Template:Documentation/doc: Difference between revisions

From Xenharmonic Wiki
Jump to navigation Jump to search
ArrowHead294 (talk | contribs)
mNo edit summary
ArrowHead294 (talk | contribs)
mNo edit summary
Line 19: Line 19:
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:


{{escape notice}} Additionally, when {{tlx|lua}} is used on a module documentation page to indicate dependencies, each paragraph of text may need to be encased in its own paragraph (<code>&lt;p&gt;)</code> element:
{{escape notice}}  


<pre>
<pre>
Line 27: Line 27:
}}
}}
</pre>
</pre>
Additionally, when {{tlx|lua}} is used on a module documentation page to indicate dependencies, the first paragraph paragraph of text after the Lua banner may need to be encased in its own paragraph (<code>&lt;p&gt;)</code> element:


<pre>
<pre>
Line 32: Line 34:
{{dochead}}{{lua|...|...|}}
{{dochead}}{{lua|...|...|}}
<p>Paragraph 1</p>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
 
<p>Paragraph 3</p>
Paragraph 2
 
Paragraph 3
...
...
}}
}}

Revision as of 12:08, 19 May 2025

English Wikipedia has an article on:

The {{documentation}} template is used to contain information and instructions for templates and modules. The actual information is located in the /doc subpage.

Wikipedia's documentation template has modules that help render the dialog boxes, but here the box is hard-coded to simplify things.

Templates

On templates, place {{documentation}} on the page itself, place the relevant categories afterwards, and enclose them in <noinclude> tags:

<noinclude>
{{documentation}}

[[Category: ...]]
...
</noinclude>

Modules

On pages consisting of exclusively code (modules, CSS, JS, etc), place this template on the /doc subpage and pass the notes, along with {{dochead}}, in as the first unnamed parameter:

Note: Pipe characters (|) must be escaped as {{!}} or {{pipe}}, equals signs must be escaped as {{=}} (this may apply to tags as well, e.g. <div style{{=}}"…">), and other special characters and character sequences may need to be escaped accordingly, except for ones inside <nowiki>, <pre>, <math>, and <syntaxhighlight> tags.

{{documentation|
{{dochead}}
...
}}

Additionally, when {{lua}} is used on a module documentation page to indicate dependencies, the first paragraph paragraph of text after the Lua banner may need to be encased in its own paragraph (<p>) element:

{{documentation|
{{dochead}}{{lua|...|...|}}
<p>Paragraph 1</p>

Paragraph 2

Paragraph 3
...
}}

Wikipedia has Module:Documentation which takes care of things automatically, but here, this is used as a workaround to avoid the need for modules.

See also

  • Template:Dochead – used to categorise and add appropriate headers onto documentation pages.