Template:Documentation page/doc: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[checked revision][checked revision]
Content added Content deleted
(add nocat option)
(add notes on how to write documentation page)
Line 1: Line 1:
<noinclude>{{Documentation page}}</noinclude>
<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:
-->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}}
{{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]]}}

Revision as of 21:20, 18 June 2024

This is a template documentation page

This template is meant to be included in a <noinclude> 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 nocat). There is also the meta parameter for documentation pages meant as templates for other documentation pages. Setting this parameter produces following:

This is a template documentation page
This is a template for the documentation of templates based on Template:Documentation page.

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 {{Documentation}}. Template categories should be added to the documentation page and be transcluded by the main template page. Keep in mind to add a nocat option to template documentation pages:

<noinclude>{{Documentation page}}</noinclude><!--
-->Your text goes here.<!--
-->{{#if:{{{nocat|}}}||[[Category:Some cool category]]}}