Template:Dochead/doc: Difference between revisions
No edit summary |
todo |
||
| Line 16: | Line 16: | ||
* [[Template: Documentation]] – inserts a documentation section onto a template or module. | * [[Template: Documentation]] – inserts a documentation section onto a template or module. | ||
* [[Template: Doc head Wikipedia]] – similar template, used mainly for templates borrowed from Wikipedia. | * [[Template: Doc head Wikipedia]] – similar template, used mainly for templates borrowed from Wikipedia. | ||
{{todo|update documentation|inline=1|comments=Dochead should support categories on both templates and modules. Contains multiple default messages that came up a lot that the single "use this module's corresponding template" message cannot capture.}} | |||
Revision as of 06:26, 23 October 2025
- This template is implemented by the Lua module Module:Dochead.
- This template invokes the following functions: dochead from Dochead.
This template automatically categorizes documentation by namespace, which eliminates the need to do this manually. Currently, it is configured to place modules and their documentation inside their respective categories (Category: Lua modules and Category: Module documentation).
Usage
This template is invoked by placing {{dochead}} at the top of a module or template's /doc subpage.
On modules, unless header=none is passed, a header will appear to inform users that modules should be called via templates instead of being invoked directly:
Note: Do not invoke this module directly; use the corresponding template instead: Template: {{ROOTPAGENAME}}.
where ROOTPAGENAME is a "magic word" that returns the name of the page without the namespace or subpages. This way, the link in the header will attempt to point to a template with the same name as the module, since this is mostly the case. If the template which calls the module has a different name, pass in temp= followed by the name of the template.
You can also directly specify the header using the header parameter.
See also
- Template: Documentation – inserts a documentation section onto a template or module.
- Template: Doc head Wikipedia – similar template, used mainly for templates borrowed from Wikipedia.