''Transcluded from [[{{{1|{{FULLPAGENAME}}/doc}}}]]''
{{{{PAGENAME}}/doc}}
{{{{{1|{{PAGENAME}}/doc}}}}}
|}
|}
Revision as of 13:49, 18 June 2024
Template documentation
Transcluded from Template:Documentation/doc
This template is meant to be included in a <noinclude> block at the end of a template with documentation located in the /doc subpage. This subpage is then transcluded inside a green box in the template page, as with this very text, when read from the main template page. One can use different content by setting the content argument. If there are positional arguments present, these will be used to form a list in the transcluded from notice, rather than the default /doc subpage. For example:
Transcluded from Template:Documentation page/doc
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:
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]]}}
Often templates based on a meta-template will large parts of the documentation, or even the entire documentation, in common. Thus, one can move the common part to a subpage (typically "/doc template", in order to distinguish it from the documentation of the meta-template itself). That subpage could be structured as follows:
<noinclude>{{Documentation page|meta=1}}</noinclude><!---->Your text goes here. Here is a template argument: {{{1}}}.<!----><includeonly>{{#if:{{{nocat|}}}||[[Category:Category for derived templates]]}}</includeonly><noinclude>[[Category:Meta-templates]]</noinclude>