Template:Module rating: Difference between revisions

From LPFM Wiki
Jump to navigation Jump to search
Mediawiki>Shirayuki
m (Reverted edits by Thingofme (talk) to last version by ExE Boss)
 
m (1 revision imported)
 
(No difference)

Latest revision as of 13:01, 28 July 2022


Template documentation

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: Template:Pre

Without categories: Template:Pre

If {{Template:Module rating}} is used outside the Module namespace, an error message is shown: {{#switch:

 {{#if:
 |     
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }}

Ratings

The rating should be placed in the first positional parameter. There are five different ratings: pre-alphaTemplate:IntalphaTemplate:IntbetaTemplate:IntreleaseTemplate:IntTemplate:Intprotected. There are also short alias codes for each of the ratings.

Template:(! class="wikitable" ! Rating ! Aliases ! Result |- | pre-alpha | prealpha
pa | {{#switch:

 {{#if:Module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- | alpha | a | {{#switch:

 {{#if:module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- | beta | b | {{#switch:

 {{#if:module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- | release | r
general
g | {{#switch:

 {{#if:module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- | protected | protect
p | {{#switch:

 {{#if:module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- | Anything else or if missing | | {{#switch:

 {{#if:module
 | module    
 | {{#ifeq:Template|Module
   | module
   | other
   }}
 }}
| module =

| other | #default = Template:Error }} |- Template:!)

TemplateData

Template:Module rating/doc

Categories

The template will put modules in one of the following categories, according to the rating specified:

  • {{#ifeq:Category:Modules in pre-alpha development|
 |

}}[[Special:MyLanguage/Category:Modules in pre-alpha development|{{#if:|{{{2}}}|{{#ifexist:Translations:{{#if:Category|Category:}}Modules in pre-alpha development/Page display title/en

 |{{#if:
   |
   |{{ Template:TNTN }}
 }}
 |{{#if:
   |Modules in pre-alpha development
   |Category:Modules in pre-alpha development
 }}

}}}}]]{{#ifeq:Category:Modules in pre-alpha development|

 |

}}

  • {{#ifeq:Category:Modules in alpha|
 |

}}[[Special:MyLanguage/Category:Modules in alpha|{{#if:|{{{2}}}|{{#ifexist:Translations:{{#if:Category|Category:}}Modules in alpha/Page display title/en

 |{{#if:
   |
   |{{ Template:TNTN }}
 }}
 |{{#if:
   |Modules in alpha
   |Category:Modules in alpha
 }}

}}}}]]{{#ifeq:Category:Modules in alpha|

 |

}}

  • {{#ifeq:Category:Modules in beta|
 |

}}[[Special:MyLanguage/Category:Modules in beta|{{#if:|{{{2}}}|{{#ifexist:Translations:{{#if:Category|Category:}}Modules in beta/Page display title/en

 |{{#if:
   |
   |{{ Template:TNTN }}
 }}
 |{{#if:
   |Modules in beta
   |Category:Modules in beta
 }}

}}}}]]{{#ifeq:Category:Modules in beta|

 |

}}

  • {{#ifeq:Category:Modules for general use|
 |

}}[[Special:MyLanguage/Category:Modules for general use|{{#if:|{{{2}}}|{{#ifexist:Translations:{{#if:Category|Category:}}Modules for general use/Page display title/en

 |{{#if:
   |
   |{{ Template:TNTN }}
 }}
 |{{#if:
   |Modules for general use
   |Category:Modules for general use
 }}

}}}}]]{{#ifeq:Category:Modules for general use|

 |

}}

  • {{#ifeq:Category:Modules subject to page protection|
 |

}}[[Special:MyLanguage/Category:Modules subject to page protection|{{#if:|{{{2}}}|{{#ifexist:Translations:{{#if:Category|Category:}}Modules subject to page protection/Page display title/en

 |{{#if:
   |
   |{{ Template:TNTN }}
 }}
 |{{#if:
   |Modules subject to page protection
   |Category:Modules subject to page protection
 }}

}}}}]]{{#ifeq: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