Jump to content

Template:Documentation: Difference between revisions

From NixOS Wiki
DoggoBit (talk | contribs)
No edit summary
DoggoBit (talk | contribs)
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
   |color=initial
   |color=initial
   |backgroundColor=var(--background-color-notice-subtle)
   |backgroundColor=var(--background-color-notice-subtle)
   |borderColor=var(--border-color-notice)
   |borderColor=var(--border-color-muted)
  |wikiContent=yes
   |
   |
==Template Documentation <span class="mw-editsection" style="pointer-events: initial";><span class="mw-editsection-bracket">[</span>[https://wiki.nixos.org/w/index.php?title={{FULLPAGENAMEE}}/Doc&amp;action=edit <span>edit source</span>]<span class="mw-editsection-bracket">]</span></span>==
==Template Documentation <span class="mw-editsection" style="pointer-events: initial";><span class="mw-editsection-bracket">[</span>[https://wiki.nixos.org/w/index.php?title={{FULLPAGENAMEE}}/Doc&amp;action=edit <span>edit source</span>]<span class="mw-editsection-bracket">|</span>&nbsp;[[Special:Whatlinkshere/{{FULLPAGENAME}}|uses]]<span class="mw-editsection-bracket">|</span>&nbsp;[[Help:Templates|help]]<span class="mw-editsection-bracket">]</span></span>==


{{/Doc}}
{{/Doc}}

Latest revision as of 14:17, 11 June 2025

Template Documentation [edit source| uses| help]

This template is used for providing documentation for templates. It will "grab" the documentation from the /Doc subpage under the template it's used for. For example, using it on Template:Documentation would grab the documentation from Template:Documentation/Doc.

Usage

In general, the documentation should not be part of the template itself, thus you might want to do follow this general pattern:

<includeonly>
  <!-- Template-specific code -->
<noinclude>{{Documentation}}</noinclude>

Writing the documentation

It is generally a good idea to write the documentation before applying this template to the page you are working on. In this way, you're avoiding displaying the missing red link for anyone while your work is in progress.

Keep in mind that all documentation headings should be one level lower than what you'd normally write, because the heading Template Documentation is a level 2 header already. For example, a documentation outline might be:

Some introduction text...

=== Usage ===

Information about how to use your template...

=== Parameters ===

Available options and parameters...

=== Technical details ===

Any technical information about the template's implementation under the hood...

Template data

Provide documentation for a template, under the /Doc subpage

Template parameters[Edit template data]

ParameterDescriptionTypeStatus
No parameters specified