Topic on Help talk:TemplateData

Documenting Lua modules

4
Summary by 197.218.87.157
Adamw (talkcontribs)

Will TemplateData be used to document Lua? Can VisualEditor use TemplateData to give hints for module invocation?

Whatamidoing (WMF) (talkcontribs)

Are you meant to be invoking a module directly?

Adamw (talkcontribs)

Good point, thanks! There's already a /doc subpage (e.g. [1]) for the module itself, and that's all we need.

It's the functions within a module which can be invoked from wikitext, these take parameters, and this is where we would need the structured documentation. I'm not sure how we could provide these docs (or maybe editors feel this is not lacking?). LDoc and maybe other syntaxes would be appropriate for inlining docs in the source code, but wouldn't cover our use case. We pass an opaque frame and it's the args arguments within that define the module's MediaWiki interface. We also need a way to indicate which functions are meant to be public.

Needless to say, however we (if we) decide on a syntax, it should be machine-parsable so it can be leveraged by VisualEditor and other tools.

Reply to "Documenting Lua modules"