Template:Template rating/doc: Difference between revisions

Ganaram inukshuk (talk | contribs)
mNo edit summary
Ganaram inukshuk (talk | contribs)
mNo edit summary
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{dochead}}
{{dochead|mod=aaa}}{{substitute|no}}{{clear}}{{wikipedia}}
{{Template:Template rating|details=It works now! This template may be tested on actual templates/modules before being declared ready.}}
'''{{ARTICLEROOTPAGENAME}}''' is used to denote the rating of a template or module, namely denoting whether or not it can be used. This template is placed within the documentation page of a template, not its <code><nowiki><noinclude></noinclude></nowiki></code> block.
<hr>
 
Despite the name, this template can also be used on Lua modules' documentation pages.
 
=== Parameters ===
 
; <code>rating</code> (required; default <code>draft</code>)
: The rating of template or module.
 
; <code>namespace</code> (automatically detected using <code><nowiki>{{ARTICLESPACE}}</nowiki></code>)
: The namespace of the page. For normal use, this is automatically detected and does not need to be entered manually.
 
; <code>pagename</code> (automatically detected using <code><nowiki>{{PAGENAME}}</nowiki></code>)
: The name of the page. For normal use, this is automatically detected and does not need to be entered manually.
 
; <code>details</code> (optional)
: Any details about the template or module in question.
 
; <code>replacement</code> (required if <code>rating=replaced</code>)
: The name of the replacement template or module, if the current template or module is being replaced by a new one.
 
; <code>delete</code> (required if <code>rating=replaced</code> or <code>rating=deprecated</code>; default <code>false</code>)
: Whether to delete the template or module, if the current template or module is being either replaced or deprecated. Deprecated templates and modules are generally kept for archival and historical purposes, but those that have seen little use (such as those made for testing or with experimental features) may be deleted instead.
 
; <code>debug</code> (optional; default <code>false</code>)
: Whether to disable categories for [[Template:Category handler]]. For normal use, this should be left unchanged.
 
=== Quick copy (essential params only) ===
 
<pre>{{Template rating
| rating      =
| details    =
| replacement =
| delete      =
}}</pre>
 
=== Usage ===
 
The following examples assumes use for a template. Usage within the module namespace is automatically detected.
 
'''Draft template'''
'''Draft template'''
{{Template:Template rating|template_name=Sometemplate|rating=draft|namespace=Template|details=Other details go here.|debug=1}}
 
'''Ready''' denotes a template that is work-in-progress, or templates that are being rewritten or refactored.
 
<code><nowiki>{{Template rating|Sometemplate|rating=draft|details=Other details go here.}}</nowiki></code>
{{Template rating|Sometemplate|rating=draft|namespace=Template|details=Other details go here.|debug=1}}


'''Ready template'''
'''Ready template'''
{{Template:Template rating|template_name=Sometemplate|rating=ready|namespace=Template|details=Other details go here.}}
 
'''Ready''' denotes a template that is ready for use on the wiki. The use of this template is not necessary for most templates, as a template without any other indicators is assumed to be a ready template.
 
<code><nowiki>{{Template rating|Sometemplate|rating=ready|details=Other details go here.}}</nowiki></code>
{{Template rating|Sometemplate|rating=ready|namespace=Template|details=Other details go here.}}


'''Broken template'''
'''Broken template'''
{{Template:Template rating|template_name=Sometemplate|rating=broken|namespace=Template|details=Other details go here.|debug=1}}


'''Deprecated template, with replacement, archived'''
'''Broken''' denotes a template that is not functioning properly and is currently being fixed. For templates that work but are undergoing refactoring, use the '''draft''' rating.
{{Template:Template rating|template_name=Sometemplate|rating=deprecated|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1}}
 
<code><nowiki>{{Template rating|Sometemplate|rating=broken|details=Other details go here.}}</nowiki></code>
{{Template rating|Sometemplate|rating=broken|namespace=Template|details=Other details go here.|debug=1}}
 
'''Replaced template'''
 
'''Replaced''' denotes a template that should no longer be used and have been superseded by a new template. By default, deprecated templates are ''not'' nominated for deletion, as deleting a deprecated template makes viewing past revisions of transcluding pages much more difficult.
 
<code><nowiki>{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.}}</nowiki></code>
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1}}


'''Deprecated template, without replacement, archived'''
If a template has not been extensively used, it may be nominated for deletion by adding <code>delete=1</code>.
{{Template:Template rating|template_name=Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1}}


'''Deprecated template, with replacement, delete'''
<code><nowiki>{{Template rating|Sometemplate|rating=replaced|replacement=Somenewtemplate|details=Other details go here.|delete=1}}</nowiki></code>
{{Template:Template rating|template_name=Sometemplate|rating=deprecated|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1|delete=1}}
{{Template rating|Sometemplate|rating=replaced|namespace=Template|replacement=Somenewtemplate|details=Other details go here.|debug=1|delete=1}}


'''Deprecated template, without replacement, delete'''
'''Deprecated template'''
{{Template:Template rating|template_name=Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1|delete=1}}


<hr>
'''Deprecated''' denotes a template that should no longer be used and has no replacement.


'''Draft module'''
<code><nowiki>{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.}}</nowiki></code>
{{Template:Template rating|template_name=Somemodule|rating=draft|namespace=Module|details=Other details go here.|debug=1}}
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1}}


'''Ready module'''
As with replaced templates, deprecated templates are ''not'' nominated for deletion by default. To nominate it for deletion, add <code>delete=1</code>.
{{Template:Template rating|template_name=Somemodule|rating=ready|namespace=Module|details=Other details go here.}}


'''Broken module'''
<code><nowiki>{{Template rating|Sometemplate|rating=deprecated|details=Other details go here.|delete=1}}</nowiki></code>
{{Template:Template rating|template_name=Somemodule|rating=broken|namespace=Module|details=Other details go here.|debug=1}}
{{Template rating|Sometemplate|rating=deprecated|namespace=Template|details=Other details go here.|debug=1|delete=1}}


'''Deprecated module, with replacement, archived'''
'''Incorrect options and categories'''
{{Template:Template rating|template_name=Somemodule|rating=deprecated|namespace=Module|replacement=Somenewmodule|details=Other details go here.|debug=1}}


'''Deprecated module, without replacement, archived'''
This template uses [[Template:Category handler]], which categories templates and modules using this template in the appropriate categories, except those with a rating of ''ready''. Categories are not enabled on /doc or /sandbox pages.
{{Template:Template rating|template_name=Somemodule|rating=deprecated|namespace=Module|details=Other details go here.|debug=1}}


'''Deprecated module, with replacement, delete'''
In addition to this, this template detects whether it's in the incorrect namespace, such as when used on User namespace pages, and can detect whether it has an unrecognized rating.
{{Template:Template rating|template_name=Somemodule|rating=deprecated|namespace=Module|replacement=Somenewmodule|details=Other details go here.|debug=1|delete=1}}


'''Deprecated module, without replacement, delete'''
<code><nowiki>{{Template rating|Sometemplate|rating=aaa}}</nowiki></code>
{{Template:Template rating|template_name=Somemodule|rating=deprecated|namespace=Module|details=Other details go here.|debug=1|delete=1}}
{{Template rating|Sometemplate|rating=aaa|namespace=User}}


'''Incorrect options'''
=== See also ===
{{Template:Template rating|template_name=Template:Sometemplate|rating=aaa|namespace=Template}}
* [[Template:Deprecated template]], a template added to a deprecated template's code, to be used in conjunction with this template