Template:Documentation page/doc: Difference between revisions

Jump to navigation Jump to search
add notes on how to write documentation page
[checked revision][checked revision]
(add nocat option)
(add notes on how to write documentation page)
Line 1:
<noinclude>{{Documentation page}}</noinclude><!--
-->This template is meant to be included in a <code><nowiki><noinclude></nowiki></code> block at the start of template documentation pages, such as this one. It produces a message box and adds the documentation page to [[:Category:Template documentation]] (this can be disabled by setiing the template argument <code>nocat</code>). There is also the <code>meta</code> parameter for documentation pages meant as templates for other documentation pages. Setting this parameter produces following:
{{Documentation page|meta=1|nocat=1}}
 
{{#if:{{{nocat|}}}||[[Category:Meta-templates]]}}
When writing a template documentation page make sure to not having leading or trailing empty lines when transcluding, otherwise a larger paragraph gap than usual will be produced when transcluding through <code><nowiki>{{Documentation}}</nowiki></code>. Template categories should be added to the documentation page and be transcluded by the main template page. Keep in mind to add a <code>nocat</code> option to template documentation pages:
<syntaxhighlight lang="mediawiki">
<noinclude>{{Documentation page}}</noinclude><!--
-->Your text goes here.<!--
-->{{#if:{{{nocat|}}}||[[Category:Some cool category]]}}
</syntaxhighlight><!--
-->{{#if:{{{nocat|}}}||[[Category:Meta-templates]]}}
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu