"ৱিকিপিডিয়া:সাঁচ নথিকৰণ"ৰ বিভিন্ন সংশোধনসমূহৰ মাজৰ পাৰ্থক্য

সম্পাদনা সাৰংশ নাই
(ৰবট যোগ দিছে :no:Wikipedia:Maldokumentasjon)
{{Wikipedia how to|WP:DOC}}
 
[[Help:Template|Templates]] are a very powerful feature of [[MediaWiki]], but can be confusing to new users and even experienced users can have difficulty making sense of the more complex ones. Templates should therefore be accompanied by '''[[documentation]]''' to improve usability.
 
Template documentation should explain what a template does and how to use it. It should be simple enough that a user without complete knowledge of the intricacies of template syntax – which includes many experienced contributors who focus their attention elsewhere – can use it correctly. This is especially true in the case of very widely-used templates.
 
* The '''basic purpose''' of the template: what it does and if it is not immediately obvious, why it needs to be done. If there are other templates with similar names or purposes, it's a good idea to mention those, in order to reduce the chance of the wrong one being used.
* The '''[[Help:Templates#Parameters|parameters]]''' of the template: whether they are numbered, named or optional, and if so, what the default values are and what effect they have. If a parameter can take only a limited set of values or is constrained in any way, for example, if it can only use: “yes”"yes", “no”"no", or a number, this should be clearly explained.
* '''Usage examples''': specify the exact wikitext that should be used and the result that it produces. The wikitext can be enclosed in a {{nowraptag|<code><nowiki><code>…</code></nowiki></code>}} container, to make it clear and <code>easy to copy, like this</code>. If the template can be used in several different ways, with or without optional parameters, for example, provide a range of examples. A good way to do so is to transclude the template itself into the documentation a few times (i.e., use live examples), with different parameters each time and list the parameters used in each case. With [[Template:Xpd]] this can be done without putting the template call twice in the wikitext.
* '''Related templates''': if the template is one of a series of templates, include links to these – in particular, ensure that every template in the series is linked from each of the others, as this makes navigation easier. (A separate navigation template may be useful for this purpose, see: [[Template:Protection templates]]).
* '''[[Wikipedia:Categorization|Categories]]''' and '''[[Wikipedia:InterWikimedia links|InterWikimedia links]]''', where applicable. Like the documentation, these must be within a {{nowraptag|<code><nowiki>&lt;noinclude>…&lt;/noinclude></nowiki></code>}} container. Many template categories are available, see: [[:Category:Wikipedia templates]] to browse through them.
 
Template documentation is often placed in a [[Wikipedia:Subpages|subpage]] of the template itself, which is then [[Wikipedia:Transclusion|transcluded]] at the end of the template page. This separates the often complex template code from the documentation, making the documentation easier to edit. It also allows templates to be [[Wikipedia:Protection policy|protected]] where necessary, while allowing anyone to edit the documentation. This method is sometimes referred to as the “template"template doc page pattern”pattern".
 
Documentation of any sort on a template page should always be enclosed by a {{nowraptag|<code><nowiki>&lt;noinclude>…&lt;/noinclude></nowiki></code>}} container, so that it does not show up when the template is used on another page. Text on the template page itself adds to the amount of text that must be processed when displaying the template, which is [[Wikipedia:Template limits|limited]] for performance reasons. Placing the documentation in a subpage avoids this (MediaWiki developers have <span class="plainlinks">[http://en.wikipedia.org/w/index.php?title=Wikipedia:Village_pump_(technical)&diff=prev&oldid=69888944recommended69888944 recommended]</span> it for this reason).
 
==How to create a documentation subpage==
Suppose your template is named <code>Template:X</code>. Create a subpage with the name <code>Template:X/doc</code>. See the details at {{tl|Documentation subpage}} or copy-paste the following wikitext as a start for your documentation:
 
<!--This code block is copy-pasted from [[Template:Documentation/preload]];
<pre>
check it periodically for updates and copy it here again if necessary,
and fix the "<include<includeonly></includeonly>only>" escaping in it.--><pre>
{{Documentation subpage}}
<!-- PLEASECategories ADDand CATEGORIESinterwikis ANDgo INTERWIKISat ATthe THEbottom BOTTOMof OFthis THIS PAGEpage. -->
 
=== Usage ===
 
== See also ==
&lt;includeonly><!-- CATEGORIES AND INTERWIKIS HERE, THANKS -->
 
&lt;/<includeonly>
<!-- Categories and interwikis go here: -->
 
</includeonly>
</pre>
 
The top line will display a message explaining the current page and a link to the template page.
 
Insert the documentation after the top line and categories and interwikis under the appropriate comment line – leaving the comment in place, so that the layout is preserved when the page is edited in future. The subpage template sets a <nowiki>{{DEFAULTSORT:{{PAGENAME}}}}</nowiki>, ensuring that a <code>Template:X</code> will be properly sorted at "X" and not "T", it is thus not useful or desirable to add a <nowiki>{{PAGENAME}}</nowiki> sortkey to the categories. Related templates, policy page, projects, etc. can be linked to under "See also", or just comment-out this section heading if it isn't needed (yet): <code><nowiki><!-- ==See also == --></nowiki></code>
 
Save the subpage and return to the template itself, <code>Template:X</code>, in this example. Edit the template and append the following at the end of the template code:
 
{{Colors|black|#CCC|''{{var|[--last line of your template code--]''}}}}<nowiki>&lt;noinclude>
 
{{Documentation}}
This will transclude {{tl|Documentation}} at the bottom of the template page.
 
'''Important''': Make sure the opening <code><nowiki>&lt;{{tag|noinclude></nowiki></code>|o}} begins onimmediately the same line asafter the last character of the template code or text and ''not'' on a new line, nor with any intervening spaces. Otherwise, extra space will be inserted below the template when it is used, which is usually not wanted.
 
If the template is already protected, ask an [[Wikipedia:Administrators|administrator]] to do this or request an edit by using an {{tl2|Editprotected}} on the template's talk page. If documentation, categories and interwiki links already exist in a section, enclosed within a {{nowraptag|<code><nowiki>&lt;noinclude>…&lt;/noinclude></nowiki></code>}} container, move them into the documentation subpage (where they should be enclosed in {{tag|includeonly}}), as it is best not to have documentation split across two separate pages.
 
If the code is put on the template page first, one can benefit from the [[mw:Extension:InputBox#Parameters|preload]] feature to get a pre-filled doc page skeleton; if the documentation page does not exist yet, clicking the edit link on the template page will preload the contents of [[Template:Documentation/preload]] into the editbox of the /doc subpage creation.
 
You may wish to redirect the talk page of the /doc subpage to the talk page of the template itself. Then all talk relating to the template and its documentation will end up on the same talkpage. For example, redirect <code>Template talk:X/doc</code> to <code>Template talk:X</code>.
 
==Categories and interwiki links==
* '''To place the template itself into a category''', add the <code><nowiki>[[Category:Category name]]</nowiki></code> code inside an <code><nowiki><includeonly></nowiki></code>...<code><nowiki></includeonly></nowiki></code> section on the ''doc'' subpage.
 
* '''To create an interwiki link for the template itself''', add the <code><nowiki>[[Languagecode:Template name]]</nowiki></code> code inside an <code><nowiki><includeonly></nowiki></code>...<code><nowiki></includeonly></nowiki></code> section on the ''doc'' subpage.
 
* '''To place the ''doc'' subpage into a category''', add the <code><nowiki>[[Category:Category name]]</nowiki></code> code inside a <code><nowiki><noinclude></nowiki></code>...<code><nowiki></noinclude></nowiki></code> section on the ''doc'' subpage.
==Stub templates==
Stub templates are one of the very rare forms of template that do not generally have documentation. As all stub templates operate in identical ways, they could theoretically be linked to one documentation page giving instruction for their use. This is, however, regarded as superfluous, since all stub templates already contain a link to [[Wikipedia:Stub]], which more thoroughly covers all the information that would normally be covered by a documentation page.
 
== Tips & tricks ==
Here's some tips to facilitate writing documentations.
* Links to templates like {{tlp|Japanese year|1800}} can be inserted by writing {{tlp|tlp|Japanese year|1800}}. See {{tl|tlp}} for similar templates.
* HTML tags like {{tag|ref|params=group{{=}}"note"}} can be easily inserted with {{tl|tag}}. This example is written as {{tlp|tag|ref|params{{=}}group{{=}}"note"}}
* Equals sign '''=''' can be inserted with {{tn|{{=}}}}. For example, {{tlp|Citation needed|date{{=}}1900-02-29}} is made by {{tlp|tlp|Citation needed|date{{<nowiki />=}}1900-02-29}}. Avoid the equivalent notation &amp;#61; which is not easy to read for other editors.
* Don't forget the single {{tag|nowiki|s}} tag. [[<nowiki />{{tag|nowiki|s}}example]] becomes [[<nowiki />example]], and [<nowiki />{{tag|nowiki|s}}http://en.wikipedia.org no link] is [<nowiki />http://en.wikipedia.org no link]. See [[WP:NOWIKI]] for the details.
* For a link to a category, use {{tl|cat}}. For example {{tlp|cat|Templates with incorrect parameter syntax}} becomes {{cat|Templates with incorrect parameter syntax}}.
 
==See also==
* {{tl|Documentation}} – Transcludes the documentation on the template page, and provides documentation view, edit and history links
* {{tl|Documentation subpage}} – Explains that what follows is documentation, and links to the documented page
* [[m:Help:Templates#Noinclude, includeonly, and onlyinclude|<TT>&lt;{{tag|noinclude&gt;</TT>|o}} and <TT>&lt;{{tag|includeonly&gt;</TT>|o}}]]
* {{tl|Template reference list}}
* [[Wikipedia:High-risk templates]]
* [[Wikipedia:Template test cases]]
 
[[Category:Wikipedia templates|{{PAGENAME}}]]
<!--Categories-->
[[Category:Template documentation| <!--SPACE-->]]
[[Category:ৱিকিপিডিয়া সাঁচসমূহ|{{PAGENAME}}]]
[[Category:সাঁচ নথিকৰণ| ]]
 
<!--Interwikies-->
 
[[ar:ويكيبيديا:توثيق قالب]]
[[en:Wikipedia:Template documentation]]
[[fa:ویکی‌پدیا:مستندسازی الگوها]]
[[hu:Wikipédia:Sablondokumentáció]]
[[id:Wikipedia:Dokumentasi templat]]
[[hu:Wikipédia:Sablondokumentáció]]
[[ja:Help:テンプレートの説明文]]
[[mk:Википедија:Документирање на шаблон]]
[[mr:विकिपीडिया:साच्यांचे दस्तऐवज]]
[[ne:विकिपीडिया:Template doc page pattern]]
[[no:Wikipedia:Maldokumentasjon]]
[[ja:Help:テンプレートの説明文]]
[[pt:Wikipédia:Documentação da predefinição]]
[[sl:Wikipedija:Dokumentacija predloge]]
[[te:వికీపీడియా:మూస డాకుమెంటేషన్]]
[[tr:Vikipedi:Şablon belgelemesi]]
[[uk:Вікіпедія:Документація шаблонів]]
[[ur:منصوبہ:دستاویزی سانچہ]]
বেনামী ব্যৱহাৰকাৰী