Template:Weekly site information/doc: Difference between revisions
Appearance
Dat Hack3r (talk | contribs) Added {{Lua}}. |
Dat Hack3r (talk | contribs) Update documentation to reflect new functionality |
||
| Line 1: | Line 1: | ||
{{High priority}} | {{High priority}} | ||
{{Lua|Module:Weekly site information}} | {{Lua|Module:Weekly site information}} | ||
{{Tlx|Weekly site information}} generates links to Weekly Briefing | {{Tlx|Weekly site information}} generates links to [[Weekly Briefing]] releases. When [[MW:Transclusion|transcluded]], it will automatically display a link to the most recent Weekly Briefing release based on the release schedule. If the predicted release title is unavailable, the template automatically links to the last existing release. This functionality does not apply when {{para|number}} or {{para|offset}} are given. | ||
* {{Tlx|Weekly site information}} → | * {{Tlx|Weekly site information}} → | ||
*: {{Weekly site information}} | *: {{Weekly site information}} | ||
By default, the link displays as "Weekly Site Information". To display custom text, pass the custom text as the first parameter | By default, the link displays as "Weekly Site Information". To display custom text, pass the custom text as the first positional parameter. | ||
* {{Tlx|Weekly site information|Weekly Briefing}} → | * {{Tlx|Weekly site information|Weekly Briefing}} → | ||
*: {{Weekly site information|Weekly Briefing}} | *: {{Weekly site information|Weekly Briefing}} | ||
This template can also display a | Use {{para|number}} to get a link to a specific release number. | ||
* {{Tlx|Weekly site information|2=number=2}} → | |||
*: {{Weekly site information|number=2}} | |||
* {{Tlx|Weekly site information|The second Weekly Briefing release|3=number=2}} → | |||
*: {{Weekly site information|The second Weekly Briefing release|number=2}} | |||
This template can also display a past, present, or future Weekly Briefing release if {{para|offset}} is specified. This offset applies to the number given by {{para|number}} if it is present; otherwise, the offset is relative to the current expected release. A link will be produced regardless of whether the predicted release exists. | |||
* {{Tlx|Weekly site information|2=offset=-1}} → | * {{Tlx|Weekly site information|2=offset=-1}} → | ||
*: {{Weekly site information|offset=-1}} | *: {{Weekly site information|offset=-1}} | ||
* {{Tlx|Weekly site information|Weekly | * {{Tlx|Weekly site information|The previous expected release|3=offset=-1}} → | ||
*: {{Weekly site information|Weekly | *: {{Weekly site information|The previous expected release|offset=-1}} | ||
* {{Tlx|Weekly site information|The current expected release|3=offset=0}} → | |||
*: {{Weekly site information|The current expected release|offset=0}} | |||
* {{Tlx|Weekly site information|The next expected release|3=offset=1}} → | |||
*: {{Weekly site information|The next expected release|offset=1}} | |||
* {{Tlx|Weekly site information|The release after the second|3=number=2|4=offset=1}} → | |||
*: {{Weekly site information|The release after the second|number=2|offset=1}} | |||
== TemplateData == | == TemplateData == | ||
<templatedata> | <templatedata> | ||
{ | { | ||
"description": "This template generates links to Weekly Briefing | "description": "This template generates links to Weekly Briefing releases.", | ||
"params": { | "params": { | ||
"1": { | "1": { | ||
| Line 32: | Line 45: | ||
"offset": { | "offset": { | ||
"label": "Offset", | "label": "Offset", | ||
"description": " | "description": "An offset that can specify a past, present, or future Weekly Briefing release by being applied to the \"number\" parameter if given or the current expected release otherwise, always producing a link even if the release does not exist", | ||
"example": "-1", | "example": "-1, 0, 1", | ||
"type": "number", | "type": "number", | ||
"default": "0" | "default": "0" | ||
}, | |||
"number": { | |||
"label": "Release number", | |||
"description": "The number of a specific release to link to", | |||
"example": "2", | |||
"type": "number", | |||
"default": "The current release number" | |||
} | } | ||
}, | }, | ||
"format": "inline", | "format": "inline", | ||
" | "paramOrder": [ | ||
" | "1", | ||
" | "number", | ||
"offset" | |||
] | |||
} | } | ||
</templatedata> | </templatedata> | ||