Template:Template documentation/doc: Difference between revisions

From TestWiki
Content added Content deleted
mNo edit summary
mNo edit summary
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
The template <span style="font-family:&quot;Consolas&quot;, monospace;">{{[[Template:Template documentation|Template documentation]]}}</span> calls subroutine doc from [[Module:Template documentation|Module Template documentation]].
<onlyinclude>The template <span style="font-family:&quot;Consolas&quot;, monospace;">{{[[Template:Template documentation|Template documentation]]}}</span> calls subroutine doc from [[Module:Template documentation|Module Template documentation]]. It implements a template documentation that updates automatically when the template is edited.
== Documentation subpage==
Insert following text into the documentation subpage and fill in the parameters
<pre><nowiki>&#123;&#123;&#35;invoke:Template documentation&#124;dokuseite&#125;&#125;
<onlyinclude>
&#123;&#123;&#35;invoke:Template documentation&#124;doku
&#124;p1=1&#124;t1=&#124;d1=&#124;m1=&#124;f1=<!-- p: name of parameter; t: description; d: default; m: m=1 when mandatory; f=following line; g=another following line -->
&#124;p2=2&#124;t2=&#124;d2=&#124;m2=&#124;f2=
&#124;count=<!-- number of parameters -->
&#124;omp=<!-- add when should not rendered without params -->
&#124;text=is missing description <!-- add description here -->
&#124;aw1=<!-- add example 1, params seperated by , oder ; change the with trennzeichen=* -->
&#124;rubrik= <!-- add the group name = name of template that creates group list -->
&#124;tabwidth=
&#124;descwidth=
&#124;namewidth=
&#124;defwidth=
&#124;mandwidth=
&#124;norender=
&#124;noexpand=&#125;&#125;</onlyinclude</nowiki>></pre>
== Documentation preload page ==
Create a [[Template:Template documentation/preload-doc|preload page]] with following content
<pre><nowiki>
&lt;includeonly>&lt;onlyinclude>{{#invoke:Template documentation|dokuseite}}
&lt;onlyinclude<noinclude />>
{{#invoke:Template documentation|doku
|p1=1|t1=|d1=|m1=|f1=<!-- p: name of parameter; t: description; d: default; m: m=1 when mandatory; f=following line; g=another following line -->
|p2=2|t2=|d2=|m2=|f2=
|count=<!-- number of parameters -->
|omp=<!-- add when should not rendered without params -->
|text=is missing despreption <!-- add description here -->
|aw1=<!-- add example 1, params seperated by , oder ; change the with trennzeichen=* -->
|rubrik= <!-- add the group name = name of template that creates group list -->
|tabwidth=
|descwidth=
|namewidth=
|defwidth=
|mandwidth=
|norender=
|noexpand=}}&lt;/onlyinclude&lt;noinclude />>&lt;/onlyinclude>&lt;/includeonly>
<div style="background-color: #aaa;width:90%; border-radius: 1em; box-shadow: 0.1em 0.1em 0.5em rgba(0,0,0,0.75);;padding:0.5em;"><div style="background-color: #fff;padding:1em; border-radius: 0.5em;"><code style="white-space:pre-wrap">{{msgnw:Template:Template documentation/preload-doc}}
</code></div></div>
</nowiki></pre>
</onlyinclude>
<noinclude>__NOEDITSECTION__</noinclude>

Latest revision as of 08:58, 25 January 2021

The template {{Template documentation}} calls subroutine doc from Module Template documentation. It implements a template documentation that updates automatically when the template is edited.

Documentation subpage

Insert following text into the documentation subpage and fill in the parameters

{{#invoke:Template documentation|dokuseite}}
<onlyinclude>
{{#invoke:Template documentation|doku
|p1=1|t1=|d1=|m1=|f1=<!-- p: name of parameter; t: description; d: default; m: m=1 when mandatory; f=following line; g=another following line -->
|p2=2|t2=|d2=|m2=|f2=
|count=<!-- number of parameters -->
|omp=<!-- add when should not rendered without params -->
|text=is missing description <!-- add description here -->
|aw1=<!-- add example 1, params seperated by , oder ; change the with trennzeichen=* -->
|rubrik= <!-- add the group name = name of template that creates group list -->
|tabwidth=
|descwidth=
|namewidth=
|defwidth=
|mandwidth=
|norender=
|noexpand=}}</onlyinclude>

Documentation preload page

Create a preload page with following content

<includeonly><onlyinclude>{{#invoke:Template documentation|dokuseite}}
<onlyinclude<noinclude />>
{{#invoke:Template documentation|doku
|p1=1|t1=|d1=|m1=|f1=<!-- p: name of parameter; t: description; d: default; m: m=1 when mandatory; f=following line; g=another following line -->
|p2=2|t2=|d2=|m2=|f2=
|count=<!-- number of parameters -->
|omp=<!-- add when should not rendered without params -->
|text=is missing despreption <!-- add description here -->
|aw1=<!-- add example 1, params seperated by , oder ; change the with trennzeichen=* -->
|rubrik= <!-- add the group name = name of template that creates group list -->
|tabwidth=
|descwidth=
|namewidth=
|defwidth=
|mandwidth=
|norender=
|noexpand=}}</onlyinclude<noinclude />></onlyinclude></includeonly>
<div style="background-color: #aaa;width:90%; border-radius: 1em; box-shadow: 0.1em 0.1em 0.5em rgba(0,0,0,0.75);;padding:0.5em;"><div style="background-color: #fff;padding:1em; border-radius: 0.5em;"><code style="white-space:pre-wrap">{{msgnw:Template:Template documentation/preload-doc}}
</code></div></div>