Template:Documentation/doc: Difference between revisions
[unchecked revision] | [unchecked revision] |
mNo edit summary |
m comment out newline |
||
(6 intermediate revisions by the same user not shown) | |||
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 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. |
-->This template is meant to be included in a <code><nowiki><noinclude></nowiki></code> 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 <code>content</code> 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: |
||
<syntaxhighlight lang="mediawiki"> |
|||
{{Documentation|Template:Documentation page/doc|Template:Redirect page/doc|content= |
|||
== Documentation page documentation == |
|||
{{Documentation page/doc}} |
|||
== Redirect page documentation == |
|||
{{Redirect page/doc}} |
|||
}} |
|||
</syntaxhighlight> |
|||
Will produce: |
|||
{{Documentation|Template:Documentation page/doc|Template:Redirect page/doc|content= |
|||
== Documentation page documentation == |
|||
{{Documentation page/doc|nocat=1}} |
|||
== Redirect page documentation == |
|||
{{Redirect page/doc|nocat=1}} |
|||
}}<!-- |
|||
-->{{#if:{{{nocat|}}}||[[Category:Meta-templates]]}} |
Latest revision as of 21:23, 18 June 2024
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:
{{Documentation|Template:Documentation page/doc|Template:Redirect page/doc|content=
== Documentation page documentation ==
{{Documentation page/doc}}
== Redirect page documentation ==
{{Redirect page/doc}}
}}
Will produce:
Template documentationTranscluded from Template:Documentation page/doc and Template:Redirect page/doc Documentation page documentationThis template is meant to be included in a This is a template documentation page This is a template for the documentation of templates based on Template:Documentation.
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 <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>
Redirect page documentationThis template serves as a base for all redirect pages. Without any arguments, it produces the message box on the top of the page, and the redirect in question is automatically categorized in Category:Uncategorized redirects (which can be disabled by setting the {{Redirect page|
{{R to project page}}
}}
Will produce: This page is a redirect. This redirect is categorized in following manner:
|