· 8 years ago · Jul 18, 2018, 12:50 PM
1
2<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
3 <siteinfo>
4 <sitename>Wikipedia</sitename>
5 <dbname>enwiki</dbname>
6 <base>https://en.wikipedia.org/wiki/Main_Page</base>
7 <generator>MediaWiki 1.32.0-wmf.12</generator>
8 <case>first-letter</case>
9 <namespaces>
10 <namespace key="-2" case="first-letter">Media</namespace>
11 <namespace key="-1" case="first-letter">Special</namespace>
12 <namespace key="0" case="first-letter" />
13 <namespace key="1" case="first-letter">Talk</namespace>
14 <namespace key="2" case="first-letter">User</namespace>
15 <namespace key="3" case="first-letter">User talk</namespace>
16 <namespace key="4" case="first-letter">Wikipedia</namespace>
17 <namespace key="5" case="first-letter">Wikipedia talk</namespace>
18 <namespace key="6" case="first-letter">File</namespace>
19 <namespace key="7" case="first-letter">File talk</namespace>
20 <namespace key="8" case="first-letter">MediaWiki</namespace>
21 <namespace key="9" case="first-letter">MediaWiki talk</namespace>
22 <namespace key="10" case="first-letter">Template</namespace>
23 <namespace key="11" case="first-letter">Template talk</namespace>
24 <namespace key="12" case="first-letter">Help</namespace>
25 <namespace key="13" case="first-letter">Help talk</namespace>
26 <namespace key="14" case="first-letter">Category</namespace>
27 <namespace key="15" case="first-letter">Category talk</namespace>
28 <namespace key="100" case="first-letter">Portal</namespace>
29 <namespace key="101" case="first-letter">Portal talk</namespace>
30 <namespace key="108" case="first-letter">Book</namespace>
31 <namespace key="109" case="first-letter">Book talk</namespace>
32 <namespace key="118" case="first-letter">Draft</namespace>
33 <namespace key="119" case="first-letter">Draft talk</namespace>
34 <namespace key="446" case="first-letter">Education Program</namespace>
35 <namespace key="447" case="first-letter">Education Program talk</namespace>
36 <namespace key="710" case="first-letter">TimedText</namespace>
37 <namespace key="711" case="first-letter">TimedText talk</namespace>
38 <namespace key="828" case="first-letter">Module</namespace>
39 <namespace key="829" case="first-letter">Module talk</namespace>
40 <namespace key="2300" case="first-letter">Gadget</namespace>
41 <namespace key="2301" case="first-letter">Gadget talk</namespace>
42 <namespace key="2302" case="case-sensitive">Gadget definition</namespace>
43 <namespace key="2303" case="case-sensitive">Gadget definition talk</namespace>
44 </namespaces>
45 </siteinfo>
46 <page>
47 <title>Template:Infobox officeholder</title>
48 <ns>10</ns>
49 <id>1432586</id>
50 <revision>
51 <id>845343953</id>
52 <parentid>845324208</parentid>
53 <timestamp>2018-06-11T04:58:29Z</timestamp>
54 <contributor>
55 <username>Canley</username>
56 <id>380571</id>
57 </contributor>
58 <comment>Undid revision 845324208 by [[Special:Contributions/Muboshgu|Muboshgu]] ([[User talk:Muboshgu|talk]]) - looks awful, change made with no discussion (see talk page for objections), misunderstanding of the MOS guideline</comment>
59 <model>wikitext</model>
60 <format>text/x-wiki</format>
61 <text xml:space="preserve" bytes="86903"><includeonly>{{infobox
62| bodyclass = vcard {{{bodyclass|}}}
63| bodystyle = {{#if:{{{mainwidth|}}}|width: {{{mainwidth}}}}}
64| child = {{lc:{{{embed}}}}}
65
66| abovestyle = font-size: 130%;
67| above = {{Br separated entries
68 | 1 = {{#if:{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix|}}}}}}}}}|<span class="honorific-prefix" style="font-size: 77%; font-weight: normal;">{{{honorific prefix|{{{honorific_prefix|{{{honorific-prefix}}}}}}}}}</span>}}
69 | 2 = <span class="fn">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</span>
70 | 3 = {{#if:{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix|}}}}}}}}}|<span class="honorific-suffix" style="font-size: 77%; font-weight: normal;">{{{honorific suffix|{{{honorific_suffix|{{{honorific-suffix}}}}}}}}}</span>}}
71 }}
72
73| subheaderstyle = font-size:125%; font-weight:bold;
74| subheader = {{#ifeq:{{lc:{{{embed}}}}}|yes||{{#if:{{{native_name|}}}|<span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}}}
75
76| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{width|{{{imagesize|{{{image_size|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
77| image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image name|}}}|size={{{width|{{{imagesize|{{{image_size|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
78| image3 = {{#invoke:InfoboxImage|InfoboxImage|image={{{smallimage|}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
79| caption{{#if:{{{smallimage|}}}|3|{{#if:{{{image name|}}}|2}}}} = {{{caption|}}}
80
81| headerstyle = {{#ifeq:{{lc:{{{embed}}}}}|yes|background:#eee|background:lavender}}
82
83| data1 =
84{{#if:{{{speaker|}}}|
85{{#if:{{{nominee|}}}{{{candidate|}}}||
86{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
87| 1blankname = {{{1blankname2|}}}
88| 1namedata = {{{1namedata2|}}}
89| 2blankname = {{{2blankname2|}}}
90| 2namedata = {{{2namedata2|}}}
91| 3blankname = {{{3blankname2|}}}
92| 3namedata = {{{3namedata2|}}}
93| 4blankname = {{{4blankname2|}}}
94| 4namedata = {{{4namedata2|}}}
95| 5blankname = {{{5blankname2|}}}
96| 5namedata = {{{5namedata2|}}}
97| alongside = {{{alongside2|}}}
98| ambassador_from = {{{ambassador_from2|}}}
99| appointer = {{#if: {{{appointer2|}}} | {{{appointer2}}} | {{{appointed2|}}} }}
100| assembly = {{{assembly2|}}}
101| chancellor = {{{chancellor2|}}}
102| co-leader = {{{co-leader2|}}}
103| constituency_{{#if:{{{constituency_AM2|}}}|AM|MP}} = {{#if: {{{constituency_AM2|}}} | {{{constituency_AM2}}} | {{{constituency_MP2|}}} }}
104| constituency = {{{constituency2|}}}
105| convocation = {{{convocation2|}}}
106| country = {{{country2|}}}
107| deputy = {{{deputy2|}}}
108| district = {{{district2|}}}
109| firstminister = {{{firstminister2|}}}
110| governor-general = {{{governor-general2|}}}
111| governor_general = {{{governor_general2|}}}
112| governor = {{{governor2|}}}
113| jr/sr = {{{jr/sr2|}}}
114| jr/sr and state = {{{jr/sr and state2|}}}
115| leader = {{{leader2|}}}
116| legislature = {{{legislature2|}}}
117| lieutenant_governor = {{{lieutenant_governor2|}}}
118| lieutenant = {{{lieutenant2|}}}
119| majority_leader = {{#if: {{{majorityleader2|}}} | {{{majorityleader2}}} | {{{majority_leader2|}}} }}
120| minister_from = {{{minister_from2|}}}
121| minority_floor_leader = {{{minority_floor_leader2|}}}
122| majority_floor_leader = {{{majority_floor_leader2|}}}
123| majority = {{{majority2|}}}
124| minister = {{{minister2|}}}
125| minority_leader = {{#if: {{{minorityleader2|}}} | {{{minorityleader2}}} | {{{minority_leader2|}}} }}
126| monarch = {{{monarch2|}}}
127| nominator = {{{nominator2|}}}
128| office = {{{office2|}}}
129| order = {{{order2|}}}
130| parliament = {{{parliament2|}}}
131| parliamentarygroup = {{{parliamentarygroup2|}}}
132| predecessor = {{{predecessor2|}}}
133| preceding = {{{preceding2|}}}
134| preceded = {{{preceded2|}}}
135| premier = {{{premier2|}}}
136| president = {{{president2|}}}
137| primeminister = {{{primeminister2|}}}
138| riding = {{{riding2|}}}
139| speaker = {{{speaker|}}}
140| speaker_office = {{{speaker_office|}}}
141| state_assembly = {{{state_assembly|}}}
142| state_delegate = {{{state_delegate|}}}
143| state_house = {{{state_house|}}}
144| state_legislature = {{{state_legislature|}}}
145| state_senate = {{{state_senate|}}}
146| state = {{{state|}}}
147| succeeded = {{{succeeded2|}}}
148| succeeding = {{{succeeding2|}}}
149| successor = {{{successor2|}}}
150| taoiseach = {{{taoiseach2|}}}
151| termlabel = {{{term_label2|{{{termlabel2|In office}}}}}}
152| termend = {{#if:{{{termend2|}}}|{{{termend2}}}|{{{term_end2|}}}}}
153| termstart = {{#if:{{{termstart2|}}}|{{{termstart2}}}|{{{term_start2|}}}}}
154| term = {{{term2|}}}
155| title = {{{title2|}}}
156| vicegovernor = {{{vicegovernor2|}}}
157| vicepresident = {{{vicepresident2|}}}
158| vicepremier = {{{vicepremier2|}}}
159| viceprimeminister = {{{viceprimeminister2|}}}
160| party = {{{party|}}}
161| prior_term = {{{prior_term|}}}
162}}}}}}<!--
163-->{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
164| 1blankname = {{{1blankname|}}}
165| 1namedata = {{{1namedata|}}}
166| 2blankname = {{{2blankname|}}}
167| 2namedata = {{{2namedata|}}}
168| 3blankname = {{{3blankname|}}}
169| 3namedata = {{{3namedata|}}}
170| 4blankname = {{{4blankname|}}}
171| 4namedata = {{{4namedata|}}}
172| 5blankname = {{{5blankname|}}}
173| 5namedata = {{{5namedata|}}}
174| alongside = {{{alongside|}}}
175| ambassador_from = {{{ambassador_from|}}}
176| appointer = {{#if: {{{appointer|}}} | {{{appointer}}} | {{{appointed|}}} }}
177| assembly = {{{assembly|}}}
178| candidate = {{{candidate|}}}
179| chancellor = {{{chancellor|}}}
180| co-leader = {{{co-leader|}}}
181| constituency_{{#if:{{{constituency_AM|}}}|AM|MP}} = {{#if: {{{constituency_AM|}}} | {{{constituency_AM}}} | {{{constituency_MP|}}} }}
182| constituency = {{{constituency|}}}
183| convocation = {{{convocation|}}}
184| country = {{{country|}}}
185| deputy = {{{deputy|}}}
186| district = {{{district|}}}
187| election_date = {{{election_date|}}}
188| firstminister = {{{firstminister|}}}
189| governor-general = {{{governor-general|}}}
190| governor_general = {{{governor_general|}}}
191| governor = {{{governor|}}}
192| incumbent = {{{incumbent|}}}
193| jr/sr = {{{jr/sr|}}}
194| jr/sr and state = {{{jr/sr and state|}}}
195| leader = {{{leader|}}}
196| legislature = {{{legislature|}}}
197| lieutenant_governor = {{{lieutenant_governor|}}}
198| lieutenant = {{{lieutenant|}}}
199| majority_leader = {{#if: {{{majorityleader|}}} | {{{majorityleader}}} | {{{majority_leader|}}} }}
200| majority = {{{majority|}}}
201| minister = {{{minister|}}}
202| minister_from = {{{minister_from|}}}
203| minority_floor_leader = {{{minority_floor_leader|}}}
204| majority_floor_leader = {{{majority_floor_leader|}}}
205| minority_leader = {{#if: {{{minorityleader|}}} | {{{minorityleader}}} | {{{minority_leader|}}} }}
206| monarch = {{{monarch|}}}
207| nominator = {{{nominator|}}}
208| nominee = {{{nominee|}}}
209| office = {{{office|}}}
210| opponent = {{{opponent|}}}
211| order = {{{order|}}}
212| parliament = {{{parliament|}}}
213| parliamentarygroup = {{{parliamentarygroup|}}}
214| party_election = {{{party_election|}}}
215| predecessor = {{{predecessor|}}}
216| preceding = {{{preceding|}}}
217| preceded = {{{preceded|}}}
218| premier = {{{premier|}}}
219| president = {{{president|}}}
220| primeminister = {{{primeminister|}}}
221| riding = {{{riding|}}}
222| runningmate = {{{runningmate|}}}
223| state_assembly = {{{state_assembly|}}}
224| state_delegate = {{{state_delegate|}}}
225| state_house = {{{state_house|}}}
226| state_legislature = {{{state_legislature|}}}
227| state_senate = {{{state_senate|}}}
228| state = {{{state|}}}
229| succeeded = {{{succeeded|}}}
230| succeeding = {{{succeeding|}}}
231| successor = {{{successor|}}}
232| taoiseach = {{{taoiseach|}}}
233| termlabel = {{{term_label|{{{termlabel|In office}}}}}}
234| termend = {{#if: {{{termend|}}} | {{{termend}}} | {{{term_end|}}} }}
235| termstart = {{#if: {{{termstart|}}} | {{{termstart}}} | {{{term_start|}}} }}
236| term = {{{term|}}}
237| title = {{{title|}}}
238| vicegovernor = {{{vicegovernor|}}}
239| vicepresident = {{{vicepresident|}}}
240| vicepremier = {{{vicepremier|}}}
241| viceprimeminister = {{{viceprimeminister|}}}
242| party = {{{party|}}}
243| prior_term = {{{prior_term|}}}
244}}<!--
245-->{{#if:{{{nominee|}}}{{{candidate|}}}||
246{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
247| 1blankname = {{{1blankname1|}}}
248| 1namedata = {{{1namedata1|}}}
249| 2blankname = {{{2blankname1|}}}
250| 2namedata = {{{2namedata1|}}}
251| 3blankname = {{{3blankname1|}}}
252| 3namedata = {{{3namedata1|}}}
253| 4blankname = {{{4blankname1|}}}
254| 4namedata = {{{4namedata1|}}}
255| 5blankname = {{{5blankname1|}}}
256| 5namedata = {{{5namedata1|}}}
257| alongside = {{{alongside1|}}}
258| ambassador_from = {{{ambassador_from1|}}}
259| appointer = {{#if: {{{appointer1|}}} | {{{appointer1}}} | {{{appointed1|}}} }}
260| assembly = {{{assembly1|}}}
261| chancellor = {{{chancellor1|}}}
262| co-leader = {{{co-leader1|}}}
263| constituency_{{#if:{{{constituency_AM1|}}}|AM|MP}} = {{#if: {{{constituency_AM1|}}} | {{{constituency_AM1}}} | {{{constituency_MP1|}}} }}
264| constituency = {{{constituency1|}}}
265| convocation = {{{convocation1|}}}
266| country = {{{country1|}}}
267| deputy = {{{deputy1|}}}
268| district = {{{district1|}}}
269| firstminister = {{{firstminister1|}}}
270| governor-general = {{{governor-general1|}}}
271| governor_general = {{{governor_general1|}}}
272| governor = {{{governor1|}}}
273| jr/sr = {{{jr/sr1|}}}
274| jr/sr and state = {{{jr/sr and state1|}}}
275| leader = {{{leader1|}}}
276| legislature = {{{legislature1|}}}
277| lieutenant_governor = {{{lieutenant_governor1|}}}
278| lieutenant = {{{lieutenant1|}}}
279| minority_floor_leader = {{{minority_floor_leader1|}}}
280| minister_from = {{{minister_from1|}}}
281| majority_floor_leader = {{{majority_floor_leader1|}}}
282| majority_leader = {{#if: {{{majorityleader1|}}} | {{{majorityleader1}}} | {{{majority_leader1|}}} }}
283| majority = {{{majority1|}}}
284| minister = {{{minister1|}}}
285| minority_leader = {{#if: {{{minorityleader1|}}} | {{{minorityleader1}}} | {{{minority_leader1|}}} }}
286| monarch = {{{monarch1|}}}
287| nominator = {{{nominator1|}}}
288| office = {{{office1|}}}
289| order = {{{order1|}}}
290| parliament = {{{parliament1|}}}
291| parliamentarygroup = {{{parliamentarygroup1|}}}
292| predecessor = {{{predecessor1|}}}
293| preceding = {{{preceding1|}}}
294| preceded = {{{preceded1|}}}
295| premier = {{{premier1|}}}
296| president = {{{president1|}}}
297| primeminister = {{{primeminister1|}}}
298| riding = {{{riding1|}}}
299| state_assembly = {{{state_assembly1|}}}
300| state_delegate = {{{state_delegate1|}}}
301| state_house = {{{state_house1|}}}
302| state_legislature = {{{state_legislature1|}}}
303| state_senate = {{{state_senate1|}}}
304| state = {{{state1|}}}
305| succeeded = {{{succeeded1|}}}
306| succeeding = {{{succeeding1|}}}
307| successor = {{{successor1|}}}
308| taoiseach = {{{taoiseach1|}}}
309| termlabel = {{{term_label1|{{{termlabel1|In office}}}}}}
310| termend = {{#if:{{{termend1|}}}|{{{termend1}}}|{{{term_end1|}}}}}
311| termstart = {{#if:{{{termstart1|}}}|{{{termstart1}}}|{{{term_start1|}}}}}
312| term = {{{term1|}}}
313| title = {{{title1|}}}
314| vicegovernor = {{{vicegovernor1|}}}
315| vicepresident = {{{vicepresident1|}}}
316| vicepremier = {{{vicepremier1|}}}
317| viceprimeminister = {{{viceprimeminister1|}}}
318| party = {{{party|}}}
319| prior_term = {{{prior_term1|}}}
320}}}}<!--
321-->{{#if:{{{nominee|}}}{{{candidate|}}}||
322{{#if:{{{speaker|}}}||
323{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
324| 1blankname = {{{1blankname2|}}}
325| 1namedata = {{{1namedata2|}}}
326| 2blankname = {{{2blankname2|}}}
327| 2namedata = {{{2namedata2|}}}
328| 3blankname = {{{3blankname2|}}}
329| 3namedata = {{{3namedata2|}}}
330| 4blankname = {{{4blankname2|}}}
331| 4namedata = {{{4namedata2|}}}
332| 5blankname = {{{5blankname2|}}}
333| 5namedata = {{{5namedata2|}}}
334| alongside = {{{alongside2|}}}
335| ambassador_from = {{{ambassador_from2|}}}
336| appointer = {{#if: {{{appointer2|}}} | {{{appointer2}}} | {{{appointed2|}}} }}
337| assembly = {{{assembly2|}}}
338| chancellor = {{{chancellor2|}}}
339| co-leader = {{{co-leader2|}}}
340| constituency_{{#if:{{{constituency_AM2|}}}|AM|MP}} = {{#if: {{{constituency_AM2|}}} | {{{constituency_AM2}}} | {{{constituency_MP2|}}} }}
341| constituency = {{{constituency2|}}}
342| convocation = {{{convocation2|}}}
343| country = {{{country2|}}}
344| deputy = {{{deputy2|}}}
345| district = {{{district2|}}}
346| firstminister = {{{firstminister2|}}}
347| governor-general = {{{governor-general2|}}}
348| governor_general = {{{governor_general2|}}}
349| governor = {{{governor2|}}}
350| jr/sr = {{{jr/sr2|}}}
351| jr/sr and state = {{{jr/sr and state2|}}}
352| leader = {{{leader2|}}}
353| legislature = {{{legislature2|}}}
354| lieutenant_governor = {{{lieutenant_governor2|}}}
355| lieutenant = {{{lieutenant2|}}}
356| majority_leader = {{#if: {{{majorityleader2|}}} | {{{majorityleader2}}} | {{{majority_leader2|}}} }}
357| minister_from = {{{minister_from2|}}}
358| minority_floor_leader = {{{minority_floor_leader2|}}}
359| majority_floor_leader = {{{majority_floor_leader2|}}}
360| majority = {{{majority2|}}}
361| minister = {{{minister2|}}}
362| minority_leader = {{#if: {{{minorityleader2|}}} | {{{minorityleader2}}} | {{{minority_leader2|}}} }}
363| monarch = {{{monarch2|}}}
364| nominator = {{{nominator2|}}}
365| office = {{{office2|}}}
366| order = {{{order2|}}}
367| parliament = {{{parliament2|}}}
368| parliamentarygroup = {{{parliamentarygroup2|}}}
369| predecessor = {{{predecessor2|}}}
370| preceding = {{{preceding2|}}}
371| preceded = {{{preceded2|}}}
372| premier = {{{premier2|}}}
373| president = {{{president2|}}}
374| primeminister = {{{primeminister2|}}}
375| riding = {{{riding2|}}}
376| state_assembly = {{{state_assembly2|}}}
377| state_delegate = {{{state_delegate2|}}}
378| state_house = {{{state_house2|}}}
379| state_legislature = {{{state_legislature2|}}}
380| state_senate = {{{state_senate2|}}}
381| state = {{{state2|}}}
382| succeeded = {{{succeeded2|}}}
383| succeeding = {{{succeeding2|}}}
384| successor = {{{successor2|}}}
385| taoiseach = {{{taoiseach2|}}}
386| termlabel = {{{term_label2|{{{termlabel2|In office}}}}}}
387| termend = {{#if:{{{termend2|}}}|{{{termend2}}}|{{{term_end2|}}}}}
388| termstart = {{#if:{{{termstart2|}}}|{{{termstart2}}}|{{{term_start2|}}}}}
389| term = {{{term2|}}}
390| title = {{{title2|}}}
391| vicegovernor = {{{vicegovernor2|}}}
392| vicepresident = {{{vicepresident2|}}}
393| vicepremier = {{{vicepremier2|}}}
394| viceprimeminister = {{{viceprimeminister2|}}}
395| party = {{{party|}}}
396| prior_term = {{{prior_term2|}}}
397}}}}}}<!--
398-->{{#if:{{{nominee|}}}{{{candidate|}}}||
399{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
400| 1blankname = {{{1blankname3|}}}
401| 1namedata = {{{1namedata3|}}}
402| 2blankname = {{{2blankname3|}}}
403| 2namedata = {{{2namedata3|}}}
404| 3blankname = {{{3blankname3|}}}
405| 3namedata = {{{3namedata3|}}}
406| 4blankname = {{{4blankname3|}}}
407| 4namedata = {{{4namedata3|}}}
408| 5blankname = {{{5blankname3|}}}
409| 5namedata = {{{5namedata3|}}}
410| alongside = {{{alongside3|}}}
411| ambassador_from = {{{ambassador_from3|}}}
412| appointer = {{#if: {{{appointer3|}}} | {{{appointer3}}} | {{{appointed3|}}} }}
413| assembly = {{{assembly3|}}}
414| chancellor = {{{chancellor3|}}}
415| co-leader = {{{co-leader3|}}}
416| constituency_{{#if:{{{constituency_AM3|}}}|AM|MP}} = {{#if: {{{constituency_AM3|}}} | {{{constituency_AM3}}} | {{{constituency_MP3|}}} }}
417| constituency = {{{constituency3|}}}
418| convocation = {{{convocation3|}}}
419| country = {{{country3|}}}
420| deputy = {{{deputy3|}}}
421| district = {{{district3|}}}
422| firstminister = {{{firstminister3|}}}
423| governor-general = {{{governor-general3|}}}
424| governor_general = {{{governor_general3|}}}
425| governor = {{{governor3|}}}
426| jr/sr = {{{jr/sr3|}}}
427| jr/sr and state = {{{jr/sr and state3|}}}
428| leader = {{{leader3|}}}
429| legislature = {{{legislature3|}}}
430| lieutenant_governor = {{{lieutenant_governor3|}}}
431| lieutenant = {{{lieutenant3|}}}
432| minority_floor_leader = {{{minority_floor_leader3|}}}
433| minister_from = {{{minister_from3|}}}
434| majority_floor_leader = {{{majority_floor_leader3|}}}
435| majority_leader = {{#if: {{{majorityleader3|}}} | {{{majorityleader3}}} | {{{majority_leader3|}}} }}
436| majority = {{{majority3|}}}
437| minister = {{{minister3|}}}
438| minority_leader = {{#if: {{{minorityleader3|}}} | {{{minorityleader3}}} | {{{minority_leader3|}}} }}
439| monarch = {{{monarch3|}}}
440| nominator = {{{nominator3|}}}
441| office = {{{office3|}}}
442| order = {{{order3|}}}
443| parliament = {{{parliament3|}}}
444| parliamentarygroup = {{{parliamentarygroup3|}}}
445| predecessor = {{{predecessor3|}}}
446| preceding = {{{preceding3|}}}
447| preceded = {{{preceded3|}}}
448| premier = {{{premier3|}}}
449| president = {{{president3|}}}
450| primeminister = {{{primeminister3|}}}
451| riding = {{{riding3|}}}
452| state_assembly = {{{state_assembly3|}}}
453| state_delegate = {{{state_delegate3|}}}
454| state_house = {{{state_house3|}}}
455| state_legislature = {{{state_legislature3|}}}
456| state_senate = {{{state_senate3|}}}
457| state = {{{state3|}}}
458| succeeded = {{{succeeded3|}}}
459| succeeding = {{{succeeding3|}}}
460| successor = {{{successor3|}}}
461| taoiseach = {{{taoiseach3|}}}
462| termlabel = {{{term_label3|{{{termlabel3|In office}}}}}}
463| termend = {{#if:{{{termend3|}}}|{{{termend3}}}|{{{term_end3|}}}}}
464| termstart = {{#if:{{{termstart3|}}}|{{{termstart3}}}|{{{term_start3|}}}}}
465| term = {{{term3|}}}
466| title = {{{title3|}}}
467| vicegovernor = {{{vicegovernor3|}}}
468| vicepresident = {{{vicepresident3|}}}
469| vicepremier = {{{vicepremier3|}}}
470| viceprimeminister = {{{viceprimeminister3|}}}
471| party = {{{party|}}}
472| prior_term = {{{prior_term3|}}}
473}}}}<!--
474-->{{#if:{{{nominee|}}}{{{candidate|}}}||
475{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
476| 1blankname = {{{1blankname4|}}}
477| 1namedata = {{{1namedata4|}}}
478| 2blankname = {{{2blankname4|}}}
479| 2namedata = {{{2namedata4|}}}
480| 3blankname = {{{3blankname4|}}}
481| 3namedata = {{{3namedata4|}}}
482| 4blankname = {{{4blankname4|}}}
483| 4namedata = {{{4namedata4|}}}
484| 5blankname = {{{5blankname4|}}}
485| 5namedata = {{{5namedata4|}}}
486| alongside = {{{alongside4|}}}
487| ambassador_from = {{{ambassador_from4|}}}
488| appointer = {{#if: {{{appointer4|}}} | {{{appointer4}}} | {{{appointed4|}}} }}
489| assembly = {{{assembly4|}}}
490| chancellor = {{{chancellor4|}}}
491| co-leader = {{{co-leader4|}}}
492| constituency_{{#if:{{{constituency_AM4|}}}|AM|MP}} = {{#if: {{{constituency_AM4|}}} | {{{constituency_AM4}}} | {{{constituency_MP4|}}} }}
493| constituency = {{{constituency4|}}}
494| convocation = {{{convocation4|}}}
495| country = {{{country4|}}}
496| deputy = {{{deputy4|}}}
497| district = {{{district4|}}}
498| firstminister = {{{firstminister4|}}}
499| governor-general = {{{governor-general4|}}}
500| governor_general = {{{governor_general4|}}}
501| governor = {{{governor4|}}}
502| jr/sr = {{{jr/sr4|}}}
503| jr/sr and state = {{{jr/sr and state4|}}}
504| leader = {{{leader4|}}}
505| legislature = {{{legislature4|}}}
506| lieutenant_governor = {{{lieutenant_governor4|}}}
507| lieutenant = {{{lieutenant4|}}}
508| minister_from = {{{minister_from4|}}}
509| minority_floor_leader = {{{minority_floor_leader4|}}}
510| majority_floor_leader = {{{majority_floor_leader4|}}}
511| majority_leader = {{#if: {{{majorityleader4|}}} | {{{majorityleader4}}} | {{{majority_leader4|}}} }}
512| majority = {{{majority4|}}}
513| minister = {{{minister4|}}}
514| minority_leader = {{#if: {{{minorityleader4|}}} | {{{minorityleader4}}} | {{{minority_leader4|}}} }}
515| monarch = {{{monarch4|}}}
516| nominator = {{{nominator4|}}}
517| office = {{{office4|}}}
518| order = {{{order4|}}}
519| parliament = {{{parliament4|}}}
520| parliamentarygroup = {{{parliamentarygroup4|}}}
521| predecessor = {{{predecessor4|}}}
522| preceding = {{{preceding4|}}}
523| preceded = {{{preceded4|}}}
524| premier = {{{premier4|}}}
525| president = {{{president4|}}}
526| primeminister = {{{primeminister4|}}}
527| riding = {{{riding4|}}}
528| state_assembly = {{{state_assembly4|}}}
529| state_delegate = {{{state_delegate4|}}}
530| state_house = {{{state_house4|}}}
531| state_legislature = {{{state_legislature4|}}}
532| state_senate = {{{state_senate4|}}}
533| state = {{{state4|}}}
534| succeeded = {{{succeeded4|}}}
535| succeeding = {{{succeeding4|}}}
536| successor = {{{successor4|}}}
537| taoiseach = {{{taoiseach4|}}}
538| termlabel = {{{term_label4|{{{termlabel4|In office}}}}}}
539| termend = {{#if:{{{termend4|}}}|{{{termend4}}}|{{{term_end4|}}}}}
540| termstart = {{#if:{{{termstart4|}}}|{{{termstart4}}}|{{{term_start4|}}}}}
541| term = {{{term4|}}}
542| title = {{{title4|}}}
543| vicegovernor = {{{vicegovernor4|}}}
544| vicepresident = {{{vicepresident4|}}}
545| vicepremier = {{{vicepremier4|}}}
546| viceprimeminister = {{{viceprimeminister4|}}}
547| party = {{{party|}}}
548| prior_term = {{{prior_term4|}}}
549}}}}<!--
550-->{{#if:{{{nominee|}}}{{{candidate|}}}||
551{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
552| 1blankname = {{{1blankname5|}}}
553| 1namedata = {{{1namedata5|}}}
554| 2blankname = {{{2blankname5|}}}
555| 2namedata = {{{2namedata5|}}}
556| 3blankname = {{{3blankname5|}}}
557| 3namedata = {{{3namedata5|}}}
558| 4blankname = {{{4blankname5|}}}
559| 4namedata = {{{4namedata5|}}}
560| 5blankname = {{{5blankname5|}}}
561| 5namedata = {{{5namedata5|}}}
562| alongside = {{{alongside5|}}}
563| ambassador_from = {{{ambassador_from5|}}}
564| appointer = {{#if: {{{appointer5|}}} | {{{appointer5}}} | {{{appointed5|}}} }}
565| assembly = {{{assembly5|}}}
566| chancellor = {{{chancellor5|}}}
567| co-leader = {{{co-leader5|}}}
568| constituency_{{#if:{{{constituency_AM5|}}}|AM|MP}} = {{#if: {{{constituency_AM5|}}} | {{{constituency_AM5}}} | {{{constituency_MP5|}}} }}
569| constituency = {{{constituency5|}}}
570| convocation = {{{convocation5|}}}
571| country = {{{country5|}}}
572| deputy = {{{deputy5|}}}
573| district = {{{district5|}}}
574| firstminister = {{{firstminister5|}}}
575| governor-general = {{{governor-general5|}}}
576| governor_general = {{{governor_general5|}}}
577| governor = {{{governor5|}}}
578| jr/sr = {{{jr/sr5|}}}
579| jr/sr and state = {{{jr/sr and state5|}}}
580| leader = {{{leader5|}}}
581| legislature = {{{legislature5|}}}
582| lieutenant_governor = {{{lieutenant_governor5|}}}
583| lieutenant = {{{lieutenant5|}}}
584| minister_from = {{{minister_from5|}}}
585| minority_floor_leader = {{{minority_floor_leader5|}}}
586| majority_floor_leader = {{{majority_floor_leader5|}}}
587| majority_leader = {{#if: {{{majorityleader5|}}} | {{{majorityleader5}}} | {{{majority_leader5|}}} }}
588| majority = {{{majority5|}}}
589| minister = {{{minister5|}}}
590| minority_leader = {{#if: {{{minorityleader5|}}} | {{{minorityleader5}}} | {{{minority_leader5|}}} }}
591| monarch = {{{monarch5|}}}
592| nominator = {{{nominator5|}}}
593| office = {{{office5|}}}
594| order = {{{order5|}}}
595| parliament = {{{parliament5|}}}
596| parliamentarygroup = {{{parliamentarygroup5|}}}
597| predecessor = {{{predecessor5|}}}
598| preceding = {{{preceding5|}}}
599| preceded = {{{preceded5|}}}
600| premier = {{{premier5|}}}
601| president = {{{president5|}}}
602| primeminister = {{{primeminister5|}}}
603| riding = {{{riding5|}}}
604| state_assembly = {{{state_assembly5|}}}
605| state_delegate = {{{state_delegate5|}}}
606| state_house = {{{state_house5|}}}
607| state_legislature = {{{state_legislature5|}}}
608| state_senate = {{{state_senate5|}}}
609| state = {{{state5|}}}
610| succeeded = {{{succeeded5|}}}
611| succeeding = {{{succeeding5|}}}
612| successor = {{{successor5|}}}
613| taoiseach = {{{taoiseach5|}}}
614| termlabel = {{{term_label5|{{{termlabel5|In office}}}}}}
615| termend = {{#if:{{{termend5|}}}|{{{termend5}}}|{{{term_end5|}}}}}
616| termstart = {{#if:{{{termstart5|}}}|{{{termstart5}}}|{{{term_start5|}}}}}
617| term = {{{term5|}}}
618| title = {{{title5|}}}
619| vicegovernor = {{{vicegovernor5|}}}
620| vicepresident = {{{vicepresident5|}}}
621| vicepremier = {{{vicepremier5|}}}
622| viceprimeminister = {{{viceprimeminister5|}}}
623| party = {{{party|}}}
624| prior_term = {{{prior_term5|}}}
625}}}}<!--
626-->{{#if:{{{nominee|}}}{{{candidate|}}}||
627{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
628| 1blankname = {{{1blankname6|}}}
629| 1namedata = {{{1namedata6|}}}
630| 2blankname = {{{2blankname6|}}}
631| 2namedata = {{{2namedata6|}}}
632| 3blankname = {{{3blankname6|}}}
633| 3namedata = {{{3namedata6|}}}
634| 4blankname = {{{4blankname6|}}}
635| 4namedata = {{{4namedata6|}}}
636| 5blankname = {{{5blankname6|}}}
637| 5namedata = {{{5namedata6|}}}
638| alongside = {{{alongside6|}}}
639| ambassador_from = {{{ambassador_from6|}}}
640| appointer = {{#if: {{{appointer6|}}} | {{{appointer6}}} | {{{appointed6|}}} }}
641| assembly = {{{assembly6|}}}
642| chancellor = {{{chancellor6|}}}
643| co-leader = {{{co-leader6|}}}
644| constituency_{{#if:{{{constituency_AM6|}}}|AM|MP}} = {{#if: {{{constituency_AM6|}}} | {{{constituency_AM6}}} | {{{constituency_MP6|}}} }}
645| constituency = {{{constituency6|}}}
646| convocation = {{{convocation6|}}}
647| country = {{{country6|}}}
648| deputy = {{{deputy6|}}}
649| district = {{{district6|}}}
650| firstminister = {{{firstminister6|}}}
651| governor-general = {{{governor-general6|}}}
652| governor_general = {{{governor_general6|}}}
653| governor = {{{governor6|}}}
654| jr/sr = {{{jr/sr6|}}}
655| jr/sr and state = {{{jr/sr and state6|}}}
656| leader = {{{leader6|}}}
657| legislature = {{{legislature6|}}}
658| lieutenant_governor = {{{lieutenant_governor6|}}}
659| lieutenant = {{{lieutenant6|}}}
660| minority_floor_leader = {{{minority_floor_leader6|}}}
661| minister_from = {{{minister_from6|}}}
662| majority_floor_leader = {{{majority_floor_leader6|}}}
663| majority_leader = {{#if: {{{majorityleader6|}}} | {{{majorityleader6}}} | {{{majority_leader6|}}} }}
664| majority = {{{majority6|}}}
665| minister = {{{minister6|}}}
666| minority_leader = {{#if: {{{minorityleader6|}}} | {{{minorityleader6}}} | {{{minority_leader6|}}} }}
667| monarch = {{{monarch6|}}}
668| nominator = {{{nominator6|}}}
669| office = {{{office6|}}}
670| order = {{{order6|}}}
671| parliament = {{{parliament6|}}}
672| parliamentarygroup = {{{parliamentarygroup6|}}}
673| predecessor = {{{predecessor6|}}}
674| preceding = {{{preceding6|}}}
675| preceded = {{{preceded6|}}}
676| premier = {{{premier6|}}}
677| president = {{{president6|}}}
678| primeminister = {{{primeminister6|}}}
679| riding = {{{riding6|}}}
680| state_assembly = {{{state_assembly6|}}}
681| state_delegate = {{{state_delegate6|}}}
682| state_house = {{{state_house6|}}}
683| state_legislature = {{{state_legislature6|}}}
684| state_senate = {{{state_senate6|}}}
685| state = {{{state6|}}}
686| succeeded = {{{succeeded6|}}}
687| succeeding = {{{succeeding6|}}}
688| successor = {{{successor6|}}}
689| taoiseach = {{{taoiseach6|}}}
690| termlabel = {{{term_label6|{{{termlabel6|In office}}}}}}
691| termend = {{#if:{{{termend6|}}}|{{{termend6}}}|{{{term_end6|}}}}}
692| termstart = {{#if:{{{termstart6|}}}|{{{termstart6}}}|{{{term_start6|}}}}}
693| term = {{{term6|}}}
694| title = {{{title6|}}}
695| vicegovernor = {{{vicegovernor6|}}}
696| vicepresident = {{{vicepresident6|}}}
697| vicepremier = {{{vicepremier6|}}}
698| viceprimeminister = {{{viceprimeminister6|}}}
699| party = {{{party|}}}
700| prior_term = {{{prior_term6|}}}
701}}}}<!--
702-->{{#if:{{{nominee|}}}{{{candidate|}}}||
703{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
704| 1blankname = {{{1blankname7|}}}
705| 1namedata = {{{1namedata7|}}}
706| 2blankname = {{{2blankname7|}}}
707| 2namedata = {{{2namedata7|}}}
708| 3blankname = {{{3blankname7|}}}
709| 3namedata = {{{3namedata7|}}}
710| 4blankname = {{{4blankname7|}}}
711| 4namedata = {{{4namedata7|}}}
712| 5blankname = {{{5blankname7|}}}
713| 5namedata = {{{5namedata7|}}}
714| alongside = {{{alongside7|}}}
715| ambassador_from = {{{ambassador_from7|}}}
716| appointer = {{#if: {{{appointer7|}}} | {{{appointer7}}} | {{{appointed7|}}} }}
717| assembly = {{{assembly7|}}}
718| chancellor = {{{chancellor7|}}}
719| co-leader = {{{co-leader7|}}}
720| constituency_{{#if:{{{constituency_AM7|}}}|AM|MP}} = {{#if: {{{constituency_AM7|}}} | {{{constituency_AM7}}} | {{{constituency_MP7|}}} }}
721| constituency = {{{constituency7|}}}
722| convocation = {{{convocation7|}}}
723| country = {{{country7|}}}
724| deputy = {{{deputy7|}}}
725| district = {{{district7|}}}
726| firstminister = {{{firstminister7|}}}
727| governor-general = {{{governor-general7|}}}
728| governor_general = {{{governor_general7|}}}
729| governor = {{{governor7|}}}
730| jr/sr = {{{jr/sr7|}}}
731| jr/sr and state = {{{jr/sr and state7|}}}
732| leader = {{{leader7|}}}
733| legislature = {{{legislature7|}}}
734| lieutenant_governor = {{{lieutenant_governor7|}}}
735| lieutenant = {{{lieutenant7|}}}
736| minister_from = {{{minister_from7|}}}
737| minority_floor_leader = {{{minority_floor_leader7|}}}
738| majority_floor_leader = {{{majority_floor_leader7|}}}
739| majority_leader = {{#if: {{{majorityleader7|}}} | {{{majorityleader7}}} | {{{majority_leader7|}}} }}
740| majority = {{{majority7|}}}
741| minister = {{{minister7|}}}
742| minority_leader = {{#if: {{{minorityleader7|}}} | {{{minorityleader7}}} | {{{minority_leader7|}}} }}
743| monarch = {{{monarch7|}}}
744| nominator = {{{nominator7|}}}
745| office = {{{office7|}}}
746| order = {{{order7|}}}
747| parliament = {{{parliament7|}}}
748| parliamentarygroup = {{{parliamentarygroup7|}}}
749| predecessor = {{{predecessor7|}}}
750| preceding = {{{preceding7|}}}
751| preceded = {{{preceded7|}}}
752| premier = {{{premier7|}}}
753| president = {{{president7|}}}
754| primeminister = {{{primeminister7|}}}
755| riding = {{{riding7|}}}
756| state_assembly = {{{state_assembly7|}}}
757| state_delegate = {{{state_delegate7|}}}
758| state_house = {{{state_house7|}}}
759| state_legislature = {{{state_legislature7|}}}
760| state_senate = {{{state_senate7|}}}
761| state = {{{state7|}}}
762| succeeded = {{{succeeded7|}}}
763| succeeding = {{{succeeding7|}}}
764| successor = {{{successor7|}}}
765| taoiseach = {{{taoiseach7|}}}
766| termlabel = {{{term_label7|{{{termlabel7|In office}}}}}}
767| termend = {{#if:{{{termend7|}}}|{{{termend7}}}|{{{term_end7|}}}}}
768| termstart = {{#if:{{{termstart7|}}}|{{{termstart7}}}|{{{term_start7|}}}}}
769| term = {{{term7|}}}
770| title = {{{title7|}}}
771| vicegovernor = {{{vicegovernor7|}}}
772| vicepresident = {{{vicepresident7|}}}
773| vicepremier = {{{vicepremier7|}}}
774| viceprimeminister = {{{viceprimeminister7|}}}
775| party = {{{party|}}}
776| prior_term = {{{prior_term7|}}}
777}}}}<!--
778-->{{#if:{{{nominee|}}}{{{candidate|}}}||
779{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
780| 1blankname = {{{1blankname8|}}}
781| 1namedata = {{{1namedata8|}}}
782| 2blankname = {{{2blankname8|}}}
783| 2namedata = {{{2namedata8|}}}
784| 3blankname = {{{3blankname8|}}}
785| 3namedata = {{{3namedata8|}}}
786| 4blankname = {{{4blankname8|}}}
787| 4namedata = {{{4namedata8|}}}
788| 5blankname = {{{5blankname8|}}}
789| 5namedata = {{{5namedata8|}}}
790| alongside = {{{alongside8|}}}
791| ambassador_from = {{{ambassador_from8|}}}
792| appointer = {{#if: {{{appointer8|}}} | {{{appointer8}}} | {{{appointed8|}}} }}
793| assembly = {{{assembly8|}}}
794| chancellor = {{{chancellor8|}}}
795| co-leader = {{{co-leader8|}}}
796| constituency_{{#if:{{{constituency_AM8|}}}|AM|MP}} = {{#if: {{{constituency_AM8|}}} | {{{constituency_AM8}}} | {{{constituency_MP8|}}} }}
797| constituency = {{{constituency8|}}}
798| convocation = {{{convocation8|}}}
799| country = {{{country8|}}}
800| deputy = {{{deputy8|}}}
801| district = {{{district8|}}}
802| firstminister = {{{firstminister8|}}}
803| governor-general = {{{governor-general8|}}}
804| governor_general = {{{governor_general8|}}}
805| governor = {{{governor8|}}}
806| jr/sr = {{{jr/sr8|}}}
807| jr/sr and state = {{{jr/sr and state8|}}}
808| leader = {{{leader8|}}}
809| legislature = {{{legislature8|}}}
810| lieutenant_governor = {{{lieutenant_governor8|}}}
811| lieutenant = {{{lieutenant8|}}}
812| minister_from = {{{minister_from8|}}}
813| minority_floor_leader = {{{minority_floor_leader8|}}}
814| majority_floor_leader = {{{majority_floor_leader8|}}}
815| majority_leader = {{#if: {{{majorityleader8|}}} | {{{majorityleader8}}} | {{{majority_leader8|}}} }}
816| majority = {{{majority8|}}}
817| minister = {{{minister8|}}}
818| minority_leader = {{#if: {{{minorityleader8|}}} | {{{minorityleader8}}} | {{{minority_leader8|}}} }}
819| monarch = {{{monarch8|}}}
820| nominator = {{{nominator8|}}}
821| office = {{{office8|}}}
822| order = {{{order8|}}}
823| parliament = {{{parliament8|}}}
824| parliamentarygroup = {{{parliamentarygroup8|}}}
825| predecessor = {{{predecessor8|}}}
826| preceding = {{{preceding8|}}}
827| preceded = {{{preceded8|}}}
828| premier = {{{premier8|}}}
829| president = {{{president8|}}}
830| primeminister = {{{primeminister8|}}}
831| riding = {{{riding8|}}}
832| state_assembly = {{{state_assembly8|}}}
833| state_delegate = {{{state_delegate8|}}}
834| state_house = {{{state_house8|}}}
835| state_legislature = {{{state_legislature8|}}}
836| state_senate = {{{state_senate8|}}}
837| state = {{{state8|}}}
838| succeeded = {{{succeeded8|}}}
839| succeeding = {{{succeeding8|}}}
840| successor = {{{successor8|}}}
841| taoiseach = {{{taoiseach8|}}}
842| termlabel = {{{term_label8|{{{termlabel8|In office}}}}}}
843| termend = {{#if:{{{termend8|}}}|{{{termend8}}}|{{{term_end8|}}}}}
844| termstart = {{#if:{{{termstart8|}}}|{{{termstart8}}}|{{{term_start8|}}}}}
845| term = {{{term8|}}}
846| title = {{{title8|}}}
847| vicegovernor = {{{vicegovernor8|}}}
848| vicepresident = {{{vicepresident8|}}}
849| vicepremier = {{{vicepremier8|}}}
850| viceprimeminister = {{{viceprimeminister8|}}}
851| party = {{{party|}}}
852| prior_term = {{{prior_term8|}}}
853}}}}<!--
854-->{{#if:{{{nominee|}}}{{{candidate|}}}||
855{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
856| 1blankname = {{{1blankname9|}}}
857| 1namedata = {{{1namedata9|}}}
858| 2blankname = {{{2blankname9|}}}
859| 2namedata = {{{2namedata9|}}}
860| 3blankname = {{{3blankname9|}}}
861| 3namedata = {{{3namedata9|}}}
862| 4blankname = {{{4blankname9|}}}
863| 4namedata = {{{4namedata9|}}}
864| 5blankname = {{{5blankname9|}}}
865| 5namedata = {{{5namedata9|}}}
866| alongside = {{{alongside9|}}}
867| ambassador_from = {{{ambassador_from9|}}}
868| appointer = {{#if: {{{appointer9|}}} | {{{appointer9}}} | {{{appointed9|}}} }}
869| assembly = {{{assembly9|}}}
870| chancellor = {{{chancellor9|}}}
871| co-leader = {{{co-leader9|}}}
872| constituency_{{#if:{{{constituency_AM9|}}}|AM|MP}} = {{#if: {{{constituency_AM9|}}} | {{{constituency_AM9}}} | {{{constituency_MP9|}}} }}
873| constituency = {{{constituency9|}}}
874| convocation = {{{convocation9|}}}
875| country = {{{country9|}}}
876| deputy = {{{deputy9|}}}
877| district = {{{district9|}}}
878| firstminister = {{{firstminister9|}}}
879| governor-general = {{{governor-general9|}}}
880| governor_general = {{{governor_general9|}}}
881| governor = {{{governor9|}}}
882| jr/sr = {{{jr/sr9|}}}
883| jr/sr and state = {{{jr/sr and state9|}}}
884| leader = {{{leader9|}}}
885| legislature = {{{legislature9|}}}
886| lieutenant_governor = {{{lieutenant_governor9|}}}
887| lieutenant = {{{lieutenant9|}}}
888| minister_from = {{{minister_from9|}}}
889| minority_floor_leader = {{{minority_floor_leader9|}}}
890| majority_floor_leader = {{{majority_floor_leader9|}}}
891| majority_leader = {{#if: {{{majorityleader9|}}} | {{{majorityleader9}}} | {{{majority_leader9|}}} }}
892| majority = {{{majority9|}}}
893| minister = {{{minister9|}}}
894| minority_leader = {{#if: {{{minorityleader9|}}} | {{{minorityleader9}}} | {{{minority_leader9|}}} }}
895| monarch = {{{monarch9|}}}
896| nominator = {{{nominator9|}}}
897| office = {{{office9|}}}
898| order = {{{order9|}}}
899| parliament = {{{parliament9|}}}
900| parliamentarygroup = {{{parliamentarygroup9|}}}
901| predecessor = {{{predecessor9|}}}
902| preceding = {{{preceding9|}}}
903| preceded = {{{preceded9|}}}
904| premier = {{{premier9|}}}
905| president = {{{president9|}}}
906| primeminister = {{{primeminister9|}}}
907| riding = {{{riding9|}}}
908| state_assembly = {{{state_assembly9|}}}
909| state_delegate = {{{state_delegate9|}}}
910| state_house = {{{state_house9|}}}
911| state_legislature = {{{state_legislature9|}}}
912| state_senate = {{{state_senate9|}}}
913| state = {{{state9|}}}
914| succeeded = {{{succeeded9|}}}
915| succeeding = {{{succeeding9|}}}
916| successor = {{{successor9|}}}
917| taoiseach = {{{taoiseach9|}}}
918| termlabel = {{{term_label9|{{{termlabel9|In office}}}}}}
919| termend = {{#if:{{{termend9|}}}|{{{termend9}}}|{{{term_end9|}}}}}
920| termstart = {{#if:{{{termstart9|}}}|{{{termstart9}}}|{{{term_start9|}}}}}
921| term = {{{term9|}}}
922| title = {{{title9|}}}
923| vicegovernor = {{{vicegovernor9|}}}
924| vicepresident = {{{vicepresident9|}}}
925| vicepremier = {{{vicepremier9|}}}
926| viceprimeminister = {{{viceprimeminister9|}}}
927| party = {{{party|}}}
928| prior_term = {{{prior_term9|}}}
929}}}}<!--
930-->{{#if:{{{nominee|}}}{{{candidate|}}}||
931{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
932| 1blankname = {{{1blankname10|}}}
933| 1namedata = {{{1namedata10|}}}
934| 2blankname = {{{2blankname10|}}}
935| 2namedata = {{{2namedata10|}}}
936| 3blankname = {{{3blankname10|}}}
937| 3namedata = {{{3namedata10|}}}
938| 4blankname = {{{4blankname10|}}}
939| 4namedata = {{{4namedata10|}}}
940| 5blankname = {{{5blankname10|}}}
941| 5namedata = {{{5namedata10|}}}
942| alongside = {{{alongside10|}}}
943| ambassador_from = {{{ambassador_from10|}}}
944| appointer = {{#if: {{{appointer10|}}} | {{{appointer10}}} | {{{appointed10|}}} }}
945| assembly = {{{assembly10|}}}
946| chancellor = {{{chancellor10|}}}
947| co-leader = {{{co-leader10|}}}
948| constituency_{{#if:{{{constituency_AM10|}}}|AM|MP}} = {{#if: {{{constituency_AM10|}}} | {{{constituency_AM10}}} | {{{constituency_MP10|}}} }}
949| constituency = {{{constituency10|}}}
950| convocation = {{{convocation10|}}}
951| country = {{{country10|}}}
952| deputy = {{{deputy10|}}}
953| district = {{{district10|}}}
954| firstminister = {{{firstminister10|}}}
955| governor-general = {{{governor-general10|}}}
956| governor_general = {{{governor_general10|}}}
957| governor = {{{governor10|}}}
958| jr/sr = {{{jr/sr10|}}}
959| jr/sr and state = {{{jr/sr and state10|}}}
960| leader = {{{leader10|}}}
961| legislature = {{{legislature10|}}}
962| lieutenant_governor = {{{lieutenant_governor10|}}}
963| lieutenant = {{{lieutenant10|}}}
964| minister_from = {{{minister_from10|}}}
965| minority_floor_leader = {{{minority_floor_leader10|}}}
966| majority_floor_leader = {{{majority_floor_leader10|}}}
967| majority_leader = {{#if: {{{majorityleader10|}}} | {{{majorityleader10}}} | {{{majority_leader10|}}} }}
968| majority = {{{majority10|}}}
969| minister = {{{minister10|}}}
970| minority_leader = {{#if: {{{minorityleader10|}}} | {{{minorityleader10}}} | {{{minority_leader10|}}} }}
971| monarch = {{{monarch10|}}}
972| nominator = {{{nominator10|}}}
973| office = {{{office10|}}}
974| order = {{{order10|}}}
975| parliament = {{{parliament10|}}}
976| parliamentarygroup = {{{parliamentarygroup10|}}}
977| predecessor = {{{predecessor10|}}}
978| preceding = {{{preceding10|}}}
979| preceded = {{{preceded10|}}}
980| premier = {{{premier10|}}}
981| president = {{{president10|}}}
982| primeminister = {{{primeminister10|}}}
983| riding = {{{riding10|}}}
984| state_assembly = {{{state_assembly10|}}}
985| state_delegate = {{{state_delegate10|}}}
986| state_house = {{{state_house10|}}}
987| state_legislature = {{{state_legislature10|}}}
988| state_senate = {{{state_senate10|}}}
989| state = {{{state10|}}}
990| succeeded = {{{succeeded10|}}}
991| succeeding = {{{succeeding10|}}}
992| successor = {{{successor10|}}}
993| taoiseach = {{{taoiseach10|}}}
994| termlabel = {{{term_label10|{{{termlabel10|In office}}}}}}
995| termend = {{#if:{{{termend10|}}}|{{{termend10}}}|{{{term_end10|}}}}}
996| termstart = {{#if:{{{termstart10|}}}|{{{termstart10}}}|{{{term_start10|}}}}}
997| term = {{{term10|}}}
998| title = {{{title10|}}}
999| vicegovernor = {{{vicegovernor10|}}}
1000| vicepresident = {{{vicepresident10|}}}
1001| vicepremier = {{{vicepremier10|}}}
1002| viceprimeminister = {{{viceprimeminister10|}}}
1003| party = {{{party|}}}
1004| prior_term = {{{prior_term10|}}}
1005}}}}<!--
1006-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1007{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1008| 1blankname = {{{1blankname11|}}}
1009| 1namedata = {{{1namedata11|}}}
1010| 2blankname = {{{2blankname11|}}}
1011| 2namedata = {{{2namedata11|}}}
1012| 3blankname = {{{3blankname11|}}}
1013| 3namedata = {{{3namedata11|}}}
1014| 4blankname = {{{4blankname11|}}}
1015| 4namedata = {{{4namedata11|}}}
1016| 5blankname = {{{5blankname11|}}}
1017| 5namedata = {{{5namedata11|}}}
1018| alongside = {{{alongside11|}}}
1019| ambassador_from = {{{ambassador_from11|}}}
1020| appointer = {{#if: {{{appointer11|}}} | {{{appointer11}}} | {{{appointed11|}}} }}
1021| assembly = {{{assembly11|}}}
1022| chancellor = {{{chancellor11|}}}
1023| co-leader = {{{co-leader11|}}}
1024| constituency_{{#if:{{{constituency_AM11|}}}|AM|MP}} = {{#if: {{{constituency_AM11|}}} | {{{constituency_AM11}}} | {{{constituency_MP11|}}} }}
1025| constituency = {{{constituency11|}}}
1026| convocation = {{{convocation11|}}}
1027| country = {{{country11|}}}
1028| deputy = {{{deputy11|}}}
1029| district = {{{district11|}}}
1030| firstminister = {{{firstminister11|}}}
1031| governor-general = {{{governor-general11|}}}
1032| governor_general = {{{governor_general11|}}}
1033| governor = {{{governor11|}}}
1034| jr/sr = {{{jr/sr11|}}}
1035| jr/sr and state = {{{jr/sr and state11|}}}
1036| leader = {{{leader11|}}}
1037| legislature = {{{legislature11|}}}
1038| lieutenant_governor = {{{lieutenant_governor11|}}}
1039| lieutenant = {{{lieutenant11|}}}
1040| minister_from = {{{minister_from11|}}}
1041| minority_floor_leader = {{{minority_floor_leader11|}}}
1042| majority_floor_leader = {{{majority_floor_leader11|}}}
1043| majority_leader = {{#if: {{{majorityleader11|}}} | {{{majorityleader11}}} | {{{majority_leader11|}}} }}
1044| majority = {{{majority11|}}}
1045| minister = {{{minister11|}}}
1046| minority_leader = {{#if: {{{minorityleader11|}}} | {{{minorityleader11}}} | {{{minority_leader11|}}} }}
1047| monarch = {{{monarch11|}}}
1048| nominator = {{{nominator11|}}}
1049| office = {{{office11|}}}
1050| order = {{{order11|}}}
1051| parliament = {{{parliament11|}}}
1052| parliamentarygroup = {{{parliamentarygroup11|}}}
1053| predecessor = {{{predecessor11|}}}
1054| preceding = {{{preceding11|}}}
1055| preceded = {{{preceded11|}}}
1056| premier = {{{premier11|}}}
1057| president = {{{president11|}}}
1058| primeminister = {{{primeminister11|}}}
1059| riding = {{{riding11|}}}
1060| state_assembly = {{{state_assembly11|}}}
1061| state_delegate = {{{state_delegate11|}}}
1062| state_house = {{{state_house11|}}}
1063| state_legislature = {{{state_legislature11|}}}
1064| state_senate = {{{state_senate11|}}}
1065| state = {{{state11|}}}
1066| succeeded = {{{succeeded11|}}}
1067| succeeding = {{{succeeding11|}}}
1068| successor = {{{successor11|}}}
1069| taoiseach = {{{taoiseach11|}}}
1070| termlabel = {{{term_label11|{{{termlabel11|In office}}}}}}
1071| termend = {{#if:{{{termend11|}}}|{{{termend11}}}|{{{term_end11|}}}}}
1072| termstart = {{#if:{{{termstart11|}}}|{{{termstart11}}}|{{{term_start11|}}}}}
1073| term = {{{term11|}}}
1074| title = {{{title11|}}}
1075| vicegovernor = {{{vicegovernor11|}}}
1076| vicepresident = {{{vicepresident11|}}}
1077| vicepremier = {{{vicepremier11|}}}
1078| viceprimeminister = {{{viceprimeminister11|}}}
1079| party = {{{party|}}}
1080| prior_term = {{{prior_term11|}}}
1081}}}}<!--
1082-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1083{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1084| 1blankname = {{{1blankname12|}}}
1085| 1namedata = {{{1namedata12|}}}
1086| 2blankname = {{{2blankname12|}}}
1087| 2namedata = {{{2namedata12|}}}
1088| 3blankname = {{{3blankname12|}}}
1089| 3namedata = {{{3namedata12|}}}
1090| 4blankname = {{{4blankname12|}}}
1091| 4namedata = {{{4namedata12|}}}
1092| 5blankname = {{{5blankname12|}}}
1093| 5namedata = {{{5namedata12|}}}
1094| alongside = {{{alongside12|}}}
1095| ambassador_from = {{{ambassador_from12|}}}
1096| appointer = {{#if: {{{appointer12|}}} | {{{appointer12}}} | {{{appointed12|}}} }}
1097| assembly = {{{assembly12|}}}
1098| chancellor = {{{chancellor12|}}}
1099| co-leader = {{{co-leader12|}}}
1100| constituency_{{#if:{{{constituency_AM12|}}}|AM|MP}} = {{#if: {{{constituency_AM12|}}} | {{{constituency_AM12}}} | {{{constituency_MP12|}}} }}
1101| constituency = {{{constituency12|}}}
1102| convocation = {{{convocation12|}}}
1103| country = {{{country12|}}}
1104| deputy = {{{deputy12|}}}
1105| district = {{{district12|}}}
1106| firstminister = {{{firstminister12|}}}
1107| governor-general = {{{governor-general12|}}}
1108| governor_general = {{{governor_general12|}}}
1109| governor = {{{governor12|}}}
1110| jr/sr = {{{jr/sr12|}}}
1111| jr/sr and state = {{{jr/sr and state12|}}}
1112| leader = {{{leader12|}}}
1113| legislature = {{{legislature12|}}}
1114| lieutenant_governor = {{{lieutenant_governor12|}}}
1115| lieutenant = {{{lieutenant12|}}}
1116| minister_from = {{{minister_from12|}}}
1117| minority_floor_leader = {{{minority_floor_leader12|}}}
1118| majority_floor_leader = {{{majority_floor_leader12|}}}
1119| majority_leader = {{#if: {{{majorityleader12|}}} | {{{majorityleader12}}} | {{{majority_leader12|}}} }}
1120| majority = {{{majority12|}}}
1121| minister = {{{minister12|}}}
1122| minority_leader = {{#if: {{{minorityleader12|}}} | {{{minorityleader12}}} | {{{minority_leader12|}}} }}
1123| monarch = {{{monarch12|}}}
1124| nominator = {{{nominator12|}}}
1125| office = {{{office12|}}}
1126| order = {{{order12|}}}
1127| parliament = {{{parliament12|}}}
1128| parliamentarygroup = {{{parliamentarygroup12|}}}
1129| predecessor = {{{predecessor12|}}}
1130| preceding = {{{preceding12|}}}
1131| preceded = {{{preceded12|}}}
1132| premier = {{{premier12|}}}
1133| president = {{{president12|}}}
1134| primeminister = {{{primeminister12|}}}
1135| riding = {{{riding12|}}}
1136| state_assembly = {{{state_assembly12|}}}
1137| state_delegate = {{{state_delegate12|}}}
1138| state_house = {{{state_house12|}}}
1139| state_legislature = {{{state_legislature12|}}}
1140| state_senate = {{{state_senate12|}}}
1141| state = {{{state12|}}}
1142| succeeded = {{{succeeded12|}}}
1143| succeeding = {{{succeeding12|}}}
1144| successor = {{{successor12|}}}
1145| taoiseach = {{{taoiseach12|}}}
1146| termlabel = {{{term_label12|{{{termlabel12|In office}}}}}}
1147| termend = {{#if:{{{termend12|}}}|{{{termend12}}}|{{{term_end12|}}}}}
1148| termstart = {{#if:{{{termstart12|}}}|{{{termstart12}}}|{{{term_start12|}}}}}
1149| term = {{{term12|}}}
1150| title = {{{title12|}}}
1151| vicegovernor = {{{vicegovernor12|}}}
1152| vicepresident = {{{vicepresident12|}}}
1153| vicepremier = {{{vicepremier12|}}}
1154| viceprimeminister = {{{viceprimeminister12|}}}
1155| party = {{{party|}}}
1156| prior_term = {{{prior_term12|}}}
1157}}}}<!--
1158-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1159{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1160| 1blankname = {{{1blankname13|}}}
1161| 1namedata = {{{1namedata13|}}}
1162| 2blankname = {{{2blankname13|}}}
1163| 2namedata = {{{2namedata13|}}}
1164| 3blankname = {{{3blankname13|}}}
1165| 3namedata = {{{3namedata13|}}}
1166| 4blankname = {{{4blankname13|}}}
1167| 4namedata = {{{4namedata13|}}}
1168| 5blankname = {{{5blankname13|}}}
1169| 5namedata = {{{5namedata13|}}}
1170| alongside = {{{alongside13|}}}
1171| ambassador_from = {{{ambassador_from13|}}}
1172| appointer = {{#if: {{{appointer13|}}} | {{{appointer13}}} | {{{appointed13|}}} }}
1173| assembly = {{{assembly13|}}}
1174| chancellor = {{{chancellor13|}}}
1175| co-leader = {{{co-leader13|}}}
1176| constituency_{{#if:{{{constituency_AM13|}}}|AM|MP}} = {{#if: {{{constituency_AM13|}}} | {{{constituency_AM13}}} | {{{constituency_MP13|}}} }}
1177| constituency = {{{constituency13|}}}
1178| convocation = {{{convocation13|}}}
1179| country = {{{country13|}}}
1180| deputy = {{{deputy13|}}}
1181| district = {{{district13|}}}
1182| firstminister = {{{firstminister13|}}}
1183| governor-general = {{{governor-general13|}}}
1184| governor_general = {{{governor_general13|}}}
1185| governor = {{{governor13|}}}
1186| jr/sr = {{{jr/sr13|}}}
1187| jr/sr and state = {{{jr/sr and state13|}}}
1188| leader = {{{leader13|}}}
1189| legislature = {{{legislature13|}}}
1190| lieutenant_governor = {{{lieutenant_governor13|}}}
1191| lieutenant = {{{lieutenant13|}}}
1192| minister_from = {{{minister_from13|}}}
1193| minority_floor_leader = {{{minority_floor_leader13|}}}
1194| majority_floor_leader = {{{majority_floor_leader13|}}}
1195| majority_leader = {{#if: {{{majorityleader13|}}} | {{{majorityleader13}}} | {{{majority_leader13|}}} }}
1196| majority = {{{majority13|}}}
1197| minister = {{{minister13|}}}
1198| minority_leader = {{#if: {{{minorityleader13|}}} | {{{minorityleader13}}} | {{{minority_leader13|}}} }}
1199| monarch = {{{monarch13|}}}
1200| nominator = {{{nominator13|}}}
1201| office = {{{office13|}}}
1202| order = {{{order13|}}}
1203| parliament = {{{parliament13|}}}
1204| parliamentarygroup = {{{parliamentarygroup13|}}}
1205| predecessor = {{{predecessor13|}}}
1206| preceding = {{{preceding13|}}}
1207| preceded = {{{preceded13|}}}
1208| premier = {{{premier13|}}}
1209| president = {{{president13|}}}
1210| primeminister = {{{primeminister13|}}}
1211| riding = {{{riding13|}}}
1212| state_assembly = {{{state_assembly13|}}}
1213| state_delegate = {{{state_delegate13|}}}
1214| state_house = {{{state_house13|}}}
1215| state_legislature = {{{state_legislature13|}}}
1216| state_senate = {{{state_senate13|}}}
1217| state = {{{state13|}}}
1218| succeeded = {{{succeeded13|}}}
1219| succeeding = {{{succeeding13|}}}
1220| successor = {{{successor13|}}}
1221| taoiseach = {{{taoiseach13|}}}
1222| termlabel = {{{term_label13|{{{termlabel13|In office}}}}}}
1223| termend = {{#if:{{{termend13|}}}|{{{termend13}}}|{{{term_end13|}}}}}
1224| termstart = {{#if:{{{termstart13|}}}|{{{termstart13}}}|{{{term_start13|}}}}}
1225| term = {{{term13|}}}
1226| title = {{{title13|}}}
1227| vicegovernor = {{{vicegovernor13|}}}
1228| vicepresident = {{{vicepresident13|}}}
1229| vicepremier = {{{vicepremier13|}}}
1230| viceprimeminister = {{{viceprimeminister13|}}}
1231| party = {{{party|}}}
1232| prior_term = {{{prior_term13|}}}
1233}}}}<!--
1234-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1235{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1236| 1blankname = {{{1blankname14|}}}
1237| 1namedata = {{{1namedata14|}}}
1238| 2blankname = {{{2blankname14|}}}
1239| 2namedata = {{{2namedata14|}}}
1240| 3blankname = {{{3blankname14|}}}
1241| 3namedata = {{{3namedata14|}}}
1242| 4blankname = {{{4blankname14|}}}
1243| 4namedata = {{{4namedata14|}}}
1244| 5blankname = {{{5blankname14|}}}
1245| 5namedata = {{{5namedata14|}}}
1246| alongside = {{{alongside14|}}}
1247| ambassador_from = {{{ambassador_from14|}}}
1248| appointer = {{#if: {{{appointer14|}}} | {{{appointer14}}} | {{{appointed14|}}} }}
1249| assembly = {{{assembly14|}}}
1250| chancellor = {{{chancellor14|}}}
1251| co-leader = {{{co-leader14|}}}
1252| constituency_{{#if:{{{constituency_AM14|}}}|AM|MP}} = {{#if: {{{constituency_AM14|}}} | {{{constituency_AM14}}} | {{{constituency_MP14|}}} }}
1253| constituency = {{{constituency14|}}}
1254| convocation = {{{convocation14|}}}
1255| country = {{{country14|}}}
1256| deputy = {{{deputy14|}}}
1257| district = {{{district14|}}}
1258| firstminister = {{{firstminister14|}}}
1259| governor-general = {{{governor-general14|}}}
1260| governor_general = {{{governor_general14|}}}
1261| governor = {{{governor14|}}}
1262| jr/sr = {{{jr/sr14|}}}
1263| jr/sr and state = {{{jr/sr and state14|}}}
1264| leader = {{{leader14|}}}
1265| legislature = {{{legislature14|}}}
1266| lieutenant_governor = {{{lieutenant_governor14|}}}
1267| lieutenant = {{{lieutenant14|}}}
1268| minister_from = {{{minister_from14|}}}
1269| minority_floor_leader = {{{minority_floor_leader14|}}}
1270| majority_floor_leader = {{{majority_floor_leader14|}}}
1271| majority_leader = {{#if: {{{majorityleader14|}}} | {{{majorityleader14}}} | {{{majority_leader14|}}} }}
1272| majority = {{{majority14|}}}
1273| minister = {{{minister14|}}}
1274| minority_leader = {{#if: {{{minorityleader14|}}} | {{{minorityleader14}}} | {{{minority_leader14|}}} }}
1275| monarch = {{{monarch14|}}}
1276| nominator = {{{nominator14|}}}
1277| office = {{{office14|}}}
1278| order = {{{order14|}}}
1279| parliament = {{{parliament14|}}}
1280| parliamentarygroup = {{{parliamentarygroup14|}}}
1281| predecessor = {{{predecessor14|}}}
1282| preceding = {{{preceding14|}}}
1283| preceded = {{{preceded14|}}}
1284| premier = {{{premier14|}}}
1285| president = {{{president14|}}}
1286| primeminister = {{{primeminister14|}}}
1287| riding = {{{riding14|}}}
1288| state_assembly = {{{state_assembly14|}}}
1289| state_delegate = {{{state_delegate14|}}}
1290| state_house = {{{state_house14|}}}
1291| state_legislature = {{{state_legislature14|}}}
1292| state_senate = {{{state_senate14|}}}
1293| state = {{{state14|}}}
1294| succeeded = {{{succeeded14|}}}
1295| succeeding = {{{succeeding14|}}}
1296| successor = {{{successor14|}}}
1297| taoiseach = {{{taoiseach14|}}}
1298| termlabel = {{{term_label14|{{{termlabel14|In office}}}}}}
1299| termend = {{#if:{{{termend14|}}}|{{{termend14}}}|{{{term_end14|}}}}}
1300| termstart = {{#if:{{{termstart14|}}}|{{{termstart14}}}|{{{term_start14|}}}}}
1301| term = {{{term14|}}}
1302| title = {{{title14|}}}
1303| vicegovernor = {{{vicegovernor14|}}}
1304| vicepresident = {{{vicepresident14|}}}
1305| vicepremier = {{{vicepremier14|}}}
1306| viceprimeminister = {{{viceprimeminister14|}}}
1307| party = {{{party|}}}
1308| prior_term = {{{prior_term14|}}}
1309}}}}<!--
1310-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1311{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1312| 1blankname = {{{1blankname15|}}}
1313| 1namedata = {{{1namedata15|}}}
1314| 2blankname = {{{2blankname15|}}}
1315| 2namedata = {{{2namedata15|}}}
1316| 3blankname = {{{3blankname15|}}}
1317| 3namedata = {{{3namedata15|}}}
1318| 4blankname = {{{4blankname15|}}}
1319| 4namedata = {{{4namedata15|}}}
1320| 5blankname = {{{5blankname15|}}}
1321| 5namedata = {{{5namedata15|}}}
1322| alongside = {{{alongside15|}}}
1323| ambassador_from = {{{ambassador_from15|}}}
1324| appointer = {{#if: {{{appointer15|}}} | {{{appointer15}}} | {{{appointed15|}}} }}
1325| assembly = {{{assembly15|}}}
1326| chancellor = {{{chancellor15|}}}
1327| co-leader = {{{co-leader15|}}}
1328| constituency_{{#if:{{{constituency_AM15|}}}|AM|MP}} = {{#if: {{{constituency_AM15|}}} | {{{constituency_AM15}}} | {{{constituency_MP15|}}} }}
1329| constituency = {{{constituency15|}}}
1330| convocation = {{{convocation15|}}}
1331| country = {{{country15|}}}
1332| deputy = {{{deputy15|}}}
1333| district = {{{district15|}}}
1334| firstminister = {{{firstminister15|}}}
1335| governor-general = {{{governor-general15|}}}
1336| governor_general = {{{governor_general15|}}}
1337| governor = {{{governor15|}}}
1338| jr/sr = {{{jr/sr15|}}}
1339| jr/sr and state = {{{jr/sr and state15|}}}
1340| leader = {{{leader15|}}}
1341| legislature = {{{legislature15|}}}
1342| lieutenant_governor = {{{lieutenant_governor15|}}}
1343| lieutenant = {{{lieutenant15|}}}
1344| minister_from = {{{minister_from15|}}}
1345| minority_floor_leader = {{{minority_floor_leader15|}}}
1346| majority_floor_leader = {{{majority_floor_leader15|}}}
1347| majority_leader = {{#if: {{{majorityleader15|}}} | {{{majorityleader15}}} | {{{majority_leader15|}}} }}
1348| majority = {{{majority15|}}}
1349| minister = {{{minister15|}}}
1350| minority_leader = {{#if: {{{minorityleader15|}}} | {{{minorityleader15}}} | {{{minority_leader15|}}} }}
1351| monarch = {{{monarch15|}}}
1352| nominator = {{{nominator15|}}}
1353| office = {{{office15|}}}
1354| order = {{{order15|}}}
1355| parliament = {{{parliament15|}}}
1356| parliamentarygroup = {{{parliamentarygroup15|}}}
1357| predecessor = {{{predecessor15|}}}
1358| preceding = {{{preceding15|}}}
1359| preceded = {{{preceded15|}}}
1360| premier = {{{premier15|}}}
1361| president = {{{president15|}}}
1362| primeminister = {{{primeminister15|}}}
1363| riding = {{{riding15|}}}
1364| state_assembly = {{{state_assembly15|}}}
1365| state_delegate = {{{state_delegate15|}}}
1366| state_house = {{{state_house15|}}}
1367| state_legislature = {{{state_legislature15|}}}
1368| state_senate = {{{state_senate15|}}}
1369| state = {{{state15|}}}
1370| succeeded = {{{succeeded15|}}}
1371| succeeding = {{{succeeding15|}}}
1372| successor = {{{successor15|}}}
1373| taoiseach = {{{taoiseach15|}}}
1374| termlabel = {{{term_label15|{{{termlabel15|In office}}}}}}
1375| termend = {{#if:{{{termend15|}}}|{{{termend15}}}|{{{term_end15|}}}}}
1376| termstart = {{#if:{{{termstart15|}}}|{{{termstart15}}}|{{{term_start15|}}}}}
1377| term = {{{term15|}}}
1378| title = {{{title15|}}}
1379| vicegovernor = {{{vicegovernor15|}}}
1380| vicepresident = {{{vicepresident15|}}}
1381| vicepremier = {{{vicepremier15|}}}
1382| viceprimeminister = {{{viceprimeminister15|}}}
1383| party = {{{party|}}}
1384| prior_term = {{{prior_term15|}}}
1385}}}}<!--
1386-->{{#if:{{{nominee|}}}{{{candidate|}}}||
1387{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
1388| 1blankname = {{{1blankname16|}}}
1389| 1namedata = {{{1namedata16|}}}
1390| 2blankname = {{{2blankname16|}}}
1391| 2namedata = {{{2namedata16|}}}
1392| 3blankname = {{{3blankname16|}}}
1393| 3namedata = {{{3namedata16|}}}
1394| 4blankname = {{{4blankname16|}}}
1395| 4namedata = {{{4namedata16|}}}
1396| 5blankname = {{{5blankname16|}}}
1397| 5namedata = {{{5namedata16|}}}
1398| alongside = {{{alongside16|}}}
1399| ambassador_from = {{{ambassador_from16|}}}
1400| appointer = {{#if: {{{appointer16|}}} | {{{appointer16}}} | {{{appointed16|}}} }}
1401| assembly = {{{assembly16|}}}
1402| chancellor = {{{chancellor16|}}}
1403| co-leader = {{{co-leader16|}}}
1404| constituency_{{#if:{{{constituency_AM16|}}}|AM|MP}} = {{#if: {{{constituency_AM16|}}} | {{{constituency_AM16}}} | {{{constituency_MP16|}}} }}
1405| constituency = {{{constituency16|}}}
1406| convocation = {{{convocation16|}}}
1407| country = {{{country16|}}}
1408| deputy = {{{deputy16|}}}
1409| district = {{{district16|}}}
1410| firstminister = {{{firstminister16|}}}
1411| governor-general = {{{governor-general16|}}}
1412| governor_general = {{{governor_general16|}}}
1413| governor = {{{governor16|}}}
1414| jr/sr = {{{jr/sr16|}}}
1415| jr/sr and state = {{{jr/sr and state16|}}}
1416| leader = {{{leader16|}}}
1417| legislature = {{{legislature16|}}}
1418| lieutenant_governor = {{{lieutenant_governor16|}}}
1419| lieutenant = {{{lieutenant16|}}}
1420| minister_from = {{{minister_from16|}}}
1421| minority_floor_leader = {{{minority_floor_leader16|}}}
1422| majority_floor_leader = {{{majority_floor_leader16|}}}
1423| majority_leader = {{#if: {{{majorityleader16|}}} | {{{majorityleader16}}} | {{{majority_leader16|}}} }}
1424| majority = {{{majority16|}}}
1425| minister = {{{minister16|}}}
1426| minority_leader = {{#if: {{{minorityleader16|}}} | {{{minorityleader16}}} | {{{minority_leader16|}}} }}
1427| monarch = {{{monarch16|}}}
1428| nominator = {{{nominator16|}}}
1429| office = {{{office16|}}}
1430| order = {{{order16|}}}
1431| parliament = {{{parliament16|}}}
1432| parliamentarygroup = {{{parliamentarygroup16|}}}
1433| predecessor = {{{predecessor16|}}}
1434| preceding = {{{preceding16|}}}
1435| preceded = {{{preceded16|}}}
1436| premier = {{{premier16|}}}
1437| president = {{{president16|}}}
1438| primeminister = {{{primeminister16|}}}
1439| riding = {{{riding16|}}}
1440| state_assembly = {{{state_assembly16|}}}
1441| state_delegate = {{{state_delegate16|}}}
1442| state_house = {{{state_house16|}}}
1443| state_legislature = {{{state_legislature16|}}}
1444| state_senate = {{{state_senate16|}}}
1445| state = {{{state16|}}}
1446| succeeded = {{{succeeded16|}}}
1447| succeeding = {{{succeeding16|}}}
1448| successor = {{{successor16|}}}
1449| taoiseach = {{{taoiseach16|}}}
1450| termlabel = {{{term_label16|{{{termlabel16|In office}}}}}}
1451| termend = {{#if:{{{termend16|}}}|{{{termend16}}}|{{{term_end16|}}}}}
1452| termstart = {{#if:{{{termstart16|}}}|{{{termstart16}}}|{{{term_start16|}}}}}
1453| term = {{{term16|}}}
1454| title = {{{title16|}}}
1455| vicegovernor = {{{vicegovernor16|}}}
1456| vicepresident = {{{vicepresident16|}}}
1457| vicepremier = {{{vicepremier16|}}}
1458| viceprimeminister = {{{viceprimeminister16|}}}
1459| party = {{{party|}}}
1460| prior_term = {{{prior_term16|}}}
1461}}}}
1462
1463| data19 = {{{module0|}}}
1464<!----------Personal data---------->
1465| header20 = {{#if:{{{pronunciation|}}}{{{birth_name|{{{birthname|}}}}}}{{{birth_date|}}}{{{birth_place|}}}{{{death_date|}}}{{{death_place|}}}{{{resting_place|{{{restingplace|}}}}}}{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}{{{citizenship|}}}{{{nationality|}}}{{{party|}}}{{{otherparty|}}}{{{spouse|}}}{{{partner|}}}{{{relations|}}}{{{children|}}}{{{parents|}}}{{{mother|}}}{{{father|}}}{{{relatives|}}}{{{residence|}}}{{{education|}}}{{{alma_mater|}}}{{{occupation|}}}{{{profession|}}}{{{known_for|}}}{{{salary|}}}{{{net_worth|}}}{{{cabinet|}}}{{{committees|}}}{{{portfolio|}}}{{{awards|}}}{{{data1|}}}{{{data2|}}}{{{data3|}}}{{{data4|}}}{{{data5|}}}|Personal details}}
1466| label21 = Pronunciation
1467| data21 = {{{pronunciation|}}}
1468
1469| label22 = Born
1470| data22 = {{br separated entries
1471 |1 = {{#if:{{{birth_name|{{{birthname|}}}}}}|<span class="nickname">{{{birth_name|{{{birthname}}}}}}</span>}}
1472 |2 = {{{birth_date|}}}
1473 |3 = {{{birth_place|}}}
1474 }}
1475
1476| label23 = Died
1477| data23 = {{br separated entries|{{{death_date|}}}|{{{death_place|}}}}}
1478
1479| label24 = Cause&nbsp;of&nbsp;death
1480| data24 = {{{death_cause|}}}
1481
1482| label25 = Resting place
1483| class25 = label
1484| data25 = {{br separated entries|{{{resting_place|{{{restingplace|}}}}}}|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}
1485
1486| label26 = Citizenship
1487| data26 = {{{citizenship|}}}
1488
1489| label27 = Nationality
1490| data27 = {{{nationality|}}}
1491
1492| label28 = Political party
1493| data28 = {{#switch:{{{party|}}}
1494| =
1495| [[United States Democratic Party|Democrat]]
1496| [[Democratic Party (United States)|Democratic]]
1497| [[Democratic Party (United States)|Democrat]] = [[Democratic Party (United States)|Democratic]]
1498| [[Republican Party (United States)|Republican]]
1499| [[United States Republican Party]]
1500| [[United States Republican Party|Republican]]
1501| [[Republican Party (United States)|Republican Party]] = [[Republican Party (United States)|Republican]]
1502| [[Conservative Party (UK)|Conservative Party]]
1503| [[Conservative Party (UK)|Conservative]] = [[Conservative Party (UK)|Conservative]]
1504| [[Labour Party (UK)|Labour Party]]
1505| [[Labour Party (UK)|Labour]] = [[Labour Party (UK)|Labour]]
1506| [[Conservative Party of Canada|Conservative Party]]
1507| [[Conservative Party of Canada|Conservative]] = [[Conservative Party of Canada|Conservative]]
1508| [[Liberal Party of Canada|Liberal Party]]
1509| [[Liberal Party of Canada|Liberal]] = [[Liberal Party of Canada|Liberal]]
1510| KMT
1511| Kuomintang
1512| [[KMT]]
1513| [[Kuomintang|KMT]]
1514| [[Kuomintang]]
1515| Kuomintang (KMT)
1516| [[Kuomintang]] (KMT)
1517| {{KMT}} (KMT)
1518| {{KMT}} = [[Kuomintang]]
1519| DPP
1520| [[Democratic Progressive Party|DPP]]
1521| [[Democratic Progressive Party]]
1522| {{DPP}} = [[Democratic Progressive Party]]
1523| #default = {{{party|}}} {{main other|{{#invoke:Officeholder party tracking|tracking|party={{{party|}}}}}}}}}
1524
1525| label29 = Other political<br />affiliations
1526| data29 = {{{otherparty|}}}
1527
1528| label30 = Height
1529| data30 = {{#if:{{{height|}}}|{{infobox person/height|{{{height|}}}}}}}
1530
1531| label31 = Spouse(s)
1532| data31 = {{{spouse|}}}
1533
1534| label32 = Domestic partner
1535| data32 = {{{partner|}}}
1536
1537| label33 = Relations
1538| data33 = {{{relations|}}}
1539
1540| label34 = Children
1541| data34 = {{{children|}}}
1542
1543| label35 = Parents
1544| data35 = {{{parents|}}}
1545
1546| label36 = Mother
1547| data36 = {{{mother|}}}
1548
1549| label37 = Father
1550| data37 = {{{father|}}}
1551
1552| label38 = Relatives
1553| data38 = {{{relatives|}}}
1554
1555| label39 = Residence
1556| class39 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
1557| data39 = {{{residence|}}}
1558
1559| label40 = Education
1560| data40 = {{{education|}}}
1561
1562| label41 = [[Alma mater]]
1563| data41 = {{{alma_mater|}}}
1564
1565| label42 = Occupation
1566| data42 = {{{occupation|}}}
1567
1568| label43 = Profession
1569| data43 = {{{profession|}}}
1570
1571| label44 = Known for
1572| data44 = {{{known_for|}}}
1573
1574| label45 = Salary
1575| data45 = {{{salary|}}}
1576
1577| label46 = Net worth
1578| data46 = {{{net_worth|}}}
1579
1580| label47 = Cabinet
1581| data47 = {{{cabinet|}}}
1582
1583| label48 = Committees
1584| data48 = {{{committees|}}}
1585
1586| label49 = Portfolio
1587| data49 = {{{portfolio|}}}
1588
1589| label51 = {{#if:{{{mawards|}}}|Civilian awards|Awards}}
1590| data51 = {{{awards|}}}
1591
1592| label52 = {{{blank1}}}
1593| data52 = {{{data1|}}}
1594
1595| label53 = {{{blank2}}}
1596| data53 = {{{data2|}}}
1597
1598| label54 = {{{blank3}}}
1599| data54 = {{{data3|}}}
1600
1601| label55 = {{{blank4}}}
1602| data55 = {{{data4|}}}
1603
1604| label56 = {{{blank5}}}
1605| data56 = {{{data5|}}}
1606
1607| label57 = Signature
1608| data57 = {{#if:{{{signature|}}}|[[File:{{{signature}}}|128x80px|alt={{{signature_alt|}}}|{{PAGENAME}}'s signature]]}}
1609
1610| label58 = Website
1611| data58 = {{{website|}}}
1612
1613| header59 = {{#if:{{{allegiance|}}}{{{branch|}}}{{{serviceyears|}}}{{{rank|}}}{{{unit|}}}{{{commands|}}}{{{battles|}}}{{{military_blank1|}}}|Military service}}
1614
1615| label60 = Nickname(s)
1616| data60 = {{{nickname|}}}
1617
1618| label61 = Allegiance
1619| data61 = {{{allegiance|}}}
1620
1621| label62 = Service/branch
1622| data62 = {{{branch|}}}
1623
1624| label63 = Years of service
1625| data63 = {{{serviceyears|}}}
1626
1627| label64 = Rank
1628| data64 = {{{rank|}}}
1629
1630| label65 = Unit
1631| data65 = {{{unit|}}}
1632
1633| label66 = Commands
1634| data66 = {{{commands|}}}
1635
1636| label67 = Battles/wars
1637| data67 = {{{battles|}}}
1638
1639| label68 = {{#if:{{{awards|}}}|Military awards|Awards}}
1640| data68 = {{{mawards|}}}
1641
1642| label69 = {{{military_blank1}}}
1643| data69 = {{{military_data1|}}}
1644
1645| label70 = {{{military_blank2}}}
1646| data70 = {{{military_data2|}}}
1647
1648| label71 = {{{military_blank3}}}
1649| data71 = {{{military_data3|}}}
1650
1651| label72 = {{{military_blank4}}}
1652| data72 = {{{military_data4|}}}
1653
1654| label73 = {{{military_blank5}}}
1655| data73 = {{{military_data5|}}}
1656
1657| data74 = {{{module|}}}
1658| data75 = {{{module2|}}}
1659| data76 = {{{module3|}}}
1660| data77 = {{{module4|}}}
1661| data78 = {{{module5|}}}
1662| data79 = {{{footnotes|}}}
1663| belowstyle = border-top: 1px solid right; font-size: 90%
1664| below = {{#if:{{{date|}}}| As of {{{date}}}{{#if:{{{year|}}}|, {{{year}}}}}{{#if:{{{source|}}}|<br />Source: [{{{source}}}]}} }}
1665
1666}}{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]
1667}}{{#if:{{{1blankname0|}}}{{{1namedata0|}}}{{{2blankname0|}}}{{{2namedata0|}}}{{{3blankname0|}}}{{{3namedata0|}}}{{{4blankname0|}}}{{{4namedata0|}}}{{{5blankname0|}}}{{{5namedata0|}}}{{{alongside0|}}}{{{ambassador_from0|}}}{{{appointer0|}}}{{{assembly0|}}}{{{chancellor0|}}}{{{co-leader0|}}}{{{constituency_AM0|}}}{{{constituency0|}}}{{{country0|}}}{{{deputy0|}}}{{{district0|}}}{{{firstminister0|}}}{{{governor-general0|}}}{{{governor0|}}}{{{jr/sr0|}}}{{{jr/sr and state0|}}}{{{leader0|}}}{{{legislature0|}}}{{{lieutenant_governor0|}}}{{{lieutenant0|}}}{{{minister_from0|}}}{{{minority_floor_leader0|}}}{{{majority_floor_leader0|}}}{{{majorityleader0|}}}{{{majority0|}}}{{{minister0|}}}{{{minorityleader0|}}}{{{monarch0|}}}{{{nominator0|}}}{{{office0|}}}{{{order0|}}}{{{parliament0|}}}{{{predecessor0|}}}{{{preceding0|}}}{{{preceded0|}}}{{{premier0|}}}{{{president0|}}}{{{primeminister0|}}}{{{riding0|}}}{{{state_assembly0|}}}{{{state_delegate0|}}}{{{state_house0|}}}{{{state_legislature0|}}}{{{state_senate0|}}}{{{state0|}}}{{{succeeded0|}}}{{{succeeding0|}}}{{{successor0|}}}{{{taoiseach0|}}}{{{termend0|}}}{{{termstart0|}}}{{{term0|}}}{{{title0|}}}{{{vicegovernor0|}}}{{{vicepresident0|}}}{{{vicepremier0|}}}{{{viceprimeminister0|}}}{{{prior_term0|}}}{{{appointe0|}}}{{{constituency_0|}}}|[[Category:Pages using infobox officeholder with office0]]
1668}}{{#if:{{{speaker|}}}|{{#if:{{{nominee|}}}{{{candidate|}}}||[[Category:Pages using infobox officeholder with speaker and without nominee or candidate]]}}
1669}}</includeonly>{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using infobox officeholder with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Infobox officeholder]] with unknown parameter "_VALUE_"|ignoreblank=y| 1blankname | 1blankname1 | 1blankname10 | 1blankname11 | 1blankname12 | 1blankname13 | 1blankname14 | 1blankname15 | 1blankname16 | 1blankname2 | 1blankname3 | 1blankname4 | 1blankname5 | 1blankname6 | 1blankname7 | 1blankname8 | 1blankname9 | 1namedata | 1namedata1 | 1namedata10 | 1namedata11 | 1namedata12 | 1namedata13 | 1namedata14 | 1namedata15 | 1namedata16 | 1namedata2 | 1namedata3 | 1namedata4 | 1namedata5 | 1namedata6 | 1namedata7 | 1namedata8 | 1namedata9 | 2blankname | 2blankname1 | 2blankname10 | 2blankname11 | 2blankname12 | 2blankname13 | 2blankname14 | 2blankname15 | 2blankname16 | 2blankname2 | 2blankname3 | 2blankname4 | 2blankname5 | 2blankname6 | 2blankname7 | 2blankname8 | 2blankname9 | 2namedata | 2namedata1 | 2namedata10 | 2namedata11 | 2namedata12 | 2namedata13 | 2namedata14 | 2namedata15 | 2namedata16 | 2namedata2 | 2namedata3 | 2namedata4 | 2namedata5 | 2namedata6 | 2namedata7 | 2namedata8 | 2namedata9 | 3blankname | 3blankname1 | 3blankname10 | 3blankname11 | 3blankname12 | 3blankname13 | 3blankname14 | 3blankname15 | 3blankname16 | 3blankname2 | 3blankname3 | 3blankname4 | 3blankname5 | 3blankname6 | 3blankname7 | 3blankname8 | 3blankname9 | 3namedata | 3namedata1 | 3namedata10 | 3namedata11 | 3namedata12 | 3namedata13 | 3namedata14 | 3namedata15 | 3namedata16 | 3namedata2 | 3namedata3 | 3namedata4 | 3namedata5 | 3namedata6 | 3namedata7 | 3namedata8 | 3namedata9 | 4blankname | 4blankname1 | 4blankname10 | 4blankname11 | 4blankname12 | 4blankname13 | 4blankname14 | 4blankname15 | 4blankname16 | 4blankname2 | 4blankname3 | 4blankname4 | 4blankname5 | 4blankname6 | 4blankname7 | 4blankname8 | 4blankname9 | 4namedata | 4namedata1 | 4namedata10 | 4namedata11 | 4namedata12 | 4namedata13 | 4namedata14 | 4namedata15 | 4namedata16 | 4namedata2 | 4namedata3 | 4namedata4 | 4namedata5 | 4namedata6 | 4namedata7 | 4namedata8 | 4namedata9 | 5blankname | 5blankname1 | 5blankname10 | 5blankname11 | 5blankname12 | 5blankname13 | 5blankname14 | 5blankname15 | 5blankname16 | 5blankname2 | 5blankname3 | 5blankname4 | 5blankname5 | 5blankname6 | 5blankname7 | 5blankname8 | 5blankname9 | 5namedata | 5namedata1 | 5namedata10 | 5namedata11 | 5namedata12 | 5namedata13 | 5namedata14 | 5namedata15 | 5namedata16 | 5namedata2 | 5namedata3 | 5namedata4 | 5namedata5 | 5namedata6 | 5namedata7 | 5namedata8 | 5namedata9 | allegiance | alma_mater | alongside | alongside1 | alongside10 | alongside11 | alongside12 | alongside13 | alongside14 | alongside15 | alongside16 | alongside2 | alongside3 | alongside4 | alongside5 | alongside6 | alongside7 | alongside8 | alongside9 | alt | ambassador_from | ambassador_from1 | ambassador_from10 | ambassador_from11 | ambassador_from12 | ambassador_from13 | ambassador_from14 | ambassador_from15 | ambassador_from16 | ambassador_from2 | ambassador_from3 | ambassador_from4 | ambassador_from5 | ambassador_from6 | ambassador_from7 | ambassador_from8 | ambassador_from9 | appointed | appointed1 | appointed10 | appointed11 | appointed12 | appointed13 | appointed14 | appointed15 | appointed16 | appointed2 | appointed3 | appointed4 | appointed5 | appointed6 | appointed7 | appointed8 | appointed9 | appointer | appointer1 | appointer10 | appointer11 | appointer12 | appointer13 | appointer14 | appointer15 | appointer16 | appointer2 | appointer3 | appointer4 | appointer5 | appointer6 | appointer7 | appointer8 | appointer9 | assembly | assembly1 | assembly10 | assembly11 | assembly12 | assembly13 | assembly14 | assembly15 | assembly16 | assembly2 | assembly3 | assembly4 | assembly5 | assembly6 | assembly7 | assembly8 | assembly9 | awards | battles | birth_date | birth_name | birth_place | birthname | blank1 | blank2 | blank3 | blank4 | blank5 | bodyclass | branch | cabinet | candidate | caption | chancellor | chancellor1 | chancellor10 | chancellor11 | chancellor12 | chancellor13 | chancellor14 | chancellor15 | chancellor16 | chancellor2 | chancellor3 | chancellor4 | chancellor5 | chancellor6 | chancellor7 | chancellor8 | chancellor9 | children | citizenship | co-leader | co-leader1 | co-leader10 | co-leader11 | co-leader12 | co-leader13 | co-leader14 | co-leader15 | co-leader16 | co-leader2 | co-leader3 | co-leader4 | co-leader5 | co-leader6 | co-leader7 | co-leader8 | co-leader9 | commands | committees | constituency | constituency_AM | constituency_AM1 | constituency_AM10 | constituency_AM11 | constituency_AM12 | constituency_AM13 | constituency_AM14 | constituency_AM15 | constituency_AM16 | constituency_AM2 | constituency_AM3 | constituency_AM4 | constituency_AM5 | constituency_AM6 | constituency_AM7 | constituency_AM8 | constituency_AM9 | constituency_MP | constituency_MP1 | constituency_MP10 | constituency_MP11 | constituency_MP12 | constituency_MP13 | constituency_MP14 | constituency_MP15 | constituency_MP16 | constituency_MP2 | constituency_MP3 | constituency_MP4 | constituency_MP5 | constituency_MP6 | constituency_MP7 | constituency_MP8 | constituency_MP9 | constituency1 | constituency10 | constituency11 | constituency12 | constituency13 | constituency14 | constituency15 | constituency16 | constituency2 | constituency3 | constituency4 | constituency5 | constituency6 | constituency7 | constituency8 | constituency9 | convocation | convocation1 | convocation2 | convocation3 | convocation4 | convocation5 | convocation6 | convocation7 | convocation8 | convocation9 | convocation10 | convocation11 | convocation12 | convocation13 | convocation14 | convocation15 | convocation16 | country | country1 | country10 | country11 | country12 | country13 | country14 | country15 | country16 | country2 | country3 | country4 | country5 | country6 | country7 | country8 | country9 | data1 | data2 | data3 | data4 | data5 | date | death_cause | death_date | death_place | deputy | deputy1 | deputy10 | deputy11 | deputy12 | deputy13 | deputy14 | deputy15 | deputy16 | deputy2 | deputy3 | deputy4 | deputy5 | deputy6 | deputy7 | deputy8 | deputy9 | district | district1 | district10 | district11 | district12 | district13 | district14 | district15 | district16 | district2 | district3 | district4 | district5 | district6 | district7 | district8 | district9 | education | election_date | embed | father | firstminister | firstminister1 | firstminister10 | firstminister11 | firstminister12 | firstminister13 | firstminister14 | firstminister15 | firstminister16 | firstminister2 | firstminister3 | firstminister4 | firstminister5 | firstminister6 | firstminister7 | firstminister8 | firstminister9 | footnotes | governor | governor_general | governor_general1 | governor_general10 | governor_general11 | governor_general12 | governor_general13 | governor_general14 | governor_general15 | governor_general16 | governor_general2 | governor_general3 | governor_general4 | governor_general5 | governor_general6 | governor_general7 | governor_general8 | governor_general9 | governor-general | governor-general1 | governor-general10 | governor-general11 | governor-general12 | governor-general13 | governor-general14 | governor-general15 | governor-general16 | governor-general2 | governor-general3 | governor-general4 | governor-general5 | governor-general6 | governor-general7 | governor-general8 | governor-general9 | governor1 | governor10 | governor11 | governor12 | governor13 | governor14 | governor15 | governor16 | governor2 | governor3 | governor4 | governor5 | governor6 | governor7 | governor8 | governor9 | height | honorific_prefix | honorific-prefix | honorific_suffix | honorific-suffix | image | image name | image_size | imagesize | image_upright | incumbent | jr/sr | jr/sr and state | jr/sr and state1 | jr/sr and state10 | jr/sr and state11 | jr/sr and state12 | jr/sr and state13 | jr/sr and state14 | jr/sr and state15 | jr/sr and state16 | jr/sr and state2 | jr/sr and state3 | jr/sr and state4 | jr/sr and state5 | jr/sr and state6 | jr/sr and state7 | jr/sr and state8 | jr/sr and state9 | jr/sr1 | jr/sr10 | jr/sr11 | jr/sr12 | jr/sr13 | jr/sr14 | jr/sr15 | jr/sr16 | jr/sr2 | jr/sr3 | jr/sr4 | jr/sr5 | jr/sr6 | jr/sr7 | jr/sr8 | jr/sr9 | known_for | leader | leader1 | leader10 | leader11 | leader12 | leader13 | leader14 | leader15 | leader16 | leader2 | leader3 | leader4 | leader5 | leader6 | leader7 | leader8 | leader9 | legislature | legislature1 | legislature10 | legislature11 | legislature12 | legislature13 | legislature14 | legislature15 | legislature16 | legislature2 | legislature3 | legislature4 | legislature5 | legislature6 | legislature7 | legislature8 | legislature9 | lieutenant | lieutenant_governor | lieutenant_governor1 | lieutenant_governor10 | lieutenant_governor11 | lieutenant_governor12 | lieutenant_governor13 | lieutenant_governor14 | lieutenant_governor15 | lieutenant_governor16 | lieutenant_governor2 | lieutenant_governor3 | lieutenant_governor4 | lieutenant_governor5 | lieutenant_governor6 | lieutenant_governor7 | lieutenant_governor8 | lieutenant_governor9 | lieutenant1 | lieutenant10 | lieutenant11 | lieutenant12 | lieutenant13 | lieutenant14 | lieutenant15 | lieutenant16 | lieutenant2 | lieutenant3 | lieutenant4 | lieutenant5 | lieutenant6 | lieutenant7 | lieutenant8 | lieutenant9 | mainwidth | majority | majority_floor_leader | majority_floor_leader1 | majority_floor_leader10 | majority_floor_leader11 | majority_floor_leader12 | majority_floor_leader13 | majority_floor_leader14 | majority_floor_leader15 | majority_floor_leader16 | majority_floor_leader2 | majority_floor_leader3 | majority_floor_leader4 | majority_floor_leader5 | majority_floor_leader6 | majority_floor_leader7 | majority_floor_leader8 | majority_floor_leader9 | majority_leader | majority_leader1 | majority_leader10 | majority_leader11 | majority_leader12 | majority_leader13 | majority_leader14 | majority_leader15 | majority_leader16 | majority_leader2 | majority_leader3 | majority_leader4 | majority_leader5 | majority_leader6 | majority_leader7 | majority_leader8 | majority_leader9 | majority1 | majority10 | majority11 | majority12 | majority13 | majority14 | majority15 | majority16 | majority2 | majority3 | majority4 | majority5 | majority6 | majority7 | majority8 | majority9 | majorityleader | majorityleader1 | majorityleader10 | majorityleader11 | majorityleader12 | majorityleader13 | majorityleader14 | majorityleader15 | majorityleader16 | majorityleader2 | majorityleader3 | majorityleader4 | majorityleader5 | majorityleader6 | majorityleader7 | majorityleader8 | majorityleader9 | mawards | military_blank1 | military_blank2 | military_blank3 | military_blank4 | military_blank5 | military_data1 | military_data2 | military_data3 | military_data4 | military_data5 | minister | minister_from | minister_from1 | minister_from10 | minister_from11 | minister_from12 | minister_from13 | minister_from14 | minister_from15 | minister_from16 | minister_from2 | minister_from3 | minister_from4 | minister_from5 | minister_from6 | minister_from7 | minister_from8 | minister_from9 | minister1 | minister10 | minister11 | minister12 | minister13 | minister14 | minister15 | minister16 | minister2 | minister3 | minister4 | minister5 | minister6 | minister7 | minister8 | minister9 | minority_floor_leader | minority_floor_leader1 | minority_floor_leader10 | minority_floor_leader11 | minority_floor_leader12 | minority_floor_leader13 | minority_floor_leader14 | minority_floor_leader15 | minority_floor_leader16 | minority_floor_leader2 | minority_floor_leader3 | minority_floor_leader4 | minority_floor_leader5 | minority_floor_leader6 | minority_floor_leader7 | minority_floor_leader8 | minority_floor_leader9 | minority_leader | minority_leader1 | minority_leader10 | minority_leader11 | minority_leader12 | minority_leader13 | minority_leader14 | minority_leader15 | minority_leader16 | minority_leader2 | minority_leader3 | minority_leader4 | minority_leader5 | minority_leader6 | minority_leader7 | minority_leader8 | minority_leader9 | minorityleader | minorityleader1 | minorityleader10 | minorityleader11 | minorityleader12 | minorityleader13 | minorityleader14 | minorityleader15 | minorityleader16 | minorityleader2 | minorityleader3 | minorityleader4 | minorityleader5 | minorityleader6 | minorityleader7 | minorityleader8 | minorityleader9 | module | module0 | module2 | module3 | module4 | module5 | monarch | monarch1 | monarch10 | monarch11 | monarch12 | monarch13 | monarch14 | monarch15 | monarch16 | monarch2 | monarch3 | monarch4 | monarch5 | monarch6 | monarch7 | monarch8 | monarch9 | mother | name | nationality | native_name | native_name_lang | net_worth | nickname | nominator | nominator1 | nominator10 | nominator11 | nominator12 | nominator13 | nominator14 | nominator15 | nominator16 | nominator2 | nominator3 | nominator4 | nominator5 | nominator6 | nominator7 | nominator8 | nominator9 | nominee | occupation | office | office1 | office10 | office11 | office12 | office13 | office14 | office15 | office16 | office2 | office3 | office4 | office5 | office6 | office7 | office8 | office9 | opponent | order | order1 | order10 | order11 | order12 | order13 | order14 | order15 | order16 | order2 | order3 | order4 | order5 | order6 | order7 | order8 | order9 | otherparty | parents | parliament | parliament1 | parliament10 | parliament11 | parliament12 | parliament13 | parliament14 | parliament15 | parliament16 | parliament2 | parliament3 | parliament4 | parliament5 | parliament6 | parliament7 | parliament8 | parliament9 | parliamentarygroup | parliamentarygroup1 | parliamentarygroup10 | parliamentarygroup11 | parliamentarygroup12 | parliamentarygroup13 | parliamentarygroup14 | parliamentarygroup15 | parliamentarygroup16 | parliamentarygroup2 | parliamentarygroup3 | parliamentarygroup4 | parliamentarygroup5 | parliamentarygroup6 | parliamentarygroup7 | parliamentarygroup8 | parliamentarygroup9 | partner | party | party_election | portfolio | preceded | preceded1 | preceded10 | preceded11 | preceded12 | preceded13 | preceded14 | preceded15 | preceded16 | preceded2 | preceded3 | preceded4 | preceded5 | preceded6 | preceded7 | preceded8 | preceded9 | preceding | preceding1 | preceding10 | preceding11 | preceding12 | preceding13 | preceding14 | preceding15 | preceding16 | preceding2 | preceding3 | preceding4 | preceding5 | preceding6 | preceding7 | preceding8 | preceding9 | predecessor | predecessor1 | predecessor10 | predecessor11 | predecessor12 | predecessor13 | predecessor14 | predecessor15 | predecessor16 | predecessor2 | predecessor3 | predecessor4 | predecessor5 | predecessor6 | predecessor7 | predecessor8 | predecessor9 | premier | premier1 | premier10 | premier11 | premier12 | premier13 | premier14 | premier15 | premier16 | premier2 | premier3 | premier4 | premier5 | premier6 | premier7 | premier8 | premier9 | president | president1 | president10 | president11 | president12 | president13 | president14 | president15 | president16 | president2 | president3 | president4 | president5 | president6 | president7 | president8 | president9 | primeminister | primeminister1 | primeminister10 | primeminister11 | primeminister12 | primeminister13 | primeminister14 | primeminister15 | primeminister16 | primeminister2 | primeminister3 | primeminister4 | primeminister5 | primeminister6 | primeminister7 | primeminister8 | primeminister9 | prior_term | prior_term1 | prior_term10 | prior_term11 | prior_term12 | prior_term13 | prior_term14 | prior_term15 | prior_term16 | prior_term2 | prior_term3 | prior_term4 | prior_term5 | prior_term6 | prior_term7 | prior_term8 | prior_term9 | profession | pronunciation | rank | relations | relatives | residence | resting_place | resting_place_coordinates | restingplace | restingplacecoordinates | riding | riding1 | riding10 | riding11 | riding12 | riding13 | riding14 | riding15 | riding16 | riding2 | riding3 | riding4 | riding5 | riding6 | riding7 | riding8 | riding9 | runningmate | salary | serviceyears | signature | signature_alt | smallimage | source | speaker | speaker_office | spouse | state | state_assembly | state_assembly1 | state_assembly10 | state_assembly11 | state_assembly12 | state_assembly13 | state_assembly14 | state_assembly15 | state_assembly16 | state_assembly2 | state_assembly3 | state_assembly4 | state_assembly5 | state_assembly6 | state_assembly7 | state_assembly8 | state_assembly9 | state_delegate | state_delegate1 | state_delegate10 | state_delegate11 | state_delegate12 | state_delegate13 | state_delegate14 | state_delegate15 | state_delegate16 | state_delegate2 | state_delegate3 | state_delegate4 | state_delegate5 | state_delegate6 | state_delegate7 | state_delegate8 | state_delegate9 | state_house | state_house1 | state_house10 | state_house11 | state_house12 | state_house13 | state_house14 | state_house15 | state_house16 | state_house2 | state_house3 | state_house4 | state_house5 | state_house6 | state_house7 | state_house8 | state_house9 | state_legislature | state_legislature1 | state_legislature10 | state_legislature11 | state_legislature12 | state_legislature13 | state_legislature14 | state_legislature15 | state_legislature16 | state_legislature2 | state_legislature3 | state_legislature4 | state_legislature5 | state_legislature6 | state_legislature7 | state_legislature8 | state_legislature9 | state_senate | state_senate1 | state_senate10 | state_senate11 | state_senate12 | state_senate13 | state_senate14 | state_senate15 | state_senate16 | state_senate2 | state_senate3 | state_senate4 | state_senate5 | state_senate6 | state_senate7 | state_senate8 | state_senate9 | state1 | state10 | state11 | state12 | state13 | state14 | state15 | state16 | state2 | state3 | state4 | state5 | state6 | state7 | state8 | state9 | succeeded | succeeded1 | succeeded10 | succeeded11 | succeeded12 | succeeded13 | succeeded14 | succeeded15 | succeeded16 | succeeded2 | succeeded3 | succeeded4 | succeeded5 | succeeded6 | succeeded7 | succeeded8 | succeeded9 | succeeding | succeeding1 | succeeding10 | succeeding11 | succeeding12 | succeeding13 | succeeding14 | succeeding15 | succeeding16 | succeeding2 | succeeding3 | succeeding4 | succeeding5 | succeeding6 | succeeding7 | succeeding8 | succeeding9 | successor | successor1 | successor10 | successor11 | successor12 | successor13 | successor14 | successor15 | successor16 | successor2 | successor3 | successor4 | successor5 | successor6 | successor7 | successor8 | successor9 | taoiseach | taoiseach1 | taoiseach10 | taoiseach11 | taoiseach12 | taoiseach13 | taoiseach14 | taoiseach15 | taoiseach16 | taoiseach2 | taoiseach3 | taoiseach4 | taoiseach5 | taoiseach6 | taoiseach7 | taoiseach8 | taoiseach9 | term | term_end | term_end1 | term_end10 | term_end11 | term_end12 | term_end13 | term_end14 | term_end15 | term_end16 | term_end2 | term_end3 | term_end4 | term_end5 | term_end6 | term_end7 | term_end8 | term_end9 | term_label | term_label1 | term_label10 | term_label11 | term_label12 | term_label13 | term_label14 | term_label15 | term_label16 | term_label2 | term_label3 | term_label4 | term_label5 | term_label6 | term_label7 | term_label8 | term_label9 | term_start | term_start1 | term_start10 | term_start11 | term_start12 | term_start13 | term_start14 | term_start15 | term_start16 | term_start2 | term_start3 | term_start4 | term_start5 | term_start6 | term_start7 | term_start8 | term_start9 | term1 | term10 | term11 | term12 | term13 | term14 | term15 | term16 | term2 | term3 | term4 | term5 | term6 | term7 | term8 | term9 | termend | termend1 | termend10 | termend11 | termend12 | termend13 | termend14 | termend15 | termend16 | termend2 | termend3 | termend4 | termend5 | termend6 | termend7 | termend8 | termend9 | termlabel | termlabel1 | termlabel10 | termlabel11 | termlabel12 | termlabel13 | termlabel14 | termlabel15 | termlabel16 | termlabel2 | termlabel3 | termlabel4 | termlabel5 | termlabel6 | termlabel7 | termlabel8 | termlabel9 | termstart | termstart1 | termstart10 | termstart11 | termstart12 | termstart13 | termstart14 | termstart15 | termstart16 | termstart2 | termstart3 | termstart4 | termstart5 | termstart6 | termstart7 | termstart8 | termstart9 | title | title1 | title10 | title11 | title12 | title13 | title14 | title15 | title16 | title2 | title3 | title4 | title5 | title6 | title7 | title8 | title9 | unit | vicegovernor | vicegovernor1 | vicegovernor10 | vicegovernor11 | vicegovernor12 | vicegovernor13 | vicegovernor14 | vicegovernor15 | vicegovernor16 | vicegovernor2 | vicegovernor3 | vicegovernor4 | vicegovernor5 | vicegovernor6 | vicegovernor7 | vicegovernor8 | vicegovernor9 | vicepremier | vicepremier1 | vicepremier10 | vicepremier11 | vicepremier12 | vicepremier13 | vicepremier14 | vicepremier15 | vicepremier16 | vicepremier2 | vicepremier3 | vicepremier4 | vicepremier5 | vicepremier6 | vicepremier7 | vicepremier8 | vicepremier9 | vicepresident | vicepresident1 | vicepresident10 | vicepresident11 | vicepresident12 | vicepresident13 | vicepresident14 | vicepresident15 | vicepresident16 | vicepresident2 | vicepresident3 | vicepresident4 | vicepresident5 | vicepresident6 | vicepresident7 | vicepresident8 | vicepresident9 | viceprimeminister | viceprimeminister1 | viceprimeminister10 | viceprimeminister11 | viceprimeminister12 | viceprimeminister13 | viceprimeminister14 | viceprimeminister15 | viceprimeminister16 | viceprimeminister2 | viceprimeminister3 | viceprimeminister4 | viceprimeminister5 | viceprimeminister6 | viceprimeminister7 | viceprimeminister8 | viceprimeminister9 | website | width | year }}<noinclude>{{Documentation}}</noinclude></text>
1670 <sha1>hxake6prnwxhh2qsykyshvi9siidbb7</sha1>
1671 </revision>
1672 </page>
1673 <page>
1674 <title>Template:Basepage subpage</title>
1675 <ns>10</ns>
1676 <id>43986518</id>
1677 <redirect title="Template:When on basepage" />
1678 <revision>
1679 <id>769880910</id>
1680 <parentid>642181889</parentid>
1681 <timestamp>2017-03-12T04:26:29Z</timestamp>
1682 <contributor>
1683 <username>Godsy</username>
1684 <id>23257138</id>
1685 </contributor>
1686 <comment>[[Template:This is a redirect]] has been deprecated, change to [[Template:Redirect category shell]].</comment>
1687 <model>wikitext</model>
1688 <format>text/x-wiki</format>
1689 <text xml:space="preserve" bytes="115">#REDIRECT [[Template:When on basepage]]
1690
1691{{Redirect category shell|
1692{{R from move}}
1693{{R from template shortcut}}
1694}}</text>
1695 <sha1>8auv81suxp1xkygdvxy45lt28yl3p6z</sha1>
1696 </revision>
1697 </page>
1698 <page>
1699 <title>Template:Both</title>
1700 <ns>10</ns>
1701 <id>13984942</id>
1702 <revision>
1703 <id>752919001</id>
1704 <parentid>579826991</parentid>
1705 <timestamp>2016-12-04T04:31:50Z</timestamp>
1706 <contributor>
1707 <username>JJMC89</username>
1708 <id>24812038</id>
1709 </contributor>
1710 <comment>make subst'able</comment>
1711 <model>wikitext</model>
1712 <format>text/x-wiki</format>
1713 <text xml:space="preserve" bytes="123">{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
1714{{documentation}}
1715</noinclude></text>
1716 <sha1>a92g9dgn74wuyygsul02g6cnq29em4t</sha1>
1717 </revision>
1718 </page>
1719 <page>
1720 <title>Template:Br separated entries</title>
1721 <ns>10</ns>
1722 <id>27461703</id>
1723 <revision>
1724 <id>664153181</id>
1725 <parentid>579827061</parentid>
1726 <timestamp>2015-05-26T18:06:33Z</timestamp>
1727 <contributor>
1728 <username>Izkala</username>
1729 <id>23051379</id>
1730 </contributor>
1731 <comment>Switch to using [[Module:Separated entries]]; leading and trailing whitespace and newlines are now trimmed</comment>
1732 <model>wikitext</model>
1733 <format>text/x-wiki</format>
1734 <text xml:space="preserve" bytes="111">{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
1735{{documentation}}
1736</noinclude></text>
1737 <sha1>3qzqyo0vc2bkjx7dik52fp751jwcnq3</sha1>
1738 </revision>
1739 </page>
1740 <page>
1741 <title>Template:Category link with count</title>
1742 <ns>10</ns>
1743 <id>30847816</id>
1744 <revision>
1745 <id>827250605</id>
1746 <parentid>804533676</parentid>
1747 <timestamp>2018-02-23T17:02:11Z</timestamp>
1748 <contributor>
1749 <username>Primefac</username>
1750 <id>11508456</id>
1751 </contributor>
1752 <minor/>
1753 <comment>Changed protection level for "[[Template:Category link with count]]": [[WP:HIGHRISK|high-risk]] template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
1754 <model>wikitext</model>
1755 <format>text/x-wiki</format>
1756 <text xml:space="preserve" bytes="307">[[:Category:{{#ifeq:{{str left|{{{1}}}|9}}|Category:|{{str right|{{{1}}}|9}}|{{{1}}}}}]]&nbsp;({{PAGESINCATEGORY:{{#ifeq:{{str left|{{{1}}}|9}}|Category:|{{str right|{{{1}}}|9}}|{{{1}}}}}|{{{2|all}}}}})<noinclude>
1757{{Documentation|Template:Clc/doc}}
1758[[Category:Internal category-link templates]]
1759</noinclude></text>
1760 <sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1>
1761 </revision>
1762 </page>
1763 <page>
1764 <title>Template:Clc</title>
1765 <ns>10</ns>
1766 <id>52342109</id>
1767 <redirect title="Template:Category link with count" />
1768 <revision>
1769 <id>827250628</id>
1770 <parentid>804533685</parentid>
1771 <timestamp>2018-02-23T17:02:12Z</timestamp>
1772 <contributor>
1773 <username>Primefac</username>
1774 <id>11508456</id>
1775 </contributor>
1776 <minor/>
1777 <comment>Changed protection level for "[[Template:Clc]]": [[WP:HIGHRISK|high-risk]] template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
1778 <model>wikitext</model>
1779 <format>text/x-wiki</format>
1780 <text xml:space="preserve" bytes="94">#REDIRECT [[Template:Category link with count]]
1781
1782[[Category:Internal category-link templates]]</text>
1783 <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1>
1784 </revision>
1785 </page>
1786 <page>
1787 <title>Template:Clear</title>
1788 <ns>10</ns>
1789 <id>1239772</id>
1790 <revision>
1791 <id>684162145</id>
1792 <parentid>683948339</parentid>
1793 <timestamp>2015-10-04T23:53:36Z</timestamp>
1794 <contributor>
1795 <username>Nyttend</username>
1796 <id>1960810</id>
1797 </contributor>
1798 <minor/>
1799 <comment>Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment>
1800 <model>wikitext</model>
1801 <format>text/x-wiki</format>
1802 <text xml:space="preserve" bytes="81"><div style="clear:{{{1|both}}};"></div><noinclude>
1803{{documentation}}
1804</noinclude></text>
1805 <sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1>
1806 </revision>
1807 </page>
1808 <page>
1809 <title>Template:Column-width</title>
1810 <ns>10</ns>
1811 <id>29216399</id>
1812 <revision>
1813 <id>638540885</id>
1814 <parentid>579832996</parentid>
1815 <timestamp>2014-12-17T20:09:33Z</timestamp>
1816 <contributor>
1817 <username>Edokter</username>
1818 <id>1624037</id>
1819 </contributor>
1820 <minor/>
1821 <comment>redundant</comment>
1822 <model>wikitext</model>
1823 <format>text/x-wiki</format>
1824 <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: {{{1|30em}}}; -webkit-column-width: {{{1|30em}}}; column-width: {{{1|30em}}};</includeonly><noinclude>
1825{{documentation}}
1826</noinclude></text>
1827 <sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1>
1828 </revision>
1829 </page>
1830 <page>
1831 <title>Template:CountryPrefixThe</title>
1832 <ns>10</ns>
1833 <id>52976455</id>
1834 <revision>
1835 <id>818775229</id>
1836 <parentid>817191733</parentid>
1837 <timestamp>2018-01-05T14:33:33Z</timestamp>
1838 <contributor>
1839 <username>Jonesey95</username>
1840 <id>9755426</id>
1841 </contributor>
1842 <comment>rm Gambia, since it should be written "Gambia" or "The Gambia", not "the Gambia", apparently. Pedantic.</comment>
1843 <model>wikitext</model>
1844 <format>text/x-wiki</format>
1845 <text xml:space="preserve" bytes="688">{{#switch: {{{1|}}}
1846| Bahamas | British Virgin Islands | Central African Republic | Cayman Islands | Comoros| Cook Islands | Democratic Republic of the Congo | Czech Republic | Dominican Republic | Falkland Islands | Faroe Islands | Federated States of Micronesia | Isle of Man | Marshall Islands | Netherlands | Netherlands Antilles | Northern Mariana Islands | Ottoman Empire | State of Palestine | Philippines | Republic of the Congo | Republic of Macedonia | Solomon Islands | Soviet Union | Turks and Caicos Islands | United Arab Emirates | United Kingdom | United States | United States Virgin Islands = the {{{1|}}}
1847|#default = {{{1|}}}
1848}}<noinclude>
1849{{Documentation}}
1850</noinclude></text>
1851 <sha1>5d4k5ybi2hyt08r7pjn6htr69x0qm99</sha1>
1852 </revision>
1853 </page>
1854 <page>
1855 <title>Template:DPP</title>
1856 <ns>10</ns>
1857 <id>11474048</id>
1858 <revision>
1859 <id>577859213</id>
1860 <parentid>399530343</parentid>
1861 <timestamp>2013-10-19T16:15:09Z</timestamp>
1862 <contributor>
1863 <username>WOSlinker</username>
1864 <id>3138265</id>
1865 </contributor>
1866 <minor/>
1867 <comment>Changed protection level of Template:DPP: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
1868 <model>wikitext</model>
1869 <format>text/x-wiki</format>
1870 <text xml:space="preserve" bytes="87">{{DPP/logo}} [[Democratic Progressive Party]]<noinclude>
1871{{documentation}}
1872</noinclude></text>
1873 <sha1>ogcndsb1r2npmn6x22l5b68f3468dht</sha1>
1874 </revision>
1875 </page>
1876 <page>
1877 <title>Template:DPP/logo</title>
1878 <ns>10</ns>
1879 <id>29792285</id>
1880 <revision>
1881 <id>825510940</id>
1882 <parentid>725082550</parentid>
1883 <timestamp>2018-02-13T20:32:59Z</timestamp>
1884 <contributor>
1885 <username>WOSlinker</username>
1886 <id>3138265</id>
1887 </contributor>
1888 <comment>separate pp-template not needed</comment>
1889 <model>wikitext</model>
1890 <format>text/x-wiki</format>
1891 <text xml:space="preserve" bytes="87">[[File:Green Taiwan in White Cross.svg|20px]]<noinclude>
1892{{documentation}}
1893</noinclude></text>
1894 <sha1>0y8l7qshw8kf36qrxoxr7phmdlphkki</sha1>
1895 </revision>
1896 </page>
1897 <page>
1898 <title>Template:Documentation</title>
1899 <ns>10</ns>
1900 <id>13529042</id>
1901 <revision>
1902 <id>714754089</id>
1903 <parentid>714753814</parentid>
1904 <timestamp>2016-04-11T17:18:54Z</timestamp>
1905 <contributor>
1906 <username>Rich Farmbrough</username>
1907 <id>82835</id>
1908 </contributor>
1909 <comment>Undid revision 714753814 by [[Special:Contributions/Rich Farmbrough|Rich Farmbrough]] ([[User talk:Rich Farmbrough|talk]])</comment>
1910 <model>wikitext</model>
1911 <format>text/x-wiki</format>
1912 <text xml:space="preserve" bytes="182">{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
1913<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
1914</noinclude></text>
1915 <sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1>
1916 </revision>
1917 </page>
1918 <page>
1919 <title>Template:Documentation subpage</title>
1920 <ns>10</ns>
1921 <id>7890381</id>
1922 <revision>
1923 <id>617432645</id>
1924 <parentid>608599904</parentid>
1925 <timestamp>2014-07-18T09:37:22Z</timestamp>
1926 <contributor>
1927 <username>Sardanaphalus</username>
1928 <id>427947</id>
1929 </contributor>
1930 <comment>Added 1.0em margin so template looks less a part of subsequent content and amended code layout -- hope neither of these too controversial</comment>
1931 <model>wikitext</model>
1932 <format>text/x-wiki</format>
1933 <text xml:space="preserve" bytes="1667"><includeonly><!--
1934 -->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
1935 | <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
1936</includeonly><!--
1937
1938 -->{{#ifeq:{{{doc-notice|show}}} |show
1939 | {{Mbox
1940 | type = notice
1941 | style = margin-bottom:1.0em;
1942 | image = [[File:Edit-copy green.svg|40px|alt=|link=]]
1943 | text =
1944'''This is a [[Wikipedia:Template documentation|documentation]] [[Wikipedia:Subpages|subpage]] for {{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}'''.<br />It contains usage information, [[Wikipedia:Categorization|categories]] and other content that is not part of the original {{#if:{{{text2|}}} |{{{text2}}} |{{#if:{{{text1|}}} |{{{text1}}} |{{#ifeq:{{SUBJECTSPACE}} |{{ns:User}} |{{lc:{{SUBJECTSPACE}}}} template page |{{#if:{{SUBJECTSPACE}} |{{lc:{{SUBJECTSPACE}}}} page|article}}}}}}}}.
1945 }}
1946 }}<!--
1947
1948 -->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
1949
1950 -->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
1951 | <includeonly><!--
1952 -->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
1953 | [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
1954 | [[Category:Documentation subpages without corresponding pages]]
1955 }}<!--
1956 --></includeonly>
1957 }}<!--
1958
1959(completing initial #ifeq: at start of template:)
1960--><includeonly>
1961 | <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
1962 }}<!--
1963--></includeonly><noinclude>{{Documentation}}</noinclude></text>
1964 <sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1>
1965 </revision>
1966 </page>
1967 <page>
1968 <title>Template:Flatlist/microformat</title>
1969 <ns>10</ns>
1970 <id>36831247</id>
1971 <revision>
1972 <id>590162792</id>
1973 <parentid>567192725</parentid>
1974 <timestamp>2014-01-11T02:01:02Z</timestamp>
1975 <contributor>
1976 <username>Mark Arsten</username>
1977 <id>15020596</id>
1978 </contributor>
1979 <minor/>
1980 <comment>Protected Template:Flatlist/microformat: [[WP:High-risk templates|Highly visible template]] ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</comment>
1981 <model>wikitext</model>
1982 <format>text/x-wiki</format>
1983 <text xml:space="preserve" bytes="175"><div class="hlist">{{{1}}}</div><noinclude>
1984{{documentation|content=A separate version of the flatlist template for use on the microformat documentation pages.}}
1985
1986</noinclude></text>
1987 <sha1>sxo2o920rctg4u89zzp6mnyzszcql6m</sha1>
1988 </revision>
1989 </page>
1990 <page>
1991 <title>Template:For</title>
1992 <ns>10</ns>
1993 <id>1808502</id>
1994 <revision>
1995 <id>850158102</id>
1996 <parentid>848893061</parentid>
1997 <timestamp>2018-07-14T01:05:26Z</timestamp>
1998 <contributor>
1999 <username>Primefac</username>
2000 <id>11508456</id>
2001 </contributor>
2002 <comment>TFD closed as no consensus ([[WP:XFDC|XFDcloser]])</comment>
2003 <model>wikitext</model>
2004 <format>text/x-wiki</format>
2005 <text xml:space="preserve" bytes="88"><includeonly>{{#invoke:For|For}}</includeonly><noinclude>
2006{{Documentation}}
2007</noinclude></text>
2008 <sha1>7es2p1mk6qse8zlwn5qqya2ysrq1rcr</sha1>
2009 </revision>
2010 </page>
2011 <page>
2012 <title>Template:Generic template demo</title>
2013 <ns>10</ns>
2014 <id>43381292</id>
2015 <redirect title="Template:Parameter names example" />
2016 <revision>
2017 <id>821201376</id>
2018 <parentid>620313329</parentid>
2019 <timestamp>2018-01-19T00:29:55Z</timestamp>
2020 <contributor>
2021 <username>Primefac</username>
2022 <id>11508456</id>
2023 </contributor>
2024 <minor/>
2025 <comment>Protected "[[Template:Generic template demo]]": [[WP:SEMIPROT|semi-protection]] of high-usage templates to combat systematic vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (inde...</comment>
2026 <model>wikitext</model>
2027 <format>text/x-wiki</format>
2028 <text xml:space="preserve" bytes="166">#redirect [[Template:Parameter names example]]
2029
2030[[Category:Wikipedia utility templates]]
2031[[Category:Template namespace templates]]
2032[[Category:Template documentation]]</text>
2033 <sha1>ogbr4wqk2lnafw0hlw1wy7gr9imxk3k</sha1>
2034 </revision>
2035 </page>
2036 <page>
2037 <title>Template:Hatnote</title>
2038 <ns>10</ns>
2039 <id>945764</id>
2040 <revision>
2041 <id>609825987</id>
2042 <parentid>607120708</parentid>
2043 <timestamp>2014-05-23T15:55:04Z</timestamp>
2044 <contributor>
2045 <username>SMcCandlish</username>
2046 <id>378390</id>
2047 </contributor>
2048 <minor/>
2049 <comment>tweak</comment>
2050 <model>wikitext</model>
2051 <format>text/x-wiki</format>
2052 <text xml:space="preserve" bytes="171"><includeonly>{{#invoke:Hatnote|hatnote}}</includeonly><noinclude>
2053{{documentation}}
2054<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
2055</noinclude></text>
2056 <sha1>8nnude79i1y2v6yy2z7j285k1k4v8p3</sha1>
2057 </revision>
2058 </page>
2059 <page>
2060 <title>Template:High-risk</title>
2061 <ns>10</ns>
2062 <id>11453893</id>
2063 <revision>
2064 <id>840937597</id>
2065 <parentid>839761457</parentid>
2066 <timestamp>2018-05-13T01:30:44Z</timestamp>
2067 <contributor>
2068 <username>Primefac</username>
2069 <id>11508456</id>
2070 </contributor>
2071 <comment>Per [[Wikipedia:Templates for discussion/Log/2018 May 5#Template:High-risk]], added {{being deleted}} ([[WP:XFDC|XFDcloser]])</comment>
2072 <model>wikitext</model>
2073 <format>text/x-wiki</format>
2074 <text xml:space="preserve" bytes="1633"><noinclude>{{Being deleted|2018 May 5|Template:High-risk|merge=Template:High-use}}</noinclude>{{ombox
2075| type = content
2076| image = [[File:Ambox warning orange.svg|40px|alt=Warning|link=]]
2077| imageright =
2078| text =
2079'''This {{
2080#switch:{{NAMESPACE}}
2081|Module=Lua module
2082|#default=template
2083}} is used on <span class="plainlinks">[https://tools.wmflabs.org/templatecount/index.php?lang=en&namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&name={{urlencode:{{
2084#switch: {{SUBPAGENAME}}
2085| doc | sandbox = {{BASEPAGENAME}}
2086| #default = {{PAGENAME}}
2087}}}} {{#if:{{{1|}}}|{{formatnum:{{{1}}}}}|a very large number of}} pages]</span>.'''{{#if:{{{info|}}}|<br />{{{info}}}}}<br />To avoid large-scale disruption and unnecessary server load, any changes to it should first be tested in its [[{{
2088#switch: {{SUBPAGENAME}}
2089| doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
2090| #default = {{SUBJECTPAGENAME}}
2091}}/sandbox|/sandbox]] or [[{{
2092#switch: {{SUBPAGENAME}}
2093| doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
2094| #default = {{SUBJECTPAGENAME}}
2095}}/testcases|/testcases]] subpages{{
2096#switch:{{NAMESPACE}}
2097|Module=.
2098|#default=&#32;or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].
2099}} The tested changes can then be added to this page in a single edit. Please consider discussing any changes {{#if:{{{2|}}}|at [[{{{2}}}]]|on the [[{{
2100#switch: {{SUBPAGENAME}}
2101| doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}}
2102| #default = {{TALKPAGENAME}}
2103}}|talk page]]}} before implementing them.
2104}}<noinclude>
2105{{Documentation}}
2106<!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
2107</noinclude></text>
2108 <sha1>mao65vhyco3hzz1tlvnydcjrss7fwph</sha1>
2109 </revision>
2110 </page>
2111 <page>
2112 <title>Template:Infobox</title>
2113 <ns>10</ns>
2114 <id>891845</id>
2115 <revision>
2116 <id>844984935</id>
2117 <parentid>844983838</parentid>
2118 <timestamp>2018-06-08T14:52:46Z</timestamp>
2119 <contributor>
2120 <username>Primefac</username>
2121 <id>11508456</id>
2122 </contributor>
2123 <comment>don't know how I messed that one up...</comment>
2124 <model>wikitext</model>
2125 <format>text/x-wiki</format>
2126 <text xml:space="preserve" bytes="340">{{#invoke:Infobox|infobox}}<includeonly>{{template other|{{#ifeq:{{PAGENAME}}|Infobox||{{#ifeq:{{str left|{{SUBPAGENAME}}|7}}|Infobox|[[Category:Infobox templates|{{remove first word|{{SUBPAGENAME}}}}]]}}}}|}}</includeonly><noinclude>
2127{{documentation}}
2128<!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
2129</noinclude></text>
2130 <sha1>f4hgwrnr11ahhwyo266vcd10dpi92pe</sha1>
2131 </revision>
2132 </page>
2133 <page>
2134 <title>Template:Infobox officeholder/doc</title>
2135 <ns>10</ns>
2136 <id>10961078</id>
2137 <revision>
2138 <id>825299205</id>
2139 <parentid>822718097</parentid>
2140 <timestamp>2018-02-12T16:34:41Z</timestamp>
2141 <contributor>
2142 <username>Paine Ellsworth</username>
2143 <id>9092818</id>
2144 </contributor>
2145 <minor/>
2146 <comment>update /doc</comment>
2147 <model>wikitext</model>
2148 <format>text/x-wiki</format>
2149 <text xml:space="preserve" bytes="61698">{{Documentation subpage}}
2150{{Person infobox header}}
2151{{high-risk| 123000+ }}
2152{{Notice|Please note that in June 2017, the {{para|religion}} parameter was removed from Infobox officeholder as a result of [[Template talk:Infobox officeholder/Archive 21#Religion in officeholder infoboxes|this discussion]].}}
2153{{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
2154
2155{{tl|Infobox officeholder}} incorporates the following templates (i.e. all the templates listed <span class="plainlinks">[{{fullurl:Special:WhatLinksHere/Template:Infobox officeholder|namespace=10&limit=1000&hidetrans=1&hidelinks=1}} here]</span>). Please use the most appropriate name when placing this template on a page.
2156
2157{{refbegin|colwidth=20em}}
2158* {{Tld|Infobox AM}}
2159* {{Tld|Infobox Canadian MP}}
2160* {{Tld|Infobox Canadian senator}}
2161* {{Tld|Infobox candidate}}
2162* {{Tld|Infobox chancellor}}
2163* {{Tld|Infobox congressional candidate}}
2164* {{Tld|Infobox congressman}}
2165* {{Tld|Infobox defense minister}}
2166* {{Tld|Infobox deputy first minister}}
2167* {{Tld|Infobox deputy prime minister}}
2168* {{Tld|Infobox doge}}
2169* {{Tld|Infobox Eritrea cabinet official}}
2170* {{Tld|Infobox first lady}}
2171* {{Tld|Infobox first minister}}
2172* {{Tld|Infobox governor}}
2173* {{Tld|Infobox governor-elect}}
2174* {{Tld|Infobox governor general}}
2175* {{Tld|Infobox governor-general}}
2176* {{Tld|Infobox Indian politician}}
2177* {{Tld|Infobox judge}}
2178* {{Tld|Infobox lt governor}}
2179* {{Tld|Infobox mayor}}
2180* {{Tld|Infobox MEP}}
2181* {{Tld|Infobox minister}}
2182* {{Tld|Infobox MLA}}
2183* {{Tld|Infobox MP}}
2184* {{Tld|Infobox MSP}}
2185* {{Tld|Infobox PM}}
2186* {{Tld|Infobox politician}}
2187* {{Tld|Infobox politician (general)}}
2188* {{Tld|Infobox premier}}
2189* {{Tld|Infobox president}}
2190* {{Tld|Infobox president-elect}}
2191* {{Tld|Infobox prime minister}}
2192* {{Tld|Infobox prime minister-elect}}
2193* {{Tld|Infobox representative-elect}}
2194* {{Tld|Infobox SCC chief justice}}
2195* {{Tld|Infobox SCC puisne justice}}
2196* {{Tld|Infobox secretary-general}}
2197* {{Tld|Infobox senator}}
2198* {{Tld|Infobox senator-elect}}
2199* {{Tld|Infobox speaker}}
2200* {{Tld|Infobox state representative}}
2201* {{Tld|Infobox state SC associate justice}}
2202* {{Tld|Infobox state SC justice}}
2203* {{Tld|Infobox state senator}}
2204* {{Tld|Infobox US ambassador}}
2205* {{Tld|Infobox US associate justice}}
2206* {{Tld|Infobox US cabinet official}}
2207* {{Tld|Infobox US chief justice}}
2208* {{Tld|Infobox US territorial governor}}
2209* {{Tld|Infobox vice president}}
2210{{refend}}
2211
2212==Usage==
2213{{hatnote|Note: This template is for use on articles about '''individual persons'''. For the infobox for use on articles about offices/positions, see [[Template:Infobox official post]].}}
2214
2215Paste the code for the relevant office and then add the [[#Personal data|personal data]] to the bottom. There are no required fields and some fields will not appear when others are in use. For instructions on how to implement multiple terms, see [[Template:Infobox officeholder/example#Multiple terms|this page]]. For advice on alt text, see ''[[Wikipedia:Alternative text for images]]''.
2216
2217The parameter {{para|order}} is used in conjunction with {{para|office}} to state that the officeholder is the ''n''th holder of the office, for example "42nd President of the United States". This should only be used when there is a well established use of such numbering in reliable sources. Do not add numbers simply based on a Wikipedia list of holders of the office, because (1) the list may not be accurate and (2) even with a definite list, different numbering systems could be applied (as to how various categories of "irregular" officeholders should be counted, and as to the counting of those serving for multiple non-consecutive periods) making the numbers arbitrary; and even where such issues are not yet present, they are bound to be in the future, making this unsustainable. Per [[WP:SEAOFBLUE]], is not recommended to wikilink {{para|order}} to a list of officeholders, even if such a list exists.
2218
2219If {{para|order}} is not specified, the value of {{para|office}} can be [[Help:Link#Wikilinks|wikilinked]] in the usual way, for example, "<code><nowiki>[[Ministry of Defence (Singapore)|Minister for Defence]]</nowiki></code>". However, if {{para|order}} is specified together with {{para|office}}, the value of {{para|office}} is automatically linked to a Wikipedia article of the same name, whether such an article exists or not. Wikilinking cannot be used to redirect the link elsewhere, but a [[Wikipedia:Piped link|piped link]] can be created like this: "<code><nowiki>Ministry of Defence (Singapore){{!}}Minister for Defence</nowiki></code>" (note that the double square brackets have been omitted).
2220
2221When both a start and an end term are given, you can instead specify the complete term using the parameters {{para|term}}, {{para|term2}}, etc. This can be helpful for complicated terms that cannot be given as simple starting or ending dates, or if you prefer something other than the default term separator (an en dash, with spaces around it if the start or end is not a simple integer date).
2222
2223Where a politician was redistricted into a new district, you can use {{para|prior_term}} to indicate which district(s) he was in before. This saves space in the infobox by not generating a completely new office each time redistricting happens. If you do this, it is recommended that you list the person who preceded the subject when the subject first took office and the person who succeeded the subject when the subject last left office. Where the use of "same district number" is used for determining "predecessor" and "successor" in any office, but where the area is so altered as to make such a "predecessor" or "successor" of little or no biographical value, the word "redistricted" should be used rather than using names of officeholders whose connection is accidental by virtue of district number, but unrelated to any election contests between officeholders.
2224
2225Please do not re-purpose any fields to add decorative images, icons or flags. Template:Infobox viceroy styles or the like can be used for this. [[WP:INFOBOXFLAG]] applies here.
2226
2227The infobox for an incumbent officeholder should not mention an [[-elect|elected or designated]] successor, or the end date of the term, until the transition actually takes place.
2228
2229===General office===
2230{{For|examples of this code in use|Template:Infobox officeholder/example#General office}}
2231{{Generic template demo
2232 | honorific_prefix
2233 | name
2234 | native_name
2235 | native_name_lang
2236 | honorific_suffix
2237 | image
2238 | image_size
2239 | image_upright
2240 | smallimage
2241 | alt
2242 | caption
2243 | order
2244 | office
2245 | term_start
2246 | term_end<!-- Add data only when the actual term has ended, not for terms which will end in the future. (Per usage guideline.) -->
2247 | alongside
2248 | monarch
2249 | president
2250 | governor_general
2251 | primeminister
2252 | chancellor
2253 | taoiseach
2254 | governor
2255 | vicepresident
2256 | viceprimeminister
2257 | deputy
2258 | lieutenant
2259 | parliamentarygroup
2260 | constituency
2261 | majority
2262 | predecessor
2263 | successor
2264 | prior_term
2265 | order2
2266 | office2
2267 | term_start2
2268 | term_end2
2269 | alongside2
2270 | monarch2
2271 | president2
2272 | governor_general2
2273 | primeminister2
2274 | chancellor2
2275 | taoiseach2
2276 | governor2
2277 | vicepresident2
2278 | viceprimeminister2
2279 | deputy2
2280 | lieutenant2
2281 | parliamentarygroup2
2282 | constituency2
2283 | predecessor2
2284 | successor2
2285 | majority2
2286 | prior_term2
2287}}
2288<pre style="overflow:auto;">
2289{{Infobox officeholder
2290 | honorific_prefix =
2291 | name =
2292 | native_name = <!--The person's name in their own language, if different.-->
2293 | native_name_lang = <!--ISO 639-1 code, e.g., "fr" for French. If more than one, use {{lang}} in |native_name= instead.-->
2294 | honorific_suffix =
2295 | image =
2296 | image_size =
2297 | image_upright =
2298 | smallimage = <!--If this is specified, "image" should not be.-->
2299 | alt =
2300 | caption =
2301 | order =
2302 | office =
2303 | term_start =
2304 | term_end = <!-- Add data only when the actual term has ended, not for terms which will end in the future. (Per usage guideline.) -->
2305 | alongside = <!--For two or more people serving in the same position from the same district. (e.g. United States Senators.)-->
2306 | monarch =
2307 | president =
2308 | governor_general =
2309 | primeminister =
2310 | taoiseach =
2311 | chancellor =
2312 | governor =
2313 | vicepresident =
2314 | viceprimeminister =
2315 | deputy =
2316 | lieutenant =
2317 | succeeding = <!--For President-elect or equivalent-->
2318 | parliamentarygroup =
2319 | constituency =
2320 | majority =
2321 | predecessor =
2322 | successor =
2323 | prior_term =
2324 | order2 = <!--Can be repeated up to 16 times by changing the number-->
2325 | office2 = <!--Can be repeated up to 16 times by changing the number-->
2326 | term_start2 = <!--Can be repeated up to 16 times by changing the number-->
2327 | term_end2 = <!--Can be repeated up to 16 times by changing the number-->
2328 | alongside2 = <!--Can be repeated up to 16 times by changing the number-->
2329 | monarch2 = <!--Can be repeated up to 16 times by changing the number-->
2330 | president2 = <!--Can be repeated up to 16 times by changing the number-->
2331 | governor_general2 = <!--Can be repeated up to 16 times by changing the number-->
2332 | primeminister2 = <!--Can be repeated up to 16 times by changing the number-->
2333 | chancellor2 = <!--Can be repeated up to 16 times by changing the number-->
2334 | taoiseach2 = <!--Can be repeated up to 16 times by changing the number-->
2335 | governor2 = <!--Can be repeated up to 16 times by changing the number-->
2336 | vicepresident2 = <!--Can be repeated up to 16 times by changing the number-->
2337 | viceprimeminister2 = <!--Can be repeated up to 16 times by changing the number-->
2338 | deputy2 = <!--Can be repeated up to 16 times by changing the number-->
2339 | lieutenant2 = <!--Can be repeated up to 16 times by changing the number-->
2340 | succeeding2 = <!--Can be repeated up to 16 times by changing the number-->
2341 | predecessor2 = <!--Can be repeated up to 16 times by changing the number-->
2342 | successor2 = <!--Can be repeated up to 16 times by changing the number-->
2343 | parliamentarygroup2= <!--Can be repeated up to 16 times by changing the number-->
2344 | constituency2 = <!--Can be repeated up to 16 times by changing the number-->
2345 | majority2 = <!--Can be repeated up to 16 times by changing the number-->
2346 | prior_term2 = <!--Can be repeated up to 16 times by changing the number-->
2347</pre>
2348''add [[#Personal data|personal data]]''
2349{{clear}}
2350
2351===Ambassador===
2352{{For|examples of this code in use|Template:Infobox officeholder/example#Ambassador}}
2353{{Generic template demo
2354 | honorific_prefix
2355 | name
2356 | honorific_suffix
2357 | image
2358 | alt
2359 | order
2360 | ambassador_from
2361 | country
2362 | term_start
2363 | term_end
2364 | predecessor
2365 | successor
2366 | president
2367}}
2368<pre style="overflow:auto;">
2369{{Infobox ambassador
2370 | honorific_prefix =
2371 | name =
2372 | honorific_suffix =
2373 | image =
2374 | alt =
2375 | order = <!--Can be repeated up to 16 times by adding a number-->
2376 | ambassador_from = <!--Can be repeated up to 16 times by adding a number-->
2377 | country = <!--Can be repeated up to 16 times by adding a number-->
2378 | term_start = <!--Can be repeated up to 16 times by adding a number-->
2379 | term_end = <!--Can be repeated up to 16 times by adding a number-->
2380 | predecessor = <!--Can be repeated up to 16 times by adding a number-->
2381 | successor = <!--Can be repeated up to 16 times by adding a number-->
2382 | president = <!--Can be repeated up to 16 times by adding a number-->
2383</pre>
2384''add [[#Personal data|personal data]]''
2385{{clear}}
2386
2387===Assembly Member===
2388{{For|examples of this code in use|Template:Infobox officeholder/example#Assembly Member}}
2389{{Generic template demo
2390 | honorific_prefix
2391 | name
2392 | honorific_suffix
2393 | image
2394 | alt
2395 | caption
2396 | constituency_AM
2397 | assembly
2398 | majority
2399 | term_start
2400 | term_end
2401 | predecessor
2402 | successor
2403 | prior_term
2404}}
2405<pre style="overflow:auto;">
2406{{Infobox AM
2407 | honorific_prefix =
2408 | name =
2409 | honorific_suffix =
2410 | image =
2411 | alt =
2412 | caption =
2413 | constituency_AM = <!--Can be repeated up to eight times by adding a number-->
2414 | assembly = <!--Can be repeated up to 16 times by adding a number-->
2415 | majority = <!--Can be repeated up to 16 times by adding a number-->
2416 | term_start = <!--Can be repeated up to 16 times by adding a number-->
2417 | term_end = <!--Can be repeated up to 16 times by adding a number-->
2418 | predecessor = <!--Can be repeated up to 16 times by adding a number-->
2419 | successor = <!--Can be repeated up to 16 times by adding a number-->
2420 | prior_term =
2421</pre>
2422''add [[#Personal data|personal data]]''
2423{{clear}}
2424
2425===Governor===
2426{{For|examples of this code in use|Template:Infobox officeholder/example#Governor}}
2427{{Generic template demo
2428 | honorific_prefix
2429 | name
2430 | honorific_suffix
2431 | image
2432 | alt
2433 | order
2434 | office
2435 | term_start
2436 | term_end
2437 | lieutenant
2438 | predecessor
2439 | successor
2440}}
2441<pre style="overflow:auto;">
2442{{Infobox governor
2443 | honorific_prefix =
2444 | name =
2445 | honorific_suffix =
2446 | image =
2447 | alt =
2448 | order = <!--Can be repeated up to 16 times by adding a number-->
2449 | office = <!--Can be repeated up to 16 times by adding a number-->
2450 | term_start = <!--Can be repeated up to 16 times by adding a number-->
2451 | term_end = <!--Can be repeated up to 16 times by adding a number-->
2452 | lieutenant = <!--Can be repeated up to 16 times by adding a number-->
2453 | predecessor = <!--Can be repeated up to 16 times by adding a number-->
2454 | successor = <!--Can be repeated up to 16 times by adding a number-->
2455</pre>
2456''add [[#Personal data|personal data]]''
2457{{clear}}
2458
2459If Governor was appointed by a President, add:
2460{{Generic template demo
2461 | president
2462}}
2463<pre style="overflow:auto;">
2464 | president = <!--name of president-->
2465</pre>
2466{{clear}}
2467
2468If Governor appointed by other, add:
2469{{Generic template demo
2470 | appointed
2471}}
2472<pre style="overflow:auto;">
2473 | appointed = <!--name of appointer-->
2474</pre>
2475{{clear}}
2476
2477===Judge===
2478{{For|examples of this code in use|Template:Infobox officeholder/example#Judge}}
2479{{Generic template demo
2480 | honorific_prefix
2481 | name
2482 | honorific_suffix
2483 | image
2484 | alt
2485 | caption
2486 | office
2487 | term_start
2488 | term_end
2489 | nominator
2490 | appointer
2491 | predecessor
2492 | successor
2493}}
2494<pre style="overflow:auto;">
2495{{Infobox judge
2496 | honorific_prefix =
2497 | name =
2498 | honorific_suffix =
2499 | image =
2500 | alt =
2501 | caption =
2502 | office = <!--Can be repeated up to 16 times by changing the number-->
2503 | term_start = <!--Can be repeated up to 16 times by changing the number-->
2504 | term_end = <!--Can be repeated up to 16 times by changing the number-->
2505 | nominator = <!--Can be repeated up to 16 times by changing the number-->
2506 | appointer = <!--Can be repeated up to 16 times by changing the number-->
2507 | predecessor = <!--Can be repeated up to 16 times by changing the number-->
2508 | successor = <!--Can be repeated up to 16 times by changing the number-->
2509</pre>
2510''add [[#Personal data|personal data]]''
2511{{clear}}
2512
2513===Nominee/candidate===
2514{{For|examples of this code in use|Template:Infobox officeholder/example#Nominee/candidate}}
2515:'''''Do not add this section to pages of people who have held a previous office.'''''
2516{{Generic template demo
2517 | honorific_prefix
2518 | name
2519 | honorific_suffix
2520 | image
2521 | alt
2522 | caption
2523 | nominee
2524 | party_election
2525 | election_date
2526 | runningmate
2527 | opponent
2528 | incumbent
2529}}
2530<pre style="overflow:auto;">
2531{{Infobox candidate
2532 | honorific_prefix =
2533 | name =
2534 | honorific_suffix =
2535 | image =
2536 | alt =
2537 | caption =
2538 | nominee =
2539 | party_election =
2540 | election_date =
2541 | runningmate =
2542 | opponent =
2543 | incumbent =
2544</pre>
2545{{clear}}
2546
2547If a candidate, then instead of <code>nominee</code> use:
2548{{Generic template demo
2549 | candidate
2550}}
2551<pre style="overflow:auto;">
2552 | candidate =
2553</pre>
2554
2555''add [[#Personal data|personal data]]''
2556{{clear}}
2557
2558===Member of Parliament===
2559{{For|examples of this code in use|Template:Infobox officeholder/example#Member of Parliament}}
2560{{Generic template demo
2561 | honorific_prefix
2562 | name
2563 | honorific_suffix
2564 | image
2565 | alt
2566 | caption
2567 | constituency_MP
2568 | parliament
2569 | majority
2570 | term_start
2571 | term_end
2572 | predecessor
2573 | successor
2574 | prior_term
2575}}
2576<pre style="overflow:auto;">
2577{{Infobox MP
2578 | honorific_prefix =
2579 | name =
2580 | honorific_suffix =
2581 | image =
2582 | alt =
2583 | caption =
2584 | constituency_MP = <!--Can be repeated up to eight times by adding a number-->
2585 | parliament = <!--Can be repeated up to 16 times by adding a number-->
2586 | majority = <!--Can be repeated up to 16 times by adding a number-->
2587 | term_start = <!--Can be repeated up to 16 times by adding a number-->
2588 | term_end = <!--Can be repeated up to 16 times by adding a number-->
2589 | predecessor = <!--Can be repeated up to 16 times by adding a number-->
2590 | successor = <!--Can be repeated up to 16 times by adding a number-->
2591 | prior_term =
2592</pre>
2593''add [[#Personal data|personal data]]''
2594{{clear}}
2595
2596===U.S. Representatives===
2597
2598====U.S. Congressman====
2599{{For|examples of this code in use|Template:Infobox officeholder/example#US Congressman}}
2600{{Generic template demo
2601 | honorific_prefix
2602 | name
2603 | honorific_suffix
2604 | image
2605 | alt
2606 | state
2607 | district
2608 | term_start
2609 | term_end
2610 | predecessor
2611 | successor
2612 | prior_term
2613}}
2614<pre style="overflow:auto;">
2615{{Infobox Congressman
2616 | honorific_prefix =
2617 | name =
2618 | honorific_suffix =
2619 | image =
2620 | alt =
2621 | state = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2622 | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2623 | term_start = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2624 | term_end = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2625 | predecessor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2626 | successor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2627 | prior_term =
2628</pre>
2629''add [[#Personal data|personal data]]''
2630{{clear}}
2631
2632If Congressman served as Speaker of the House add:
2633{{Generic template demo
2634 | speaker
2635 | term_start2
2636 | term_end2
2637 | predecessor2
2638 | successor2
2639}}
2640<pre style="overflow:auto;">
2641 | speaker = <!--number of office holder-->
2642 | term_start2 =
2643 | term_end2 =
2644 | predecessor2 =
2645 | successor2 =
2646</pre>
2647{{clear}}
2648
2649If Congressman has been elected but not sworn in:
2650{{Generic template demo
2651 | succeeding
2652}}
2653<pre style="overflow:auto;">
2654 | succeeding = <!--the name of the incumbent congressman-->
2655</pre>
2656{{clear}}
2657
2658====State Representative====
2659{{For|examples of this code in use|Template:Infobox officeholder/example#State Representative}}
2660{{Generic template demo
2661 | honorific_prefix
2662 | name
2663 | honorific_suffix
2664 | image
2665 | alt
2666 | state_house
2667 | district
2668 | term_start
2669 | term_end
2670 | predecessor
2671 | successor
2672 | prior_term
2673}}
2674<pre style="overflow:auto;">
2675{{Infobox state representative
2676 | honorific_prefix =
2677 | name =
2678 | honorific_suffix =
2679 | image =
2680 | alt =
2681 | state_house = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2682 | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2683 | term_start = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2684 | term_end = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2685 | predecessor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2686 | successor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2687 | prior_term =
2688</pre>
2689''add [[#Personal data|personal data]]''
2690{{clear}}
2691
2692For Representative from states that have an Assembly, instead of state_house use:
2693{{Generic template demo
2694 | state_assembly
2695 | district
2696}}
2697<pre style="overflow:auto;">
2698 | state_assembly = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2699 | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2700</pre>
2701{{clear}}
2702
2703For Representative from states that have a House of Delegates, instead of state_house use:
2704{{Generic template demo
2705 | state_delegate
2706 | district
2707}}
2708<pre style="overflow:auto;">
2709 | state_delegate = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2710 | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2711</pre>
2712{{clear}}
2713
2714For Representative from states that have a Legislature, instead of state_house use:
2715{{Generic template demo
2716 | state_legislature
2717 | district
2718}}
2719<pre style="overflow:auto;">
2720 | state_legislature = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2721 | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
2722</pre>
2723{{clear}}
2724
2725If Representative served as Speaker of the State House add:
2726{{Generic template demo
2727 | speaker
2728 | state_house
2729 | term_start2
2730 | term_end2
2731 | predecessor2
2732 | successor2
2733}}
2734<pre style="overflow:auto;">
2735 | speaker = <!--number of office holder-->
2736 | state_house =
2737 | term_start2 =
2738 | term_end2 =
2739 | predecessor2 =
2740 | successor2 =
2741</pre>
2742{{clear}}
2743
2744===U.S. Senators===
2745
2746====U.S. Senator====
2747{{For|examples of this code in use|Template:Infobox officeholder/example#US Senator}}
2748{{Generic template demo
2749 | honorific_prefix
2750 | name
2751 | honorific_suffix
2752 | image
2753 | image_size
2754 | image_upright
2755 | alt
2756 | jr/sr
2757 | state
2758 | term_start
2759 | term_end
2760 | predecessor
2761 | successor
2762}}
2763<pre style="overflow:auto;">
2764{{Infobox senator
2765 | honorific_prefix =
2766 | name =
2767 | honorific_suffix =
2768 | image =
2769 | image_size =
2770 | image_upright =
2771 | alt =
2772 | jr/sr = <!--Can be repeated up to eight times by appending 2, 3, etc--> This code has been disabled per Template talk:Infobox officeholder.
2773 | state = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2774 | term_start = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2775 | term_end = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2776 | predecessor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2777 | successor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2778</pre>
2779''add [[#Personal data|personal data]]''
2780{{clear}}
2781
2782{{Generic template demo
2783 | term_start
2784 | alongside
2785}}
2786<pre style="overflow:auto;">
2787 | term_start =
2788 | alongside = <!--the name of fellow senator-->
2789</pre>
2790{{clear}}
2791
2792If Senator has just been elected and is a Senator-Elect:
2793{{Generic template demo
2794 | succeeding
2795}}
2796<pre style="overflow:auto;">
2797 | succeeding = <!--the name of the incumbent senator-->
2798</pre>
2799{{clear}}
2800
2801If Senator served as Senate Majority Leader add:
2802{{Generic template demo
2803 | majorityleader3
2804 | term_start3
2805 | term_end3
2806 | predecessor3
2807 | successor3
2808}}
2809<pre style="overflow:auto;">
2810 | majorityleader3 = <!--number of office holder-->
2811 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2812 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2813 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2814 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2815</pre>
2816{{clear}}
2817
2818If Senator served as Congressman add:
2819{{Generic template demo
2820 | state3
2821 | district3
2822 | term_start3
2823 | term_end3
2824 | predecessor3
2825 | successor3
2826}}
2827<pre style="overflow:auto;">
2828 | state3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2829 | district3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2830 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2831 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2832 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2833 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2834</pre>
2835{{clear}}
2836
2837====State Senator====
2838{{For|examples of this code in use|Template:Infobox officeholder/example#State Senator}}
2839{{Generic template demo
2840 | honorific_prefix
2841 | name
2842 | honorific_suffix
2843 | image
2844 | alt
2845 | state_senate
2846 | district
2847 | term_start
2848 | term_end
2849 | predecessor
2850 | successor
2851 | prior_term
2852}}
2853<pre style="overflow:auto;">
2854{{Infobox state senator
2855 | honorific_prefix =
2856 | name =
2857 | honorific_suffix =
2858 | image =
2859 | alt =
2860 | state_senate = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2861 | district = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2862 | term_start = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2863 | term_end = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2864 | predecessor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2865 | successor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
2866 | prior_term =
2867</pre>
2868''add [[#Personal data|personal data]]''
2869{{clear}}
2870
2871If State Senator served as Majority Leader of the State Senate add:
2872{{Generic template demo
2873 | majority_leader3
2874 | term_start3
2875 | term_end3
2876 | predecessor3
2877 | successor3
2878}}
2879<pre style="overflow:auto;">
2880 | majority_leader3 = <!--number of office holder-->
2881 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2882 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2883 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2884 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2885</pre>
2886{{clear}}
2887
2888If State Senator served as Minority Leader of the State Senate add:
2889{{Generic template demo
2890 | minority_leader3
2891 | term_start3
2892 | term_end3
2893 | predecessor3
2894 | successor3
2895}}
2896<pre style="overflow:auto;">
2897 | minority_leader3 = <!--number of office holder-->
2898 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2899 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2900 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2901 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2902</pre>
2903{{clear}}
2904
2905If State Senator served as Majority Floor Leader of the State Senate add:
2906{{Generic template demo
2907 | majority_floor_leader3
2908 | term_start3
2909 | term_end3
2910 | predecessor3
2911 | successor3
2912}}
2913<pre style="overflow:auto;">
2914 | majority_floor_leader3 = <!--number of office holder-->
2915 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2916 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2917 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2918 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2919</pre>
2920{{clear}}
2921
2922If State Senator served as Minority Floor Leader of the State Senate add:
2923{{Generic template demo
2924 | minority_floor_leader3
2925 | term_start3
2926 | term_end3
2927 | predecessor3
2928 | successor3
2929}}
2930<pre style="overflow:auto;">
2931 | minority_floor_leader3 = <!--number of office holder-->
2932 | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2933 | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2934 | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2935 | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
2936</pre>
2937{{clear}}
2938
2939===Ukrainian legislative office===
2940{{For|examples of this code in use|Template:Infobox officeholder/example#Ukrainian legislative office}}
2941
2942{{Generic template demo
2943| name
2944| native_name
2945| native_name_lang
2946| image
2947| caption
2948| office1
2949| convocation1
2950| constituency1
2951| term_start1
2952| term_end1
2953| convocation2
2954| constituency2
2955| term_start2
2956| term_end2
2957| office3
2958| convocation3
2959| constituency3
2960| term_start3
2961| term_end3
2962}}
2963<pre style="overflow:auto;">
2964{{Infobox Ukrainian legislative office
2965| name =
2966| native_name =
2967| native_name_lang =
2968| image =
2969| caption =
2970| office1 =
2971| convocation1 =
2972| constituency1 =
2973| term_start1 =
2974| term_end1 =
2975| convocation2 =
2976| constituency2 =
2977| term_start2 =
2978| term_end2 =
2979| office3 = <!--Can be repeated up to 16 times by adding a number-->
2980| convocation3 = <!--Can be repeated up to 16 times by adding a number-->
2981| constituency3 = <!--Can be repeated up to 16 times by adding a number-->
2982| term_start3 = <!--Can be repeated up to 16 times by adding a number-->
2983| term_end3 = <!--Can be repeated up to 16 times by adding a number-->
2984</pre>
2985
2986
2987==Personal data==
2988Place this underneath the template
2989{{Generic template demo
2990 | pronunciation
2991 | birth_name
2992 | birth_date
2993 | birth_place
2994 | death_date
2995 | death_place
2996 | death_cause
2997 | resting_place
2998 | resting_place_coordinates
2999 | citizenship
3000 | nationality
3001 | party
3002 | otherparty
3003 | height
3004 | spouse
3005 | partner
3006 | relations
3007 | children
3008 | parents
3009 | mother
3010 | father
3011 | relatives
3012 | residence
3013 | education
3014 | alma_mater
3015 | occupation
3016 | profession
3017 | salary
3018 | net_worth
3019 | known_for
3020 | cabinet
3021 | committees
3022 | portfolio
3023 | awards
3024 | blank1
3025 | data1
3026 | blank2
3027 | data2
3028 | blank3
3029 | data3
3030 | blank4
3031 | data4
3032 | blank5
3033 | data5
3034 | signature
3035 | signature_alt
3036 | website
3037 | nickname
3038 | allegiance
3039 | branch
3040 | serviceyears
3041 | rank
3042 | unit
3043 | commands
3044 | battles
3045 | mawards
3046 | military_blank1
3047 | military_data1
3048 | military_blank2
3049 | military_data2
3050 | military_blank3
3051 | military_data3
3052 | military_blank4
3053 | military_data4
3054 | military_blank5
3055 | military_data5
3056 | module
3057 | module2
3058 | module3
3059 | module4
3060 | module5
3061 | footnotes
3062}}
3063<pre style="overflow:auto;">
3064 | pronunciation =
3065 | birth_name =
3066 | birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
3067 | birth_place =
3068 | death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} -->
3069 | death_place =
3070 | death_cause =
3071 | resting_place =
3072 | resting_place_coordinates =
3073 | citizenship =
3074 | nationality =
3075 | party =
3076 | otherparty = <!--For additional political affiliations-->
3077 | height = <!-- "X cm", "X m" or "X ft Y in" plus optional reference (conversions are automatic) -->
3078 | spouse =
3079 | partner = <!--For those with a domestic partner and not married-->
3080 | relations =
3081 | children =
3082 | parents = <!-- overrides mother and father parameters -->
3083 | mother = <!-- may be used (optionally with father parameter) in place of parents parameter (displays "Parent(s)" as label) -->
3084 | father = <!-- may be used (optionally with mother parameter) in place of parents parameter (displays "Parent(s)" as label) -->
3085 | relatives =
3086 | residence =
3087 | education =
3088 | alma_mater =
3089 | occupation =
3090 | profession =
3091 | known_for =
3092 | salary =
3093 | net_worth = <!-- Net worth should be supported with a citation from a reliable source -->
3094 | cabinet =
3095 | committees =
3096 | portfolio =
3097 | awards = <!-- For civilian awards - appears as "Awards" if |mawards= is not set -->
3098 | blank1 =
3099 | data1 =
3100 | blank2 =
3101 | data2 =
3102 | blank3 =
3103 | data3 =
3104 | blank4 =
3105 | data4 =
3106 | blank5 =
3107 | data5 =
3108 | signature =
3109 | signature_alt =
3110 | website =
3111<!--Military service-->
3112 | nickname =
3113 | allegiance =
3114 | branch =
3115 | serviceyears =
3116 | rank =
3117 | unit =
3118 | commands =
3119 | battles =
3120 | mawards = <!-- for military awards - appears as "Awards" if |awards= is not set -->
3121 | military_blank1 =
3122 | military_data1 =
3123 | military_blank2 =
3124 | military_data2 =
3125 | military_blank3 =
3126 | military_data3 =
3127 | military_blank4 =
3128 | military_data4 =
3129 | military_blank5 =
3130 | military_data5 =
3131<!--Embedded templates / Footnotes-->
3132 | module =
3133 | module2 =
3134 | module3 =
3135 | module4 =
3136 | module5 =
3137 | footnotes =
3138}}
3139</pre>
3140{{clear}}
3141
3142== Embedding other templates ==
3143The ''module'' parameters (module, module2, ... module5) may used to embed other templates into this infobox (see [[Wikipedia:Infobox modules]]).
3144
3145<pre style="overflow: auto;">
3146{{Infobox officeholder
3147 | name =
3148 | <!-- etc. -->
3149 | module =
3150 {{Infobox football biography | embed = yes
3151 | <!-- etc. -->
3152 }}
3153}}
3154</pre>
3155
3156== Embedding within a different infobox ==
3157Many officeholders are known for more than just their appointments (e.g., [[Clint Eastwood]]), and hence it may be desirable to merge this infobox with another one, like {{tl|Infobox person}}. By adding "''{{para|embed|yes}}''" to the first line of the infobox code, one can embed this infobox into another, creating the illusion of one continuous infobox. Though the process is a little complicated, it is possible to insert this infobox into most if not all other infoboxes. For {{tl|Infobox person}}, this infobox is passed as a "module" using the {{para|module}} syntax.
3158
3159<pre style="overflow: auto">
3160{{Infobox person
3161 | name = John Infobox
3162 | image = Example.jpg
3163 | caption = John Infobox in 2005
3164 | birth_name = John Officeholder Person Infobox
3165 | birth_date = {{Birth date|1950|5|5}}
3166 | birth_place = Template City
3167 | death_date = {{Death date and age|2010|10|10|1950|5|5}}
3168 | occupation = Actor
3169 | years_active = 1970–1990
3170 | module =
3171 {{Infobox officeholder | embed = yes
3172 | office = Mayor of Wikipedia
3173 | term_start = 1994
3174 | term_end = 1998
3175 }}
3176 | website = {{URL|example.com}}
3177}}
3178</pre>
3179
3180==Microformat==
3181{{UF-hcard-person}}
3182
3183==TemplateData==
3184{{TemplateDataHeader}}
3185<templatedata>
3186{
3187 "description": "An infobox for office holders.",
3188 "params": {
3189 "name": {
3190 "label": "name",
3191 "description": "The person's name",
3192 "type": "string",
3193 "default": "The pagename"
3194 },
3195 "office": {
3196 "label": "office",
3197 "description": "Office held",
3198 "type": "string"
3199 },
3200 "order": {
3201 "label": "order",
3202 "description": "Used in conjunction with 'office' to state that the officeholder is the nth holder of the office",
3203 "type": "string"
3204 },
3205 "bodyclass": {
3206 "label": "bodyclass",
3207 "type": "string"
3208 },
3209 "mainwidth": {
3210 "label": "mainwidth",
3211 "default": "22em",
3212 "type": "string"
3213 },
3214 "honorific_prefix": {
3215 "label": "honorific_prefix",
3216 "type": "string"
3217 },
3218 "honorific_suffix": {
3219 "label": "honorific_suffix",
3220 "type": "string"
3221 },
3222 "native_name": {
3223 "label": "native_name",
3224 "type": "string"
3225 },
3226 "native_name_lang": {
3227 "label": "native_name_lang",
3228 "type": "string"
3229 },
3230 "image": {
3231 "label": "image",
3232 "type": "string"
3233 },
3234 "width": {
3235 "label": "width",
3236 "type": "string",
3237 "aliases": [
3238 "imagesize",
3239 " image_size"
3240 ]
3241 },
3242 "image_upright": {
3243 "label": "image_upright",
3244 "type": "string",
3245 },
3246 "alt": {
3247 "label": "alt",
3248 "type": "string"
3249 },
3250 "image name": {
3251 "label": "image name",
3252 "type": "string"
3253 },
3254 "smallimage": {
3255 "label": "smallimage",
3256 "type": "string"
3257 },
3258 "caption": {
3259 "label": "caption",
3260 "type": "string"
3261 },
3262 "alongside": {
3263 "label": "alongside",
3264 "description": "For two or more people serving in the same position from the same district. (e.g. United States Senators.)",
3265 "type": "string"
3266 },
3267 "ambassador_from": {
3268 "label": "ambassador_from",
3269 "type": "string"
3270 },
3271 "appointer": {
3272 "label": "appointer",
3273 "type": "string"
3274 },
3275 "assembly": {
3276 "label": "assembly",
3277 "type": "string"
3278 },
3279 "chancellor": {
3280 "label": "chancellor",
3281 "type": "string"
3282 },
3283 "co-leader": {
3284 "label": "co-leader",
3285 "type": "string"
3286 },
3287 "constituency_AM": {
3288 "label": "constituency_AM",
3289 "type": "string"
3290 },
3291 "constituency": {
3292 "label": "constituency",
3293 "type": "string"
3294 },
3295 "country": {
3296 "label": "country",
3297 "type": "string"
3298 },
3299 "deputy": {
3300 "label": "deputy",
3301 "type": "string"
3302 },
3303 "district": {
3304 "label": "district",
3305 "type": "string"
3306 },
3307 "election_date": {
3308 "label": "election_date",
3309 "type": "string"
3310 },
3311 "firstminister": {
3312 "label": "firstminister",
3313 "type": "string"
3314 },
3315 "governor-general": {
3316 "label": "governor-general",
3317 "type": "string"
3318 },
3319 "incumbent": {
3320 "label": "incumbent",
3321 "type": "string"
3322 },
3323 "jr/sr": {
3324 "label": "jr/sr",
3325 "type": "string"
3326 },
3327 "jr/sr and state": {
3328 "label": "jr/sr and state",
3329 "type": "string"
3330 },
3331 "leader": {
3332 "label": "leader",
3333 "type": "string"
3334 },
3335 "legislature": {
3336 "label": "legislature",
3337 "type": "string"
3338 },
3339 "lieutenant_governor": {
3340 "label": "lieutenant_governor",
3341 "type": "string"
3342 },
3343 "lieutenant": {
3344 "label": "lieutenant",
3345 "type": "string"
3346 },
3347 "majorityleader": {
3348 "label": "majorityleader",
3349 "type": "string"
3350 },
3351 "minister": {
3352 "label": "minister",
3353 "type": "string"
3354 },
3355 "minister_from": {
3356 "label": "minister_from",
3357 "type": "string"
3358 },
3359 "minority_floor_leader": {
3360 "label": "minority_floor_leader",
3361 "type": "string"
3362 },
3363 "majority_floor_leader": {
3364 "label": "majority_floor_leader",
3365 "type": "string"
3366 },
3367 "minorityleader": {
3368 "label": "minorityleader",
3369 "type": "string"
3370 },
3371 "monarch": {
3372 "label": "monarch",
3373 "type": "string"
3374 },
3375 "nominator": {
3376 "label": "nominator",
3377 "type": "string"
3378 },
3379 "opponent": {
3380 "label": "opponent",
3381 "type": "string"
3382 },
3383 "parliament": {
3384 "label": "parliament",
3385 "type": "string"
3386 },
3387 "parliamentarygroup": {
3388 "label": "parliamentary group",
3389 "type": "string"
3390 },
3391 "party_election": {
3392 "label": "party_election",
3393 "type": "string"
3394 },
3395 "predecessor": {
3396 "label": "predecessor",
3397 "type": "string"
3398 },
3399 "preceding": {
3400 "label": "preceding",
3401 "type": "string"
3402 },
3403 "preceded": {
3404 "label": "preceded",
3405 "type": "string"
3406 },
3407 "premier": {
3408 "label": "premier",
3409 "type": "string"
3410 },
3411 "president": {
3412 "label": "president",
3413 "type": "string"
3414 },
3415 "primeminister": {
3416 "label": "primeminister",
3417 "type": "string"
3418 },
3419 "riding": {
3420 "label": "riding",
3421 "type": "string"
3422 },
3423 "runningmate": {
3424 "label": "runningmate",
3425 "type": "string"
3426 },
3427 "succeeded": {
3428 "label": "succeeded",
3429 "type": "string"
3430 },
3431 "succeeding": {
3432 "label": "succeeding",
3433 "description": "For President-elect or equivalent.",
3434 "type": "string"
3435 },
3436 "successor": {
3437 "label": "successor",
3438 "type": "string"
3439 },
3440 "taoiseach": {
3441 "label": "taoiseach",
3442 "type": "string"
3443 },
3444 "termend": {
3445 "label": "termend",
3446 "type": "string"
3447 },
3448 "termstart": {
3449 "label": "termstart",
3450 "type": "string"
3451 },
3452 "title": {
3453 "label": "title",
3454 "type": "string"
3455 },
3456 "vicegovernor": {
3457 "label": "vicegovernor",
3458 "type": "string"
3459 },
3460 "vicepresident": {
3461 "label": "vicepresident",
3462 "type": "string"
3463 },
3464 "vicepremier": {
3465 "label": "vicepremier",
3466 "type": "string"
3467 },
3468 "viceprimeminister": {
3469 "label": "viceprimeminister",
3470 "type": "string"
3471 },
3472 "speaker": {
3473 "label": "speaker",
3474 "type": "string"
3475 },
3476 "nominee": {
3477 "label": "nominee",
3478 "type": "string"
3479 },
3480 "candidate": {
3481 "label": "candidate",
3482 "type": "string"
3483 },
3484 "footnotes": {
3485 "label": "footnotes",
3486 "type": "string"
3487 },
3488 "date": {
3489 "label": "date",
3490 "type": "string"
3491 },
3492 "year": {
3493 "label": "year",
3494 "type": "string"
3495 },
3496 "source": {
3497 "label": "source",
3498 "type": "string"
3499 },
3500 "signature": {
3501 "label": "signature",
3502 "type": "string"
3503 },
3504 "signature_alt": {
3505 "label": "signature_alt",
3506 "type": "string"
3507 },
3508 "appointe": {
3509 "label": "appointe",
3510 "type": "string"
3511 },
3512 "alongside2": {
3513 "label": "alongside2",
3514 "type": "string"
3515 },
3516 "peerage2": {
3517 "label": "peerage2",
3518 "type": "string"
3519 },
3520 "ambassador_from2": {
3521 "label": "ambassador_from2",
3522 "type": "string"
3523 },
3524 "appointer2": {
3525 "label": "appointer2",
3526 "type": "string"
3527 },
3528 "assembly2": {
3529 "label": "assembly2",
3530 "type": "string"
3531 },
3532 "chancellor2": {
3533 "label": "chancellor2",
3534 "type": "string"
3535 },
3536 "co-leader2": {
3537 "label": "co-leader2",
3538 "type": "string"
3539 },
3540 "constituency_AM2": {
3541 "label": "constituency_AM2",
3542 "type": "string"
3543 },
3544 "constituency_": {
3545 "label": "constituency_",
3546 "type": "string"
3547 },
3548 "constituency2": {
3549 "label": "constituency2",
3550 "type": "string"
3551 },
3552 "country2": {
3553 "label": "country2",
3554 "type": "string"
3555 },
3556 "deputy2": {
3557 "label": "deputy2",
3558 "type": "string"
3559 },
3560 "district2": {
3561 "label": "district2",
3562 "type": "string"
3563 },
3564 "firstminister2": {
3565 "label": "firstminister2",
3566 "type": "string"
3567 },
3568 "governor": {
3569 "label": "governor",
3570 "type": "string"
3571 },
3572 "governor-general2": {
3573 "label": "governor-general2",
3574 "type": "string"
3575 },
3576 "governor2": {
3577 "label": "governor2",
3578 "type": "string"
3579 },
3580 "jr/sr2": {
3581 "label": "jr/sr2",
3582 "type": "string"
3583 },
3584 "jr/sr and state2": {
3585 "label": "jr/sr and state2",
3586 "type": "string"
3587 },
3588 "leader2": {
3589 "label": "leader2",
3590 "type": "string"
3591 },
3592 "legislature2": {
3593 "label": "legislature2",
3594 "type": "string"
3595 },
3596 "lieutenant_governor2": {
3597 "label": "lieutenant_governor2",
3598 "type": "string"
3599 },
3600 "lieutenant2": {
3601 "label": "lieutenant2",
3602 "type": "string"
3603 },
3604 "majority": {
3605 "label": "majority",
3606 "type": "string"
3607 },
3608 "majorityleader2": {
3609 "label": "majorityleader2",
3610 "type": "string"
3611 },
3612 "minister_from2": {
3613 "label": "minister_from2",
3614 "type": "string"
3615 },
3616 "minority_floor_leader2": {
3617 "label": "minority_floor_leader2",
3618 "type": "string"
3619 },
3620 "majority_floor_leader2": {
3621 "label": "majority_floor_leader2",
3622 "type": "string"
3623 },
3624 "majority2": {
3625 "label": "majority2",
3626 "type": "string"
3627 },
3628 "minister2": {
3629 "label": "minister2",
3630 "type": "string"
3631 },
3632 "minority": {
3633 "label": "minority",
3634 "type": "string"
3635 },
3636 "minorityleader2": {
3637 "label": "minorityleader2",
3638 "type": "string"
3639 },
3640 "monarch2": {
3641 "label": "monarch2",
3642 "type": "string"
3643 },
3644 "nominator2": {
3645 "label": "nominator2",
3646 "type": "string"
3647 },
3648 "office2": {
3649 "label": "office2",
3650 "type": "string"
3651 },
3652 "order2": {
3653 "label": "order2",
3654 "type": "string"
3655 },
3656 "parliament2": {
3657 "label": "parliament2",
3658 "type": "string"
3659 },
3660 "parliamentarygroup2": {
3661 "label": "parliamentary group 2",
3662 "type": "string"
3663 },
3664 "predecessor2": {
3665 "label": "predecessor2",
3666 "type": "string"
3667 },
3668 "preceding2": {
3669 "label": "preceding2",
3670 "type": "string"
3671 },
3672 "preceded2": {
3673 "label": "preceded2",
3674 "type": "string"
3675 },
3676 "premier2": {
3677 "label": "premier2",
3678 "type": "string"
3679 },
3680 "president2": {
3681 "label": "president2",
3682 "type": "string"
3683 },
3684 "primeminister2": {
3685 "label": "primeminister2",
3686 "type": "string"
3687 },
3688 "riding2": {
3689 "label": "riding2",
3690 "type": "string"
3691 },
3692 "speaker_office": {
3693 "label": "speaker_office",
3694 "type": "string"
3695 },
3696 "state_assembly": {
3697 "label": "state_assembly",
3698 "type": "string"
3699 },
3700 "state_delegate": {
3701 "label": "state_delegate",
3702 "type": "string"
3703 },
3704 "state_house": {
3705 "label": "state_house",
3706 "type": "string"
3707 },
3708 "state_legislature": {
3709 "label": "state_legislature",
3710 "type": "string"
3711 },
3712 "state_senate": {
3713 "label": "state_senate",
3714 "type": "string"
3715 },
3716 "state": {
3717 "label": "state",
3718 "type": "string"
3719 },
3720 "term": {
3721 "label": "term",
3722 "type": "string"
3723 },
3724 "party": {
3725 "label": "party",
3726 "type": "string"
3727 },
3728 "prior_term": {
3729 "label": "prior_term",
3730 "description": "Additional fields numbered up to 14",
3731 "type": "string"
3732 },
3733 "1blankname": {
3734 "label": "1blankname",
3735 "description": "Additional fields numbered up to 14",
3736 "type": "string"
3737 },
3738 "1namedata": {
3739 "label": "1namedata",
3740 "description": "Additional fields numbered up to 14",
3741 "type": "string"
3742 },
3743 "2blankname": {
3744 "label": "2blankname",
3745 "description": "Additional fields numbered up to 14",
3746 "type": "string"
3747 },
3748 "2namedata": {
3749 "label": "2namedata",
3750 "description": "Additional fields numbered up to 14",
3751 "type": "string"
3752 },
3753 "3blankname": {
3754 "label": "3blankname",
3755 "description": "Additional fields numbered up to 14",
3756 "type": "string"
3757 },
3758 "3namedata": {
3759 "label": "3namedata",
3760 "description": "Additional fields numbered up to 14",
3761 "type": "string"
3762 },
3763 "4blankname": {
3764 "label": "4blankname",
3765 "description": "Additional fields numbered up to 14",
3766 "type": "string"
3767 },
3768 "4namedata": {
3769 "label": "4namedata",
3770 "description": "Additional fields numbered up to 14",
3771 "type": "string"
3772 },
3773 "5blankname": {
3774 "label": "5blankname",
3775 "description": "Additional fields numbered up to 14",
3776 "type": "string"
3777 },
3778 "5namedata": {
3779 "label": "5namedata",
3780 "description": "Additional fields numbered up to 14",
3781 "type": "string"
3782 },
3783 "1blankname1": {
3784 "label": "1blankname1",
3785 "description": "Additional fields numbered up to 14",
3786 "type": "string"
3787 },
3788 "1namedata1": {
3789 "label": "1namedata1",
3790 "description": "Additional fields numbered up to 14",
3791 "type": "string"
3792 },
3793 "2blankname1": {
3794 "label": "2blankname1",
3795 "description": "Additional fields numbered up to 14",
3796 "type": "string"
3797 },
3798 "2namedata1": {
3799 "label": "2namedata1",
3800 "description": "Additional fields numbered up to 14",
3801 "type": "string"
3802 },
3803 "3blankname1": {
3804 "label": "3blankname1",
3805 "description": "Additional fields numbered up to 14",
3806 "type": "string"
3807 },
3808 "3namedata1": {
3809 "label": "3namedata1",
3810 "description": "Additional fields numbered up to 14",
3811 "type": "string"
3812 },
3813 "4blankname1": {
3814 "label": "4blankname1",
3815 "description": "Additional fields numbered up to 14",
3816 "type": "string"
3817 },
3818 "4namedata1": {
3819 "label": "4namedata1",
3820 "description": "Additional fields numbered up to 14",
3821 "type": "string"
3822 },
3823 "5blankname1": {
3824 "label": "5blankname1",
3825 "description": "Additional fields numbered up to 14",
3826 "type": "string"
3827 },
3828 "5namedata1": {
3829 "label": "5namedata1",
3830 "description": "Additional fields numbered up to 14",
3831 "type": "string"
3832 },
3833 "alongside1": {
3834 "label": "alongside1",
3835 "description": "Additional fields numbered up to 14",
3836 "type": "string"
3837 },
3838 "ambassador_from1": {
3839 "label": "ambassador_from1",
3840 "description": "Additional fields numbered up to 14",
3841 "type": "string"
3842 },
3843 "appointer1": {
3844 "label": "appointer1",
3845 "description": "Additional fields numbered up to 14",
3846 "type": "string"
3847 },
3848 "assembly1": {
3849 "label": "assembly1",
3850 "description": "Additional fields numbered up to 14",
3851 "type": "string"
3852 },
3853 "chancellor1": {
3854 "label": "chancellor1",
3855 "description": "Additional fields numbered up to 14",
3856 "type": "string"
3857 },
3858 "co-leader1": {
3859 "label": "co-leader1",
3860 "description": "Additional fields numbered up to 14",
3861 "type": "string"
3862 },
3863 "constituency_AM1": {
3864 "label": "constituency_AM1",
3865 "description": "Additional fields numbered up to 14",
3866 "type": "string"
3867 },
3868 "constituency1": {
3869 "label": "constituency1",
3870 "description": "Additional fields numbered up to 14",
3871 "type": "string"
3872 },
3873 "country1": {
3874 "label": "country1",
3875 "description": "Additional fields numbered up to 14",
3876 "type": "string"
3877 },
3878 "deputy1": {
3879 "label": "deputy1",
3880 "description": "Additional fields numbered up to 14",
3881 "type": "string"
3882 },
3883 "district1": {
3884 "label": "district1",
3885 "description": "Additional fields numbered up to 14",
3886 "type": "string"
3887 },
3888 "firstminister1": {
3889 "label": "firstminister1",
3890 "description": "Additional fields numbered up to 14",
3891 "type": "string"
3892 },
3893 "governor-general1": {
3894 "label": "governor-general1",
3895 "description": "Additional fields numbered up to 14",
3896 "type": "string"
3897 },
3898 "governor1": {
3899 "label": "governor1",
3900 "description": "Additional fields numbered up to 14",
3901 "type": "string"
3902 },
3903 "jr/sr1": {
3904 "label": "jr/sr1",
3905 "description": "Additional fields numbered up to 14",
3906 "type": "string"
3907 },
3908 "jr/sr and state1": {
3909 "label": "jr/sr and state1",
3910 "description": "Additional fields numbered up to 14",
3911 "type": "string"
3912 },
3913 "leader1": {
3914 "label": "leader1",
3915 "description": "Additional fields numbered up to 14",
3916 "type": "string"
3917 },
3918 "legislature1": {
3919 "label": "legislature1",
3920 "description": "Additional fields numbered up to 14",
3921 "type": "string"
3922 },
3923 "lieutenant_governor1": {
3924 "label": "lieutenant_governor1",
3925 "description": "Additional fields numbered up to 14",
3926 "type": "string"
3927 },
3928 "lieutenant1": {
3929 "label": "lieutenant1",
3930 "description": "Additional fields numbered up to 14",
3931 "type": "string"
3932 },
3933 "minority_floor_leader1": {
3934 "label": "minority_floor_leader1",
3935 "description": "Additional fields numbered up to 14",
3936 "type": "string"
3937 },
3938 "minister_from1": {
3939 "label": "minister_from1",
3940 "description": "Additional fields numbered up to 14",
3941 "type": "string"
3942 },
3943 "majority_floor_leader1": {
3944 "label": "majority_floor_leader1",
3945 "description": "Additional fields numbered up to 14",
3946 "type": "string"
3947 },
3948 "majorityleader1": {
3949 "label": "majorityleader1",
3950 "description": "Additional fields numbered up to 14",
3951 "type": "string"
3952 },
3953 "majority1": {
3954 "label": "majority1",
3955 "description": "Additional fields numbered up to 14",
3956 "type": "string"
3957 },
3958 "minister1": {
3959 "label": "minister1",
3960 "description": "Additional fields numbered up to 14",
3961 "type": "string"
3962 },
3963 "minorityleader1": {
3964 "label": "minorityleader1",
3965 "description": "Additional fields numbered up to 14",
3966 "type": "string"
3967 },
3968 "monarch1": {
3969 "label": "monarch1",
3970 "description": "Additional fields numbered up to 14",
3971 "type": "string"
3972 },
3973 "nominator1": {
3974 "label": "nominator1",
3975 "description": "Additional fields numbered up to 14",
3976 "type": "string"
3977 },
3978 "office1": {
3979 "label": "office1",
3980 "description": "Additional fields numbered up to 14",
3981 "type": "string"
3982 },
3983 "order1": {
3984 "label": "order1",
3985 "description": "Additional fields numbered up to 14",
3986 "type": "string"
3987 },
3988 "parliament1": {
3989 "label": "parliament1",
3990 "description": "Additional fields numbered up to 14",
3991 "type": "string"
3992 },
3993 "parliamentarygroup1": {
3994 "label": "parliamentary group 1",
3995 "description": "Additional fields numbered up to 14",
3996 "type": "string"
3997 },
3998 "predecessor1": {
3999 "label": "predecessor1",
4000 "description": "Additional fields numbered up to 14",
4001 "type": "string"
4002 },
4003 "preceding1": {
4004 "label": "preceding1",
4005 "description": "Additional fields numbered up to 14",
4006 "type": "string"
4007 },
4008 "preceded1": {
4009 "label": "preceded1",
4010 "description": "Additional fields numbered up to 14",
4011 "type": "string"
4012 },
4013 "premier1": {
4014 "label": "premier1",
4015 "description": "Additional fields numbered up to 14",
4016 "type": "string"
4017 },
4018 "president1": {
4019 "label": "president1",
4020 "description": "Additional fields numbered up to 14",
4021 "type": "string"
4022 },
4023 "primeminister1": {
4024 "label": "primeminister1",
4025 "description": "Additional fields numbered up to 14",
4026 "type": "string"
4027 },
4028 "riding1": {
4029 "label": "riding1",
4030 "description": "Additional fields numbered up to 14",
4031 "type": "string"
4032 },
4033 "state_assembly1": {
4034 "label": "state_assembly1",
4035 "description": "Additional fields numbered up to 14",
4036 "type": "string"
4037 },
4038 "state_delegate1": {
4039 "label": "state_delegate1",
4040 "description": "Additional fields numbered up to 14",
4041 "type": "string"
4042 },
4043 "state_house1": {
4044 "label": "state_house1",
4045 "description": "Additional fields numbered up to 14",
4046 "type": "string"
4047 },
4048 "state_legislature1": {
4049 "label": "state_legislature1",
4050 "description": "Additional fields numbered up to 14",
4051 "type": "string"
4052 },
4053 "state_senate1": {
4054 "label": "state_senate1",
4055 "description": "Additional fields numbered up to 14",
4056 "type": "string"
4057 },
4058 "state1": {
4059 "label": "state1",
4060 "description": "Additional fields numbered up to 14",
4061 "type": "string"
4062 },
4063 "succeeded1": {
4064 "label": "succeeded1",
4065 "description": "Additional fields numbered up to 14",
4066 "type": "string"
4067 },
4068 "succeeding1": {
4069 "label": "succeeding1",
4070 "description": "Additional fields numbered up to 14",
4071 "type": "string"
4072 },
4073 "successor1": {
4074 "label": "successor1",
4075 "description": "Additional fields numbered up to 14",
4076 "type": "string"
4077 },
4078 "taoiseach1": {
4079 "label": "taoiseach1",
4080 "description": "Additional fields numbered up to 14",
4081 "type": "string"
4082 },
4083 "termend1": {
4084 "label": "termend1",
4085 "description": "Additional fields numbered up to 14",
4086 "type": "string"
4087 },
4088 "termstart1": {
4089 "label": "termstart1",
4090 "description": "Additional fields numbered up to 14",
4091 "type": "string"
4092 },
4093 "term1": {
4094 "label": "term1",
4095 "description": "Additional fields numbered up to 14",
4096 "type": "string"
4097 },
4098 "title1": {
4099 "label": "title1",
4100 "description": "Additional fields numbered up to 14",
4101 "type": "string"
4102 },
4103 "vicegovernor1": {
4104 "label": "vicegovernor1",
4105 "description": "Additional fields numbered up to 14",
4106 "type": "string"
4107 },
4108 "vicepresident1": {
4109 "label": "vicepresident1",
4110 "description": "Additional fields numbered up to 14",
4111 "type": "string"
4112 },
4113 "vicepremier1": {
4114 "label": "vicepremier1",
4115 "description": "Additional fields numbered up to 14",
4116 "type": "string"
4117 },
4118 "viceprimeminister1": {
4119 "label": "viceprimeminister1",
4120 "description": "Additional fields numbered up to 14",
4121 "type": "string"
4122 },
4123 "prior_term1": {
4124 "label": "prior_term1",
4125 "description": "Additional fields numbered up to 14",
4126 "type": "string"
4127 },
4128 "termend2": {
4129 "label": "termend2",
4130 "type": "string"
4131 },
4132 "termstart2": {
4133 "label": "termstart2",
4134 "type": "string"
4135 },
4136 "term2": {
4137 "label": "term2",
4138 "type": "string"
4139 },
4140 "title2": {
4141 "label": "title2",
4142 "type": "string"
4143 },
4144 "vicegovernor2": {
4145 "label": "vicegovernor2",
4146 "type": "string"
4147 },
4148 "vicepresident2": {
4149 "label": "vicepresident2",
4150 "type": "string"
4151 },
4152 "vicepremier2": {
4153 "label": "vicepremier2",
4154 "type": "string"
4155 },
4156 "viceprimeminister2": {
4157 "label": "viceprimeminister2",
4158 "type": "string"
4159 },
4160 "succeeded2": {
4161 "label": "succeeded2",
4162 "type": "string"
4163 },
4164 "succeeding2": {
4165 "label": "succeeding2",
4166 "type": "string"
4167 },
4168 "successor2": {
4169 "label": "successor2",
4170 "type": "string"
4171 },
4172 "taoiseach2": {
4173 "label": "taoiseach2",
4174 "type": "string"
4175 },
4176 "state_assembly2": {
4177 "label": "state_assembly2",
4178 "description": "Additional fields numbered up to 14",
4179 "type": "string"
4180 },
4181 "state_delegate2": {
4182 "label": "state_delegate2",
4183 "description": "Additional fields numbered up to 14",
4184 "type": "string"
4185 },
4186 "state_house2": {
4187 "label": "state_house2",
4188 "description": "Additional fields numbered up to 14",
4189 "type": "string"
4190 },
4191 "state_legislature2": {
4192 "label": "state_legislature2",
4193 "description": "Additional fields numbered up to 14",
4194 "type": "string"
4195 },
4196 "state_senate2": {
4197 "label": "state_senate2",
4198 "description": "Additional fields numbered up to 14",
4199 "type": "string"
4200 },
4201 "state2": {
4202 "label": "state2",
4203 "description": "Additional fields numbered up to 14",
4204 "type": "string"
4205 },
4206 "prior_term2": {
4207 "label": "prior_term2",
4208 "description": "Additional fields numbered up to 14",
4209 "type": "string"
4210 },
4211 "birth_name": {
4212 "label": "birth_name",
4213 "type": "string",
4214 "aliases": [
4215 "birthname"
4216 ]
4217 },
4218 "birth_date": {
4219 "label": "birth_date",
4220 "type": "string"
4221 },
4222 "birth_place": {
4223 "label": "birth_place",
4224 "type": "string"
4225 },
4226 "death_date": {
4227 "label": "death_date",
4228 "type": "string"
4229 },
4230 "death_place": {
4231 "label": "death_place",
4232 "type": "string"
4233 },
4234 "resting_place": {
4235 "label": "resting_place",
4236 "type": "string",
4237 "aliases": [
4238 "restingplace"
4239 ]
4240 },
4241 "resting_place_coordinates": {
4242 "label": "resting_place_coordinates",
4243 "type": "string",
4244 "aliases": [
4245 "restingplacecoordinates"
4246 ]
4247 },
4248 "citizenship": {
4249 "label": "citizenship",
4250 "type": "string"
4251 },
4252 "nationality": {
4253 "label": "nationality",
4254 "type": "string"
4255 },
4256 "otherparty": {
4257 "label": "otherparty",
4258 "type": "string"
4259 },
4260 "spouse": {
4261 "label": "spouse",
4262 "type": "string"
4263 },
4264 "partner": {
4265 "label": "partner",
4266 "type": "string"
4267 },
4268 "relations": {
4269 "label": "relations",
4270 "type": "string"
4271 },
4272 "children": {
4273 "label": "children",
4274 "type": "string"
4275 },
4276 "parents": {
4277 "label": "parents",
4278 "type": "string"
4279 },
4280 "residence": {
4281 "label": "residence",
4282 "type": "string"
4283 },
4284 "alma_mater": {
4285 "label": "alma_mater",
4286 "type": "string"
4287 },
4288 "occupation": {
4289 "label": "occupation",
4290 "description": " Please observe sentence case and capitalise only the first letter of the first item: (i.e. Politician, entrepreneur, businessman)",
4291 "type": "string"
4292 },
4293 "profession": {
4294 "label": "profession",
4295 "description": " Please observe sentence case and capitalise only the first letter of the first item: (i.e. Attorney, accountant)",
4296 "type": "string"
4297 },
4298 "cabinet": {
4299 "label": "cabinet",
4300 "type": "string"
4301 },
4302 "committees": {
4303 "label": "committees",
4304 "type": "string"
4305 },
4306 "portfolio": {
4307 "label": "portfolio",
4308 "type": "string"
4309 },
4310 "blank1": {
4311 "label": "blank1",
4312 "description": "Also blank2 ... blank5",
4313 "type": "string"
4314 },
4315 "data1": {
4316 "label": "data1",
4317 "description": "Also data2 ... data5",
4318 "type": "string"
4319 },
4320 "website": {
4321 "label": "website",
4322 "type": "string"
4323 },
4324 "nickname": {
4325 "label": "nickname",
4326 "type": "string"
4327 },
4328 "allegiance": {
4329 "label": "allegiance",
4330 "type": "string"
4331 },
4332 "branch": {
4333 "label": "branch",
4334 "type": "string"
4335 },
4336 "serviceyears": {
4337 "label": "serviceyears",
4338 "type": "string"
4339 },
4340 "rank": {
4341 "label": "rank",
4342 "type": "string"
4343 },
4344 "unit": {
4345 "label": "unit",
4346 "type": "string"
4347 },
4348 "commands": {
4349 "label": "commands",
4350 "type": "string"
4351 },
4352 "battles": {
4353 "label": "battles",
4354 "type": "string"
4355 },
4356 "awards": {
4357 "label": "awards",
4358 "type": "string"
4359 },
4360 "military_blank1": {
4361 "label": "military_blank1",
4362 "description": "Also military_blank2 ... military_blank5",
4363 "type": "string"
4364 },
4365 "military_data1": {
4366 "label": "military_data1",
4367 "description": "Also military_data2 ... military_data5",
4368 "type": "string"
4369 },
4370 "1blankname2": {
4371 "label": "1blankname2",
4372 "type": "string"
4373 },
4374 "1namedata2": {
4375 "label": "1namedata2",
4376 "type": "string"
4377 },
4378 "2blankname2": {
4379 "label": "2blankname2",
4380 "type": "string"
4381 },
4382 "2namedata2": {
4383 "label": "2namedata2",
4384 "type": "string"
4385 },
4386 "3blankname2": {
4387 "label": "3blankname2",
4388 "type": "string"
4389 },
4390 "3namedata2": {
4391 "label": "3namedata2",
4392 "type": "string"
4393 },
4394 "4blankname2": {
4395 "label": "4blankname2",
4396 "type": "string"
4397 },
4398 "4namedata2": {
4399 "label": "4namedata2",
4400 "type": "string"
4401 },
4402 "5blankname2": {
4403 "label": "5blankname2",
4404 "type": "string"
4405 },
4406 "5namedata2": {
4407 "label": "5namedata2",
4408 "type": "string"
4409 },
4410 "pronunciation": {
4411 "label": "pronunciation",
4412 "type": "string"
4413 },
4414 "established": {
4415 "label": "established",
4416 "type": "string"
4417 },
4418 "founder": {
4419 "label": "founder",
4420 "type": "string"
4421 },
4422 "chairman": {
4423 "label": "chairman",
4424 "type": "string"
4425 },
4426 "vice chairman": {
4427 "label": "vice chairman",
4428 "type": "string"
4429 },
4430 "director": {
4431 "label": "director",
4432 "type": "string"
4433 },
4434 "principal": {
4435 "label": "principal",
4436 "type": "string"
4437 }
4438 },
4439 "format": "block"
4440}
4441</templatedata>
4442
4443== Tracking categories ==
4444; Hidden tracking/maintenance categories (in main and supporting templates):
4445* {{clc|Biography template using pronunciation}}
4446* {{clc|Pages using infobox officeholder with ambassador from or minister from}}
4447* {{clc|Pages using infobox officeholder with an atypical party value}}
4448* {{clc|Pages using infobox officeholder with both term and term_start or term_end}}
4449* {{clc|Pages using infobox officeholder with office0}}
4450* {{clc|Pages using infobox officeholder with speaker and without nominee or candidate}}
4451* {{clc|Pages using infobox officeholder with succeeding and term or termend}}
4452* {{clc|Pages using infobox officeholder with unknown parameters}}
4453
4454== See also ==
4455; Supporting templates
4456* [[Template:Infobox officeholder/office]]
4457* <!-- [[Template:Infobox officeholder/Personal data]] -->
4458
4459<includeonly>
4460{{Basepage subpage|
4461<!-- Categories below this line, please; interwikis at Wikidata -->
4462[[Category:Politics and government infobox templates|Officeholder]]
4463[[Category:People and person infobox templates|Officeholder]]
4464[[Category:Infobox templates with module parameter|Officeholder]]
4465[[Category:Biographical templates usable as a module|Officeholder]]
4466[[Category:Templates that add a tracking category]]
4467}}
4468</includeonly></text>
4469 <sha1>tu46uqjasgzpg4sacr67fpx6gile73x</sha1>
4470 </revision>
4471 </page>
4472 <page>
4473 <title>Template:Infobox officeholder/office</title>
4474 <ns>10</ns>
4475 <id>32357517</id>
4476 <revision>
4477 <id>848584450</id>
4478 <parentid>848527382</parentid>
4479 <timestamp>2018-07-02T21:58:46Z</timestamp>
4480 <contributor>
4481 <username>Neveselbert</username>
4482 <id>25820411</id>
4483 </contributor>
4484 <comment>Reverted [[WP:AGF|good faith]] edits by [[Special:Contributions/JFG|JFG]]: Unnecessary change; only politicians are described as incumbents. The |term= parameter can be used instead of |term_start to allow the termlabel to appear. ([[WP:TW|TW]])</comment>
4485 <model>wikitext</model>
4486 <format>text/x-wiki</format>
4487 <text xml:space="preserve" bytes="13090">{{#if:{{{speaker|}}}{{{state_legislature|}}}{{{state_assembly|}}}{{{speaker_office|}}}{{{state_delegate|}}}{{{state_house|}}}{{{prior_term|}}}{{{nominee|}}}{{{candidate|}}}{{{termstart|}}}{{{election_date|}}}{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}{{{jr/sr|}}}{{{succeeding|}}}{{{state|}}}{{{jr/sr and state|}}}{{{state_senate|}}}{{{district|}}}{{{ambassador_from|}}}{{{minister_from|}}}{{{order|}}}{{{office|}}}{{{title|}}}{{{country|}}}{{{constituency_AM|}}}{{{constituency_MP|}}}{{{parliament|}}}{{{assembly|}}}{{{constituency_|}}}{{{riding|}}}{{{term|}}}{{{termend|}}}{{{alongside|}}}{{{co-leader|}}}
4488|{{infobox|child=yes
4489| headerstyle = background:{{{color|lavender}}}
4490| datastyle = border-bottom:none
4491
4492<!--------Speaker of the House--------->
4493| header1 = {{#if:{{{speaker|}}}|
4494{{{speaker}}} {{#if:{{{state_legislature|}}}
4495 |[[Speaker of the {{{state_legislature}}} Legislature]]
4496 |{{#if:{{{state_assembly|}}}
4497 |[[Speaker of the {{{state_assembly|}}} {{#ifeq:{{{state_assembly|}}}|Nevada||{{#ifeq:{{{state_assembly|}}}|New Jersey|General|State}}}} Assembly]]
4498 |{{#if:{{{speaker_office|}}}|{{{speaker_office}}}|[[Speaker of the {{#if:{{{state_delegate|}}} |{{{state_delegate}}}|{{#if:{{{state_house|}}} |{{{state_house}}}|United States}}}} House of {{#if:{{{state_delegate|}}}|Delegates|Representatives}}|Speaker of the {{#if:{{{state_delegate|}}} |{{{state_delegate}}}|{{#if:{{{state_house|}}} |{{{state_house}}}|U.S.}}}} House of {{#if:{{{state_delegate|}}}|Delegates|Representatives}}]]}}
4499 }}
4500 }}{{#if:{{{prior_term|}}}|
4501<br /><small>{{{prior_term}}}</small>}}
4502}}
4503
4504<!--------Office--------->
4505| header2 = {{#if:{{{nominee|}}}{{{candidate|}}}|
4506{{#if:{{{party_election|}}}{{{party|}}}
4507 |{{#if:{{{party_election|}}}|{{{party_election}}}|{{{party}}}}} {{#if:{{{nominee|}}}|nominee for<br>{{{nominee}}}|candidate for<br>{{{candidate}}}}}
4508 |{{#if:{{{nominee|}}}|Nominee for<br>{{{nominee}}}|Candidate for<br>{{{candidate}}}}}
4509}} }}
4510
4511| data3 = {{#if:{{{nominee|}}}{{{candidate|}}}|
4512{{#if:{{{termstart|}}}{{{election_date|}}} | {{nowrap|'''Election date'''}}<br />{{#if:{{{election_date|}}}|{{{election_date}}}|{{{termstart}}}}}
4513}} }}
4514
4515| header4 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
4516{{#if:{{{jr/sr|}}}|[[United States Senate|<!--Changed code to eliminate "Junior/Senior" distinction for U.S. Senators per [[Template talk:Infobox Officeholder#Senior/Junior U.S. Senators]]{{{jr/sr}}}-->United States Senator{{#if:{{{succeeding|}}} |-elect}}]]<br />from {{{state}}}
4517}} }}
4518
4519| header5 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
4520{{{jr/sr and state|}}}
4521}}
4522
4523| header6 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
4524{{#if:{{{state_senate|}}}|Member{{#if:{{{succeeding|}}} |-elect}} of the <span style="display: inline-block;">[[{{{state_senate}}} Senate]]</span><br />from the {{{district}}} district{{#if:{{{prior_term|}}}|
4525<br /><small>{{{prior_term}}}</small>}}
4526}} }}
4527
4528| header7 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
4529{{#if:{{{state_legislature|}}}|Member{{#if:{{{succeeding|}}} |-elect}} of the <span style="display: inline-block;">[[{{{state_legislature}}} Legislature]]</span><br />from the {{{district}}} district
4530}} }}
4531
4532| header8 = {{#if:{{{ambassador_from|}}}{{{minister_from|}}}||
4533{{#if:{{{order|}}}
4534|{{{order}}}{{#if:{{{office|}}} |&#32;[[{{{office}}}]]}}{{#if:{{{state|}}} |&#32;[[{{{state}}}]]}}{{#if:{{{title|}}} |&#32;{{{title}}}}}
4535|{{{office|}}}
4536}} }}
4537
4538| header9 = {{#if:{{{ambassador_from|}}}{{{minister_from|}}}||
4539{{#if:{{{order|}}}
4540||{{{title|}}}
4541}} }}
4542
4543<!--------Ambassador--------->
4544| header10 = {{#if:{{both|{{{ambassador_from|}}}{{{minister_from|}}}|{{{country|}}}}}
4545 |{{#if:{{{order|}}}|{{{order}}}}} {{#if:{{{minister_from|}}}
4546 |[[{{{minister_from}}} Ambassador to {{CountryPrefixThe|{{{country}}}}}|{{{minister_from}}} Minister to {{CountryPrefixThe|{{{country}}}}}]]
4547 |[[{{{ambassador_from}}} Ambassador to {{CountryPrefixThe|{{{country}}}}}]]
4548 }} [[Category:Pages using infobox officeholder with ambassador from or minister from]]
4549}}
4550
4551<!--------MP--------->
4552| header11 = {{#if:{{{constituency_AM|}}}{{{constituency_MP|}}}|
4553{{#ifeq:{{{parliament|}}}|Ireland|[[Teachta Dála]]|{{#ifeq:{{{parliament|}}}|Australian|Member of the <span style="display: inline-block;">[[Parliament of Australia|Australian Parliament]]</span>|{{#if:{{{constituency_AM|}}}|{{#if:{{{assembly|}}}|Member of the <span style="display: inline-block;">[[{{{assembly}}} Assembly]]</span>|Assembly Member}}|Member of {{#if:{{{parliament|}}}|the <span style="display: inline-block;">[[{{{parliament}}} Parliament]]</span>|Parliament}}}}}}<br />for {{{constituency_{{#if:{{{constituency_AM|}}}|AM|MP}}}}}}}
4554}}
4555| header12 = {{#if:{{{riding|}}}|{{#if:{{{constituency_AM|}}}|{{#if:{{{assembly|}}}|Member of the <span style="display: inline-block;">[[{{{assembly}}} Assembly]]</span>|Assembly Member}}|Member of {{#if:{{{parliament|}}}|the <span style="display: inline-block;">[[{{{parliament}}} Parliament]]</span>|Parliament}}}}<br />for {{{riding}}}
4556}}
4557
4558<!--------Majority Leader (State Senate)--------->
4559| header13 = {{#if:{{{majority_leader|}}}|{{{majority_leader}}} {{#if:{{{state_senate|}}}|[[Majority Leader of the {{{state_senate}}} Senate]]|[[United States Senate Majority Leader]]}}
4560}}
4561
4562<!--------Majority Floor Leader (State Senate)--------->
4563| header14 = {{#if:{{{majority_floor_leader|}}}|{{{majority_floor_leader}}} [[Majority Floor Leader of the {{{state_senate}}} Senate]]
4564}}
4565
4566<!--------Minority Leader (State Senate)--------->
4567| header15 = {{#if:{{{minority_leader|}}}|{{{minority_leader}}} [[Minority Leader of the {{{state_senate}}} Senate]]
4568}}
4569
4570<!--------Minority Floor Leader (State Senate)--------->
4571| header16 = {{#if:{{{minority_floor_leader|}}}|{{{minority_floor_leader}}} [[Minority Floor Leader of the {{{state_senate}}} Senate]]
4572}}
4573
4574<!--------Congressman--------->
4575| header17 = {{#if:{{{state_legislature|}}}{{{state_senate|}}}{{{jr/sr|}}}{{{jr/sr and state|}}}||
4576{{#if:{{{district|}}}|{{#if:{{{state_assembly|}}}
4577 |Member{{#if:{{{succeeding|}}}|-elect}} of the <span style="display: inline-block;">[[{{{state_assembly|}}} {{#ifeq:{{{state_assembly|}}}|Nevada||{{#ifeq:{{{state_assembly|}}}|New Jersey|General|State}}}} Assembly]]</span><br />from the
4578 |Member{{#if:{{{succeeding|}}}|-elect}} of the <span style="display: inline-block;">[[{{#if:{{{state_house|}}} |{{{state_house}}}|{{#if:{{{state_delegate|}}}|{{{state_delegate}}}|United States }}}} {{#if:{{{state_delegate|}}}|House of Delegates|House of Representatives}}|{{#if:{{{state_house|}}} |{{{state_house}}}|{{#if:{{{state_delegate|}}}|{{{state_delegate}}}|U.S.}}}}&#32;{{#if:{{{state_delegate|}}}|House&#32;of&#32;Delegates|{{#if:{{{state_house|}}}| }}House&#32;of&#32;Representatives}}]]</span><br />from {{#if:{{{state_delegate|}}}|the |{{#if:{{{state_house|}}}|the |{{{state}}}'s}}}}
4579 }} {{{district}}} district{{#if:{{{prior_term|}}}|
4580<br /><small>{{{prior_term}}}</small>}}
4581}}
4582}}
4583
4584<!--------Convocation--------->
4585| header18 = {{#if:{{{convocation|}}}|{{{convocation}}}}}
4586
4587<!--------Term--------->
4588| data19 = {{#if:{{{nominee|}}}{{{candidate|}}}||
4589{{#if:{{{succeeding|}}}
4590 | {{nowrap|'''Assuming office'''}}<br />{{{termstart}}}{{#if:{{{term|}}}{{{termend|}}}|[[Category:Pages using infobox officeholder with succeeding and term or termend]]}}
4591 | {{#if: {{{term|}}} | {{nowrap|'''{{{termlabel|In office}}}'''}}<br />{{{term}}} }}
4592}} }}
4593
4594| data20 = {{#if:{{{nominee|}}}{{{candidate|}}}||
4595{{#if:{{{succeeding|}}}
4596 |
4597 |{{#if:{{{termstart|}}}
4598 | {{#if:{{{termend|}}}
4599 |<!--then: term has start and end:-->{{nowrap|'''{{{termlabel|In office}}}'''}}<br />{{{termstart}}}{{#iferror:{{#expr:{{{termstart}}}*{{{termend}}}}}|&nbsp;–&#32;|–}}{{{termend}}}{{#if:{{{alongside|}}}{{{co-leader|}}}|<br />{{#if:{{{alongside|}}}|Serving|Co-leading}}&#32;with&#32;{{#if:{{{alongside|}}}|{{{alongside}}}|{{{co-leader}}}}}}}
4600 |<!--else: term is ongoing--><div style="width:100%; margin:0; padding:0; background-color: {{{color|lavender}}}">'''[[Incumbent]]'''</div>
4601 }}
4602 }}
4603}} }}
4604
4605| data21 = {{#if:{{{nominee|}}}{{{candidate|}}}||
4606{{#if:{{{succeeding|}}}
4607 |
4608 |{{#if:{{{termstart|}}}
4609 |{{#if:{{{termend|}}}
4610|<!--then nothing else; term has ended-->
4611|<!--else term is ongoing:-->{{nowrap|'''Assumed office'''}}&#32;<br />{{{termstart}}}{{#if:{{{alongside|}}}{{{co-leader|}}}|<br />{{#if:{{{alongside|}}}|Serving|Co-leader}}&#32;with&#32;{{#if:{{{alongside|}}}|{{{alongside}}}|{{{co-leader}}}}}}}
4612 }}
4613 }}
4614}} }}
4615
4616}} }}<!--
4617 end infobox1 / start infobox2
4618-->{{#if:{{{monarch|}}}{{{president|}}}{{{governor-general|}}}{{{governor_general|}}}{{{primeminister|}}}{{{chancellor|}}}{{{minister|}}}{{{taoiseach|}}}{{{firstminister|}}}{{{chiefminister|}}}{{{premier|}}}{{{governor|}}}{{{lieutenant_governor|}}}{{{vicepresident|}}}{{{vicegovernor|}}}{{{viceprimeminister|}}}{{{vicepremier|}}}{{{deputy|}}}{{{leader|}}}{{{lieutenant|}}}{{{nominator|}}}{{{appointer|}}}{{{opponent|}}}{{{incumbent|}}}{{{succeeding|}}}{{{preceding|}}}{{{predecessor|}}}{{{preceded|}}}{{{successor|}}}{{{succeeded|}}}{{{parliamentarygroup|}}}{{{constituency|}}}{{{majority|}}}{{{1namedata|}}}{{{2namedata|}}}{{{3namedata|}}}{{{4namedata|}}}{{{5namedata|}}}{{{runningmate|}}}|
4619{{infobox|child=yes
4620| labelstyle = text-align:left
4621
4622| label1 = {{nowrap|Nominated by}}
4623| data1 = {{{nominator|}}}
4624
4625| label2 = {{nowrap|Appointed by}}
4626| data2 = {{{appointer|}}}
4627
4628<!--------President, Prime Minister, Governor--------->
4629| label3 = Monarch
4630| data3 = {{{monarch|}}}
4631
4632| label4 = President
4633| data4 = {{{president|}}}
4634
4635| label5 = {{#if:{{{governor_general|}}}|Governor General|Governor-General}}
4636| data5 = {{#if:{{{governor_general|}}}|{{{governor_general}}}|{{{governor-general|}}}}}
4637
4638| label6 = {{nowrap|Prime Minister}}
4639| data6 = {{{primeminister|}}}
4640
4641| label7 = Chancellor
4642| data7 = {{{chancellor|}}}
4643
4644| label8 = Minister
4645| data8 = {{{minister|}}}
4646
4647| label9 = Taoiseach
4648| data9 = {{{taoiseach|}}}
4649
4650| label10 = {{nowrap|First Minister}}
4651| data10 = {{{firstminister|}}}
4652
4653| label11 = {{nowrap|Chief Minister}}
4654| data11 = {{{chiefminister|}}}
4655
4656| label12 = Premier
4657| data12 = {{{premier|}}}
4658
4659| label13 = Governor
4660| data13 = {{{governor|}}}
4661
4662| label14 = Lieutenant Governor
4663| data14 = {{{lieutenant_governor|}}}
4664
4665<!--------Vice president/s, Vice Prime Minister/s, Deputy/ies, Lieutenant/s--------->
4666| label15 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice President]]|Vice President}}|Vice President}}}}
4667| data15 = {{{vicepresident|}}}
4668
4669| label16 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice Governor]]|Vice Governor}}|Vice Governor}}}}
4670| data16 = {{{vicegovernor|}}}
4671
4672| label17 = {{nowrap|{{#if:{{{office|}}}|[[Vice {{{office}}}|Vice PM]]|Vice [[Prime Minister|PM]]}}}}
4673| data17 = {{{viceprimeminister|}}}
4674
4675| label18 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice Premier]]|Vice Premier}}|Vice Premier}}}}
4676| data18 = {{{vicepremier|}}}
4677
4678| label19 = {{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Deputy {{{office}}}}}|valid|[[Deputy {{{office}}}|Deputy]]|Deputy}}|Deputy}}
4679| data19 = {{{deputy|}}}
4680
4681| label20 = Leader
4682| data20 = {{{leader|}}}
4683
4684| label21 = {{#if:{{{office|}}}|[[Lieutenant {{{office}}}|Lieutenant]]|Lieutenant}}
4685| data21 = {{{lieutenant|}}}
4686
4687<!--------Blank fields--------->
4688| label22 = {{{1blankname|}}}
4689| data22 = {{{1namedata|}}}
4690
4691| label23 = {{{2blankname|}}}
4692| data23 = {{{2namedata|}}}
4693
4694| label24 = {{{3blankname|}}}
4695| data24 = {{{3namedata|}}}
4696
4697| label25 = {{{4blankname|}}}
4698| data25 = {{{4namedata|}}}
4699
4700| label26 = {{{5blankname|}}}
4701| data26 = {{{5namedata|}}}
4702
4703<!--------Predecessor/successor--------->
4704| label27 = {{nowrap|Running mate}}
4705| data27 = {{{runningmate|}}}
4706
4707| label28 = Opponent(s)
4708| data28 = {{{opponent|}}}
4709
4710| label29 = Incumbent
4711| data29 = {{{incumbent|}}}
4712
4713| label30 = {{#if:{{{succeeding|}}}|Succeeding|Preceding}}
4714| data30 = {{#if:{{{succeeding|}}}|{{{succeeding|}}}|{{{preceding|}}}}}
4715
4716| label32 = {{nowrap|Preceded by}}
4717| data32 = {{#if:{{{succeeding|}}}||{{#if:{{{predecessor|}}}|{{{predecessor}}}|{{{preceded|}}}}}}}
4718
4719| label33 = {{nowrap|Succeeded by}}
4720| data33 = {{#if:{{{succeeding|}}}||{{#switch:{{#if:{{{successor|}}}|{{{successor}}}|{{{succeeded|}}}}}
4721| Incumbent
4722| '''Incumbent'''
4723| ''Incumbent''
4724| [[Incumbent]]
4725| incumbent
4726| '''incumbent'''
4727| ''incumbent''
4728| [[incumbent]] =
4729| #default = {{#if:{{{successor|}}}|{{{successor}}}|{{{succeeded|}}}}}
4730}}}}
4731<!--------Constituency/Majority--------->
4732| label34 = [[Parliamentary group]]
4733| data34 = {{{parliamentarygroup|}}}
4734
4735| label35 = Constituency
4736| data35 = {{{constituency|}}}
4737
4738| label36 = Majority
4739| data36 = {{{majority|}}}
4740}} }}<noinclude>{{documentation}}</noinclude></text>
4741 <sha1>2rmo84jauqmguacs6lf3h069y8nunoa</sha1>
4742 </revision>
4743 </page>
4744 <page>
4745 <title>Template:Infobox person/height</title>
4746 <ns>10</ns>
4747 <id>46311214</id>
4748 <revision>
4749 <id>750531944</id>
4750 <parentid>669608865</parentid>
4751 <timestamp>2016-11-20T09:38:14Z</timestamp>
4752 <contributor>
4753 <username>Zyxw</username>
4754 <id>473593</id>
4755 </contributor>
4756 <comment>fix to generate correct output if this template is passed a {{convert}} template using lk=on which generates wikilinks for unit names, tested with /sandbox and /testcases</comment>
4757 <model>wikitext</model>
4758 <format>text/x-wiki</format>
4759 <text xml:space="preserve" bytes="891">{{infobox person/height/locate|<!--
4760-->{{#invoke:String|replace|<!--
4761-->{{#invoke:String|replace|<!--
4762-->{{#invoke:String|replace|<!--
4763-->{{#invoke:String|replace|<!--
4764-->{{#invoke:String|replace|<!--
4765-->{{#invoke:String|replace|<!--
4766-->{{#invoke:String|replace|<!--
4767-->{{#invoke:String|replace|<!--
4768-->{{#invoke:String|replace|<!--
4769-->{{#invoke:String|replace|<!--
4770-->{{#invoke:String|replace|<!--
4771-->{{#invoke:String|replace|<!--
4772-->{{#invoke:String|replace|<!--
4773-->{{{1|}}}<!--
4774-->|metre|m}}<!--
4775-->|meter|m}}<!--
4776-->|centi|c}}<!--
4777-->|feet|ft}}<!--
4778-->|foot|ft}}<!--
4779-->|inches|in}}<!--
4780-->|inch|in}}<!--
4781-->|ms|m}}<!--
4782-->|ins|in}}<!--
4783-->|pattern=[[in|in]]|replace=[[inch|in]]}}<!--
4784-->|pattern=[[Centim|cm]]|replace=[[Centimetre|cm]]}}<!--
4785-->|pattern=[[m]]s|replace=[[Metre|m]]}}<!--
4786-->|pattern=[[cm]]s|replace=[[Centimetre|cm]]}}<!--
4787-->}}<noinclude>
4788{{Documentation}}
4789</noinclude></text>
4790 <sha1>hm0a0y5eigfl1uxgvuml6a1e537my1r</sha1>
4791 </revision>
4792 </page>
4793 <page>
4794 <title>Template:Infobox person/height/locate</title>
4795 <ns>10</ns>
4796 <id>46273076</id>
4797 <revision>
4798 <id>669728053</id>
4799 <parentid>654876043</parentid>
4800 <timestamp>2015-07-03T03:27:49Z</timestamp>
4801 <contributor>
4802 <username>Zyxw</username>
4803 <id>473593</id>
4804 </contributor>
4805 <comment>add documentation</comment>
4806 <model>wikitext</model>
4807 <format>text/x-wiki</format>
4808 <text xml:space="preserve" bytes="442">{{infobox person/height/switch
4809 |{{{1|}}}
4810 |{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}
4811 |m={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|m}}
4812 |c={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|cm}}
4813 |f={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|ft}}
4814 |i={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|in}}
4815}}<noinclude>
4816{{Documentation}}
4817</noinclude></text>
4818 <sha1>2iwsnrmmoqw8wz2cfz2gqum93q5z5o8</sha1>
4819 </revision>
4820 </page>
4821 <page>
4822 <title>Template:Infobox person/height/switch</title>
4823 <ns>10</ns>
4824 <id>46273068</id>
4825 <revision>
4826 <id>669728313</id>
4827 <parentid>654284746</parentid>
4828 <timestamp>2015-07-03T03:30:59Z</timestamp>
4829 <contributor>
4830 <username>Zyxw</username>
4831 <id>473593</id>
4832 </contributor>
4833 <comment>add documentation</comment>
4834 <model>wikitext</model>
4835 <format>text/x-wiki</format>
4836 <text xml:space="preserve" bytes="1628">{{#switch:0
4837 |{{{m}}}{{{f}}}{{{i}}}={{{1|}}}
4838 |{{{f}}}{{{i}}}={{#ifeq:{{{c}}}|0
4839 |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}}}
4840 |{{{1|}}}
4841 |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}|m|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
4842 }}
4843 |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}}}
4844 |{{{1|}}}
4845 |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}|cm|ftin|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{m|1}}}+1}}}}
4846 }}
4847 }}
4848 |{{{m}}}{{{f}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}}}
4849 |{{{1|}}}
4850 |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
4851 }}
4852 |{{{m}}}{{{i}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}}}
4853 |{{{1|}}}
4854 |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}}}
4855 }}
4856 |{{{m}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}+{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}}}
4857 |{{{1|}}}
4858 |{{convert|{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}|ft|{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{f|1}}}+2}}|{{#expr:{{{i|1}}}-1}}}}|in|cm|0|abbr=on}}{{#invoke:String|sub|{{{2|0}}}|{{#expr:{{{i|1}}}+2}}}}
4859 }}
4860 |{{{1|}}}
4861}}<noinclude>
4862{{Documentation}}
4863</noinclude></text>
4864 <sha1>tfj76ybwce528ig6r7c2o24m7aezoaz</sha1>
4865 </revision>
4866 </page>
4867 <page>
4868 <title>Template:IsValidPageName</title>
4869 <ns>10</ns>
4870 <id>13887241</id>
4871 <revision>
4872 <id>602408525</id>
4873 <parentid>602403710</parentid>
4874 <timestamp>2014-04-02T12:17:17Z</timestamp>
4875 <contributor>
4876 <username>Mr. Stradivarius</username>
4877 <id>4708675</id>
4878 </contributor>
4879 <comment>use [[Module:IsValidPageName]] per protected edit request by [[User:Mxn]]</comment>
4880 <model>wikitext</model>
4881 <format>text/x-wiki</format>
4882 <text xml:space="preserve" bytes="189">{{#ifeq:{{{1}}}|-||{{#invoke:isValidPageName|isValidPageName|{{{1}}}}}}}<noinclude>
4883{{documentation}}
4884<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
4885</noinclude></text>
4886 <sha1>m87vggnewseew9faw9mw0pefjucksud</sha1>
4887 </revision>
4888 </page>
4889 <page>
4890 <title>Template:KMT</title>
4891 <ns>10</ns>
4892 <id>11473981</id>
4893 <revision>
4894 <id>577859184</id>
4895 <parentid>399531305</parentid>
4896 <timestamp>2013-10-19T16:14:48Z</timestamp>
4897 <contributor>
4898 <username>WOSlinker</username>
4899 <id>3138265</id>
4900 </contributor>
4901 <minor/>
4902 <comment>Changed protection level of Template:KMT: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
4903 <model>wikitext</model>
4904 <format>text/x-wiki</format>
4905 <text xml:space="preserve" bytes="69">{{KMT/logo}} [[Kuomintang]]<noinclude>
4906{{documentation}}
4907</noinclude></text>
4908 <sha1>bciuvfwplt78dlw69sb47427jsiusje</sha1>
4909 </revision>
4910 </page>
4911 <page>
4912 <title>Template:KMT/logo</title>
4913 <ns>10</ns>
4914 <id>29792324</id>
4915 <revision>
4916 <id>577830981</id>
4917 <parentid>430631591</parentid>
4918 <timestamp>2013-10-19T11:18:58Z</timestamp>
4919 <contributor>
4920 <username>WOSlinker</username>
4921 <id>3138265</id>
4922 </contributor>
4923 <minor/>
4924 <comment>Changed protection level of Template:KMT/logo: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
4925 <model>wikitext</model>
4926 <format>text/x-wiki</format>
4927 <text xml:space="preserve" bytes="84">[[File:Emblem of the Kuomintang.svg|25px]]<noinclude>
4928{{documentation}}
4929</noinclude></text>
4930 <sha1>1pkag82pg2v2vjtqixy23cnhxln84ki</sha1>
4931 </revision>
4932 </page>
4933 <page>
4934 <title>Template:Lua</title>
4935 <ns>10</ns>
4936 <id>38752725</id>
4937 <revision>
4938 <id>827250968</id>
4939 <parentid>804533741</parentid>
4940 <timestamp>2018-02-23T17:02:35Z</timestamp>
4941 <contributor>
4942 <username>Primefac</username>
4943 <id>11508456</id>
4944 </contributor>
4945 <minor/>
4946 <comment>Changed protection level for "[[Template:Lua]]": [[WP:HIGHRISK|high-risk]] template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
4947 <model>wikitext</model>
4948 <format>text/x-wiki</format>
4949 <text xml:space="preserve" bytes="196"><includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
4950{{Lua|Module:Lua banner}}
4951{{documentation}}
4952<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
4953</noinclude></text>
4954 <sha1>pnmjp3f3fl321yf2jpg5syebi412n7b</sha1>
4955 </revision>
4956 </page>
4957 <page>
4958 <title>Template:Main other</title>
4959 <ns>10</ns>
4960 <id>17220251</id>
4961 <revision>
4962 <id>388689011</id>
4963 <parentid>334818505</parentid>
4964 <timestamp>2010-10-04T14:46:48Z</timestamp>
4965 <contributor>
4966 <username>WOSlinker</username>
4967 <id>3138265</id>
4968 </contributor>
4969 <comment>remove {{pp-template}}</comment>
4970 <model>wikitext</model>
4971 <format>text/x-wiki</format>
4972 <text xml:space="preserve" bytes="409">{{#switch:
4973 <!--If no or empty "demospace" parameter then detect namespace-->
4974 {{#if:{{{demospace|}}}
4975 | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
4976 | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
4977 | main
4978 | other
4979 }}
4980 }}
4981| main = {{{1|}}}
4982| other
4983| #default = {{{2|}}}
4984}}<noinclude>
4985
4986{{documentation}}
4987<!-- Add categories and interwikis to the /doc subpage, not here! -->
4988</noinclude></text>
4989 <sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1>
4990 </revision>
4991 </page>
4992 <page>
4993 <title>Template:Mbox</title>
4994 <ns>10</ns>
4995 <id>13319244</id>
4996 <revision>
4997 <id>772147376</id>
4998 <parentid>577968069</parentid>
4999 <timestamp>2017-03-25T16:04:14Z</timestamp>
5000 <contributor>
5001 <username>Jo-Jo Eumerus</username>
5002 <id>17449355</id>
5003 </contributor>
5004 <minor/>
5005 <comment>Changed protection level for "[[Template:Mbox]]": Allowing template editors on some templates with full protection dating back to pre-[[WP:TPROT]] times which aren't too often or too sensitively used. ([Edit=Require template editor access] (indefinite)...</comment>
5006 <model>wikitext</model>
5007 <format>text/x-wiki</format>
5008 <text xml:space="preserve" bytes="145">{{#invoke:Message box|mbox}}<noinclude>
5009{{documentation}}
5010<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
5011</noinclude></text>
5012 <sha1>mpflpb6s8l8gaoxaeypyuqyu2w7vc7i</sha1>
5013 </revision>
5014 </page>
5015 <page>
5016 <title>Template:Notice</title>
5017 <ns>10</ns>
5018 <id>1720676</id>
5019 <revision>
5020 <id>842723603</id>
5021 <parentid>753895133</parentid>
5022 <timestamp>2018-05-24T07:51:13Z</timestamp>
5023 <contributor>
5024 <username>TheDJ</username>
5025 <id>244887</id>
5026 </contributor>
5027 <comment>remove invalid css</comment>
5028 <model>wikitext</model>
5029 <format>text/x-wiki</format>
5030 <text xml:space="preserve" bytes="1008">{{Mbox
5031| name = Notice
5032| demospace = {{{demospace|}}}
5033| style = {{#if:{{{style|}}} |{{#if:{{{small|}}}||width:80%;}} {{{style}}} }}
5034| subst = <includeonly>{{subst:substcheck}}</includeonly>
5035| type = notice
5036| image = {{#if:{{{image|}}} |[[File:{{{image}}}|40px|Notice]]}}
5037| small = {{{small|}}}
5038| smallimage = {{#if:{{{image|}}} |[[File:{{{image}}}|30px|Notice]]}}
5039| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
5040| textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
5041| text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
5042 -->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
5043}}<noinclude>
5044{{Documentation}}
5045</noinclude></text>
5046 <sha1>etnai90pwmwvjm60vm69f5gjdnc8xy4</sha1>
5047 </revision>
5048 </page>
5049 <page>
5050 <title>Template:Nowrap</title>
5051 <ns>10</ns>
5052 <id>1627975</id>
5053 <restrictions>edit=sysop:move=sysop</restrictions>
5054 <revision>
5055 <id>692794261</id>
5056 <parentid>462345338</parentid>
5057 <timestamp>2015-11-28T10:13:53Z</timestamp>
5058 <contributor>
5059 <username>Edokter</username>
5060 <id>1624037</id>
5061 </contributor>
5062 <comment>Adapt comment; edits inside noinclude blocks should not affect job queue, but won't kill parser either way.</comment>
5063 <model>wikitext</model>
5064 <format>text/x-wiki</format>
5065 <text xml:space="preserve" bytes="145"><span class="nowrap">{{{1}}}</span><noinclude>
5066{{documentation}}
5067<!-- Categories go on the /doc page; interwikis go to Wikidata. -->
5068</noinclude></text>
5069 <sha1>avb5tcymgupik1ikutqclidkj9tnitx</sha1>
5070 </revision>
5071 </page>
5072 <page>
5073 <title>Template:Ombox</title>
5074 <ns>10</ns>
5075 <id>17522403</id>
5076 <revision>
5077 <id>577969039</id>
5078 <parentid>463278061</parentid>
5079 <timestamp>2013-10-20T12:45:08Z</timestamp>
5080 <contributor>
5081 <username>Mr. Stradivarius</username>
5082 <id>4708675</id>
5083 </contributor>
5084 <comment>switch to Lua version</comment>
5085 <model>wikitext</model>
5086 <format>text/x-wiki</format>
5087 <text xml:space="preserve" bytes="146">{{#invoke:Message box|ombox}}<noinclude>
5088{{documentation}}
5089<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
5090</noinclude></text>
5091 <sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1>
5092 </revision>
5093 </page>
5094 <page>
5095 <title>Template:PAGENAMEBASE</title>
5096 <ns>10</ns>
5097 <id>29780699</id>
5098 <revision>
5099 <id>708575225</id>
5100 <parentid>636280634</parentid>
5101 <timestamp>2016-03-06T09:37:56Z</timestamp>
5102 <contributor>
5103 <username>Cabayi</username>
5104 <id>6561336</id>
5105 </contributor>
5106 <comment>per edit request & discussion</comment>
5107 <model>wikitext</model>
5108 <format>text/x-wiki</format>
5109 <text xml:space="preserve" bytes="141">{{{{{|safesubst:}}}#Invoke:String|replace|{{{1|{{{{{|safesubst:}}}PAGENAME}}}}}|%s+%b()$||1|false}}<noinclude>
5110{{documentation}}
5111</noinclude></text>
5112 <sha1>sam8aetb68ekom4findu6pp900ngldr</sha1>
5113 </revision>
5114 </page>
5115 <page>
5116 <title>Template:Para</title>
5117 <ns>10</ns>
5118 <id>16639086</id>
5119 <revision>
5120 <id>843137667</id>
5121 <parentid>679823176</parentid>
5122 <timestamp>2018-05-27T03:56:49Z</timestamp>
5123 <contributor>
5124 <username>JJMC89</username>
5125 <id>24812038</id>
5126 </contributor>
5127 <comment>clean subst</comment>
5128 <model>wikitext</model>
5129 <format>text/x-wiki</format>
5130 <text xml:space="preserve" bytes="313"><code class="nowrap" {{SAFESUBST:<noinclude />#if:{{{plain|}}}|style="border:none;background-color:inherit;color:inherit;"}}>&#124;{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{{1}}}&#61;}}{{{2|}}}</code><noinclude>
5131{{Documentation}}
5132<!--Categories and interwikis go near the bottom of the /doc subpage.-->
5133</noinclude></text>
5134 <sha1>fzhirwlsi2n3ak3qun5tviym3yisuda</sha1>
5135 </revision>
5136 </page>
5137 <page>
5138 <title>Template:Parameter names example</title>
5139 <ns>10</ns>
5140 <id>43305139</id>
5141 <revision>
5142 <id>804536750</id>
5143 <parentid>623570683</parentid>
5144 <timestamp>2017-10-09T17:20:51Z</timestamp>
5145 <contributor>
5146 <username>MusikAnimal</username>
5147 <id>14882394</id>
5148 </contributor>
5149 <minor/>
5150 <comment>Protected "[[Template:Parameter names example]]": [[WP:High-risk templates|Highly visible template]]; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))</comment>
5151 <model>wikitext</model>
5152 <format>text/x-wiki</format>
5153 <text xml:space="preserve" bytes="256"><includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
5154{{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
5155{{Documentation}}
5156</noinclude></text>
5157 <sha1>cjle1o3weadzp7u1v4l5clox5ri8mpi</sha1>
5158 </revision>
5159 </page>
5160 <page>
5161 <title>Template:Person infobox header</title>
5162 <ns>10</ns>
5163 <id>35514345</id>
5164 <revision>
5165 <id>779401388</id>
5166 <parentid>779400974</parentid>
5167 <timestamp>2017-05-08T18:09:48Z</timestamp>
5168 <contributor>
5169 <username>Obsuser</username>
5170 <id>22359926</id>
5171 </contributor>
5172 <comment>not only about living</comment>
5173 <model>wikitext</model>
5174 <format>text/x-wiki</format>
5175 <text xml:space="preserve" bytes="692">{{ombox|type=content|text=The design and content of biographical infoboxes must follow Wikipedia's [[Wikipedia:Verifiability|verifiability policy]], as well as [[Wikipedia:Manual of Style/Infoboxes|infobox]] and [[Wikipedia:Manual of Style/Biographies|biographical style guideline]].
5176
5177All content displayed in this template must adhere to the '''[[Wikipedia:Biographies of living persons|biographies of living persons]]''' policy if applicable. [[Wikipedia:Citing sources|Unsourced or poorly sourced]] contentious material '''must be removed immediately''' from the article and its infobox, especially if potentially [[Wikipedia:Libel|libellous]].}}
5178<noinclude>
5179{{Documentation}}
5180</noinclude></text>
5181 <sha1>jod8xgsivbjufzzca2z1az6kmt07fji</sha1>
5182 </revision>
5183 </page>
5184 <page>
5185 <title>Template:Refbegin</title>
5186 <ns>10</ns>
5187 <id>9391283</id>
5188 <revision>
5189 <id>780001198</id>
5190 <parentid>772120876</parentid>
5191 <timestamp>2017-05-12T09:46:40Z</timestamp>
5192 <contributor>
5193 <username>TheDJ</username>
5194 <id>244887</id>
5195 </contributor>
5196 <comment>Use class from MediaWiki:Common.css to implement hanging indentation</comment>
5197 <model>wikitext</model>
5198 <format>text/x-wiki</format>
5199 <text xml:space="preserve" bytes="828"><includeonly><div class="refbegin <!--
5200-->{{#if: {{{indent|}}}
5201 | refbegin-hanging-indents }} <!--
5202 -->{{#if: {{{normalfont|}}}
5203 | refbegin-100 }} <!--
5204 -->{{#if: {{{1|}}}
5205 | columns {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
5206 | references-column-width
5207 | references-column-count references-column-count-{{#if:1|{{{1}}}}} }}
5208 | {{#if: {{{colwidth|}}}
5209 | references-column-width }} }}" style="<!--
5210 -->{{#if: {{{1|}}}
5211 | {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
5212 | {{column-width|{{#if:1|{{{1}}}}}}}
5213 | {{column-count|{{#if:1|{{{1}}}}}}} }}
5214 | {{#if: {{{colwidth|}}}
5215 | {{column-width|{{{colwidth}}}}} }} }}"><!--
5216 -->{{#if: {{{normalfont|}}}
5217 | [[Category:Pages using refbegin with normalfont parameter]]}}</includeonly><noinclude>
5218{{Documentation}}
5219{{/TemplateData}}
5220</noinclude></text>
5221 <sha1>jviesmg7qfir8shmypzzu26dk3g9eiw</sha1>
5222 </revision>
5223 </page>
5224 <page>
5225 <title>Template:Refend</title>
5226 <ns>10</ns>
5227 <id>10023179</id>
5228 <revision>
5229 <id>792167400</id>
5230 <parentid>772120878</parentid>
5231 <timestamp>2017-07-24T21:40:56Z</timestamp>
5232 <contributor>
5233 <username>WOSlinker</username>
5234 <id>3138265</id>
5235 </contributor>
5236 <comment>remove </dl> since no <dl> in Template:Refbegin</comment>
5237 <model>wikitext</model>
5238 <format>text/x-wiki</format>
5239 <text xml:space="preserve" bytes="246"><includeonly></div></includeonly><noinclude>
5240{{template doc|Template:refbegin/doc}}
5241{{TemplateDataHeader}}
5242<templatedata>
5243{
5244 "description": "Ends a reference lists started by {{refbegin}}.",
5245 "params": {
5246 }
5247}
5248</templatedata>
5249</noinclude></text>
5250 <sha1>kcrxzrf6v4rvbl0yhnfcb5labufpnsp</sha1>
5251 </revision>
5252 </page>
5253 <page>
5254 <title>Template:Remove first word</title>
5255 <ns>10</ns>
5256 <id>31754320</id>
5257 <revision>
5258 <id>825507827</id>
5259 <parentid>825479029</parentid>
5260 <timestamp>2018-02-13T20:10:27Z</timestamp>
5261 <contributor>
5262 <username>WOSlinker</username>
5263 <id>3138265</id>
5264 </contributor>
5265 <comment>separate pp-template not needed</comment>
5266 <model>wikitext</model>
5267 <format>text/x-wiki</format>
5268 <text xml:space="preserve" bytes="178">{{<includeonly>safesubst:</includeonly>#invoke:String|replace|source={{{1}}}|pattern=^[^{{{sep|%s}}}]*{{{sep|%s}}}*|replace=|plain=false}}<noinclude>{{Documentation}}</noinclude></text>
5269 <sha1>q3rvb3vj9phd54s3yecz8846q90qfgo</sha1>
5270 </revision>
5271 </page>
5272 <page>
5273 <title>Template:Str left</title>
5274 <ns>10</ns>
5275 <id>21696393</id>
5276 <revision>
5277 <id>741880261</id>
5278 <parentid>605122708</parentid>
5279 <timestamp>2016-09-30T07:01:19Z</timestamp>
5280 <contributor>
5281 <username>Ymblanter</username>
5282 <id>14596827</id>
5283 </contributor>
5284 <minor/>
5285 <comment>Changed protection level of Template:Str left: [[WP:High-risk templates|Highly visible template]]: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
5286 <model>wikitext</model>
5287 <format>text/x-wiki</format>
5288 <text xml:space="preserve" bytes="184"><includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
5289{{documentation}}
5290<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
5291</noinclude></text>
5292 <sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1>
5293 </revision>
5294 </page>
5295 <page>
5296 <title>Template:TemplateDataHeader</title>
5297 <ns>10</ns>
5298 <id>46746520</id>
5299 <redirect title="Template:TemplateData header" />
5300 <revision>
5301 <id>827245774</id>
5302 <parentid>663071012</parentid>
5303 <timestamp>2018-02-23T16:30:31Z</timestamp>
5304 <contributor>
5305 <username>Primefac</username>
5306 <id>11508456</id>
5307 </contributor>
5308 <minor/>
5309 <comment>Changed protection level for "[[Template:TemplateDataHeader]]": [[WP:HIGHRISK|high-risk]] template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
5310 <model>wikitext</model>
5311 <format>text/x-wiki</format>
5312 <text xml:space="preserve" bytes="58">#REDIRECT [[Template:TemplateData header]]
5313{{R from move}}</text>
5314 <sha1>bfnm7z66t4q2d8otfa0y3vtgkcwrfao</sha1>
5315 </revision>
5316 </page>
5317 <page>
5318 <title>Template:TemplateData header</title>
5319 <ns>10</ns>
5320 <id>40047498</id>
5321 <revision>
5322 <id>827245794</id>
5323 <parentid>826349555</parentid>
5324 <timestamp>2018-02-23T16:30:31Z</timestamp>
5325 <contributor>
5326 <username>Primefac</username>
5327 <id>11508456</id>
5328 </contributor>
5329 <minor/>
5330 <comment>Changed protection level for "[[Template:TemplateData header]]": [[WP:HIGHRISK|high-risk]] template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
5331 <model>wikitext</model>
5332 <format>text/x-wiki</format>
5333 <text xml:space="preserve" bytes="501"><div class="templatedata-header">{{#if:{{{noheader|}}}|{{Template error report}}|This is the {{#if:{{{nolink|}}}|TemplateData|[[Wikipedia:TemplateData|TemplateData]]}} documentation for this template used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools; {{Template error report|lc=yes}}}}
5334
5335'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
5336</div><includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
5337[[Category:TemplateData documentation]]
5338}}</includeonly><noinclude>
5339{{Documentation}}
5340</noinclude></text>
5341 <sha1>1lgj007izalttlek052vptodul1clkt</sha1>
5342 </revision>
5343 </page>
5344 <page>
5345 <title>Template:Template error report</title>
5346 <ns>10</ns>
5347 <id>51792646</id>
5348 <revision>
5349 <id>827245762</id>
5350 <parentid>826348773</parentid>
5351 <timestamp>2018-02-23T16:30:31Z</timestamp>
5352 <contributor>
5353 <username>Primefac</username>
5354 <id>11508456</id>
5355 </contributor>
5356 <minor/>
5357 <comment>Changed protection level for "[[Template:Template error report]]": [[WP:HIGHRISK|high-risk]] template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
5358 <model>wikitext</model>
5359 <format>text/x-wiki</format>
5360 <text xml:space="preserve" bytes="278">{{#ifeq:{{yesno-no|{{{lc}}}}}|no|S|s}}ee the [https://tools.wmflabs.org/bambots/TemplateParam.php?wiki=enwiki&template={{Urlencode:{{{1|{{ROOTPAGENAME}}}}}}} monthly error report] for this template.<noinclude>
5361
5362{{documentation}}
5363
5364[[Category:External link templates]]</noinclude></text>
5365 <sha1>58xkdtdvcn1dijd3bs4zlibe610r8r1</sha1>
5366 </revision>
5367 </page>
5368 <page>
5369 <title>Template:Template other</title>
5370 <ns>10</ns>
5371 <id>21418395</id>
5372 <revision>
5373 <id>774731050</id>
5374 <parentid>388689098</parentid>
5375 <timestamp>2017-04-10T09:49:10Z</timestamp>
5376 <contributor>
5377 <username>CambridgeBayWeather</username>
5378 <id>294180</id>
5379 </contributor>
5380 <minor/>
5381 <comment>Changed protection level for "[[Template:Template other]]": Request at RFPP ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
5382 <model>wikitext</model>
5383 <format>text/x-wiki</format>
5384 <text xml:space="preserve" bytes="435">{{#switch:
5385 <!--If no or empty "demospace" parameter then detect namespace-->
5386 {{#if:{{{demospace|}}}
5387 | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
5388 | {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
5389 | template
5390 | other
5391 }}
5392 }}
5393| template = {{{1|}}}
5394| other
5395| #default = {{{2|}}}
5396}}<!--End switch--><noinclude>
5397
5398{{documentation}}
5399<!-- Add categories and interwikis to the /doc subpage, not here! -->
5400</noinclude></text>
5401 <sha1>0tcssjmltwl7y5v3f5wj2kqciaabqly</sha1>
5402 </revision>
5403 </page>
5404 <page>
5405 <title>Template:Tl</title>
5406 <ns>10</ns>
5407 <id>1487430</id>
5408 <revision>
5409 <id>836995080</id>
5410 <parentid>776260390</parentid>
5411 <timestamp>2018-04-18T02:46:37Z</timestamp>
5412 <contributor>
5413 <username>Xaosflux</username>
5414 <id>502540</id>
5415 </contributor>
5416 <minor/>
5417 <comment>Changed protection level for "[[Template:Tl]]": used in the mediawiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
5418 <model>wikitext</model>
5419 <format>text/x-wiki</format>
5420 <text xml:space="preserve" bytes="168">&#123;&#123;[[Template:{{{1}}}|{{{1}}}]]&#125;&#125;<noinclude>
5421{{documentation}}
5422<!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
5423</noinclude></text>
5424 <sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1>
5425 </revision>
5426 </page>
5427 <page>
5428 <title>Template:Tld</title>
5429 <ns>10</ns>
5430 <id>16451582</id>
5431 <revision>
5432 <id>722499597</id>
5433 <parentid>559778632</parentid>
5434 <timestamp>2016-05-28T14:58:08Z</timestamp>
5435 <contributor>
5436 <username>Yaris678</username>
5437 <id>1210941</id>
5438 </contributor>
5439 <minor/>
5440 <comment>Changed protection level of Template:Tld: [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
5441 <model>wikitext</model>
5442 <format>text/x-wiki</format>
5443 <text xml:space="preserve" bytes="766">{{Tlg|code=yes|nolink=yes|subst={{{subst|}}}|nowrap={{#if:{{{allowlinebreak|}}}||yes}}|{{{1|}}}<!--
5444-->|2{{#ifeq:{{{2}}}|{{{2|x}}}||x}}={{{2}}}<!--
5445-->|3{{#ifeq:{{{3}}}|{{{3|x}}}||x}}={{{3}}}<!--
5446-->|4{{#ifeq:{{{4}}}|{{{4|x}}}||x}}={{{4}}}<!--
5447-->|5{{#ifeq:{{{5}}}|{{{5|x}}}||x}}={{{5}}}<!--
5448-->|6{{#ifeq:{{{6}}}|{{{6|x}}}||x}}={{{6}}}<!--
5449-->|7{{#ifeq:{{{7}}}|{{{7|x}}}||x}}={{{7}}}<!--
5450-->|8{{#ifeq:{{{8}}}|{{{8|x}}}||x}}={{{8}}}<!--
5451-->|9{{#ifeq:{{{9}}}|{{{9|x}}}||x}}={{{9}}}<!--
5452-->|10{{#ifeq:{{{10}}}|{{{10|x}}}||x}}={{{10}}}<!--
5453-->|11{{#ifeq:{{{11}}}|{{{11|x}}}||x}}={{{11}}}<!--
5454-->|12{{#ifeq:{{{12}}}|{{{12|x}}}||x}}={{{12}}}}}<noinclude>
5455{{Documentation|Template:Tlc/doc}}
5456<!-- Add categories and interwikis to the /doc subpage, not here! -->
5457</noinclude></text>
5458 <sha1>m2m4u5powlflffx95pdx6t1iqjyxxrr</sha1>
5459 </revision>
5460 </page>
5461 <page>
5462 <title>Template:Tlg</title>
5463 <ns>10</ns>
5464 <id>31734151</id>
5465 <revision>
5466 <id>790785155</id>
5467 <parentid>790782997</parentid>
5468 <timestamp>2017-07-16T01:43:12Z</timestamp>
5469 <contributor>
5470 <username>Zyxw</username>
5471 <id>473593</id>
5472 </contributor>
5473 <minor/>
5474 <comment>update placement of span</comment>
5475 <model>wikitext</model>
5476 <format>text/x-wiki</format>
5477 <text xml:space="preserve" bytes="2794"><includeonly><!--
5478 -->{{#if:{{{nowrap|}}} |<span class="nowrap">}}<!--
5479 -->{{#if:{{{code|{{{tt|}}}}}} |<code> |{{#if:{{{plaincode|}}}|<code style="border:none;background:transparent;">}} }}<!--
5480 -->{{#if:{{{kbd|}}} |<kbd>}}<!--
5481 -->{{#if:{{{nowrapname|}}} |<span class="nowrap">}}<!--
5482 -->{{#if:{{{braceinside|}}} | |<nowiki>{{</nowiki>}}<!--
5483 -->{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
5484
5485 -->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!--
5486 -->{{#if:{{{nolink|}}} |<!--then omit template link, else:
5487 -->| {{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!--
5488 -->{{!((}}:<!--(start building link with "[[:")
5489 -->{{#ifeq:{{padleft:|1|{{{1}}}}}|: <!--i.e. if {{{1}}}'s first character is a colon,
5490 then:--> |{{FULLPAGENAME:{{{1}}}}}<!--
5491 else:--> |{{#switch:{{NAMESPACE:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}}}
5492 | {{ns:0}} = {{ns:10}}:{{#if:{{{1|}}}|{{PAGENAME:{{{1}}}}}|{{PAGENAME}}}}
5493 | #default = {{#if:{{{1|}}}|{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME}}}}
5494 }}}}<!--
5495 -->{{!}}<!--(pipe between link and label, i.e. [[:link|label]])
5496 -->}}<!--
5497 -->{{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!--
5498 label / template name:
5499 -->{{{alttext|{{#if:{{{1|}}}|{{{1}}}|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME}}}}}}}}}<!--
5500 -->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!--
5501 -->{{#if:{{{nolink|}}} | |<!--
5502 -->{{!))}}<!--(end link)
5503 -->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!--
5504 -->}}<!--
5505 -->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!--
5506 -->{{#if:{{{nowrapname|}}} |</span>}}<!--
5507
5508 -->{{#if:{{{italic|{{{italics|}}}}}} |<span style="font-style:italic;">}}<!--
5509 -->{{#ifeq:{{{2|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{2}}}}}}}<!--
5510 -->{{#ifeq:{{{3|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{3}}}}}}}<!--
5511 -->{{#ifeq:{{{4|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{4}}}}}}}<!--
5512 -->{{#ifeq:{{{5|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{5}}}}}}}<!--
5513 -->{{#ifeq:{{{6|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{6}}}}}}}<!--
5514 -->{{#ifeq:{{{7|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{7}}}}}}}<!--
5515 -->{{#ifeq:{{{8|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{8}}}}}}}<!--
5516 -->{{#ifeq:{{{9|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{9}}}}}}}<!--
5517 -->{{#ifeq:{{{10|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{10}}}}}}}<!--
5518 -->{{#ifeq:{{{11|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{11}}}}}}}<!--
5519 -->{{#if:{{{12|}}} |&#124;…}}<!--
5520 -->{{#if:{{{italic|{{{italics|}}}}}} |</span>}}<!--
5521
5522 -->{{#if:{{{braceinside|}}} | |<nowiki>}}</nowiki>}}<!--
5523 -->{{#if:{{{kbd|}}} |</kbd>}}<!--
5524 -->{{#if:{{{code|{{{tt|}}}}}}{{{plaincode|}}} |</code>}}<!--
5525 -->{{#if:{{{nowrap|}}} |</span>}}<!--
5526--></includeonly><noinclude>
5527{{Documentation}}
5528</noinclude></text>
5529 <sha1>byyf1x2onevkha93mms6divoszra5y1</sha1>
5530 </revision>
5531 </page>
5532 <page>
5533 <title>Template:UF-hcard-person</title>
5534 <ns>10</ns>
5535 <id>10730642</id>
5536 <revision>
5537 <id>833916985</id>
5538 <parentid>833916926</parentid>
5539 <timestamp>2018-04-03T00:59:17Z</timestamp>
5540 <contributor>
5541 <username>Charles E Hampton II</username>
5542 <id>1545773</id>
5543 </contributor>
5544 <comment>Undid revision 833916926 by [[Special:Contributions/Charles E Hampton II|Charles E Hampton II]] ([[User talk:Charles E Hampton II|talk]])</comment>
5545 <model>wikitext</model>
5546 <format>text/x-wiki</format>
5547 <text xml:space="preserve" bytes="1569">The HTML markup produced by this template includes an [[HCard|hCard microformat]], which makes the person's details [[Parsing|parsable]] by computers, either acting automatically to catalogue articles across Wikipedia or via a browser tool operated by a reader, to (for example) add the subject to an address book or database. For more information about the use of [[microformat]]s on Wikipedia, please see [[Wikipedia:WikiProject Microformats|the microformat project]].
5548
5549=== Sub-templates ===
5550Date-of-birth ("bday") information will only be included in the microformat if {{tl|birth date}}, or {{tl|birth date and age}} are used in the infobox. ([[Wikipedia:WikiProject Microformats/dates|Do not use these if the date is before 1583]]). Be cautious about using these if the person is still living, per [[WP:DOB]].
5551
5552To include a URL, use {{Tl|URL}}.
5553
5554'''Please do not remove instances of these sub-templates.'''
5555
5556=== Classes ===
5557hCard uses HTML classes including:
5558{{Flatlist/microformat|
5559*adr
5560*agent
5561*bday
5562*birthplace
5563*category
5564*country-name
5565*deathdate
5566*deathplace
5567*extended-address
5568*family-name
5569*fn (required)
5570*given-name
5571*honorific-prefix
5572*honorific-suffix
5573*label
5574*locality
5575*n
5576*nickname
5577*note
5578*org
5579*role
5580*url
5581*vcard
5582}}
5583
5584'''Please do not rename or remove these classes nor collapse nested elements which use them.'''<includeonly>{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCards]]}} }}</includeonly><noinclude>
5585
5586[[Category:Templates generating hCards]]
5587[[Category:Microformat (uF) message templates]]
5588</noinclude></text>
5589 <sha1>axz1fcq74yk4k48upkzdbv1ne3ifwdf</sha1>
5590 </revision>
5591 </page>
5592 <page>
5593 <title>Template:When on basepage</title>
5594 <ns>10</ns>
5595 <id>24953498</id>
5596 <revision>
5597 <id>627655680</id>
5598 <parentid>623562904</parentid>
5599 <timestamp>2014-09-30T08:52:52Z</timestamp>
5600 <contributor>
5601 <username>Sardanaphalus</username>
5602 <id>427947</id>
5603 </contributor>
5604 <minor/>
5605 <comment>Sardanaphalus moved page [[Template:Basepage subpage]] to [[Template:When on basepage]]: Per move request</comment>
5606 <model>wikitext</model>
5607 <format>text/x-wiki</format>
5608 <text xml:space="preserve" bytes="686">{{#switch:
5609 <!--If no or empty "page" parameter then detect
5610 basepage/subpage/subsubpage-->
5611 {{#if:{{{page|}}}
5612 | {{#if:{{#titleparts:{{{page}}}|0|3}}
5613 | subsubpage <!--Subsubpage or lower-->
5614 | {{#if:{{#titleparts:{{{page}}}|0|2}}
5615 | subpage
5616 | basepage
5617 }}
5618 }}
5619 | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
5620 | subsubpage <!--Subsubpage or lower-->
5621 | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
5622 | subpage
5623 | basepage
5624 }}
5625 }}
5626 }}
5627
5628| basepage = {{{1|}}}
5629| subpage = {{{2|}}}
5630| subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
5631}}<!--End switch--><noinclude>
5632{{Documentation}}
5633</noinclude></text>
5634 <sha1>o7r5t2v8ni781nvx47cen0sam91sxxc</sha1>
5635 </revision>
5636 </page>
5637 <page>
5638 <title>Template:Yesno</title>
5639 <ns>10</ns>
5640 <id>22255088</id>
5641 <revision>
5642 <id>821904792</id>
5643 <parentid>669640856</parentid>
5644 <timestamp>2018-01-23T08:37:08Z</timestamp>
5645 <contributor>
5646 <username>MSGJ</username>
5647 <id>42630</id>
5648 </contributor>
5649 <comment>add support for on/off, per discussion</comment>
5650 <model>wikitext</model>
5651 <format>text/x-wiki</format>
5652 <text xml:space="preserve" bytes="366">{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
5653 |no
5654 |n
5655 |false
5656 |off
5657 |0 = {{{no|<!-- null -->}}}
5658 | = {{{blank|{{{no|<!-- null -->}}}}}}
5659 |¬ = {{{¬|}}}
5660 |yes
5661 |y
5662 |true
5663 |on
5664 |1 = {{{yes|yes}}}
5665 |#default = {{{def|{{{yes|yes}}}}}}
5666}}<noinclude>
5667{{Documentation}}
5668</noinclude></text>
5669 <sha1>r1wh7ajnm478r67owpatavjany80n9e</sha1>
5670 </revision>
5671 </page>
5672 <page>
5673 <title>Template:Yesno-no</title>
5674 <ns>10</ns>
5675 <id>48375573</id>
5676 <revision>
5677 <id>825510157</id>
5678 <parentid>804450734</parentid>
5679 <timestamp>2018-02-13T20:27:17Z</timestamp>
5680 <contributor>
5681 <username>WOSlinker</username>
5682 <id>3138265</id>
5683 </contributor>
5684 <comment>separate pp-template not needed</comment>
5685 <model>wikitext</model>
5686 <format>text/x-wiki</format>
5687 <text xml:space="preserve" bytes="269">{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
5688{{Documentation|Template:Yesno/doc}}
5689<!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
5690</noinclude></text>
5691 <sha1>34vmtxa9ubuh1vz2ulp78m5ela68riu</sha1>
5692 </revision>
5693 </page>
5694 <page>
5695 <title>Module:Arguments</title>
5696 <ns>828</ns>
5697 <id>41298065</id>
5698 <revision>
5699 <id>696500078</id>
5700 <parentid>668829606</parentid>
5701 <timestamp>2015-12-23T16:07:27Z</timestamp>
5702 <contributor>
5703 <username>Xaosflux</username>
5704 <id>502540</id>
5705 </contributor>
5706 <minor/>
5707 <comment>Changed protection level of Module:Arguments: used in the mediawiki interface ex: [[MediaWiki:Watchlist-details]] ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</comment>
5708 <model>Scribunto</model>
5709 <format>text/plain</format>
5710 <text xml:space="preserve" bytes="10054">-- This module provides easy processing of arguments passed to Scribunto from
5711-- #invoke. It is intended for use by other Lua modules, and should not be
5712-- called from #invoke directly.
5713
5714local libraryUtil = require('libraryUtil')
5715local checkType = libraryUtil.checkType
5716
5717local arguments = {}
5718
5719-- Generate four different tidyVal functions, so that we don't have to check the
5720-- options every time we call it.
5721
5722local function tidyValDefault(key, val)
5723 if type(val) == 'string' then
5724 val = val:match('^%s*(.-)%s*$')
5725 if val == '' then
5726 return nil
5727 else
5728 return val
5729 end
5730 else
5731 return val
5732 end
5733end
5734
5735local function tidyValTrimOnly(key, val)
5736 if type(val) == 'string' then
5737 return val:match('^%s*(.-)%s*$')
5738 else
5739 return val
5740 end
5741end
5742
5743local function tidyValRemoveBlanksOnly(key, val)
5744 if type(val) == 'string' then
5745 if val:find('%S') then
5746 return val
5747 else
5748 return nil
5749 end
5750 else
5751 return val
5752 end
5753end
5754
5755local function tidyValNoChange(key, val)
5756 return val
5757end
5758
5759local function matchesTitle(given, title)
5760 local tp = type( given )
5761 return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
5762end
5763
5764local translate_mt = { __index = function(t, k) return k end }
5765
5766function arguments.getArgs(frame, options)
5767 checkType('getArgs', 1, frame, 'table', true)
5768 checkType('getArgs', 2, options, 'table', true)
5769 frame = frame or {}
5770 options = options or {}
5771
5772 --[[
5773 -- Set up argument translation.
5774 --]]
5775 options.translate = options.translate or {}
5776 if getmetatable(options.translate) == nil then
5777 setmetatable(options.translate, translate_mt)
5778 end
5779 if options.backtranslate == nil then
5780 options.backtranslate = {}
5781 for k,v in pairs(options.translate) do
5782 options.backtranslate[v] = k
5783 end
5784 end
5785 if options.backtranslate and getmetatable(options.backtranslate) == nil then
5786 setmetatable(options.backtranslate, {
5787 __index = function(t, k)
5788 if options.translate[k] ~= k then
5789 return nil
5790 else
5791 return k
5792 end
5793 end
5794 })
5795 end
5796
5797 --[[
5798 -- Get the argument tables. If we were passed a valid frame object, get the
5799 -- frame arguments (fargs) and the parent frame arguments (pargs), depending
5800 -- on the options set and on the parent frame's availability. If we weren't
5801 -- passed a valid frame object, we are being called from another Lua module
5802 -- or from the debug console, so assume that we were passed a table of args
5803 -- directly, and assign it to a new variable (luaArgs).
5804 --]]
5805 local fargs, pargs, luaArgs
5806 if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
5807 if options.wrappers then
5808 --[[
5809 -- The wrappers option makes Module:Arguments look up arguments in
5810 -- either the frame argument table or the parent argument table, but
5811 -- not both. This means that users can use either the #invoke syntax
5812 -- or a wrapper template without the loss of performance associated
5813 -- with looking arguments up in both the frame and the parent frame.
5814 -- Module:Arguments will look up arguments in the parent frame
5815 -- if it finds the parent frame's title in options.wrapper;
5816 -- otherwise it will look up arguments in the frame object passed
5817 -- to getArgs.
5818 --]]
5819 local parent = frame:getParent()
5820 if not parent then
5821 fargs = frame.args
5822 else
5823 local title = parent:getTitle():gsub('/sandbox$', '')
5824 local found = false
5825 if matchesTitle(options.wrappers, title) then
5826 found = true
5827 elseif type(options.wrappers) == 'table' then
5828 for _,v in pairs(options.wrappers) do
5829 if matchesTitle(v, title) then
5830 found = true
5831 break
5832 end
5833 end
5834 end
5835
5836 -- We test for false specifically here so that nil (the default) acts like true.
5837 if found or options.frameOnly == false then
5838 pargs = parent.args
5839 end
5840 if not found or options.parentOnly == false then
5841 fargs = frame.args
5842 end
5843 end
5844 else
5845 -- options.wrapper isn't set, so check the other options.
5846 if not options.parentOnly then
5847 fargs = frame.args
5848 end
5849 if not options.frameOnly then
5850 local parent = frame:getParent()
5851 pargs = parent and parent.args or nil
5852 end
5853 end
5854 if options.parentFirst then
5855 fargs, pargs = pargs, fargs
5856 end
5857 else
5858 luaArgs = frame
5859 end
5860
5861 -- Set the order of precedence of the argument tables. If the variables are
5862 -- nil, nothing will be added to the table, which is how we avoid clashes
5863 -- between the frame/parent args and the Lua args.
5864 local argTables = {fargs}
5865 argTables[#argTables + 1] = pargs
5866 argTables[#argTables + 1] = luaArgs
5867
5868 --[[
5869 -- Generate the tidyVal function. If it has been specified by the user, we
5870 -- use that; if not, we choose one of four functions depending on the
5871 -- options chosen. This is so that we don't have to call the options table
5872 -- every time the function is called.
5873 --]]
5874 local tidyVal = options.valueFunc
5875 if tidyVal then
5876 if type(tidyVal) ~= 'function' then
5877 error(
5878 "bad value assigned to option 'valueFunc'"
5879 .. '(function expected, got '
5880 .. type(tidyVal)
5881 .. ')',
5882 2
5883 )
5884 end
5885 elseif options.trim ~= false then
5886 if options.removeBlanks ~= false then
5887 tidyVal = tidyValDefault
5888 else
5889 tidyVal = tidyValTrimOnly
5890 end
5891 else
5892 if options.removeBlanks ~= false then
5893 tidyVal = tidyValRemoveBlanksOnly
5894 else
5895 tidyVal = tidyValNoChange
5896 end
5897 end
5898
5899 --[[
5900 -- Set up the args, metaArgs and nilArgs tables. args will be the one
5901 -- accessed from functions, and metaArgs will hold the actual arguments. Nil
5902 -- arguments are memoized in nilArgs, and the metatable connects all of them
5903 -- together.
5904 --]]
5905 local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
5906 setmetatable(args, metatable)
5907
5908 local function mergeArgs(tables)
5909 --[[
5910 -- Accepts multiple tables as input and merges their keys and values
5911 -- into one table. If a value is already present it is not overwritten;
5912 -- tables listed earlier have precedence. We are also memoizing nil
5913 -- values, which can be overwritten if they are 's' (soft).
5914 --]]
5915 for _, t in ipairs(tables) do
5916 for key, val in pairs(t) do
5917 if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
5918 local tidiedVal = tidyVal(key, val)
5919 if tidiedVal == nil then
5920 nilArgs[key] = 's'
5921 else
5922 metaArgs[key] = tidiedVal
5923 end
5924 end
5925 end
5926 end
5927 end
5928
5929 --[[
5930 -- Define metatable behaviour. Arguments are memoized in the metaArgs table,
5931 -- and are only fetched from the argument tables once. Fetching arguments
5932 -- from the argument tables is the most resource-intensive step in this
5933 -- module, so we try and avoid it where possible. For this reason, nil
5934 -- arguments are also memoized, in the nilArgs table. Also, we keep a record
5935 -- in the metatable of when pairs and ipairs have been called, so we do not
5936 -- run pairs and ipairs on the argument tables more than once. We also do
5937 -- not run ipairs on fargs and pargs if pairs has already been run, as all
5938 -- the arguments will already have been copied over.
5939 --]]
5940
5941 metatable.__index = function (t, key)
5942 --[[
5943 -- Fetches an argument when the args table is indexed. First we check
5944 -- to see if the value is memoized, and if not we try and fetch it from
5945 -- the argument tables. When we check memoization, we need to check
5946 -- metaArgs before nilArgs, as both can be non-nil at the same time.
5947 -- If the argument is not present in metaArgs, we also check whether
5948 -- pairs has been run yet. If pairs has already been run, we return nil.
5949 -- This is because all the arguments will have already been copied into
5950 -- metaArgs by the mergeArgs function, meaning that any other arguments
5951 -- must be nil.
5952 --]]
5953 if type(key) == 'string' then
5954 key = options.translate[key]
5955 end
5956 local val = metaArgs[key]
5957 if val ~= nil then
5958 return val
5959 elseif metatable.donePairs or nilArgs[key] then
5960 return nil
5961 end
5962 for _, argTable in ipairs(argTables) do
5963 local argTableVal = tidyVal(key, argTable[key])
5964 if argTableVal ~= nil then
5965 metaArgs[key] = argTableVal
5966 return argTableVal
5967 end
5968 end
5969 nilArgs[key] = 'h'
5970 return nil
5971 end
5972
5973 metatable.__newindex = function (t, key, val)
5974 -- This function is called when a module tries to add a new value to the
5975 -- args table, or tries to change an existing value.
5976 if type(key) == 'string' then
5977 key = options.translate[key]
5978 end
5979 if options.readOnly then
5980 error(
5981 'could not write to argument table key "'
5982 .. tostring(key)
5983 .. '"; the table is read-only',
5984 2
5985 )
5986 elseif options.noOverwrite and args[key] ~= nil then
5987 error(
5988 'could not write to argument table key "'
5989 .. tostring(key)
5990 .. '"; overwriting existing arguments is not permitted',
5991 2
5992 )
5993 elseif val == nil then
5994 --[[
5995 -- If the argument is to be overwritten with nil, we need to erase
5996 -- the value in metaArgs, so that __index, __pairs and __ipairs do
5997 -- not use a previous existing value, if present; and we also need
5998 -- to memoize the nil in nilArgs, so that the value isn't looked
5999 -- up in the argument tables if it is accessed again.
6000 --]]
6001 metaArgs[key] = nil
6002 nilArgs[key] = 'h'
6003 else
6004 metaArgs[key] = val
6005 end
6006 end
6007
6008 local function translatenext(invariant)
6009 local k, v = next(invariant.t, invariant.k)
6010 invariant.k = k
6011 if k == nil then
6012 return nil
6013 elseif type(k) ~= 'string' or not options.backtranslate then
6014 return k, v
6015 else
6016 local backtranslate = options.backtranslate[k]
6017 if backtranslate == nil then
6018 -- Skip this one. This is a tail call, so this won't cause stack overflow
6019 return translatenext(invariant)
6020 else
6021 return backtranslate, v
6022 end
6023 end
6024 end
6025
6026 metatable.__pairs = function ()
6027 -- Called when pairs is run on the args table.
6028 if not metatable.donePairs then
6029 mergeArgs(argTables)
6030 metatable.donePairs = true
6031 end
6032 return translatenext, { t = metaArgs }
6033 end
6034
6035 local function inext(t, i)
6036 -- This uses our __index metamethod
6037 local v = t[i + 1]
6038 if v ~= nil then
6039 return i + 1, v
6040 end
6041 end
6042
6043 metatable.__ipairs = function (t)
6044 -- Called when ipairs is run on the args table.
6045 return inext, t, 0
6046 end
6047
6048 return args
6049end
6050
6051return arguments</text>
6052 <sha1>5qx9tzlul9ser30uxj9nbasjt92cevn</sha1>
6053 </revision>
6054 </page>
6055 <page>
6056 <title>Module:Check for unknown parameters</title>
6057 <ns>828</ns>
6058 <id>42286729</id>
6059 <revision>
6060 <id>726655795</id>
6061 <parentid>726655742</parentid>
6062 <timestamp>2016-06-23T14:41:43Z</timestamp>
6063 <contributor>
6064 <username>Frietjes</username>
6065 <id>13791031</id>
6066 </contributor>
6067 <model>Scribunto</model>
6068 <format>text/plain</format>
6069 <text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
6070-- with a list of arguments, returning a specified result if an argument is
6071-- not on the list
6072local p = {}
6073
6074local function trim(s)
6075 return s:match('^%s*(.-)%s*$')
6076end
6077
6078local function isnotempty(s)
6079 return s and trim(s) ~= ''
6080end
6081
6082function p.check (frame)
6083 local args = frame.args
6084 local pargs = frame:getParent().args
6085 local ignoreblank = isnotempty(frame.args['ignoreblank'])
6086 local showblankpos = isnotempty(frame.args['showblankpositional'])
6087 local knownargs = {}
6088 local unknown = frame.args['unknown'] or 'Found _VALUE_, '
6089 local preview = frame.args['preview']
6090
6091 local values = {}
6092 local res = {}
6093 local regexps = {}
6094
6095 -- create the list of known args, regular expressions, and the return string
6096 for k, v in pairs(args) do
6097 if type(k) == 'number' then
6098 v = trim(v)
6099 knownargs[v] = 1
6100 elseif k:find('^regexp[1-9][0-9]*$') then
6101 table.insert(regexps, '^' .. v .. '$')
6102 end
6103 end
6104 if isnotempty(preview) then
6105 preview = '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview).</div>'
6106 elseif preview == nil then
6107 preview = unknown
6108 end
6109
6110 -- loop over the parent args, and make sure they are on the list
6111 for k, v in pairs(pargs) do
6112 if type(k) == 'string' and knownargs[k] == nil then
6113 local knownflag = false
6114 for i, regexp in ipairs(regexps) do
6115 if mw.ustring.match(k, regexp) then
6116 knownflag = true
6117 break
6118 end
6119 end
6120 if not knownflag and ( not ignoreblank or isnotempty(v) ) then
6121 k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
6122 table.insert(values, k)
6123 end
6124 elseif type(k) == 'number' and
6125 knownargs[tostring(k)] == nil and
6126 ( showblankpos or isnotempty(v) )
6127 then
6128 local vlen = mw.ustring.len(v)
6129 v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)
6130 v = mw.ustring.gsub(v, '[^%w\-_ ]', '?')
6131 table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
6132 end
6133 end
6134
6135 -- add resuls to the output tables
6136 if #values > 0 then
6137 if frame:preprocess( "{{REVISIONID}}" ) == "" then
6138 unknown = preview
6139 end
6140 for k, v in pairs(values) do
6141 if v == '' then
6142 -- Fix odd bug for | = which gets stripped to the empty string and
6143 -- breaks category links
6144 v = ' '
6145 end
6146 local r = unknown:gsub('_VALUE_', v)
6147 table.insert(res, r)
6148 end
6149 end
6150
6151 return table.concat(res)
6152end
6153
6154return p</text>
6155 <sha1>hrayw1t1r2ij1wg65qi0jh0x6y31ba4</sha1>
6156 </revision>
6157 </page>
6158 <page>
6159 <title>Module:Documentation</title>
6160 <ns>828</ns>
6161 <id>40256557</id>
6162 <revision>
6163 <id>729280556</id>
6164 <parentid>725653683</parentid>
6165 <timestamp>2016-07-11T04:31:31Z</timestamp>
6166 <contributor>
6167 <username>Andy M. Wang</username>
6168 <id>516856</id>
6169 </contributor>
6170 <comment>rm alt text on icon, since the adjacent text, "Template documentation" or "Module documentation", is sufficient alternative text (per [[Special:Diff/729145419|edit request]])</comment>
6171 <model>Scribunto</model>
6172 <format>text/plain</format>
6173 <text xml:space="preserve" bytes="36685">-- This module implements {{documentation}}.
6174
6175-- Get required modules.
6176local getArgs = require('Module:Arguments').getArgs
6177local messageBox = require('Module:Message box')
6178
6179-- Get the config table.
6180local cfg = mw.loadData('Module:Documentation/config')
6181
6182local p = {}
6183
6184-- Often-used functions.
6185local ugsub = mw.ustring.gsub
6186
6187----------------------------------------------------------------------------
6188-- Helper functions
6189--
6190-- These are defined as local functions, but are made available in the p
6191-- table for testing purposes.
6192----------------------------------------------------------------------------
6193
6194local function message(cfgKey, valArray, expectType)
6195 --[[
6196 -- Gets a message from the cfg table and formats it if appropriate.
6197 -- The function raises an error if the value from the cfg table is not
6198 -- of the type expectType. The default type for expectType is 'string'.
6199 -- If the table valArray is present, strings such as $1, $2 etc. in the
6200 -- message are substituted with values from the table keys [1], [2] etc.
6201 -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
6202 -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
6203 --]]
6204 local msg = cfg[cfgKey]
6205 expectType = expectType or 'string'
6206 if type(msg) ~= expectType then
6207 error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
6208 end
6209 if not valArray then
6210 return msg
6211 end
6212
6213 local function getMessageVal(match)
6214 match = tonumber(match)
6215 return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
6216 end
6217
6218 local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
6219 return ret
6220end
6221
6222p.message = message
6223
6224local function makeWikilink(page, display)
6225 if display then
6226 return mw.ustring.format('[[%s|%s]]', page, display)
6227 else
6228 return mw.ustring.format('[[%s]]', page)
6229 end
6230end
6231
6232p.makeWikilink = makeWikilink
6233
6234local function makeCategoryLink(cat, sort)
6235 local catns = mw.site.namespaces[14].name
6236 return makeWikilink(catns .. ':' .. cat, sort)
6237end
6238
6239p.makeCategoryLink = makeCategoryLink
6240
6241local function makeUrlLink(url, display)
6242 return mw.ustring.format('[%s %s]', url, display)
6243end
6244
6245p.makeUrlLink = makeUrlLink
6246
6247local function makeToolbar(...)
6248 local ret = {}
6249 local lim = select('#', ...)
6250 if lim < 1 then
6251 return nil
6252 end
6253 for i = 1, lim do
6254 ret[#ret + 1] = select(i, ...)
6255 end
6256 return '<small style="font-style: normal;">(' .. table.concat(ret, ' &#124; ') .. ')</small>'
6257end
6258
6259p.makeToolbar = makeToolbar
6260
6261----------------------------------------------------------------------------
6262-- Argument processing
6263----------------------------------------------------------------------------
6264
6265local function makeInvokeFunc(funcName)
6266 return function (frame)
6267 local args = getArgs(frame, {
6268 valueFunc = function (key, value)
6269 if type(value) == 'string' then
6270 value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
6271 if key == 'heading' or value ~= '' then
6272 return value
6273 else
6274 return nil
6275 end
6276 else
6277 return value
6278 end
6279 end
6280 })
6281 return p[funcName](args)
6282 end
6283end
6284
6285----------------------------------------------------------------------------
6286-- Main function
6287----------------------------------------------------------------------------
6288
6289p.main = makeInvokeFunc('_main')
6290
6291function p._main(args)
6292 --[[
6293 -- This function defines logic flow for the module.
6294 -- @args - table of arguments passed by the user
6295 --
6296 -- Messages:
6297 -- 'main-div-id' --> 'template-documentation'
6298 -- 'main-div-classes' --> 'template-documentation iezoomfix'
6299 --]]
6300 local env = p.getEnvironment(args)
6301 local root = mw.html.create()
6302 root
6303 :wikitext(p.protectionTemplate(env))
6304 :wikitext(p.sandboxNotice(args, env))
6305 -- This div tag is from {{documentation/start box}}, but moving it here
6306 -- so that we don't have to worry about unclosed tags.
6307 :tag('div')
6308 :attr('id', message('main-div-id'))
6309 :addClass(message('main-div-classes'))
6310 :newline()
6311 :wikitext(p._startBox(args, env))
6312 :wikitext(p._content(args, env))
6313 :tag('div')
6314 :css('clear', 'both') -- So right or left floating items don't stick out of the doc box.
6315 :newline()
6316 :done()
6317 :done()
6318 :wikitext(p._endBox(args, env))
6319 :wikitext(p.addTrackingCategories(env))
6320 return tostring(root)
6321end
6322
6323----------------------------------------------------------------------------
6324-- Environment settings
6325----------------------------------------------------------------------------
6326
6327function p.getEnvironment(args)
6328 --[[
6329 -- Returns a table with information about the environment, including title objects and other namespace- or
6330 -- path-related data.
6331 -- @args - table of arguments passed by the user
6332 --
6333 -- Title objects include:
6334 -- env.title - the page we are making documentation for (usually the current title)
6335 -- env.templateTitle - the template (or module, file, etc.)
6336 -- env.docTitle - the /doc subpage.
6337 -- env.sandboxTitle - the /sandbox subpage.
6338 -- env.testcasesTitle - the /testcases subpage.
6339 -- env.printTitle - the print version of the template, located at the /Print subpage.
6340 --
6341 -- Data includes:
6342 -- env.protectionLevels - the protection levels table of the title object.
6343 -- env.subjectSpace - the number of the title's subject namespace.
6344 -- env.docSpace - the number of the namespace the title puts its documentation in.
6345 -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
6346 -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
6347 --
6348 -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
6349 -- returned will be nil.
6350 --]]
6351
6352 local env, envFuncs = {}, {}
6353
6354 -- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
6355 -- returned by that function is memoized in the env table so that we don't call any of the functions
6356 -- more than once. (Nils won't be memoized.)
6357 setmetatable(env, {
6358 __index = function (t, key)
6359 local envFunc = envFuncs[key]
6360 if envFunc then
6361 local success, val = pcall(envFunc)
6362 if success then
6363 env[key] = val -- Memoise the value.
6364 return val
6365 end
6366 end
6367 return nil
6368 end
6369 })
6370
6371 function envFuncs.title()
6372 -- The title object for the current page, or a test page passed with args.page.
6373 local title
6374 local titleArg = args.page
6375 if titleArg then
6376 title = mw.title.new(titleArg)
6377 else
6378 title = mw.title.getCurrentTitle()
6379 end
6380 return title
6381 end
6382
6383 function envFuncs.templateTitle()
6384 --[[
6385 -- The template (or module, etc.) title object.
6386 -- Messages:
6387 -- 'sandbox-subpage' --> 'sandbox'
6388 -- 'testcases-subpage' --> 'testcases'
6389 --]]
6390 local subjectSpace = env.subjectSpace
6391 local title = env.title
6392 local subpage = title.subpageText
6393 if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
6394 return mw.title.makeTitle(subjectSpace, title.baseText)
6395 else
6396 return mw.title.makeTitle(subjectSpace, title.text)
6397 end
6398 end
6399
6400 function envFuncs.docTitle()
6401 --[[
6402 -- Title object of the /doc subpage.
6403 -- Messages:
6404 -- 'doc-subpage' --> 'doc'
6405 --]]
6406 local title = env.title
6407 local docname = args[1] -- User-specified doc page.
6408 local docpage
6409 if docname then
6410 docpage = docname
6411 else
6412 docpage = env.docpageBase .. '/' .. message('doc-subpage')
6413 end
6414 return mw.title.new(docpage)
6415 end
6416
6417 function envFuncs.sandboxTitle()
6418 --[[
6419 -- Title object for the /sandbox subpage.
6420 -- Messages:
6421 -- 'sandbox-subpage' --> 'sandbox'
6422 --]]
6423 return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
6424 end
6425
6426 function envFuncs.testcasesTitle()
6427 --[[
6428 -- Title object for the /testcases subpage.
6429 -- Messages:
6430 -- 'testcases-subpage' --> 'testcases'
6431 --]]
6432 return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
6433 end
6434
6435 function envFuncs.printTitle()
6436 --[[
6437 -- Title object for the /Print subpage.
6438 -- Messages:
6439 -- 'print-subpage' --> 'Print'
6440 --]]
6441 return env.templateTitle:subPageTitle(message('print-subpage'))
6442 end
6443
6444 function envFuncs.protectionLevels()
6445 -- The protection levels table of the title object.
6446 return env.title.protectionLevels
6447 end
6448
6449 function envFuncs.subjectSpace()
6450 -- The subject namespace number.
6451 return mw.site.namespaces[env.title.namespace].subject.id
6452 end
6453
6454 function envFuncs.docSpace()
6455 -- The documentation namespace number. For most namespaces this is the same as the
6456 -- subject namespace. However, pages in the Article, File, MediaWiki or Category
6457 -- namespaces must have their /doc, /sandbox and /testcases pages in talk space.
6458 local subjectSpace = env.subjectSpace
6459 if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
6460 return subjectSpace + 1
6461 else
6462 return subjectSpace
6463 end
6464 end
6465
6466 function envFuncs.docpageBase()
6467 -- The base page of the /doc, /sandbox, and /testcases subpages.
6468 -- For some namespaces this is the talk page, rather than the template page.
6469 local templateTitle = env.templateTitle
6470 local docSpace = env.docSpace
6471 local docSpaceText = mw.site.namespaces[docSpace].name
6472 -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
6473 return docSpaceText .. ':' .. templateTitle.text
6474 end
6475
6476 function envFuncs.compareUrl()
6477 -- Diff link between the sandbox and the main template using [[Special:ComparePages]].
6478 local templateTitle = env.templateTitle
6479 local sandboxTitle = env.sandboxTitle
6480 if templateTitle.exists and sandboxTitle.exists then
6481 local compareUrl = mw.uri.fullUrl(
6482 'Special:ComparePages',
6483 {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
6484 )
6485 return tostring(compareUrl)
6486 else
6487 return nil
6488 end
6489 end
6490
6491 return env
6492end
6493
6494----------------------------------------------------------------------------
6495-- Auxiliary templates
6496----------------------------------------------------------------------------
6497
6498function p.sandboxNotice(args, env)
6499 --[=[
6500 -- Generates a sandbox notice for display above sandbox pages.
6501 -- @args - a table of arguments passed by the user
6502 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6503 --
6504 -- Messages:
6505 -- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
6506 -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
6507 -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
6508 -- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
6509 -- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
6510 -- 'sandbox-notice-pagetype-other' --> 'sandbox page'
6511 -- 'sandbox-notice-compare-link-display' --> 'diff'
6512 -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
6513 -- 'sandbox-notice-testcases-link-display' --> 'test cases'
6514 -- 'sandbox-category' --> 'Template sandboxes'
6515 --]=]
6516 local title = env.title
6517 local sandboxTitle = env.sandboxTitle
6518 local templateTitle = env.templateTitle
6519 local subjectSpace = env.subjectSpace
6520 if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then
6521 return nil
6522 end
6523 -- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
6524 local omargs = {}
6525 omargs.image = message('sandbox-notice-image')
6526 -- Get the text. We start with the opening blurb, which is something like
6527 -- "This is the template sandbox for [[Template:Foo]] (diff)."
6528 local text = ''
6529 local pagetype
6530 if subjectSpace == 10 then
6531 pagetype = message('sandbox-notice-pagetype-template')
6532 elseif subjectSpace == 828 then
6533 pagetype = message('sandbox-notice-pagetype-module')
6534 else
6535 pagetype = message('sandbox-notice-pagetype-other')
6536 end
6537 local templateLink = makeWikilink(templateTitle.prefixedText)
6538 local compareUrl = env.compareUrl
6539 if compareUrl then
6540 local compareDisplay = message('sandbox-notice-compare-link-display')
6541 local compareLink = makeUrlLink(compareUrl, compareDisplay)
6542 text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
6543 else
6544 text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
6545 end
6546 -- Get the test cases page blurb if the page exists. This is something like
6547 -- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
6548 local testcasesTitle = env.testcasesTitle
6549 if testcasesTitle and testcasesTitle.exists then
6550 if testcasesTitle.namespace == mw.site.namespaces.Module.id then
6551 local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
6552 local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
6553 local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
6554 local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
6555 text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
6556 else
6557 local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
6558 local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
6559 text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
6560 end
6561 end
6562 -- Add the sandbox to the sandbox category.
6563 text = text .. makeCategoryLink(message('sandbox-category'))
6564 omargs.text = text
6565 local ret = '<div style="clear: both;"></div>'
6566 ret = ret .. messageBox.main('ombox', omargs)
6567 return ret
6568end
6569
6570function p.protectionTemplate(env)
6571 -- Generates the padlock icon in the top right.
6572 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6573 -- Messages:
6574 -- 'protection-template' --> 'pp-template'
6575 -- 'protection-template-args' --> {docusage = 'yes'}
6576 local protectionLevels, mProtectionBanner
6577 local title = env.title
6578 protectionLevels = env.protectionLevels
6579 if not protectionLevels then
6580 return nil
6581 end
6582 local editProt = protectionLevels.edit and protectionLevels.edit[1]
6583 local moveProt = protectionLevels.move and protectionLevels.move[1]
6584 if editProt then
6585 -- The page is edit-protected.
6586 mProtectionBanner = require('Module:Protection banner')
6587 local reason = message('protection-reason-edit')
6588 return mProtectionBanner._main{reason, small = true}
6589 elseif moveProt and moveProt ~= 'autoconfirmed' then
6590 -- The page is move-protected but not edit-protected. Exclude move
6591 -- protection with the level "autoconfirmed", as this is equivalent to
6592 -- no move protection at all.
6593 mProtectionBanner = require('Module:Protection banner')
6594 return mProtectionBanner._main{action = 'move', small = true}
6595 else
6596 return nil
6597 end
6598end
6599
6600----------------------------------------------------------------------------
6601-- Start box
6602----------------------------------------------------------------------------
6603
6604p.startBox = makeInvokeFunc('_startBox')
6605
6606function p._startBox(args, env)
6607 --[[
6608 -- This function generates the start box.
6609 -- @args - a table of arguments passed by the user
6610 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6611 --
6612 -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
6613 -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
6614 -- which generate the box HTML.
6615 --]]
6616 env = env or p.getEnvironment(args)
6617 local links
6618 local content = args.content
6619 if not content then
6620 -- No need to include the links if the documentation is on the template page itself.
6621 local linksData = p.makeStartBoxLinksData(args, env)
6622 if linksData then
6623 links = p.renderStartBoxLinks(linksData)
6624 end
6625 end
6626 -- Generate the start box html.
6627 local data = p.makeStartBoxData(args, env, links)
6628 if data then
6629 return p.renderStartBox(data)
6630 else
6631 -- User specified no heading.
6632 return nil
6633 end
6634end
6635
6636function p.makeStartBoxLinksData(args, env)
6637 --[[
6638 -- Does initial processing of data to make the [view] [edit] [history] [purge] links.
6639 -- @args - a table of arguments passed by the user
6640 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6641 --
6642 -- Messages:
6643 -- 'view-link-display' --> 'view'
6644 -- 'edit-link-display' --> 'edit'
6645 -- 'history-link-display' --> 'history'
6646 -- 'purge-link-display' --> 'purge'
6647 -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
6648 -- 'module-preload' --> 'Template:Documentation/preload-module-doc'
6649 -- 'docpage-preload' --> 'Template:Documentation/preload'
6650 -- 'create-link-display' --> 'create'
6651 --]]
6652 local subjectSpace = env.subjectSpace
6653 local title = env.title
6654 local docTitle = env.docTitle
6655 if not title or not docTitle then
6656 return nil
6657 end
6658
6659 local data = {}
6660 data.title = title
6661 data.docTitle = docTitle
6662 -- View, display, edit, and purge links if /doc exists.
6663 data.viewLinkDisplay = message('view-link-display')
6664 data.editLinkDisplay = message('edit-link-display')
6665 data.historyLinkDisplay = message('history-link-display')
6666 data.purgeLinkDisplay = message('purge-link-display')
6667 -- Create link if /doc doesn't exist.
6668 local preload = args.preload
6669 if not preload then
6670 if subjectSpace == 6 then -- File namespace
6671 preload = message('file-docpage-preload')
6672 elseif subjectSpace == 828 then -- Module namespace
6673 preload = message('module-preload')
6674 else
6675 preload = message('docpage-preload')
6676 end
6677 end
6678 data.preload = preload
6679 data.createLinkDisplay = message('create-link-display')
6680 return data
6681end
6682
6683function p.renderStartBoxLinks(data)
6684 --[[
6685 -- Generates the [view][edit][history][purge] or [create] links from the data table.
6686 -- @data - a table of data generated by p.makeStartBoxLinksData
6687 --]]
6688
6689 local function escapeBrackets(s)
6690 -- Escapes square brackets with HTML entities.
6691 s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities.
6692 s = s:gsub('%]', '&#93;')
6693 return s
6694 end
6695
6696 local ret
6697 local docTitle = data.docTitle
6698 local title = data.title
6699 if docTitle.exists then
6700 local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
6701 local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
6702 local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
6703 local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
6704 ret = '[%s] [%s] [%s] [%s]'
6705 ret = escapeBrackets(ret)
6706 ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
6707 else
6708 local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
6709 ret = '[%s]'
6710 ret = escapeBrackets(ret)
6711 ret = mw.ustring.format(ret, createLink)
6712 end
6713 return ret
6714end
6715
6716function p.makeStartBoxData(args, env, links)
6717 --[=[
6718 -- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
6719 -- @args - a table of arguments passed by the user
6720 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6721 -- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
6722 --
6723 -- Messages:
6724 -- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
6725 -- 'template-namespace-heading' --> 'Template documentation'
6726 -- 'module-namespace-heading' --> 'Module documentation'
6727 -- 'file-namespace-heading' --> 'Summary'
6728 -- 'other-namespaces-heading' --> 'Documentation'
6729 -- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks'
6730 -- 'start-box-link-id' --> 'doc_editlinks'
6731 -- 'testcases-create-link-display' --> 'create'
6732 --]=]
6733 local subjectSpace = env.subjectSpace
6734 if not subjectSpace then
6735 -- Default to an "other namespaces" namespace, so that we get at least some output
6736 -- if an error occurs.
6737 subjectSpace = 2
6738 end
6739 local data = {}
6740
6741 -- Heading
6742 local heading = args.heading -- Blank values are not removed.
6743 if heading == '' then
6744 -- Don't display the start box if the heading arg is defined but blank.
6745 return nil
6746 end
6747 if heading then
6748 data.heading = heading
6749 elseif subjectSpace == 10 then -- Template namespace
6750 data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
6751 elseif subjectSpace == 828 then -- Module namespace
6752 data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
6753 elseif subjectSpace == 6 then -- File namespace
6754 data.heading = message('file-namespace-heading')
6755 else
6756 data.heading = message('other-namespaces-heading')
6757 end
6758
6759 -- Heading CSS
6760 local headingStyle = args['heading-style']
6761 if headingStyle then
6762 data.headingStyleText = headingStyle
6763 elseif subjectSpace == 10 then
6764 -- We are in the template or template talk namespaces.
6765 data.headingFontWeight = 'bold'
6766 data.headingFontSize = '125%'
6767 else
6768 data.headingFontSize = '150%'
6769 end
6770
6771 -- Data for the [view][edit][history][purge] or [create] links.
6772 if links then
6773 data.linksClass = message('start-box-linkclasses')
6774 data.linksId = message('start-box-link-id')
6775 data.links = links
6776 end
6777
6778 return data
6779end
6780
6781function p.renderStartBox(data)
6782 -- Renders the start box html.
6783 -- @data - a table of data generated by p.makeStartBoxData.
6784 local sbox = mw.html.create('div')
6785 sbox
6786 :css('padding-bottom', '3px')
6787 :css('border-bottom', '1px solid #aaa')
6788 :css('margin-bottom', '1ex')
6789 :newline()
6790 :tag('span')
6791 :cssText(data.headingStyleText)
6792 :css('font-weight', data.headingFontWeight)
6793 :css('font-size', data.headingFontSize)
6794 :wikitext(data.heading)
6795 local links = data.links
6796 if links then
6797 sbox:tag('span')
6798 :addClass(data.linksClass)
6799 :attr('id', data.linksId)
6800 :wikitext(links)
6801 end
6802 return tostring(sbox)
6803end
6804
6805----------------------------------------------------------------------------
6806-- Documentation content
6807----------------------------------------------------------------------------
6808
6809p.content = makeInvokeFunc('_content')
6810
6811function p._content(args, env)
6812 -- Displays the documentation contents
6813 -- @args - a table of arguments passed by the user
6814 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6815 env = env or p.getEnvironment(args)
6816 local docTitle = env.docTitle
6817 local content = args.content
6818 if not content and docTitle and docTitle.exists then
6819 content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
6820 end
6821 -- The line breaks below are necessary so that "=== Headings ===" at the start and end
6822 -- of docs are interpreted correctly.
6823 return '\n' .. (content or '') .. '\n'
6824end
6825
6826p.contentTitle = makeInvokeFunc('_contentTitle')
6827
6828function p._contentTitle(args, env)
6829 env = env or p.getEnvironment(args)
6830 local docTitle = env.docTitle
6831 if not args.content and docTitle and docTitle.exists then
6832 return docTitle.prefixedText
6833 else
6834 return ''
6835 end
6836end
6837
6838----------------------------------------------------------------------------
6839-- End box
6840----------------------------------------------------------------------------
6841
6842p.endBox = makeInvokeFunc('_endBox')
6843
6844function p._endBox(args, env)
6845 --[=[
6846 -- This function generates the end box (also known as the link box).
6847 -- @args - a table of arguments passed by the user
6848 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6849 --
6850 -- Messages:
6851 -- 'fmbox-id' --> 'documentation-meta-data'
6852 -- 'fmbox-style' --> 'background-color: #ecfcf4'
6853 -- 'fmbox-textstyle' --> 'font-style: italic'
6854 --
6855 -- The HTML is generated by the {{fmbox}} template, courtesy of [[Module:Message box]].
6856 --]=]
6857
6858 -- Get environment data.
6859 env = env or p.getEnvironment(args)
6860 local subjectSpace = env.subjectSpace
6861 local docTitle = env.docTitle
6862 if not subjectSpace or not docTitle then
6863 return nil
6864 end
6865
6866 -- Check whether we should output the end box at all. Add the end
6867 -- box by default if the documentation exists or if we are in the
6868 -- user, module or template namespaces.
6869 local linkBox = args['link box']
6870 if linkBox == 'off'
6871 or not (
6872 docTitle.exists
6873 or subjectSpace == 2
6874 or subjectSpace == 828
6875 or subjectSpace == 10
6876 )
6877 then
6878 return nil
6879 end
6880
6881 -- Assemble the arguments for {{fmbox}}.
6882 local fmargs = {}
6883 fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data'
6884 fmargs.image = 'none'
6885 fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4'
6886 fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;'
6887
6888 -- Assemble the fmbox text field.
6889 local text = ''
6890 if linkBox then
6891 text = text .. linkBox
6892 else
6893 text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
6894 if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
6895 -- We are in the user, template or module namespaces.
6896 -- Add sandbox and testcases links.
6897 -- "Editors can experiment in this template's sandbox and testcases pages."
6898 text = text .. (p.makeExperimentBlurb(args, env) or '')
6899 text = text .. '<br />'
6900 if not args.content and not args[1] then
6901 -- "Please add categories to the /doc subpage."
6902 -- Don't show this message with inline docs or with an explicitly specified doc page,
6903 -- as then it is unclear where to add the categories.
6904 text = text .. (p.makeCategoriesBlurb(args, env) or '')
6905 end
6906 text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
6907 local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
6908 if printBlurb then
6909 text = text .. '<br />' .. printBlurb
6910 end
6911 end
6912 end
6913 fmargs.text = text
6914
6915 return messageBox.main('fmbox', fmargs)
6916end
6917
6918function p.makeDocPageBlurb(args, env)
6919 --[=[
6920 -- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
6921 -- @args - a table of arguments passed by the user
6922 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6923 --
6924 -- Messages:
6925 -- 'edit-link-display' --> 'edit'
6926 -- 'history-link-display' --> 'history'
6927 -- 'transcluded-from-blurb' -->
6928 -- 'The above [[Wikipedia:Template documentation|documentation]]
6929 -- is [[Wikipedia:Transclusion|transcluded]] from $1.'
6930 -- 'module-preload' --> 'Template:Documentation/preload-module-doc'
6931 -- 'create-link-display' --> 'create'
6932 -- 'create-module-doc-blurb' -->
6933 -- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
6934 --]=]
6935 local docTitle = env.docTitle
6936 if not docTitle then
6937 return nil
6938 end
6939 local ret
6940 if docTitle.exists then
6941 -- /doc exists; link to it.
6942 local docLink = makeWikilink(docTitle.prefixedText)
6943 local editUrl = docTitle:fullUrl{action = 'edit'}
6944 local editDisplay = message('edit-link-display')
6945 local editLink = makeUrlLink(editUrl, editDisplay)
6946 local historyUrl = docTitle:fullUrl{action = 'history'}
6947 local historyDisplay = message('history-link-display')
6948 local historyLink = makeUrlLink(historyUrl, historyDisplay)
6949 ret = message('transcluded-from-blurb', {docLink})
6950 .. ' '
6951 .. makeToolbar(editLink, historyLink)
6952 .. '<br />'
6953 elseif env.subjectSpace == 828 then
6954 -- /doc does not exist; ask to create it.
6955 local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
6956 local createDisplay = message('create-link-display')
6957 local createLink = makeUrlLink(createUrl, createDisplay)
6958 ret = message('create-module-doc-blurb', {createLink})
6959 .. '<br />'
6960 end
6961 return ret
6962end
6963
6964function p.makeExperimentBlurb(args, env)
6965 --[[
6966 -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
6967 -- @args - a table of arguments passed by the user
6968 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
6969 --
6970 -- Messages:
6971 -- 'sandbox-link-display' --> 'sandbox'
6972 -- 'sandbox-edit-link-display' --> 'edit'
6973 -- 'compare-link-display' --> 'diff'
6974 -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
6975 -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
6976 -- 'sandbox-create-link-display' --> 'create'
6977 -- 'mirror-edit-summary' --> 'Create sandbox version of $1'
6978 -- 'mirror-link-display' --> 'mirror'
6979 -- 'mirror-link-preload' --> 'Template:Documentation/mirror'
6980 -- 'sandbox-link-display' --> 'sandbox'
6981 -- 'testcases-link-display' --> 'testcases'
6982 -- 'testcases-edit-link-display'--> 'edit'
6983 -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
6984 -- 'testcases-create-link-display' --> 'create'
6985 -- 'testcases-link-display' --> 'testcases'
6986 -- 'testcases-edit-link-display' --> 'edit'
6987 -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
6988 -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
6989 -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
6990 -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
6991 --]]
6992 local subjectSpace = env.subjectSpace
6993 local templateTitle = env.templateTitle
6994 local sandboxTitle = env.sandboxTitle
6995 local testcasesTitle = env.testcasesTitle
6996 local templatePage = templateTitle.prefixedText
6997 if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
6998 return nil
6999 end
7000 -- Make links.
7001 local sandboxLinks, testcasesLinks
7002 if sandboxTitle.exists then
7003 local sandboxPage = sandboxTitle.prefixedText
7004 local sandboxDisplay = message('sandbox-link-display')
7005 local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
7006 local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
7007 local sandboxEditDisplay = message('sandbox-edit-link-display')
7008 local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
7009 local compareUrl = env.compareUrl
7010 local compareLink
7011 if compareUrl then
7012 local compareDisplay = message('compare-link-display')
7013 compareLink = makeUrlLink(compareUrl, compareDisplay)
7014 end
7015 sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
7016 else
7017 local sandboxPreload
7018 if subjectSpace == 828 then
7019 sandboxPreload = message('module-sandbox-preload')
7020 else
7021 sandboxPreload = message('template-sandbox-preload')
7022 end
7023 local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
7024 local sandboxCreateDisplay = message('sandbox-create-link-display')
7025 local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
7026 local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
7027 local mirrorPreload = message('mirror-link-preload')
7028 local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
7029 if subjectSpace == 828 then
7030 mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
7031 end
7032 local mirrorDisplay = message('mirror-link-display')
7033 local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
7034 sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
7035 end
7036 if testcasesTitle.exists then
7037 local testcasesPage = testcasesTitle.prefixedText
7038 local testcasesDisplay = message('testcases-link-display')
7039 local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
7040 local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
7041 local testcasesEditDisplay = message('testcases-edit-link-display')
7042 local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
7043 -- for Modules, add testcases run link if exists
7044 if subjectSpace == 828 and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
7045 local testcasesRunLinkDisplay = message('testcases-run-link-display')
7046 local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
7047 testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
7048 else
7049 testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
7050 end
7051 else
7052 local testcasesPreload
7053 if subjectSpace == 828 then
7054 testcasesPreload = message('module-testcases-preload')
7055 else
7056 testcasesPreload = message('template-testcases-preload')
7057 end
7058 local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
7059 local testcasesCreateDisplay = message('testcases-create-link-display')
7060 local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
7061 testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
7062 end
7063 local messageName
7064 if subjectSpace == 828 then
7065 messageName = 'experiment-blurb-module'
7066 else
7067 messageName = 'experiment-blurb-template'
7068 end
7069 return message(messageName, {sandboxLinks, testcasesLinks})
7070end
7071
7072function p.makeCategoriesBlurb(args, env)
7073 --[[
7074 -- Generates the text "Please add categories to the /doc subpage."
7075 -- @args - a table of arguments passed by the user
7076 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
7077 -- Messages:
7078 -- 'doc-link-display' --> '/doc'
7079 -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
7080 --]]
7081 local docTitle = env.docTitle
7082 if not docTitle then
7083 return nil
7084 end
7085 local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
7086 return message('add-categories-blurb', {docPathLink})
7087end
7088
7089function p.makeSubpagesBlurb(args, env)
7090 --[[
7091 -- Generates the "Subpages of this template" link.
7092 -- @args - a table of arguments passed by the user
7093 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
7094
7095 -- Messages:
7096 -- 'template-pagetype' --> 'template'
7097 -- 'module-pagetype' --> 'module'
7098 -- 'default-pagetype' --> 'page'
7099 -- 'subpages-link-display' --> 'Subpages of this $1'
7100 --]]
7101 local subjectSpace = env.subjectSpace
7102 local templateTitle = env.templateTitle
7103 if not subjectSpace or not templateTitle then
7104 return nil
7105 end
7106 local pagetype
7107 if subjectSpace == 10 then
7108 pagetype = message('template-pagetype')
7109 elseif subjectSpace == 828 then
7110 pagetype = message('module-pagetype')
7111 else
7112 pagetype = message('default-pagetype')
7113 end
7114 local subpagesLink = makeWikilink(
7115 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
7116 message('subpages-link-display', {pagetype})
7117 )
7118 return message('subpages-blurb', {subpagesLink})
7119end
7120
7121function p.makePrintBlurb(args, env)
7122 --[=[
7123 -- Generates the blurb displayed when there is a print version of the template available.
7124 -- @args - a table of arguments passed by the user
7125 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
7126 --
7127 -- Messages:
7128 -- 'print-link-display' --> '/Print'
7129 -- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]'
7130 -- .. ' of this template exists at $1.'
7131 -- .. ' If you make a change to this template, please update the print version as well.'
7132 -- 'display-print-category' --> true
7133 -- 'print-category' --> 'Templates with print versions'
7134 --]=]
7135 local printTitle = env.printTitle
7136 if not printTitle then
7137 return nil
7138 end
7139 local ret
7140 if printTitle.exists then
7141 local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))
7142 ret = message('print-blurb', {printLink})
7143 local displayPrintCategory = message('display-print-category', nil, 'boolean')
7144 if displayPrintCategory then
7145 ret = ret .. makeCategoryLink(message('print-category'))
7146 end
7147 end
7148 return ret
7149end
7150
7151----------------------------------------------------------------------------
7152-- Tracking categories
7153----------------------------------------------------------------------------
7154
7155function p.addTrackingCategories(env)
7156 --[[
7157 -- Check if {{documentation}} is transcluded on a /doc or /testcases page.
7158 -- @env - environment table containing title objects, etc., generated with p.getEnvironment
7159
7160 -- Messages:
7161 -- 'display-strange-usage-category' --> true
7162 -- 'doc-subpage' --> 'doc'
7163 -- 'testcases-subpage' --> 'testcases'
7164 -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
7165 --
7166 -- /testcases pages in the module namespace are not categorised, as they may have
7167 -- {{documentation}} transcluded automatically.
7168 --]]
7169 local title = env.title
7170 local subjectSpace = env.subjectSpace
7171 if not title or not subjectSpace then
7172 return nil
7173 end
7174 local subpage = title.subpageText
7175 local ret = ''
7176 if message('display-strange-usage-category', nil, 'boolean')
7177 and (
7178 subpage == message('doc-subpage')
7179 or subjectSpace ~= 828 and subpage == message('testcases-subpage')
7180 )
7181 then
7182 ret = ret .. makeCategoryLink(message('strange-usage-category'))
7183 end
7184 return ret
7185end
7186
7187return p</text>
7188 <sha1>jf2f51u5rzim7qgb93sv92cvfe6ak0s</sha1>
7189 </revision>
7190 </page>
7191 <page>
7192 <title>Module:Documentation/config</title>
7193 <ns>828</ns>
7194 <id>41520829</id>
7195 <revision>
7196 <id>729280654</id>
7197 <parentid>717457729</parentid>
7198 <timestamp>2016-07-11T04:32:48Z</timestamp>
7199 <contributor>
7200 <username>Andy M. Wang</username>
7201 <id>516856</id>
7202 </contributor>
7203 <comment>rm alt text on icon, since the adjacent text is sufficient alternative text (per [[Special:Diff/729145419|edit request]])</comment>
7204 <model>Scribunto</model>
7205 <format>text/plain</format>
7206 <text xml:space="preserve" bytes="18622">----------------------------------------------------------------------------------------------------
7207--
7208-- Configuration for Module:Documentation
7209--
7210-- Here you can set the values of the parameters and messages used in Module:Documentation to
7211-- localise it to your wiki and your language. Unless specified otherwise, values given here
7212-- should be string values.
7213----------------------------------------------------------------------------------------------------
7214
7215local cfg = {} -- Do not edit this line.
7216
7217----------------------------------------------------------------------------------------------------
7218-- Protection template configuration
7219----------------------------------------------------------------------------------------------------
7220
7221-- cfg['protection-reason-edit']
7222-- The protection reason for edit-protected templates to pass to
7223-- [[Module:Protection banner]].
7224cfg['protection-reason-edit'] = 'template'
7225
7226--[[
7227----------------------------------------------------------------------------------------------------
7228-- Sandbox notice configuration
7229--
7230-- On sandbox pages the module can display a template notifying users that the current page is a
7231-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
7232-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
7233-- messages that the notices contains.
7234----------------------------------------------------------------------------------------------------
7235--]]
7236
7237-- cfg['sandbox-notice-image']
7238-- The image displayed in the sandbox notice.
7239cfg['sandbox-notice-image'] = '[[Image:Sandbox.svg|50px|alt=|link=]]'
7240
7241--[[
7242-- cfg['sandbox-notice-pagetype-template']
7243-- cfg['sandbox-notice-pagetype-module']
7244-- cfg['sandbox-notice-pagetype-other']
7245-- The page type of the sandbox page. The message that is displayed depends on the current subject
7246-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
7247-- cfg['sandbox-notice-diff-blurb'].
7248--]]
7249cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
7250cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
7251cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
7252
7253--[[
7254-- cfg['sandbox-notice-blurb']
7255-- cfg['sandbox-notice-diff-blurb']
7256-- cfg['sandbox-notice-diff-display']
7257-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
7258-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
7259-- type, which is either cfg['sandbox-notice-pagetype-template'],
7260-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
7261-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
7262-- the sandbox and the main template. The display value of the diff link is set by
7263-- cfg['sandbox-notice-compare-link-display'].
7264--]]
7265cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
7266cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
7267cfg['sandbox-notice-compare-link-display'] = 'diff'
7268
7269--[[
7270-- cfg['sandbox-notice-testcases-blurb']
7271-- cfg['sandbox-notice-testcases-link-display']
7272-- cfg['sandbox-notice-testcases-run-blurb']
7273-- cfg['sandbox-notice-testcases-run-link-display']
7274-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
7275-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
7276-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
7277-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
7278-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
7279-- cases page, and $2 is a link to the page to run it.
7280-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
7281-- cases.
7282--]]
7283cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
7284cfg['sandbox-notice-testcases-link-display'] = 'test cases'
7285cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
7286cfg['sandbox-notice-testcases-run-link-display'] = 'run'
7287
7288-- cfg['sandbox-category']
7289-- A category to add to all template sandboxes.
7290cfg['sandbox-category'] = 'Template sandboxes'
7291
7292----------------------------------------------------------------------------------------------------
7293-- Start box configuration
7294----------------------------------------------------------------------------------------------------
7295
7296-- cfg['documentation-icon-wikitext']
7297-- The wikitext for the icon shown at the top of the template.
7298cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
7299
7300-- cfg['template-namespace-heading']
7301-- The heading shown in the template namespace.
7302cfg['template-namespace-heading'] = 'Template documentation'
7303
7304-- cfg['module-namespace-heading']
7305-- The heading shown in the module namespace.
7306cfg['module-namespace-heading'] = 'Module documentation'
7307
7308-- cfg['file-namespace-heading']
7309-- The heading shown in the file namespace.
7310cfg['file-namespace-heading'] = 'Summary'
7311
7312-- cfg['other-namespaces-heading']
7313-- The heading shown in other namespaces.
7314cfg['other-namespaces-heading'] = 'Documentation'
7315
7316-- cfg['view-link-display']
7317-- The text to display for "view" links.
7318cfg['view-link-display'] = 'view'
7319
7320-- cfg['edit-link-display']
7321-- The text to display for "edit" links.
7322cfg['edit-link-display'] = 'edit'
7323
7324-- cfg['history-link-display']
7325-- The text to display for "history" links.
7326cfg['history-link-display'] = 'history'
7327
7328-- cfg['purge-link-display']
7329-- The text to display for "purge" links.
7330cfg['purge-link-display'] = 'purge'
7331
7332-- cfg['create-link-display']
7333-- The text to display for "create" links.
7334cfg['create-link-display'] = 'create'
7335
7336----------------------------------------------------------------------------------------------------
7337-- Link box (end box) configuration
7338----------------------------------------------------------------------------------------------------
7339
7340-- cfg['transcluded-from-blurb']
7341-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
7342cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
7343
7344--[[
7345-- cfg['create-module-doc-blurb']
7346-- Notice displayed in the module namespace when the documentation subpage does not exist.
7347-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
7348-- display cfg['create-link-display'].
7349--]]
7350cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
7351
7352----------------------------------------------------------------------------------------------------
7353-- Experiment blurb configuration
7354----------------------------------------------------------------------------------------------------
7355
7356--[[
7357-- cfg['experiment-blurb-template']
7358-- cfg['experiment-blurb-module']
7359-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
7360-- It is only shown in the template and module namespaces. With the default English settings, it
7361-- might look like this:
7362--
7363-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
7364--
7365-- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
7366--
7367-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
7368-- on what namespace we are in.
7369--
7370-- Parameters:
7371--
7372-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
7373--
7374-- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
7375--
7376-- If the sandbox doesn't exist, it is in the format:
7377--
7378-- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
7379--
7380-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
7381-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
7382-- loads a default edit summary of cfg['mirror-edit-summary'].
7383--
7384-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
7385--
7386-- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
7387--
7388-- If the test cases page doesn't exist, it is in the format:
7389--
7390-- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
7391--
7392-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
7393-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
7394-- namespace.
7395--]]
7396cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
7397cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
7398
7399----------------------------------------------------------------------------------------------------
7400-- Sandbox link configuration
7401----------------------------------------------------------------------------------------------------
7402
7403-- cfg['sandbox-subpage']
7404-- The name of the template subpage typically used for sandboxes.
7405cfg['sandbox-subpage'] = 'sandbox'
7406
7407-- cfg['template-sandbox-preload']
7408-- Preload file for template sandbox pages.
7409cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
7410
7411-- cfg['module-sandbox-preload']
7412-- Preload file for Lua module sandbox pages.
7413cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
7414
7415-- cfg['sandbox-link-display']
7416-- The text to display for "sandbox" links.
7417cfg['sandbox-link-display'] = 'sandbox'
7418
7419-- cfg['sandbox-edit-link-display']
7420-- The text to display for sandbox "edit" links.
7421cfg['sandbox-edit-link-display'] = 'edit'
7422
7423-- cfg['sandbox-create-link-display']
7424-- The text to display for sandbox "create" links.
7425cfg['sandbox-create-link-display'] = 'create'
7426
7427-- cfg['compare-link-display']
7428-- The text to display for "compare" links.
7429cfg['compare-link-display'] = 'diff'
7430
7431-- cfg['mirror-edit-summary']
7432-- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
7433-- template page.
7434cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
7435
7436-- cfg['mirror-link-display']
7437-- The text to display for "mirror" links.
7438cfg['mirror-link-display'] = 'mirror'
7439
7440-- cfg['mirror-link-preload']
7441-- The page to preload when a user clicks the "mirror" link.
7442cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
7443
7444----------------------------------------------------------------------------------------------------
7445-- Test cases link configuration
7446----------------------------------------------------------------------------------------------------
7447
7448-- cfg['testcases-subpage']
7449-- The name of the template subpage typically used for test cases.
7450cfg['testcases-subpage'] = 'testcases'
7451
7452-- cfg['template-testcases-preload']
7453-- Preload file for template test cases pages.
7454cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
7455
7456-- cfg['module-testcases-preload']
7457-- Preload file for Lua module test cases pages.
7458cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
7459
7460-- cfg['testcases-link-display']
7461-- The text to display for "testcases" links.
7462cfg['testcases-link-display'] = 'testcases'
7463
7464-- cfg['testcases-edit-link-display']
7465-- The text to display for test cases "edit" links.
7466cfg['testcases-edit-link-display'] = 'edit'
7467
7468-- cfg['testcases-run-link-display']
7469-- The text to display for test cases "run" links.
7470cfg['testcases-run-link-display'] = 'run'
7471
7472-- cfg['testcases-create-link-display']
7473-- The text to display for test cases "create" links.
7474cfg['testcases-create-link-display'] = 'create'
7475
7476----------------------------------------------------------------------------------------------------
7477-- Add categories blurb configuration
7478----------------------------------------------------------------------------------------------------
7479
7480--[[
7481-- cfg['add-categories-blurb']
7482-- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
7483-- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
7484-- link to the /doc subpage with a display value of cfg['doc-link-display'].
7485--]]
7486cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'
7487
7488-- cfg['doc-link-display']
7489-- The text to display when linking to the /doc subpage.
7490cfg['doc-link-display'] = '/doc'
7491
7492----------------------------------------------------------------------------------------------------
7493-- Subpages link configuration
7494----------------------------------------------------------------------------------------------------
7495
7496--[[
7497-- cfg['subpages-blurb']
7498-- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
7499-- display value of cfg['subpages-link-display']. In the English version this blurb is simply
7500-- the link followed by a period, and the link display provides the actual text.
7501--]]
7502cfg['subpages-blurb'] = '$1.'
7503
7504--[[
7505-- cfg['subpages-link-display']
7506-- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
7507-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
7508-- the template namespace, the module namespace, or another namespace.
7509--]]
7510cfg['subpages-link-display'] = 'Subpages of this $1'
7511
7512-- cfg['template-pagetype']
7513-- The pagetype to display for template pages.
7514cfg['template-pagetype'] = 'template'
7515
7516-- cfg['module-pagetype']
7517-- The pagetype to display for Lua module pages.
7518cfg['module-pagetype'] = 'module'
7519
7520-- cfg['default-pagetype']
7521-- The pagetype to display for pages other than templates or Lua modules.
7522cfg['default-pagetype'] = 'page'
7523
7524----------------------------------------------------------------------------------------------------
7525-- Doc link configuration
7526----------------------------------------------------------------------------------------------------
7527
7528-- cfg['doc-subpage']
7529-- The name of the subpage typically used for documentation pages.
7530cfg['doc-subpage'] = 'doc'
7531
7532-- cfg['file-docpage-preload']
7533-- Preload file for documentation page in the file namespace.
7534cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
7535
7536-- cfg['docpage-preload']
7537-- Preload file for template documentation pages in all namespaces.
7538cfg['docpage-preload'] = 'Template:Documentation/preload'
7539
7540-- cfg['module-preload']
7541-- Preload file for Lua module documentation pages.
7542cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
7543
7544----------------------------------------------------------------------------------------------------
7545-- Print version configuration
7546----------------------------------------------------------------------------------------------------
7547
7548-- cfg['print-subpage']
7549-- The name of the template subpage used for print versions.
7550cfg['print-subpage'] = 'Print'
7551
7552-- cfg['print-link-display']
7553-- The text to display when linking to the /Print subpage.
7554cfg['print-link-display'] = '/Print'
7555
7556-- cfg['print-blurb']
7557-- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display'].
7558cfg['print-blurb'] = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1.'
7559 .. ' If you make a change to this template, please update the print version as well.'
7560
7561-- cfg['display-print-category']
7562-- Set to true to enable output of cfg['print-category'] if a /Print subpage exists.
7563-- This should be a boolean value (either true or false).
7564cfg['display-print-category'] = true
7565
7566-- cfg['print-category']
7567-- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists.
7568cfg['print-category'] = 'Templates with print versions'
7569
7570----------------------------------------------------------------------------------------------------
7571-- HTML and CSS configuration
7572----------------------------------------------------------------------------------------------------
7573
7574-- cfg['main-div-id']
7575-- The "id" attribute of the main HTML "div" tag.
7576cfg['main-div-id'] = 'template-documentation'
7577
7578-- cfg['main-div-classes']
7579-- The CSS classes added to the main HTML "div" tag.
7580cfg['main-div-classes'] = 'template-documentation iezoomfix'
7581
7582-- cfg['start-box-linkclasses']
7583-- The CSS classes used for the [view][edit][history] or [create] links in the start box.
7584cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks'
7585
7586-- cfg['start-box-link-id']
7587-- The HTML "id" attribute for the links in the start box.
7588cfg['start-box-link-id'] = 'doc_editlinks'
7589
7590----------------------------------------------------------------------------------------------------
7591-- {{fmbox}} template configuration
7592----------------------------------------------------------------------------------------------------
7593
7594-- cfg['fmbox-id']
7595-- The id sent to the "id" parameter of the {{fmbox}} template.
7596cfg['fmbox-id'] = 'documentation-meta-data'
7597
7598-- cfg['fmbox-style']
7599-- The value sent to the style parameter of {{fmbox}}.
7600cfg['fmbox-style'] = 'background-color: #ecfcf4'
7601
7602-- cfg['fmbox-textstyle']
7603-- The value sent to the "textstyle parameter of {{fmbox}}.
7604cfg['fmbox-textstyle'] = 'font-style: italic'
7605
7606----------------------------------------------------------------------------------------------------
7607-- Tracking category configuration
7608----------------------------------------------------------------------------------------------------
7609
7610-- cfg['display-strange-usage-category']
7611-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
7612-- or a /testcases subpage. This should be a boolean value (either true or false).
7613cfg['display-strange-usage-category'] = true
7614
7615-- cfg['strange-usage-category']
7616-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
7617-- /doc subpage or a /testcases subpage.
7618cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
7619
7620--[[
7621----------------------------------------------------------------------------------------------------
7622-- End configuration
7623--
7624-- Don't edit anything below this line.
7625----------------------------------------------------------------------------------------------------
7626--]]
7627
7628return cfg</text>
7629 <sha1>6hym6c6py8yoseohy71qvk7kafcy1p5</sha1>
7630 </revision>
7631 </page>
7632 <page>
7633 <title>Module:Effective protection expiry</title>
7634 <ns>828</ns>
7635 <id>48785459</id>
7636 <revision>
7637 <id>744227741</id>
7638 <parentid>740797535</parentid>
7639 <timestamp>2016-10-13T22:30:40Z</timestamp>
7640 <contributor>
7641 <username>Jackmcbarn</username>
7642 <id>19285809</id>
7643 </contributor>
7644 <comment>don't error if the page isn't under PC</comment>
7645 <model>Scribunto</model>
7646 <format>text/plain</format>
7647 <text xml:space="preserve" bytes="1494">local p = {}
7648
7649-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
7650-- If no title is specified, the title of the page being displayed is used.
7651function p._main(action, pagename)
7652 local title
7653 if type(pagename) == 'table' and pagename.prefixedText then
7654 title = pagename
7655 elseif pagename then
7656 title = mw.title.new(pagename)
7657 else
7658 title = mw.title.getCurrentTitle()
7659 end
7660 pagename = title.prefixedText
7661 if action == 'autoreview' then
7662 local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
7663 return stabilitySettings and stabilitySettings.expiry or 'unknown'
7664 elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
7665 error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
7666 end
7667 local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
7668 if rawExpiry == 'infinity' then
7669 return 'infinity'
7670 elseif rawExpiry == '' then
7671 return 'unknown'
7672 else
7673 local year, month, day, hour, minute, second = rawExpiry:match(
7674 '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
7675 )
7676 if year then
7677 return string.format(
7678 '%s-%s-%sT%s:%s:%s',
7679 year, month, day, hour, minute, second
7680 )
7681 else
7682 error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
7683 end
7684 end
7685end
7686
7687setmetatable(p, { __index = function(t, k)
7688 return function(frame)
7689 return t._main(k, frame.args[1])
7690 end
7691end })
7692
7693return p</text>
7694 <sha1>i1wms02y1w048cq6uttka18a5pjzp63</sha1>
7695 </revision>
7696 </page>
7697 <page>
7698 <title>Module:Effective protection level</title>
7699 <ns>828</ns>
7700 <id>41617327</id>
7701 <revision>
7702 <id>834561914</id>
7703 <parentid>713934935</parentid>
7704 <timestamp>2018-04-06T11:52:06Z</timestamp>
7705 <contributor>
7706 <username>Mr. Stradivarius</username>
7707 <id>4708675</id>
7708 </contributor>
7709 <comment>add user JSON subpage detection - see [[mw:Special:PermaLink/2750735#Tech News: 2018-14|Tech News: 2018-14]]</comment>
7710 <model>Scribunto</model>
7711 <format>text/plain</format>
7712 <text xml:space="preserve" bytes="3056">local p = {}
7713
7714-- Returns the permission required to perform a given action on a given title.
7715-- If no title is specified, the title of the page being displayed is used.
7716function p._main(action, pagename)
7717 local title
7718 if type(pagename) == 'table' and pagename.prefixedText then
7719 title = pagename
7720 elseif pagename then
7721 title = mw.title.new(pagename)
7722 else
7723 title = mw.title.getCurrentTitle()
7724 end
7725 pagename = title.prefixedText
7726 if action == 'autoreview' then
7727 local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
7728 level = level and level.autoreview
7729 if level == 'review' then
7730 return 'reviewer'
7731 elseif level ~= '' then
7732 return level
7733 else
7734 return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review
7735 end
7736 elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
7737 error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
7738 end
7739 if title.namespace == 8 then -- MediaWiki namespace
7740 return 'sysop'
7741 elseif title.namespace == 2 and title.isSubpage and ( title.contentModel == 'javascript' or title.contentModel == 'css' or title.contentModel == 'json' ) then -- user JS, CSS or JSON page
7742 return 'sysop'
7743 end
7744 local level = title.protectionLevels[action] and title.protectionLevels[action][1]
7745 if level == 'sysop' or level == 'editprotected' then
7746 return 'sysop'
7747 elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
7748 return 'sysop'
7749 elseif level == 'templateeditor' then
7750 return 'templateeditor'
7751 elseif action == 'move' then
7752 local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.
7753 if blacklistentry and not blacklistentry.params.autoconfirmed then
7754 return 'templateeditor'
7755 elseif title.namespace == 6 then
7756 return 'filemover'
7757 elseif level == 'extendedconfirmed' then
7758 return 'extendedconfirmed'
7759 else
7760 return 'autoconfirmed'
7761 end
7762 end
7763 local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
7764 if blacklistentry then
7765 if not blacklistentry.params.autoconfirmed then
7766 return 'templateeditor'
7767 elseif level == 'extendedconfirmed' then
7768 return 'extendedconfirmed'
7769 else
7770 return 'autoconfirmed'
7771 end
7772 elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
7773 return 'autoconfirmed'
7774 elseif level then
7775 return level
7776 elseif action == 'upload' then
7777 return 'autoconfirmed'
7778 elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts
7779 return 'user'
7780 else
7781 return '*'
7782 end
7783end
7784
7785setmetatable(p, { __index = function(t, k)
7786 return function(frame)
7787 return t._main(k, frame.args[1])
7788 end
7789end })
7790
7791return p</text>
7792 <sha1>ldr27zxzu0o1ofgaoty4jscx92ku0w7</sha1>
7793 </revision>
7794 </page>
7795 <page>
7796 <title>Module:File link</title>
7797 <ns>828</ns>
7798 <id>42903140</id>
7799 <revision>
7800 <id>638642222</id>
7801 <parentid>638639021</parentid>
7802 <timestamp>2014-12-18T14:05:07Z</timestamp>
7803 <contributor>
7804 <username>Mr. Stradivarius</username>
7805 <id>4708675</id>
7806 </contributor>
7807 <comment>when calling this from wikitext use a more readable error message for missing file parameters</comment>
7808 <model>Scribunto</model>
7809 <format>text/plain</format>
7810 <text xml:space="preserve" bytes="2544">-- This module provides a library for formatting file wikilinks.
7811
7812local yesno = require('Module:Yesno')
7813local checkType = require('libraryUtil').checkType
7814
7815local p = {}
7816
7817function p._main(args)
7818 checkType('_main', 1, args, 'table')
7819
7820 -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
7821 -- own function to get the right error level.
7822 local function checkArg(key, val, level)
7823 if type(val) ~= 'string' then
7824 error(string.format(
7825 "type error in '%s' parameter of '_main' (expected string, got %s)",
7826 key, type(val)
7827 ), level)
7828 end
7829 end
7830
7831 local ret = {}
7832
7833 -- Adds a positional parameter to the buffer.
7834 local function addPositional(key)
7835 local val = args[key]
7836 if not val then
7837 return nil
7838 end
7839 checkArg(key, val, 4)
7840 ret[#ret + 1] = val
7841 end
7842
7843 -- Adds a named parameter to the buffer. We assume that the parameter name
7844 -- is the same as the argument key.
7845 local function addNamed(key)
7846 local val = args[key]
7847 if not val then
7848 return nil
7849 end
7850 checkArg(key, val, 4)
7851 ret[#ret + 1] = key .. '=' .. val
7852 end
7853
7854 -- Filename
7855 checkArg('file', args.file, 3)
7856 ret[#ret + 1] = 'File:' .. args.file
7857
7858 -- Format
7859 if args.format then
7860 checkArg('format', args.format)
7861 if args.formatfile then
7862 checkArg('formatfile', args.formatfile)
7863 ret[#ret + 1] = args.format .. '=' .. args.formatfile
7864 else
7865 ret[#ret + 1] = args.format
7866 end
7867 end
7868
7869 -- Border
7870 if yesno(args.border) then
7871 ret[#ret + 1] = 'border'
7872 end
7873
7874 addPositional('location')
7875 addPositional('alignment')
7876 addPositional('size')
7877 addNamed('upright')
7878 addNamed('link')
7879 addNamed('alt')
7880 addNamed('page')
7881 addNamed('class')
7882 addNamed('lang')
7883 addNamed('start')
7884 addNamed('end')
7885 addNamed('thumbtime')
7886 addPositional('caption')
7887
7888 return string.format('[[%s]]', table.concat(ret, '|'))
7889end
7890
7891function p.main(frame)
7892 local origArgs = require('Module:Arguments').getArgs(frame, {
7893 wrappers = 'Template:File link'
7894 })
7895 if not origArgs.file then
7896 error("'file' parameter missing from [[Template:File link]]", 0)
7897 end
7898
7899 -- Copy the arguments that were passed to a new table to avoid looking up
7900 -- every possible parameter in the frame object.
7901 local args = {}
7902 for k, v in pairs(origArgs) do
7903 -- Make _BLANK a special argument to add a blank parameter. For use in
7904 -- conditional templates etc. it is useful for blank arguments to be
7905 -- ignored, but we still need a way to specify them so that we can do
7906 -- things like [[File:Example.png|link=]].
7907 if v == '_BLANK' then
7908 v = ''
7909 end
7910 args[k] = v
7911 end
7912 return p._main(args)
7913end
7914
7915return p</text>
7916 <sha1>bzc22v133v9z5yc4aisazripn6l94p8</sha1>
7917 </revision>
7918 </page>
7919 <page>
7920 <title>Module:For</title>
7921 <ns>828</ns>
7922 <id>50413050</id>
7923 <revision>
7924 <id>732878218</id>
7925 <parentid>726039274</parentid>
7926 <timestamp>2016-08-03T20:53:03Z</timestamp>
7927 <contributor>
7928 <username>Nihiltres</username>
7929 <id>236191</id>
7930 </contributor>
7931 <comment>Updated from sandbox: categorizes as unusual "other uses" by defaulting as well as typed-out "other uses"</comment>
7932 <model>Scribunto</model>
7933 <format>text/plain</format>
7934 <text xml:space="preserve" bytes="982">local mArguments --initialize lazily
7935local yesno = require('Module:Yesno')
7936local mHatlist = require('Module:Hatnote list')
7937local mHatnote = require('Module:Hatnote')
7938local p = {}
7939
7940--Implements {{For}} from the frame
7941--uses capitalized "For" to avoid collision with Lua reserved word "for"
7942function p.For (frame)
7943 mArguments = require('Module:Arguments')
7944 return p._For(mArguments.getArgs(frame))
7945end
7946
7947--Implements {{For}} but takes a manual arguments table
7948function p._For (args)
7949 local use = args[1]
7950 local category = ''
7951 if (not use or use == 'other uses') and
7952 (not args.category or yesno(args.category)) then
7953 category = '[[Category:Hatnote templates using unusual parameters]]'
7954 end
7955 local pages = {}
7956 function two (a, b) return a, b, 1 end --lets us run ipairs from 2
7957 for k, v in two(ipairs(args)) do table.insert(pages, v) end
7958 return mHatnote._hatnote(
7959 mHatlist.forSeeTableToString({{use = use, pages = pages}}),
7960 {selfref = args.selfref}
7961 ) .. category
7962end
7963
7964return p</text>
7965 <sha1>7cw7zffjg8qhj4fig5sqk2xg5uphgx0</sha1>
7966 </revision>
7967 </page>
7968 <page>
7969 <title>Module:Hatnote</title>
7970 <ns>828</ns>
7971 <id>42498502</id>
7972 <revision>
7973 <id>779487706</id>
7974 <parentid>726656423</parentid>
7975 <timestamp>2017-05-09T05:20:32Z</timestamp>
7976 <contributor>
7977 <username>JJMC89</username>
7978 <id>24812038</id>
7979 </contributor>
7980 <comment>Add navigation-not-searchable class per [[Special:Permalink/779475248#Add navigation-not-searchable class|request]] (also see [[phab:T164781|T164781]])</comment>
7981 <model>Scribunto</model>
7982 <format>text/plain</format>
7983 <text xml:space="preserve" bytes="6703">--------------------------------------------------------------------------------
7984-- Module:Hatnote --
7985-- --
7986-- This module produces hatnote links and links to related articles. It --
7987-- implements the {{hatnote}} and {{format link}} meta-templates and includes --
7988-- helper functions for other Lua hatnote modules. --
7989--------------------------------------------------------------------------------
7990
7991local libraryUtil = require('libraryUtil')
7992local checkType = libraryUtil.checkType
7993local mArguments -- lazily initialise [[Module:Arguments]]
7994local yesno -- lazily initialise [[Module:Yesno]]
7995
7996local p = {}
7997
7998--------------------------------------------------------------------------------
7999-- Helper functions
8000--------------------------------------------------------------------------------
8001
8002local function getArgs(frame)
8003 -- Fetches the arguments from the parent frame. Whitespace is trimmed and
8004 -- blanks are removed.
8005 mArguments = require('Module:Arguments')
8006 return mArguments.getArgs(frame, {parentOnly = true})
8007end
8008
8009local function removeInitialColon(s)
8010 -- Removes the initial colon from a string, if present.
8011 return s:match('^:?(.*)')
8012end
8013
8014function p.findNamespaceId(link, removeColon)
8015 -- Finds the namespace id (namespace number) of a link or a pagename. This
8016 -- function will not work if the link is enclosed in double brackets. Colons
8017 -- are trimmed from the start of the link by default. To skip colon
8018 -- trimming, set the removeColon parameter to false.
8019 checkType('findNamespaceId', 1, link, 'string')
8020 checkType('findNamespaceId', 2, removeColon, 'boolean', true)
8021 if removeColon ~= false then
8022 link = removeInitialColon(link)
8023 end
8024 local namespace = link:match('^(.-):')
8025 if namespace then
8026 local nsTable = mw.site.namespaces[namespace]
8027 if nsTable then
8028 return nsTable.id
8029 end
8030 end
8031 return 0
8032end
8033
8034function p.formatPages(...)
8035 -- Formats a list of pages using formatLink and returns it as an array. Nil
8036 -- values are not allowed.
8037 local pages = {...}
8038 local ret = {}
8039 for i, page in ipairs(pages) do
8040 ret[i] = p._formatLink(page)
8041 end
8042 return ret
8043end
8044
8045function p.formatPageTables(...)
8046 -- Takes a list of page/display tables and returns it as a list of
8047 -- formatted links. Nil values are not allowed.
8048 local pages = {...}
8049 local links = {}
8050 for i, t in ipairs(pages) do
8051 checkType('formatPageTables', i, t, 'table')
8052 local link = t[1]
8053 local display = t[2]
8054 links[i] = p._formatLink(link, display)
8055 end
8056 return links
8057end
8058
8059function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
8060 -- Formats an error message to be returned to wikitext. If
8061 -- addTrackingCategory is not false after being returned from
8062 -- [[Module:Yesno]], and if we are not on a talk page, a tracking category
8063 -- is added.
8064 checkType('makeWikitextError', 1, msg, 'string')
8065 checkType('makeWikitextError', 2, helpLink, 'string', true)
8066 yesno = require('Module:Yesno')
8067 title = title or mw.title.getCurrentTitle()
8068 -- Make the help link text.
8069 local helpText
8070 if helpLink then
8071 helpText = ' ([[' .. helpLink .. '|help]])'
8072 else
8073 helpText = ''
8074 end
8075 -- Make the category text.
8076 local category
8077 if not title.isTalkPage and yesno(addTrackingCategory) ~= false then
8078 category = 'Hatnote templates with errors'
8079 category = string.format(
8080 '[[%s:%s]]',
8081 mw.site.namespaces[14].name,
8082 category
8083 )
8084 else
8085 category = ''
8086 end
8087 return string.format(
8088 '<strong class="error">Error: %s%s.</strong>%s',
8089 msg,
8090 helpText,
8091 category
8092 )
8093end
8094
8095function p.disambiguate(page, disambiguator)
8096 -- Formats a page title with a disambiguation parenthetical,
8097 -- i.e. "Example" → "Example (disambiguation)".
8098 checkType('disambiguate', 1, page, 'string')
8099 checkType('disambiguate', 2, disambiguator, 'string', true)
8100 disambiguator = disambiguator or 'disambiguation'
8101 return string.format('%s (%s)', page, disambiguator)
8102end
8103
8104--------------------------------------------------------------------------------
8105-- Format link
8106--
8107-- Makes a wikilink from the given link and display values. Links are escaped
8108-- with colons if necessary, and links to sections are detected and displayed
8109-- with " § " as a separator rather than the standard MediaWiki "#". Used in
8110-- the {{format hatnote link}} template.
8111--------------------------------------------------------------------------------
8112
8113function p.formatLink(frame)
8114 local args = getArgs(frame)
8115 local link = args[1]
8116 local display = args[2]
8117 if not link then
8118 return p.makeWikitextError(
8119 'no link specified',
8120 'Template:Format hatnote link#Errors',
8121 args.category
8122 )
8123 end
8124 return p._formatLink(link, display)
8125end
8126
8127function p._formatLink(link, display)
8128 checkType('_formatLink', 1, link, 'string')
8129 checkType('_formatLink', 2, display, 'string', true)
8130
8131 -- Remove the initial colon for links where it was specified manually.
8132 link = removeInitialColon(link)
8133
8134 -- Find whether a faux display value has been added with the {{!}} magic
8135 -- word.
8136 if not display then
8137 local prePipe, postPipe = link:match('^(.-)|(.*)$')
8138 link = prePipe or link
8139 display = postPipe
8140 end
8141
8142 -- Find the display value.
8143 if not display then
8144 local page, section = link:match('^(.-)#(.*)$')
8145 if page then
8146 display = page .. ' §&nbsp;' .. section
8147 end
8148 end
8149
8150 -- Assemble the link.
8151 if display then
8152 return string.format(
8153 '[[:%s|%s]]',
8154 string.gsub(link, '|(.*)$', ''), --display overwrites manual piping
8155 display
8156 )
8157 else
8158 return string.format('[[:%s]]', link)
8159 end
8160end
8161
8162--------------------------------------------------------------------------------
8163-- Hatnote
8164--
8165-- Produces standard hatnote text. Implements the {{hatnote}} template.
8166--------------------------------------------------------------------------------
8167
8168function p.hatnote(frame)
8169 local args = getArgs(frame)
8170 local s = args[1]
8171 local options = {}
8172 if not s then
8173 return p.makeWikitextError(
8174 'no text specified',
8175 'Template:Hatnote#Errors',
8176 args.category
8177 )
8178 end
8179 options.extraclasses = args.extraclasses
8180 options.selfref = args.selfref
8181 return p._hatnote(s, options)
8182end
8183
8184function p._hatnote(s, options)
8185 checkType('_hatnote', 1, s, 'string')
8186 checkType('_hatnote', 2, options, 'table', true)
8187 options = options or {}
8188 local classes = {'hatnote', 'navigation-not-searchable'}
8189 local extraclasses = options.extraclasses
8190 local selfref = options.selfref
8191 if type(extraclasses) == 'string' then
8192 classes[#classes + 1] = extraclasses
8193 end
8194 if selfref then
8195 classes[#classes + 1] = 'selfref'
8196 end
8197 return string.format(
8198 '<div role="note" class="%s">%s</div>',
8199 table.concat(classes, ' '),
8200 s
8201 )
8202end
8203
8204return p</text>
8205 <sha1>c5z31x97gktc3q7nnp8mf48t01l4qst</sha1>
8206 </revision>
8207 </page>
8208 <page>
8209 <title>Module:Hatnote list</title>
8210 <ns>828</ns>
8211 <id>50085079</id>
8212 <revision>
8213 <id>833955078</id>
8214 <parentid>833954678</parentid>
8215 <timestamp>2018-04-03T05:19:54Z</timestamp>
8216 <contributor>
8217 <username>Galobtter</username>
8218 <id>19502780</id>
8219 </contributor>
8220 <comment>fix</comment>
8221 <model>Scribunto</model>
8222 <format>text/plain</format>
8223 <text xml:space="preserve" bytes="7209">--------------------------------------------------------------------------------
8224-- Module:Hatnote list --
8225-- --
8226-- This module produces and formats lists for use in hatnotes. In particular, --
8227-- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
8228-- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
8229-- are andList & orList helpers for formatting lists with those conjunctions. --
8230--------------------------------------------------------------------------------
8231
8232local mArguments --initialize lazily
8233local mHatnote = require('Module:Hatnote')
8234local libraryUtil = require('libraryUtil')
8235local checkType = libraryUtil.checkType
8236local p = {}
8237
8238--------------------------------------------------------------------------------
8239-- List stringification helper functions
8240--
8241-- These functions are used for stringifying lists, usually page lists inside
8242-- the "Y" portion of "For X, see Y" for-see items.
8243--------------------------------------------------------------------------------
8244
8245--default options table used across the list stringification functions
8246local stringifyListDefaultOptions = {
8247 conjunction = "and",
8248 separator = ",",
8249 altSeparator = ";",
8250 space = " ",
8251 formatted = false
8252}
8253
8254-- Stringifies a list generically; probably shouldn't be used directly
8255function stringifyList(list, options)
8256 -- Type-checks, defaults, and a shortcut
8257 checkType("stringifyList", 1, list, "table")
8258 if #list == 0 then return nil end
8259 checkType("stringifyList", 2, options, "table", true)
8260 options = options or {}
8261 for k, v in pairs(stringifyListDefaultOptions) do
8262 if options[k] == nil then options[k] = v end
8263 end
8264 local s = options.space
8265 -- Format the list if requested
8266 if options.formatted then list = mHatnote.formatPages(unpack(list)) end
8267 -- Set the separator; if any item contains it, use the alternate separator
8268 local separator = options.separator
8269 --searches display text only
8270 function searchDisp(t, f)
8271 return string.find(string.sub(t, (string.find(t, '|') or 0) + 1), f)
8272 end
8273 for k, v in pairs(list) do
8274 if searchDisp(v, separator) then
8275 separator = options.altSeparator
8276 break
8277 end
8278 end
8279 -- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
8280 local conjunction = s .. options.conjunction .. s
8281 if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
8282 conjunction = separator .. conjunction
8283 end
8284 -- Return the formatted string
8285 return mw.text.listToText(list, separator .. s, conjunction)
8286end
8287
8288--DRY function
8289function conjList (conj, list, fmt)
8290 return stringifyList(list, {conjunction = conj, formatted = fmt})
8291end
8292
8293-- Stringifies lists with "and" or "or"
8294function p.andList (...) return conjList("and", ...) end
8295function p.orList (...) return conjList("or", ...) end
8296
8297--------------------------------------------------------------------------------
8298-- For see
8299--
8300-- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
8301-- {{about}} and {{redirect}} templates and their variants.
8302--------------------------------------------------------------------------------
8303
8304--default options table used across the forSee family of functions
8305local forSeeDefaultOptions = {
8306 andKeyword = 'and',
8307 title = mw.title.getCurrentTitle().text,
8308 otherText = 'other uses',
8309 forSeeForm = 'For %s, see %s.',
8310}
8311
8312--Collapses duplicate punctuation
8313function punctuationCollapse (text)
8314 local replacements = {
8315 ["%.%.$"] = ".",
8316 ["%?%.$"] = "?",
8317 ["%!%.$"] = "!",
8318 ["%.%]%]%.$"] = ".]]",
8319 ["%?%]%]%.$"] = "?]]",
8320 ["%!%]%]%.$"] = "!]]"
8321 }
8322 for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
8323 return text
8324end
8325
8326-- Structures arguments into a table for stringification, & options
8327function p.forSeeArgsToTable (args, from, options)
8328 -- Type-checks and defaults
8329 checkType("forSeeArgsToTable", 1, args, 'table')
8330 checkType("forSeeArgsToTable", 2, from, 'number', true)
8331 from = from or 1
8332 checkType("forSeeArgsToTable", 3, options, 'table', true)
8333 options = options or {}
8334 for k, v in pairs(forSeeDefaultOptions) do
8335 if options[k] == nil then options[k] = v end
8336 end
8337 -- maxArg's gotten manually because getArgs() and table.maxn aren't friends
8338 local maxArg = 0
8339 for k, v in pairs(args) do
8340 if type(k) == 'number' and k > maxArg then maxArg = k end
8341 end
8342 -- Structure the data out from the parameter list:
8343 -- * forTable is the wrapper table, with forRow rows
8344 -- * Rows are tables of a "use" string & a "pages" table of pagename strings
8345 -- * Blanks are left empty for defaulting elsewhere, but can terminate list
8346 local forTable = {}
8347 local i = from
8348 local terminated = false
8349 -- If there is extra text, and no arguments are given, give nil value
8350 -- to not produce default of "For other uses, see foo (disambiguation)"
8351 if options.extratext and i > maxArg then return nil end
8352 -- Loop to generate rows
8353 repeat
8354 -- New empty row
8355 local forRow = {}
8356 -- On blank use, assume list's ended & break at end of this loop
8357 forRow.use = args[i]
8358 if not args[i] then terminated = true end
8359 -- New empty list of pages
8360 forRow.pages = {}
8361 -- Insert first pages item if present
8362 table.insert(forRow.pages, args[i + 1])
8363 -- If the param after next is "and", do inner loop to collect params
8364 -- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
8365 while args[i + 2] == options.andKeyword do
8366 if args[i + 3] then
8367 table.insert(forRow.pages, args[i + 3])
8368 end
8369 -- Increment to next "and"
8370 i = i + 2
8371 end
8372 -- Increment to next use
8373 i = i + 2
8374 -- Append the row
8375 table.insert(forTable, forRow)
8376 until terminated or i > maxArg
8377
8378 return forTable
8379end
8380
8381-- Stringifies a table as formatted by forSeeArgsToTable
8382function p.forSeeTableToString (forSeeTable, options)
8383 -- Type-checks and defaults
8384 checkType("forSeeTableToString", 1, forSeeTable, "table", true)
8385 checkType("forSeeTableToString", 2, options, "table", true)
8386 options = options or {}
8387 for k, v in pairs(forSeeDefaultOptions) do
8388 if options[k] == nil then options[k] = v end
8389 end
8390 -- Stringify each for-see item into a list
8391 local strList = {}
8392 if forSeeTable then
8393 for k, v in pairs(forSeeTable) do
8394 local useStr = v.use or options.otherText
8395 local pagesStr = p.andList(v.pages, true) or mHatnote._formatLink(mHatnote.disambiguate(options.title))
8396 local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
8397 forSeeStr = punctuationCollapse(forSeeStr)
8398 table.insert(strList, forSeeStr)
8399 end
8400 end
8401 if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
8402 -- Return the concatenated list
8403 return table.concat(strList, ' ')
8404end
8405
8406-- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
8407-- but not blank/whitespace values. Ignores named args and args < "from".
8408function p._forSee (args, from, options)
8409 local forSeeTable = p.forSeeArgsToTable(args, from, options)
8410 return p.forSeeTableToString(forSeeTable, options)
8411end
8412
8413-- As _forSee, but uses the frame.
8414function p.forSee (frame, from, options)
8415 mArguments = require('Module:Arguments')
8416 return p._forSee(mArguments.getArgs(frame), from, options)
8417end
8418
8419return p</text>
8420 <sha1>2hmyydi47hep0hexbh8sw7ybxc07m5k</sha1>
8421 </revision>
8422 </page>
8423 <page>
8424 <title>Module:Infobox</title>
8425 <ns>828</ns>
8426 <id>38808424</id>
8427 <revision>
8428 <id>849197215</id>
8429 <parentid>849089853</parentid>
8430 <timestamp>2018-07-07T07:04:41Z</timestamp>
8431 <contributor>
8432 <username>Jc86035</username>
8433 <id>17245768</id>
8434 </contributor>
8435 <minor/>
8436 <comment>the three other types of lists as well</comment>
8437 <model>Scribunto</model>
8438 <format>text/plain</format>
8439 <text xml:space="preserve" bytes="15742">--
8440-- This module implements {{Infobox}}
8441--
8442
8443local p = {}
8444
8445local navbar = require('Module:Navbar')._navbar
8446
8447local args = {}
8448local origArgs
8449local root
8450
8451local function notempty( s ) return s and s:match( '%S' ) end
8452
8453local function fixChildBoxes(sval, tt)
8454 if notempty(sval) then
8455 local marker = '<span class=special_infobox_marker>'
8456 local s = sval
8457 s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
8458 s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
8459 if s:match(marker) then
8460 s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
8461 s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
8462 s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
8463 s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
8464 s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
8465 s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
8466 s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
8467 s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
8468 s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
8469 end
8470 if s:match(marker) then
8471 local subcells = mw.text.split(s, marker)
8472 s = ''
8473 for k = 1, #subcells do
8474 if k == 1 then
8475 s = s .. subcells[k] .. '</' .. tt .. '></tr>'
8476 elseif k == #subcells then
8477 local rowstyle = ' style="display:none"'
8478 if notempty(subcells[k]) then rowstyle = '' end
8479 s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
8480 elseif notempty(subcells[k]) then
8481 if (k % 2) == 0 then
8482 s = s .. subcells[k]
8483 else
8484 s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
8485 end
8486 end
8487 end
8488 end
8489 -- the next two lines add a newline at the end of lists for the PHP parser
8490 -- https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
8491 s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
8492 s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
8493 return s
8494 else
8495 return sval
8496 end
8497end
8498
8499local function union(t1, t2)
8500 -- Returns the union of the values of two tables, as a sequence.
8501 local vals = {}
8502 for k, v in pairs(t1) do
8503 vals[v] = true
8504 end
8505 for k, v in pairs(t2) do
8506 vals[v] = true
8507 end
8508 local ret = {}
8509 for k, v in pairs(vals) do
8510 table.insert(ret, k)
8511 end
8512 return ret
8513end
8514
8515local function getArgNums(prefix)
8516 -- Returns a table containing the numbers of the arguments that exist
8517 -- for the specified prefix. For example, if the prefix was 'data', and
8518 -- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
8519 local nums = {}
8520 for k, v in pairs(args) do
8521 local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
8522 if num then table.insert(nums, tonumber(num)) end
8523 end
8524 table.sort(nums)
8525 return nums
8526end
8527
8528local function addRow(rowArgs)
8529 -- Adds a row to the infobox, with either a header cell
8530 -- or a label/data cell combination.
8531 if rowArgs.header then
8532 root
8533 :tag('tr')
8534 :addClass(rowArgs.rowclass)
8535 :cssText(rowArgs.rowstyle)
8536 :attr('id', rowArgs.rowid)
8537 :tag('th')
8538 :attr('colspan', 2)
8539 :attr('id', rowArgs.headerid)
8540 :addClass(rowArgs.class)
8541 :addClass(args.headerclass)
8542 :css('text-align', 'center')
8543 :cssText(args.headerstyle)
8544 :cssText(rowArgs.rowcellstyle)
8545 :wikitext(fixChildBoxes(rowArgs.header, 'th'))
8546 elseif rowArgs.data then
8547 local row = root:tag('tr')
8548 row:addClass(rowArgs.rowclass)
8549 row:cssText(rowArgs.rowstyle)
8550 row:attr('id', rowArgs.rowid)
8551 if rowArgs.label then
8552 row
8553 :tag('th')
8554 :attr('scope', 'row')
8555 :attr('id', rowArgs.labelid)
8556 :cssText(args.labelstyle)
8557 :cssText(rowArgs.rowcellstyle)
8558 :wikitext(rowArgs.label)
8559 :done()
8560 end
8561
8562 local dataCell = row:tag('td')
8563 if not rowArgs.label then
8564 dataCell
8565 :attr('colspan', 2)
8566 :css('text-align', 'center')
8567 end
8568 dataCell
8569 :attr('id', rowArgs.dataid)
8570 :addClass(rowArgs.class)
8571 :cssText(rowArgs.datastyle)
8572 :cssText(rowArgs.rowcellstyle)
8573 :newline()
8574 :wikitext(fixChildBoxes(rowArgs.data, 'td'))
8575 end
8576end
8577
8578local function renderTitle()
8579 if not args.title then return end
8580
8581 root
8582 :tag('caption')
8583 :addClass(args.titleclass)
8584 :cssText(args.titlestyle)
8585 :wikitext(args.title)
8586end
8587
8588local function renderAboveRow()
8589 if not args.above then return end
8590
8591 root
8592 :tag('tr')
8593 :tag('th')
8594 :attr('colspan', 2)
8595 :addClass(args.aboveclass)
8596 :css('text-align', 'center')
8597 :css('font-size', '125%')
8598 :css('font-weight', 'bold')
8599 :cssText(args.abovestyle)
8600 :wikitext(fixChildBoxes(args.above,'th'))
8601end
8602
8603local function renderBelowRow()
8604 if not args.below then return end
8605
8606 root
8607 :tag('tr')
8608 :tag('td')
8609 :attr('colspan', '2')
8610 :addClass(args.belowclass)
8611 :css('text-align', 'center')
8612 :cssText(args.belowstyle)
8613 :newline()
8614 :wikitext(fixChildBoxes(args.below,'td'))
8615end
8616
8617local function renderSubheaders()
8618 if args.subheader then
8619 args.subheader1 = args.subheader
8620 end
8621 if args.subheaderrowclass then
8622 args.subheaderrowclass1 = args.subheaderrowclass
8623 end
8624 local subheadernums = getArgNums('subheader')
8625 for k, num in ipairs(subheadernums) do
8626 addRow({
8627 data = args['subheader' .. tostring(num)],
8628 datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
8629 class = args.subheaderclass,
8630 rowclass = args['subheaderrowclass' .. tostring(num)]
8631 })
8632 end
8633end
8634
8635local function renderImages()
8636 if args.image then
8637 args.image1 = args.image
8638 end
8639 if args.caption then
8640 args.caption1 = args.caption
8641 end
8642 local imagenums = getArgNums('image')
8643 for k, num in ipairs(imagenums) do
8644 local caption = args['caption' .. tostring(num)]
8645 local data = mw.html.create():wikitext(args['image' .. tostring(num)])
8646 if caption then
8647 data
8648 :tag('div')
8649 :cssText(args.captionstyle)
8650 :wikitext(caption)
8651 end
8652 addRow({
8653 data = tostring(data),
8654 datastyle = args.imagestyle,
8655 class = args.imageclass,
8656 rowclass = args['imagerowclass' .. tostring(num)]
8657 })
8658 end
8659end
8660
8661local function renderRows()
8662 -- Gets the union of the header and data argument numbers,
8663 -- and renders them all in order using addRow.
8664 local rownums = union(getArgNums('header'), getArgNums('data'))
8665 table.sort(rownums)
8666 for k, num in ipairs(rownums) do
8667 addRow({
8668 header = args['header' .. tostring(num)],
8669 label = args['label' .. tostring(num)],
8670 data = args['data' .. tostring(num)],
8671 datastyle = args.datastyle,
8672 class = args['class' .. tostring(num)],
8673 rowclass = args['rowclass' .. tostring(num)],
8674 rowstyle = args['rowstyle' .. tostring(num)],
8675 rowcellstyle = args['rowcellstyle' .. tostring(num)],
8676 dataid = args['dataid' .. tostring(num)],
8677 labelid = args['labelid' .. tostring(num)],
8678 headerid = args['headerid' .. tostring(num)],
8679 rowid = args['rowid' .. tostring(num)]
8680 })
8681 end
8682end
8683
8684local function renderNavBar()
8685 if not args.name then return end
8686
8687 root
8688 :tag('tr')
8689 :tag('td')
8690 :attr('colspan', '2')
8691 :css('text-align', 'right')
8692 :wikitext(navbar{
8693 args.name,
8694 mini = 1,
8695 })
8696end
8697
8698local function renderItalicTitle()
8699 local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
8700 if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
8701 root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
8702 end
8703end
8704
8705local function renderTrackingCategories()
8706 if args.decat ~= 'yes' then
8707 if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
8708 root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
8709 end
8710 if args.child == 'yes' and args.title then
8711 root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
8712 end
8713 end
8714end
8715
8716local function _infobox()
8717 -- Specify the overall layout of the infobox, with special settings
8718 -- if the infobox is used as a 'child' inside another infobox.
8719 if args.child ~= 'yes' then
8720 root = mw.html.create('table')
8721
8722 root
8723 :addClass((args.subbox ~= 'yes') and 'infobox' or nil)
8724 :addClass(args.bodyclass)
8725
8726 if args.subbox == 'yes' then
8727 root
8728 :css('padding', '0')
8729 :css('border', 'none')
8730 :css('margin', '-3px')
8731 :css('width', 'auto')
8732 :css('min-width', '100%')
8733 :css('font-size', '100%')
8734 :css('clear', 'none')
8735 :css('float', 'none')
8736 :css('background-color', 'transparent')
8737 else
8738 root
8739 :css('width', '22em')
8740 end
8741 root
8742 :cssText(args.bodystyle)
8743
8744 renderTitle()
8745 renderAboveRow()
8746 else
8747 root = mw.html.create()
8748
8749 root
8750 :wikitext(args.title)
8751 end
8752
8753 renderSubheaders()
8754 renderImages()
8755 renderRows()
8756 renderBelowRow()
8757 renderNavBar()
8758 renderItalicTitle()
8759 renderTrackingCategories()
8760
8761 return tostring(root)
8762end
8763
8764local function preprocessSingleArg(argName)
8765 -- If the argument exists and isn't blank, add it to the argument table.
8766 -- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
8767 if origArgs[argName] and origArgs[argName] ~= '' then
8768 args[argName] = origArgs[argName]
8769 end
8770end
8771
8772local function preprocessArgs(prefixTable, step)
8773 -- Assign the parameters with the given prefixes to the args table, in order, in batches
8774 -- of the step size specified. This is to prevent references etc. from appearing in the
8775 -- wrong order. The prefixTable should be an array containing tables, each of which has
8776 -- two possible fields, a "prefix" string and a "depend" table. The function always parses
8777 -- parameters containing the "prefix" string, but only parses parameters in the "depend"
8778 -- table if the prefix parameter is present and non-blank.
8779 if type(prefixTable) ~= 'table' then
8780 error("Non-table value detected for the prefix table", 2)
8781 end
8782 if type(step) ~= 'number' then
8783 error("Invalid step value detected", 2)
8784 end
8785
8786 -- Get arguments without a number suffix, and check for bad input.
8787 for i,v in ipairs(prefixTable) do
8788 if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
8789 error('Invalid input detected to preprocessArgs prefix table', 2)
8790 end
8791 preprocessSingleArg(v.prefix)
8792 -- Only parse the depend parameter if the prefix parameter is present and not blank.
8793 if args[v.prefix] and v.depend then
8794 for j, dependValue in ipairs(v.depend) do
8795 if type(dependValue) ~= 'string' then
8796 error('Invalid "depend" parameter value detected in preprocessArgs')
8797 end
8798 preprocessSingleArg(dependValue)
8799 end
8800 end
8801 end
8802
8803 -- Get arguments with number suffixes.
8804 local a = 1 -- Counter variable.
8805 local moreArgumentsExist = true
8806 while moreArgumentsExist == true do
8807 moreArgumentsExist = false
8808 for i = a, a + step - 1 do
8809 for j,v in ipairs(prefixTable) do
8810 local prefixArgName = v.prefix .. tostring(i)
8811 if origArgs[prefixArgName] then
8812 moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
8813 preprocessSingleArg(prefixArgName)
8814 end
8815 -- Process the depend table if the prefix argument is present and not blank, or
8816 -- we are processing "prefix1" and "prefix" is present and not blank, and
8817 -- if the depend table is present.
8818 if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
8819 for j,dependValue in ipairs(v.depend) do
8820 local dependArgName = dependValue .. tostring(i)
8821 preprocessSingleArg(dependArgName)
8822 end
8823 end
8824 end
8825 end
8826 a = a + step
8827 end
8828end
8829
8830function p.infobox(frame)
8831 -- If called via #invoke, use the args passed into the invoking template.
8832 -- Otherwise, for testing purposes, assume args are being passed directly in.
8833 if frame == mw.getCurrentFrame() then
8834 origArgs = frame:getParent().args
8835 else
8836 origArgs = frame
8837 end
8838
8839 -- Parse the data parameters in the same order that the old {{infobox}} did, so that
8840 -- references etc. will display in the expected places. Parameters that depend on
8841 -- another parameter are only processed if that parameter is present, to avoid
8842 -- phantom references appearing in article reference lists.
8843 preprocessSingleArg('child')
8844 preprocessSingleArg('bodyclass')
8845 preprocessSingleArg('subbox')
8846 preprocessSingleArg('bodystyle')
8847 preprocessSingleArg('title')
8848 preprocessSingleArg('titleclass')
8849 preprocessSingleArg('titlestyle')
8850 preprocessSingleArg('above')
8851 preprocessSingleArg('aboveclass')
8852 preprocessSingleArg('abovestyle')
8853 preprocessArgs({
8854 {prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
8855 }, 10)
8856 preprocessSingleArg('subheaderstyle')
8857 preprocessSingleArg('subheaderclass')
8858 preprocessArgs({
8859 {prefix = 'image', depend = {'caption', 'imagerowclass'}}
8860 }, 10)
8861 preprocessSingleArg('captionstyle')
8862 preprocessSingleArg('imagestyle')
8863 preprocessSingleArg('imageclass')
8864 preprocessArgs({
8865 {prefix = 'header'},
8866 {prefix = 'data', depend = {'label'}},
8867 {prefix = 'rowclass'},
8868 {prefix = 'rowstyle'},
8869 {prefix = 'rowcellstyle'},
8870 {prefix = 'class'},
8871 {prefix = 'dataid'},
8872 {prefix = 'labelid'},
8873 {prefix = 'headerid'},
8874 {prefix = 'rowid'}
8875 }, 50)
8876 preprocessSingleArg('headerclass')
8877 preprocessSingleArg('headerstyle')
8878 preprocessSingleArg('labelstyle')
8879 preprocessSingleArg('datastyle')
8880 preprocessSingleArg('below')
8881 preprocessSingleArg('belowclass')
8882 preprocessSingleArg('belowstyle')
8883 preprocessSingleArg('name')
8884 args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
8885 preprocessSingleArg('decat')
8886
8887 return _infobox()
8888end
8889
8890return p</text>
8891 <sha1>3lqvq40va735qhmz9ozwwkwt6n87qbr</sha1>
8892 </revision>
8893 </page>
8894 <page>
8895 <title>Module:InfoboxImage</title>
8896 <ns>828</ns>
8897 <id>38581924</id>
8898 <revision>
8899 <id>839038061</id>
8900 <parentid>769944044</parentid>
8901 <timestamp>2018-04-30T21:16:56Z</timestamp>
8902 <contributor>
8903 <username>WOSlinker</username>
8904 <id>3138265</id>
8905 </contributor>
8906 <comment>add Noimage.gif to placeholder list</comment>
8907 <model>Scribunto</model>
8908 <format>text/plain</format>
8909 <text xml:space="preserve" bytes="9657">-- Inputs:
8910-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
8911-- page - page to display for multipage images (DjVu)
8912-- size - size to display the image
8913-- maxsize - maximum size for image
8914-- sizedefault - default size to display the image if size param is blank
8915-- alt - alt text for image
8916-- title - title text for image
8917-- border - set to yes if border
8918-- center - set to yes, if the image has to be centered
8919-- upright - upright image param
8920-- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
8921-- link - page to visit when clicking on image
8922-- Outputs:
8923-- Formatted image.
8924-- More details available at the "Module:InfoboxImage/doc" page
8925
8926local i = {};
8927
8928local placeholder_image = {
8929 "Blue - Replace this image female.svg",
8930 "Blue - Replace this image male.svg",
8931 "Female no free image yet.png",
8932 "Flag of None (square).svg",
8933 "Flag of None.svg",
8934 "Flag of.svg",
8935 "Green - Replace this image female.svg",
8936 "Green - Replace this image male.svg",
8937 "Image is needed female.svg",
8938 "Image is needed male.svg",
8939 "Location map of None.svg",
8940 "Male no free image yet.png",
8941 "Missing flag.png",
8942 "No flag.svg",
8943 "No free portrait.svg",
8944 "No portrait (female).svg",
8945 "No portrait (male).svg",
8946 "Red - Replace this image female.svg",
8947 "Red - Replace this image male.svg",
8948 "Replace this image female (blue).svg",
8949 "Replace this image female.svg",
8950 "Replace this image male (blue).svg",
8951 "Replace this image male.svg",
8952 "Silver - Replace this image female.svg",
8953 "Silver - Replace this image male.svg",
8954 "Replace this image.svg",
8955 "Cricket no pic.png",
8956 "CarersLogo.gif",
8957 "Diagram Needed.svg",
8958 "Example.jpg",
8959 "Image placeholder.png",
8960 "No male portrait.svg",
8961 "Nocover-upload.png",
8962 "NoDVDcover copy.png",
8963 "Noribbon.svg",
8964 "No portrait-BFD-test.svg",
8965 "Placeholder barnstar ribbon.png",
8966 "Project Trains no image.png",
8967 "Image-request.png",
8968 "Sin bandera.svg",
8969 "Sin escudo.svg",
8970 "Replace this image - temple.png",
8971 "Replace this image butterfly.png",
8972 "Replace this image.svg",
8973 "Replace this image1.svg",
8974 "Resolution angle.png",
8975 "Image-No portrait-text-BFD-test.svg",
8976 "Insert image here.svg",
8977 "No image available.png",
8978 "NO IMAGE YET square.png",
8979 "NO IMAGE YET.png",
8980 "No Photo Available.svg",
8981 "No Screenshot.svg",
8982 "No-image-available.jpg",
8983 "Null.png",
8984 "PictureNeeded.gif",
8985 "Place holder.jpg",
8986 "Unbenannt.JPG",
8987 "UploadACopyrightFreeImage.svg",
8988 "UploadAnImage.gif",
8989 "UploadAnImage.svg",
8990 "UploadAnImageShort.svg",
8991 "CarersLogo.gif",
8992 "Diagram Needed.svg",
8993 "No male portrait.svg",
8994 "NoDVDcover copy.png",
8995 "Placeholder barnstar ribbon.png",
8996 "Project Trains no image.png",
8997 "Image-request.png",
8998 "Noimage.gif",
8999}
9000
9001function i.IsPlaceholder(image)
9002 -- change underscores to spaces
9003 image = mw.ustring.gsub(image, "_", " ");
9004 assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
9005 -- if image starts with [[ then remove that and anything after |
9006 if mw.ustring.sub(image,1,2) == "[[" then
9007 image = mw.ustring.sub(image,3);
9008 image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
9009 assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
9010 end
9011 -- Trim spaces
9012 image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
9013 assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
9014 -- remove prefix if exists
9015 local allNames = mw.site.namespaces[6].aliases
9016 allNames[#allNames + 1] = mw.site.namespaces[6].name
9017 allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
9018 for i, name in ipairs(allNames) do
9019 if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
9020 image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
9021 break
9022 end
9023 end
9024 -- Trim spaces
9025 image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
9026 -- capitalise first letter
9027 image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
9028
9029 for i,j in pairs(placeholder_image) do
9030 if image == j then
9031 return true
9032 end
9033 end
9034 return false
9035end
9036
9037function i.InfoboxImage(frame)
9038 local image = frame.args["image"];
9039
9040 if image == "" or image == nil then
9041 return "";
9042 end
9043 if image == "&nbsp;" then
9044 return image;
9045 end
9046 if frame.args["suppressplaceholder"] ~= "no" then
9047 if i.IsPlaceholder(image) == true then
9048 return "";
9049 end
9050 end
9051
9052 if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
9053 return "";
9054 end
9055 if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
9056 return "";
9057 end
9058 if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
9059 return "";
9060 end
9061 if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
9062 return "";
9063 end
9064 if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
9065 return "";
9066 end
9067 if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
9068 return "";
9069 end
9070
9071 if mw.ustring.sub(image,1,2) == "[[" then
9072 -- search for thumbnail images and add to tracking cat if found
9073 if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
9074 return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
9075 elseif mw.title.getCurrentTitle().namespace == 0 then
9076 return image .. "[[Category:Pages using deprecated image syntax]]";
9077 else
9078 return image;
9079 end
9080 elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
9081 return image;
9082 elseif mw.ustring.sub(image,1,1) == "<" then
9083 return image;
9084 elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
9085 -- Found strip marker at begining, so pass don't process at all
9086 return image;
9087 elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
9088 -- Found strip marker at begining, so pass don't process at all
9089 return image;
9090 else
9091 local result = "";
9092 local page = frame.args["page"];
9093 local size = frame.args["size"];
9094 local maxsize = frame.args["maxsize"];
9095 local sizedefault = frame.args["sizedefault"];
9096 local alt = frame.args["alt"];
9097 local link = frame.args["link"];
9098 local title = frame.args["title"];
9099 local border = frame.args["border"];
9100 local upright = frame.args["upright"] or "";
9101 local thumbtime = frame.args["thumbtime"] or "";
9102 local center= frame.args["center"];
9103
9104 -- remove prefix if exists
9105 local allNames = mw.site.namespaces[6].aliases
9106 allNames[#allNames + 1] = mw.site.namespaces[6].name
9107 allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
9108 for i, name in ipairs(allNames) do
9109 if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
9110 image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
9111 break
9112 end
9113 end
9114
9115 if maxsize ~= "" and maxsize ~= nil then
9116 -- if no sizedefault then set to maxsize
9117 if sizedefault == "" or sizedefault == nil then
9118 sizedefault = maxsize
9119 end
9120 -- check to see if size bigger than maxsize
9121 if size ~= "" and size ~= nil then
9122 local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
9123 local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
9124 if sizenumber>maxsizenumber and maxsizenumber>0 then
9125 size = maxsize;
9126 end
9127 end
9128 end
9129 -- add px to size if just a number
9130 if (tonumber(size) or 0) > 0 then
9131 size = size .. "px";
9132 end
9133 -- add px to sizedefault if just a number
9134 if (tonumber(sizedefault) or 0) > 0 then
9135 sizedefault = sizedefault .. "px";
9136 end
9137
9138 result = "[[File:" .. image;
9139 if page ~= "" and page ~= nil then
9140 result = result .. "|page=" .. page;
9141 end
9142 if size ~= "" and size ~= nil then
9143 result = result .. "|" .. size;
9144 elseif sizedefault ~= "" and sizedefault ~= nil then
9145 result = result .. "|" .. sizedefault;
9146 else
9147 result = result .. "|frameless";
9148 end
9149 if center == "yes" then
9150 result = result .. "|center"
9151 end
9152 if alt ~= "" and alt ~= nil then
9153 result = result .. "|alt=" .. alt;
9154 end
9155 if link ~= "" and link ~= nil then
9156 result = result .. "|link=" .. link;
9157 end
9158 if border == "yes" then
9159 result = result .. "|border";
9160 end
9161 if upright == "yes" then
9162 result = result .. "|upright";
9163 elseif upright ~= "" then
9164 result = result .. "|upright=" .. upright;
9165 end
9166 if thumbtime ~= "" then
9167 result = result .. "|thumbtime=" .. thumbtime;
9168 end
9169 if title ~= "" and title ~= nil then
9170 result = result .. "|" .. title;
9171 elseif alt ~= "" and alt ~= nil then
9172 result = result .. "|" .. alt;
9173 end
9174 result = result .. "]]";
9175
9176 return result;
9177 end
9178end
9179
9180return i;</text>
9181 <sha1>qtnddjnyefntigkcp7xwqp47j23hao6</sha1>
9182 </revision>
9183 </page>
9184 <page>
9185 <title>Module:IsValidPageName</title>
9186 <ns>828</ns>
9187 <id>42378350</id>
9188 <revision>
9189 <id>602409120</id>
9190 <parentid>602403765</parentid>
9191 <timestamp>2014-04-02T12:23:11Z</timestamp>
9192 <contributor>
9193 <username>Mr. Stradivarius</username>
9194 <id>4708675</id>
9195 </contributor>
9196 <comment>use pcall in case we are over the expensive function count</comment>
9197 <model>Scribunto</model>
9198 <format>text/plain</format>
9199 <text xml:space="preserve" bytes="255">-- This module implements [[Template:isValidPageName]].
9200
9201local export = {}
9202
9203function export.isValidPageName(frame)
9204 local success, res = pcall(mw.title.new, frame.args[1])
9205 if success and res then
9206 return "valid"
9207 else
9208 return ""
9209 end
9210end
9211
9212return export</text>
9213 <sha1>hoypn4rnht45b6h0cxlb6y0r0h6hpq2</sha1>
9214 </revision>
9215 </page>
9216 <page>
9217 <title>Module:List</title>
9218 <ns>828</ns>
9219 <id>41068627</id>
9220 <revision>
9221 <id>794511725</id>
9222 <parentid>788254921</parentid>
9223 <timestamp>2017-08-08T13:55:25Z</timestamp>
9224 <contributor>
9225 <username>Jdlrobson</username>
9226 <id>15999850</id>
9227 </contributor>
9228 <comment>Minerva skin needs whether an hlist is separated to be explicit (see https://en.wikipedia.org/wiki/Wikipedia:Village_pump_(technical)#Hlist_bullets_not_shown_in_mobile)</comment>
9229 <model>Scribunto</model>
9230 <format>text/plain</format>
9231 <text xml:space="preserve" bytes="5154">-- This module outputs different kinds of lists. At the moment, bulleted,
9232-- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
9233
9234local libUtil = require('libraryUtil')
9235local checkType = libUtil.checkType
9236local mTableTools = require('Module:TableTools')
9237
9238local p = {}
9239
9240local listTypes = {
9241 ['bulleted'] = true,
9242 ['unbulleted'] = true,
9243 ['horizontal'] = true,
9244 ['ordered'] = true,
9245 ['horizontal_ordered'] = true
9246}
9247
9248function p.makeListData(listType, args)
9249 -- Constructs a data table to be passed to p.renderList.
9250 local data = {}
9251
9252 -- Classes
9253 data.classes = {}
9254 if listType == 'horizontal' or listType == 'horizontal_ordered' then
9255 table.insert(data.classes, 'hlist hlist-separated')
9256 elseif listType == 'unbulleted' then
9257 table.insert(data.classes, 'plainlist')
9258 end
9259 table.insert(data.classes, args.class)
9260
9261 -- Main div style
9262 data.style = args.style
9263
9264 -- Indent for horizontal lists
9265 if listType == 'horizontal' or listType == 'horizontal_ordered' then
9266 local indent = tonumber(args.indent)
9267 indent = indent and indent * 1.6 or 0
9268 if indent > 0 then
9269 data.marginLeft = indent .. 'em'
9270 end
9271 end
9272
9273 -- List style types for ordered lists
9274 -- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
9275 -- type is either set by the "type" attribute or the "list-style-type" CSS
9276 -- property.
9277 if listType == 'ordered' or listType == 'horizontal_ordered' then
9278 data.listStyleType = args.list_style_type or args['list-style-type']
9279 data.type = args['type']
9280
9281 -- Detect invalid type attributes and attempt to convert them to
9282 -- list-style-type CSS properties.
9283 if data.type
9284 and not data.listStyleType
9285 and not tostring(data.type):find('^%s*[1AaIi]%s*$')
9286 then
9287 data.listStyleType = data.type
9288 data.type = nil
9289 end
9290 end
9291
9292 -- List tag type
9293 if listType == 'ordered' or listType == 'horizontal_ordered' then
9294 data.listTag = 'ol'
9295 else
9296 data.listTag = 'ul'
9297 end
9298
9299 -- Start number for ordered lists
9300 data.start = args.start
9301 if listType == 'horizontal_ordered' then
9302 -- Apply fix to get start numbers working with horizontal ordered lists.
9303 local startNum = tonumber(data.start)
9304 if startNum then
9305 data.counterReset = 'listitem ' .. tostring(startNum - 1)
9306 end
9307 end
9308
9309 -- List style
9310 -- ul_style and ol_style are included for backwards compatibility. No
9311 -- distinction is made for ordered or unordered lists.
9312 data.listStyle = args.list_style
9313
9314 -- List items
9315 -- li_style is included for backwards compatibility. item_style was included
9316 -- to be easier to understand for non-coders.
9317 data.itemStyle = args.item_style or args.li_style
9318 data.items = {}
9319 for i, num in ipairs(mTableTools.numKeys(args)) do
9320 local item = {}
9321 item.content = args[num]
9322 item.style = args['item' .. tostring(num) .. '_style']
9323 or args['item_style' .. tostring(num)]
9324 item.value = args['item' .. tostring(num) .. '_value']
9325 or args['item_value' .. tostring(num)]
9326 table.insert(data.items, item)
9327 end
9328
9329 return data
9330end
9331
9332function p.renderList(data)
9333 -- Renders the list HTML.
9334
9335 -- Return the blank string if there are no list items.
9336 if type(data.items) ~= 'table' or #data.items < 1 then
9337 return ''
9338 end
9339
9340 -- Render the main div tag.
9341 local root = mw.html.create('div')
9342 for i, class in ipairs(data.classes or {}) do
9343 root:addClass(class)
9344 end
9345 root:css{['margin-left'] = data.marginLeft}
9346 if data.style then
9347 root:cssText(data.style)
9348 end
9349
9350 -- Render the list tag.
9351 local list = root:tag(data.listTag or 'ul')
9352 list
9353 :attr{start = data.start, type = data.type}
9354 :css{
9355 ['counter-reset'] = data.counterReset,
9356 ['list-style-type'] = data.listStyleType
9357 }
9358 if data.listStyle then
9359 list:cssText(data.listStyle)
9360 end
9361
9362 -- Render the list items
9363 for i, t in ipairs(data.items or {}) do
9364 local item = list:tag('li')
9365 if data.itemStyle then
9366 item:cssText(data.itemStyle)
9367 end
9368 if t.style then
9369 item:cssText(t.style)
9370 end
9371 item
9372 :attr{value = t.value}
9373 :wikitext(t.content)
9374 end
9375
9376 return tostring(root)
9377end
9378
9379function p.renderTrackingCategories(args)
9380 local isDeprecated = false -- Tracks deprecated parameters.
9381 for k, v in pairs(args) do
9382 k = tostring(k)
9383 if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
9384 isDeprecated = true
9385 break
9386 end
9387 end
9388 local ret = ''
9389 if isDeprecated then
9390 ret = ret .. '[[Category:List templates with deprecated parameters]]'
9391 end
9392 return ret
9393end
9394
9395function p.makeList(listType, args)
9396 if not listType or not listTypes[listType] then
9397 error(string.format(
9398 "bad argument #1 to 'makeList' ('%s' is not a valid list type)",
9399 tostring(listType)
9400 ), 2)
9401 end
9402 checkType('makeList', 2, args, 'table')
9403 local data = p.makeListData(listType, args)
9404 local list = p.renderList(data)
9405 local trackingCategories = p.renderTrackingCategories(args)
9406 return list .. trackingCategories
9407end
9408
9409for listType in pairs(listTypes) do
9410 p[listType] = function (frame)
9411 local mArguments = require('Module:Arguments')
9412 local origArgs = mArguments.getArgs(frame)
9413 -- Copy all the arguments to a new table, for faster indexing.
9414 local args = {}
9415 for k, v in pairs(origArgs) do
9416 args[k] = v
9417 end
9418 return p.makeList(listType, args)
9419 end
9420end
9421
9422return p</text>
9423 <sha1>lkqmcmpfob2c6xhq46f675tm6p136ns</sha1>
9424 </revision>
9425 </page>
9426 <page>
9427 <title>Module:Lua banner</title>
9428 <ns>828</ns>
9429 <id>42951651</id>
9430 <revision>
9431 <id>847256650</id>
9432 <parentid>837866503</parentid>
9433 <timestamp>2018-06-24T00:47:01Z</timestamp>
9434 <contributor>
9435 <username>Ahecht</username>
9436 <id>2016996</id>
9437 </contributor>
9438 <comment>Detect if on module page</comment>
9439 <model>Scribunto</model>
9440 <format>text/plain</format>
9441 <text xml:space="preserve" bytes="3086">-- This module implements the {{lua}} template.
9442local yesno = require('Module:Yesno')
9443local mList = require('Module:List')
9444local mTableTools = require('Module:TableTools')
9445local mMessageBox = require('Module:Message box')
9446
9447local p = {}
9448
9449function p.main(frame)
9450 local origArgs = frame:getParent().args
9451 local args = {}
9452 for k, v in pairs(origArgs) do
9453 v = v:match('^%s*(.-)%s*$')
9454 if v ~= '' then
9455 args[k] = v
9456 end
9457 end
9458 return p._main(args)
9459end
9460
9461function p._main(args)
9462 local modules = mTableTools.compressSparseArray(args)
9463 local box = p.renderBox(modules)
9464 local trackingCategories = p.renderTrackingCategories(args, modules)
9465 return box .. trackingCategories
9466end
9467
9468function p.renderBox(modules)
9469 local boxArgs = {}
9470 if #modules < 1 then
9471 boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
9472 else
9473 local moduleLinks = {}
9474 for i, module in ipairs(modules) do
9475 moduleLinks[i] = string.format('[[:%s]]', module)
9476 end
9477 local moduleList = mList.makeList('bulleted', moduleLinks)
9478 boxArgs.text = 'This ' ..
9479 (mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
9480 ' uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
9481 end
9482 boxArgs.type = 'notice'
9483 boxArgs.small = true
9484 boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=|link=]]'
9485 return mMessageBox.main('mbox', boxArgs)
9486end
9487
9488function p.renderTrackingCategories(args, modules, titleObj)
9489 if yesno(args.nocat) then
9490 return ''
9491 end
9492
9493 local cats = {}
9494
9495 -- Error category
9496 if #modules < 1 then
9497 cats[#cats + 1] = 'Lua templates with errors'
9498 end
9499
9500 -- Lua templates category
9501 titleObj = titleObj or mw.title.getCurrentTitle()
9502 local subpageBlacklist = {
9503 doc = true,
9504 sandbox = true,
9505 sandbox2 = true,
9506 testcases = true
9507 }
9508 if titleObj.namespace == 10
9509 and not subpageBlacklist[titleObj.subpageText]
9510 then
9511 local category = args.category
9512 if not category then
9513 local categories = {
9514 ['Module:String'] = 'Lua String-based templates',
9515 ['Module:Math'] = 'Templates based on the Math Lua module',
9516 ['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
9517 ['Module:Citation'] = 'Lua-based citation templates'
9518 }
9519 categories['Module:Citation/CS1'] = categories['Module:Citation']
9520 category = modules[1] and categories[modules[1]]
9521 category = category or 'Lua-based templates'
9522 end
9523 cats[#cats + 1] = category
9524 local protLevels = {
9525 autoconfirmed = 1,
9526 extendedconfirmed = 2,
9527 templateeditor = 3,
9528 sysop = 4
9529 }
9530 local currentProt = titleObj.protectionLevels["edit"][1]
9531 if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
9532 for i, module in ipairs(modules) do
9533 local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
9534 if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
9535 if moduleProt < currentProt then
9536 cats[#cats + 1] = "Templates using under-protected Lua modules"
9537 break
9538 end
9539 end
9540 end
9541
9542 for i, cat in ipairs(cats) do
9543 cats[i] = string.format('[[Category:%s]]', cat)
9544 end
9545 return table.concat(cats)
9546end
9547
9548return p</text>
9549 <sha1>691clljhkwhpn2xemapk54m2k5fuame</sha1>
9550 </revision>
9551 </page>
9552 <page>
9553 <title>Module:Message box</title>
9554 <ns>828</ns>
9555 <id>40574910</id>
9556 <revision>
9557 <id>835732555</id>
9558 <parentid>803399820</parentid>
9559 <timestamp>2018-04-10T12:58:17Z</timestamp>
9560 <contributor>
9561 <username>MSGJ</username>
9562 <id>42630</id>
9563 </contributor>
9564 <comment>ony load Category handler when needed, requested on talk page</comment>
9565 <model>Scribunto</model>
9566 <format>text/plain</format>
9567 <text xml:space="preserve" bytes="17101">-- This is a meta-module for producing message box templates, including
9568-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
9569
9570-- Load necessary modules.
9571require('Module:No globals')
9572local getArgs
9573local yesno = require('Module:Yesno')
9574
9575-- Get a language object for formatDate and ucfirst.
9576local lang = mw.language.getContentLanguage()
9577
9578-- Define constants
9579local CONFIG_MODULE = 'Module:Message box/configuration'
9580
9581--------------------------------------------------------------------------------
9582-- Helper functions
9583--------------------------------------------------------------------------------
9584
9585local function getTitleObject(...)
9586 -- Get the title object, passing the function through pcall
9587 -- in case we are over the expensive function count limit.
9588 local success, title = pcall(mw.title.new, ...)
9589 if success then
9590 return title
9591 end
9592end
9593
9594local function union(t1, t2)
9595 -- Returns the union of two arrays.
9596 local vals = {}
9597 for i, v in ipairs(t1) do
9598 vals[v] = true
9599 end
9600 for i, v in ipairs(t2) do
9601 vals[v] = true
9602 end
9603 local ret = {}
9604 for k in pairs(vals) do
9605 table.insert(ret, k)
9606 end
9607 table.sort(ret)
9608 return ret
9609end
9610
9611local function getArgNums(args, prefix)
9612 local nums = {}
9613 for k, v in pairs(args) do
9614 local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
9615 if num then
9616 table.insert(nums, tonumber(num))
9617 end
9618 end
9619 table.sort(nums)
9620 return nums
9621end
9622
9623--------------------------------------------------------------------------------
9624-- Box class definition
9625--------------------------------------------------------------------------------
9626
9627local MessageBox = {}
9628MessageBox.__index = MessageBox
9629
9630function MessageBox.new(boxType, args, cfg)
9631 args = args or {}
9632 local obj = {}
9633
9634 -- Set the title object and the namespace.
9635 obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
9636
9637 -- Set the config for our box type.
9638 obj.cfg = cfg[boxType]
9639 if not obj.cfg then
9640 local ns = obj.title.namespace
9641 -- boxType is "mbox" or invalid input
9642 if ns == 0 then
9643 obj.cfg = cfg.ambox -- main namespace
9644 elseif ns == 6 then
9645 obj.cfg = cfg.imbox -- file namespace
9646 elseif ns == 14 then
9647 obj.cfg = cfg.cmbox -- category namespace
9648 else
9649 local nsTable = mw.site.namespaces[ns]
9650 if nsTable and nsTable.isTalk then
9651 obj.cfg = cfg.tmbox -- any talk namespace
9652 else
9653 obj.cfg = cfg.ombox -- other namespaces or invalid input
9654 end
9655 end
9656 end
9657
9658 -- Set the arguments, and remove all blank arguments except for the ones
9659 -- listed in cfg.allowBlankParams.
9660 do
9661 local newArgs = {}
9662 for k, v in pairs(args) do
9663 if v ~= '' then
9664 newArgs[k] = v
9665 end
9666 end
9667 for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
9668 newArgs[param] = args[param]
9669 end
9670 obj.args = newArgs
9671 end
9672
9673 -- Define internal data structure.
9674 obj.categories = {}
9675 obj.classes = {}
9676 -- For lazy loading of [[Module:Category handler]].
9677 obj.hasCategories = false
9678
9679 return setmetatable(obj, MessageBox)
9680end
9681
9682function MessageBox:addCat(ns, cat, sort)
9683 if not cat then
9684 return nil
9685 end
9686 if sort then
9687 cat = string.format('[[Category:%s|%s]]', cat, sort)
9688 else
9689 cat = string.format('[[Category:%s]]', cat)
9690 end
9691 self.hasCategories = true
9692 self.categories[ns] = self.categories[ns] or {}
9693 table.insert(self.categories[ns], cat)
9694end
9695
9696function MessageBox:addClass(class)
9697 if not class then
9698 return nil
9699 end
9700 table.insert(self.classes, class)
9701end
9702
9703function MessageBox:setParameters()
9704 local args = self.args
9705 local cfg = self.cfg
9706
9707 -- Get type data.
9708 self.type = args.type
9709 local typeData = cfg.types[self.type]
9710 self.invalidTypeError = cfg.showInvalidTypeError
9711 and self.type
9712 and not typeData
9713 typeData = typeData or cfg.types[cfg.default]
9714 self.typeClass = typeData.class
9715 self.typeImage = typeData.image
9716
9717 -- Find if the box has been wrongly substituted.
9718 self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
9719
9720 -- Find whether we are using a small message box.
9721 self.isSmall = cfg.allowSmall and (
9722 cfg.smallParam and args.small == cfg.smallParam
9723 or not cfg.smallParam and yesno(args.small)
9724 )
9725
9726 -- Add attributes, classes and styles.
9727 self.id = args.id
9728 if yesno(args.plainlinks) ~= false then
9729 self:addClass('plainlinks')
9730 end
9731 for _, class in ipairs(cfg.classes or {}) do
9732 self:addClass(class)
9733 end
9734 if self.isSmall then
9735 self:addClass(cfg.smallClass or 'mbox-small')
9736 end
9737 self:addClass(self.typeClass)
9738 self:addClass(args.class)
9739 self.style = args.style
9740 self.attrs = args.attrs
9741
9742 -- Set text style.
9743 self.textstyle = args.textstyle
9744
9745 -- Find if we are on the template page or not. This functionality is only
9746 -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
9747 -- and cfg.templateCategoryRequireName are set.
9748 self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
9749 if self.useCollapsibleTextFields
9750 or cfg.templateCategory
9751 and cfg.templateCategoryRequireName
9752 then
9753 self.name = args.name
9754 if self.name then
9755 local templateName = mw.ustring.match(
9756 self.name,
9757 '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
9758 ) or self.name
9759 templateName = 'Template:' .. templateName
9760 self.templateTitle = getTitleObject(templateName)
9761 end
9762 self.isTemplatePage = self.templateTitle
9763 and mw.title.equals(self.title, self.templateTitle)
9764 end
9765
9766 -- Process data for collapsible text fields. At the moment these are only
9767 -- used in {{ambox}}.
9768 if self.useCollapsibleTextFields then
9769 -- Get the self.issue value.
9770 if self.isSmall and args.smalltext then
9771 self.issue = args.smalltext
9772 else
9773 local sect
9774 if args.sect == '' then
9775 sect = 'This ' .. (cfg.sectionDefault or 'page')
9776 elseif type(args.sect) == 'string' then
9777 sect = 'This ' .. args.sect
9778 end
9779 local issue = args.issue
9780 issue = type(issue) == 'string' and issue ~= '' and issue or nil
9781 local text = args.text
9782 text = type(text) == 'string' and text or nil
9783 local issues = {}
9784 table.insert(issues, sect)
9785 table.insert(issues, issue)
9786 table.insert(issues, text)
9787 self.issue = table.concat(issues, ' ')
9788 end
9789
9790 -- Get the self.talk value.
9791 local talk = args.talk
9792 -- Show talk links on the template page or template subpages if the talk
9793 -- parameter is blank.
9794 if talk == ''
9795 and self.templateTitle
9796 and (
9797 mw.title.equals(self.templateTitle, self.title)
9798 or self.title:isSubpageOf(self.templateTitle)
9799 )
9800 then
9801 talk = '#'
9802 elseif talk == '' then
9803 talk = nil
9804 end
9805 if talk then
9806 -- If the talk value is a talk page, make a link to that page. Else
9807 -- assume that it's a section heading, and make a link to the talk
9808 -- page of the current page with that section heading.
9809 local talkTitle = getTitleObject(talk)
9810 local talkArgIsTalkPage = true
9811 if not talkTitle or not talkTitle.isTalkPage then
9812 talkArgIsTalkPage = false
9813 talkTitle = getTitleObject(
9814 self.title.text,
9815 mw.site.namespaces[self.title.namespace].talk.id
9816 )
9817 end
9818 if talkTitle and talkTitle.exists then
9819 local talkText = 'Relevant discussion may be found on'
9820 if talkArgIsTalkPage then
9821 talkText = string.format(
9822 '%s [[%s|%s]].',
9823 talkText,
9824 talk,
9825 talkTitle.prefixedText
9826 )
9827 else
9828 talkText = string.format(
9829 '%s the [[%s#%s|talk page]].',
9830 talkText,
9831 talkTitle.prefixedText,
9832 talk
9833 )
9834 end
9835 self.talk = talkText
9836 end
9837 end
9838
9839 -- Get other values.
9840 self.fix = args.fix ~= '' and args.fix or nil
9841 local date
9842 if args.date and args.date ~= '' then
9843 date = args.date
9844 elseif args.date == '' and self.isTemplatePage then
9845 date = lang:formatDate('F Y')
9846 end
9847 if date then
9848 self.date = string.format(" <small>''(%s)''</small>", date)
9849 end
9850 self.info = args.info
9851 if yesno(args.removalnotice) then
9852 self.removalNotice = cfg.removalNotice
9853 end
9854 end
9855
9856 -- Set the non-collapsible text field. At the moment this is used by all box
9857 -- types other than ambox, and also by ambox when small=yes.
9858 if self.isSmall then
9859 self.text = args.smalltext or args.text
9860 else
9861 self.text = args.text
9862 end
9863
9864 -- Set the below row.
9865 self.below = cfg.below and args.below
9866
9867 -- General image settings.
9868 self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
9869 self.imageEmptyCell = cfg.imageEmptyCell
9870 if cfg.imageEmptyCellStyle then
9871 self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'
9872 end
9873
9874 -- Left image settings.
9875 local imageLeft = self.isSmall and args.smallimage or args.image
9876 if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
9877 or not cfg.imageCheckBlank and imageLeft ~= 'none'
9878 then
9879 self.imageLeft = imageLeft
9880 if not imageLeft then
9881 local imageSize = self.isSmall
9882 and (cfg.imageSmallSize or '30x30px')
9883 or '40x40px'
9884 self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
9885 or 'Imbox notice.png', imageSize)
9886 end
9887 end
9888
9889 -- Right image settings.
9890 local imageRight = self.isSmall and args.smallimageright or args.imageright
9891 if not (cfg.imageRightNone and imageRight == 'none') then
9892 self.imageRight = imageRight
9893 end
9894end
9895
9896function MessageBox:setMainspaceCategories()
9897 local args = self.args
9898 local cfg = self.cfg
9899
9900 if not cfg.allowMainspaceCategories then
9901 return nil
9902 end
9903
9904 local nums = {}
9905 for _, prefix in ipairs{'cat', 'category', 'all'} do
9906 args[prefix .. '1'] = args[prefix]
9907 nums = union(nums, getArgNums(args, prefix))
9908 end
9909
9910 -- The following is roughly equivalent to the old {{Ambox/category}}.
9911 local date = args.date
9912 date = type(date) == 'string' and date
9913 local preposition = 'from'
9914 for _, num in ipairs(nums) do
9915 local mainCat = args['cat' .. tostring(num)]
9916 or args['category' .. tostring(num)]
9917 local allCat = args['all' .. tostring(num)]
9918 mainCat = type(mainCat) == 'string' and mainCat
9919 allCat = type(allCat) == 'string' and allCat
9920 if mainCat and date and date ~= '' then
9921 local catTitle = string.format('%s %s %s', mainCat, preposition, date)
9922 self:addCat(0, catTitle)
9923 catTitle = getTitleObject('Category:' .. catTitle)
9924 if not catTitle or not catTitle.exists then
9925 self:addCat(0, 'Articles with invalid date parameter in template')
9926 end
9927 elseif mainCat and (not date or date == '') then
9928 self:addCat(0, mainCat)
9929 end
9930 if allCat then
9931 self:addCat(0, allCat)
9932 end
9933 end
9934end
9935
9936function MessageBox:setTemplateCategories()
9937 local args = self.args
9938 local cfg = self.cfg
9939
9940 -- Add template categories.
9941 if cfg.templateCategory then
9942 if cfg.templateCategoryRequireName then
9943 if self.isTemplatePage then
9944 self:addCat(10, cfg.templateCategory)
9945 end
9946 elseif not self.title.isSubpage then
9947 self:addCat(10, cfg.templateCategory)
9948 end
9949 end
9950
9951 -- Add template error categories.
9952 if cfg.templateErrorCategory then
9953 local templateErrorCategory = cfg.templateErrorCategory
9954 local templateCat, templateSort
9955 if not self.name and not self.title.isSubpage then
9956 templateCat = templateErrorCategory
9957 elseif self.isTemplatePage then
9958 local paramsToCheck = cfg.templateErrorParamsToCheck or {}
9959 local count = 0
9960 for i, param in ipairs(paramsToCheck) do
9961 if not args[param] then
9962 count = count + 1
9963 end
9964 end
9965 if count > 0 then
9966 templateCat = templateErrorCategory
9967 templateSort = tostring(count)
9968 end
9969 if self.categoryNums and #self.categoryNums > 0 then
9970 templateCat = templateErrorCategory
9971 templateSort = 'C'
9972 end
9973 end
9974 self:addCat(10, templateCat, templateSort)
9975 end
9976end
9977
9978function MessageBox:setAllNamespaceCategories()
9979 -- Set categories for all namespaces.
9980 if self.invalidTypeError then
9981 local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
9982 self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
9983 end
9984 if self.isSubstituted then
9985 self:addCat('all', 'Pages with incorrectly substituted templates')
9986 end
9987end
9988
9989function MessageBox:setCategories()
9990 if self.title.namespace == 0 then
9991 self:setMainspaceCategories()
9992 elseif self.title.namespace == 10 then
9993 self:setTemplateCategories()
9994 end
9995 self:setAllNamespaceCategories()
9996end
9997
9998function MessageBox:renderCategories()
9999 if not self.hasCategories then
10000 -- No categories added, no need to pass them to Category handler so,
10001 -- if it was invoked, it would return the empty string.
10002 -- So we shortcut and return the empty string.
10003 return ""
10004 end
10005 -- Convert category tables to strings and pass them through
10006 -- [[Module:Category handler]].
10007 return require('Module:Category handler')._main{
10008 main = table.concat(self.categories[0] or {}),
10009 template = table.concat(self.categories[10] or {}),
10010 all = table.concat(self.categories.all or {}),
10011 nocat = self.args.nocat,
10012 page = self.args.page
10013 }
10014end
10015
10016function MessageBox:export()
10017 local root = mw.html.create()
10018
10019 -- Add the subst check error.
10020 if self.isSubstituted and self.name then
10021 root:tag('b')
10022 :addClass('error')
10023 :wikitext(string.format(
10024 'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
10025 mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
10026 ))
10027 end
10028
10029 -- Create the box table.
10030 local boxTable = root:tag('table')
10031 boxTable:attr('id', self.id or nil)
10032 for i, class in ipairs(self.classes or {}) do
10033 boxTable:addClass(class or nil)
10034 end
10035 boxTable
10036 :cssText(self.style or nil)
10037 :attr('role', 'presentation')
10038
10039 if self.attrs then
10040 boxTable:attr(self.attrs)
10041 end
10042
10043 -- Add the left-hand image.
10044 local row = boxTable:tag('tr')
10045 if self.imageLeft then
10046 local imageLeftCell = row:tag('td'):addClass('mbox-image')
10047 if self.imageCellDiv then
10048 -- If we are using a div, redefine imageLeftCell so that the image
10049 -- is inside it. Divs use style="width: 52px;", which limits the
10050 -- image width to 52px. If any images in a div are wider than that,
10051 -- they may overlap with the text or cause other display problems.
10052 imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
10053 end
10054 imageLeftCell:wikitext(self.imageLeft or nil)
10055 elseif self.imageEmptyCell then
10056 -- Some message boxes define an empty cell if no image is specified, and
10057 -- some don't. The old template code in templates where empty cells are
10058 -- specified gives the following hint: "No image. Cell with some width
10059 -- or padding necessary for text cell to have 100% width."
10060 row:tag('td')
10061 :addClass('mbox-empty-cell')
10062 :cssText(self.imageEmptyCellStyle or nil)
10063 end
10064
10065 -- Add the text.
10066 local textCell = row:tag('td'):addClass('mbox-text')
10067 if self.useCollapsibleTextFields then
10068 -- The message box uses advanced text parameters that allow things to be
10069 -- collapsible. At the moment, only ambox uses this.
10070 textCell:cssText(self.textstyle or nil)
10071 local textCellDiv = textCell:tag('div')
10072 textCellDiv
10073 :addClass('mbox-text-span')
10074 :wikitext(self.issue or nil)
10075 if (self.talk or self.fix) and not self.isSmall then
10076 textCellDiv:tag('span')
10077 :addClass('hide-when-compact')
10078 :wikitext(self.talk and (' ' .. self.talk) or nil)
10079 :wikitext(self.fix and (' ' .. self.fix) or nil)
10080 end
10081 textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
10082 if self.info and not self.isSmall then
10083 textCellDiv
10084 :tag('span')
10085 :addClass('hide-when-compact')
10086 :wikitext(self.info and (' ' .. self.info) or nil)
10087 end
10088 if self.removalNotice then
10089 textCellDiv:tag('small')
10090 :addClass('hide-when-compact')
10091 :tag('i')
10092 :wikitext(string.format(" (%s)", self.removalNotice))
10093 end
10094 else
10095 -- Default text formatting - anything goes.
10096 textCell
10097 :cssText(self.textstyle or nil)
10098 :wikitext(self.text or nil)
10099 end
10100
10101 -- Add the right-hand image.
10102 if self.imageRight then
10103 local imageRightCell = row:tag('td'):addClass('mbox-imageright')
10104 if self.imageCellDiv then
10105 -- If we are using a div, redefine imageRightCell so that the image
10106 -- is inside it.
10107 imageRightCell = imageRightCell:tag('div'):css('width', '52px')
10108 end
10109 imageRightCell
10110 :wikitext(self.imageRight or nil)
10111 end
10112
10113 -- Add the below row.
10114 if self.below then
10115 boxTable:tag('tr')
10116 :tag('td')
10117 :attr('colspan', self.imageRight and '3' or '2')
10118 :addClass('mbox-text')
10119 :cssText(self.textstyle or nil)
10120 :wikitext(self.below or nil)
10121 end
10122
10123 -- Add error message for invalid type parameters.
10124 if self.invalidTypeError then
10125 root:tag('div')
10126 :css('text-align', 'center')
10127 :wikitext(string.format(
10128 'This message box is using an invalid "type=%s" parameter and needs fixing.',
10129 self.type or ''
10130 ))
10131 end
10132
10133 -- Add categories.
10134 root:wikitext(self:renderCategories() or nil)
10135
10136 return tostring(root)
10137end
10138
10139--------------------------------------------------------------------------------
10140-- Exports
10141--------------------------------------------------------------------------------
10142
10143local p, mt = {}, {}
10144
10145function p._exportClasses()
10146 -- For testing.
10147 return {
10148 MessageBox = MessageBox
10149 }
10150end
10151
10152function p.main(boxType, args, cfgTables)
10153 local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
10154 box:setParameters()
10155 box:setCategories()
10156 return box:export()
10157end
10158
10159function mt.__index(t, k)
10160 return function (frame)
10161 if not getArgs then
10162 getArgs = require('Module:Arguments').getArgs
10163 end
10164 return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
10165 end
10166end
10167
10168return setmetatable(p, mt)</text>
10169 <sha1>6r6gh40ujwjmoo5h9kc5j9ytuxwrvvy</sha1>
10170 </revision>
10171 </page>
10172 <page>
10173 <title>Module:Message box/configuration</title>
10174 <ns>828</ns>
10175 <id>40627038</id>
10176 <revision>
10177 <id>742383738</id>
10178 <parentid>717357572</parentid>
10179 <timestamp>2016-10-03T11:04:13Z</timestamp>
10180 <contributor>
10181 <username>Mr. Stradivarius</username>
10182 <id>4708675</id>
10183 </contributor>
10184 <comment>allow all templates to disable the plainlinks class</comment>
10185 <model>Scribunto</model>
10186 <format>text/plain</format>
10187 <text xml:space="preserve" bytes="6091">--------------------------------------------------------------------------------
10188-- Message box configuration --
10189-- --
10190-- This module contains configuration data for [[Module:Message box]]. --
10191--------------------------------------------------------------------------------
10192
10193return {
10194 ambox = {
10195 types = {
10196 speedy = {
10197 class = 'ambox-speedy',
10198 image = 'Ambox warning pn.svg'
10199 },
10200 delete = {
10201 class = 'ambox-delete',
10202 image = 'Ambox warning pn.svg'
10203 },
10204 content = {
10205 class = 'ambox-content',
10206 image = 'Ambox important.svg'
10207 },
10208 style = {
10209 class = 'ambox-style',
10210 image = 'Edit-clear.svg'
10211 },
10212 move = {
10213 class = 'ambox-move',
10214 image = 'Merge-split-transwiki default.svg'
10215 },
10216 protection = {
10217 class = 'ambox-protection',
10218 image = 'Padlock-silver-medium.svg'
10219 },
10220 notice = {
10221 class = 'ambox-notice',
10222 image = 'Information icon4.svg'
10223 }
10224 },
10225 default = 'notice',
10226 allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
10227 allowSmall = true,
10228 smallParam = 'left',
10229 smallClass = 'mbox-small-left',
10230 substCheck = true,
10231 classes = {'metadata', 'ambox'},
10232 imageEmptyCell = true,
10233 imageCheckBlank = true,
10234 imageSmallSize = '20x20px',
10235 imageCellDiv = true,
10236 useCollapsibleTextFields = true,
10237 imageRightNone = true,
10238 sectionDefault = 'article',
10239 allowMainspaceCategories = true,
10240 templateCategory = 'Article message templates',
10241 templateCategoryRequireName = true,
10242 templateErrorCategory = 'Article message templates with missing parameters',
10243 templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
10244 removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
10245 },
10246
10247 cmbox = {
10248 types = {
10249 speedy = {
10250 class = 'cmbox-speedy',
10251 image = 'Ambox warning pn.svg'
10252 },
10253 delete = {
10254 class = 'cmbox-delete',
10255 image = 'Ambox warning pn.svg'
10256 },
10257 content = {
10258 class = 'cmbox-content',
10259 image = 'Ambox important.svg'
10260 },
10261 style = {
10262 class = 'cmbox-style',
10263 image = 'Edit-clear.svg'
10264 },
10265 move = {
10266 class = 'cmbox-move',
10267 image = 'Merge-split-transwiki default.svg'
10268 },
10269 protection = {
10270 class = 'cmbox-protection',
10271 image = 'Padlock-silver-medium.svg'
10272 },
10273 notice = {
10274 class = 'cmbox-notice',
10275 image = 'Information icon4.svg'
10276 }
10277 },
10278 default = 'notice',
10279 showInvalidTypeError = true,
10280 classes = {'cmbox'},
10281 imageEmptyCell = true
10282 },
10283
10284 fmbox = {
10285 types = {
10286 warning = {
10287 class = 'fmbox-warning',
10288 image = 'Ambox warning pn.svg'
10289 },
10290 editnotice = {
10291 class = 'fmbox-editnotice',
10292 image = 'Information icon4.svg'
10293 },
10294 system = {
10295 class = 'fmbox-system',
10296 image = 'Information icon4.svg'
10297 }
10298 },
10299 default = 'system',
10300 showInvalidTypeError = true,
10301 classes = {'fmbox'},
10302 imageEmptyCell = false,
10303 imageRightNone = false
10304 },
10305
10306 imbox = {
10307 types = {
10308 speedy = {
10309 class = 'imbox-speedy',
10310 image = 'Ambox warning pn.svg'
10311 },
10312 delete = {
10313 class = 'imbox-delete',
10314 image = 'Ambox warning pn.svg'
10315 },
10316 content = {
10317 class = 'imbox-content',
10318 image = 'Ambox important.svg'
10319 },
10320 style = {
10321 class = 'imbox-style',
10322 image = 'Edit-clear.svg'
10323 },
10324 move = {
10325 class = 'imbox-move',
10326 image = 'Merge-split-transwiki default.svg'
10327 },
10328 protection = {
10329 class = 'imbox-protection',
10330 image = 'Padlock-silver-medium.svg'
10331 },
10332 license = {
10333 class = 'imbox-license licensetpl',
10334 image = 'Imbox license.png' -- @todo We need an SVG version of this
10335 },
10336 featured = {
10337 class = 'imbox-featured',
10338 image = 'Cscr-featured.svg'
10339 },
10340 notice = {
10341 class = 'imbox-notice',
10342 image = 'Information icon4.svg'
10343 }
10344 },
10345 default = 'notice',
10346 showInvalidTypeError = true,
10347 classes = {'imbox'},
10348 imageEmptyCell = true,
10349 below = true,
10350 templateCategory = 'File message boxes'
10351 },
10352
10353 ombox = {
10354 types = {
10355 speedy = {
10356 class = 'ombox-speedy',
10357 image = 'Ambox warning pn.svg'
10358 },
10359 delete = {
10360 class = 'ombox-delete',
10361 image = 'Ambox warning pn.svg'
10362 },
10363 content = {
10364 class = 'ombox-content',
10365 image = 'Ambox important.svg'
10366 },
10367 style = {
10368 class = 'ombox-style',
10369 image = 'Edit-clear.svg'
10370 },
10371 move = {
10372 class = 'ombox-move',
10373 image = 'Merge-split-transwiki default.svg'
10374 },
10375 protection = {
10376 class = 'ombox-protection',
10377 image = 'Padlock-silver-medium.svg'
10378 },
10379 notice = {
10380 class = 'ombox-notice',
10381 image = 'Information icon4.svg'
10382 }
10383 },
10384 default = 'notice',
10385 showInvalidTypeError = true,
10386 classes = {'ombox'},
10387 allowSmall = true,
10388 imageEmptyCell = true,
10389 imageRightNone = true
10390 },
10391
10392 tmbox = {
10393 types = {
10394 speedy = {
10395 class = 'tmbox-speedy',
10396 image = 'Ambox warning pn.svg'
10397 },
10398 delete = {
10399 class = 'tmbox-delete',
10400 image = 'Ambox warning pn.svg'
10401 },
10402 content = {
10403 class = 'tmbox-content',
10404 image = 'Ambox important.svg'
10405 },
10406 style = {
10407 class = 'tmbox-style',
10408 image = 'Edit-clear.svg'
10409 },
10410 move = {
10411 class = 'tmbox-move',
10412 image = 'Merge-split-transwiki default.svg'
10413 },
10414 protection = {
10415 class = 'tmbox-protection',
10416 image = 'Padlock-silver-medium.svg'
10417 },
10418 notice = {
10419 class = 'tmbox-notice',
10420 image = 'Information icon4.svg'
10421 }
10422 },
10423 default = 'notice',
10424 showInvalidTypeError = true,
10425 classes = {'tmbox'},
10426 allowSmall = true,
10427 imageRightNone = true,
10428 imageEmptyCell = true,
10429 imageEmptyCellStyle = true,
10430 templateCategory = 'Talk message boxes'
10431 }
10432}</text>
10433 <sha1>16xsc67jviirmw0nf2yuxvotqd7rygq</sha1>
10434 </revision>
10435 </page>
10436 <page>
10437 <title>Module:Navbar</title>
10438 <ns>828</ns>
10439 <id>38827227</id>
10440 <revision>
10441 <id>835774036</id>
10442 <parentid>835562114</parentid>
10443 <timestamp>2018-04-10T17:55:58Z</timestamp>
10444 <contributor>
10445 <username>Primefac</username>
10446 <id>11508456</id>
10447 </contributor>
10448 <comment>another local</comment>
10449 <model>Scribunto</model>
10450 <format>text/plain</format>
10451 <text xml:space="preserve" bytes="3091">local p = {}
10452
10453local getArgs
10454local ul
10455
10456function p.addItem (mini, full, link, descrip, args, url)
10457 local l
10458 if url then
10459 l = {'[', '', ']'}
10460 else
10461 l = {'[[', '|', ']]'}
10462 end
10463 ul:tag('li')
10464 :addClass('nv-'..full)
10465 :wikitext(l[1] .. link .. l[2])
10466 :tag(args.mini and 'abbr' or 'span')
10467 :attr('title', descrip..' this template')
10468 :cssText(args.fontstyle)
10469 :wikitext(args.mini and mini or full)
10470 :done()
10471 :wikitext(l[3])
10472end
10473
10474function p.brackets (position, c, args, div)
10475 if args.brackets then
10476 div
10477 :tag('span')
10478 :css('margin-'..position, '-0.125em')
10479 :cssText(args.fontstyle)
10480 :wikitext(c)
10481 end
10482end
10483
10484function p._navbar(args)
10485 local show = {true, true, true, false, false, false}
10486 local titleArg = 1
10487
10488 if args.collapsible then
10489 titleArg = 2
10490 if not args.plain then args.mini = 1 end
10491 if args.fontcolor then
10492 args.fontstyle = 'color:' .. args.fontcolor .. ';'
10493 end
10494 args.style = 'float:left; text-align:left'
10495 end
10496
10497 if args.template then
10498 titleArg = 'template'
10499 show = {true, false, false, false, false, false}
10500 local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6, talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
10501 for k,v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
10502 local num = index[v]
10503 if num then show[num] = true end
10504 end
10505 end
10506
10507 if args.noedit then show[3] = false end
10508
10509 local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
10510 local title = mw.title.new(mw.text.trim(titleText), 'Template')
10511 if not title then
10512 error('Invalid title ' .. titleText)
10513 end
10514 local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
10515
10516 local div = mw.html.create():tag('div')
10517 div
10518 :addClass('plainlinks')
10519 :addClass('hlist')
10520 :addClass('navbar')
10521 :cssText(args.style)
10522
10523 if args.mini then div:addClass('mini') end
10524
10525 if not (args.mini or args.plain) then
10526 div
10527 :tag('span')
10528 :css('word-spacing', 0)
10529 :cssText(args.fontstyle)
10530 :wikitext(args.text or 'This box:')
10531 :wikitext(' ')
10532 end
10533
10534 p.brackets('right', '&#91; ', args, div)
10535
10536 ul = div:tag('ul')
10537 if show[1] then p.addItem('v', 'view', title.fullText, 'View', args) end
10538 if show[2] then p.addItem('t', 'talk', talkpage, 'Discuss', args) end
10539 if show[3] then p.addItem('e', 'edit', title:fullUrl('action=edit'), 'Edit', args, true) end
10540 if show[4] then p.addItem('h', 'hist', title:fullUrl('action=history'), 'History of', args, true) end
10541 if show[5] then
10542 local move = mw.title.new ('Special:Movepage')
10543 p.addItem('m', 'move', move:fullUrl('target='..title.fullText), 'Move', args, true) end
10544 if show[6] then p.addItem('w', 'watch', title:fullUrl('action=watch'), 'Watch', args, true) end
10545
10546 p.brackets('left', ' &#93;', args, div)
10547
10548 if args.collapsible then
10549 div
10550 :done()
10551 :tag('div')
10552 :css('font-size', '114%')
10553 :css('margin', args.mini and '0 4em' or '0 7em')
10554 :cssText(args.fontstyle)
10555 :wikitext(args[1])
10556 end
10557
10558 return tostring(div:done())
10559end
10560
10561function p.navbar(frame)
10562 if not getArgs then
10563 getArgs = require('Module:Arguments').getArgs
10564 end
10565 return p._navbar(getArgs(frame))
10566end
10567
10568return p</text>
10569 <sha1>0kto9e56pycr6rz0vadnqvghkpm06x9</sha1>
10570 </revision>
10571 </page>
10572 <page>
10573 <title>Module:No globals</title>
10574 <ns>828</ns>
10575 <id>42567026</id>
10576 <revision>
10577 <id>606781024</id>
10578 <parentid>605595284</parentid>
10579 <timestamp>2014-05-02T15:35:56Z</timestamp>
10580 <contributor>
10581 <username>Jackmcbarn</username>
10582 <id>19285809</id>
10583 </contributor>
10584 <comment>rm name exception</comment>
10585 <model>Scribunto</model>
10586 <format>text/plain</format>
10587 <text xml:space="preserve" bytes="307">local mt = getmetatable(_G) or {}
10588function mt.__index (t, k)
10589 if k ~= 'arg' then
10590 error('Tried to read nil global ' .. tostring(k), 2)
10591 end
10592 return nil
10593end
10594function mt.__newindex(t, k, v)
10595 if k ~= 'arg' then
10596 error('Tried to write global ' .. tostring(k), 2)
10597 end
10598 rawset(t, k, v)
10599end
10600setmetatable(_G, mt)</text>
10601 <sha1>gggsv54pq7f94l3up48hr91qtxnskdm</sha1>
10602 </revision>
10603 </page>
10604 <page>
10605 <title>Module:Parameter names example</title>
10606 <ns>828</ns>
10607 <id>43325707</id>
10608 <revision>
10609 <id>804712407</id>
10610 <parentid>625611091</parentid>
10611 <timestamp>2017-10-10T17:47:29Z</timestamp>
10612 <contributor>
10613 <username>MusikAnimal</username>
10614 <id>14882394</id>
10615 </contributor>
10616 <minor/>
10617 <comment>Protected "[[Module:Parameter names example]]": [[WP:High-risk templates|High-risk Lua module]]; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))</comment>
10618 <model>Scribunto</model>
10619 <format>text/plain</format>
10620 <text xml:space="preserve" bytes="1521">-- This module implements {{parameter names example}}.
10621
10622local p = {}
10623
10624local function makeParam(s)
10625 local lb = '&#123;'
10626 local rb = '&#125;'
10627 return lb:rep(3) .. s .. rb:rep(3)
10628end
10629
10630local function italicize(s)
10631 return "''" .. s .. "''"
10632end
10633
10634local function plain(s)
10635 return s
10636end
10637
10638function p._main(args, frame)
10639 -- Find how we want to format the arguments to the template.
10640 local formatFunc
10641 if args._display == 'italics' or args._display == 'italic' then
10642 formatFunc = italicize
10643 elseif args._display == 'plain' then
10644 formatFunc = plain
10645 else
10646 formatFunc = makeParam
10647 end
10648
10649 -- Build the table of template arguments.
10650 local targs = {}
10651 for k, v in pairs(args) do
10652 if type(k) == 'number' then
10653 targs[v] = formatFunc(v)
10654 elseif not k:find('^_') then
10655 targs[k] = v
10656 end
10657 end
10658
10659 -- Find the template name.
10660 local template
10661 if args._template then
10662 template = args._template
10663 else
10664 local currentTitle = mw.title.getCurrentTitle()
10665 if currentTitle.prefixedText:find('/sandbox$') then
10666 template = currentTitle.prefixedText
10667 else
10668 template = currentTitle.basePageTitle.prefixedText
10669 end
10670 end
10671
10672 -- Call the template with the arguments.
10673 frame = frame or mw.getCurrentFrame()
10674 local success, result = pcall(
10675 frame.expandTemplate,
10676 frame,
10677 {title = template, args = targs}
10678 )
10679 if success then
10680 return result
10681 else
10682 return ''
10683 end
10684end
10685
10686function p.main(frame)
10687 local args = require('Module:Arguments').getArgs(frame, {
10688 wrappers = 'Template:Parameter names example'
10689 })
10690 return p._main(args, frame)
10691end
10692
10693return p</text>
10694 <sha1>6o7ema5t5ok6u2ticvu2qjmkbqsdz1n</sha1>
10695 </revision>
10696 </page>
10697 <page>
10698 <title>Module:Protection banner</title>
10699 <ns>828</ns>
10700 <id>42040984</id>
10701 <revision>
10702 <id>741795115</id>
10703 <parentid>732908599</parentid>
10704 <timestamp>2016-09-29T18:32:41Z</timestamp>
10705 <contributor>
10706 <username>Cenarium</username>
10707 <id>5711305</id>
10708 </contributor>
10709 <comment>remove expiry param (now also automatically retrieved for autoreview) and needsexpiry check</comment>
10710 <model>Scribunto</model>
10711 <format>text/plain</format>
10712 <text xml:space="preserve" bytes="25486">-- This module implements {{pp-meta}} and its daughter templates such as
10713-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
10714
10715-- Initialise necessary modules.
10716require('Module:No globals')
10717local makeFileLink = require('Module:File link')._main
10718local effectiveProtectionLevel = require('Module:Effective protection level')._main
10719local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
10720local yesno = require('Module:Yesno')
10721
10722-- Lazily initialise modules and objects we don't always need.
10723local getArgs, makeMessageBox, lang
10724
10725-- Set constants.
10726local CONFIG_MODULE = 'Module:Protection banner/config'
10727
10728--------------------------------------------------------------------------------
10729-- Helper functions
10730--------------------------------------------------------------------------------
10731
10732local function makeCategoryLink(cat, sort)
10733 if cat then
10734 return string.format(
10735 '[[%s:%s|%s]]',
10736 mw.site.namespaces[14].name,
10737 cat,
10738 sort
10739 )
10740 end
10741end
10742
10743-- Validation function for the expiry and the protection date
10744local function validateDate(dateString, dateType)
10745 if not lang then
10746 lang = mw.language.getContentLanguage()
10747 end
10748 local success, result = pcall(lang.formatDate, lang, 'U', dateString)
10749 if success then
10750 result = tonumber(result)
10751 if result then
10752 return result
10753 end
10754 end
10755 error(string.format(
10756 'invalid %s: %s',
10757 dateType,
10758 tostring(dateString)
10759 ), 4)
10760end
10761
10762local function makeFullUrl(page, query, display)
10763 return string.format(
10764 '[%s %s]',
10765 tostring(mw.uri.fullUrl(page, query)),
10766 display
10767 )
10768end
10769
10770-- Given a directed graph formatted as node -> table of direct successors,
10771-- get a table of all nodes reachable from a given node (though always
10772-- including the given node).
10773local function getReachableNodes(graph, start)
10774 local toWalk, retval = {[start] = true}, {}
10775 while true do
10776 -- Can't use pairs() since we're adding and removing things as we're iterating
10777 local k = next(toWalk) -- This always gets the "first" key
10778 if k == nil then
10779 return retval
10780 end
10781 toWalk[k] = nil
10782 retval[k] = true
10783 for _,v in ipairs(graph[k]) do
10784 if not retval[v] then
10785 toWalk[v] = true
10786 end
10787 end
10788 end
10789end
10790
10791--------------------------------------------------------------------------------
10792-- Protection class
10793--------------------------------------------------------------------------------
10794
10795local Protection = {}
10796Protection.__index = Protection
10797
10798Protection.supportedActions = {
10799 edit = true,
10800 move = true,
10801 autoreview = true,
10802 upload = true
10803}
10804
10805Protection.bannerConfigFields = {
10806 'text',
10807 'explanation',
10808 'tooltip',
10809 'alt',
10810 'link',
10811 'image'
10812}
10813
10814function Protection.new(args, cfg, title)
10815 local obj = {}
10816 obj._cfg = cfg
10817 obj.title = title or mw.title.getCurrentTitle()
10818
10819 -- Set action
10820 if not args.action then
10821 obj.action = 'edit'
10822 elseif Protection.supportedActions[args.action] then
10823 obj.action = args.action
10824 else
10825 error(string.format(
10826 'invalid action: %s',
10827 tostring(args.action)
10828 ), 3)
10829 end
10830
10831 -- Set level
10832 obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
10833 if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
10834 -- Users need to be autoconfirmed to move pages anyway, so treat
10835 -- semi-move-protected pages as unprotected.
10836 obj.level = '*'
10837 end
10838
10839 -- Set expiry
10840 local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
10841 if effectiveExpiry == 'infinity' then
10842 obj.expiry = 'indef'
10843 elseif effectiveExpiry ~= 'unknown' then
10844 obj.expiry = validateDate(effectiveExpiry, 'expiry date')
10845 end
10846
10847 -- Set reason
10848 if args[1] then
10849 obj.reason = mw.ustring.lower(args[1])
10850 if obj.reason:find('|') then
10851 error('reasons cannot contain the pipe character ("|")', 3)
10852 end
10853 end
10854
10855 -- Set protection date
10856 if args.date then
10857 obj.protectionDate = validateDate(args.date, 'protection date')
10858 end
10859
10860 -- Set banner config
10861 do
10862 obj.bannerConfig = {}
10863 local configTables = {}
10864 if cfg.banners[obj.action] then
10865 configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
10866 end
10867 if cfg.defaultBanners[obj.action] then
10868 configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
10869 configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
10870 end
10871 configTables[#configTables + 1] = cfg.masterBanner
10872 for i, field in ipairs(Protection.bannerConfigFields) do
10873 for j, t in ipairs(configTables) do
10874 if t[field] then
10875 obj.bannerConfig[field] = t[field]
10876 break
10877 end
10878 end
10879 end
10880 end
10881 return setmetatable(obj, Protection)
10882end
10883
10884function Protection:isProtected()
10885 return self.level ~= '*'
10886end
10887
10888function Protection:isTemporary()
10889 return type(self.expiry) == 'number'
10890end
10891
10892function Protection:makeProtectionCategory()
10893 local cfg = self._cfg
10894 local title = self.title
10895
10896 -- Exit if the page is not protected.
10897 if not self:isProtected() then
10898 return ''
10899 end
10900
10901 -- Get the expiry key fragment.
10902 local expiryFragment
10903 if self.expiry == 'indef' then
10904 expiryFragment = self.expiry
10905 elseif type(self.expiry) == 'number' then
10906 expiryFragment = 'temp'
10907 end
10908
10909 -- Get the namespace key fragment.
10910 local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
10911 if not namespaceFragment and title.namespace % 2 == 1 then
10912 namespaceFragment = 'talk'
10913 end
10914
10915 -- Define the order that key fragments are tested in. This is done with an
10916 -- array of tables containing the value to be tested, along with its
10917 -- position in the cfg.protectionCategories table.
10918 local order = {
10919 {val = expiryFragment, keypos = 1},
10920 {val = namespaceFragment, keypos = 2},
10921 {val = self.reason, keypos = 3},
10922 {val = self.level, keypos = 4},
10923 {val = self.action, keypos = 5}
10924 }
10925
10926 --[[
10927 -- The old protection templates used an ad-hoc protection category system,
10928 -- with some templates prioritising namespaces in their categories, and
10929 -- others prioritising the protection reason. To emulate this in this module
10930 -- we use the config table cfg.reasonsWithNamespacePriority to set the
10931 -- reasons for which namespaces have priority over protection reason.
10932 -- If we are dealing with one of those reasons, move the namespace table to
10933 -- the end of the order table, i.e. give it highest priority. If not, the
10934 -- reason should have highest priority, so move that to the end of the table
10935 -- instead.
10936 --]]
10937 table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
10938
10939 --[[
10940 -- Define the attempt order. Inactive subtables (subtables with nil "value"
10941 -- fields) are moved to the end, where they will later be given the key
10942 -- "all". This is to cut down on the number of table lookups in
10943 -- cfg.protectionCategories, which grows exponentially with the number of
10944 -- non-nil keys. We keep track of the number of active subtables with the
10945 -- noActive parameter.
10946 --]]
10947 local noActive, attemptOrder
10948 do
10949 local active, inactive = {}, {}
10950 for i, t in ipairs(order) do
10951 if t.val then
10952 active[#active + 1] = t
10953 else
10954 inactive[#inactive + 1] = t
10955 end
10956 end
10957 noActive = #active
10958 attemptOrder = active
10959 for i, t in ipairs(inactive) do
10960 attemptOrder[#attemptOrder + 1] = t
10961 end
10962 end
10963
10964 --[[
10965 -- Check increasingly generic key combinations until we find a match. If a
10966 -- specific category exists for the combination of key fragments we are
10967 -- given, that match will be found first. If not, we keep trying different
10968 -- key fragment combinations until we match using the key
10969 -- "all-all-all-all-all".
10970 --
10971 -- To generate the keys, we index the key subtables using a binary matrix
10972 -- with indexes i and j. j is only calculated up to the number of active
10973 -- subtables. For example, if there were three active subtables, the matrix
10974 -- would look like this, with 0 corresponding to the key fragment "all", and
10975 -- 1 corresponding to other key fragments.
10976 --
10977 -- j 1 2 3
10978 -- i
10979 -- 1 1 1 1
10980 -- 2 0 1 1
10981 -- 3 1 0 1
10982 -- 4 0 0 1
10983 -- 5 1 1 0
10984 -- 6 0 1 0
10985 -- 7 1 0 0
10986 -- 8 0 0 0
10987 --
10988 -- Values of j higher than the number of active subtables are set
10989 -- to the string "all".
10990 --
10991 -- A key for cfg.protectionCategories is constructed for each value of i.
10992 -- The position of the value in the key is determined by the keypos field in
10993 -- each subtable.
10994 --]]
10995 local cats = cfg.protectionCategories
10996 for i = 1, 2^noActive do
10997 local key = {}
10998 for j, t in ipairs(attemptOrder) do
10999 if j > noActive then
11000 key[t.keypos] = 'all'
11001 else
11002 local quotient = i / 2 ^ (j - 1)
11003 quotient = math.ceil(quotient)
11004 if quotient % 2 == 1 then
11005 key[t.keypos] = t.val
11006 else
11007 key[t.keypos] = 'all'
11008 end
11009 end
11010 end
11011 key = table.concat(key, '|')
11012 local attempt = cats[key]
11013 if attempt then
11014 return makeCategoryLink(attempt, title.text)
11015 end
11016 end
11017 return ''
11018end
11019
11020function Protection:isIncorrect()
11021 local expiry = self.expiry
11022 return not self:isProtected()
11023 or type(expiry) == 'number' and expiry < os.time()
11024end
11025
11026function Protection:isTemplateProtectedNonTemplate()
11027 local action, namespace = self.action, self.title.namespace
11028 return self.level == 'templateeditor'
11029 and (
11030 (action ~= 'edit' and action ~= 'move')
11031 or (namespace ~= 10 and namespace ~= 828)
11032 )
11033end
11034
11035function Protection:makeCategoryLinks()
11036 local msg = self._cfg.msg
11037 local ret = { self:makeProtectionCategory() }
11038 if self:isIncorrect() then
11039 ret[#ret + 1] = makeCategoryLink(
11040 msg['tracking-category-incorrect'],
11041 self.title.text
11042 )
11043 end
11044 if self:isTemplateProtectedNonTemplate() then
11045 ret[#ret + 1] = makeCategoryLink(
11046 msg['tracking-category-template'],
11047 self.title.text
11048 )
11049 end
11050 return table.concat(ret)
11051end
11052
11053--------------------------------------------------------------------------------
11054-- Blurb class
11055--------------------------------------------------------------------------------
11056
11057local Blurb = {}
11058Blurb.__index = Blurb
11059
11060Blurb.bannerTextFields = {
11061 text = true,
11062 explanation = true,
11063 tooltip = true,
11064 alt = true,
11065 link = true
11066}
11067
11068function Blurb.new(protectionObj, args, cfg)
11069 return setmetatable({
11070 _cfg = cfg,
11071 _protectionObj = protectionObj,
11072 _args = args
11073 }, Blurb)
11074end
11075
11076-- Private methods --
11077
11078function Blurb:_formatDate(num)
11079 -- Formats a Unix timestamp into dd Month, YYYY format.
11080 lang = lang or mw.language.getContentLanguage()
11081 local success, date = pcall(
11082 lang.formatDate,
11083 lang,
11084 self._cfg.msg['expiry-date-format'] or 'j F Y',
11085 '@' .. tostring(num)
11086 )
11087 if success then
11088 return date
11089 end
11090end
11091
11092function Blurb:_getExpandedMessage(msgKey)
11093 return self:_substituteParameters(self._cfg.msg[msgKey])
11094end
11095
11096function Blurb:_substituteParameters(msg)
11097 if not self._params then
11098 local parameterFuncs = {}
11099
11100 parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
11101 parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
11102 parameterFuncs.EXPIRY = self._makeExpiryParameter
11103 parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
11104 parameterFuncs.IMAGELINK = self._makeImageLinkParameter
11105 parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
11106 parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
11107 parameterFuncs.PAGETYPE = self._makePagetypeParameter
11108 parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
11109 parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
11110 parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
11111 parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
11112 parameterFuncs.TALKPAGE = self._makeTalkPageParameter
11113 parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
11114 parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
11115 parameterFuncs.VANDAL = self._makeVandalTemplateParameter
11116
11117 self._params = setmetatable({}, {
11118 __index = function (t, k)
11119 local param
11120 if parameterFuncs[k] then
11121 param = parameterFuncs[k](self)
11122 end
11123 param = param or ''
11124 t[k] = param
11125 return param
11126 end
11127 })
11128 end
11129
11130 msg = msg:gsub('${(%u+)}', self._params)
11131 return msg
11132end
11133
11134function Blurb:_makeCurrentVersionParameter()
11135 -- A link to the page history or the move log, depending on the kind of
11136 -- protection.
11137 local pagename = self._protectionObj.title.prefixedText
11138 if self._protectionObj.action == 'move' then
11139 -- We need the move log link.
11140 return makeFullUrl(
11141 'Special:Log',
11142 {type = 'move', page = pagename},
11143 self:_getExpandedMessage('current-version-move-display')
11144 )
11145 else
11146 -- We need the history link.
11147 return makeFullUrl(
11148 pagename,
11149 {action = 'history'},
11150 self:_getExpandedMessage('current-version-edit-display')
11151 )
11152 end
11153end
11154
11155function Blurb:_makeEditRequestParameter()
11156 local mEditRequest = require('Module:Submit an edit request')
11157 local action = self._protectionObj.action
11158 local level = self._protectionObj.level
11159
11160 -- Get the edit request type.
11161 local requestType
11162 if action == 'edit' then
11163 if level == 'autoconfirmed' then
11164 requestType = 'semi'
11165 elseif level == 'extendedconfirmed' then
11166 requestType = 'extended'
11167 elseif level == 'templateeditor' then
11168 requestType = 'template'
11169 end
11170 end
11171 requestType = requestType or 'full'
11172
11173 -- Get the display value.
11174 local display = self:_getExpandedMessage('edit-request-display')
11175
11176 return mEditRequest._link{type = requestType, display = display}
11177end
11178
11179function Blurb:_makeExpiryParameter()
11180 local expiry = self._protectionObj.expiry
11181 if type(expiry) == 'number' then
11182 return self:_formatDate(expiry)
11183 else
11184 return expiry
11185 end
11186end
11187
11188function Blurb:_makeExplanationBlurbParameter()
11189 -- Cover special cases first.
11190 if self._protectionObj.title.namespace == 8 then
11191 -- MediaWiki namespace
11192 return self:_getExpandedMessage('explanation-blurb-nounprotect')
11193 end
11194
11195 -- Get explanation blurb table keys
11196 local action = self._protectionObj.action
11197 local level = self._protectionObj.level
11198 local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
11199
11200 -- Find the message in the explanation blurb table and substitute any
11201 -- parameters.
11202 local explanations = self._cfg.explanationBlurbs
11203 local msg
11204 if explanations[action][level] and explanations[action][level][talkKey] then
11205 msg = explanations[action][level][talkKey]
11206 elseif explanations[action][level] and explanations[action][level].default then
11207 msg = explanations[action][level].default
11208 elseif explanations[action].default and explanations[action].default[talkKey] then
11209 msg = explanations[action].default[talkKey]
11210 elseif explanations[action].default and explanations[action].default.default then
11211 msg = explanations[action].default.default
11212 else
11213 error(string.format(
11214 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
11215 action,
11216 level,
11217 talkKey
11218 ), 8)
11219 end
11220 return self:_substituteParameters(msg)
11221end
11222
11223function Blurb:_makeImageLinkParameter()
11224 local imageLinks = self._cfg.imageLinks
11225 local action = self._protectionObj.action
11226 local level = self._protectionObj.level
11227 local msg
11228 if imageLinks[action][level] then
11229 msg = imageLinks[action][level]
11230 elseif imageLinks[action].default then
11231 msg = imageLinks[action].default
11232 else
11233 msg = imageLinks.edit.default
11234 end
11235 return self:_substituteParameters(msg)
11236end
11237
11238function Blurb:_makeIntroBlurbParameter()
11239 if self._protectionObj:isTemporary() then
11240 return self:_getExpandedMessage('intro-blurb-expiry')
11241 else
11242 return self:_getExpandedMessage('intro-blurb-noexpiry')
11243 end
11244end
11245
11246function Blurb:_makeIntroFragmentParameter()
11247 if self._protectionObj:isTemporary() then
11248 return self:_getExpandedMessage('intro-fragment-expiry')
11249 else
11250 return self:_getExpandedMessage('intro-fragment-noexpiry')
11251 end
11252end
11253
11254function Blurb:_makePagetypeParameter()
11255 local pagetypes = self._cfg.pagetypes
11256 return pagetypes[self._protectionObj.title.namespace]
11257 or pagetypes.default
11258 or error('no default pagetype defined', 8)
11259end
11260
11261function Blurb:_makeProtectionBlurbParameter()
11262 local protectionBlurbs = self._cfg.protectionBlurbs
11263 local action = self._protectionObj.action
11264 local level = self._protectionObj.level
11265 local msg
11266 if protectionBlurbs[action][level] then
11267 msg = protectionBlurbs[action][level]
11268 elseif protectionBlurbs[action].default then
11269 msg = protectionBlurbs[action].default
11270 elseif protectionBlurbs.edit.default then
11271 msg = protectionBlurbs.edit.default
11272 else
11273 error('no protection blurb defined for protectionBlurbs.edit.default', 8)
11274 end
11275 return self:_substituteParameters(msg)
11276end
11277
11278function Blurb:_makeProtectionDateParameter()
11279 local protectionDate = self._protectionObj.protectionDate
11280 if type(protectionDate) == 'number' then
11281 return self:_formatDate(protectionDate)
11282 else
11283 return protectionDate
11284 end
11285end
11286
11287function Blurb:_makeProtectionLevelParameter()
11288 local protectionLevels = self._cfg.protectionLevels
11289 local action = self._protectionObj.action
11290 local level = self._protectionObj.level
11291 local msg
11292 if protectionLevels[action][level] then
11293 msg = protectionLevels[action][level]
11294 elseif protectionLevels[action].default then
11295 msg = protectionLevels[action].default
11296 elseif protectionLevels.edit.default then
11297 msg = protectionLevels.edit.default
11298 else
11299 error('no protection level defined for protectionLevels.edit.default', 8)
11300 end
11301 return self:_substituteParameters(msg)
11302end
11303
11304function Blurb:_makeProtectionLogParameter()
11305 local pagename = self._protectionObj.title.prefixedText
11306 if self._protectionObj.action == 'autoreview' then
11307 -- We need the pending changes log.
11308 return makeFullUrl(
11309 'Special:Log',
11310 {type = 'stable', page = pagename},
11311 self:_getExpandedMessage('pc-log-display')
11312 )
11313 else
11314 -- We need the protection log.
11315 return makeFullUrl(
11316 'Special:Log',
11317 {type = 'protect', page = pagename},
11318 self:_getExpandedMessage('protection-log-display')
11319 )
11320 end
11321end
11322
11323function Blurb:_makeTalkPageParameter()
11324 return string.format(
11325 '[[%s:%s#%s|%s]]',
11326 mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
11327 self._protectionObj.title.text,
11328 self._args.section or 'top',
11329 self:_getExpandedMessage('talk-page-link-display')
11330 )
11331end
11332
11333function Blurb:_makeTooltipBlurbParameter()
11334 if self._protectionObj:isTemporary() then
11335 return self:_getExpandedMessage('tooltip-blurb-expiry')
11336 else
11337 return self:_getExpandedMessage('tooltip-blurb-noexpiry')
11338 end
11339end
11340
11341function Blurb:_makeTooltipFragmentParameter()
11342 if self._protectionObj:isTemporary() then
11343 return self:_getExpandedMessage('tooltip-fragment-expiry')
11344 else
11345 return self:_getExpandedMessage('tooltip-fragment-noexpiry')
11346 end
11347end
11348
11349function Blurb:_makeVandalTemplateParameter()
11350 return require('Module:Vandal-m')._main{
11351 self._args.user or self._protectionObj.title.baseText
11352 }
11353end
11354
11355-- Public methods --
11356
11357function Blurb:makeBannerText(key)
11358 -- Validate input.
11359 if not key or not Blurb.bannerTextFields[key] then
11360 error(string.format(
11361 '"%s" is not a valid banner config field',
11362 tostring(key)
11363 ), 2)
11364 end
11365
11366 -- Generate the text.
11367 local msg = self._protectionObj.bannerConfig[key]
11368 if type(msg) == 'string' then
11369 return self:_substituteParameters(msg)
11370 elseif type(msg) == 'function' then
11371 msg = msg(self._protectionObj, self._args)
11372 if type(msg) ~= 'string' then
11373 error(string.format(
11374 'bad output from banner config function with key "%s"'
11375 .. ' (expected string, got %s)',
11376 tostring(key),
11377 type(msg)
11378 ), 4)
11379 end
11380 return self:_substituteParameters(msg)
11381 end
11382end
11383
11384--------------------------------------------------------------------------------
11385-- BannerTemplate class
11386--------------------------------------------------------------------------------
11387
11388local BannerTemplate = {}
11389BannerTemplate.__index = BannerTemplate
11390
11391function BannerTemplate.new(protectionObj, cfg)
11392 local obj = {}
11393 obj._cfg = cfg
11394
11395 -- Set the image filename.
11396 local imageFilename = protectionObj.bannerConfig.image
11397 if imageFilename then
11398 obj._imageFilename = imageFilename
11399 else
11400 -- If an image filename isn't specified explicitly in the banner config,
11401 -- generate it from the protection status and the namespace.
11402 local action = protectionObj.action
11403 local level = protectionObj.level
11404 local namespace = protectionObj.title.namespace
11405 local reason = protectionObj.reason
11406
11407 -- Deal with special cases first.
11408 if (
11409 namespace == 10
11410 or namespace == 828
11411 or reason and obj._cfg.indefImageReasons[reason]
11412 )
11413 and action == 'edit'
11414 and level == 'sysop'
11415 and not protectionObj:isTemporary()
11416 then
11417 -- Fully protected modules and templates get the special red "indef"
11418 -- padlock.
11419 obj._imageFilename = obj._cfg.msg['image-filename-indef']
11420 else
11421 -- Deal with regular protection types.
11422 local images = obj._cfg.images
11423 if images[action] then
11424 if images[action][level] then
11425 obj._imageFilename = images[action][level]
11426 elseif images[action].default then
11427 obj._imageFilename = images[action].default
11428 end
11429 end
11430 end
11431 end
11432 return setmetatable(obj, BannerTemplate)
11433end
11434
11435function BannerTemplate:renderImage()
11436 local filename = self._imageFilename
11437 or self._cfg.msg['image-filename-default']
11438 or 'Transparent.gif'
11439 return makeFileLink{
11440 file = filename,
11441 size = (self.imageWidth or 20) .. 'px',
11442 alt = self._imageAlt,
11443 link = self._imageLink,
11444 caption = self.imageCaption
11445 }
11446end
11447
11448--------------------------------------------------------------------------------
11449-- Banner class
11450--------------------------------------------------------------------------------
11451
11452local Banner = setmetatable({}, BannerTemplate)
11453Banner.__index = Banner
11454
11455function Banner.new(protectionObj, blurbObj, cfg)
11456 local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
11457 obj.imageWidth = 40
11458 obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
11459 obj._reasonText = blurbObj:makeBannerText('text')
11460 obj._explanationText = blurbObj:makeBannerText('explanation')
11461 obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
11462 return setmetatable(obj, Banner)
11463end
11464
11465function Banner:__tostring()
11466 -- Renders the banner.
11467 makeMessageBox = makeMessageBox or require('Module:Message box').main
11468 local reasonText = self._reasonText or error('no reason text set', 2)
11469 local explanationText = self._explanationText
11470 local mbargs = {
11471 page = self._page,
11472 type = 'protection',
11473 image = self:renderImage(),
11474 text = string.format(
11475 "'''%s'''%s",
11476 reasonText,
11477 explanationText and '<br />' .. explanationText or ''
11478 )
11479 }
11480 return makeMessageBox('mbox', mbargs)
11481end
11482
11483--------------------------------------------------------------------------------
11484-- Padlock class
11485--------------------------------------------------------------------------------
11486
11487local Padlock = setmetatable({}, BannerTemplate)
11488Padlock.__index = Padlock
11489
11490function Padlock.new(protectionObj, blurbObj, cfg)
11491 local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
11492 obj.imageWidth = 20
11493 obj.imageCaption = blurbObj:makeBannerText('tooltip')
11494 obj._imageAlt = blurbObj:makeBannerText('alt')
11495 obj._imageLink = blurbObj:makeBannerText('link')
11496 obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
11497 or cfg.padlockIndicatorNames.default
11498 or 'pp-default'
11499 return setmetatable(obj, Padlock)
11500end
11501
11502function Padlock:__tostring()
11503 local frame = mw.getCurrentFrame()
11504 -- The nowiki tag helps prevent whitespace at the top of articles.
11505 return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
11506 name = 'indicator',
11507 args = {name = self._indicatorName},
11508 content = self:renderImage()
11509 }
11510end
11511
11512--------------------------------------------------------------------------------
11513-- Exports
11514--------------------------------------------------------------------------------
11515
11516local p = {}
11517
11518function p._exportClasses()
11519 -- This is used for testing purposes.
11520 return {
11521 Protection = Protection,
11522 Blurb = Blurb,
11523 BannerTemplate = BannerTemplate,
11524 Banner = Banner,
11525 Padlock = Padlock,
11526 }
11527end
11528
11529function p._main(args, cfg, title)
11530 args = args or {}
11531 cfg = cfg or require(CONFIG_MODULE)
11532
11533 local protectionObj = Protection.new(args, cfg, title)
11534
11535 local ret = {}
11536
11537 -- If a page's edit protection is equally or more restrictive than its
11538 -- protection from some other action, then don't bother displaying anything
11539 -- for the other action (except categories).
11540 if protectionObj.action == 'edit' or
11541 args.demolevel or
11542 not getReachableNodes(
11543 cfg.hierarchy,
11544 protectionObj.level
11545 )[effectiveProtectionLevel('edit', protectionObj.title)]
11546 then
11547 -- Initialise the blurb object
11548 local blurbObj = Blurb.new(protectionObj, args, cfg)
11549
11550 -- Render the banner
11551 if protectionObj:isProtected() then
11552 ret[#ret + 1] = tostring(
11553 (yesno(args.small) and Padlock or Banner)
11554 .new(protectionObj, blurbObj, cfg)
11555 )
11556 end
11557 end
11558
11559 -- Render the categories
11560 if yesno(args.category) ~= false then
11561 ret[#ret + 1] = protectionObj:makeCategoryLinks()
11562 end
11563
11564 return table.concat(ret)
11565end
11566
11567function p.main(frame, cfg)
11568 cfg = cfg or require(CONFIG_MODULE)
11569
11570 -- Find default args, if any.
11571 local parent = frame.getParent and frame:getParent()
11572 local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
11573
11574 -- Find user args, and use the parent frame if we are being called from a
11575 -- wrapper template.
11576 getArgs = getArgs or require('Module:Arguments').getArgs
11577 local userArgs = getArgs(frame, {
11578 parentOnly = defaultArgs,
11579 frameOnly = not defaultArgs
11580 })
11581
11582 -- Build the args table. User-specified args overwrite default args.
11583 local args = {}
11584 for k, v in pairs(defaultArgs or {}) do
11585 args[k] = v
11586 end
11587 for k, v in pairs(userArgs) do
11588 args[k] = v
11589 end
11590 return p._main(args, cfg)
11591end
11592
11593return p</text>
11594 <sha1>ice162y8kua930ie41kredxjaxhzy3y</sha1>
11595 </revision>
11596 </page>
11597 <page>
11598 <title>Module:Protection banner/config</title>
11599 <ns>828</ns>
11600 <id>42982788</id>
11601 <revision>
11602 <id>844849478</id>
11603 <parentid>844429869</parentid>
11604 <timestamp>2018-06-07T15:55:40Z</timestamp>
11605 <contributor>
11606 <username>SMcCandlish</username>
11607 <id>378390</id>
11608 </contributor>
11609 <comment>This usage of "given that" is confusing and non-idiomatic in some English dialects, but a simple "if" works in all of them.</comment>
11610 <model>Scribunto</model>
11611 <format>text/plain</format>
11612 <text xml:space="preserve" bytes="46786">-- This module provides configuration data for [[Module:Protection banner]].
11613
11614return {
11615
11616--------------------------------------------------------------------------------
11617--
11618-- BANNER DATA
11619--
11620--------------------------------------------------------------------------------
11621
11622--[[
11623-- Banner data consists of six fields:
11624-- * text - the main protection text that appears at the top of protection
11625-- banners.
11626-- * explanation - the text that appears below the main protection text, used
11627-- to explain the details of the protection.
11628-- * tooltip - the tooltip text you see when you move the mouse over a small
11629-- padlock icon.
11630-- * link - the page that the small padlock icon links to.
11631-- * alt - the alt text for the small padlock icon. This is also used as tooltip
11632-- text for the large protection banners.
11633-- * image - the padlock image used in both protection banners and small padlock
11634-- icons.
11635--
11636-- The module checks in three separate tables to find a value for each field.
11637-- First it checks the banners table, which has values specific to the reason
11638-- for the page being protected. Then the module checks the defaultBanners
11639-- table, which has values specific to each protection level. Finally, the
11640-- module checks the masterBanner table, which holds data for protection
11641-- templates to use if no data has been found in the previous two tables.
11642--
11643-- The values in the banner data can take parameters. These are specified
11644-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
11645-- enclosed in curly braces).
11646--
11647-- Available parameters:
11648--
11649-- ${CURRENTVERSION} - a link to the page history or the move log, with the
11650-- display message "current-version-edit-display" or
11651-- "current-version-move-display".
11652--
11653-- ${EDITREQUEST} - a link to create an edit request for the current page.
11654--
11655-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
11656-- on the talk page; you may submit a request to ask an administrator to make
11657-- an edit if it is minor or supported by consensus."
11658--
11659-- ${IMAGELINK} - a link to set the image to, depending on the protection
11660-- action and protection level.
11661--
11662-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
11663-- is set. E.g. "Editing of this page by new or unregistered users is currently
11664-- disabled until dd Month YYYY."
11665--
11666-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
11667-- so that it can be used in run-on sentences.
11668--
11669-- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
11670-- Defined in the cfg.pagetypes table.
11671--
11672-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
11673-- "Editing of this page by new or unregistered users is currently disabled"
11674--
11675-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
11676-- template.
11677--
11678-- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
11679-- "semi-protected".
11680--
11681-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
11682-- depending on the protection action.
11683--
11684-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
11685-- straight to that talk page section.
11686--
11687-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
11688-- create a blurb like "This template is semi-protected", or "This article is
11689-- move-protected until DD Month YYYY".
11690--
11691-- ${VANDAL} - links for the specified username (or the root page name)
11692-- using Module:Vandal-m.
11693--
11694-- Functions
11695--
11696-- For advanced users, it is possible to use Lua functions instead of strings
11697-- in the banner config tables. Using functions gives flexibility that is not
11698-- possible just by using parameters. Functions take two arguments, the
11699-- protection object and the template arguments, and they must output a string.
11700--
11701-- For example:
11702--
11703-- text = function (protectionObj, args)
11704-- if protectionObj.level == 'autoconfirmed' then
11705-- return 'foo'
11706-- else
11707-- return 'bar'
11708-- end
11709-- end
11710--
11711-- Some protection object properties and methods that may be useful:
11712-- protectionObj.action - the protection action
11713-- protectionObj.level - the protection level
11714-- protectionObj.reason - the protection reason
11715-- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
11716-- to indefinite, and the protection time in unix time if temporary.
11717-- protectionObj.protectionDate - the protection date in unix time, or nil if
11718-- unspecified.
11719-- protectionObj.bannerConfig - the banner config found by the module. Beware
11720-- of editing the config field used by the function, as it could create an
11721-- infinite loop.
11722-- protectionObj:isProtected - returns a boolean showing whether the page is
11723-- protected.
11724-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
11725-- temporary.
11726-- protectionObj:isIncorrect - returns a boolean showing whether the protection
11727-- template is incorrect.
11728--]]
11729
11730-- The master banner data, used if no values have been found in banners or
11731-- defaultBanners.
11732masterBanner = {
11733 text = '${INTROBLURB}',
11734 explanation = '${EXPLANATIONBLURB}',
11735 tooltip = '${TOOLTIPBLURB}',
11736 link = '${IMAGELINK}',
11737 alt = 'Page ${PROTECTIONLEVEL}'
11738},
11739
11740-- The default banner data. This holds banner data for different protection
11741-- levels.
11742-- *required* - this table needs edit, move, autoreview and upload subtables.
11743defaultBanners = {
11744 edit = {},
11745 move = {},
11746 autoreview = {
11747 autoconfirmed = {
11748 alt = 'Page protected with pending changes level 1',
11749 tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
11750 image = 'Padlock-silver-light.svg'
11751 },
11752 default = {
11753 alt = 'Page protected with pending changes level 2',
11754 tooltip = 'All edits by users who are not reviewers or administrators are'
11755 .. ' subject to review prior to becoming visible to unregistered users',
11756 image = 'Padlock-orange.svg'
11757 }
11758 },
11759 upload = {}
11760},
11761
11762-- The banner data. This holds banner data for different protection reasons.
11763-- In fact, the reasons specified in this table control which reasons are
11764-- valid inputs to the first positional parameter.
11765--
11766-- There is also a non-standard "description" field that can be used for items
11767-- in this table. This is a description of the protection reason for use in the
11768-- module documentation.
11769--
11770-- *required* - this table needs edit, move, autoreview and upload subtables.
11771banners = {
11772 edit = {
11773 blp = {
11774 description = 'For pages protected to promote compliance with the'
11775 .. ' [[Wikipedia:Biographies of living persons'
11776 .. '|biographies of living persons]] policy',
11777 text = '${INTROFRAGMENT} to promote compliance with'
11778 .. ' [[Wikipedia:Biographies of living persons'
11779 .. "|Wikipedia's&nbsp;policy on&nbsp;the&nbsp;biographies"
11780 .. ' of&nbsp;living&nbsp;people]].',
11781 tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
11782 .. ' biographies of living people',
11783 },
11784 dmca = {
11785 description = 'For pages protected by the Wikimedia Foundation'
11786 .. ' due to [[Digital Millennium Copyright Act]] takedown requests',
11787 explanation = function (protectionObj, args)
11788 local ret = 'Pursuant to a rights owner notice under the Digital'
11789 .. ' Millennium Copyright Act (DMCA) regarding some content'
11790 .. ' in this article, the Wikimedia Foundation acted under'
11791 .. ' applicable law and took down and restricted the content'
11792 .. ' in question.'
11793 if args.notice then
11794 ret = ret .. ' A copy of the received notice can be found here: '
11795 .. args.notice .. '.'
11796 end
11797 ret = ret .. ' For more information, including websites discussing'
11798 .. ' how to file a counter-notice, please see'
11799 .. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
11800 .. "'''Do not remove this template from the article until the"
11801 .. " restrictions are withdrawn'''."
11802 return ret
11803 end,
11804 image = 'Padlock-black.svg',
11805 },
11806 dispute = {
11807 description = 'For pages protected due to editing disputes',
11808 text = function (protectionObj, args)
11809 -- Find the value of "disputes".
11810 local display = 'disputes'
11811 local disputes
11812 if args.section then
11813 disputes = string.format(
11814 '[[%s:%s#%s|%s]]',
11815 mw.site.namespaces[protectionObj.title.namespace].talk.name,
11816 protectionObj.title.text,
11817 args.section,
11818 display
11819 )
11820 else
11821 disputes = display
11822 end
11823
11824 -- Make the blurb, depending on the expiry.
11825 local msg
11826 if type(protectionObj.expiry) == 'number' then
11827 msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
11828 else
11829 msg = '${INTROFRAGMENT} until editing %s have been resolved.'
11830 end
11831 return string.format(msg, disputes)
11832 end,
11833 explanation = "This protection is '''not''' an endorsement of the"
11834 .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
11835 tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
11836 },
11837 ecp = {
11838 description = 'For articles in topic areas authorized by'
11839 .. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
11840 .. ' meets the criteria for community use',
11841 tooltip = 'This ${PAGETYPE} is extended-confirmed protected',
11842 alt = 'Extended-protected ${PAGETYPE}',
11843 },
11844 mainpage = {
11845 description = 'For pages protected for being displayed on the [[Main Page]]',
11846 text = 'This file is currently'
11847 .. ' [[Wikipedia:This page is protected|protected]] from'
11848 .. ' editing because it is currently or will soon be displayed'
11849 .. ' on the [[Main Page]].',
11850 explanation = 'Images on the Main Page are protected due to their high'
11851 .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
11852 .. '<br /><span style="font-size:90%;">'
11853 .. "'''Administrators:''' Once this image is definitely off the Main Page,"
11854 .. ' please unprotect this file, or reduce to semi-protection,'
11855 .. ' as appropriate.</span>',
11856 },
11857 office = {
11858 description = 'For pages protected by the Wikimedia Foundation',
11859 text = function (protectionObj, args)
11860 local ret = 'This ${PAGETYPE} is currently under the'
11861 .. ' scrutiny of the'
11862 .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
11863 .. ' and is protected.'
11864 if protectionObj.protectionDate then
11865 ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
11866 end
11867 return ret
11868 end,
11869 explanation = "If you can edit this page, please discuss all changes and"
11870 .. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
11871 .. " page unless you are authorized by the Wikimedia Foundation to do"
11872 .. " so.'''",
11873 image = 'Padlock-black.svg',
11874 },
11875 reset = {
11876 description = 'For pages protected by the Wikimedia Foundation and'
11877 .. ' "reset" to a bare-bones version',
11878 text = 'This ${PAGETYPE} is currently under the'
11879 .. ' scrutiny of the'
11880 .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
11881 .. ' and is protected.',
11882 explanation = function (protectionObj, args)
11883 local ret = ''
11884 if protectionObj.protectionDate then
11885 ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
11886 else
11887 ret = ret .. 'This ${PAGETYPE} has been'
11888 end
11889 ret = ret .. ' reduced to a'
11890 .. ' simplified, "bare bones" version so that it may be completely'
11891 .. ' rewritten to ensure it meets the policies of'
11892 .. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
11893 .. ' Standard Wikipedia policies will apply to its rewriting—which'
11894 .. ' will eventually be open to all editors—and will be strictly'
11895 .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
11896 .. ' it is being rebuilt.\n\n'
11897 .. 'Any insertion of material directly from'
11898 .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
11899 .. ' will any material added to the ${PAGETYPE} that is not properly'
11900 .. ' sourced. The associated talk page(s) were also cleared on the'
11901 .. " same date.\n\n"
11902 .. "If you can edit this page, please discuss all changes and"
11903 .. " additions on the ${TALKPAGE} first. '''Do not override"
11904 .. " this action, and do not remove protection from this page,"
11905 .. " unless you are authorized by the Wikimedia Foundation"
11906 .. " to do so. No editor may remove this notice.'''"
11907
11908 return ret
11909 end,
11910 image = 'Padlock-black.svg',
11911 },
11912 sock = {
11913 description = 'For pages protected due to'
11914 .. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
11915 text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
11916 .. ' [[Wikipedia:Blocking policy|blocked]] or'
11917 .. ' [[Wikipedia:Banning policy|banned users]]'
11918 .. ' from editing it.',
11919 tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
11920 .. ' editing it',
11921 },
11922 template = {
11923 description = 'For [[Wikipedia:High-risk templates|high-risk]]'
11924 .. ' templates and Lua modules',
11925 text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
11926 .. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
11927 explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
11928 .. ' ${EDITREQUEST} to ask an'
11929 .. ' [[Wikipedia:Administrators|administrator]] or'
11930 .. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
11931 .. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
11932 .. '|uncontroversial]] or supported by'
11933 .. ' [[Wikipedia:Consensus|consensus]]. You can also'
11934 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
11935 .. ' unprotected.',
11936 tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
11937 .. ' to prevent vandalism',
11938 alt = 'Permanently protected ${PAGETYPE}',
11939 },
11940 usertalk = {
11941 description = 'For pages protected against disruptive edits by a'
11942 .. ' particular user',
11943 text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
11944 .. ' such as abusing the'
11945 .. ' &#123;&#123;[[Template:unblock|unblock]]&#125;&#125; template.',
11946 explanation = 'If you cannot edit this user talk page and you need to'
11947 .. ' make a change or leave a message, you can'
11948 .. ' [[Wikipedia:Requests for page protection'
11949 .. '#Current requests for edits to a protected page'
11950 .. '|request an edit]],'
11951 .. ' [[Wikipedia:Requests for page protection'
11952 .. '#Current requests for reduction in protection level'
11953 .. '|request unprotection]],'
11954 .. ' [[Special:Userlogin|log in]],'
11955 .. ' or [[Special:UserLogin/signup|create an account]].',
11956 },
11957 vandalism = {
11958 description = 'For pages protected against'
11959 .. ' [[Wikipedia:Vandalism|vandalism]]',
11960 text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
11961 explanation = function (protectionObj, args)
11962 local ret = ''
11963 if protectionObj.level == 'sysop' then
11964 ret = ret .. "This protection is '''not''' an endorsement of the"
11965 .. ' ${CURRENTVERSION}. '
11966 end
11967 return ret .. '${EXPLANATIONBLURB}'
11968 end,
11969 tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
11970 }
11971 },
11972 move = {
11973 dispute = {
11974 description = 'For pages protected against page moves due to'
11975 .. ' disputes over the page title',
11976 explanation = "This protection is '''not''' an endorsement of the"
11977 .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
11978 image = 'Padlock-olive.svg'
11979 },
11980 vandalism = {
11981 description = 'For pages protected against'
11982 .. ' [[Wikipedia:Vandalism#Page-move vandalism'
11983 .. ' |page-move vandalism]]'
11984 }
11985 },
11986 autoreview = {},
11987 upload = {}
11988},
11989
11990--------------------------------------------------------------------------------
11991--
11992-- GENERAL DATA TABLES
11993--
11994--------------------------------------------------------------------------------
11995
11996--------------------------------------------------------------------------------
11997-- Protection blurbs
11998--------------------------------------------------------------------------------
11999
12000-- This table produces the protection blurbs available with the
12001-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
12002-- protection level, and is checked by the module in the following order:
12003-- 1. page's protection action, page's protection level
12004-- 2. page's protection action, default protection level
12005-- 3. "edit" protection action, default protection level
12006--
12007-- It is possible to use banner parameters inside this table.
12008-- *required* - this table needs edit, move, autoreview and upload subtables.
12009protectionBlurbs = {
12010 edit = {
12011 default = 'This ${PAGETYPE} is currently [[Help:Protection|'
12012 .. 'protected]] from editing',
12013 autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
12014 .. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
12015 .. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
12016 extendedconfirmed = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} as a result of'
12017 .. ' [[Wikipedia:Arbitration Committee|ArbCom]] enforcement or meets the'
12018 .. ' [[Wikipedia:Protection policy#extended|criteria for community use]]',
12019 },
12020 move = {
12021 default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
12022 .. ' from [[Help:Moving a page|page moves]]'
12023 },
12024 autoreview = {
12025 autoconfirmed = 'All edits made to this ${PAGETYPE} by'
12026 .. ' [[Wikipedia:User access levels#New users|new]] or'
12027 .. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
12028 .. ' users are currently'
12029 .. ' [[Wikipedia:Pending changes|subject to review]]',
12030 default = 'All edits made to this ${PAGETYPE} by users who are not'
12031 .. ' [[Wikipedia:Reviewing|reviewers]] or'
12032 .. ' [[Wikipedia:Administrators|administrators]] are currently'
12033 .. ' [[Wikipedia:Pending changes|subject to review]]'
12034 },
12035 upload = {
12036 default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
12037 }
12038},
12039
12040
12041--------------------------------------------------------------------------------
12042-- Explanation blurbs
12043--------------------------------------------------------------------------------
12044
12045-- This table produces the explanation blurbs available with the
12046-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
12047-- protection level, and whether the page is a talk page or not. If the page is
12048-- a talk page it will have a talk key of "talk"; otherwise it will have a talk
12049-- key of "subject". The table is checked in the following order:
12050-- 1. page's protection action, page's protection level, page's talk key
12051-- 2. page's protection action, page's protection level, default talk key
12052-- 3. page's protection action, default protection level, page's talk key
12053-- 4. page's protection action, default protection level, default talk key
12054--
12055-- It is possible to use banner parameters inside this table.
12056-- *required* - this table needs edit, move, autoreview and upload subtables.
12057explanationBlurbs = {
12058 edit = {
12059 autoconfirmed = {
12060 subject = 'See the [[Wikipedia:Protection policy|'
12061 .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
12062 .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
12063 .. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
12064 .. ' [[Wikipedia:Requests for page protection'
12065 .. '#Current requests for reduction in protection level'
12066 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
12067 .. ' [[Special:UserLogin/signup|create an account]].',
12068 default = 'See the [[Wikipedia:Protection policy|'
12069 .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
12070 .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
12071 .. ' [[Wikipedia:Requests for page protection'
12072 .. '#Current requests for reduction in protection level'
12073 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
12074 .. ' [[Special:UserLogin/signup|create an account]].',
12075 },
12076 extendedconfirmed = {
12077 default = 'Extended confirmed protection prevents edits from all IP editors'
12078 .. ' and registered users with fewer than 30 days tenure and 500 edits.'
12079 .. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
12080 .. ' specifies that extended confirmed protection can be applied to combat'
12081 .. ' disruption, if semi-protection has proven to be ineffective.'
12082 .. ' Please discuss any changes on the ${TALKPAGE}; you may'
12083 .. ' ${EDITREQUEST} to ask for unconversial changes supported by'
12084 .. ' [[Wikipedia:Consensus|consensus]].'
12085 },
12086 default = {
12087 subject = 'See the [[Wikipedia:Protection policy|'
12088 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12089 .. ' Please discuss any changes on the ${TALKPAGE}; you'
12090 .. ' may ${EDITREQUEST} to ask an'
12091 .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
12092 .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
12093 .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
12094 .. '|consensus]]. You may also [[Wikipedia:Requests for'
12095 .. ' page protection#Current requests for reduction in protection level'
12096 .. '|request]] that this page be unprotected.',
12097 default = 'See the [[Wikipedia:Protection policy|'
12098 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12099 .. ' You may [[Wikipedia:Requests for page'
12100 .. ' protection#Current requests for edits to a protected page|request an'
12101 .. ' edit]] to this page, or [[Wikipedia:Requests for'
12102 .. ' page protection#Current requests for reduction in protection level'
12103 .. '|ask]] for it to be unprotected.'
12104 }
12105 },
12106 move = {
12107 default = {
12108 subject = 'See the [[Wikipedia:Protection policy|'
12109 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12110 .. ' The page may still be edited but cannot be moved'
12111 .. ' until unprotected. Please discuss any suggested moves on the'
12112 .. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
12113 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
12114 .. ' unprotected.',
12115 default = 'See the [[Wikipedia:Protection policy|'
12116 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12117 .. ' The page may still be edited but cannot be moved'
12118 .. ' until unprotected. Please discuss any suggested moves at'
12119 .. ' [[Wikipedia:Requested moves]]. You can also'
12120 .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
12121 .. ' unprotected.'
12122 }
12123 },
12124 autoreview = {
12125 default = {
12126 reviewer = 'See the [[Wikipedia:Protection policy|'
12127 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12128 .. ' Edits to this ${PAGETYPE} will not be visible to readers'
12129 .. ' until they are accepted by a reviewer or an administrator.'
12130 .. ' To avoid the need for your edits to be reviewed, you may'
12131 .. ' [[Wikipedia:Requests for page protection'
12132 .. '#Current requests for reduction in protection level'
12133 .. '|request unprotection]]. Experienced editors may also'
12134 .. ' request the [[Wikipedia:Reviewing|reviewer user right]].',
12135 default = 'See the [[Wikipedia:Protection policy|'
12136 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12137 .. ' Edits to this ${PAGETYPE} by new and unregistered users'
12138 .. ' will not be visible to readers until they are accepted by'
12139 .. ' a reviewer. To avoid the need for your edits to be'
12140 .. ' reviewed, you may'
12141 .. ' [[Wikipedia:Requests for page protection'
12142 .. '#Current requests for reduction in protection level'
12143 .. '|request unprotection]], [[Special:Userlogin|log in]], or'
12144 .. ' [[Special:UserLogin/signup|create an account]].'
12145 },
12146 },
12147 upload = {
12148 default = {
12149 default = 'See the [[Wikipedia:Protection policy|'
12150 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12151 .. ' The page may still be edited but new versions of the file'
12152 .. ' cannot be uploaded until it is unprotected. You can'
12153 .. ' request that a new version be uploaded by using a'
12154 .. ' [[Wikipedia:Edit requests|protected edit request]], or you'
12155 .. ' can [[Wikipedia:Requests for page protection|request]]'
12156 .. ' that the file be unprotected.'
12157 }
12158 }
12159},
12160
12161--------------------------------------------------------------------------------
12162-- Protection levels
12163--------------------------------------------------------------------------------
12164
12165-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
12166-- produces a short label for different protection levels. It is sorted by
12167-- protection action and protection level, and is checked in the following
12168-- order:
12169-- 1. page's protection action, page's protection level
12170-- 2. page's protection action, default protection level
12171-- 3. "edit" protection action, default protection level
12172--
12173-- It is possible to use banner parameters inside this table.
12174-- *required* - this table needs edit, move, autoreview and upload subtables.
12175protectionLevels = {
12176 edit = {
12177 default = 'protected',
12178 templateeditor = 'template-protected',
12179 extendedconfirmed = 'extended-protected',
12180 autoconfirmed = 'semi-protected',
12181 },
12182 move = {
12183 default = 'move-protected'
12184 },
12185 autoreview = {
12186 },
12187 upload = {
12188 default = 'upload-protected'
12189 }
12190},
12191
12192--------------------------------------------------------------------------------
12193-- Images
12194--------------------------------------------------------------------------------
12195
12196-- This table lists different padlock images for each protection action and
12197-- protection level. It is used if an image is not specified in any of the
12198-- banner data tables, and if the page does not satisfy the conditions for using
12199-- the ['image-filename-indef'] image. It is checked in the following order:
12200-- 1. page's protection action, page's protection level
12201-- 2. page's protection action, default protection level
12202images = {
12203 edit = {
12204 default = 'Padlock.svg',
12205 templateeditor = 'Padlock-pink.svg',
12206 extendedconfirmed = 'Padlock-blue.svg',
12207 autoconfirmed = 'Padlock-silver.svg'
12208 },
12209 move = {
12210 default = 'Padlock-olive.svg',
12211 },
12212 autoreview = {
12213 autoconfirmed = 'Padlock-silver-light.svg',
12214 default = 'Padlock-orange.svg'
12215 },
12216 upload = {
12217 default = 'Padlock-purple.svg'
12218 }
12219},
12220
12221-- Pages with a reason specified in this table will show the special "indef"
12222-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
12223indefImageReasons = {
12224 template = true
12225},
12226
12227--------------------------------------------------------------------------------
12228-- Image links
12229--------------------------------------------------------------------------------
12230
12231-- This table provides the data for the ${IMAGELINK} parameter, which gets
12232-- the image link for small padlock icons based on the page's protection action
12233-- and protection level. It is checked in the following order:
12234-- 1. page's protection action, page's protection level
12235-- 2. page's protection action, default protection level
12236-- 3. "edit" protection action, default protection level
12237--
12238-- It is possible to use banner parameters inside this table.
12239-- *required* - this table needs edit, move, autoreview and upload subtables.
12240imageLinks = {
12241 edit = {
12242 default = 'Wikipedia:Protection policy#full',
12243 templateeditor = 'Wikipedia:Protection policy#template',
12244 extendedconfirmed = 'Wikipedia:Protection policy#extended',
12245 autoconfirmed = 'Wikipedia:Protection policy#semi'
12246 },
12247 move = {
12248 default = 'Wikipedia:Protection policy#move'
12249 },
12250 autoreview = {
12251 autoconfirmed = 'Wikipedia:Protection policy#pc1',
12252 reviewer = 'Wikipedia:Protection policy#pc2'
12253 },
12254 upload = {
12255 default = 'Wikipedia:Protection policy#upload'
12256 }
12257},
12258
12259--------------------------------------------------------------------------------
12260-- Padlock indicator names
12261--------------------------------------------------------------------------------
12262
12263-- This table provides the "name" attribute for the <indicator> extension tag
12264-- with which small padlock icons are generated. All indicator tags on a page
12265-- are displayed in alphabetical order based on this attribute, and with
12266-- indicator tags with duplicate names, the last tag on the page wins.
12267-- The attribute is chosen based on the protection action; table keys must be a
12268-- protection action name or the string "default".
12269padlockIndicatorNames = {
12270 autoreview = 'pp-autoreview',
12271 default = 'pp-default'
12272},
12273
12274--------------------------------------------------------------------------------
12275-- Protection categories
12276--------------------------------------------------------------------------------
12277
12278--[[
12279-- The protection categories are stored in the protectionCategories table.
12280-- Keys to this table are made up of the following strings:
12281--
12282-- 1. the expiry date
12283-- 2. the namespace
12284-- 3. the protection reason (e.g. "dispute" or "vandalism")
12285-- 4. the protection level (e.g. "sysop" or "autoconfirmed")
12286-- 5. the action (e.g. "edit" or "move")
12287--
12288-- When the module looks up a category in the table, first it will will check to
12289-- see a key exists that corresponds to all five parameters. For example, a
12290-- user page semi-protected from vandalism for two weeks would have the key
12291-- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
12292-- changes the first part of the key to "all" and checks the table again. It
12293-- keeps checking increasingly generic key combinations until it finds the
12294-- field, or until it reaches the key "all-all-all-all-all".
12295--
12296-- The module uses a binary matrix to determine the order in which to search.
12297-- This is best demonstrated by a table. In this table, the "0" values
12298-- represent "all", and the "1" values represent the original data (e.g.
12299-- "indef" or "file" or "vandalism").
12300--
12301-- expiry namespace reason level action
12302-- order
12303-- 1 1 1 1 1 1
12304-- 2 0 1 1 1 1
12305-- 3 1 0 1 1 1
12306-- 4 0 0 1 1 1
12307-- 5 1 1 0 1 1
12308-- 6 0 1 0 1 1
12309-- 7 1 0 0 1 1
12310-- 8 0 0 0 1 1
12311-- 9 1 1 1 0 1
12312-- 10 0 1 1 0 1
12313-- 11 1 0 1 0 1
12314-- 12 0 0 1 0 1
12315-- 13 1 1 0 0 1
12316-- 14 0 1 0 0 1
12317-- 15 1 0 0 0 1
12318-- 16 0 0 0 0 1
12319-- 17 1 1 1 1 0
12320-- 18 0 1 1 1 0
12321-- 19 1 0 1 1 0
12322-- 20 0 0 1 1 0
12323-- 21 1 1 0 1 0
12324-- 22 0 1 0 1 0
12325-- 23 1 0 0 1 0
12326-- 24 0 0 0 1 0
12327-- 25 1 1 1 0 0
12328-- 26 0 1 1 0 0
12329-- 27 1 0 1 0 0
12330-- 28 0 0 1 0 0
12331-- 29 1 1 0 0 0
12332-- 30 0 1 0 0 0
12333-- 31 1 0 0 0 0
12334-- 32 0 0 0 0 0
12335--
12336-- In this scheme the action has the highest priority, as it is the last
12337-- to change, and the expiry has the least priority, as it changes the most.
12338-- The priorities of the expiry, the protection level and the action are
12339-- fixed, but the priorities of the reason and the namespace can be swapped
12340-- through the use of the cfg.bannerDataNamespaceHasPriority table.
12341--]]
12342
12343-- If the reason specified to the template is listed in this table,
12344-- namespace data will take priority over reason data in the protectionCategories
12345-- table.
12346reasonsWithNamespacePriority = {
12347 vandalism = true,
12348},
12349
12350-- The string to use as a namespace key for the protectionCategories table for each
12351-- namespace number.
12352categoryNamespaceKeys = {
12353 [ 2] = 'user',
12354 [ 3] = 'user',
12355 [ 4] = 'project',
12356 [ 6] = 'file',
12357 [ 8] = 'mediawiki',
12358 [ 10] = 'template',
12359 [ 12] = 'project',
12360 [ 14] = 'category',
12361 [100] = 'portal',
12362 [828] = 'module',
12363},
12364
12365protectionCategories = {
12366 ['all|all|all|all|all'] = 'Wikipedia fully protected pages',
12367 ['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
12368 ['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
12369 ['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
12370 ['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files',
12371 ['all|all|all|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
12372 ['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
12373 ['all|template|all|all|edit'] = 'Wikipedia fully-protected templates',
12374 ['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
12375 ['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
12376 ['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
12377 ['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
12378 ['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
12379 ['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
12380 ['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
12381 ['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
12382 ['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
12383 ['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
12384 ['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
12385 ['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
12386 ['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
12387 ['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
12388 ['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
12389 ['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
12390 ['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
12391 ['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
12392 ['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
12393 ['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
12394 ['all|category|all|sysop|edit'] = 'Wikipedia protected categories',
12395 ['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files',
12396 ['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages',
12397 ['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages',
12398 ['all|template|all|sysop|edit'] = 'Wikipedia fully-protected templates',
12399 ['all|user|all|sysop|edit'] = 'Wikipedia protected user and user talk pages',
12400 ['all|module|all|all|edit'] = 'Wikipedia fully-protected modules',
12401 ['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
12402 ['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
12403 ['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
12404 ['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
12405 ['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
12406 ['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
12407 ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
12408 ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
12409 ['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
12410 ['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
12411 ['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
12412 ['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
12413 ['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
12414 ['all|all|all|reviewer|autoreview'] = 'Wikipedia pending changes protected pages (level 2)',
12415 ['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
12416},
12417
12418--------------------------------------------------------------------------------
12419-- Expiry category config
12420--------------------------------------------------------------------------------
12421
12422-- This table configures the expiry category behaviour for each protection
12423-- action.
12424-- * If set to true, setting that action will always categorise the page if
12425-- an expiry parameter is not set.
12426-- * If set to false, setting that action will never categorise the page.
12427-- * If set to nil, the module will categorise the page if:
12428-- 1) an expiry parameter is not set, and
12429-- 2) a reason is provided, and
12430-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
12431-- table.
12432
12433expiryCheckActions = {
12434 edit = nil,
12435 move = false,
12436 autoreview = true,
12437 upload = false
12438},
12439
12440reasonsWithoutExpiryCheck = {
12441 blp = true,
12442 template = true,
12443},
12444
12445--------------------------------------------------------------------------------
12446-- Pagetypes
12447--------------------------------------------------------------------------------
12448
12449-- This table produces the page types available with the ${PAGETYPE} parameter.
12450-- Keys are namespace numbers, or the string "default" for the default value.
12451pagetypes = {
12452 [0] = 'article',
12453 [6] = 'file',
12454 [10] = 'template',
12455 [14] = 'category',
12456 [828] = 'module',
12457 default = 'page'
12458},
12459
12460--------------------------------------------------------------------------------
12461-- Strings marking indefinite protection
12462--------------------------------------------------------------------------------
12463
12464-- This table contains values passed to the expiry parameter that mean the page
12465-- is protected indefinitely.
12466indefStrings = {
12467 ['indef'] = true,
12468 ['indefinite'] = true,
12469 ['indefinitely'] = true,
12470 ['infinite'] = true,
12471},
12472
12473--------------------------------------------------------------------------------
12474-- Group hierarchy
12475--------------------------------------------------------------------------------
12476
12477-- This table maps each group to all groups that have a superset of the original
12478-- group's page editing permissions.
12479hierarchy = {
12480 sysop = {},
12481 reviewer = {'sysop'},
12482 filemover = {'sysop'},
12483 templateeditor = {'sysop'},
12484 extendedconfirmed = {'sysop'},
12485 autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
12486 user = {'autoconfirmed'},
12487 ['*'] = {'user'}
12488},
12489
12490--------------------------------------------------------------------------------
12491-- Wrapper templates and their default arguments
12492--------------------------------------------------------------------------------
12493
12494-- This table contains wrapper templates used with the module, and their
12495-- default arguments. Templates specified in this table should contain the
12496-- following invocation, and no other template content:
12497--
12498-- {{#invoke:Protection banner|main}}
12499--
12500-- If other content is desired, it can be added between
12501-- <noinclude>...</noinclude> tags.
12502--
12503-- When a user calls one of these wrapper templates, they will use the
12504-- default arguments automatically. However, users can override any of the
12505-- arguments.
12506wrappers = {
12507 ['Template:Pp'] = {},
12508 ['Template:Pp-30-500'] = {'ecp'},
12509 ['Template:Pp-blp'] = {'blp'},
12510 -- we don't need Template:Pp-create
12511 ['Template:Pp-dispute'] = {'dispute'},
12512 ['Template:Pp-main-page'] = {'mainpage'},
12513 ['Template:Pp-move'] = {action = 'move'},
12514 ['Template:Pp-move-dispute'] = {'dispute', action = 'move'},
12515 -- we don't need Template:Pp-move-indef
12516 ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'},
12517 ['Template:Pp-office'] = {'office'},
12518 ['Template:Pp-office-dmca'] = {'dmca'},
12519 ['Template:Pp-pc1'] = {action = 'autoreview', small = true},
12520 ['Template:Pp-pc2'] = {action = 'autoreview', small = true},
12521 ['Template:Pp-reset'] = {'reset'},
12522 ['Template:Pp-semi-indef'] = {small = true},
12523 ['Template:Pp-sock'] = {'sock'},
12524 ['Template:Pp-template'] = {'template', small = true},
12525 ['Template:Pp-upload'] = {action = 'upload'},
12526 ['Template:Pp-usertalk'] = {'usertalk'},
12527 ['Template:Pp-vandalism'] = {'vandalism'},
12528},
12529
12530--------------------------------------------------------------------------------
12531--
12532-- MESSAGES
12533--
12534--------------------------------------------------------------------------------
12535
12536msg = {
12537
12538--------------------------------------------------------------------------------
12539-- Intro blurb and intro fragment
12540--------------------------------------------------------------------------------
12541
12542-- These messages specify what is produced by the ${INTROBLURB} and
12543-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
12544-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
12545-- intro-blurb-noexpiry or intro-fragment-noexpiry.
12546-- It is possible to use banner parameters in these messages.
12547['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
12548['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
12549['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
12550['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
12551
12552--------------------------------------------------------------------------------
12553-- Tooltip blurb
12554--------------------------------------------------------------------------------
12555
12556-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
12557-- If the protection is temporary the tooltip-blurb-expiry message is used, and
12558-- if not the tooltip-blurb-noexpiry message is used.
12559-- It is possible to use banner parameters in these messages.
12560['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
12561['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
12562['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
12563['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
12564
12565--------------------------------------------------------------------------------
12566-- Special explanation blurb
12567--------------------------------------------------------------------------------
12568
12569-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
12570-- in the MediaWiki namespace.
12571-- It is possible to use banner parameters in this message.
12572['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
12573 .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
12574 .. ' Please discuss any changes on the ${TALKPAGE}; you'
12575 .. ' may ${EDITREQUEST} to ask an'
12576 .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
12577 .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
12578 .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
12579 .. '|consensus]].',
12580
12581--------------------------------------------------------------------------------
12582-- Protection log display values
12583--------------------------------------------------------------------------------
12584
12585-- These messages determine the display values for the protection log link
12586-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
12587-- It is possible to use banner parameters in these messages.
12588['protection-log-display'] = 'protection log',
12589['pc-log-display'] = 'pending changes log',
12590
12591--------------------------------------------------------------------------------
12592-- Current version display values
12593--------------------------------------------------------------------------------
12594
12595-- These messages determine the display values for the page history link
12596-- or the move log link produced by the ${CURRENTVERSION} parameter.
12597-- It is possible to use banner parameters in these messages.
12598['current-version-move-display'] = 'current title',
12599['current-version-edit-display'] = 'current version',
12600
12601--------------------------------------------------------------------------------
12602-- Talk page
12603--------------------------------------------------------------------------------
12604
12605-- This message determines the display value of the talk page link produced
12606-- with the ${TALKPAGE} parameter.
12607-- It is possible to use banner parameters in this message.
12608['talk-page-link-display'] = 'talk page',
12609
12610--------------------------------------------------------------------------------
12611-- Edit requests
12612--------------------------------------------------------------------------------
12613
12614-- This message determines the display value of the edit request link produced
12615-- with the ${EDITREQUEST} parameter.
12616-- It is possible to use banner parameters in this message.
12617['edit-request-display'] = 'submit an edit request',
12618
12619--------------------------------------------------------------------------------
12620-- Expiry date format
12621--------------------------------------------------------------------------------
12622
12623-- This is the format for the blurb expiry date. It should be valid input for
12624-- the first parameter of the #time parser function.
12625['expiry-date-format'] = 'F j, Y',
12626
12627--------------------------------------------------------------------------------
12628-- Tracking categories
12629--------------------------------------------------------------------------------
12630
12631-- These messages determine which tracking categories the module outputs.
12632['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
12633['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
12634
12635--------------------------------------------------------------------------------
12636-- Images
12637--------------------------------------------------------------------------------
12638
12639-- These are images that are not defined by their protection action and protection level.
12640['image-filename-indef'] = 'Padlock.svg',
12641['image-filename-default'] = 'Transparent.gif',
12642
12643--------------------------------------------------------------------------------
12644-- End messages
12645--------------------------------------------------------------------------------
12646}
12647
12648--------------------------------------------------------------------------------
12649-- End configuration
12650--------------------------------------------------------------------------------
12651}</text>
12652 <sha1>rws38o0t9lndqgh42vqj1de259tmqqo</sha1>
12653 </revision>
12654 </page>
12655 <page>
12656 <title>Module:Separated entries</title>
12657 <ns>828</ns>
12658 <id>46440383</id>
12659 <revision>
12660 <id>847543373</id>
12661 <parentid>664185837</parentid>
12662 <timestamp>2018-06-26T03:05:37Z</timestamp>
12663 <contributor>
12664 <username>Jc86035</username>
12665 <id>17245768</id>
12666 </contributor>
12667 <minor/>
12668 <comment>allow the first positional parameter to be specified (useful in some templates)</comment>
12669 <model>Scribunto</model>
12670 <format>text/plain</format>
12671 <text xml:space="preserve" bytes="1403">-- This module takes positional parameters as input and concatenates them with
12672-- an optional separator. The final separator (the "conjunction") can be
12673-- specified independently, enabling natural-language lists like
12674-- "foo, bar, baz and qux". The starting parameter can also be specified.
12675
12676local compressSparseArray = require('Module:TableTools').compressSparseArray
12677local p = {}
12678
12679function p._main(args)
12680 local separator = args.separator
12681 -- Decode (convert to Unicode) HTML escape sequences, such as "&#32;" for space.
12682 and mw.text.decode(args.separator) or ''
12683 local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
12684 -- Discard values before the starting parameter.
12685 local start = tonumber(args.start)
12686 if start then
12687 for i = 1, start - 1 do args[i] = nil end
12688 end
12689 -- Discard named parameters.
12690 local values = compressSparseArray(args)
12691 return mw.text.listToText(values, separator, conjunction)
12692end
12693
12694local function makeInvokeFunction(separator, conjunction, first)
12695 return function (frame)
12696 local args = require('Module:Arguments').getArgs(frame)
12697 args.separator = separator or args.separator
12698 args.conjunction = conjunction or args.conjunction
12699 args.first = first or args.first
12700 return p._main(args)
12701 end
12702end
12703
12704p.main = makeInvokeFunction()
12705p.br = makeInvokeFunction('<br />')
12706p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
12707
12708return p</text>
12709 <sha1>r3n53qz4zycs3vxyo5ms9qjo1jm32bp</sha1>
12710 </revision>
12711 </page>
12712 <page>
12713 <title>Module:String</title>
12714 <ns>828</ns>
12715 <id>38569505</id>
12716 <revision>
12717 <id>552254999</id>
12718 <parentid>540627185</parentid>
12719 <timestamp>2013-04-26T10:52:01Z</timestamp>
12720 <contributor>
12721 <username>Mr. Stradivarius</username>
12722 <id>4708675</id>
12723 </contributor>
12724 <comment>Add "rep" function per request by [[User:×§×™×¤×•×“× ×—×©]] at [[Wikipedia:Lua requests#Template:Loop and Template:Loop15]]. Copied from sandbox.</comment>
12725 <model>Scribunto</model>
12726 <format>text/plain</format>
12727 <text xml:space="preserve" bytes="15731">--[[
12728
12729This module is intended to provide access to basic string functions.
12730
12731Most of the functions provided here can be invoked with named parameters,
12732unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
12733automatically remove any leading or trailing whitespace from the parameter.
12734Depending on the intended use, it may be advantageous to either preserve or
12735remove such whitespace.
12736
12737Global options
12738 ignore_errors: If set to 'true' or 1, any error condition will result in
12739 an empty string being returned rather than an error message.
12740
12741 error_category: If an error occurs, specifies the name of a category to
12742 include with the error message. The default category is
12743 [Category:Errors reported by Module String].
12744
12745 no_category: If set to 'true' or 1, no category will be added if an error
12746 is generated.
12747
12748Unit tests for this module are available at Module:String/tests.
12749]]
12750
12751local str = {}
12752
12753--[[
12754len
12755
12756This function returns the length of the target string.
12757
12758Usage:
12759{{#invoke:String|len|target_string|}}
12760OR
12761{{#invoke:String|len|s=target_string}}
12762
12763Parameters
12764 s: The string whose length to report
12765
12766If invoked using named parameters, Mediawiki will automatically remove any leading or
12767trailing whitespace from the target string.
12768]]
12769function str.len( frame )
12770 local new_args = str._getParameters( frame.args, {'s'} );
12771 local s = new_args['s'] or '';
12772 return mw.ustring.len( s )
12773end
12774
12775--[[
12776sub
12777
12778This function returns a substring of the target string at specified indices.
12779
12780Usage:
12781{{#invoke:String|sub|target_string|start_index|end_index}}
12782OR
12783{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
12784
12785Parameters
12786 s: The string to return a subset of
12787 i: The fist index of the substring to return, defaults to 1.
12788 j: The last index of the string to return, defaults to the last character.
12789
12790The first character of the string is assigned an index of 1. If either i or j
12791is a negative value, it is interpreted the same as selecting a character by
12792counting from the end of the string. Hence, a value of -1 is the same as
12793selecting the last character of the string.
12794
12795If the requested indices are out of range for the given string, an error is
12796reported.
12797]]
12798function str.sub( frame )
12799 local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } );
12800 local s = new_args['s'] or '';
12801 local i = tonumber( new_args['i'] ) or 1;
12802 local j = tonumber( new_args['j'] ) or -1;
12803
12804 local len = mw.ustring.len( s );
12805
12806 -- Convert negatives for range checking
12807 if i < 0 then
12808 i = len + i + 1;
12809 end
12810 if j < 0 then
12811 j = len + j + 1;
12812 end
12813
12814 if i > len or j > len or i < 1 or j < 1 then
12815 return str._error( 'String subset index out of range' );
12816 end
12817 if j < i then
12818 return str._error( 'String subset indices out of order' );
12819 end
12820
12821 return mw.ustring.sub( s, i, j )
12822end
12823
12824--[[
12825This function implements that features of {{str sub old}} and is kept in order
12826to maintain these older templates.
12827]]
12828function str.sublength( frame )
12829 local i = tonumber( frame.args.i ) or 0
12830 local len = tonumber( frame.args.len )
12831 return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
12832end
12833
12834--[[
12835match
12836
12837This function returns a substring from the source string that matches a
12838specified pattern.
12839
12840Usage:
12841{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
12842OR
12843{{#invoke:String|pos|s=source_string|pattern=pattern_string|start=start_index
12844 |match=match_number|plain=plain_flag|nomatch=nomatch_output}}
12845
12846Parameters
12847 s: The string to search
12848 pattern: The pattern or string to find within the string
12849 start: The index within the source string to start the search. The first
12850 character of the string has index 1. Defaults to 1.
12851 match: In some cases it may be possible to make multiple matches on a single
12852 string. This specifies which match to return, where the first match is
12853 match= 1. If a negative number is specified then a match is returned
12854 counting from the last match. Hence match = -1 is the same as requesting
12855 the last match. Defaults to 1.
12856 plain: A flag indicating that the pattern should be understood as plain
12857 text. Defaults to false.
12858 nomatch: If no match is found, output the "nomatch" value rather than an error.
12859
12860If invoked using named parameters, Mediawiki will automatically remove any leading or
12861trailing whitespace from each string. In some circumstances this is desirable, in
12862other cases one may want to preserve the whitespace.
12863
12864If the match_number or start_index are out of range for the string being queried, then
12865this function generates an error. An error is also generated if no match is found.
12866If one adds the parameter ignore_errors=true, then the error will be suppressed and
12867an empty string will be returned on any failure.
12868
12869For information on constructing Lua patterns, a form of [regular expression], see:
12870
12871* http://www.lua.org/manual/5.1/manual.html#5.4.1
12872* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
12873* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
12874
12875]]
12876function str.match( frame )
12877 local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} );
12878 local s = new_args['s'] or '';
12879 local start = tonumber( new_args['start'] ) or 1;
12880 local plain_flag = str._getBoolean( new_args['plain'] or false );
12881 local pattern = new_args['pattern'] or '';
12882 local match_index = math.floor( tonumber(new_args['match']) or 1 );
12883 local nomatch = new_args['nomatch'];
12884
12885 if s == '' then
12886 return str._error( 'Target string is empty' );
12887 end
12888 if pattern == '' then
12889 return str._error( 'Pattern string is empty' );
12890 end
12891 if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
12892 return str._error( 'Requested start is out of range' );
12893 end
12894 if match_index == 0 then
12895 return str._error( 'Match index is out of range' );
12896 end
12897 if plain_flag then
12898 pattern = str._escapePattern( pattern );
12899 end
12900
12901 local result
12902 if match_index == 1 then
12903 -- Find first match is simple case
12904 result = mw.ustring.match( s, pattern, start )
12905 else
12906 if start > 1 then
12907 s = mw.ustring.sub( s, start );
12908 end
12909
12910 local iterator = mw.ustring.gmatch(s, pattern);
12911 if match_index > 0 then
12912 -- Forward search
12913 for w in iterator do
12914 match_index = match_index - 1;
12915 if match_index == 0 then
12916 result = w;
12917 break;
12918 end
12919 end
12920 else
12921 -- Reverse search
12922 local result_table = {};
12923 local count = 1;
12924 for w in iterator do
12925 result_table[count] = w;
12926 count = count + 1;
12927 end
12928
12929 result = result_table[ count + match_index ];
12930 end
12931 end
12932
12933 if result == nil then
12934 if nomatch == nil then
12935 return str._error( 'Match not found' );
12936 else
12937 return nomatch;
12938 end
12939 else
12940 return result;
12941 end
12942end
12943
12944--[[
12945pos
12946
12947This function returns a single character from the target string at position pos.
12948
12949Usage:
12950{{#invoke:String|pos|target_string|index_value}}
12951OR
12952{{#invoke:String|pos|target=target_string|pos=index_value}}
12953
12954Parameters
12955 target: The string to search
12956 pos: The index for the character to return
12957
12958If invoked using named parameters, Mediawiki will automatically remove any leading or
12959trailing whitespace from the target string. In some circumstances this is desirable, in
12960other cases one may want to preserve the whitespace.
12961
12962The first character has an index value of 1.
12963
12964If one requests a negative value, this function will select a character by counting backwards
12965from the end of the string. In other words pos = -1 is the same as asking for the last character.
12966
12967A requested value of zero, or a value greater than the length of the string returns an error.
12968]]
12969function str.pos( frame )
12970 local new_args = str._getParameters( frame.args, {'target', 'pos'} );
12971 local target_str = new_args['target'] or '';
12972 local pos = tonumber( new_args['pos'] ) or 0;
12973
12974 if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
12975 return str._error( 'String index out of range' );
12976 end
12977
12978 return mw.ustring.sub( target_str, pos, pos );
12979end
12980
12981--[[
12982str_find
12983
12984This function duplicates the behavior of {{str_find}}, including all of its quirks.
12985This is provided in order to support existing templates, but is NOT RECOMMENDED for
12986new code and templates. New code is recommended to use the "find" function instead.
12987
12988Returns the first index in "source" that is a match to "target". Indexing is 1-based,
12989and the function returns -1 if the "target" string is not present in "source".
12990
12991Important Note: If the "target" string is empty / missing, this function returns a
12992value of "1", which is generally unexpected behavior, and must be accounted for
12993separatetly.
12994]]
12995function str.str_find( frame )
12996 local new_args = str._getParameters( frame.args, {'source', 'target'} );
12997 local source_str = new_args['source'] or '';
12998 local target_str = new_args['target'] or '';
12999
13000 if target_str == '' then
13001 return 1;
13002 end
13003
13004 local start = mw.ustring.find( source_str, target_str, 1, true )
13005 if start == nil then
13006 start = -1
13007 end
13008
13009 return start
13010end
13011
13012--[[
13013find
13014
13015This function allows one to search for a target string or pattern within another
13016string.
13017
13018Usage:
13019{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
13020OR
13021{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
13022
13023Parameters
13024 source: The string to search
13025 target: The string or pattern to find within source
13026 start: The index within the source string to start the search, defaults to 1
13027 plain: Boolean flag indicating that target should be understood as plain
13028 text and not as a Lua style regular expression, defaults to true
13029
13030If invoked using named parameters, Mediawiki will automatically remove any leading or
13031trailing whitespace from the parameter. In some circumstances this is desirable, in
13032other cases one may want to preserve the whitespace.
13033
13034This function returns the first index >= "start" where "target" can be found
13035within "source". Indices are 1-based. If "target" is not found, then this
13036function returns 0. If either "source" or "target" are missing / empty, this
13037function also returns 0.
13038
13039This function should be safe for UTF-8 strings.
13040]]
13041function str.find( frame )
13042 local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } );
13043 local source_str = new_args['source'] or '';
13044 local pattern = new_args['target'] or '';
13045 local start_pos = tonumber(new_args['start']) or 1;
13046 local plain = new_args['plain'] or true;
13047
13048 if source_str == '' or pattern == '' then
13049 return 0;
13050 end
13051
13052 plain = str._getBoolean( plain );
13053
13054 local start = mw.ustring.find( source_str, pattern, start_pos, plain )
13055 if start == nil then
13056 start = 0
13057 end
13058
13059 return start
13060end
13061
13062--[[
13063replace
13064
13065This function allows one to replace a target string or pattern within another
13066string.
13067
13068Usage:
13069{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
13070OR
13071{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
13072 count=replacement_count|plain=plain_flag}}
13073
13074Parameters
13075 source: The string to search
13076 pattern: The string or pattern to find within source
13077 replace: The replacement text
13078 count: The number of occurences to replace, defaults to all.
13079 plain: Boolean flag indicating that pattern should be understood as plain
13080 text and not as a Lua style regular expression, defaults to true
13081]]
13082function str.replace( frame )
13083 local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } );
13084 local source_str = new_args['source'] or '';
13085 local pattern = new_args['pattern'] or '';
13086 local replace = new_args['replace'] or '';
13087 local count = tonumber( new_args['count'] );
13088 local plain = new_args['plain'] or true;
13089
13090 if source_str == '' or pattern == '' then
13091 return source_str;
13092 end
13093 plain = str._getBoolean( plain );
13094
13095 if plain then
13096 pattern = str._escapePattern( pattern );
13097 replace = mw.ustring.gsub( replace, "%%", "%%%%" ); --Only need to escape replacement sequences.
13098 end
13099
13100 local result;
13101
13102 if count ~= nil then
13103 result = mw.ustring.gsub( source_str, pattern, replace, count );
13104 else
13105 result = mw.ustring.gsub( source_str, pattern, replace );
13106 end
13107
13108 return result;
13109end
13110
13111--[[
13112 simple function to pipe string.rep to templates.
13113]]
13114
13115function str.rep( frame )
13116 local repetitions = tonumber( frame.args[2] )
13117 if not repetitions then
13118 return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
13119 end
13120 return string.rep( frame.args[1] or '', repetitions )
13121end
13122
13123--[[
13124Helper function that populates the argument list given that user may need to use a mix of
13125named and unnamed parameters. This is relevant because named parameters are not
13126identical to unnamed parameters due to string trimming, and when dealing with strings
13127we sometimes want to either preserve or remove that whitespace depending on the application.
13128]]
13129function str._getParameters( frame_args, arg_list )
13130 local new_args = {};
13131 local index = 1;
13132 local value;
13133
13134 for i,arg in ipairs( arg_list ) do
13135 value = frame_args[arg]
13136 if value == nil then
13137 value = frame_args[index];
13138 index = index + 1;
13139 end
13140 new_args[arg] = value;
13141 end
13142
13143 return new_args;
13144end
13145
13146--[[
13147Helper function to handle error messages.
13148]]
13149function str._error( error_str )
13150 local frame = mw.getCurrentFrame();
13151 local error_category = frame.args.error_category or 'Errors reported by Module String';
13152 local ignore_errors = frame.args.ignore_errors or false;
13153 local no_category = frame.args.no_category or false;
13154
13155 if str._getBoolean(ignore_errors) then
13156 return '';
13157 end
13158
13159 local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>';
13160 if error_category ~= '' and not str._getBoolean( no_category ) then
13161 error_str = '[[Category:' .. error_category .. ']]' .. error_str;
13162 end
13163
13164 return error_str;
13165end
13166
13167--[[
13168Helper Function to interpret boolean strings
13169]]
13170function str._getBoolean( boolean_str )
13171 local boolean_value;
13172
13173 if type( boolean_str ) == 'string' then
13174 boolean_str = boolean_str:lower();
13175 if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
13176 or boolean_str == '' then
13177 boolean_value = false;
13178 else
13179 boolean_value = true;
13180 end
13181 elseif type( boolean_str ) == 'boolean' then
13182 boolean_value = boolean_str;
13183 else
13184 error( 'No boolean value found' );
13185 end
13186 return boolean_value
13187end
13188
13189--[[
13190Helper function that escapes all pattern characters so that they will be treated
13191as plain text.
13192]]
13193function str._escapePattern( pattern_str )
13194 return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
13195end
13196
13197return str</text>
13198 <sha1>l0shz7fzxb1bq626nihqwbptk7dfqd5</sha1>
13199 </revision>
13200 </page>
13201 <page>
13202 <title>Module:TableTools</title>
13203 <ns>828</ns>
13204 <id>41371028</id>
13205 <revision>
13206 <id>610073853</id>
13207 <parentid>587870113</parentid>
13208 <timestamp>2014-05-25T14:11:02Z</timestamp>
13209 <contributor>
13210 <username>Mr. Stradivarius</username>
13211 <id>4708675</id>
13212 </contributor>
13213 <comment>fix cleanPattern function - some of the character classes were still being magic even when they were inside the set, so escape them all</comment>
13214 <model>Scribunto</model>
13215 <format>text/plain</format>
13216 <text xml:space="preserve" bytes="8030">--[[
13217------------------------------------------------------------------------------------
13218-- TableTools --
13219-- --
13220-- This module includes a number of functions for dealing with Lua tables. --
13221-- It is a meta-module, meant to be called from other Lua modules, and should --
13222-- not be called directly from #invoke. --
13223------------------------------------------------------------------------------------
13224--]]
13225
13226local libraryUtil = require('libraryUtil')
13227
13228local p = {}
13229
13230-- Define often-used variables and functions.
13231local floor = math.floor
13232local infinity = math.huge
13233local checkType = libraryUtil.checkType
13234
13235--[[
13236------------------------------------------------------------------------------------
13237-- isPositiveInteger
13238--
13239-- This function returns true if the given value is a positive integer, and false
13240-- if not. Although it doesn't operate on tables, it is included here as it is
13241-- useful for determining whether a given table key is in the array part or the
13242-- hash part of a table.
13243------------------------------------------------------------------------------------
13244--]]
13245function p.isPositiveInteger(v)
13246 if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
13247 return true
13248 else
13249 return false
13250 end
13251end
13252
13253--[[
13254------------------------------------------------------------------------------------
13255-- isNan
13256--
13257-- This function returns true if the given number is a NaN value, and false
13258-- if not. Although it doesn't operate on tables, it is included here as it is
13259-- useful for determining whether a value can be a valid table key. Lua will
13260-- generate an error if a NaN is used as a table key.
13261------------------------------------------------------------------------------------
13262--]]
13263function p.isNan(v)
13264 if type(v) == 'number' and tostring(v) == '-nan' then
13265 return true
13266 else
13267 return false
13268 end
13269end
13270
13271--[[
13272------------------------------------------------------------------------------------
13273-- shallowClone
13274--
13275-- This returns a clone of a table. The value returned is a new table, but all
13276-- subtables and functions are shared. Metamethods are respected, but the returned
13277-- table will have no metatable of its own.
13278------------------------------------------------------------------------------------
13279--]]
13280function p.shallowClone(t)
13281 local ret = {}
13282 for k, v in pairs(t) do
13283 ret[k] = v
13284 end
13285 return ret
13286end
13287
13288--[[
13289------------------------------------------------------------------------------------
13290-- removeDuplicates
13291--
13292-- This removes duplicate values from an array. Non-positive-integer keys are
13293-- ignored. The earliest value is kept, and all subsequent duplicate values are
13294-- removed, but otherwise the array order is unchanged.
13295------------------------------------------------------------------------------------
13296--]]
13297function p.removeDuplicates(t)
13298 checkType('removeDuplicates', 1, t, 'table')
13299 local isNan = p.isNan
13300 local ret, exists = {}, {}
13301 for i, v in ipairs(t) do
13302 if isNan(v) then
13303 -- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
13304 ret[#ret + 1] = v
13305 else
13306 if not exists[v] then
13307 ret[#ret + 1] = v
13308 exists[v] = true
13309 end
13310 end
13311 end
13312 return ret
13313end
13314
13315--[[
13316------------------------------------------------------------------------------------
13317-- numKeys
13318--
13319-- This takes a table and returns an array containing the numbers of any numerical
13320-- keys that have non-nil values, sorted in numerical order.
13321------------------------------------------------------------------------------------
13322--]]
13323function p.numKeys(t)
13324 checkType('numKeys', 1, t, 'table')
13325 local isPositiveInteger = p.isPositiveInteger
13326 local nums = {}
13327 for k, v in pairs(t) do
13328 if isPositiveInteger(k) then
13329 nums[#nums + 1] = k
13330 end
13331 end
13332 table.sort(nums)
13333 return nums
13334end
13335
13336--[[
13337------------------------------------------------------------------------------------
13338-- affixNums
13339--
13340-- This takes a table and returns an array containing the numbers of keys with the
13341-- specified prefix and suffix. For example, for the table
13342-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
13343-- return {1, 3, 6}.
13344------------------------------------------------------------------------------------
13345--]]
13346function p.affixNums(t, prefix, suffix)
13347 checkType('affixNums', 1, t, 'table')
13348 checkType('affixNums', 2, prefix, 'string', true)
13349 checkType('affixNums', 3, suffix, 'string', true)
13350
13351 local function cleanPattern(s)
13352 -- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
13353 s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
13354 return s
13355 end
13356
13357 prefix = prefix or ''
13358 suffix = suffix or ''
13359 prefix = cleanPattern(prefix)
13360 suffix = cleanPattern(suffix)
13361 local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
13362
13363 local nums = {}
13364 for k, v in pairs(t) do
13365 if type(k) == 'string' then
13366 local num = mw.ustring.match(k, pattern)
13367 if num then
13368 nums[#nums + 1] = tonumber(num)
13369 end
13370 end
13371 end
13372 table.sort(nums)
13373 return nums
13374end
13375
13376--[[
13377------------------------------------------------------------------------------------
13378-- numData
13379--
13380-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
13381-- of subtables in the format
13382-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
13383-- Keys that don't end with an integer are stored in a subtable named "other".
13384-- The compress option compresses the table so that it can be iterated over with
13385-- ipairs.
13386------------------------------------------------------------------------------------
13387--]]
13388function p.numData(t, compress)
13389 checkType('numData', 1, t, 'table')
13390 checkType('numData', 2, compress, 'boolean', true)
13391 local ret = {}
13392 for k, v in pairs(t) do
13393 local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
13394 if num then
13395 num = tonumber(num)
13396 local subtable = ret[num] or {}
13397 if prefix == '' then
13398 -- Positional parameters match the blank string; put them at the start of the subtable instead.
13399 prefix = 1
13400 end
13401 subtable[prefix] = v
13402 ret[num] = subtable
13403 else
13404 local subtable = ret.other or {}
13405 subtable[k] = v
13406 ret.other = subtable
13407 end
13408 end
13409 if compress then
13410 local other = ret.other
13411 ret = p.compressSparseArray(ret)
13412 ret.other = other
13413 end
13414 return ret
13415end
13416
13417--[[
13418------------------------------------------------------------------------------------
13419-- compressSparseArray
13420--
13421-- This takes an array with one or more nil values, and removes the nil values
13422-- while preserving the order, so that the array can be safely traversed with
13423-- ipairs.
13424------------------------------------------------------------------------------------
13425--]]
13426function p.compressSparseArray(t)
13427 checkType('compressSparseArray', 1, t, 'table')
13428 local ret = {}
13429 local nums = p.numKeys(t)
13430 for _, num in ipairs(nums) do
13431 ret[#ret + 1] = t[num]
13432 end
13433 return ret
13434end
13435
13436--[[
13437------------------------------------------------------------------------------------
13438-- sparseIpairs
13439--
13440-- This is an iterator for sparse arrays. It can be used like ipairs, but can
13441-- handle nil values.
13442------------------------------------------------------------------------------------
13443--]]
13444function p.sparseIpairs(t)
13445 checkType('sparseIpairs', 1, t, 'table')
13446 local nums = p.numKeys(t)
13447 local i = 0
13448 local lim = #nums
13449 return function ()
13450 i = i + 1
13451 if i <= lim then
13452 local key = nums[i]
13453 return key, t[key]
13454 else
13455 return nil, nil
13456 end
13457 end
13458end
13459
13460--[[
13461------------------------------------------------------------------------------------
13462-- size
13463--
13464-- This returns the size of a key/value pair table. It will also work on arrays,
13465-- but for arrays it is more efficient to use the # operator.
13466------------------------------------------------------------------------------------
13467--]]
13468function p.size(t)
13469 checkType('size', 1, t, 'table')
13470 local i = 0
13471 for k in pairs(t) do
13472 i = i + 1
13473 end
13474 return i
13475end
13476
13477return p</text>
13478 <sha1>k1omc17qij757n8hd68yihcqxo4biqi</sha1>
13479 </revision>
13480 </page>
13481 <page>
13482 <title>Module:Yesno</title>
13483 <ns>828</ns>
13484 <id>38665046</id>
13485 <revision>
13486 <id>828075573</id>
13487 <parentid>659459801</parentid>
13488 <timestamp>2018-02-28T12:14:32Z</timestamp>
13489 <contributor>
13490 <username>MSGJ</username>
13491 <id>42630</id>
13492 </contributor>
13493 <comment>+support for on/off</comment>
13494 <model>Scribunto</model>
13495 <format>text/plain</format>
13496 <text xml:space="preserve" bytes="745">-- Function allowing for consistent treatment of boolean-like wikitext input.
13497-- It works similarly to the template {{yesno}}.
13498
13499return function (val, default)
13500 -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
13501 -- should replace "val:lower()" with "mw.ustring.lower(val)" in the
13502 -- following line.
13503 val = type(val) == 'string' and val:lower() or val
13504 if val == nil then
13505 return nil
13506 elseif val == true
13507 or val == 'yes'
13508 or val == 'y'
13509 or val == 'true'
13510 or val == 't'
13511 or val == 'on'
13512 or tonumber(val) == 1
13513 then
13514 return true
13515 elseif val == false
13516 or val == 'no'
13517 or val == 'n'
13518 or val == 'false'
13519 or val == 'f'
13520 or val == 'off'
13521 or tonumber(val) == 0
13522 then
13523 return false
13524 else
13525 return default
13526 end
13527end</text>
13528 <sha1>swdskn7svew8i9wuydn9uj5l3r2ghcs</sha1>
13529 </revision>
13530 </page>
13531</mediawiki>