Template:TlDoc/doc: Difference between revisions

From Citizendium
Jump to navigation Jump to search
imported>Caesar Schinas
No edit summary
imported>Caesar Schinas
mNo edit summary
Line 1: Line 1:
<!-- Do not remove this line. Replace the instructions below with the correct documentation. -->
<code><nowiki>{{TlDoc}}</nowiki></code> is used to include template documentation, stored on the <code>.../doc</code> [[CZ:Subpage|subpage]] of each template, when a template page is viewed directly.
 
==== Usage ====
==== Usage ====
<code><nowiki>{{TlDoc}}</nowiki></code> is used to include template documentation, stored on the <code>.../doc</code> [[CZ:Subpage|subpage]] of that template (to minimize the size of the template), when a template page is viewed directly.<br />
Wrap the call to <code><nowiki>{{TlDoc}}</nowiki></code> inside <code><nowiki><noinclude>...</noinclude></nowiki></code> tags as seen below, to prevent the documentation from being shown on pages where the template is used.
'''Important:''' Wrap the call to <code><nowiki>{{TlDoc}}</nowiki></code> inside <code><nowiki><noinclude>...</noinclude></nowiki></code> tags as seen below, to prevent the documentation from being shown on pages where the template is used.
 
==== Example ====
The following code should be used on the template page :
 
<code><nowiki><includeonly></nowiki></code><br />
<code><nowiki><includeonly></nowiki></code><br />
<b><code>...template code here...</code></b><br />
<b><code>...template code here...</code></b><br />
<code><nowiki></includeonly><noinclude>{{TlDoc}}</noinclude></nowiki></code>
<code><nowiki></includeonly><noinclude>{{TlDoc}}</noinclude></nowiki></code><br />
 
The template has one optional parameter, <code>complex</code>, which causes a message to be displayed saying that the template uses complex code.


to give the following result when the template page is viewed :


==== Examples ====
<code><nowiki>{{TlDoc}}</nowiki></code><br />
gives
{{TlDoc}}
{{TlDoc}}
<code><nowiki>{{TlDoc|complex}}</nowiki></code><br />
gives
{{TlDoc|complex}}

Revision as of 03:51, 14 June 2009

{{TlDoc}} is used to include template documentation, stored on the .../doc subpage of each template, when a template page is viewed directly.

Usage

Wrap the call to {{TlDoc}} inside <noinclude>...</noinclude> tags as seen below, to prevent the documentation from being shown on pages where the template is used. <includeonly>
...template code here...
</includeonly><noinclude>{{TlDoc}}</noinclude>

The template has one optional parameter, complex, which causes a message to be displayed saying that the template uses complex code.


Examples

{{TlDoc}}
gives

No documentation has yet been written for this template. Create Documentation


{{TlDoc|complex}}
gives

This template employs intricate features of template syntax.
You are encouraged to familiarise yourself with its setup and parser functions before editing the template.
If your edit causes unexpected problems, please undo it quickly, as this template may appear on a large number of pages.
Remember that you can and should conduct experiments and test improvements in your user space before changing anything here.
No documentation has yet been written for this template. Create Documentation