Template:Module rating: Difference between revisions
ll>Alexis Jazz (do not show protection level of the module on the doc page, use the second (and optionally third) parameter if the doc page is also protected) |
m (1 revision imported) |
(No difference)
|
Latest revision as of 12:00, 8 February 2022
{{#ifeq:Module rating|doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module | module | {{#ifeq:Template|Module | module | other }} }}
| module =
{{#switch: release
| pre-alpha | prealpha | pa =
| alpha | a =
| beta | b =
| release | r | general | g =
| protected | protect | p = [[File:{{#switch:Lua error in Module:Effective_protection_level at line 14: attempt to index local 'title' (a nil value).|autoconfirmed=Semi|extendedconfirmed=Extended|accountcreator|templateeditor=Template|#default=Full}}-protection-shackle.svg|40x40px|link=|alt=Protected]]
| semiprotected | semiprotect | semi =
}} | {{#switch: release
| pre-alpha | prealpha | pa = This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | alpha | a = This module is rated as alpha. It is ready for third-party input, and may be used on a few pages to see if problems arise, but should be watched. Suggestions for new features or changes in their input and output mechanisms are welcome.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | beta | b = This module is rated as beta, and is ready for widespread use. It is still new and should be used with some caution to ensure the results are as expected.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | release | r | general | g = This module is rated as ready for general use. It has reached a mature form and is thought to be relatively bug-free and ready for use wherever appropriate. It is ready to mention on help pages and other Wikipedia resources as an option for new users to learn. To reduce server load and bad output, it should be improved by sandbox testing rather than repeated trial-and-error editing.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | protected | protect | p = This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is protected from editing.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | semiprotected | semiprotect | semi = This module is subject to page protection. It is a highly visible module in use by a very large number of pages, or is substituted very frequently. Because vandalism or mistakes would affect many pages, and even trivial editing might cause substantial load on the servers, it is semi-protected from editing.{{#switch: Module rating|doc|sandbox= | {{#ifeq: true | true | | }} }} | #default = Script error: No such module "Error".}} |
| other | #default = Script error: No such module "Error". }}}}
{{#ifeq:module rating |doc
|
{{#ifeq:show |show
|This is a documentation subpage for Template:Module rating{{#if:||.}} It contains usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if: | | {{#ifexist:Template:Module rating | [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]] | }} }} | }}
This template is used to rate Lua modules by quality. It is placed at the top of the module's /doc subpage. It produces a message informing users about the rating system, and it also places the module into a tracking category.
Usage
Basic usage:
{{#if:{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}|{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}}}{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||{{{8}}}}}{{#if:||{{{9}}}}}{{#if:||{{{10}}}}}{{#if:||{{{11}}}}}{{#if:||{{{12}}}}}{{#if:||{{{13}}}}}{{#if:||{{{14}}}}}{{#if:||{{{15}}}}}{{#if:||{{{16}}}}}{{#if:||{{{17}}}}}{{#if:||{{{18}}}}}{{#if:||{{{19}}}}}{{#if:||{{{20}}}}}
Without categories:
{{#if:{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:nocat=true||nocat=true}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}|{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:nocat=true||nocat=true}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}}}{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||{{{8}}}}}{{#if:||{{{9}}}}}{{#if:||{{{10}}}}}{{#if:||{{{11}}}}}{{#if:||{{{12}}}}}{{#if:||{{{13}}}}}{{#if:||{{{14}}}}}{{#if:||{{{15}}}}}{{#if:||{{{16}}}}}{{#if:||{{{17}}}}}{{#if:||{{{18}}}}}{{#if:||{{{19}}}}}{{#if:||{{{20}}}}}
If {{[[{{#if:|{{{SISTER}}}Template|Template}}:Module rating|Module rating]]{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}} is used outside the Module namespace, an error message is displayed instead and will be categorized under Category:Pages with templates in the wrong namespace.
If the documentation subpage is also protected:
{{#if:{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:reason for documentation protection||reason for documentation protection}}{{#if:action for documentation protection||action for documentation protection}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}|{{[[{{#if:|{{{SISTER}}}Template|Template}}:module rating|module rating]]{{#if:rating||rating}}{{#if:reason for documentation protection||reason for documentation protection}}{{#if:action for documentation protection||action for documentation protection}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||...}}}}}}{{#if:||{{{2}}}}}{{#if:||{{{3}}}}}{{#if:||{{{4}}}}}{{#if:||{{{5}}}}}{{#if:||{{{6}}}}}{{#if:||{{{7}}}}}{{#if:||{{{8}}}}}{{#if:||{{{9}}}}}{{#if:||{{{10}}}}}{{#if:||{{{11}}}}}{{#if:||{{{12}}}}}{{#if:||{{{13}}}}}{{#if:||{{{14}}}}}{{#if:||{{{15}}}}}{{#if:||{{{16}}}}}{{#if:||{{{17}}}}}{{#if:||{{{18}}}}}{{#if:||{{{19}}}}}{{#if:||{{{20}}}}}
The second and third unnamed arguments correspond to reason and action of {{Pp}} which gets included on the documentation subpage if at least the second unnamed argument is present.
Ratings
The rating should be placed in the first positional parameter. There are six different ratings: pre-alpha, alpha, beta, release, and protected, and semiprotected. There are also short alias codes for each of the ratings.
Rating | Aliases | Result | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
pre-alpha
|
prealpha pa
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:Module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
alpha
|
a
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
beta
|
b
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
release
|
r general g
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
protected
|
protect p
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
semiprotected
|
semiprotect semi
|
doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} | |||||||||||||||||||||
Anything else or if missing | doc|{{#if:|Template:Pp}}|{{#switch:
{{#if:module |
module | Module | module | other
}} }} |
module =
|
other | #default = Script error: No such module "Error".
}}}} |
TemplateData
{{#ifeq:{{safesubst:#switch: {{{header}}}
|no |n |f |false |off |0 = no | = yes |¬ = yes |yes |y |t |true |on |1 = yes |#default = yes}}|yes|
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:Module rating}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|#default=[1]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|C|c}}lick here] to see a monthly parameter usage report for {{#if:|[[Template:]]|this template}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3A%7C%7CModule+rating%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:|[[Template:]]|Template:Module rating}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}}.
|#default=[2]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:|its|this}} TemplateData}} }}}}
TemplateData for Module rating
{{#if: | {{{demospace}}} | {{#ifeq:Template|Template | template | other }} }}
| template = {{#if:{{#ifeq:Module |sandbox|1}}{{#ifeq:Module rating|doc|1}}||
}} | other | #default = }} }}Script error: No such module "Format TemplateData".
Categories
The template will put modules in one of the following categories, according to the rating specified:
- Category:Modules in pre-alpha development
- Category:Modules in alpha
- Category:Modules in beta
- Category:Modules for general use
- Category:Modules subject to page protection
These categories are suppressed on pages ending with /doc. To suppress categories on all pages, you can use the code |{{SAFESUBST:#if:nocat|nocat=}}true
.
See also
{{#if:{{#ifeq:Module |sandbox|1}}{{#ifeq:Module rating|doc|1}}||
}}
{{#if:|
[[Category:Template documentation pages{{#translation:}}]] }}