Template:Documentation: Difference between revisions
Create template for wrapping template documentation; based on the output of mw:Template:Documentation |
Speedybrain (talk | contribs) No edit summary |
||
| Line 1: | Line 1: | ||
<onlyinclude><div id="template-documentation" class="tpl-doc | <onlyinclude><templatestyles src="Documentation/styles.css" /><div id="template-documentation" class="tpl-doc"> | ||
<div class="tpl-doc-header"> | |||
<div class="tpl-doc-heading">{{dt|{{SUBJECTSPACE}}|Content}} documentation</div> | |||
<div class="mw-editsection-like plainlinks"><!-- | |||
"> | |||
<div class="tpl-doc-header | |||
"> | |||
<div class="tpl-doc-heading | |||
">{{dt|{{SUBJECTSPACE}}|Content}} documentation</div> | |||
<div class="mw-editsection-like plainlinks | |||
"><!-- | |||
-->[[[:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}|view]]] <!-- | -->[[[:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}|view]]] <!-- | ||
-->[[{{fullurl:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}|action=edit}} edit]] <!-- | -->[[{{fullurl:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}|action=edit}} edit]] <!-- | ||
| Line 30: | Line 9: | ||
--></div> | --></div> | ||
</div> | </div> | ||
<div class="tpl-doc-content | <div class="tpl-doc-content"> | ||
"> | |||
{{:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}}} | {{:{{dt|{{{1|}}}|{{FULLPAGENAME}}/doc}}}} | ||
<div style="clear: both;"></div></div> | <div style="clear: both;"></div></div> | ||
</div></onlyinclude> | </div></onlyinclude> | ||
Latest revision as of 01:40, 7 October 2026
Shows a template's documentation in a box under the template: the content of its /doc subpage, with links to view, edit and see the history of that subpage, and to purge the page. Based on the output of mediawiki.org's Template:Documentation.
Usage
Put this at the end of the template, after its code:
<noinclude>{{Documentation}}</noinclude>
Then write the documentation on the template's /doc subpage, such as Template:Crafting/doc. On that subpage, categories for the template go inside <includeonly>, and categories for the subpage itself inside <noinclude>.
1: a different page to show instead of the/docsubpage, such as documentation shared by several templates.
The heading names the namespace: "Template documentation", or "Content documentation" in the main namespace. Lua modules don't need this template: Scribunto shows Module:Name/doc above the module's code by itself.