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

Updating/reworking the doc since the template has been updated. Intermediate save.
Updating more. Intermediate save.
വരി 10:
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.
 
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.
=== Normal /doc ===
 
=== Normal /docUsage ===
 
Normally this template is used without any parameters and placed at the bottom of the template or page being documented, in a <noinclude> section. Like this:
Line 23 ⟶ 25:
 
Then this template automatically loads the content from the /doc subpage of the template it is used on.
 
=== Any /doc page ===
 
This template can be told to load the content from any other page. Like this:
വരി 35:
</pre>
 
ButNote that when doingloading the documentation from another page than the local /doc sopage it becomes tricky to handle the categories and interwiki links.
 
=== In-line content ===
 
The content can also be fed directly as text. Like this:
Line 50 ⟶ 48:
</pre>
 
When the '''content''' parameter is used the doc box normally doesn't get the [edit] [purge] links in the top right corner, and no link to a /doc page is shown in the link box below the doc box.
=== In-line content with [edit][purge] links ===
 
But parameter 1 and the '''content''' parameter can also be combined, like this:
 
<pre>
വരി 57:
{{documentation
| 1 = Template:Any page/doc
| content = {{Template:Any page/doc| parameters }}
}}
</noinclude>
</pre>
 
Then the pagename fed as parameter 1 is used for the [edit] [purge] links and for the /doc link in the link box below the doc box. But the '''content''' parameter is used for the content shown in the doc box. The above code means that the content is transcluded as "<code><nowiki>{{Template:Any page/doc|parameters}}</nowiki></code>". In this example a parameter is also fed to the /doc page being loaded.
 
=== Best practice ===
Line 73 ⟶ 75:
 
When in Template space this template shows this heading:
:[[File:Template-info.svg|35px32px]] '''Template documentation'''
 
In most other namespaces, such as "Wikipedia:", it shows this heading:
Line 81 ⟶ 83:
:'''Summary'''
 
The '''heading''' parameter can be used to set the heading to something else. Like this:
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.
 
:<code><nowiki>{{documentation| heading = Infobox documentation }}</nowiki></code>
=== Automatic functions ===
 
If the '''heading''' parameter is empty but defined, no heading is shown and no [edit] [purge] links are shown. Like this:
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}}.
 
:<code><nowiki>{{documentation| heading = }}</nowiki></code>
When this template is on a /sandbox subpage it automatically adds the {{tl|template sandbox notice}}.
 
=== Automatic functions ===
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.
 
If the documentation page doesn't exist, the "edit"[create]] 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 ===
 
When this template is on a protected template page it now automatically adds {{tl|pp-template}} thatwhich 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}}.
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.
 
When this template is on a /sandbox subpage it automatically adds the {{tl|template sandbox notice}}.
 
=== See also ===
"https://ml.wikipedia.org/wiki/ഫലകം:Documentation/doc" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്