Difference between revisions of "Template:Highest archive number/doc"
imported>Mr. Stradivarius (update now that the module no longer tries to detect the correct archive page) |
imported>Mr. Stradivarius (add start parameter, and add a section about archive number limitations) |
||
| Line 3: | Line 3: | ||
<!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | <!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --> | ||
| − | This template finds the highest archive number for a given set of archive pages | + | This template finds the highest archive number for a given set of archive pages. |
| − | == | + | == Usage == |
| − | {{highest archive number|''prefix''}} | + | {{highest archive number|''prefix''|start=''start number''}} |
| − | + | * '''prefix''' - the prefix of the set of archive pages. For example, for [[Talk:France/Archive 1]], [[Talk:France/Archive 2]], etc., the prefix would be "Talk:France/Archive ". For this parameter, whitespace must be input correctly for the template to work. | |
| + | * '''start''' - if the archive numbers do not start at 1, you must specify the starting number here. For example, the first archive for [[Wikipedia talk:WikiProject Chemicals]] is [[Wikipedia talk:WikiProject Chemicals/Archive 2005]], so to find the highest archive number you would need to specify {{para|start|2005}}. | ||
| + | |||
| + | == Prefix syntax == | ||
| + | |||
| + | When specifying the archive prefix, you need to use the exact whitespace. For example, the following does '''not''' work, as there is a new line after the prefix: | ||
{{highest archive number | {{highest archive number | ||
| Line 15: | Line 20: | ||
}} | }} | ||
| − | + | In addition, if your prefix contains any equals signs ("="), you will need to replace them with the code <code><nowiki>{{=}}</nowiki></code>, otherwise everything in front of the first equals sign will be interpreted as a parameter name. | |
| + | |||
| + | == Archive number limitations == | ||
| + | |||
| + | The module this template is based on uses an [[exponential search]] algorithm to find the highest archive number. Due to the way this algorithm works, there cannot be any gaps in the archive numbers. For example, if archives 1, 2, 3 and 5 exist, but not archive 4, then the algorithm makes no guarantees about whether the highest archive number will be 3 or 5. | ||
== Examples == | == Examples == | ||
| Line 21: | Line 30: | ||
* <code><nowiki>{{highest archive number|Wikipedia:Administrators' noticeboard/IncidentArchive}}</nowiki></code> → {{highest archive number|Wikipedia:Administrators' noticeboard/IncidentArchive}} | * <code><nowiki>{{highest archive number|Wikipedia:Administrators' noticeboard/IncidentArchive}}</nowiki></code> → {{highest archive number|Wikipedia:Administrators' noticeboard/IncidentArchive}} | ||
* <code><nowiki>{{highest archive number|Talk:Byzantine Empire/Archive }}</nowiki></code> → {{highest archive number|Talk:Byzantine Empire/Archive }} | * <code><nowiki>{{highest archive number|Talk:Byzantine Empire/Archive }}</nowiki></code> → {{highest archive number|Talk:Byzantine Empire/Archive }} | ||
| + | * <code><nowiki>{{highest archive number|Wikipedia talk:WikiProject Chemicals/Archive |start=2005}}</nowiki></code> → {{highest archive number|Wikipedia talk:WikiProject Chemicals/Archive |start=2005}} | ||
<includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | <includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
Latest revision as of 16:10, 8 October 2019
| 40px | This is a documentation subpage for Template:Highest archive number. It contains usage information, categories and other content that is not part of the original template page. |
| 30px | This template uses Lua: |
This template finds the highest archive number for a given set of archive pages.
Usage
{{highest archive number|prefix|start=start number}}
- prefix - the prefix of the set of archive pages. For example, for Talk:France/Archive 1, Talk:France/Archive 2, etc., the prefix would be "Talk:France/Archive ". For this parameter, whitespace must be input correctly for the template to work.
- start - if the archive numbers do not start at 1, you must specify the starting number here. For example, the first archive for Wikipedia talk:WikiProject Chemicals is Wikipedia talk:WikiProject Chemicals/Archive 2005, so to find the highest archive number you would need to specify
|start=2005.
Prefix syntax
When specifying the archive prefix, you need to use the exact whitespace. For example, the following does not work, as there is a new line after the prefix:
{{highest archive number
|prefix
}}
In addition, if your prefix contains any equals signs ("="), you will need to replace them with the code {{=}}, otherwise everything in front of the first equals sign will be interpreted as a parameter name.
Archive number limitations
The module this template is based on uses an exponential search algorithm to find the highest archive number. Due to the way this algorithm works, there cannot be any gaps in the archive numbers. For example, if archives 1, 2, 3 and 5 exist, but not archive 4, then the algorithm makes no guarantees about whether the highest archive number will be 3 or 5.
Examples
{{highest archive number|Wikipedia:Administrators' noticeboard/IncidentArchive}}→{{highest archive number|Talk:Byzantine Empire/Archive }}→{{highest archive number|Wikipedia talk:WikiProject Chemicals/Archive |start=2005}}→