"ഫലകം:Documentation/doc" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Optimised Code
Updating/reworking the doc since the template has been updated. Intermediate save.
വരി 1:
{{documentation subpage}}
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE -->
__NOTOC__
This template automatically displays a documentation box like you are seeing now, of which the content is transcluded from another page. It is intended for pages which are [[Wikipedia:Transclusion|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.
 
This is the {{tl|documentation}} template.
== Usage ==
 
Place one of the following transclusions into the page that is being documented.
For most of the instructions about how and when to use this template, see [[Wikipedia:Template documentation]].
 
This template displays a documentation box like you are seeing now, and automatically loads the content from a /doc subpage. It can also load the content from other places if instructed to.
 
This template is intended for documenting templates and other pages which are [[Wikipedia:Transclusion|transcluded]] onto other pages. It can be used in template space and most other namespaces.
 
=== Normal /doc ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}&#125;&#125;&lt;/noinclude&gt;
Normally this template is used without any parameters and placed at the bottom of the template or page being documented, in a &lt;noinclude> section. Like this:
 
<pre>
<!--Last line of your template code--><noinclude>
 
{{documentation}}
<!-- Add categories and interwikis to the /doc subpage, not here! -->
</noinclude>
</pre>
 
Then this template automatically loads the content from the /doc subpage of the template it is used on.
 
=== Any /doc page ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}|Template:any page/doc&#125;&#125;&lt;/noinclude&gt;
This template can be told to load the content from any other page. Like this:
 
<pre>
<!--Last line of your template code--><noinclude>
 
{{documentation|1 = Template:anyOther page/doc}}
</noinclude>
</pre>
 
But when doing so it becomes tricky to handle the categories and interwiki links.
 
=== In-line content ===
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}|content=This is documentation.&#125;&#125;&lt;/noinclude&gt;
 
The content can also be fed directly as text. Like this:
=== In-line content with [view][edit] links ===
 
&lt;noinclude&gt;&#123;&#123;{{{template-name|Documentation}}}
<pre>
|1 = Template:any page/doc
<!--Last line of your template code--><noinclude>
|content =&#123;&#123;Template:any page/doc|parameters&#125;&#125;
 
&#125;&#125;&lt;/noinclude&gt;
{{documentation
| content = Some documentation text.
}}
</noinclude>
</pre>
 
=== In-line content with [viewedit][editpurge] links ===
 
<pre>
<!--Last line of your template code--><noinclude>
 
{{documentation
| 1 = Template:Any page/doc
| content =&#123;&#123; {{Template:anyAny page/doc| parameters&#125;&#125; }}
}}
</noinclude>
</pre>
 
=== Best practice ===
This code should be added at the bottom of the template code, with no extra space before "<code>&lt;noinclude&gt;</code>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.
 
ThisThe code should be added at the bottom of the template code, with no extra space before "<code>&lt;noinclude&gt;></code>" (which would cause extra space on pages where the template is used). The parameter can be used as shown above to transclude an arbitrary documentation page.
Categories and interwiki links that apply to the template itself should be added to the documentation page, inside <code>&lt;includeonly&gt; &lt;/includeonly&gt;</code> tags. For more complex cases, see [[Wikipedia:Template documentation#Categories and interwiki links]].
 
Categories and interwiki links that apply to the template itself should be added to the documentation/doc pagesubpage, inside <code>&lt;includeonly&gt; >&lt;/includeonly&gt;></code> tags. For more complex cases, see [[Wikipedia:Template documentation#Categories and interwiki links]].
If the documentation page contains includeonly or noinclude tags as part of the documentation, replace the "<" with "&amp;lt;" and the ">" with "&amp;gt;".
 
If the documentation page contains &lt;includeonly> or &lt;noinclude> tags as part of the visible documentation text, replace the "<" with "code>&amp;lt;" and the "</code>" with "<code>&amp;gtlt;</code>".
 
=== The heading ===
 
When in Template space this template shows this heading:
:[[File:Template-info.svg|35px]] '''Template documentation'''
 
In most other namespaces, such as "Wikipedia:", it shows this heading:
:'''Documentation'''
 
But when on File (image) pages it shows this heading:
:'''Summary'''
 
=== Customizing display ===
Overrides exist to customize the output in special cases:
* <code>&#123;&#123;documentation| '''heading''' = ...&#125;&#125;</code> − change the text of the "documentation" heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.
 
=== FunctionsAutomatic functions ===
 
When this template is on a protected template page it now automatically adds {{tl|pp-template}} that shows the grey or red padlock in the top right corner. So no need to manually add {{tlf|pp-template}} to templates that use {{tl|documentation}}.
 
When this template is on a /sandbox subpage it automatically adds the {{tl|template sandbox notice}}.
 
If the documentation page doesn't exist, the "edit" link includes a [[mw:Manual:Creating pages with preloaded text|preload]] parameter so that clicking it will pre-fill the edit form with the basic documentation page format.
 
=== Rationale ===
 
Use of this template allows templates to be [[Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation, categories, and interwiki links.
 
=== See also ===
 
{{Documentation/doc/see also}}
 
<includeonly>
<!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
[[Category:Template documentation| ]]
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
"https://ml.wikipedia.org/wiki/ഫലകം:Documentation/doc" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്