Template:Documentation/doc: Difference between revisions
ArrowHead294 (talk | contribs) m →Modules |
m Cleanup |
||
Line 1: | Line 1: | ||
{{ | {{Dochead}}{{wikipedia}} | ||
The <code> | The <code><nowiki>{{documentation}}</nowiki></code> template is used to contain information and instructions for templates and modules. The actual information is located in the <code>/doc</code> subpage. | ||
Wikipedia's documentation template has modules that help render the dialog boxes, but here the box is hard-coded to simplify things. | Wikipedia's documentation template has modules that help render the dialog boxes, but here the box is hard-coded to simplify things. | ||
__NOTOC__ | __NOTOC__ | ||
=== Templates === | === Templates === | ||
On templates, place <code> | On templates, place <code><nowiki>{{documentation}}</nowiki></code> on the page itself, place the relevant categories afterwards, and enclose them in <code><nowiki><noinclude></nowiki></code> tags: | ||
<pre> | <pre> | ||
<noinclude> | <noinclude> | ||
{{ | {{Documentation}} | ||
[[Category: | [[Category: …]] | ||
… | |||
</noinclude> | </noinclude> | ||
</pre> | </pre> | ||
=== Modules === | === Modules === | ||
On pages consisting of exclusively code (modules, CSS, JS, etc), place this template on the <code>/doc</code> subpage and pass the notes, along with {{tlx|dochead}}, in as the first unnamed parameter: | On pages consisting of exclusively code (modules, CSS, JS, etc.), place this template on the <code>/doc</code> subpage and pass the notes, along with {{tlx|dochead}}, in as the first unnamed parameter: | ||
<pre> | <pre> | ||
{{ | {{Documentation| | ||
{{ | {{Dochead}} | ||
… | |||
}} | }} | ||
</pre> | </pre> | ||
Additionally, when {{tlx|lua}} is used on a module documentation page to indicate dependencies, the first | {{Escape notice}} | ||
Additionally, when {{tlx|lua}} is used on a module documentation page to indicate dependencies, the first paragraph of text after the Lua banner may need to be encased in its own paragraph (<code><nowiki><p></nowiki></code>) element since otherwise the MediaWiki parser may fail to render the paragraphs correctly: | |||
<pre> | <pre> | ||
{{ | {{Documentation| | ||
{{ | {{Dochead}}{{lua|…|…|}} | ||
<p>Paragraph 1</p> | <p>Paragraph 1</p> | ||
Line 38: | Line 38: | ||
Paragraph 3 | Paragraph 3 | ||
… | |||
}} | }} | ||
</pre> | </pre> | ||
Wikipedia has {{w|Module:Documentation}} which takes care of things automatically, but here, these are used as workarounds to avoid the need for modules. | Wikipedia has {{w|Module: Documentation}} which takes care of things automatically, but here, these are used as workarounds to avoid the need for modules. | ||
=== See also === | === See also === | ||
* [[Template:Dochead]] – used to categorise and add appropriate headers onto documentation pages. | * [[Template: Dochead]] – used to categorise and add appropriate headers onto documentation pages. |