Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <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">
- <siteinfo>
- <sitename>Wikipedia</sitename>
- <dbname>enwiki</dbname>
- <base>https://en.wikipedia.org/wiki/Main_Page</base>
- <generator>MediaWiki 1.32.0-wmf.12</generator>
- <case>first-letter</case>
- <namespaces>
- <namespace key="-2" case="first-letter">Media</namespace>
- <namespace key="-1" case="first-letter">Special</namespace>
- <namespace key="0" case="first-letter" />
- <namespace key="1" case="first-letter">Talk</namespace>
- <namespace key="2" case="first-letter">User</namespace>
- <namespace key="3" case="first-letter">User talk</namespace>
- <namespace key="4" case="first-letter">Wikipedia</namespace>
- <namespace key="5" case="first-letter">Wikipedia talk</namespace>
- <namespace key="6" case="first-letter">File</namespace>
- <namespace key="7" case="first-letter">File talk</namespace>
- <namespace key="8" case="first-letter">MediaWiki</namespace>
- <namespace key="9" case="first-letter">MediaWiki talk</namespace>
- <namespace key="10" case="first-letter">Template</namespace>
- <namespace key="11" case="first-letter">Template talk</namespace>
- <namespace key="12" case="first-letter">Help</namespace>
- <namespace key="13" case="first-letter">Help talk</namespace>
- <namespace key="14" case="first-letter">Category</namespace>
- <namespace key="15" case="first-letter">Category talk</namespace>
- <namespace key="100" case="first-letter">Portal</namespace>
- <namespace key="101" case="first-letter">Portal talk</namespace>
- <namespace key="108" case="first-letter">Book</namespace>
- <namespace key="109" case="first-letter">Book talk</namespace>
- <namespace key="118" case="first-letter">Draft</namespace>
- <namespace key="119" case="first-letter">Draft talk</namespace>
- <namespace key="446" case="first-letter">Education Program</namespace>
- <namespace key="447" case="first-letter">Education Program talk</namespace>
- <namespace key="710" case="first-letter">TimedText</namespace>
- <namespace key="711" case="first-letter">TimedText talk</namespace>
- <namespace key="828" case="first-letter">Module</namespace>
- <namespace key="829" case="first-letter">Module talk</namespace>
- <namespace key="2300" case="first-letter">Gadget</namespace>
- <namespace key="2301" case="first-letter">Gadget talk</namespace>
- <namespace key="2302" case="case-sensitive">Gadget definition</namespace>
- <namespace key="2303" case="case-sensitive">Gadget definition talk</namespace>
- </namespaces>
- </siteinfo>
- <page>
- <title>Template:Infobox officeholder</title>
- <ns>10</ns>
- <id>1432586</id>
- <revision>
- <id>845343953</id>
- <parentid>845324208</parentid>
- <timestamp>2018-06-11T04:58:29Z</timestamp>
- <contributor>
- <username>Canley</username>
- <id>380571</id>
- </contributor>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="86903"><includeonly>{{infobox
- | bodyclass = vcard {{{bodyclass|}}}
- | bodystyle = {{#if:{{{mainwidth|}}}|width: {{{mainwidth}}}}}
- | child = {{lc:{{{embed}}}}}
- | abovestyle = font-size: 130%;
- | above = {{Br separated entries
- | 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>}}
- | 2 = <span class="fn">{{#if:{{{name|}}}|{{{name}}}|{{PAGENAMEBASE}}}}</span>
- | 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>}}
- }}
- | subheaderstyle = font-size:125%; font-weight:bold;
- | subheader = {{#ifeq:{{lc:{{{embed}}}}}|yes||{{#if:{{{native_name|}}}|<span class="nickname" {{#if:{{{native_name_lang|}}}|lang="{{{native_name_lang}}}"}}>{{{native_name}}}</span>}}}}
- | image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{width|{{{imagesize|{{{image_size|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
- | image2 = {{#invoke:InfoboxImage|InfoboxImage|image={{{image name|}}}|size={{{width|{{{imagesize|{{{image_size|}}}}}}}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
- | image3 = {{#invoke:InfoboxImage|InfoboxImage|image={{{smallimage|}}}|sizedefault=frameless|upright={{{image_upright|1}}}|alt={{{alt|}}}|suppressplaceholder=yes}}
- | caption{{#if:{{{smallimage|}}}|3|{{#if:{{{image name|}}}|2}}}} = {{{caption|}}}
- | headerstyle = {{#ifeq:{{lc:{{{embed}}}}}|yes|background:#eee|background:lavender}}
- | data1 =
- {{#if:{{{speaker|}}}|
- {{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname2|}}}
- | 1namedata = {{{1namedata2|}}}
- | 2blankname = {{{2blankname2|}}}
- | 2namedata = {{{2namedata2|}}}
- | 3blankname = {{{3blankname2|}}}
- | 3namedata = {{{3namedata2|}}}
- | 4blankname = {{{4blankname2|}}}
- | 4namedata = {{{4namedata2|}}}
- | 5blankname = {{{5blankname2|}}}
- | 5namedata = {{{5namedata2|}}}
- | alongside = {{{alongside2|}}}
- | ambassador_from = {{{ambassador_from2|}}}
- | appointer = {{#if: {{{appointer2|}}} | {{{appointer2}}} | {{{appointed2|}}} }}
- | assembly = {{{assembly2|}}}
- | chancellor = {{{chancellor2|}}}
- | co-leader = {{{co-leader2|}}}
- | constituency_{{#if:{{{constituency_AM2|}}}|AM|MP}} = {{#if: {{{constituency_AM2|}}} | {{{constituency_AM2}}} | {{{constituency_MP2|}}} }}
- | constituency = {{{constituency2|}}}
- | convocation = {{{convocation2|}}}
- | country = {{{country2|}}}
- | deputy = {{{deputy2|}}}
- | district = {{{district2|}}}
- | firstminister = {{{firstminister2|}}}
- | governor-general = {{{governor-general2|}}}
- | governor_general = {{{governor_general2|}}}
- | governor = {{{governor2|}}}
- | jr/sr = {{{jr/sr2|}}}
- | jr/sr and state = {{{jr/sr and state2|}}}
- | leader = {{{leader2|}}}
- | legislature = {{{legislature2|}}}
- | lieutenant_governor = {{{lieutenant_governor2|}}}
- | lieutenant = {{{lieutenant2|}}}
- | majority_leader = {{#if: {{{majorityleader2|}}} | {{{majorityleader2}}} | {{{majority_leader2|}}} }}
- | minister_from = {{{minister_from2|}}}
- | minority_floor_leader = {{{minority_floor_leader2|}}}
- | majority_floor_leader = {{{majority_floor_leader2|}}}
- | majority = {{{majority2|}}}
- | minister = {{{minister2|}}}
- | minority_leader = {{#if: {{{minorityleader2|}}} | {{{minorityleader2}}} | {{{minority_leader2|}}} }}
- | monarch = {{{monarch2|}}}
- | nominator = {{{nominator2|}}}
- | office = {{{office2|}}}
- | order = {{{order2|}}}
- | parliament = {{{parliament2|}}}
- | parliamentarygroup = {{{parliamentarygroup2|}}}
- | predecessor = {{{predecessor2|}}}
- | preceding = {{{preceding2|}}}
- | preceded = {{{preceded2|}}}
- | premier = {{{premier2|}}}
- | president = {{{president2|}}}
- | primeminister = {{{primeminister2|}}}
- | riding = {{{riding2|}}}
- | speaker = {{{speaker|}}}
- | speaker_office = {{{speaker_office|}}}
- | state_assembly = {{{state_assembly|}}}
- | state_delegate = {{{state_delegate|}}}
- | state_house = {{{state_house|}}}
- | state_legislature = {{{state_legislature|}}}
- | state_senate = {{{state_senate|}}}
- | state = {{{state|}}}
- | succeeded = {{{succeeded2|}}}
- | succeeding = {{{succeeding2|}}}
- | successor = {{{successor2|}}}
- | taoiseach = {{{taoiseach2|}}}
- | termlabel = {{{term_label2|{{{termlabel2|In office}}}}}}
- | termend = {{#if:{{{termend2|}}}|{{{termend2}}}|{{{term_end2|}}}}}
- | termstart = {{#if:{{{termstart2|}}}|{{{termstart2}}}|{{{term_start2|}}}}}
- | term = {{{term2|}}}
- | title = {{{title2|}}}
- | vicegovernor = {{{vicegovernor2|}}}
- | vicepresident = {{{vicepresident2|}}}
- | vicepremier = {{{vicepremier2|}}}
- | viceprimeminister = {{{viceprimeminister2|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term|}}}
- }}}}}}<!--
- -->{{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname|}}}
- | 1namedata = {{{1namedata|}}}
- | 2blankname = {{{2blankname|}}}
- | 2namedata = {{{2namedata|}}}
- | 3blankname = {{{3blankname|}}}
- | 3namedata = {{{3namedata|}}}
- | 4blankname = {{{4blankname|}}}
- | 4namedata = {{{4namedata|}}}
- | 5blankname = {{{5blankname|}}}
- | 5namedata = {{{5namedata|}}}
- | alongside = {{{alongside|}}}
- | ambassador_from = {{{ambassador_from|}}}
- | appointer = {{#if: {{{appointer|}}} | {{{appointer}}} | {{{appointed|}}} }}
- | assembly = {{{assembly|}}}
- | candidate = {{{candidate|}}}
- | chancellor = {{{chancellor|}}}
- | co-leader = {{{co-leader|}}}
- | constituency_{{#if:{{{constituency_AM|}}}|AM|MP}} = {{#if: {{{constituency_AM|}}} | {{{constituency_AM}}} | {{{constituency_MP|}}} }}
- | constituency = {{{constituency|}}}
- | convocation = {{{convocation|}}}
- | country = {{{country|}}}
- | deputy = {{{deputy|}}}
- | district = {{{district|}}}
- | election_date = {{{election_date|}}}
- | firstminister = {{{firstminister|}}}
- | governor-general = {{{governor-general|}}}
- | governor_general = {{{governor_general|}}}
- | governor = {{{governor|}}}
- | incumbent = {{{incumbent|}}}
- | jr/sr = {{{jr/sr|}}}
- | jr/sr and state = {{{jr/sr and state|}}}
- | leader = {{{leader|}}}
- | legislature = {{{legislature|}}}
- | lieutenant_governor = {{{lieutenant_governor|}}}
- | lieutenant = {{{lieutenant|}}}
- | majority_leader = {{#if: {{{majorityleader|}}} | {{{majorityleader}}} | {{{majority_leader|}}} }}
- | majority = {{{majority|}}}
- | minister = {{{minister|}}}
- | minister_from = {{{minister_from|}}}
- | minority_floor_leader = {{{minority_floor_leader|}}}
- | majority_floor_leader = {{{majority_floor_leader|}}}
- | minority_leader = {{#if: {{{minorityleader|}}} | {{{minorityleader}}} | {{{minority_leader|}}} }}
- | monarch = {{{monarch|}}}
- | nominator = {{{nominator|}}}
- | nominee = {{{nominee|}}}
- | office = {{{office|}}}
- | opponent = {{{opponent|}}}
- | order = {{{order|}}}
- | parliament = {{{parliament|}}}
- | parliamentarygroup = {{{parliamentarygroup|}}}
- | party_election = {{{party_election|}}}
- | predecessor = {{{predecessor|}}}
- | preceding = {{{preceding|}}}
- | preceded = {{{preceded|}}}
- | premier = {{{premier|}}}
- | president = {{{president|}}}
- | primeminister = {{{primeminister|}}}
- | riding = {{{riding|}}}
- | runningmate = {{{runningmate|}}}
- | state_assembly = {{{state_assembly|}}}
- | state_delegate = {{{state_delegate|}}}
- | state_house = {{{state_house|}}}
- | state_legislature = {{{state_legislature|}}}
- | state_senate = {{{state_senate|}}}
- | state = {{{state|}}}
- | succeeded = {{{succeeded|}}}
- | succeeding = {{{succeeding|}}}
- | successor = {{{successor|}}}
- | taoiseach = {{{taoiseach|}}}
- | termlabel = {{{term_label|{{{termlabel|In office}}}}}}
- | termend = {{#if: {{{termend|}}} | {{{termend}}} | {{{term_end|}}} }}
- | termstart = {{#if: {{{termstart|}}} | {{{termstart}}} | {{{term_start|}}} }}
- | term = {{{term|}}}
- | title = {{{title|}}}
- | vicegovernor = {{{vicegovernor|}}}
- | vicepresident = {{{vicepresident|}}}
- | vicepremier = {{{vicepremier|}}}
- | viceprimeminister = {{{viceprimeminister|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term|}}}
- }}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname1|}}}
- | 1namedata = {{{1namedata1|}}}
- | 2blankname = {{{2blankname1|}}}
- | 2namedata = {{{2namedata1|}}}
- | 3blankname = {{{3blankname1|}}}
- | 3namedata = {{{3namedata1|}}}
- | 4blankname = {{{4blankname1|}}}
- | 4namedata = {{{4namedata1|}}}
- | 5blankname = {{{5blankname1|}}}
- | 5namedata = {{{5namedata1|}}}
- | alongside = {{{alongside1|}}}
- | ambassador_from = {{{ambassador_from1|}}}
- | appointer = {{#if: {{{appointer1|}}} | {{{appointer1}}} | {{{appointed1|}}} }}
- | assembly = {{{assembly1|}}}
- | chancellor = {{{chancellor1|}}}
- | co-leader = {{{co-leader1|}}}
- | constituency_{{#if:{{{constituency_AM1|}}}|AM|MP}} = {{#if: {{{constituency_AM1|}}} | {{{constituency_AM1}}} | {{{constituency_MP1|}}} }}
- | constituency = {{{constituency1|}}}
- | convocation = {{{convocation1|}}}
- | country = {{{country1|}}}
- | deputy = {{{deputy1|}}}
- | district = {{{district1|}}}
- | firstminister = {{{firstminister1|}}}
- | governor-general = {{{governor-general1|}}}
- | governor_general = {{{governor_general1|}}}
- | governor = {{{governor1|}}}
- | jr/sr = {{{jr/sr1|}}}
- | jr/sr and state = {{{jr/sr and state1|}}}
- | leader = {{{leader1|}}}
- | legislature = {{{legislature1|}}}
- | lieutenant_governor = {{{lieutenant_governor1|}}}
- | lieutenant = {{{lieutenant1|}}}
- | minority_floor_leader = {{{minority_floor_leader1|}}}
- | minister_from = {{{minister_from1|}}}
- | majority_floor_leader = {{{majority_floor_leader1|}}}
- | majority_leader = {{#if: {{{majorityleader1|}}} | {{{majorityleader1}}} | {{{majority_leader1|}}} }}
- | majority = {{{majority1|}}}
- | minister = {{{minister1|}}}
- | minority_leader = {{#if: {{{minorityleader1|}}} | {{{minorityleader1}}} | {{{minority_leader1|}}} }}
- | monarch = {{{monarch1|}}}
- | nominator = {{{nominator1|}}}
- | office = {{{office1|}}}
- | order = {{{order1|}}}
- | parliament = {{{parliament1|}}}
- | parliamentarygroup = {{{parliamentarygroup1|}}}
- | predecessor = {{{predecessor1|}}}
- | preceding = {{{preceding1|}}}
- | preceded = {{{preceded1|}}}
- | premier = {{{premier1|}}}
- | president = {{{president1|}}}
- | primeminister = {{{primeminister1|}}}
- | riding = {{{riding1|}}}
- | state_assembly = {{{state_assembly1|}}}
- | state_delegate = {{{state_delegate1|}}}
- | state_house = {{{state_house1|}}}
- | state_legislature = {{{state_legislature1|}}}
- | state_senate = {{{state_senate1|}}}
- | state = {{{state1|}}}
- | succeeded = {{{succeeded1|}}}
- | succeeding = {{{succeeding1|}}}
- | successor = {{{successor1|}}}
- | taoiseach = {{{taoiseach1|}}}
- | termlabel = {{{term_label1|{{{termlabel1|In office}}}}}}
- | termend = {{#if:{{{termend1|}}}|{{{termend1}}}|{{{term_end1|}}}}}
- | termstart = {{#if:{{{termstart1|}}}|{{{termstart1}}}|{{{term_start1|}}}}}
- | term = {{{term1|}}}
- | title = {{{title1|}}}
- | vicegovernor = {{{vicegovernor1|}}}
- | vicepresident = {{{vicepresident1|}}}
- | vicepremier = {{{vicepremier1|}}}
- | viceprimeminister = {{{viceprimeminister1|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term1|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{#if:{{{speaker|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname2|}}}
- | 1namedata = {{{1namedata2|}}}
- | 2blankname = {{{2blankname2|}}}
- | 2namedata = {{{2namedata2|}}}
- | 3blankname = {{{3blankname2|}}}
- | 3namedata = {{{3namedata2|}}}
- | 4blankname = {{{4blankname2|}}}
- | 4namedata = {{{4namedata2|}}}
- | 5blankname = {{{5blankname2|}}}
- | 5namedata = {{{5namedata2|}}}
- | alongside = {{{alongside2|}}}
- | ambassador_from = {{{ambassador_from2|}}}
- | appointer = {{#if: {{{appointer2|}}} | {{{appointer2}}} | {{{appointed2|}}} }}
- | assembly = {{{assembly2|}}}
- | chancellor = {{{chancellor2|}}}
- | co-leader = {{{co-leader2|}}}
- | constituency_{{#if:{{{constituency_AM2|}}}|AM|MP}} = {{#if: {{{constituency_AM2|}}} | {{{constituency_AM2}}} | {{{constituency_MP2|}}} }}
- | constituency = {{{constituency2|}}}
- | convocation = {{{convocation2|}}}
- | country = {{{country2|}}}
- | deputy = {{{deputy2|}}}
- | district = {{{district2|}}}
- | firstminister = {{{firstminister2|}}}
- | governor-general = {{{governor-general2|}}}
- | governor_general = {{{governor_general2|}}}
- | governor = {{{governor2|}}}
- | jr/sr = {{{jr/sr2|}}}
- | jr/sr and state = {{{jr/sr and state2|}}}
- | leader = {{{leader2|}}}
- | legislature = {{{legislature2|}}}
- | lieutenant_governor = {{{lieutenant_governor2|}}}
- | lieutenant = {{{lieutenant2|}}}
- | majority_leader = {{#if: {{{majorityleader2|}}} | {{{majorityleader2}}} | {{{majority_leader2|}}} }}
- | minister_from = {{{minister_from2|}}}
- | minority_floor_leader = {{{minority_floor_leader2|}}}
- | majority_floor_leader = {{{majority_floor_leader2|}}}
- | majority = {{{majority2|}}}
- | minister = {{{minister2|}}}
- | minority_leader = {{#if: {{{minorityleader2|}}} | {{{minorityleader2}}} | {{{minority_leader2|}}} }}
- | monarch = {{{monarch2|}}}
- | nominator = {{{nominator2|}}}
- | office = {{{office2|}}}
- | order = {{{order2|}}}
- | parliament = {{{parliament2|}}}
- | parliamentarygroup = {{{parliamentarygroup2|}}}
- | predecessor = {{{predecessor2|}}}
- | preceding = {{{preceding2|}}}
- | preceded = {{{preceded2|}}}
- | premier = {{{premier2|}}}
- | president = {{{president2|}}}
- | primeminister = {{{primeminister2|}}}
- | riding = {{{riding2|}}}
- | state_assembly = {{{state_assembly2|}}}
- | state_delegate = {{{state_delegate2|}}}
- | state_house = {{{state_house2|}}}
- | state_legislature = {{{state_legislature2|}}}
- | state_senate = {{{state_senate2|}}}
- | state = {{{state2|}}}
- | succeeded = {{{succeeded2|}}}
- | succeeding = {{{succeeding2|}}}
- | successor = {{{successor2|}}}
- | taoiseach = {{{taoiseach2|}}}
- | termlabel = {{{term_label2|{{{termlabel2|In office}}}}}}
- | termend = {{#if:{{{termend2|}}}|{{{termend2}}}|{{{term_end2|}}}}}
- | termstart = {{#if:{{{termstart2|}}}|{{{termstart2}}}|{{{term_start2|}}}}}
- | term = {{{term2|}}}
- | title = {{{title2|}}}
- | vicegovernor = {{{vicegovernor2|}}}
- | vicepresident = {{{vicepresident2|}}}
- | vicepremier = {{{vicepremier2|}}}
- | viceprimeminister = {{{viceprimeminister2|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term2|}}}
- }}}}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname3|}}}
- | 1namedata = {{{1namedata3|}}}
- | 2blankname = {{{2blankname3|}}}
- | 2namedata = {{{2namedata3|}}}
- | 3blankname = {{{3blankname3|}}}
- | 3namedata = {{{3namedata3|}}}
- | 4blankname = {{{4blankname3|}}}
- | 4namedata = {{{4namedata3|}}}
- | 5blankname = {{{5blankname3|}}}
- | 5namedata = {{{5namedata3|}}}
- | alongside = {{{alongside3|}}}
- | ambassador_from = {{{ambassador_from3|}}}
- | appointer = {{#if: {{{appointer3|}}} | {{{appointer3}}} | {{{appointed3|}}} }}
- | assembly = {{{assembly3|}}}
- | chancellor = {{{chancellor3|}}}
- | co-leader = {{{co-leader3|}}}
- | constituency_{{#if:{{{constituency_AM3|}}}|AM|MP}} = {{#if: {{{constituency_AM3|}}} | {{{constituency_AM3}}} | {{{constituency_MP3|}}} }}
- | constituency = {{{constituency3|}}}
- | convocation = {{{convocation3|}}}
- | country = {{{country3|}}}
- | deputy = {{{deputy3|}}}
- | district = {{{district3|}}}
- | firstminister = {{{firstminister3|}}}
- | governor-general = {{{governor-general3|}}}
- | governor_general = {{{governor_general3|}}}
- | governor = {{{governor3|}}}
- | jr/sr = {{{jr/sr3|}}}
- | jr/sr and state = {{{jr/sr and state3|}}}
- | leader = {{{leader3|}}}
- | legislature = {{{legislature3|}}}
- | lieutenant_governor = {{{lieutenant_governor3|}}}
- | lieutenant = {{{lieutenant3|}}}
- | minority_floor_leader = {{{minority_floor_leader3|}}}
- | minister_from = {{{minister_from3|}}}
- | majority_floor_leader = {{{majority_floor_leader3|}}}
- | majority_leader = {{#if: {{{majorityleader3|}}} | {{{majorityleader3}}} | {{{majority_leader3|}}} }}
- | majority = {{{majority3|}}}
- | minister = {{{minister3|}}}
- | minority_leader = {{#if: {{{minorityleader3|}}} | {{{minorityleader3}}} | {{{minority_leader3|}}} }}
- | monarch = {{{monarch3|}}}
- | nominator = {{{nominator3|}}}
- | office = {{{office3|}}}
- | order = {{{order3|}}}
- | parliament = {{{parliament3|}}}
- | parliamentarygroup = {{{parliamentarygroup3|}}}
- | predecessor = {{{predecessor3|}}}
- | preceding = {{{preceding3|}}}
- | preceded = {{{preceded3|}}}
- | premier = {{{premier3|}}}
- | president = {{{president3|}}}
- | primeminister = {{{primeminister3|}}}
- | riding = {{{riding3|}}}
- | state_assembly = {{{state_assembly3|}}}
- | state_delegate = {{{state_delegate3|}}}
- | state_house = {{{state_house3|}}}
- | state_legislature = {{{state_legislature3|}}}
- | state_senate = {{{state_senate3|}}}
- | state = {{{state3|}}}
- | succeeded = {{{succeeded3|}}}
- | succeeding = {{{succeeding3|}}}
- | successor = {{{successor3|}}}
- | taoiseach = {{{taoiseach3|}}}
- | termlabel = {{{term_label3|{{{termlabel3|In office}}}}}}
- | termend = {{#if:{{{termend3|}}}|{{{termend3}}}|{{{term_end3|}}}}}
- | termstart = {{#if:{{{termstart3|}}}|{{{termstart3}}}|{{{term_start3|}}}}}
- | term = {{{term3|}}}
- | title = {{{title3|}}}
- | vicegovernor = {{{vicegovernor3|}}}
- | vicepresident = {{{vicepresident3|}}}
- | vicepremier = {{{vicepremier3|}}}
- | viceprimeminister = {{{viceprimeminister3|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term3|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname4|}}}
- | 1namedata = {{{1namedata4|}}}
- | 2blankname = {{{2blankname4|}}}
- | 2namedata = {{{2namedata4|}}}
- | 3blankname = {{{3blankname4|}}}
- | 3namedata = {{{3namedata4|}}}
- | 4blankname = {{{4blankname4|}}}
- | 4namedata = {{{4namedata4|}}}
- | 5blankname = {{{5blankname4|}}}
- | 5namedata = {{{5namedata4|}}}
- | alongside = {{{alongside4|}}}
- | ambassador_from = {{{ambassador_from4|}}}
- | appointer = {{#if: {{{appointer4|}}} | {{{appointer4}}} | {{{appointed4|}}} }}
- | assembly = {{{assembly4|}}}
- | chancellor = {{{chancellor4|}}}
- | co-leader = {{{co-leader4|}}}
- | constituency_{{#if:{{{constituency_AM4|}}}|AM|MP}} = {{#if: {{{constituency_AM4|}}} | {{{constituency_AM4}}} | {{{constituency_MP4|}}} }}
- | constituency = {{{constituency4|}}}
- | convocation = {{{convocation4|}}}
- | country = {{{country4|}}}
- | deputy = {{{deputy4|}}}
- | district = {{{district4|}}}
- | firstminister = {{{firstminister4|}}}
- | governor-general = {{{governor-general4|}}}
- | governor_general = {{{governor_general4|}}}
- | governor = {{{governor4|}}}
- | jr/sr = {{{jr/sr4|}}}
- | jr/sr and state = {{{jr/sr and state4|}}}
- | leader = {{{leader4|}}}
- | legislature = {{{legislature4|}}}
- | lieutenant_governor = {{{lieutenant_governor4|}}}
- | lieutenant = {{{lieutenant4|}}}
- | minister_from = {{{minister_from4|}}}
- | minority_floor_leader = {{{minority_floor_leader4|}}}
- | majority_floor_leader = {{{majority_floor_leader4|}}}
- | majority_leader = {{#if: {{{majorityleader4|}}} | {{{majorityleader4}}} | {{{majority_leader4|}}} }}
- | majority = {{{majority4|}}}
- | minister = {{{minister4|}}}
- | minority_leader = {{#if: {{{minorityleader4|}}} | {{{minorityleader4}}} | {{{minority_leader4|}}} }}
- | monarch = {{{monarch4|}}}
- | nominator = {{{nominator4|}}}
- | office = {{{office4|}}}
- | order = {{{order4|}}}
- | parliament = {{{parliament4|}}}
- | parliamentarygroup = {{{parliamentarygroup4|}}}
- | predecessor = {{{predecessor4|}}}
- | preceding = {{{preceding4|}}}
- | preceded = {{{preceded4|}}}
- | premier = {{{premier4|}}}
- | president = {{{president4|}}}
- | primeminister = {{{primeminister4|}}}
- | riding = {{{riding4|}}}
- | state_assembly = {{{state_assembly4|}}}
- | state_delegate = {{{state_delegate4|}}}
- | state_house = {{{state_house4|}}}
- | state_legislature = {{{state_legislature4|}}}
- | state_senate = {{{state_senate4|}}}
- | state = {{{state4|}}}
- | succeeded = {{{succeeded4|}}}
- | succeeding = {{{succeeding4|}}}
- | successor = {{{successor4|}}}
- | taoiseach = {{{taoiseach4|}}}
- | termlabel = {{{term_label4|{{{termlabel4|In office}}}}}}
- | termend = {{#if:{{{termend4|}}}|{{{termend4}}}|{{{term_end4|}}}}}
- | termstart = {{#if:{{{termstart4|}}}|{{{termstart4}}}|{{{term_start4|}}}}}
- | term = {{{term4|}}}
- | title = {{{title4|}}}
- | vicegovernor = {{{vicegovernor4|}}}
- | vicepresident = {{{vicepresident4|}}}
- | vicepremier = {{{vicepremier4|}}}
- | viceprimeminister = {{{viceprimeminister4|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term4|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname5|}}}
- | 1namedata = {{{1namedata5|}}}
- | 2blankname = {{{2blankname5|}}}
- | 2namedata = {{{2namedata5|}}}
- | 3blankname = {{{3blankname5|}}}
- | 3namedata = {{{3namedata5|}}}
- | 4blankname = {{{4blankname5|}}}
- | 4namedata = {{{4namedata5|}}}
- | 5blankname = {{{5blankname5|}}}
- | 5namedata = {{{5namedata5|}}}
- | alongside = {{{alongside5|}}}
- | ambassador_from = {{{ambassador_from5|}}}
- | appointer = {{#if: {{{appointer5|}}} | {{{appointer5}}} | {{{appointed5|}}} }}
- | assembly = {{{assembly5|}}}
- | chancellor = {{{chancellor5|}}}
- | co-leader = {{{co-leader5|}}}
- | constituency_{{#if:{{{constituency_AM5|}}}|AM|MP}} = {{#if: {{{constituency_AM5|}}} | {{{constituency_AM5}}} | {{{constituency_MP5|}}} }}
- | constituency = {{{constituency5|}}}
- | convocation = {{{convocation5|}}}
- | country = {{{country5|}}}
- | deputy = {{{deputy5|}}}
- | district = {{{district5|}}}
- | firstminister = {{{firstminister5|}}}
- | governor-general = {{{governor-general5|}}}
- | governor_general = {{{governor_general5|}}}
- | governor = {{{governor5|}}}
- | jr/sr = {{{jr/sr5|}}}
- | jr/sr and state = {{{jr/sr and state5|}}}
- | leader = {{{leader5|}}}
- | legislature = {{{legislature5|}}}
- | lieutenant_governor = {{{lieutenant_governor5|}}}
- | lieutenant = {{{lieutenant5|}}}
- | minister_from = {{{minister_from5|}}}
- | minority_floor_leader = {{{minority_floor_leader5|}}}
- | majority_floor_leader = {{{majority_floor_leader5|}}}
- | majority_leader = {{#if: {{{majorityleader5|}}} | {{{majorityleader5}}} | {{{majority_leader5|}}} }}
- | majority = {{{majority5|}}}
- | minister = {{{minister5|}}}
- | minority_leader = {{#if: {{{minorityleader5|}}} | {{{minorityleader5}}} | {{{minority_leader5|}}} }}
- | monarch = {{{monarch5|}}}
- | nominator = {{{nominator5|}}}
- | office = {{{office5|}}}
- | order = {{{order5|}}}
- | parliament = {{{parliament5|}}}
- | parliamentarygroup = {{{parliamentarygroup5|}}}
- | predecessor = {{{predecessor5|}}}
- | preceding = {{{preceding5|}}}
- | preceded = {{{preceded5|}}}
- | premier = {{{premier5|}}}
- | president = {{{president5|}}}
- | primeminister = {{{primeminister5|}}}
- | riding = {{{riding5|}}}
- | state_assembly = {{{state_assembly5|}}}
- | state_delegate = {{{state_delegate5|}}}
- | state_house = {{{state_house5|}}}
- | state_legislature = {{{state_legislature5|}}}
- | state_senate = {{{state_senate5|}}}
- | state = {{{state5|}}}
- | succeeded = {{{succeeded5|}}}
- | succeeding = {{{succeeding5|}}}
- | successor = {{{successor5|}}}
- | taoiseach = {{{taoiseach5|}}}
- | termlabel = {{{term_label5|{{{termlabel5|In office}}}}}}
- | termend = {{#if:{{{termend5|}}}|{{{termend5}}}|{{{term_end5|}}}}}
- | termstart = {{#if:{{{termstart5|}}}|{{{termstart5}}}|{{{term_start5|}}}}}
- | term = {{{term5|}}}
- | title = {{{title5|}}}
- | vicegovernor = {{{vicegovernor5|}}}
- | vicepresident = {{{vicepresident5|}}}
- | vicepremier = {{{vicepremier5|}}}
- | viceprimeminister = {{{viceprimeminister5|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term5|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname6|}}}
- | 1namedata = {{{1namedata6|}}}
- | 2blankname = {{{2blankname6|}}}
- | 2namedata = {{{2namedata6|}}}
- | 3blankname = {{{3blankname6|}}}
- | 3namedata = {{{3namedata6|}}}
- | 4blankname = {{{4blankname6|}}}
- | 4namedata = {{{4namedata6|}}}
- | 5blankname = {{{5blankname6|}}}
- | 5namedata = {{{5namedata6|}}}
- | alongside = {{{alongside6|}}}
- | ambassador_from = {{{ambassador_from6|}}}
- | appointer = {{#if: {{{appointer6|}}} | {{{appointer6}}} | {{{appointed6|}}} }}
- | assembly = {{{assembly6|}}}
- | chancellor = {{{chancellor6|}}}
- | co-leader = {{{co-leader6|}}}
- | constituency_{{#if:{{{constituency_AM6|}}}|AM|MP}} = {{#if: {{{constituency_AM6|}}} | {{{constituency_AM6}}} | {{{constituency_MP6|}}} }}
- | constituency = {{{constituency6|}}}
- | convocation = {{{convocation6|}}}
- | country = {{{country6|}}}
- | deputy = {{{deputy6|}}}
- | district = {{{district6|}}}
- | firstminister = {{{firstminister6|}}}
- | governor-general = {{{governor-general6|}}}
- | governor_general = {{{governor_general6|}}}
- | governor = {{{governor6|}}}
- | jr/sr = {{{jr/sr6|}}}
- | jr/sr and state = {{{jr/sr and state6|}}}
- | leader = {{{leader6|}}}
- | legislature = {{{legislature6|}}}
- | lieutenant_governor = {{{lieutenant_governor6|}}}
- | lieutenant = {{{lieutenant6|}}}
- | minority_floor_leader = {{{minority_floor_leader6|}}}
- | minister_from = {{{minister_from6|}}}
- | majority_floor_leader = {{{majority_floor_leader6|}}}
- | majority_leader = {{#if: {{{majorityleader6|}}} | {{{majorityleader6}}} | {{{majority_leader6|}}} }}
- | majority = {{{majority6|}}}
- | minister = {{{minister6|}}}
- | minority_leader = {{#if: {{{minorityleader6|}}} | {{{minorityleader6}}} | {{{minority_leader6|}}} }}
- | monarch = {{{monarch6|}}}
- | nominator = {{{nominator6|}}}
- | office = {{{office6|}}}
- | order = {{{order6|}}}
- | parliament = {{{parliament6|}}}
- | parliamentarygroup = {{{parliamentarygroup6|}}}
- | predecessor = {{{predecessor6|}}}
- | preceding = {{{preceding6|}}}
- | preceded = {{{preceded6|}}}
- | premier = {{{premier6|}}}
- | president = {{{president6|}}}
- | primeminister = {{{primeminister6|}}}
- | riding = {{{riding6|}}}
- | state_assembly = {{{state_assembly6|}}}
- | state_delegate = {{{state_delegate6|}}}
- | state_house = {{{state_house6|}}}
- | state_legislature = {{{state_legislature6|}}}
- | state_senate = {{{state_senate6|}}}
- | state = {{{state6|}}}
- | succeeded = {{{succeeded6|}}}
- | succeeding = {{{succeeding6|}}}
- | successor = {{{successor6|}}}
- | taoiseach = {{{taoiseach6|}}}
- | termlabel = {{{term_label6|{{{termlabel6|In office}}}}}}
- | termend = {{#if:{{{termend6|}}}|{{{termend6}}}|{{{term_end6|}}}}}
- | termstart = {{#if:{{{termstart6|}}}|{{{termstart6}}}|{{{term_start6|}}}}}
- | term = {{{term6|}}}
- | title = {{{title6|}}}
- | vicegovernor = {{{vicegovernor6|}}}
- | vicepresident = {{{vicepresident6|}}}
- | vicepremier = {{{vicepremier6|}}}
- | viceprimeminister = {{{viceprimeminister6|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term6|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname7|}}}
- | 1namedata = {{{1namedata7|}}}
- | 2blankname = {{{2blankname7|}}}
- | 2namedata = {{{2namedata7|}}}
- | 3blankname = {{{3blankname7|}}}
- | 3namedata = {{{3namedata7|}}}
- | 4blankname = {{{4blankname7|}}}
- | 4namedata = {{{4namedata7|}}}
- | 5blankname = {{{5blankname7|}}}
- | 5namedata = {{{5namedata7|}}}
- | alongside = {{{alongside7|}}}
- | ambassador_from = {{{ambassador_from7|}}}
- | appointer = {{#if: {{{appointer7|}}} | {{{appointer7}}} | {{{appointed7|}}} }}
- | assembly = {{{assembly7|}}}
- | chancellor = {{{chancellor7|}}}
- | co-leader = {{{co-leader7|}}}
- | constituency_{{#if:{{{constituency_AM7|}}}|AM|MP}} = {{#if: {{{constituency_AM7|}}} | {{{constituency_AM7}}} | {{{constituency_MP7|}}} }}
- | constituency = {{{constituency7|}}}
- | convocation = {{{convocation7|}}}
- | country = {{{country7|}}}
- | deputy = {{{deputy7|}}}
- | district = {{{district7|}}}
- | firstminister = {{{firstminister7|}}}
- | governor-general = {{{governor-general7|}}}
- | governor_general = {{{governor_general7|}}}
- | governor = {{{governor7|}}}
- | jr/sr = {{{jr/sr7|}}}
- | jr/sr and state = {{{jr/sr and state7|}}}
- | leader = {{{leader7|}}}
- | legislature = {{{legislature7|}}}
- | lieutenant_governor = {{{lieutenant_governor7|}}}
- | lieutenant = {{{lieutenant7|}}}
- | minister_from = {{{minister_from7|}}}
- | minority_floor_leader = {{{minority_floor_leader7|}}}
- | majority_floor_leader = {{{majority_floor_leader7|}}}
- | majority_leader = {{#if: {{{majorityleader7|}}} | {{{majorityleader7}}} | {{{majority_leader7|}}} }}
- | majority = {{{majority7|}}}
- | minister = {{{minister7|}}}
- | minority_leader = {{#if: {{{minorityleader7|}}} | {{{minorityleader7}}} | {{{minority_leader7|}}} }}
- | monarch = {{{monarch7|}}}
- | nominator = {{{nominator7|}}}
- | office = {{{office7|}}}
- | order = {{{order7|}}}
- | parliament = {{{parliament7|}}}
- | parliamentarygroup = {{{parliamentarygroup7|}}}
- | predecessor = {{{predecessor7|}}}
- | preceding = {{{preceding7|}}}
- | preceded = {{{preceded7|}}}
- | premier = {{{premier7|}}}
- | president = {{{president7|}}}
- | primeminister = {{{primeminister7|}}}
- | riding = {{{riding7|}}}
- | state_assembly = {{{state_assembly7|}}}
- | state_delegate = {{{state_delegate7|}}}
- | state_house = {{{state_house7|}}}
- | state_legislature = {{{state_legislature7|}}}
- | state_senate = {{{state_senate7|}}}
- | state = {{{state7|}}}
- | succeeded = {{{succeeded7|}}}
- | succeeding = {{{succeeding7|}}}
- | successor = {{{successor7|}}}
- | taoiseach = {{{taoiseach7|}}}
- | termlabel = {{{term_label7|{{{termlabel7|In office}}}}}}
- | termend = {{#if:{{{termend7|}}}|{{{termend7}}}|{{{term_end7|}}}}}
- | termstart = {{#if:{{{termstart7|}}}|{{{termstart7}}}|{{{term_start7|}}}}}
- | term = {{{term7|}}}
- | title = {{{title7|}}}
- | vicegovernor = {{{vicegovernor7|}}}
- | vicepresident = {{{vicepresident7|}}}
- | vicepremier = {{{vicepremier7|}}}
- | viceprimeminister = {{{viceprimeminister7|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term7|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname8|}}}
- | 1namedata = {{{1namedata8|}}}
- | 2blankname = {{{2blankname8|}}}
- | 2namedata = {{{2namedata8|}}}
- | 3blankname = {{{3blankname8|}}}
- | 3namedata = {{{3namedata8|}}}
- | 4blankname = {{{4blankname8|}}}
- | 4namedata = {{{4namedata8|}}}
- | 5blankname = {{{5blankname8|}}}
- | 5namedata = {{{5namedata8|}}}
- | alongside = {{{alongside8|}}}
- | ambassador_from = {{{ambassador_from8|}}}
- | appointer = {{#if: {{{appointer8|}}} | {{{appointer8}}} | {{{appointed8|}}} }}
- | assembly = {{{assembly8|}}}
- | chancellor = {{{chancellor8|}}}
- | co-leader = {{{co-leader8|}}}
- | constituency_{{#if:{{{constituency_AM8|}}}|AM|MP}} = {{#if: {{{constituency_AM8|}}} | {{{constituency_AM8}}} | {{{constituency_MP8|}}} }}
- | constituency = {{{constituency8|}}}
- | convocation = {{{convocation8|}}}
- | country = {{{country8|}}}
- | deputy = {{{deputy8|}}}
- | district = {{{district8|}}}
- | firstminister = {{{firstminister8|}}}
- | governor-general = {{{governor-general8|}}}
- | governor_general = {{{governor_general8|}}}
- | governor = {{{governor8|}}}
- | jr/sr = {{{jr/sr8|}}}
- | jr/sr and state = {{{jr/sr and state8|}}}
- | leader = {{{leader8|}}}
- | legislature = {{{legislature8|}}}
- | lieutenant_governor = {{{lieutenant_governor8|}}}
- | lieutenant = {{{lieutenant8|}}}
- | minister_from = {{{minister_from8|}}}
- | minority_floor_leader = {{{minority_floor_leader8|}}}
- | majority_floor_leader = {{{majority_floor_leader8|}}}
- | majority_leader = {{#if: {{{majorityleader8|}}} | {{{majorityleader8}}} | {{{majority_leader8|}}} }}
- | majority = {{{majority8|}}}
- | minister = {{{minister8|}}}
- | minority_leader = {{#if: {{{minorityleader8|}}} | {{{minorityleader8}}} | {{{minority_leader8|}}} }}
- | monarch = {{{monarch8|}}}
- | nominator = {{{nominator8|}}}
- | office = {{{office8|}}}
- | order = {{{order8|}}}
- | parliament = {{{parliament8|}}}
- | parliamentarygroup = {{{parliamentarygroup8|}}}
- | predecessor = {{{predecessor8|}}}
- | preceding = {{{preceding8|}}}
- | preceded = {{{preceded8|}}}
- | premier = {{{premier8|}}}
- | president = {{{president8|}}}
- | primeminister = {{{primeminister8|}}}
- | riding = {{{riding8|}}}
- | state_assembly = {{{state_assembly8|}}}
- | state_delegate = {{{state_delegate8|}}}
- | state_house = {{{state_house8|}}}
- | state_legislature = {{{state_legislature8|}}}
- | state_senate = {{{state_senate8|}}}
- | state = {{{state8|}}}
- | succeeded = {{{succeeded8|}}}
- | succeeding = {{{succeeding8|}}}
- | successor = {{{successor8|}}}
- | taoiseach = {{{taoiseach8|}}}
- | termlabel = {{{term_label8|{{{termlabel8|In office}}}}}}
- | termend = {{#if:{{{termend8|}}}|{{{termend8}}}|{{{term_end8|}}}}}
- | termstart = {{#if:{{{termstart8|}}}|{{{termstart8}}}|{{{term_start8|}}}}}
- | term = {{{term8|}}}
- | title = {{{title8|}}}
- | vicegovernor = {{{vicegovernor8|}}}
- | vicepresident = {{{vicepresident8|}}}
- | vicepremier = {{{vicepremier8|}}}
- | viceprimeminister = {{{viceprimeminister8|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term8|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname9|}}}
- | 1namedata = {{{1namedata9|}}}
- | 2blankname = {{{2blankname9|}}}
- | 2namedata = {{{2namedata9|}}}
- | 3blankname = {{{3blankname9|}}}
- | 3namedata = {{{3namedata9|}}}
- | 4blankname = {{{4blankname9|}}}
- | 4namedata = {{{4namedata9|}}}
- | 5blankname = {{{5blankname9|}}}
- | 5namedata = {{{5namedata9|}}}
- | alongside = {{{alongside9|}}}
- | ambassador_from = {{{ambassador_from9|}}}
- | appointer = {{#if: {{{appointer9|}}} | {{{appointer9}}} | {{{appointed9|}}} }}
- | assembly = {{{assembly9|}}}
- | chancellor = {{{chancellor9|}}}
- | co-leader = {{{co-leader9|}}}
- | constituency_{{#if:{{{constituency_AM9|}}}|AM|MP}} = {{#if: {{{constituency_AM9|}}} | {{{constituency_AM9}}} | {{{constituency_MP9|}}} }}
- | constituency = {{{constituency9|}}}
- | convocation = {{{convocation9|}}}
- | country = {{{country9|}}}
- | deputy = {{{deputy9|}}}
- | district = {{{district9|}}}
- | firstminister = {{{firstminister9|}}}
- | governor-general = {{{governor-general9|}}}
- | governor_general = {{{governor_general9|}}}
- | governor = {{{governor9|}}}
- | jr/sr = {{{jr/sr9|}}}
- | jr/sr and state = {{{jr/sr and state9|}}}
- | leader = {{{leader9|}}}
- | legislature = {{{legislature9|}}}
- | lieutenant_governor = {{{lieutenant_governor9|}}}
- | lieutenant = {{{lieutenant9|}}}
- | minister_from = {{{minister_from9|}}}
- | minority_floor_leader = {{{minority_floor_leader9|}}}
- | majority_floor_leader = {{{majority_floor_leader9|}}}
- | majority_leader = {{#if: {{{majorityleader9|}}} | {{{majorityleader9}}} | {{{majority_leader9|}}} }}
- | majority = {{{majority9|}}}
- | minister = {{{minister9|}}}
- | minority_leader = {{#if: {{{minorityleader9|}}} | {{{minorityleader9}}} | {{{minority_leader9|}}} }}
- | monarch = {{{monarch9|}}}
- | nominator = {{{nominator9|}}}
- | office = {{{office9|}}}
- | order = {{{order9|}}}
- | parliament = {{{parliament9|}}}
- | parliamentarygroup = {{{parliamentarygroup9|}}}
- | predecessor = {{{predecessor9|}}}
- | preceding = {{{preceding9|}}}
- | preceded = {{{preceded9|}}}
- | premier = {{{premier9|}}}
- | president = {{{president9|}}}
- | primeminister = {{{primeminister9|}}}
- | riding = {{{riding9|}}}
- | state_assembly = {{{state_assembly9|}}}
- | state_delegate = {{{state_delegate9|}}}
- | state_house = {{{state_house9|}}}
- | state_legislature = {{{state_legislature9|}}}
- | state_senate = {{{state_senate9|}}}
- | state = {{{state9|}}}
- | succeeded = {{{succeeded9|}}}
- | succeeding = {{{succeeding9|}}}
- | successor = {{{successor9|}}}
- | taoiseach = {{{taoiseach9|}}}
- | termlabel = {{{term_label9|{{{termlabel9|In office}}}}}}
- | termend = {{#if:{{{termend9|}}}|{{{termend9}}}|{{{term_end9|}}}}}
- | termstart = {{#if:{{{termstart9|}}}|{{{termstart9}}}|{{{term_start9|}}}}}
- | term = {{{term9|}}}
- | title = {{{title9|}}}
- | vicegovernor = {{{vicegovernor9|}}}
- | vicepresident = {{{vicepresident9|}}}
- | vicepremier = {{{vicepremier9|}}}
- | viceprimeminister = {{{viceprimeminister9|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term9|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname10|}}}
- | 1namedata = {{{1namedata10|}}}
- | 2blankname = {{{2blankname10|}}}
- | 2namedata = {{{2namedata10|}}}
- | 3blankname = {{{3blankname10|}}}
- | 3namedata = {{{3namedata10|}}}
- | 4blankname = {{{4blankname10|}}}
- | 4namedata = {{{4namedata10|}}}
- | 5blankname = {{{5blankname10|}}}
- | 5namedata = {{{5namedata10|}}}
- | alongside = {{{alongside10|}}}
- | ambassador_from = {{{ambassador_from10|}}}
- | appointer = {{#if: {{{appointer10|}}} | {{{appointer10}}} | {{{appointed10|}}} }}
- | assembly = {{{assembly10|}}}
- | chancellor = {{{chancellor10|}}}
- | co-leader = {{{co-leader10|}}}
- | constituency_{{#if:{{{constituency_AM10|}}}|AM|MP}} = {{#if: {{{constituency_AM10|}}} | {{{constituency_AM10}}} | {{{constituency_MP10|}}} }}
- | constituency = {{{constituency10|}}}
- | convocation = {{{convocation10|}}}
- | country = {{{country10|}}}
- | deputy = {{{deputy10|}}}
- | district = {{{district10|}}}
- | firstminister = {{{firstminister10|}}}
- | governor-general = {{{governor-general10|}}}
- | governor_general = {{{governor_general10|}}}
- | governor = {{{governor10|}}}
- | jr/sr = {{{jr/sr10|}}}
- | jr/sr and state = {{{jr/sr and state10|}}}
- | leader = {{{leader10|}}}
- | legislature = {{{legislature10|}}}
- | lieutenant_governor = {{{lieutenant_governor10|}}}
- | lieutenant = {{{lieutenant10|}}}
- | minister_from = {{{minister_from10|}}}
- | minority_floor_leader = {{{minority_floor_leader10|}}}
- | majority_floor_leader = {{{majority_floor_leader10|}}}
- | majority_leader = {{#if: {{{majorityleader10|}}} | {{{majorityleader10}}} | {{{majority_leader10|}}} }}
- | majority = {{{majority10|}}}
- | minister = {{{minister10|}}}
- | minority_leader = {{#if: {{{minorityleader10|}}} | {{{minorityleader10}}} | {{{minority_leader10|}}} }}
- | monarch = {{{monarch10|}}}
- | nominator = {{{nominator10|}}}
- | office = {{{office10|}}}
- | order = {{{order10|}}}
- | parliament = {{{parliament10|}}}
- | parliamentarygroup = {{{parliamentarygroup10|}}}
- | predecessor = {{{predecessor10|}}}
- | preceding = {{{preceding10|}}}
- | preceded = {{{preceded10|}}}
- | premier = {{{premier10|}}}
- | president = {{{president10|}}}
- | primeminister = {{{primeminister10|}}}
- | riding = {{{riding10|}}}
- | state_assembly = {{{state_assembly10|}}}
- | state_delegate = {{{state_delegate10|}}}
- | state_house = {{{state_house10|}}}
- | state_legislature = {{{state_legislature10|}}}
- | state_senate = {{{state_senate10|}}}
- | state = {{{state10|}}}
- | succeeded = {{{succeeded10|}}}
- | succeeding = {{{succeeding10|}}}
- | successor = {{{successor10|}}}
- | taoiseach = {{{taoiseach10|}}}
- | termlabel = {{{term_label10|{{{termlabel10|In office}}}}}}
- | termend = {{#if:{{{termend10|}}}|{{{termend10}}}|{{{term_end10|}}}}}
- | termstart = {{#if:{{{termstart10|}}}|{{{termstart10}}}|{{{term_start10|}}}}}
- | term = {{{term10|}}}
- | title = {{{title10|}}}
- | vicegovernor = {{{vicegovernor10|}}}
- | vicepresident = {{{vicepresident10|}}}
- | vicepremier = {{{vicepremier10|}}}
- | viceprimeminister = {{{viceprimeminister10|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term10|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname11|}}}
- | 1namedata = {{{1namedata11|}}}
- | 2blankname = {{{2blankname11|}}}
- | 2namedata = {{{2namedata11|}}}
- | 3blankname = {{{3blankname11|}}}
- | 3namedata = {{{3namedata11|}}}
- | 4blankname = {{{4blankname11|}}}
- | 4namedata = {{{4namedata11|}}}
- | 5blankname = {{{5blankname11|}}}
- | 5namedata = {{{5namedata11|}}}
- | alongside = {{{alongside11|}}}
- | ambassador_from = {{{ambassador_from11|}}}
- | appointer = {{#if: {{{appointer11|}}} | {{{appointer11}}} | {{{appointed11|}}} }}
- | assembly = {{{assembly11|}}}
- | chancellor = {{{chancellor11|}}}
- | co-leader = {{{co-leader11|}}}
- | constituency_{{#if:{{{constituency_AM11|}}}|AM|MP}} = {{#if: {{{constituency_AM11|}}} | {{{constituency_AM11}}} | {{{constituency_MP11|}}} }}
- | constituency = {{{constituency11|}}}
- | convocation = {{{convocation11|}}}
- | country = {{{country11|}}}
- | deputy = {{{deputy11|}}}
- | district = {{{district11|}}}
- | firstminister = {{{firstminister11|}}}
- | governor-general = {{{governor-general11|}}}
- | governor_general = {{{governor_general11|}}}
- | governor = {{{governor11|}}}
- | jr/sr = {{{jr/sr11|}}}
- | jr/sr and state = {{{jr/sr and state11|}}}
- | leader = {{{leader11|}}}
- | legislature = {{{legislature11|}}}
- | lieutenant_governor = {{{lieutenant_governor11|}}}
- | lieutenant = {{{lieutenant11|}}}
- | minister_from = {{{minister_from11|}}}
- | minority_floor_leader = {{{minority_floor_leader11|}}}
- | majority_floor_leader = {{{majority_floor_leader11|}}}
- | majority_leader = {{#if: {{{majorityleader11|}}} | {{{majorityleader11}}} | {{{majority_leader11|}}} }}
- | majority = {{{majority11|}}}
- | minister = {{{minister11|}}}
- | minority_leader = {{#if: {{{minorityleader11|}}} | {{{minorityleader11}}} | {{{minority_leader11|}}} }}
- | monarch = {{{monarch11|}}}
- | nominator = {{{nominator11|}}}
- | office = {{{office11|}}}
- | order = {{{order11|}}}
- | parliament = {{{parliament11|}}}
- | parliamentarygroup = {{{parliamentarygroup11|}}}
- | predecessor = {{{predecessor11|}}}
- | preceding = {{{preceding11|}}}
- | preceded = {{{preceded11|}}}
- | premier = {{{premier11|}}}
- | president = {{{president11|}}}
- | primeminister = {{{primeminister11|}}}
- | riding = {{{riding11|}}}
- | state_assembly = {{{state_assembly11|}}}
- | state_delegate = {{{state_delegate11|}}}
- | state_house = {{{state_house11|}}}
- | state_legislature = {{{state_legislature11|}}}
- | state_senate = {{{state_senate11|}}}
- | state = {{{state11|}}}
- | succeeded = {{{succeeded11|}}}
- | succeeding = {{{succeeding11|}}}
- | successor = {{{successor11|}}}
- | taoiseach = {{{taoiseach11|}}}
- | termlabel = {{{term_label11|{{{termlabel11|In office}}}}}}
- | termend = {{#if:{{{termend11|}}}|{{{termend11}}}|{{{term_end11|}}}}}
- | termstart = {{#if:{{{termstart11|}}}|{{{termstart11}}}|{{{term_start11|}}}}}
- | term = {{{term11|}}}
- | title = {{{title11|}}}
- | vicegovernor = {{{vicegovernor11|}}}
- | vicepresident = {{{vicepresident11|}}}
- | vicepremier = {{{vicepremier11|}}}
- | viceprimeminister = {{{viceprimeminister11|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term11|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname12|}}}
- | 1namedata = {{{1namedata12|}}}
- | 2blankname = {{{2blankname12|}}}
- | 2namedata = {{{2namedata12|}}}
- | 3blankname = {{{3blankname12|}}}
- | 3namedata = {{{3namedata12|}}}
- | 4blankname = {{{4blankname12|}}}
- | 4namedata = {{{4namedata12|}}}
- | 5blankname = {{{5blankname12|}}}
- | 5namedata = {{{5namedata12|}}}
- | alongside = {{{alongside12|}}}
- | ambassador_from = {{{ambassador_from12|}}}
- | appointer = {{#if: {{{appointer12|}}} | {{{appointer12}}} | {{{appointed12|}}} }}
- | assembly = {{{assembly12|}}}
- | chancellor = {{{chancellor12|}}}
- | co-leader = {{{co-leader12|}}}
- | constituency_{{#if:{{{constituency_AM12|}}}|AM|MP}} = {{#if: {{{constituency_AM12|}}} | {{{constituency_AM12}}} | {{{constituency_MP12|}}} }}
- | constituency = {{{constituency12|}}}
- | convocation = {{{convocation12|}}}
- | country = {{{country12|}}}
- | deputy = {{{deputy12|}}}
- | district = {{{district12|}}}
- | firstminister = {{{firstminister12|}}}
- | governor-general = {{{governor-general12|}}}
- | governor_general = {{{governor_general12|}}}
- | governor = {{{governor12|}}}
- | jr/sr = {{{jr/sr12|}}}
- | jr/sr and state = {{{jr/sr and state12|}}}
- | leader = {{{leader12|}}}
- | legislature = {{{legislature12|}}}
- | lieutenant_governor = {{{lieutenant_governor12|}}}
- | lieutenant = {{{lieutenant12|}}}
- | minister_from = {{{minister_from12|}}}
- | minority_floor_leader = {{{minority_floor_leader12|}}}
- | majority_floor_leader = {{{majority_floor_leader12|}}}
- | majority_leader = {{#if: {{{majorityleader12|}}} | {{{majorityleader12}}} | {{{majority_leader12|}}} }}
- | majority = {{{majority12|}}}
- | minister = {{{minister12|}}}
- | minority_leader = {{#if: {{{minorityleader12|}}} | {{{minorityleader12}}} | {{{minority_leader12|}}} }}
- | monarch = {{{monarch12|}}}
- | nominator = {{{nominator12|}}}
- | office = {{{office12|}}}
- | order = {{{order12|}}}
- | parliament = {{{parliament12|}}}
- | parliamentarygroup = {{{parliamentarygroup12|}}}
- | predecessor = {{{predecessor12|}}}
- | preceding = {{{preceding12|}}}
- | preceded = {{{preceded12|}}}
- | premier = {{{premier12|}}}
- | president = {{{president12|}}}
- | primeminister = {{{primeminister12|}}}
- | riding = {{{riding12|}}}
- | state_assembly = {{{state_assembly12|}}}
- | state_delegate = {{{state_delegate12|}}}
- | state_house = {{{state_house12|}}}
- | state_legislature = {{{state_legislature12|}}}
- | state_senate = {{{state_senate12|}}}
- | state = {{{state12|}}}
- | succeeded = {{{succeeded12|}}}
- | succeeding = {{{succeeding12|}}}
- | successor = {{{successor12|}}}
- | taoiseach = {{{taoiseach12|}}}
- | termlabel = {{{term_label12|{{{termlabel12|In office}}}}}}
- | termend = {{#if:{{{termend12|}}}|{{{termend12}}}|{{{term_end12|}}}}}
- | termstart = {{#if:{{{termstart12|}}}|{{{termstart12}}}|{{{term_start12|}}}}}
- | term = {{{term12|}}}
- | title = {{{title12|}}}
- | vicegovernor = {{{vicegovernor12|}}}
- | vicepresident = {{{vicepresident12|}}}
- | vicepremier = {{{vicepremier12|}}}
- | viceprimeminister = {{{viceprimeminister12|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term12|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname13|}}}
- | 1namedata = {{{1namedata13|}}}
- | 2blankname = {{{2blankname13|}}}
- | 2namedata = {{{2namedata13|}}}
- | 3blankname = {{{3blankname13|}}}
- | 3namedata = {{{3namedata13|}}}
- | 4blankname = {{{4blankname13|}}}
- | 4namedata = {{{4namedata13|}}}
- | 5blankname = {{{5blankname13|}}}
- | 5namedata = {{{5namedata13|}}}
- | alongside = {{{alongside13|}}}
- | ambassador_from = {{{ambassador_from13|}}}
- | appointer = {{#if: {{{appointer13|}}} | {{{appointer13}}} | {{{appointed13|}}} }}
- | assembly = {{{assembly13|}}}
- | chancellor = {{{chancellor13|}}}
- | co-leader = {{{co-leader13|}}}
- | constituency_{{#if:{{{constituency_AM13|}}}|AM|MP}} = {{#if: {{{constituency_AM13|}}} | {{{constituency_AM13}}} | {{{constituency_MP13|}}} }}
- | constituency = {{{constituency13|}}}
- | convocation = {{{convocation13|}}}
- | country = {{{country13|}}}
- | deputy = {{{deputy13|}}}
- | district = {{{district13|}}}
- | firstminister = {{{firstminister13|}}}
- | governor-general = {{{governor-general13|}}}
- | governor_general = {{{governor_general13|}}}
- | governor = {{{governor13|}}}
- | jr/sr = {{{jr/sr13|}}}
- | jr/sr and state = {{{jr/sr and state13|}}}
- | leader = {{{leader13|}}}
- | legislature = {{{legislature13|}}}
- | lieutenant_governor = {{{lieutenant_governor13|}}}
- | lieutenant = {{{lieutenant13|}}}
- | minister_from = {{{minister_from13|}}}
- | minority_floor_leader = {{{minority_floor_leader13|}}}
- | majority_floor_leader = {{{majority_floor_leader13|}}}
- | majority_leader = {{#if: {{{majorityleader13|}}} | {{{majorityleader13}}} | {{{majority_leader13|}}} }}
- | majority = {{{majority13|}}}
- | minister = {{{minister13|}}}
- | minority_leader = {{#if: {{{minorityleader13|}}} | {{{minorityleader13}}} | {{{minority_leader13|}}} }}
- | monarch = {{{monarch13|}}}
- | nominator = {{{nominator13|}}}
- | office = {{{office13|}}}
- | order = {{{order13|}}}
- | parliament = {{{parliament13|}}}
- | parliamentarygroup = {{{parliamentarygroup13|}}}
- | predecessor = {{{predecessor13|}}}
- | preceding = {{{preceding13|}}}
- | preceded = {{{preceded13|}}}
- | premier = {{{premier13|}}}
- | president = {{{president13|}}}
- | primeminister = {{{primeminister13|}}}
- | riding = {{{riding13|}}}
- | state_assembly = {{{state_assembly13|}}}
- | state_delegate = {{{state_delegate13|}}}
- | state_house = {{{state_house13|}}}
- | state_legislature = {{{state_legislature13|}}}
- | state_senate = {{{state_senate13|}}}
- | state = {{{state13|}}}
- | succeeded = {{{succeeded13|}}}
- | succeeding = {{{succeeding13|}}}
- | successor = {{{successor13|}}}
- | taoiseach = {{{taoiseach13|}}}
- | termlabel = {{{term_label13|{{{termlabel13|In office}}}}}}
- | termend = {{#if:{{{termend13|}}}|{{{termend13}}}|{{{term_end13|}}}}}
- | termstart = {{#if:{{{termstart13|}}}|{{{termstart13}}}|{{{term_start13|}}}}}
- | term = {{{term13|}}}
- | title = {{{title13|}}}
- | vicegovernor = {{{vicegovernor13|}}}
- | vicepresident = {{{vicepresident13|}}}
- | vicepremier = {{{vicepremier13|}}}
- | viceprimeminister = {{{viceprimeminister13|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term13|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname14|}}}
- | 1namedata = {{{1namedata14|}}}
- | 2blankname = {{{2blankname14|}}}
- | 2namedata = {{{2namedata14|}}}
- | 3blankname = {{{3blankname14|}}}
- | 3namedata = {{{3namedata14|}}}
- | 4blankname = {{{4blankname14|}}}
- | 4namedata = {{{4namedata14|}}}
- | 5blankname = {{{5blankname14|}}}
- | 5namedata = {{{5namedata14|}}}
- | alongside = {{{alongside14|}}}
- | ambassador_from = {{{ambassador_from14|}}}
- | appointer = {{#if: {{{appointer14|}}} | {{{appointer14}}} | {{{appointed14|}}} }}
- | assembly = {{{assembly14|}}}
- | chancellor = {{{chancellor14|}}}
- | co-leader = {{{co-leader14|}}}
- | constituency_{{#if:{{{constituency_AM14|}}}|AM|MP}} = {{#if: {{{constituency_AM14|}}} | {{{constituency_AM14}}} | {{{constituency_MP14|}}} }}
- | constituency = {{{constituency14|}}}
- | convocation = {{{convocation14|}}}
- | country = {{{country14|}}}
- | deputy = {{{deputy14|}}}
- | district = {{{district14|}}}
- | firstminister = {{{firstminister14|}}}
- | governor-general = {{{governor-general14|}}}
- | governor_general = {{{governor_general14|}}}
- | governor = {{{governor14|}}}
- | jr/sr = {{{jr/sr14|}}}
- | jr/sr and state = {{{jr/sr and state14|}}}
- | leader = {{{leader14|}}}
- | legislature = {{{legislature14|}}}
- | lieutenant_governor = {{{lieutenant_governor14|}}}
- | lieutenant = {{{lieutenant14|}}}
- | minister_from = {{{minister_from14|}}}
- | minority_floor_leader = {{{minority_floor_leader14|}}}
- | majority_floor_leader = {{{majority_floor_leader14|}}}
- | majority_leader = {{#if: {{{majorityleader14|}}} | {{{majorityleader14}}} | {{{majority_leader14|}}} }}
- | majority = {{{majority14|}}}
- | minister = {{{minister14|}}}
- | minority_leader = {{#if: {{{minorityleader14|}}} | {{{minorityleader14}}} | {{{minority_leader14|}}} }}
- | monarch = {{{monarch14|}}}
- | nominator = {{{nominator14|}}}
- | office = {{{office14|}}}
- | order = {{{order14|}}}
- | parliament = {{{parliament14|}}}
- | parliamentarygroup = {{{parliamentarygroup14|}}}
- | predecessor = {{{predecessor14|}}}
- | preceding = {{{preceding14|}}}
- | preceded = {{{preceded14|}}}
- | premier = {{{premier14|}}}
- | president = {{{president14|}}}
- | primeminister = {{{primeminister14|}}}
- | riding = {{{riding14|}}}
- | state_assembly = {{{state_assembly14|}}}
- | state_delegate = {{{state_delegate14|}}}
- | state_house = {{{state_house14|}}}
- | state_legislature = {{{state_legislature14|}}}
- | state_senate = {{{state_senate14|}}}
- | state = {{{state14|}}}
- | succeeded = {{{succeeded14|}}}
- | succeeding = {{{succeeding14|}}}
- | successor = {{{successor14|}}}
- | taoiseach = {{{taoiseach14|}}}
- | termlabel = {{{term_label14|{{{termlabel14|In office}}}}}}
- | termend = {{#if:{{{termend14|}}}|{{{termend14}}}|{{{term_end14|}}}}}
- | termstart = {{#if:{{{termstart14|}}}|{{{termstart14}}}|{{{term_start14|}}}}}
- | term = {{{term14|}}}
- | title = {{{title14|}}}
- | vicegovernor = {{{vicegovernor14|}}}
- | vicepresident = {{{vicepresident14|}}}
- | vicepremier = {{{vicepremier14|}}}
- | viceprimeminister = {{{viceprimeminister14|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term14|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname15|}}}
- | 1namedata = {{{1namedata15|}}}
- | 2blankname = {{{2blankname15|}}}
- | 2namedata = {{{2namedata15|}}}
- | 3blankname = {{{3blankname15|}}}
- | 3namedata = {{{3namedata15|}}}
- | 4blankname = {{{4blankname15|}}}
- | 4namedata = {{{4namedata15|}}}
- | 5blankname = {{{5blankname15|}}}
- | 5namedata = {{{5namedata15|}}}
- | alongside = {{{alongside15|}}}
- | ambassador_from = {{{ambassador_from15|}}}
- | appointer = {{#if: {{{appointer15|}}} | {{{appointer15}}} | {{{appointed15|}}} }}
- | assembly = {{{assembly15|}}}
- | chancellor = {{{chancellor15|}}}
- | co-leader = {{{co-leader15|}}}
- | constituency_{{#if:{{{constituency_AM15|}}}|AM|MP}} = {{#if: {{{constituency_AM15|}}} | {{{constituency_AM15}}} | {{{constituency_MP15|}}} }}
- | constituency = {{{constituency15|}}}
- | convocation = {{{convocation15|}}}
- | country = {{{country15|}}}
- | deputy = {{{deputy15|}}}
- | district = {{{district15|}}}
- | firstminister = {{{firstminister15|}}}
- | governor-general = {{{governor-general15|}}}
- | governor_general = {{{governor_general15|}}}
- | governor = {{{governor15|}}}
- | jr/sr = {{{jr/sr15|}}}
- | jr/sr and state = {{{jr/sr and state15|}}}
- | leader = {{{leader15|}}}
- | legislature = {{{legislature15|}}}
- | lieutenant_governor = {{{lieutenant_governor15|}}}
- | lieutenant = {{{lieutenant15|}}}
- | minister_from = {{{minister_from15|}}}
- | minority_floor_leader = {{{minority_floor_leader15|}}}
- | majority_floor_leader = {{{majority_floor_leader15|}}}
- | majority_leader = {{#if: {{{majorityleader15|}}} | {{{majorityleader15}}} | {{{majority_leader15|}}} }}
- | majority = {{{majority15|}}}
- | minister = {{{minister15|}}}
- | minority_leader = {{#if: {{{minorityleader15|}}} | {{{minorityleader15}}} | {{{minority_leader15|}}} }}
- | monarch = {{{monarch15|}}}
- | nominator = {{{nominator15|}}}
- | office = {{{office15|}}}
- | order = {{{order15|}}}
- | parliament = {{{parliament15|}}}
- | parliamentarygroup = {{{parliamentarygroup15|}}}
- | predecessor = {{{predecessor15|}}}
- | preceding = {{{preceding15|}}}
- | preceded = {{{preceded15|}}}
- | premier = {{{premier15|}}}
- | president = {{{president15|}}}
- | primeminister = {{{primeminister15|}}}
- | riding = {{{riding15|}}}
- | state_assembly = {{{state_assembly15|}}}
- | state_delegate = {{{state_delegate15|}}}
- | state_house = {{{state_house15|}}}
- | state_legislature = {{{state_legislature15|}}}
- | state_senate = {{{state_senate15|}}}
- | state = {{{state15|}}}
- | succeeded = {{{succeeded15|}}}
- | succeeding = {{{succeeding15|}}}
- | successor = {{{successor15|}}}
- | taoiseach = {{{taoiseach15|}}}
- | termlabel = {{{term_label15|{{{termlabel15|In office}}}}}}
- | termend = {{#if:{{{termend15|}}}|{{{termend15}}}|{{{term_end15|}}}}}
- | termstart = {{#if:{{{termstart15|}}}|{{{termstart15}}}|{{{term_start15|}}}}}
- | term = {{{term15|}}}
- | title = {{{title15|}}}
- | vicegovernor = {{{vicegovernor15|}}}
- | vicepresident = {{{vicepresident15|}}}
- | vicepremier = {{{vicepremier15|}}}
- | viceprimeminister = {{{viceprimeminister15|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term15|}}}
- }}}}<!--
- -->{{#if:{{{nominee|}}}{{{candidate|}}}||
- {{Infobox officeholder/office|color={{#ifeq:{{lc:{{{embed}}}}}|yes|#eee|lavender}}
- | 1blankname = {{{1blankname16|}}}
- | 1namedata = {{{1namedata16|}}}
- | 2blankname = {{{2blankname16|}}}
- | 2namedata = {{{2namedata16|}}}
- | 3blankname = {{{3blankname16|}}}
- | 3namedata = {{{3namedata16|}}}
- | 4blankname = {{{4blankname16|}}}
- | 4namedata = {{{4namedata16|}}}
- | 5blankname = {{{5blankname16|}}}
- | 5namedata = {{{5namedata16|}}}
- | alongside = {{{alongside16|}}}
- | ambassador_from = {{{ambassador_from16|}}}
- | appointer = {{#if: {{{appointer16|}}} | {{{appointer16}}} | {{{appointed16|}}} }}
- | assembly = {{{assembly16|}}}
- | chancellor = {{{chancellor16|}}}
- | co-leader = {{{co-leader16|}}}
- | constituency_{{#if:{{{constituency_AM16|}}}|AM|MP}} = {{#if: {{{constituency_AM16|}}} | {{{constituency_AM16}}} | {{{constituency_MP16|}}} }}
- | constituency = {{{constituency16|}}}
- | convocation = {{{convocation16|}}}
- | country = {{{country16|}}}
- | deputy = {{{deputy16|}}}
- | district = {{{district16|}}}
- | firstminister = {{{firstminister16|}}}
- | governor-general = {{{governor-general16|}}}
- | governor_general = {{{governor_general16|}}}
- | governor = {{{governor16|}}}
- | jr/sr = {{{jr/sr16|}}}
- | jr/sr and state = {{{jr/sr and state16|}}}
- | leader = {{{leader16|}}}
- | legislature = {{{legislature16|}}}
- | lieutenant_governor = {{{lieutenant_governor16|}}}
- | lieutenant = {{{lieutenant16|}}}
- | minister_from = {{{minister_from16|}}}
- | minority_floor_leader = {{{minority_floor_leader16|}}}
- | majority_floor_leader = {{{majority_floor_leader16|}}}
- | majority_leader = {{#if: {{{majorityleader16|}}} | {{{majorityleader16}}} | {{{majority_leader16|}}} }}
- | majority = {{{majority16|}}}
- | minister = {{{minister16|}}}
- | minority_leader = {{#if: {{{minorityleader16|}}} | {{{minorityleader16}}} | {{{minority_leader16|}}} }}
- | monarch = {{{monarch16|}}}
- | nominator = {{{nominator16|}}}
- | office = {{{office16|}}}
- | order = {{{order16|}}}
- | parliament = {{{parliament16|}}}
- | parliamentarygroup = {{{parliamentarygroup16|}}}
- | predecessor = {{{predecessor16|}}}
- | preceding = {{{preceding16|}}}
- | preceded = {{{preceded16|}}}
- | premier = {{{premier16|}}}
- | president = {{{president16|}}}
- | primeminister = {{{primeminister16|}}}
- | riding = {{{riding16|}}}
- | state_assembly = {{{state_assembly16|}}}
- | state_delegate = {{{state_delegate16|}}}
- | state_house = {{{state_house16|}}}
- | state_legislature = {{{state_legislature16|}}}
- | state_senate = {{{state_senate16|}}}
- | state = {{{state16|}}}
- | succeeded = {{{succeeded16|}}}
- | succeeding = {{{succeeding16|}}}
- | successor = {{{successor16|}}}
- | taoiseach = {{{taoiseach16|}}}
- | termlabel = {{{term_label16|{{{termlabel16|In office}}}}}}
- | termend = {{#if:{{{termend16|}}}|{{{termend16}}}|{{{term_end16|}}}}}
- | termstart = {{#if:{{{termstart16|}}}|{{{termstart16}}}|{{{term_start16|}}}}}
- | term = {{{term16|}}}
- | title = {{{title16|}}}
- | vicegovernor = {{{vicegovernor16|}}}
- | vicepresident = {{{vicepresident16|}}}
- | vicepremier = {{{vicepremier16|}}}
- | viceprimeminister = {{{viceprimeminister16|}}}
- | party = {{{party|}}}
- | prior_term = {{{prior_term16|}}}
- }}}}
- | data19 = {{{module0|}}}
- <!----------Personal data---------->
- | 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}}
- | label21 = Pronunciation
- | data21 = {{{pronunciation|}}}
- | label22 = Born
- | data22 = {{br separated entries
- |1 = {{#if:{{{birth_name|{{{birthname|}}}}}}|<span class="nickname">{{{birth_name|{{{birthname}}}}}}</span>}}
- |2 = {{{birth_date|}}}
- |3 = {{{birth_place|}}}
- }}
- | label23 = Died
- | data23 = {{br separated entries|{{{death_date|}}}|{{{death_place|}}}}}
- | label24 = Cause&nbsp;of&nbsp;death
- | data24 = {{{death_cause|}}}
- | label25 = Resting place
- | class25 = label
- | data25 = {{br separated entries|{{{resting_place|{{{restingplace|}}}}}}|{{{resting_place_coordinates|{{{restingplacecoordinates|}}}}}}}}
- | label26 = Citizenship
- | data26 = {{{citizenship|}}}
- | label27 = Nationality
- | data27 = {{{nationality|}}}
- | label28 = Political party
- | data28 = {{#switch:{{{party|}}}
- | =
- | [[United States Democratic Party|Democrat]]
- | [[Democratic Party (United States)|Democratic]]
- | [[Democratic Party (United States)|Democrat]] = [[Democratic Party (United States)|Democratic]]
- | [[Republican Party (United States)|Republican]]
- | [[United States Republican Party]]
- | [[United States Republican Party|Republican]]
- | [[Republican Party (United States)|Republican Party]] = [[Republican Party (United States)|Republican]]
- | [[Conservative Party (UK)|Conservative Party]]
- | [[Conservative Party (UK)|Conservative]] = [[Conservative Party (UK)|Conservative]]
- | [[Labour Party (UK)|Labour Party]]
- | [[Labour Party (UK)|Labour]] = [[Labour Party (UK)|Labour]]
- | [[Conservative Party of Canada|Conservative Party]]
- | [[Conservative Party of Canada|Conservative]] = [[Conservative Party of Canada|Conservative]]
- | [[Liberal Party of Canada|Liberal Party]]
- | [[Liberal Party of Canada|Liberal]] = [[Liberal Party of Canada|Liberal]]
- | KMT
- | Kuomintang
- | [[KMT]]
- | [[Kuomintang|KMT]]
- | [[Kuomintang]]
- | Kuomintang (KMT)
- | [[Kuomintang]] (KMT)
- | {{KMT}} (KMT)
- | {{KMT}} = [[Kuomintang]]
- | DPP
- | [[Democratic Progressive Party|DPP]]
- | [[Democratic Progressive Party]]
- | {{DPP}} = [[Democratic Progressive Party]]
- | #default = {{{party|}}} {{main other|{{#invoke:Officeholder party tracking|tracking|party={{{party|}}}}}}}}}
- | label29 = Other political<br />affiliations
- | data29 = {{{otherparty|}}}
- | label30 = Height
- | data30 = {{#if:{{{height|}}}|{{infobox person/height|{{{height|}}}}}}}
- | label31 = Spouse(s)
- | data31 = {{{spouse|}}}
- | label32 = Domestic partner
- | data32 = {{{partner|}}}
- | label33 = Relations
- | data33 = {{{relations|}}}
- | label34 = Children
- | data34 = {{{children|}}}
- | label35 = Parents
- | data35 = {{{parents|}}}
- | label36 = Mother
- | data36 = {{{mother|}}}
- | label37 = Father
- | data37 = {{{father|}}}
- | label38 = Relatives
- | data38 = {{{relatives|}}}
- | label39 = Residence
- | class39 = {{#if:{{{death_date|}}}{{{death_place|}}}||label}}
- | data39 = {{{residence|}}}
- | label40 = Education
- | data40 = {{{education|}}}
- | label41 = [[Alma mater]]
- | data41 = {{{alma_mater|}}}
- | label42 = Occupation
- | data42 = {{{occupation|}}}
- | label43 = Profession
- | data43 = {{{profession|}}}
- | label44 = Known for
- | data44 = {{{known_for|}}}
- | label45 = Salary
- | data45 = {{{salary|}}}
- | label46 = Net worth
- | data46 = {{{net_worth|}}}
- | label47 = Cabinet
- | data47 = {{{cabinet|}}}
- | label48 = Committees
- | data48 = {{{committees|}}}
- | label49 = Portfolio
- | data49 = {{{portfolio|}}}
- | label51 = {{#if:{{{mawards|}}}|Civilian awards|Awards}}
- | data51 = {{{awards|}}}
- | label52 = {{{blank1}}}
- | data52 = {{{data1|}}}
- | label53 = {{{blank2}}}
- | data53 = {{{data2|}}}
- | label54 = {{{blank3}}}
- | data54 = {{{data3|}}}
- | label55 = {{{blank4}}}
- | data55 = {{{data4|}}}
- | label56 = {{{blank5}}}
- | data56 = {{{data5|}}}
- | label57 = Signature
- | data57 = {{#if:{{{signature|}}}|[[File:{{{signature}}}|128x80px|alt={{{signature_alt|}}}|{{PAGENAME}}'s signature]]}}
- | label58 = Website
- | data58 = {{{website|}}}
- | header59 = {{#if:{{{allegiance|}}}{{{branch|}}}{{{serviceyears|}}}{{{rank|}}}{{{unit|}}}{{{commands|}}}{{{battles|}}}{{{military_blank1|}}}|Military service}}
- | label60 = Nickname(s)
- | data60 = {{{nickname|}}}
- | label61 = Allegiance
- | data61 = {{{allegiance|}}}
- | label62 = Service/branch
- | data62 = {{{branch|}}}
- | label63 = Years of service
- | data63 = {{{serviceyears|}}}
- | label64 = Rank
- | data64 = {{{rank|}}}
- | label65 = Unit
- | data65 = {{{unit|}}}
- | label66 = Commands
- | data66 = {{{commands|}}}
- | label67 = Battles/wars
- | data67 = {{{battles|}}}
- | label68 = {{#if:{{{awards|}}}|Military awards|Awards}}
- | data68 = {{{mawards|}}}
- | label69 = {{{military_blank1}}}
- | data69 = {{{military_data1|}}}
- | label70 = {{{military_blank2}}}
- | data70 = {{{military_data2|}}}
- | label71 = {{{military_blank3}}}
- | data71 = {{{military_data3|}}}
- | label72 = {{{military_blank4}}}
- | data72 = {{{military_data4|}}}
- | label73 = {{{military_blank5}}}
- | data73 = {{{military_data5|}}}
- | data74 = {{{module|}}}
- | data75 = {{{module2|}}}
- | data76 = {{{module3|}}}
- | data77 = {{{module4|}}}
- | data78 = {{{module5|}}}
- | data79 = {{{footnotes|}}}
- | belowstyle = border-top: 1px solid right; font-size: 90%
- | below = {{#if:{{{date|}}}| As of {{{date}}}{{#if:{{{year|}}}|, {{{year}}}}}{{#if:{{{source|}}}|<br />Source: [{{{source}}}]}} }}
- }}{{#if:{{{pronunciation|}}}|[[Category:Biography template using pronunciation]]
- }}{{#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]]
- }}{{#if:{{{speaker|}}}|{{#if:{{{nominee|}}}{{{candidate|}}}||[[Category:Pages using infobox officeholder with speaker and without nominee or candidate]]}}
- }}</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>
- <sha1>hxake6prnwxhh2qsykyshvi9siidbb7</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Basepage subpage</title>
- <ns>10</ns>
- <id>43986518</id>
- <redirect title="Template:When on basepage" />
- <revision>
- <id>769880910</id>
- <parentid>642181889</parentid>
- <timestamp>2017-03-12T04:26:29Z</timestamp>
- <contributor>
- <username>Godsy</username>
- <id>23257138</id>
- </contributor>
- <comment>[[Template:This is a redirect]] has been deprecated, change to [[Template:Redirect category shell]].</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="115">#REDIRECT [[Template:When on basepage]]
- {{Redirect category shell|
- {{R from move}}
- {{R from template shortcut}}
- }}</text>
- <sha1>8auv81suxp1xkygdvxy45lt28yl3p6z</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Both</title>
- <ns>10</ns>
- <id>13984942</id>
- <revision>
- <id>752919001</id>
- <parentid>579826991</parentid>
- <timestamp>2016-12-04T04:31:50Z</timestamp>
- <contributor>
- <username>JJMC89</username>
- <id>24812038</id>
- </contributor>
- <comment>make subst'able</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="123">{{SAFESUBST:<noinclude />#if:{{{1|}}}|{{SAFESUBST:<noinclude />#if:{{{2|}}}|1}}}}<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>a92g9dgn74wuyygsul02g6cnq29em4t</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Br separated entries</title>
- <ns>10</ns>
- <id>27461703</id>
- <revision>
- <id>664153181</id>
- <parentid>579827061</parentid>
- <timestamp>2015-05-26T18:06:33Z</timestamp>
- <contributor>
- <username>Izkala</username>
- <id>23051379</id>
- </contributor>
- <comment>Switch to using [[Module:Separated entries]]; leading and trailing whitespace and newlines are now trimmed</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="111">{{<includeonly>safesubst:</includeonly>#invoke:Separated entries|br}}<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>3qzqyo0vc2bkjx7dik52fp751jwcnq3</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Category link with count</title>
- <ns>10</ns>
- <id>30847816</id>
- <revision>
- <id>827250605</id>
- <parentid>804533676</parentid>
- <timestamp>2018-02-23T17:02:11Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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>
- {{Documentation|Template:Clc/doc}}
- [[Category:Internal category-link templates]]
- </noinclude></text>
- <sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Clc</title>
- <ns>10</ns>
- <id>52342109</id>
- <redirect title="Template:Category link with count" />
- <revision>
- <id>827250628</id>
- <parentid>804533685</parentid>
- <timestamp>2018-02-23T17:02:12Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="94">#REDIRECT [[Template:Category link with count]]
- [[Category:Internal category-link templates]]</text>
- <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Clear</title>
- <ns>10</ns>
- <id>1239772</id>
- <revision>
- <id>684162145</id>
- <parentid>683948339</parentid>
- <timestamp>2015-10-04T23:53:36Z</timestamp>
- <contributor>
- <username>Nyttend</username>
- <id>1960810</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="81"><div style="clear:{{{1|both}}};"></div><noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Column-width</title>
- <ns>10</ns>
- <id>29216399</id>
- <revision>
- <id>638540885</id>
- <parentid>579832996</parentid>
- <timestamp>2014-12-17T20:09:33Z</timestamp>
- <contributor>
- <username>Edokter</username>
- <id>1624037</id>
- </contributor>
- <minor/>
- <comment>redundant</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: {{{1|30em}}}; -webkit-column-width: {{{1|30em}}}; column-width: {{{1|30em}}};</includeonly><noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1>
- </revision>
- </page>
- <page>
- <title>Template:CountryPrefixThe</title>
- <ns>10</ns>
- <id>52976455</id>
- <revision>
- <id>818775229</id>
- <parentid>817191733</parentid>
- <timestamp>2018-01-05T14:33:33Z</timestamp>
- <contributor>
- <username>Jonesey95</username>
- <id>9755426</id>
- </contributor>
- <comment>rm Gambia, since it should be written "Gambia" or "The Gambia", not "the Gambia", apparently. Pedantic.</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="688">{{#switch: {{{1|}}}
- | 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|}}}
- |#default = {{{1|}}}
- }}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>5d4k5ybi2hyt08r7pjn6htr69x0qm99</sha1>
- </revision>
- </page>
- <page>
- <title>Template:DPP</title>
- <ns>10</ns>
- <id>11474048</id>
- <revision>
- <id>577859213</id>
- <parentid>399530343</parentid>
- <timestamp>2013-10-19T16:15:09Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <minor/>
- <comment>Changed protection level of Template:DPP: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="87">{{DPP/logo}} [[Democratic Progressive Party]]<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>ogcndsb1r2npmn6x22l5b68f3468dht</sha1>
- </revision>
- </page>
- <page>
- <title>Template:DPP/logo</title>
- <ns>10</ns>
- <id>29792285</id>
- <revision>
- <id>825510940</id>
- <parentid>725082550</parentid>
- <timestamp>2018-02-13T20:32:59Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>separate pp-template not needed</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="87">[[File:Green Taiwan in White Cross.svg|20px]]<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>0y8l7qshw8kf36qrxoxr7phmdlphkki</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Documentation</title>
- <ns>10</ns>
- <id>13529042</id>
- <revision>
- <id>714754089</id>
- <parentid>714753814</parentid>
- <timestamp>2016-04-11T17:18:54Z</timestamp>
- <contributor>
- <username>Rich Farmbrough</username>
- <id>82835</id>
- </contributor>
- <comment>Undid revision 714753814 by [[Special:Contributions/Rich Farmbrough|Rich Farmbrough]] ([[User talk:Rich Farmbrough|talk]])</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="182">{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}<noinclude>
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Documentation subpage</title>
- <ns>10</ns>
- <id>7890381</id>
- <revision>
- <id>617432645</id>
- <parentid>608599904</parentid>
- <timestamp>2014-07-18T09:37:22Z</timestamp>
- <contributor>
- <username>Sardanaphalus</username>
- <id>427947</id>
- </contributor>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="1667"><includeonly><!--
- -->{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
- | <!--(this template has been transcluded on a /doc or /{{{override}}} page)-->
- </includeonly><!--
- -->{{#ifeq:{{{doc-notice|show}}} |show
- | {{Mbox
- | type = notice
- | style = margin-bottom:1.0em;
- | image = [[File:Edit-copy green.svg|40px|alt=|link=]]
- | text =
- '''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}}}}}}}}.
- }}
- }}<!--
- -->{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}<!--
- -->{{#if:{{{inhibit|}}} |<!--(don't categorize)-->
- | <includeonly><!--
- -->{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
- | [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
- | [[Category:Documentation subpages without corresponding pages]]
- }}<!--
- --></includeonly>
- }}<!--
- (completing initial #ifeq: at start of template:)
- --><includeonly>
- | <!--(this template has not been transcluded on a /doc or /{{{override}}} page)-->
- }}<!--
- --></includeonly><noinclude>{{Documentation}}</noinclude></text>
- <sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Flatlist/microformat</title>
- <ns>10</ns>
- <id>36831247</id>
- <revision>
- <id>590162792</id>
- <parentid>567192725</parentid>
- <timestamp>2014-01-11T02:01:02Z</timestamp>
- <contributor>
- <username>Mark Arsten</username>
- <id>15020596</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="175"><div class="hlist">{{{1}}}</div><noinclude>
- {{documentation|content=A separate version of the flatlist template for use on the microformat documentation pages.}}
- </noinclude></text>
- <sha1>sxo2o920rctg4u89zzp6mnyzszcql6m</sha1>
- </revision>
- </page>
- <page>
- <title>Template:For</title>
- <ns>10</ns>
- <id>1808502</id>
- <revision>
- <id>850158102</id>
- <parentid>848893061</parentid>
- <timestamp>2018-07-14T01:05:26Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <comment>TFD closed as no consensus ([[WP:XFDC|XFDcloser]])</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="88"><includeonly>{{#invoke:For|For}}</includeonly><noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>7es2p1mk6qse8zlwn5qqya2ysrq1rcr</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Generic template demo</title>
- <ns>10</ns>
- <id>43381292</id>
- <redirect title="Template:Parameter names example" />
- <revision>
- <id>821201376</id>
- <parentid>620313329</parentid>
- <timestamp>2018-01-19T00:29:55Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="166">#redirect [[Template:Parameter names example]]
- [[Category:Wikipedia utility templates]]
- [[Category:Template namespace templates]]
- [[Category:Template documentation]]</text>
- <sha1>ogbr4wqk2lnafw0hlw1wy7gr9imxk3k</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Hatnote</title>
- <ns>10</ns>
- <id>945764</id>
- <revision>
- <id>609825987</id>
- <parentid>607120708</parentid>
- <timestamp>2014-05-23T15:55:04Z</timestamp>
- <contributor>
- <username>SMcCandlish</username>
- <id>378390</id>
- </contributor>
- <minor/>
- <comment>tweak</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="171"><includeonly>{{#invoke:Hatnote|hatnote}}</includeonly><noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>8nnude79i1y2v6yy2z7j285k1k4v8p3</sha1>
- </revision>
- </page>
- <page>
- <title>Template:High-risk</title>
- <ns>10</ns>
- <id>11453893</id>
- <revision>
- <id>840937597</id>
- <parentid>839761457</parentid>
- <timestamp>2018-05-13T01:30:44Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <comment>Per [[Wikipedia:Templates for discussion/Log/2018 May 5#Template:High-risk]], added {{being deleted}} ([[WP:XFDC|XFDcloser]])</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="1633"><noinclude>{{Being deleted|2018 May 5|Template:High-risk|merge=Template:High-use}}</noinclude>{{ombox
- | type = content
- | image = [[File:Ambox warning orange.svg|40px|alt=Warning|link=]]
- | imageright =
- | text =
- '''This {{
- #switch:{{NAMESPACE}}
- |Module=Lua module
- |#default=template
- }} is used on <span class="plainlinks">[https://tools.wmflabs.org/templatecount/index.php?lang=en&namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&name={{urlencode:{{
- #switch: {{SUBPAGENAME}}
- | doc | sandbox = {{BASEPAGENAME}}
- | #default = {{PAGENAME}}
- }}}} {{#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 [[{{
- #switch: {{SUBPAGENAME}}
- | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
- | #default = {{SUBJECTPAGENAME}}
- }}/sandbox|/sandbox]] or [[{{
- #switch: {{SUBPAGENAME}}
- | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
- | #default = {{SUBJECTPAGENAME}}
- }}/testcases|/testcases]] subpages{{
- #switch:{{NAMESPACE}}
- |Module=.
- |#default=&#32;or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].
- }} 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 [[{{
- #switch: {{SUBPAGENAME}}
- | doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}}
- | #default = {{TALKPAGENAME}}
- }}|talk page]]}} before implementing them.
- }}<noinclude>
- {{Documentation}}
- <!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! -->
- </noinclude></text>
- <sha1>mao65vhyco3hzz1tlvnydcjrss7fwph</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox</title>
- <ns>10</ns>
- <id>891845</id>
- <revision>
- <id>844984935</id>
- <parentid>844983838</parentid>
- <timestamp>2018-06-08T14:52:46Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <comment>don't know how I messed that one up...</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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>
- {{documentation}}
- <!-- Categories go in the /doc subpage, and interwikis go in Wikidata. -->
- </noinclude></text>
- <sha1>f4hgwrnr11ahhwyo266vcd10dpi92pe</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox officeholder/doc</title>
- <ns>10</ns>
- <id>10961078</id>
- <revision>
- <id>825299205</id>
- <parentid>822718097</parentid>
- <timestamp>2018-02-12T16:34:41Z</timestamp>
- <contributor>
- <username>Paine Ellsworth</username>
- <id>9092818</id>
- </contributor>
- <minor/>
- <comment>update /doc</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="61698">{{Documentation subpage}}
- {{Person infobox header}}
- {{high-risk| 123000+ }}
- {{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]].}}
- {{Lua|Module:Infobox|Module:InfoboxImage|Module:Check for unknown parameters}}
- {{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.
- {{refbegin|colwidth=20em}}
- * {{Tld|Infobox AM}}
- * {{Tld|Infobox Canadian MP}}
- * {{Tld|Infobox Canadian senator}}
- * {{Tld|Infobox candidate}}
- * {{Tld|Infobox chancellor}}
- * {{Tld|Infobox congressional candidate}}
- * {{Tld|Infobox congressman}}
- * {{Tld|Infobox defense minister}}
- * {{Tld|Infobox deputy first minister}}
- * {{Tld|Infobox deputy prime minister}}
- * {{Tld|Infobox doge}}
- * {{Tld|Infobox Eritrea cabinet official}}
- * {{Tld|Infobox first lady}}
- * {{Tld|Infobox first minister}}
- * {{Tld|Infobox governor}}
- * {{Tld|Infobox governor-elect}}
- * {{Tld|Infobox governor general}}
- * {{Tld|Infobox governor-general}}
- * {{Tld|Infobox Indian politician}}
- * {{Tld|Infobox judge}}
- * {{Tld|Infobox lt governor}}
- * {{Tld|Infobox mayor}}
- * {{Tld|Infobox MEP}}
- * {{Tld|Infobox minister}}
- * {{Tld|Infobox MLA}}
- * {{Tld|Infobox MP}}
- * {{Tld|Infobox MSP}}
- * {{Tld|Infobox PM}}
- * {{Tld|Infobox politician}}
- * {{Tld|Infobox politician (general)}}
- * {{Tld|Infobox premier}}
- * {{Tld|Infobox president}}
- * {{Tld|Infobox president-elect}}
- * {{Tld|Infobox prime minister}}
- * {{Tld|Infobox prime minister-elect}}
- * {{Tld|Infobox representative-elect}}
- * {{Tld|Infobox SCC chief justice}}
- * {{Tld|Infobox SCC puisne justice}}
- * {{Tld|Infobox secretary-general}}
- * {{Tld|Infobox senator}}
- * {{Tld|Infobox senator-elect}}
- * {{Tld|Infobox speaker}}
- * {{Tld|Infobox state representative}}
- * {{Tld|Infobox state SC associate justice}}
- * {{Tld|Infobox state SC justice}}
- * {{Tld|Infobox state senator}}
- * {{Tld|Infobox US ambassador}}
- * {{Tld|Infobox US associate justice}}
- * {{Tld|Infobox US cabinet official}}
- * {{Tld|Infobox US chief justice}}
- * {{Tld|Infobox US territorial governor}}
- * {{Tld|Infobox vice president}}
- {{refend}}
- ==Usage==
- {{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]].}}
- Paste 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]]''.
- The 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.
- If {{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).
- When 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).
- Where 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.
- Please 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.
- The 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.
- ===General office===
- {{For|examples of this code in use|Template:Infobox officeholder/example#General office}}
- {{Generic template demo
- | honorific_prefix
- | name
- | native_name
- | native_name_lang
- | honorific_suffix
- | image
- | image_size
- | image_upright
- | smallimage
- | alt
- | caption
- | order
- | office
- | term_start
- | term_end<!-- Add data only when the actual term has ended, not for terms which will end in the future. (Per usage guideline.) -->
- | alongside
- | monarch
- | president
- | governor_general
- | primeminister
- | chancellor
- | taoiseach
- | governor
- | vicepresident
- | viceprimeminister
- | deputy
- | lieutenant
- | parliamentarygroup
- | constituency
- | majority
- | predecessor
- | successor
- | prior_term
- | order2
- | office2
- | term_start2
- | term_end2
- | alongside2
- | monarch2
- | president2
- | governor_general2
- | primeminister2
- | chancellor2
- | taoiseach2
- | governor2
- | vicepresident2
- | viceprimeminister2
- | deputy2
- | lieutenant2
- | parliamentarygroup2
- | constituency2
- | predecessor2
- | successor2
- | majority2
- | prior_term2
- }}
- <pre style="overflow:auto;">
- {{Infobox officeholder
- | honorific_prefix =
- | name =
- | native_name = <!--The person's name in their own language, if different.-->
- | native_name_lang = <!--ISO 639-1 code, e.g., "fr" for French. If more than one, use {{lang}} in |native_name= instead.-->
- | honorific_suffix =
- | image =
- | image_size =
- | image_upright =
- | smallimage = <!--If this is specified, "image" should not be.-->
- | alt =
- | caption =
- | order =
- | office =
- | term_start =
- | term_end = <!-- Add data only when the actual term has ended, not for terms which will end in the future. (Per usage guideline.) -->
- | alongside = <!--For two or more people serving in the same position from the same district. (e.g. United States Senators.)-->
- | monarch =
- | president =
- | governor_general =
- | primeminister =
- | taoiseach =
- | chancellor =
- | governor =
- | vicepresident =
- | viceprimeminister =
- | deputy =
- | lieutenant =
- | succeeding = <!--For President-elect or equivalent-->
- | parliamentarygroup =
- | constituency =
- | majority =
- | predecessor =
- | successor =
- | prior_term =
- | order2 = <!--Can be repeated up to 16 times by changing the number-->
- | office2 = <!--Can be repeated up to 16 times by changing the number-->
- | term_start2 = <!--Can be repeated up to 16 times by changing the number-->
- | term_end2 = <!--Can be repeated up to 16 times by changing the number-->
- | alongside2 = <!--Can be repeated up to 16 times by changing the number-->
- | monarch2 = <!--Can be repeated up to 16 times by changing the number-->
- | president2 = <!--Can be repeated up to 16 times by changing the number-->
- | governor_general2 = <!--Can be repeated up to 16 times by changing the number-->
- | primeminister2 = <!--Can be repeated up to 16 times by changing the number-->
- | chancellor2 = <!--Can be repeated up to 16 times by changing the number-->
- | taoiseach2 = <!--Can be repeated up to 16 times by changing the number-->
- | governor2 = <!--Can be repeated up to 16 times by changing the number-->
- | vicepresident2 = <!--Can be repeated up to 16 times by changing the number-->
- | viceprimeminister2 = <!--Can be repeated up to 16 times by changing the number-->
- | deputy2 = <!--Can be repeated up to 16 times by changing the number-->
- | lieutenant2 = <!--Can be repeated up to 16 times by changing the number-->
- | succeeding2 = <!--Can be repeated up to 16 times by changing the number-->
- | predecessor2 = <!--Can be repeated up to 16 times by changing the number-->
- | successor2 = <!--Can be repeated up to 16 times by changing the number-->
- | parliamentarygroup2= <!--Can be repeated up to 16 times by changing the number-->
- | constituency2 = <!--Can be repeated up to 16 times by changing the number-->
- | majority2 = <!--Can be repeated up to 16 times by changing the number-->
- | prior_term2 = <!--Can be repeated up to 16 times by changing the number-->
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===Ambassador===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Ambassador}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | order
- | ambassador_from
- | country
- | term_start
- | term_end
- | predecessor
- | successor
- | president
- }}
- <pre style="overflow:auto;">
- {{Infobox ambassador
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | order = <!--Can be repeated up to 16 times by adding a number-->
- | ambassador_from = <!--Can be repeated up to 16 times by adding a number-->
- | country = <!--Can be repeated up to 16 times by adding a number-->
- | term_start = <!--Can be repeated up to 16 times by adding a number-->
- | term_end = <!--Can be repeated up to 16 times by adding a number-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number-->
- | successor = <!--Can be repeated up to 16 times by adding a number-->
- | president = <!--Can be repeated up to 16 times by adding a number-->
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===Assembly Member===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Assembly Member}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | caption
- | constituency_AM
- | assembly
- | majority
- | term_start
- | term_end
- | predecessor
- | successor
- | prior_term
- }}
- <pre style="overflow:auto;">
- {{Infobox AM
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | caption =
- | constituency_AM = <!--Can be repeated up to eight times by adding a number-->
- | assembly = <!--Can be repeated up to 16 times by adding a number-->
- | majority = <!--Can be repeated up to 16 times by adding a number-->
- | term_start = <!--Can be repeated up to 16 times by adding a number-->
- | term_end = <!--Can be repeated up to 16 times by adding a number-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number-->
- | successor = <!--Can be repeated up to 16 times by adding a number-->
- | prior_term =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===Governor===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Governor}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | order
- | office
- | term_start
- | term_end
- | lieutenant
- | predecessor
- | successor
- }}
- <pre style="overflow:auto;">
- {{Infobox governor
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | order = <!--Can be repeated up to 16 times by adding a number-->
- | office = <!--Can be repeated up to 16 times by adding a number-->
- | term_start = <!--Can be repeated up to 16 times by adding a number-->
- | term_end = <!--Can be repeated up to 16 times by adding a number-->
- | lieutenant = <!--Can be repeated up to 16 times by adding a number-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number-->
- | successor = <!--Can be repeated up to 16 times by adding a number-->
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- If Governor was appointed by a President, add:
- {{Generic template demo
- | president
- }}
- <pre style="overflow:auto;">
- | president = <!--name of president-->
- </pre>
- {{clear}}
- If Governor appointed by other, add:
- {{Generic template demo
- | appointed
- }}
- <pre style="overflow:auto;">
- | appointed = <!--name of appointer-->
- </pre>
- {{clear}}
- ===Judge===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Judge}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | caption
- | office
- | term_start
- | term_end
- | nominator
- | appointer
- | predecessor
- | successor
- }}
- <pre style="overflow:auto;">
- {{Infobox judge
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | caption =
- | office = <!--Can be repeated up to 16 times by changing the number-->
- | term_start = <!--Can be repeated up to 16 times by changing the number-->
- | term_end = <!--Can be repeated up to 16 times by changing the number-->
- | nominator = <!--Can be repeated up to 16 times by changing the number-->
- | appointer = <!--Can be repeated up to 16 times by changing the number-->
- | predecessor = <!--Can be repeated up to 16 times by changing the number-->
- | successor = <!--Can be repeated up to 16 times by changing the number-->
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===Nominee/candidate===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Nominee/candidate}}
- :'''''Do not add this section to pages of people who have held a previous office.'''''
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | caption
- | nominee
- | party_election
- | election_date
- | runningmate
- | opponent
- | incumbent
- }}
- <pre style="overflow:auto;">
- {{Infobox candidate
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | caption =
- | nominee =
- | party_election =
- | election_date =
- | runningmate =
- | opponent =
- | incumbent =
- </pre>
- {{clear}}
- If a candidate, then instead of <code>nominee</code> use:
- {{Generic template demo
- | candidate
- }}
- <pre style="overflow:auto;">
- | candidate =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===Member of Parliament===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Member of Parliament}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | caption
- | constituency_MP
- | parliament
- | majority
- | term_start
- | term_end
- | predecessor
- | successor
- | prior_term
- }}
- <pre style="overflow:auto;">
- {{Infobox MP
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | caption =
- | constituency_MP = <!--Can be repeated up to eight times by adding a number-->
- | parliament = <!--Can be repeated up to 16 times by adding a number-->
- | majority = <!--Can be repeated up to 16 times by adding a number-->
- | term_start = <!--Can be repeated up to 16 times by adding a number-->
- | term_end = <!--Can be repeated up to 16 times by adding a number-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number-->
- | successor = <!--Can be repeated up to 16 times by adding a number-->
- | prior_term =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- ===U.S. Representatives===
- ====U.S. Congressman====
- {{For|examples of this code in use|Template:Infobox officeholder/example#US Congressman}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | state
- | district
- | term_start
- | term_end
- | predecessor
- | successor
- | prior_term
- }}
- <pre style="overflow:auto;">
- {{Infobox Congressman
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | state = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | term_start = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | term_end = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | successor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | prior_term =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- If Congressman served as Speaker of the House add:
- {{Generic template demo
- | speaker
- | term_start2
- | term_end2
- | predecessor2
- | successor2
- }}
- <pre style="overflow:auto;">
- | speaker = <!--number of office holder-->
- | term_start2 =
- | term_end2 =
- | predecessor2 =
- | successor2 =
- </pre>
- {{clear}}
- If Congressman has been elected but not sworn in:
- {{Generic template demo
- | succeeding
- }}
- <pre style="overflow:auto;">
- | succeeding = <!--the name of the incumbent congressman-->
- </pre>
- {{clear}}
- ====State Representative====
- {{For|examples of this code in use|Template:Infobox officeholder/example#State Representative}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | state_house
- | district
- | term_start
- | term_end
- | predecessor
- | successor
- | prior_term
- }}
- <pre style="overflow:auto;">
- {{Infobox state representative
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | state_house = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | term_start = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | term_end = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | predecessor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | successor = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | prior_term =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- For Representative from states that have an Assembly, instead of state_house use:
- {{Generic template demo
- | state_assembly
- | district
- }}
- <pre style="overflow:auto;">
- | state_assembly = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- </pre>
- {{clear}}
- For Representative from states that have a House of Delegates, instead of state_house use:
- {{Generic template demo
- | state_delegate
- | district
- }}
- <pre style="overflow:auto;">
- | state_delegate = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- </pre>
- {{clear}}
- For Representative from states that have a Legislature, instead of state_house use:
- {{Generic template demo
- | state_legislature
- | district
- }}
- <pre style="overflow:auto;">
- | state_legislature = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- | district = <!--Can be repeated up to 16 times by adding a number, start at 3-->
- </pre>
- {{clear}}
- If Representative served as Speaker of the State House add:
- {{Generic template demo
- | speaker
- | state_house
- | term_start2
- | term_end2
- | predecessor2
- | successor2
- }}
- <pre style="overflow:auto;">
- | speaker = <!--number of office holder-->
- | state_house =
- | term_start2 =
- | term_end2 =
- | predecessor2 =
- | successor2 =
- </pre>
- {{clear}}
- ===U.S. Senators===
- ====U.S. Senator====
- {{For|examples of this code in use|Template:Infobox officeholder/example#US Senator}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | image_size
- | image_upright
- | alt
- | jr/sr
- | state
- | term_start
- | term_end
- | predecessor
- | successor
- }}
- <pre style="overflow:auto;">
- {{Infobox senator
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | image_size =
- | image_upright =
- | alt =
- | jr/sr = <!--Can be repeated up to eight times by appending 2, 3, etc--> This code has been disabled per Template talk:Infobox officeholder.
- | state = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | term_start = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | term_end = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | predecessor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | successor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- {{Generic template demo
- | term_start
- | alongside
- }}
- <pre style="overflow:auto;">
- | term_start =
- | alongside = <!--the name of fellow senator-->
- </pre>
- {{clear}}
- If Senator has just been elected and is a Senator-Elect:
- {{Generic template demo
- | succeeding
- }}
- <pre style="overflow:auto;">
- | succeeding = <!--the name of the incumbent senator-->
- </pre>
- {{clear}}
- If Senator served as Senate Majority Leader add:
- {{Generic template demo
- | majorityleader3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | majorityleader3 = <!--number of office holder-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- If Senator served as Congressman add:
- {{Generic template demo
- | state3
- | district3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | state3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | district3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- ====State Senator====
- {{For|examples of this code in use|Template:Infobox officeholder/example#State Senator}}
- {{Generic template demo
- | honorific_prefix
- | name
- | honorific_suffix
- | image
- | alt
- | state_senate
- | district
- | term_start
- | term_end
- | predecessor
- | successor
- | prior_term
- }}
- <pre style="overflow:auto;">
- {{Infobox state senator
- | honorific_prefix =
- | name =
- | honorific_suffix =
- | image =
- | alt =
- | state_senate = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | district = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | term_start = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | term_end = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | predecessor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | successor = <!--Can be repeated up to eight times by appending 2, 3, etc-->
- | prior_term =
- </pre>
- ''add [[#Personal data|personal data]]''
- {{clear}}
- If State Senator served as Majority Leader of the State Senate add:
- {{Generic template demo
- | majority_leader3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | majority_leader3 = <!--number of office holder-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- If State Senator served as Minority Leader of the State Senate add:
- {{Generic template demo
- | minority_leader3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | minority_leader3 = <!--number of office holder-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- If State Senator served as Majority Floor Leader of the State Senate add:
- {{Generic template demo
- | majority_floor_leader3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | majority_floor_leader3 = <!--number of office holder-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- If State Senator served as Minority Floor Leader of the State Senate add:
- {{Generic template demo
- | minority_floor_leader3
- | term_start3
- | term_end3
- | predecessor3
- | successor3
- }}
- <pre style="overflow:auto;">
- | minority_floor_leader3 = <!--number of office holder-->
- | term_start3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | term_end3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | predecessor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- | successor3 = <!--Can be repeated up to seven times by adding a number, start at 3-->
- </pre>
- {{clear}}
- ===Ukrainian legislative office===
- {{For|examples of this code in use|Template:Infobox officeholder/example#Ukrainian legislative office}}
- {{Generic template demo
- | name
- | native_name
- | native_name_lang
- | image
- | caption
- | office1
- | convocation1
- | constituency1
- | term_start1
- | term_end1
- | convocation2
- | constituency2
- | term_start2
- | term_end2
- | office3
- | convocation3
- | constituency3
- | term_start3
- | term_end3
- }}
- <pre style="overflow:auto;">
- {{Infobox Ukrainian legislative office
- | name =
- | native_name =
- | native_name_lang =
- | image =
- | caption =
- | office1 =
- | convocation1 =
- | constituency1 =
- | term_start1 =
- | term_end1 =
- | convocation2 =
- | constituency2 =
- | term_start2 =
- | term_end2 =
- | office3 = <!--Can be repeated up to 16 times by adding a number-->
- | convocation3 = <!--Can be repeated up to 16 times by adding a number-->
- | constituency3 = <!--Can be repeated up to 16 times by adding a number-->
- | term_start3 = <!--Can be repeated up to 16 times by adding a number-->
- | term_end3 = <!--Can be repeated up to 16 times by adding a number-->
- </pre>
- ==Personal data==
- Place this underneath the template
- {{Generic template demo
- | pronunciation
- | birth_name
- | birth_date
- | birth_place
- | death_date
- | death_place
- | death_cause
- | resting_place
- | resting_place_coordinates
- | citizenship
- | nationality
- | party
- | otherparty
- | height
- | spouse
- | partner
- | relations
- | children
- | parents
- | mother
- | father
- | relatives
- | residence
- | education
- | alma_mater
- | occupation
- | profession
- | salary
- | net_worth
- | known_for
- | cabinet
- | committees
- | portfolio
- | awards
- | blank1
- | data1
- | blank2
- | data2
- | blank3
- | data3
- | blank4
- | data4
- | blank5
- | data5
- | signature
- | signature_alt
- | website
- | nickname
- | allegiance
- | branch
- | serviceyears
- | rank
- | unit
- | commands
- | battles
- | mawards
- | military_blank1
- | military_data1
- | military_blank2
- | military_data2
- | military_blank3
- | military_data3
- | military_blank4
- | military_data4
- | military_blank5
- | military_data5
- | module
- | module2
- | module3
- | module4
- | module5
- | footnotes
- }}
- <pre style="overflow:auto;">
- | pronunciation =
- | birth_name =
- | birth_date = <!-- {{Birth date and age|YYYY|MM|DD}} -->
- | birth_place =
- | death_date = <!-- {{Death date and age|YYYY|MM|DD|YYYY|MM|DD}} -->
- | death_place =
- | death_cause =
- | resting_place =
- | resting_place_coordinates =
- | citizenship =
- | nationality =
- | party =
- | otherparty = <!--For additional political affiliations-->
- | height = <!-- "X cm", "X m" or "X ft Y in" plus optional reference (conversions are automatic) -->
- | spouse =
- | partner = <!--For those with a domestic partner and not married-->
- | relations =
- | children =
- | parents = <!-- overrides mother and father parameters -->
- | mother = <!-- may be used (optionally with father parameter) in place of parents parameter (displays "Parent(s)" as label) -->
- | father = <!-- may be used (optionally with mother parameter) in place of parents parameter (displays "Parent(s)" as label) -->
- | relatives =
- | residence =
- | education =
- | alma_mater =
- | occupation =
- | profession =
- | known_for =
- | salary =
- | net_worth = <!-- Net worth should be supported with a citation from a reliable source -->
- | cabinet =
- | committees =
- | portfolio =
- | awards = <!-- For civilian awards - appears as "Awards" if |mawards= is not set -->
- | blank1 =
- | data1 =
- | blank2 =
- | data2 =
- | blank3 =
- | data3 =
- | blank4 =
- | data4 =
- | blank5 =
- | data5 =
- | signature =
- | signature_alt =
- | website =
- <!--Military service-->
- | nickname =
- | allegiance =
- | branch =
- | serviceyears =
- | rank =
- | unit =
- | commands =
- | battles =
- | mawards = <!-- for military awards - appears as "Awards" if |awards= is not set -->
- | military_blank1 =
- | military_data1 =
- | military_blank2 =
- | military_data2 =
- | military_blank3 =
- | military_data3 =
- | military_blank4 =
- | military_data4 =
- | military_blank5 =
- | military_data5 =
- <!--Embedded templates / Footnotes-->
- | module =
- | module2 =
- | module3 =
- | module4 =
- | module5 =
- | footnotes =
- }}
- </pre>
- {{clear}}
- == Embedding other templates ==
- The ''module'' parameters (module, module2, ... module5) may used to embed other templates into this infobox (see [[Wikipedia:Infobox modules]]).
- <pre style="overflow: auto;">
- {{Infobox officeholder
- | name =
- | <!-- etc. -->
- | module =
- {{Infobox football biography | embed = yes
- | <!-- etc. -->
- }}
- }}
- </pre>
- == Embedding within a different infobox ==
- Many 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.
- <pre style="overflow: auto">
- {{Infobox person
- | name = John Infobox
- | image = Example.jpg
- | caption = John Infobox in 2005
- | birth_name = John Officeholder Person Infobox
- | birth_date = {{Birth date|1950|5|5}}
- | birth_place = Template City
- | death_date = {{Death date and age|2010|10|10|1950|5|5}}
- | occupation = Actor
- | years_active = 1970–1990
- | module =
- {{Infobox officeholder | embed = yes
- | office = Mayor of Wikipedia
- | term_start = 1994
- | term_end = 1998
- }}
- | website = {{URL|example.com}}
- }}
- </pre>
- ==Microformat==
- {{UF-hcard-person}}
- ==TemplateData==
- {{TemplateDataHeader}}
- <templatedata>
- {
- "description": "An infobox for office holders.",
- "params": {
- "name": {
- "label": "name",
- "description": "The person's name",
- "type": "string",
- "default": "The pagename"
- },
- "office": {
- "label": "office",
- "description": "Office held",
- "type": "string"
- },
- "order": {
- "label": "order",
- "description": "Used in conjunction with 'office' to state that the officeholder is the nth holder of the office",
- "type": "string"
- },
- "bodyclass": {
- "label": "bodyclass",
- "type": "string"
- },
- "mainwidth": {
- "label": "mainwidth",
- "default": "22em",
- "type": "string"
- },
- "honorific_prefix": {
- "label": "honorific_prefix",
- "type": "string"
- },
- "honorific_suffix": {
- "label": "honorific_suffix",
- "type": "string"
- },
- "native_name": {
- "label": "native_name",
- "type": "string"
- },
- "native_name_lang": {
- "label": "native_name_lang",
- "type": "string"
- },
- "image": {
- "label": "image",
- "type": "string"
- },
- "width": {
- "label": "width",
- "type": "string",
- "aliases": [
- "imagesize",
- " image_size"
- ]
- },
- "image_upright": {
- "label": "image_upright",
- "type": "string",
- },
- "alt": {
- "label": "alt",
- "type": "string"
- },
- "image name": {
- "label": "image name",
- "type": "string"
- },
- "smallimage": {
- "label": "smallimage",
- "type": "string"
- },
- "caption": {
- "label": "caption",
- "type": "string"
- },
- "alongside": {
- "label": "alongside",
- "description": "For two or more people serving in the same position from the same district. (e.g. United States Senators.)",
- "type": "string"
- },
- "ambassador_from": {
- "label": "ambassador_from",
- "type": "string"
- },
- "appointer": {
- "label": "appointer",
- "type": "string"
- },
- "assembly": {
- "label": "assembly",
- "type": "string"
- },
- "chancellor": {
- "label": "chancellor",
- "type": "string"
- },
- "co-leader": {
- "label": "co-leader",
- "type": "string"
- },
- "constituency_AM": {
- "label": "constituency_AM",
- "type": "string"
- },
- "constituency": {
- "label": "constituency",
- "type": "string"
- },
- "country": {
- "label": "country",
- "type": "string"
- },
- "deputy": {
- "label": "deputy",
- "type": "string"
- },
- "district": {
- "label": "district",
- "type": "string"
- },
- "election_date": {
- "label": "election_date",
- "type": "string"
- },
- "firstminister": {
- "label": "firstminister",
- "type": "string"
- },
- "governor-general": {
- "label": "governor-general",
- "type": "string"
- },
- "incumbent": {
- "label": "incumbent",
- "type": "string"
- },
- "jr/sr": {
- "label": "jr/sr",
- "type": "string"
- },
- "jr/sr and state": {
- "label": "jr/sr and state",
- "type": "string"
- },
- "leader": {
- "label": "leader",
- "type": "string"
- },
- "legislature": {
- "label": "legislature",
- "type": "string"
- },
- "lieutenant_governor": {
- "label": "lieutenant_governor",
- "type": "string"
- },
- "lieutenant": {
- "label": "lieutenant",
- "type": "string"
- },
- "majorityleader": {
- "label": "majorityleader",
- "type": "string"
- },
- "minister": {
- "label": "minister",
- "type": "string"
- },
- "minister_from": {
- "label": "minister_from",
- "type": "string"
- },
- "minority_floor_leader": {
- "label": "minority_floor_leader",
- "type": "string"
- },
- "majority_floor_leader": {
- "label": "majority_floor_leader",
- "type": "string"
- },
- "minorityleader": {
- "label": "minorityleader",
- "type": "string"
- },
- "monarch": {
- "label": "monarch",
- "type": "string"
- },
- "nominator": {
- "label": "nominator",
- "type": "string"
- },
- "opponent": {
- "label": "opponent",
- "type": "string"
- },
- "parliament": {
- "label": "parliament",
- "type": "string"
- },
- "parliamentarygroup": {
- "label": "parliamentary group",
- "type": "string"
- },
- "party_election": {
- "label": "party_election",
- "type": "string"
- },
- "predecessor": {
- "label": "predecessor",
- "type": "string"
- },
- "preceding": {
- "label": "preceding",
- "type": "string"
- },
- "preceded": {
- "label": "preceded",
- "type": "string"
- },
- "premier": {
- "label": "premier",
- "type": "string"
- },
- "president": {
- "label": "president",
- "type": "string"
- },
- "primeminister": {
- "label": "primeminister",
- "type": "string"
- },
- "riding": {
- "label": "riding",
- "type": "string"
- },
- "runningmate": {
- "label": "runningmate",
- "type": "string"
- },
- "succeeded": {
- "label": "succeeded",
- "type": "string"
- },
- "succeeding": {
- "label": "succeeding",
- "description": "For President-elect or equivalent.",
- "type": "string"
- },
- "successor": {
- "label": "successor",
- "type": "string"
- },
- "taoiseach": {
- "label": "taoiseach",
- "type": "string"
- },
- "termend": {
- "label": "termend",
- "type": "string"
- },
- "termstart": {
- "label": "termstart",
- "type": "string"
- },
- "title": {
- "label": "title",
- "type": "string"
- },
- "vicegovernor": {
- "label": "vicegovernor",
- "type": "string"
- },
- "vicepresident": {
- "label": "vicepresident",
- "type": "string"
- },
- "vicepremier": {
- "label": "vicepremier",
- "type": "string"
- },
- "viceprimeminister": {
- "label": "viceprimeminister",
- "type": "string"
- },
- "speaker": {
- "label": "speaker",
- "type": "string"
- },
- "nominee": {
- "label": "nominee",
- "type": "string"
- },
- "candidate": {
- "label": "candidate",
- "type": "string"
- },
- "footnotes": {
- "label": "footnotes",
- "type": "string"
- },
- "date": {
- "label": "date",
- "type": "string"
- },
- "year": {
- "label": "year",
- "type": "string"
- },
- "source": {
- "label": "source",
- "type": "string"
- },
- "signature": {
- "label": "signature",
- "type": "string"
- },
- "signature_alt": {
- "label": "signature_alt",
- "type": "string"
- },
- "appointe": {
- "label": "appointe",
- "type": "string"
- },
- "alongside2": {
- "label": "alongside2",
- "type": "string"
- },
- "peerage2": {
- "label": "peerage2",
- "type": "string"
- },
- "ambassador_from2": {
- "label": "ambassador_from2",
- "type": "string"
- },
- "appointer2": {
- "label": "appointer2",
- "type": "string"
- },
- "assembly2": {
- "label": "assembly2",
- "type": "string"
- },
- "chancellor2": {
- "label": "chancellor2",
- "type": "string"
- },
- "co-leader2": {
- "label": "co-leader2",
- "type": "string"
- },
- "constituency_AM2": {
- "label": "constituency_AM2",
- "type": "string"
- },
- "constituency_": {
- "label": "constituency_",
- "type": "string"
- },
- "constituency2": {
- "label": "constituency2",
- "type": "string"
- },
- "country2": {
- "label": "country2",
- "type": "string"
- },
- "deputy2": {
- "label": "deputy2",
- "type": "string"
- },
- "district2": {
- "label": "district2",
- "type": "string"
- },
- "firstminister2": {
- "label": "firstminister2",
- "type": "string"
- },
- "governor": {
- "label": "governor",
- "type": "string"
- },
- "governor-general2": {
- "label": "governor-general2",
- "type": "string"
- },
- "governor2": {
- "label": "governor2",
- "type": "string"
- },
- "jr/sr2": {
- "label": "jr/sr2",
- "type": "string"
- },
- "jr/sr and state2": {
- "label": "jr/sr and state2",
- "type": "string"
- },
- "leader2": {
- "label": "leader2",
- "type": "string"
- },
- "legislature2": {
- "label": "legislature2",
- "type": "string"
- },
- "lieutenant_governor2": {
- "label": "lieutenant_governor2",
- "type": "string"
- },
- "lieutenant2": {
- "label": "lieutenant2",
- "type": "string"
- },
- "majority": {
- "label": "majority",
- "type": "string"
- },
- "majorityleader2": {
- "label": "majorityleader2",
- "type": "string"
- },
- "minister_from2": {
- "label": "minister_from2",
- "type": "string"
- },
- "minority_floor_leader2": {
- "label": "minority_floor_leader2",
- "type": "string"
- },
- "majority_floor_leader2": {
- "label": "majority_floor_leader2",
- "type": "string"
- },
- "majority2": {
- "label": "majority2",
- "type": "string"
- },
- "minister2": {
- "label": "minister2",
- "type": "string"
- },
- "minority": {
- "label": "minority",
- "type": "string"
- },
- "minorityleader2": {
- "label": "minorityleader2",
- "type": "string"
- },
- "monarch2": {
- "label": "monarch2",
- "type": "string"
- },
- "nominator2": {
- "label": "nominator2",
- "type": "string"
- },
- "office2": {
- "label": "office2",
- "type": "string"
- },
- "order2": {
- "label": "order2",
- "type": "string"
- },
- "parliament2": {
- "label": "parliament2",
- "type": "string"
- },
- "parliamentarygroup2": {
- "label": "parliamentary group 2",
- "type": "string"
- },
- "predecessor2": {
- "label": "predecessor2",
- "type": "string"
- },
- "preceding2": {
- "label": "preceding2",
- "type": "string"
- },
- "preceded2": {
- "label": "preceded2",
- "type": "string"
- },
- "premier2": {
- "label": "premier2",
- "type": "string"
- },
- "president2": {
- "label": "president2",
- "type": "string"
- },
- "primeminister2": {
- "label": "primeminister2",
- "type": "string"
- },
- "riding2": {
- "label": "riding2",
- "type": "string"
- },
- "speaker_office": {
- "label": "speaker_office",
- "type": "string"
- },
- "state_assembly": {
- "label": "state_assembly",
- "type": "string"
- },
- "state_delegate": {
- "label": "state_delegate",
- "type": "string"
- },
- "state_house": {
- "label": "state_house",
- "type": "string"
- },
- "state_legislature": {
- "label": "state_legislature",
- "type": "string"
- },
- "state_senate": {
- "label": "state_senate",
- "type": "string"
- },
- "state": {
- "label": "state",
- "type": "string"
- },
- "term": {
- "label": "term",
- "type": "string"
- },
- "party": {
- "label": "party",
- "type": "string"
- },
- "prior_term": {
- "label": "prior_term",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "1blankname": {
- "label": "1blankname",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "1namedata": {
- "label": "1namedata",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "2blankname": {
- "label": "2blankname",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "2namedata": {
- "label": "2namedata",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "3blankname": {
- "label": "3blankname",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "3namedata": {
- "label": "3namedata",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "4blankname": {
- "label": "4blankname",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "4namedata": {
- "label": "4namedata",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "5blankname": {
- "label": "5blankname",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "5namedata": {
- "label": "5namedata",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "1blankname1": {
- "label": "1blankname1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "1namedata1": {
- "label": "1namedata1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "2blankname1": {
- "label": "2blankname1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "2namedata1": {
- "label": "2namedata1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "3blankname1": {
- "label": "3blankname1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "3namedata1": {
- "label": "3namedata1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "4blankname1": {
- "label": "4blankname1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "4namedata1": {
- "label": "4namedata1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "5blankname1": {
- "label": "5blankname1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "5namedata1": {
- "label": "5namedata1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "alongside1": {
- "label": "alongside1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "ambassador_from1": {
- "label": "ambassador_from1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "appointer1": {
- "label": "appointer1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "assembly1": {
- "label": "assembly1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "chancellor1": {
- "label": "chancellor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "co-leader1": {
- "label": "co-leader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "constituency_AM1": {
- "label": "constituency_AM1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "constituency1": {
- "label": "constituency1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "country1": {
- "label": "country1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "deputy1": {
- "label": "deputy1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "district1": {
- "label": "district1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "firstminister1": {
- "label": "firstminister1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "governor-general1": {
- "label": "governor-general1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "governor1": {
- "label": "governor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "jr/sr1": {
- "label": "jr/sr1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "jr/sr and state1": {
- "label": "jr/sr and state1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "leader1": {
- "label": "leader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "legislature1": {
- "label": "legislature1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "lieutenant_governor1": {
- "label": "lieutenant_governor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "lieutenant1": {
- "label": "lieutenant1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "minority_floor_leader1": {
- "label": "minority_floor_leader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "minister_from1": {
- "label": "minister_from1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "majority_floor_leader1": {
- "label": "majority_floor_leader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "majorityleader1": {
- "label": "majorityleader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "majority1": {
- "label": "majority1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "minister1": {
- "label": "minister1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "minorityleader1": {
- "label": "minorityleader1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "monarch1": {
- "label": "monarch1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "nominator1": {
- "label": "nominator1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "office1": {
- "label": "office1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "order1": {
- "label": "order1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "parliament1": {
- "label": "parliament1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "parliamentarygroup1": {
- "label": "parliamentary group 1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "predecessor1": {
- "label": "predecessor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "preceding1": {
- "label": "preceding1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "preceded1": {
- "label": "preceded1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "premier1": {
- "label": "premier1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "president1": {
- "label": "president1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "primeminister1": {
- "label": "primeminister1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "riding1": {
- "label": "riding1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_assembly1": {
- "label": "state_assembly1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_delegate1": {
- "label": "state_delegate1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_house1": {
- "label": "state_house1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_legislature1": {
- "label": "state_legislature1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_senate1": {
- "label": "state_senate1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state1": {
- "label": "state1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "succeeded1": {
- "label": "succeeded1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "succeeding1": {
- "label": "succeeding1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "successor1": {
- "label": "successor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "taoiseach1": {
- "label": "taoiseach1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "termend1": {
- "label": "termend1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "termstart1": {
- "label": "termstart1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "term1": {
- "label": "term1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "title1": {
- "label": "title1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "vicegovernor1": {
- "label": "vicegovernor1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "vicepresident1": {
- "label": "vicepresident1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "vicepremier1": {
- "label": "vicepremier1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "viceprimeminister1": {
- "label": "viceprimeminister1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "prior_term1": {
- "label": "prior_term1",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "termend2": {
- "label": "termend2",
- "type": "string"
- },
- "termstart2": {
- "label": "termstart2",
- "type": "string"
- },
- "term2": {
- "label": "term2",
- "type": "string"
- },
- "title2": {
- "label": "title2",
- "type": "string"
- },
- "vicegovernor2": {
- "label": "vicegovernor2",
- "type": "string"
- },
- "vicepresident2": {
- "label": "vicepresident2",
- "type": "string"
- },
- "vicepremier2": {
- "label": "vicepremier2",
- "type": "string"
- },
- "viceprimeminister2": {
- "label": "viceprimeminister2",
- "type": "string"
- },
- "succeeded2": {
- "label": "succeeded2",
- "type": "string"
- },
- "succeeding2": {
- "label": "succeeding2",
- "type": "string"
- },
- "successor2": {
- "label": "successor2",
- "type": "string"
- },
- "taoiseach2": {
- "label": "taoiseach2",
- "type": "string"
- },
- "state_assembly2": {
- "label": "state_assembly2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_delegate2": {
- "label": "state_delegate2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_house2": {
- "label": "state_house2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_legislature2": {
- "label": "state_legislature2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state_senate2": {
- "label": "state_senate2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "state2": {
- "label": "state2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "prior_term2": {
- "label": "prior_term2",
- "description": "Additional fields numbered up to 14",
- "type": "string"
- },
- "birth_name": {
- "label": "birth_name",
- "type": "string",
- "aliases": [
- "birthname"
- ]
- },
- "birth_date": {
- "label": "birth_date",
- "type": "string"
- },
- "birth_place": {
- "label": "birth_place",
- "type": "string"
- },
- "death_date": {
- "label": "death_date",
- "type": "string"
- },
- "death_place": {
- "label": "death_place",
- "type": "string"
- },
- "resting_place": {
- "label": "resting_place",
- "type": "string",
- "aliases": [
- "restingplace"
- ]
- },
- "resting_place_coordinates": {
- "label": "resting_place_coordinates",
- "type": "string",
- "aliases": [
- "restingplacecoordinates"
- ]
- },
- "citizenship": {
- "label": "citizenship",
- "type": "string"
- },
- "nationality": {
- "label": "nationality",
- "type": "string"
- },
- "otherparty": {
- "label": "otherparty",
- "type": "string"
- },
- "spouse": {
- "label": "spouse",
- "type": "string"
- },
- "partner": {
- "label": "partner",
- "type": "string"
- },
- "relations": {
- "label": "relations",
- "type": "string"
- },
- "children": {
- "label": "children",
- "type": "string"
- },
- "parents": {
- "label": "parents",
- "type": "string"
- },
- "residence": {
- "label": "residence",
- "type": "string"
- },
- "alma_mater": {
- "label": "alma_mater",
- "type": "string"
- },
- "occupation": {
- "label": "occupation",
- "description": " Please observe sentence case and capitalise only the first letter of the first item: (i.e. Politician, entrepreneur, businessman)",
- "type": "string"
- },
- "profession": {
- "label": "profession",
- "description": " Please observe sentence case and capitalise only the first letter of the first item: (i.e. Attorney, accountant)",
- "type": "string"
- },
- "cabinet": {
- "label": "cabinet",
- "type": "string"
- },
- "committees": {
- "label": "committees",
- "type": "string"
- },
- "portfolio": {
- "label": "portfolio",
- "type": "string"
- },
- "blank1": {
- "label": "blank1",
- "description": "Also blank2 ... blank5",
- "type": "string"
- },
- "data1": {
- "label": "data1",
- "description": "Also data2 ... data5",
- "type": "string"
- },
- "website": {
- "label": "website",
- "type": "string"
- },
- "nickname": {
- "label": "nickname",
- "type": "string"
- },
- "allegiance": {
- "label": "allegiance",
- "type": "string"
- },
- "branch": {
- "label": "branch",
- "type": "string"
- },
- "serviceyears": {
- "label": "serviceyears",
- "type": "string"
- },
- "rank": {
- "label": "rank",
- "type": "string"
- },
- "unit": {
- "label": "unit",
- "type": "string"
- },
- "commands": {
- "label": "commands",
- "type": "string"
- },
- "battles": {
- "label": "battles",
- "type": "string"
- },
- "awards": {
- "label": "awards",
- "type": "string"
- },
- "military_blank1": {
- "label": "military_blank1",
- "description": "Also military_blank2 ... military_blank5",
- "type": "string"
- },
- "military_data1": {
- "label": "military_data1",
- "description": "Also military_data2 ... military_data5",
- "type": "string"
- },
- "1blankname2": {
- "label": "1blankname2",
- "type": "string"
- },
- "1namedata2": {
- "label": "1namedata2",
- "type": "string"
- },
- "2blankname2": {
- "label": "2blankname2",
- "type": "string"
- },
- "2namedata2": {
- "label": "2namedata2",
- "type": "string"
- },
- "3blankname2": {
- "label": "3blankname2",
- "type": "string"
- },
- "3namedata2": {
- "label": "3namedata2",
- "type": "string"
- },
- "4blankname2": {
- "label": "4blankname2",
- "type": "string"
- },
- "4namedata2": {
- "label": "4namedata2",
- "type": "string"
- },
- "5blankname2": {
- "label": "5blankname2",
- "type": "string"
- },
- "5namedata2": {
- "label": "5namedata2",
- "type": "string"
- },
- "pronunciation": {
- "label": "pronunciation",
- "type": "string"
- },
- "established": {
- "label": "established",
- "type": "string"
- },
- "founder": {
- "label": "founder",
- "type": "string"
- },
- "chairman": {
- "label": "chairman",
- "type": "string"
- },
- "vice chairman": {
- "label": "vice chairman",
- "type": "string"
- },
- "director": {
- "label": "director",
- "type": "string"
- },
- "principal": {
- "label": "principal",
- "type": "string"
- }
- },
- "format": "block"
- }
- </templatedata>
- == Tracking categories ==
- ; Hidden tracking/maintenance categories (in main and supporting templates):
- * {{clc|Biography template using pronunciation}}
- * {{clc|Pages using infobox officeholder with ambassador from or minister from}}
- * {{clc|Pages using infobox officeholder with an atypical party value}}
- * {{clc|Pages using infobox officeholder with both term and term_start or term_end}}
- * {{clc|Pages using infobox officeholder with office0}}
- * {{clc|Pages using infobox officeholder with speaker and without nominee or candidate}}
- * {{clc|Pages using infobox officeholder with succeeding and term or termend}}
- * {{clc|Pages using infobox officeholder with unknown parameters}}
- == See also ==
- ; Supporting templates
- * [[Template:Infobox officeholder/office]]
- * <!-- [[Template:Infobox officeholder/Personal data]] -->
- <includeonly>
- {{Basepage subpage|
- <!-- Categories below this line, please; interwikis at Wikidata -->
- [[Category:Politics and government infobox templates|Officeholder]]
- [[Category:People and person infobox templates|Officeholder]]
- [[Category:Infobox templates with module parameter|Officeholder]]
- [[Category:Biographical templates usable as a module|Officeholder]]
- [[Category:Templates that add a tracking category]]
- }}
- </includeonly></text>
- <sha1>tu46uqjasgzpg4sacr67fpx6gile73x</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox officeholder/office</title>
- <ns>10</ns>
- <id>32357517</id>
- <revision>
- <id>848584450</id>
- <parentid>848527382</parentid>
- <timestamp>2018-07-02T21:58:46Z</timestamp>
- <contributor>
- <username>Neveselbert</username>
- <id>25820411</id>
- </contributor>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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|}}}
- |{{infobox|child=yes
- | headerstyle = background:{{{color|lavender}}}
- | datastyle = border-bottom:none
- <!--------Speaker of the House--------->
- | header1 = {{#if:{{{speaker|}}}|
- {{{speaker}}} {{#if:{{{state_legislature|}}}
- |[[Speaker of the {{{state_legislature}}} Legislature]]
- |{{#if:{{{state_assembly|}}}
- |[[Speaker of the {{{state_assembly|}}} {{#ifeq:{{{state_assembly|}}}|Nevada||{{#ifeq:{{{state_assembly|}}}|New Jersey|General|State}}}} Assembly]]
- |{{#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}}]]}}
- }}
- }}{{#if:{{{prior_term|}}}|
- <br /><small>{{{prior_term}}}</small>}}
- }}
- <!--------Office--------->
- | header2 = {{#if:{{{nominee|}}}{{{candidate|}}}|
- {{#if:{{{party_election|}}}{{{party|}}}
- |{{#if:{{{party_election|}}}|{{{party_election}}}|{{{party}}}}} {{#if:{{{nominee|}}}|nominee for<br>{{{nominee}}}|candidate for<br>{{{candidate}}}}}
- |{{#if:{{{nominee|}}}|Nominee for<br>{{{nominee}}}|Candidate for<br>{{{candidate}}}}}
- }} }}
- | data3 = {{#if:{{{nominee|}}}{{{candidate|}}}|
- {{#if:{{{termstart|}}}{{{election_date|}}} | {{nowrap|'''Election date'''}}<br />{{#if:{{{election_date|}}}|{{{election_date}}}|{{{termstart}}}}}
- }} }}
- | header4 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
- {{#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}}}
- }} }}
- | header5 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
- {{{jr/sr and state|}}}
- }}
- | header6 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
- {{#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|}}}|
- <br /><small>{{{prior_term}}}</small>}}
- }} }}
- | header7 = {{#if:{{{majority_leader|}}}{{{minority_floor_leader|}}}{{{minority_leader|}}}{{{majority_floor_leader|}}}||
- {{#if:{{{state_legislature|}}}|Member{{#if:{{{succeeding|}}} |-elect}} of the <span style="display: inline-block;">[[{{{state_legislature}}} Legislature]]</span><br />from the {{{district}}} district
- }} }}
- | header8 = {{#if:{{{ambassador_from|}}}{{{minister_from|}}}||
- {{#if:{{{order|}}}
- |{{{order}}}{{#if:{{{office|}}} |&#32;[[{{{office}}}]]}}{{#if:{{{state|}}} |&#32;[[{{{state}}}]]}}{{#if:{{{title|}}} |&#32;{{{title}}}}}
- |{{{office|}}}
- }} }}
- | header9 = {{#if:{{{ambassador_from|}}}{{{minister_from|}}}||
- {{#if:{{{order|}}}
- ||{{{title|}}}
- }} }}
- <!--------Ambassador--------->
- | header10 = {{#if:{{both|{{{ambassador_from|}}}{{{minister_from|}}}|{{{country|}}}}}
- |{{#if:{{{order|}}}|{{{order}}}}} {{#if:{{{minister_from|}}}
- |[[{{{minister_from}}} Ambassador to {{CountryPrefixThe|{{{country}}}}}|{{{minister_from}}} Minister to {{CountryPrefixThe|{{{country}}}}}]]
- |[[{{{ambassador_from}}} Ambassador to {{CountryPrefixThe|{{{country}}}}}]]
- }} [[Category:Pages using infobox officeholder with ambassador from or minister from]]
- }}
- <!--------MP--------->
- | header11 = {{#if:{{{constituency_AM|}}}{{{constituency_MP|}}}|
- {{#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}}}}}}}
- }}
- | 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}}}
- }}
- <!--------Majority Leader (State Senate)--------->
- | header13 = {{#if:{{{majority_leader|}}}|{{{majority_leader}}} {{#if:{{{state_senate|}}}|[[Majority Leader of the {{{state_senate}}} Senate]]|[[United States Senate Majority Leader]]}}
- }}
- <!--------Majority Floor Leader (State Senate)--------->
- | header14 = {{#if:{{{majority_floor_leader|}}}|{{{majority_floor_leader}}} [[Majority Floor Leader of the {{{state_senate}}} Senate]]
- }}
- <!--------Minority Leader (State Senate)--------->
- | header15 = {{#if:{{{minority_leader|}}}|{{{minority_leader}}} [[Minority Leader of the {{{state_senate}}} Senate]]
- }}
- <!--------Minority Floor Leader (State Senate)--------->
- | header16 = {{#if:{{{minority_floor_leader|}}}|{{{minority_floor_leader}}} [[Minority Floor Leader of the {{{state_senate}}} Senate]]
- }}
- <!--------Congressman--------->
- | header17 = {{#if:{{{state_legislature|}}}{{{state_senate|}}}{{{jr/sr|}}}{{{jr/sr and state|}}}||
- {{#if:{{{district|}}}|{{#if:{{{state_assembly|}}}
- |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
- |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}}}}
- }} {{{district}}} district{{#if:{{{prior_term|}}}|
- <br /><small>{{{prior_term}}}</small>}}
- }}
- }}
- <!--------Convocation--------->
- | header18 = {{#if:{{{convocation|}}}|{{{convocation}}}}}
- <!--------Term--------->
- | data19 = {{#if:{{{nominee|}}}{{{candidate|}}}||
- {{#if:{{{succeeding|}}}
- | {{nowrap|'''Assuming office'''}}<br />{{{termstart}}}{{#if:{{{term|}}}{{{termend|}}}|[[Category:Pages using infobox officeholder with succeeding and term or termend]]}}
- | {{#if: {{{term|}}} | {{nowrap|'''{{{termlabel|In office}}}'''}}<br />{{{term}}} }}
- }} }}
- | data20 = {{#if:{{{nominee|}}}{{{candidate|}}}||
- {{#if:{{{succeeding|}}}
- |
- |{{#if:{{{termstart|}}}
- | {{#if:{{{termend|}}}
- |<!--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}}}}}}}
- |<!--else: term is ongoing--><div style="width:100%; margin:0; padding:0; background-color: {{{color|lavender}}}">'''[[Incumbent]]'''</div>
- }}
- }}
- }} }}
- | data21 = {{#if:{{{nominee|}}}{{{candidate|}}}||
- {{#if:{{{succeeding|}}}
- |
- |{{#if:{{{termstart|}}}
- |{{#if:{{{termend|}}}
- |<!--then nothing else; term has ended-->
- |<!--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}}}}}}}
- }}
- }}
- }} }}
- }} }}<!--
- end infobox1 / start infobox2
- -->{{#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|}}}|
- {{infobox|child=yes
- | labelstyle = text-align:left
- | label1 = {{nowrap|Nominated by}}
- | data1 = {{{nominator|}}}
- | label2 = {{nowrap|Appointed by}}
- | data2 = {{{appointer|}}}
- <!--------President, Prime Minister, Governor--------->
- | label3 = Monarch
- | data3 = {{{monarch|}}}
- | label4 = President
- | data4 = {{{president|}}}
- | label5 = {{#if:{{{governor_general|}}}|Governor General|Governor-General}}
- | data5 = {{#if:{{{governor_general|}}}|{{{governor_general}}}|{{{governor-general|}}}}}
- | label6 = {{nowrap|Prime Minister}}
- | data6 = {{{primeminister|}}}
- | label7 = Chancellor
- | data7 = {{{chancellor|}}}
- | label8 = Minister
- | data8 = {{{minister|}}}
- | label9 = Taoiseach
- | data9 = {{{taoiseach|}}}
- | label10 = {{nowrap|First Minister}}
- | data10 = {{{firstminister|}}}
- | label11 = {{nowrap|Chief Minister}}
- | data11 = {{{chiefminister|}}}
- | label12 = Premier
- | data12 = {{{premier|}}}
- | label13 = Governor
- | data13 = {{{governor|}}}
- | label14 = Lieutenant Governor
- | data14 = {{{lieutenant_governor|}}}
- <!--------Vice president/s, Vice Prime Minister/s, Deputy/ies, Lieutenant/s--------->
- | label15 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice President]]|Vice President}}|Vice President}}}}
- | data15 = {{{vicepresident|}}}
- | label16 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice Governor]]|Vice Governor}}|Vice Governor}}}}
- | data16 = {{{vicegovernor|}}}
- | label17 = {{nowrap|{{#if:{{{office|}}}|[[Vice {{{office}}}|Vice PM]]|Vice [[Prime Minister|PM]]}}}}
- | data17 = {{{viceprimeminister|}}}
- | label18 = {{nowrap|{{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Vice {{{office}}}}}|valid|[[Vice {{{office}}}|Vice Premier]]|Vice Premier}}|Vice Premier}}}}
- | data18 = {{{vicepremier|}}}
- | label19 = {{#if:{{{office|}}}|{{#ifeq:{{isValidPageName|Deputy {{{office}}}}}|valid|[[Deputy {{{office}}}|Deputy]]|Deputy}}|Deputy}}
- | data19 = {{{deputy|}}}
- | label20 = Leader
- | data20 = {{{leader|}}}
- | label21 = {{#if:{{{office|}}}|[[Lieutenant {{{office}}}|Lieutenant]]|Lieutenant}}
- | data21 = {{{lieutenant|}}}
- <!--------Blank fields--------->
- | label22 = {{{1blankname|}}}
- | data22 = {{{1namedata|}}}
- | label23 = {{{2blankname|}}}
- | data23 = {{{2namedata|}}}
- | label24 = {{{3blankname|}}}
- | data24 = {{{3namedata|}}}
- | label25 = {{{4blankname|}}}
- | data25 = {{{4namedata|}}}
- | label26 = {{{5blankname|}}}
- | data26 = {{{5namedata|}}}
- <!--------Predecessor/successor--------->
- | label27 = {{nowrap|Running mate}}
- | data27 = {{{runningmate|}}}
- | label28 = Opponent(s)
- | data28 = {{{opponent|}}}
- | label29 = Incumbent
- | data29 = {{{incumbent|}}}
- | label30 = {{#if:{{{succeeding|}}}|Succeeding|Preceding}}
- | data30 = {{#if:{{{succeeding|}}}|{{{succeeding|}}}|{{{preceding|}}}}}
- | label32 = {{nowrap|Preceded by}}
- | data32 = {{#if:{{{succeeding|}}}||{{#if:{{{predecessor|}}}|{{{predecessor}}}|{{{preceded|}}}}}}}
- | label33 = {{nowrap|Succeeded by}}
- | data33 = {{#if:{{{succeeding|}}}||{{#switch:{{#if:{{{successor|}}}|{{{successor}}}|{{{succeeded|}}}}}
- | Incumbent
- | '''Incumbent'''
- | ''Incumbent''
- | [[Incumbent]]
- | incumbent
- | '''incumbent'''
- | ''incumbent''
- | [[incumbent]] =
- | #default = {{#if:{{{successor|}}}|{{{successor}}}|{{{succeeded|}}}}}
- }}}}
- <!--------Constituency/Majority--------->
- | label34 = [[Parliamentary group]]
- | data34 = {{{parliamentarygroup|}}}
- | label35 = Constituency
- | data35 = {{{constituency|}}}
- | label36 = Majority
- | data36 = {{{majority|}}}
- }} }}<noinclude>{{documentation}}</noinclude></text>
- <sha1>2rmo84jauqmguacs6lf3h069y8nunoa</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox person/height</title>
- <ns>10</ns>
- <id>46311214</id>
- <revision>
- <id>750531944</id>
- <parentid>669608865</parentid>
- <timestamp>2016-11-20T09:38:14Z</timestamp>
- <contributor>
- <username>Zyxw</username>
- <id>473593</id>
- </contributor>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="891">{{infobox person/height/locate|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{#invoke:String|replace|<!--
- -->{{{1|}}}<!--
- -->|metre|m}}<!--
- -->|meter|m}}<!--
- -->|centi|c}}<!--
- -->|feet|ft}}<!--
- -->|foot|ft}}<!--
- -->|inches|in}}<!--
- -->|inch|in}}<!--
- -->|ms|m}}<!--
- -->|ins|in}}<!--
- -->|pattern=[[in|in]]|replace=[[inch|in]]}}<!--
- -->|pattern=[[Centim|cm]]|replace=[[Centimetre|cm]]}}<!--
- -->|pattern=[[m]]s|replace=[[Metre|m]]}}<!--
- -->|pattern=[[cm]]s|replace=[[Centimetre|cm]]}}<!--
- -->}}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>hm0a0y5eigfl1uxgvuml6a1e537my1r</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox person/height/locate</title>
- <ns>10</ns>
- <id>46273076</id>
- <revision>
- <id>669728053</id>
- <parentid>654876043</parentid>
- <timestamp>2015-07-03T03:27:49Z</timestamp>
- <contributor>
- <username>Zyxw</username>
- <id>473593</id>
- </contributor>
- <comment>add documentation</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="442">{{infobox person/height/switch
- |{{{1|}}}
- |{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}
- |m={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|m}}
- |c={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|cm}}
- |f={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|ft}}
- |i={{#invoke:String|find|{{#invoke:String|replace|{{{1|}}}|&nbsp;| }}|in}}
- }}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>2iwsnrmmoqw8wz2cfz2gqum93q5z5o8</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Infobox person/height/switch</title>
- <ns>10</ns>
- <id>46273068</id>
- <revision>
- <id>669728313</id>
- <parentid>654284746</parentid>
- <timestamp>2015-07-03T03:30:59Z</timestamp>
- <contributor>
- <username>Zyxw</username>
- <id>473593</id>
- </contributor>
- <comment>add documentation</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="1628">{{#switch:0
- |{{{m}}}{{{f}}}{{{i}}}={{{1|}}}
- |{{{f}}}{{{i}}}={{#ifeq:{{{c}}}|0
- |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{m|1}}}-1}}}}}}
- |{{{1|}}}
- |{{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}}}}
- }}
- |{{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{c|1}}}-1}}}}}}
- |{{{1|}}}
- |{{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}}}}
- }}
- }}
- |{{{m}}}{{{f}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{i|1}}}-1}}}}}}
- |{{{1|}}}
- |{{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}}}}
- }}
- |{{{m}}}{{{i}}}={{#iferror:{{#expr:{{#invoke:String|sub|{{{2|0}}}|1|{{#expr:{{{f|1}}}-1}}}}}}
- |{{{1|}}}
- |{{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}}}}
- }}
- |{{{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}}}}}}
- |{{{1|}}}
- |{{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}}}}
- }}
- |{{{1|}}}
- }}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>tfj76ybwce528ig6r7c2o24m7aezoaz</sha1>
- </revision>
- </page>
- <page>
- <title>Template:IsValidPageName</title>
- <ns>10</ns>
- <id>13887241</id>
- <revision>
- <id>602408525</id>
- <parentid>602403710</parentid>
- <timestamp>2014-04-02T12:17:17Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>use [[Module:IsValidPageName]] per protected edit request by [[User:Mxn]]</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="189">{{#ifeq:{{{1}}}|-||{{#invoke:isValidPageName|isValidPageName|{{{1}}}}}}}<noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>m87vggnewseew9faw9mw0pefjucksud</sha1>
- </revision>
- </page>
- <page>
- <title>Template:KMT</title>
- <ns>10</ns>
- <id>11473981</id>
- <revision>
- <id>577859184</id>
- <parentid>399531305</parentid>
- <timestamp>2013-10-19T16:14:48Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <minor/>
- <comment>Changed protection level of Template:KMT: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="69">{{KMT/logo}} [[Kuomintang]]<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>bciuvfwplt78dlw69sb47427jsiusje</sha1>
- </revision>
- </page>
- <page>
- <title>Template:KMT/logo</title>
- <ns>10</ns>
- <id>29792324</id>
- <revision>
- <id>577830981</id>
- <parentid>430631591</parentid>
- <timestamp>2013-10-19T11:18:58Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <minor/>
- <comment>Changed protection level of Template:KMT/logo: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="84">[[File:Emblem of the Kuomintang.svg|25px]]<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>1pkag82pg2v2vjtqixy23cnhxln84ki</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Lua</title>
- <ns>10</ns>
- <id>38752725</id>
- <revision>
- <id>827250968</id>
- <parentid>804533741</parentid>
- <timestamp>2018-02-23T17:02:35Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="196"><includeonly>{{#invoke:Lua banner|main}}</includeonly><noinclude>
- {{Lua|Module:Lua banner}}
- {{documentation}}
- <!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>pnmjp3f3fl321yf2jpg5syebi412n7b</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Main other</title>
- <ns>10</ns>
- <id>17220251</id>
- <revision>
- <id>388689011</id>
- <parentid>334818505</parentid>
- <timestamp>2010-10-04T14:46:48Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>remove {{pp-template}}</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="409">{{#switch:
- <!--If no or empty "demospace" parameter then detect namespace-->
- {{#if:{{{demospace|}}}
- | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
- | {{#ifeq:{{NAMESPACE}}|{{ns:0}}
- | main
- | other
- }}
- }}
- | main = {{{1|}}}
- | other
- | #default = {{{2|}}}
- }}<noinclude>
- {{documentation}}
- <!-- Add categories and interwikis to the /doc subpage, not here! -->
- </noinclude></text>
- <sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Mbox</title>
- <ns>10</ns>
- <id>13319244</id>
- <revision>
- <id>772147376</id>
- <parentid>577968069</parentid>
- <timestamp>2017-03-25T16:04:14Z</timestamp>
- <contributor>
- <username>Jo-Jo Eumerus</username>
- <id>17449355</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="145">{{#invoke:Message box|mbox}}<noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>mpflpb6s8l8gaoxaeypyuqyu2w7vc7i</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Notice</title>
- <ns>10</ns>
- <id>1720676</id>
- <revision>
- <id>842723603</id>
- <parentid>753895133</parentid>
- <timestamp>2018-05-24T07:51:13Z</timestamp>
- <contributor>
- <username>TheDJ</username>
- <id>244887</id>
- </contributor>
- <comment>remove invalid css</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="1008">{{Mbox
- | name = Notice
- | demospace = {{{demospace|}}}
- | style = {{#if:{{{style|}}} |{{#if:{{{small|}}}||width:80%;}} {{{style}}} }}
- | subst = <includeonly>{{subst:substcheck}}</includeonly>
- | type = notice
- | image = {{#if:{{{image|}}} |[[File:{{{image}}}|40px|Notice]]}}
- | small = {{{small|}}}
- | smallimage = {{#if:{{{image|}}} |[[File:{{{image}}}|30px|Notice]]}}
- | imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}
- | textstyle = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}
- | text = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |<div style="{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}">'''{{{header|{{{heading|{{{title|}}}}}}}}}'''</div>}}<!--
- -->{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}
- }}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>etnai90pwmwvjm60vm69f5gjdnc8xy4</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Nowrap</title>
- <ns>10</ns>
- <id>1627975</id>
- <restrictions>edit=sysop:move=sysop</restrictions>
- <revision>
- <id>692794261</id>
- <parentid>462345338</parentid>
- <timestamp>2015-11-28T10:13:53Z</timestamp>
- <contributor>
- <username>Edokter</username>
- <id>1624037</id>
- </contributor>
- <comment>Adapt comment; edits inside noinclude blocks should not affect job queue, but won't kill parser either way.</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="145"><span class="nowrap">{{{1}}}</span><noinclude>
- {{documentation}}
- <!-- Categories go on the /doc page; interwikis go to Wikidata. -->
- </noinclude></text>
- <sha1>avb5tcymgupik1ikutqclidkj9tnitx</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Ombox</title>
- <ns>10</ns>
- <id>17522403</id>
- <revision>
- <id>577969039</id>
- <parentid>463278061</parentid>
- <timestamp>2013-10-20T12:45:08Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>switch to Lua version</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="146">{{#invoke:Message box|ombox}}<noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1>
- </revision>
- </page>
- <page>
- <title>Template:PAGENAMEBASE</title>
- <ns>10</ns>
- <id>29780699</id>
- <revision>
- <id>708575225</id>
- <parentid>636280634</parentid>
- <timestamp>2016-03-06T09:37:56Z</timestamp>
- <contributor>
- <username>Cabayi</username>
- <id>6561336</id>
- </contributor>
- <comment>per edit request & discussion</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="141">{{{{{|safesubst:}}}#Invoke:String|replace|{{{1|{{{{{|safesubst:}}}PAGENAME}}}}}|%s+%b()$||1|false}}<noinclude>
- {{documentation}}
- </noinclude></text>
- <sha1>sam8aetb68ekom4findu6pp900ngldr</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Para</title>
- <ns>10</ns>
- <id>16639086</id>
- <revision>
- <id>843137667</id>
- <parentid>679823176</parentid>
- <timestamp>2018-05-27T03:56:49Z</timestamp>
- <contributor>
- <username>JJMC89</username>
- <id>24812038</id>
- </contributor>
- <comment>clean subst</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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>
- {{Documentation}}
- <!--Categories and interwikis go near the bottom of the /doc subpage.-->
- </noinclude></text>
- <sha1>fzhirwlsi2n3ak3qun5tviym3yisuda</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Parameter names example</title>
- <ns>10</ns>
- <id>43305139</id>
- <revision>
- <id>804536750</id>
- <parentid>623570683</parentid>
- <timestamp>2017-10-09T17:20:51Z</timestamp>
- <contributor>
- <username>MusikAnimal</username>
- <id>14882394</id>
- </contributor>
- <minor/>
- <comment>Protected "[[Template:Parameter names example]]": [[WP:High-risk templates|Highly visible template]]; 1,000+ transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="256"><includeonly>{{#invoke:Parameter names example|main}}</includeonly><noinclude>
- {{hatnote|[[Template:Generic template demo]] and [[Template:Pnex]] redirect here.}}<!--(hatnote more noticeable here than within Documentation)-->
- {{Documentation}}
- </noinclude></text>
- <sha1>cjle1o3weadzp7u1v4l5clox5ri8mpi</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Person infobox header</title>
- <ns>10</ns>
- <id>35514345</id>
- <revision>
- <id>779401388</id>
- <parentid>779400974</parentid>
- <timestamp>2017-05-08T18:09:48Z</timestamp>
- <contributor>
- <username>Obsuser</username>
- <id>22359926</id>
- </contributor>
- <comment>not only about living</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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]].
- All 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]].}}
- <noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>jod8xgsivbjufzzca2z1az6kmt07fji</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Refbegin</title>
- <ns>10</ns>
- <id>9391283</id>
- <revision>
- <id>780001198</id>
- <parentid>772120876</parentid>
- <timestamp>2017-05-12T09:46:40Z</timestamp>
- <contributor>
- <username>TheDJ</username>
- <id>244887</id>
- </contributor>
- <comment>Use class from MediaWiki:Common.css to implement hanging indentation</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="828"><includeonly><div class="refbegin <!--
- -->{{#if: {{{indent|}}}
- | refbegin-hanging-indents }} <!--
- -->{{#if: {{{normalfont|}}}
- | refbegin-100 }} <!--
- -->{{#if: {{{1|}}}
- | columns {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
- | references-column-width
- | references-column-count references-column-count-{{#if:1|{{{1}}}}} }}
- | {{#if: {{{colwidth|}}}
- | references-column-width }} }}" style="<!--
- -->{{#if: {{{1|}}}
- | {{#iferror: {{#ifexpr: {{{1|1}}} > 1 }}
- | {{column-width|{{#if:1|{{{1}}}}}}}
- | {{column-count|{{#if:1|{{{1}}}}}}} }}
- | {{#if: {{{colwidth|}}}
- | {{column-width|{{{colwidth}}}}} }} }}"><!--
- -->{{#if: {{{normalfont|}}}
- | [[Category:Pages using refbegin with normalfont parameter]]}}</includeonly><noinclude>
- {{Documentation}}
- {{/TemplateData}}
- </noinclude></text>
- <sha1>jviesmg7qfir8shmypzzu26dk3g9eiw</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Refend</title>
- <ns>10</ns>
- <id>10023179</id>
- <revision>
- <id>792167400</id>
- <parentid>772120878</parentid>
- <timestamp>2017-07-24T21:40:56Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>remove </dl> since no <dl> in Template:Refbegin</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="246"><includeonly></div></includeonly><noinclude>
- {{template doc|Template:refbegin/doc}}
- {{TemplateDataHeader}}
- <templatedata>
- {
- "description": "Ends a reference lists started by {{refbegin}}.",
- "params": {
- }
- }
- </templatedata>
- </noinclude></text>
- <sha1>kcrxzrf6v4rvbl0yhnfcb5labufpnsp</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Remove first word</title>
- <ns>10</ns>
- <id>31754320</id>
- <revision>
- <id>825507827</id>
- <parentid>825479029</parentid>
- <timestamp>2018-02-13T20:10:27Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>separate pp-template not needed</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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>
- <sha1>q3rvb3vj9phd54s3yecz8846q90qfgo</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Str left</title>
- <ns>10</ns>
- <id>21696393</id>
- <revision>
- <id>741880261</id>
- <parentid>605122708</parentid>
- <timestamp>2016-09-30T07:01:19Z</timestamp>
- <contributor>
- <username>Ymblanter</username>
- <id>14596827</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="184"><includeonly>{{safesubst:padleft:|{{{2|1}}}|{{{1}}}}}</includeonly><noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1>
- </revision>
- </page>
- <page>
- <title>Template:TemplateDataHeader</title>
- <ns>10</ns>
- <id>46746520</id>
- <redirect title="Template:TemplateData header" />
- <revision>
- <id>827245774</id>
- <parentid>663071012</parentid>
- <timestamp>2018-02-23T16:30:31Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="58">#REDIRECT [[Template:TemplateData header]]
- {{R from move}}</text>
- <sha1>bfnm7z66t4q2d8otfa0y3vtgkcwrfao</sha1>
- </revision>
- </page>
- <page>
- <title>Template:TemplateData header</title>
- <ns>10</ns>
- <id>40047498</id>
- <revision>
- <id>827245794</id>
- <parentid>826349555</parentid>
- <timestamp>2018-02-23T16:30:31Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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}}}}
- '''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
- </div><includeonly>{{#ifeq:{{SUBPAGENAME}}|sandbox||
- [[Category:TemplateData documentation]]
- }}</includeonly><noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>1lgj007izalttlek052vptodul1clkt</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Template error report</title>
- <ns>10</ns>
- <id>51792646</id>
- <revision>
- <id>827245762</id>
- <parentid>826348773</parentid>
- <timestamp>2018-02-23T16:30:31Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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>
- {{documentation}}
- [[Category:External link templates]]</noinclude></text>
- <sha1>58xkdtdvcn1dijd3bs4zlibe610r8r1</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Template other</title>
- <ns>10</ns>
- <id>21418395</id>
- <revision>
- <id>774731050</id>
- <parentid>388689098</parentid>
- <timestamp>2017-04-10T09:49:10Z</timestamp>
- <contributor>
- <username>CambridgeBayWeather</username>
- <id>294180</id>
- </contributor>
- <minor/>
- <comment>Changed protection level for "[[Template:Template other]]": Request at RFPP ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="435">{{#switch:
- <!--If no or empty "demospace" parameter then detect namespace-->
- {{#if:{{{demospace|}}}
- | {{lc: {{{demospace}}} }} <!--Use lower case "demospace"-->
- | {{#ifeq:{{NAMESPACE}}|{{ns:Template}}
- | template
- | other
- }}
- }}
- | template = {{{1|}}}
- | other
- | #default = {{{2|}}}
- }}<!--End switch--><noinclude>
- {{documentation}}
- <!-- Add categories and interwikis to the /doc subpage, not here! -->
- </noinclude></text>
- <sha1>0tcssjmltwl7y5v3f5wj2kqciaabqly</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Tl</title>
- <ns>10</ns>
- <id>1487430</id>
- <revision>
- <id>836995080</id>
- <parentid>776260390</parentid>
- <timestamp>2018-04-18T02:46:37Z</timestamp>
- <contributor>
- <username>Xaosflux</username>
- <id>502540</id>
- </contributor>
- <minor/>
- <comment>Changed protection level for "[[Template:Tl]]": used in the mediawiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="168">&#123;&#123;[[Template:{{{1}}}|{{{1}}}]]&#125;&#125;<noinclude>
- {{documentation}}
- <!-- Categories go on the /doc subpage and interwikis go on Wikidata. -->
- </noinclude></text>
- <sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Tld</title>
- <ns>10</ns>
- <id>16451582</id>
- <revision>
- <id>722499597</id>
- <parentid>559778632</parentid>
- <timestamp>2016-05-28T14:58:08Z</timestamp>
- <contributor>
- <username>Yaris678</username>
- <id>1210941</id>
- </contributor>
- <minor/>
- <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>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="766">{{Tlg|code=yes|nolink=yes|subst={{{subst|}}}|nowrap={{#if:{{{allowlinebreak|}}}||yes}}|{{{1|}}}<!--
- -->|2{{#ifeq:{{{2}}}|{{{2|x}}}||x}}={{{2}}}<!--
- -->|3{{#ifeq:{{{3}}}|{{{3|x}}}||x}}={{{3}}}<!--
- -->|4{{#ifeq:{{{4}}}|{{{4|x}}}||x}}={{{4}}}<!--
- -->|5{{#ifeq:{{{5}}}|{{{5|x}}}||x}}={{{5}}}<!--
- -->|6{{#ifeq:{{{6}}}|{{{6|x}}}||x}}={{{6}}}<!--
- -->|7{{#ifeq:{{{7}}}|{{{7|x}}}||x}}={{{7}}}<!--
- -->|8{{#ifeq:{{{8}}}|{{{8|x}}}||x}}={{{8}}}<!--
- -->|9{{#ifeq:{{{9}}}|{{{9|x}}}||x}}={{{9}}}<!--
- -->|10{{#ifeq:{{{10}}}|{{{10|x}}}||x}}={{{10}}}<!--
- -->|11{{#ifeq:{{{11}}}|{{{11|x}}}||x}}={{{11}}}<!--
- -->|12{{#ifeq:{{{12}}}|{{{12|x}}}||x}}={{{12}}}}}<noinclude>
- {{Documentation|Template:Tlc/doc}}
- <!-- Add categories and interwikis to the /doc subpage, not here! -->
- </noinclude></text>
- <sha1>m2m4u5powlflffx95pdx6t1iqjyxxrr</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Tlg</title>
- <ns>10</ns>
- <id>31734151</id>
- <revision>
- <id>790785155</id>
- <parentid>790782997</parentid>
- <timestamp>2017-07-16T01:43:12Z</timestamp>
- <contributor>
- <username>Zyxw</username>
- <id>473593</id>
- </contributor>
- <minor/>
- <comment>update placement of span</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="2794"><includeonly><!--
- -->{{#if:{{{nowrap|}}} |<span class="nowrap">}}<!--
- -->{{#if:{{{code|{{{tt|}}}}}} |<code> |{{#if:{{{plaincode|}}}|<code style="border:none;background:transparent;">}} }}<!--
- -->{{#if:{{{kbd|}}} |<kbd>}}<!--
- -->{{#if:{{{nowrapname|}}} |<span class="nowrap">}}<!--
- -->{{#if:{{{braceinside|}}} | |<nowiki>{{</nowiki>}}<!--
- -->{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}<!--
- -->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!--
- -->{{#if:{{{nolink|}}} |<!--then omit template link, else:
- -->| {{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!--
- -->{{!((}}:<!--(start building link with "[[:")
- -->{{#ifeq:{{padleft:|1|{{{1}}}}}|: <!--i.e. if {{{1}}}'s first character is a colon,
- then:--> |{{FULLPAGENAME:{{{1}}}}}<!--
- else:--> |{{#switch:{{NAMESPACE:{{#if:{{{1|}}}|{{{1}}}|{{FULLPAGENAME}}}}}}
- | {{ns:0}} = {{ns:10}}:{{#if:{{{1|}}}|{{PAGENAME:{{{1}}}}}|{{PAGENAME}}}}
- | #default = {{#if:{{{1|}}}|{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME}}}}
- }}}}<!--
- -->{{!}}<!--(pipe between link and label, i.e. [[:link|label]])
- -->}}<!--
- -->{{#if:{{{braceinside|}}} |<nowiki>{</nowiki>}}<!--
- label / template name:
- -->{{{alttext|{{#if:{{{1|}}}|{{{1}}}|{{#ifeq:{{NAMESPACE}}|{{ns:Template}}|{{PAGENAME}}|{{FULLPAGENAME}}}}}}}}}<!--
- -->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!--
- -->{{#if:{{{nolink|}}} | |<!--
- -->{{!))}}<!--(end link)
- -->{{#if:{{{braceinside|}}} |<nowiki>}</nowiki>}}<!--
- -->}}<!--
- -->{{#if:{{{bold|{{{boldlink|{{{boldname|}}}}}}}}} |'''}}<!--
- -->{{#if:{{{nowrapname|}}} |</span>}}<!--
- -->{{#if:{{{italic|{{{italics|}}}}}} |<span style="font-style:italic;">}}<!--
- -->{{#ifeq:{{{2|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{2}}}}}}}<!--
- -->{{#ifeq:{{{3|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{3}}}}}}}<!--
- -->{{#ifeq:{{{4|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{4}}}}}}}<!--
- -->{{#ifeq:{{{5|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{5}}}}}}}<!--
- -->{{#ifeq:{{{6|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{6}}}}}}}<!--
- -->{{#ifeq:{{{7|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{7}}}}}}}<!--
- -->{{#ifeq:{{{8|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{8}}}}}}}<!--
- -->{{#ifeq:{{{9|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{9}}}}}}}<!--
- -->{{#ifeq:{{{10|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{10}}}}}}}<!--
- -->{{#ifeq:{{{11|¬}}}|¬ | |&#124;{{#tag:nowiki|{{{11}}}}}}}<!--
- -->{{#if:{{{12|}}} |&#124;…}}<!--
- -->{{#if:{{{italic|{{{italics|}}}}}} |</span>}}<!--
- -->{{#if:{{{braceinside|}}} | |<nowiki>}}</nowiki>}}<!--
- -->{{#if:{{{kbd|}}} |</kbd>}}<!--
- -->{{#if:{{{code|{{{tt|}}}}}}{{{plaincode|}}} |</code>}}<!--
- -->{{#if:{{{nowrap|}}} |</span>}}<!--
- --></includeonly><noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>byyf1x2onevkha93mms6divoszra5y1</sha1>
- </revision>
- </page>
- <page>
- <title>Template:UF-hcard-person</title>
- <ns>10</ns>
- <id>10730642</id>
- <revision>
- <id>833916985</id>
- <parentid>833916926</parentid>
- <timestamp>2018-04-03T00:59:17Z</timestamp>
- <contributor>
- <username>Charles E Hampton II</username>
- <id>1545773</id>
- </contributor>
- <comment>Undid revision 833916926 by [[Special:Contributions/Charles E Hampton II|Charles E Hampton II]] ([[User talk:Charles E Hampton II|talk]])</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <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]].
- === Sub-templates ===
- Date-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]].
- To include a URL, use {{Tl|URL}}.
- '''Please do not remove instances of these sub-templates.'''
- === Classes ===
- hCard uses HTML classes including:
- {{Flatlist/microformat|
- *adr
- *agent
- *bday
- *birthplace
- *category
- *country-name
- *deathdate
- *deathplace
- *extended-address
- *family-name
- *fn (required)
- *given-name
- *honorific-prefix
- *honorific-suffix
- *label
- *locality
- *n
- *nickname
- *note
- *org
- *role
- *url
- *vcard
- }}
- '''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>
- [[Category:Templates generating hCards]]
- [[Category:Microformat (uF) message templates]]
- </noinclude></text>
- <sha1>axz1fcq74yk4k48upkzdbv1ne3ifwdf</sha1>
- </revision>
- </page>
- <page>
- <title>Template:When on basepage</title>
- <ns>10</ns>
- <id>24953498</id>
- <revision>
- <id>627655680</id>
- <parentid>623562904</parentid>
- <timestamp>2014-09-30T08:52:52Z</timestamp>
- <contributor>
- <username>Sardanaphalus</username>
- <id>427947</id>
- </contributor>
- <minor/>
- <comment>Sardanaphalus moved page [[Template:Basepage subpage]] to [[Template:When on basepage]]: Per move request</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="686">{{#switch:
- <!--If no or empty "page" parameter then detect
- basepage/subpage/subsubpage-->
- {{#if:{{{page|}}}
- | {{#if:{{#titleparts:{{{page}}}|0|3}}
- | subsubpage <!--Subsubpage or lower-->
- | {{#if:{{#titleparts:{{{page}}}|0|2}}
- | subpage
- | basepage
- }}
- }}
- | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|3}}
- | subsubpage <!--Subsubpage or lower-->
- | {{#if:{{#titleparts:{{FULLPAGENAME}}|0|2}}
- | subpage
- | basepage
- }}
- }}
- }}
- | basepage = {{{1|}}}
- | subpage = {{{2|}}}
- | subsubpage = {{{3| {{{2|}}} }}} <!--Respecting empty parameter on purpose-->
- }}<!--End switch--><noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>o7r5t2v8ni781nvx47cen0sam91sxxc</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Yesno</title>
- <ns>10</ns>
- <id>22255088</id>
- <revision>
- <id>821904792</id>
- <parentid>669640856</parentid>
- <timestamp>2018-01-23T08:37:08Z</timestamp>
- <contributor>
- <username>MSGJ</username>
- <id>42630</id>
- </contributor>
- <comment>add support for on/off, per discussion</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="366">{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: {{{1|¬}}} }}
- |no
- |n
- |false
- |off
- |0 = {{{no|<!-- null -->}}}
- | = {{{blank|{{{no|<!-- null -->}}}}}}
- |¬ = {{{¬|}}}
- |yes
- |y
- |true
- |on
- |1 = {{{yes|yes}}}
- |#default = {{{def|{{{yes|yes}}}}}}
- }}<noinclude>
- {{Documentation}}
- </noinclude></text>
- <sha1>r1wh7ajnm478r67owpatavjany80n9e</sha1>
- </revision>
- </page>
- <page>
- <title>Template:Yesno-no</title>
- <ns>10</ns>
- <id>48375573</id>
- <revision>
- <id>825510157</id>
- <parentid>804450734</parentid>
- <timestamp>2018-02-13T20:27:17Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>separate pp-template not needed</comment>
- <model>wikitext</model>
- <format>text/x-wiki</format>
- <text xml:space="preserve" bytes="269">{{safesubst:<noinclude />yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}<noinclude>
- {{Documentation|Template:Yesno/doc}}
- <!--Categories go in the doc page referenced above; interwikis go in Wikidata.-->
- </noinclude></text>
- <sha1>34vmtxa9ubuh1vz2ulp78m5ela68riu</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Arguments</title>
- <ns>828</ns>
- <id>41298065</id>
- <revision>
- <id>696500078</id>
- <parentid>668829606</parentid>
- <timestamp>2015-12-23T16:07:27Z</timestamp>
- <contributor>
- <username>Xaosflux</username>
- <id>502540</id>
- </contributor>
- <minor/>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="10054">-- This module provides easy processing of arguments passed to Scribunto from
- -- #invoke. It is intended for use by other Lua modules, and should not be
- -- called from #invoke directly.
- local libraryUtil = require('libraryUtil')
- local checkType = libraryUtil.checkType
- local arguments = {}
- -- Generate four different tidyVal functions, so that we don't have to check the
- -- options every time we call it.
- local function tidyValDefault(key, val)
- if type(val) == 'string' then
- val = val:match('^%s*(.-)%s*$')
- if val == '' then
- return nil
- else
- return val
- end
- else
- return val
- end
- end
- local function tidyValTrimOnly(key, val)
- if type(val) == 'string' then
- return val:match('^%s*(.-)%s*$')
- else
- return val
- end
- end
- local function tidyValRemoveBlanksOnly(key, val)
- if type(val) == 'string' then
- if val:find('%S') then
- return val
- else
- return nil
- end
- else
- return val
- end
- end
- local function tidyValNoChange(key, val)
- return val
- end
- local function matchesTitle(given, title)
- local tp = type( given )
- return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title
- end
- local translate_mt = { __index = function(t, k) return k end }
- function arguments.getArgs(frame, options)
- checkType('getArgs', 1, frame, 'table', true)
- checkType('getArgs', 2, options, 'table', true)
- frame = frame or {}
- options = options or {}
- --[[
- -- Set up argument translation.
- --]]
- options.translate = options.translate or {}
- if getmetatable(options.translate) == nil then
- setmetatable(options.translate, translate_mt)
- end
- if options.backtranslate == nil then
- options.backtranslate = {}
- for k,v in pairs(options.translate) do
- options.backtranslate[v] = k
- end
- end
- if options.backtranslate and getmetatable(options.backtranslate) == nil then
- setmetatable(options.backtranslate, {
- __index = function(t, k)
- if options.translate[k] ~= k then
- return nil
- else
- return k
- end
- end
- })
- end
- --[[
- -- Get the argument tables. If we were passed a valid frame object, get the
- -- frame arguments (fargs) and the parent frame arguments (pargs), depending
- -- on the options set and on the parent frame's availability. If we weren't
- -- passed a valid frame object, we are being called from another Lua module
- -- or from the debug console, so assume that we were passed a table of args
- -- directly, and assign it to a new variable (luaArgs).
- --]]
- local fargs, pargs, luaArgs
- if type(frame.args) == 'table' and type(frame.getParent) == 'function' then
- if options.wrappers then
- --[[
- -- The wrappers option makes Module:Arguments look up arguments in
- -- either the frame argument table or the parent argument table, but
- -- not both. This means that users can use either the #invoke syntax
- -- or a wrapper template without the loss of performance associated
- -- with looking arguments up in both the frame and the parent frame.
- -- Module:Arguments will look up arguments in the parent frame
- -- if it finds the parent frame's title in options.wrapper;
- -- otherwise it will look up arguments in the frame object passed
- -- to getArgs.
- --]]
- local parent = frame:getParent()
- if not parent then
- fargs = frame.args
- else
- local title = parent:getTitle():gsub('/sandbox$', '')
- local found = false
- if matchesTitle(options.wrappers, title) then
- found = true
- elseif type(options.wrappers) == 'table' then
- for _,v in pairs(options.wrappers) do
- if matchesTitle(v, title) then
- found = true
- break
- end
- end
- end
- -- We test for false specifically here so that nil (the default) acts like true.
- if found or options.frameOnly == false then
- pargs = parent.args
- end
- if not found or options.parentOnly == false then
- fargs = frame.args
- end
- end
- else
- -- options.wrapper isn't set, so check the other options.
- if not options.parentOnly then
- fargs = frame.args
- end
- if not options.frameOnly then
- local parent = frame:getParent()
- pargs = parent and parent.args or nil
- end
- end
- if options.parentFirst then
- fargs, pargs = pargs, fargs
- end
- else
- luaArgs = frame
- end
- -- Set the order of precedence of the argument tables. If the variables are
- -- nil, nothing will be added to the table, which is how we avoid clashes
- -- between the frame/parent args and the Lua args.
- local argTables = {fargs}
- argTables[#argTables + 1] = pargs
- argTables[#argTables + 1] = luaArgs
- --[[
- -- Generate the tidyVal function. If it has been specified by the user, we
- -- use that; if not, we choose one of four functions depending on the
- -- options chosen. This is so that we don't have to call the options table
- -- every time the function is called.
- --]]
- local tidyVal = options.valueFunc
- if tidyVal then
- if type(tidyVal) ~= 'function' then
- error(
- "bad value assigned to option 'valueFunc'"
- .. '(function expected, got '
- .. type(tidyVal)
- .. ')',
- 2
- )
- end
- elseif options.trim ~= false then
- if options.removeBlanks ~= false then
- tidyVal = tidyValDefault
- else
- tidyVal = tidyValTrimOnly
- end
- else
- if options.removeBlanks ~= false then
- tidyVal = tidyValRemoveBlanksOnly
- else
- tidyVal = tidyValNoChange
- end
- end
- --[[
- -- Set up the args, metaArgs and nilArgs tables. args will be the one
- -- accessed from functions, and metaArgs will hold the actual arguments. Nil
- -- arguments are memoized in nilArgs, and the metatable connects all of them
- -- together.
- --]]
- local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}
- setmetatable(args, metatable)
- local function mergeArgs(tables)
- --[[
- -- Accepts multiple tables as input and merges their keys and values
- -- into one table. If a value is already present it is not overwritten;
- -- tables listed earlier have precedence. We are also memoizing nil
- -- values, which can be overwritten if they are 's' (soft).
- --]]
- for _, t in ipairs(tables) do
- for key, val in pairs(t) do
- if metaArgs[key] == nil and nilArgs[key] ~= 'h' then
- local tidiedVal = tidyVal(key, val)
- if tidiedVal == nil then
- nilArgs[key] = 's'
- else
- metaArgs[key] = tidiedVal
- end
- end
- end
- end
- end
- --[[
- -- Define metatable behaviour. Arguments are memoized in the metaArgs table,
- -- and are only fetched from the argument tables once. Fetching arguments
- -- from the argument tables is the most resource-intensive step in this
- -- module, so we try and avoid it where possible. For this reason, nil
- -- arguments are also memoized, in the nilArgs table. Also, we keep a record
- -- in the metatable of when pairs and ipairs have been called, so we do not
- -- run pairs and ipairs on the argument tables more than once. We also do
- -- not run ipairs on fargs and pargs if pairs has already been run, as all
- -- the arguments will already have been copied over.
- --]]
- metatable.__index = function (t, key)
- --[[
- -- Fetches an argument when the args table is indexed. First we check
- -- to see if the value is memoized, and if not we try and fetch it from
- -- the argument tables. When we check memoization, we need to check
- -- metaArgs before nilArgs, as both can be non-nil at the same time.
- -- If the argument is not present in metaArgs, we also check whether
- -- pairs has been run yet. If pairs has already been run, we return nil.
- -- This is because all the arguments will have already been copied into
- -- metaArgs by the mergeArgs function, meaning that any other arguments
- -- must be nil.
- --]]
- if type(key) == 'string' then
- key = options.translate[key]
- end
- local val = metaArgs[key]
- if val ~= nil then
- return val
- elseif metatable.donePairs or nilArgs[key] then
- return nil
- end
- for _, argTable in ipairs(argTables) do
- local argTableVal = tidyVal(key, argTable[key])
- if argTableVal ~= nil then
- metaArgs[key] = argTableVal
- return argTableVal
- end
- end
- nilArgs[key] = 'h'
- return nil
- end
- metatable.__newindex = function (t, key, val)
- -- This function is called when a module tries to add a new value to the
- -- args table, or tries to change an existing value.
- if type(key) == 'string' then
- key = options.translate[key]
- end
- if options.readOnly then
- error(
- 'could not write to argument table key "'
- .. tostring(key)
- .. '"; the table is read-only',
- 2
- )
- elseif options.noOverwrite and args[key] ~= nil then
- error(
- 'could not write to argument table key "'
- .. tostring(key)
- .. '"; overwriting existing arguments is not permitted',
- 2
- )
- elseif val == nil then
- --[[
- -- If the argument is to be overwritten with nil, we need to erase
- -- the value in metaArgs, so that __index, __pairs and __ipairs do
- -- not use a previous existing value, if present; and we also need
- -- to memoize the nil in nilArgs, so that the value isn't looked
- -- up in the argument tables if it is accessed again.
- --]]
- metaArgs[key] = nil
- nilArgs[key] = 'h'
- else
- metaArgs[key] = val
- end
- end
- local function translatenext(invariant)
- local k, v = next(invariant.t, invariant.k)
- invariant.k = k
- if k == nil then
- return nil
- elseif type(k) ~= 'string' or not options.backtranslate then
- return k, v
- else
- local backtranslate = options.backtranslate[k]
- if backtranslate == nil then
- -- Skip this one. This is a tail call, so this won't cause stack overflow
- return translatenext(invariant)
- else
- return backtranslate, v
- end
- end
- end
- metatable.__pairs = function ()
- -- Called when pairs is run on the args table.
- if not metatable.donePairs then
- mergeArgs(argTables)
- metatable.donePairs = true
- end
- return translatenext, { t = metaArgs }
- end
- local function inext(t, i)
- -- This uses our __index metamethod
- local v = t[i + 1]
- if v ~= nil then
- return i + 1, v
- end
- end
- metatable.__ipairs = function (t)
- -- Called when ipairs is run on the args table.
- return inext, t, 0
- end
- return args
- end
- return arguments</text>
- <sha1>5qx9tzlul9ser30uxj9nbasjt92cevn</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Check for unknown parameters</title>
- <ns>828</ns>
- <id>42286729</id>
- <revision>
- <id>726655795</id>
- <parentid>726655742</parentid>
- <timestamp>2016-06-23T14:41:43Z</timestamp>
- <contributor>
- <username>Frietjes</username>
- <id>13791031</id>
- </contributor>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
- -- with a list of arguments, returning a specified result if an argument is
- -- not on the list
- local p = {}
- local function trim(s)
- return s:match('^%s*(.-)%s*$')
- end
- local function isnotempty(s)
- return s and trim(s) ~= ''
- end
- function p.check (frame)
- local args = frame.args
- local pargs = frame:getParent().args
- local ignoreblank = isnotempty(frame.args['ignoreblank'])
- local showblankpos = isnotempty(frame.args['showblankpositional'])
- local knownargs = {}
- local unknown = frame.args['unknown'] or 'Found _VALUE_, '
- local preview = frame.args['preview']
- local values = {}
- local res = {}
- local regexps = {}
- -- create the list of known args, regular expressions, and the return string
- for k, v in pairs(args) do
- if type(k) == 'number' then
- v = trim(v)
- knownargs[v] = 1
- elseif k:find('^regexp[1-9][0-9]*$') then
- table.insert(regexps, '^' .. v .. '$')
- end
- end
- if isnotempty(preview) then
- preview = '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview).</div>'
- elseif preview == nil then
- preview = unknown
- end
- -- loop over the parent args, and make sure they are on the list
- for k, v in pairs(pargs) do
- if type(k) == 'string' and knownargs[k] == nil then
- local knownflag = false
- for i, regexp in ipairs(regexps) do
- if mw.ustring.match(k, regexp) then
- knownflag = true
- break
- end
- end
- if not knownflag and ( not ignoreblank or isnotempty(v) ) then
- k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
- table.insert(values, k)
- end
- elseif type(k) == 'number' and
- knownargs[tostring(k)] == nil and
- ( showblankpos or isnotempty(v) )
- then
- local vlen = mw.ustring.len(v)
- v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25)
- v = mw.ustring.gsub(v, '[^%w\-_ ]', '?')
- table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or ''))
- end
- end
- -- add resuls to the output tables
- if #values > 0 then
- if frame:preprocess( "{{REVISIONID}}" ) == "" then
- unknown = preview
- end
- for k, v in pairs(values) do
- if v == '' then
- -- Fix odd bug for | = which gets stripped to the empty string and
- -- breaks category links
- v = ' '
- end
- local r = unknown:gsub('_VALUE_', v)
- table.insert(res, r)
- end
- end
- return table.concat(res)
- end
- return p</text>
- <sha1>hrayw1t1r2ij1wg65qi0jh0x6y31ba4</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Documentation</title>
- <ns>828</ns>
- <id>40256557</id>
- <revision>
- <id>729280556</id>
- <parentid>725653683</parentid>
- <timestamp>2016-07-11T04:31:31Z</timestamp>
- <contributor>
- <username>Andy M. Wang</username>
- <id>516856</id>
- </contributor>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="36685">-- This module implements {{documentation}}.
- -- Get required modules.
- local getArgs = require('Module:Arguments').getArgs
- local messageBox = require('Module:Message box')
- -- Get the config table.
- local cfg = mw.loadData('Module:Documentation/config')
- local p = {}
- -- Often-used functions.
- local ugsub = mw.ustring.gsub
- ----------------------------------------------------------------------------
- -- Helper functions
- --
- -- These are defined as local functions, but are made available in the p
- -- table for testing purposes.
- ----------------------------------------------------------------------------
- local function message(cfgKey, valArray, expectType)
- --[[
- -- Gets a message from the cfg table and formats it if appropriate.
- -- The function raises an error if the value from the cfg table is not
- -- of the type expectType. The default type for expectType is 'string'.
- -- If the table valArray is present, strings such as $1, $2 etc. in the
- -- message are substituted with values from the table keys [1], [2] etc.
- -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.',
- -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz."
- --]]
- local msg = cfg[cfgKey]
- expectType = expectType or 'string'
- if type(msg) ~= expectType then
- error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)
- end
- if not valArray then
- return msg
- end
- local function getMessageVal(match)
- match = tonumber(match)
- return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)
- end
- local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal)
- return ret
- end
- p.message = message
- local function makeWikilink(page, display)
- if display then
- return mw.ustring.format('[[%s|%s]]', page, display)
- else
- return mw.ustring.format('[[%s]]', page)
- end
- end
- p.makeWikilink = makeWikilink
- local function makeCategoryLink(cat, sort)
- local catns = mw.site.namespaces[14].name
- return makeWikilink(catns .. ':' .. cat, sort)
- end
- p.makeCategoryLink = makeCategoryLink
- local function makeUrlLink(url, display)
- return mw.ustring.format('[%s %s]', url, display)
- end
- p.makeUrlLink = makeUrlLink
- local function makeToolbar(...)
- local ret = {}
- local lim = select('#', ...)
- if lim < 1 then
- return nil
- end
- for i = 1, lim do
- ret[#ret + 1] = select(i, ...)
- end
- return '<small style="font-style: normal;">(' .. table.concat(ret, ' &#124; ') .. ')</small>'
- end
- p.makeToolbar = makeToolbar
- ----------------------------------------------------------------------------
- -- Argument processing
- ----------------------------------------------------------------------------
- local function makeInvokeFunc(funcName)
- return function (frame)
- local args = getArgs(frame, {
- valueFunc = function (key, value)
- if type(value) == 'string' then
- value = value:match('^%s*(.-)%s*$') -- Remove whitespace.
- if key == 'heading' or value ~= '' then
- return value
- else
- return nil
- end
- else
- return value
- end
- end
- })
- return p[funcName](args)
- end
- end
- ----------------------------------------------------------------------------
- -- Main function
- ----------------------------------------------------------------------------
- p.main = makeInvokeFunc('_main')
- function p._main(args)
- --[[
- -- This function defines logic flow for the module.
- -- @args - table of arguments passed by the user
- --
- -- Messages:
- -- 'main-div-id' --> 'template-documentation'
- -- 'main-div-classes' --> 'template-documentation iezoomfix'
- --]]
- local env = p.getEnvironment(args)
- local root = mw.html.create()
- root
- :wikitext(p.protectionTemplate(env))
- :wikitext(p.sandboxNotice(args, env))
- -- This div tag is from {{documentation/start box}}, but moving it here
- -- so that we don't have to worry about unclosed tags.
- :tag('div')
- :attr('id', message('main-div-id'))
- :addClass(message('main-div-classes'))
- :newline()
- :wikitext(p._startBox(args, env))
- :wikitext(p._content(args, env))
- :tag('div')
- :css('clear', 'both') -- So right or left floating items don't stick out of the doc box.
- :newline()
- :done()
- :done()
- :wikitext(p._endBox(args, env))
- :wikitext(p.addTrackingCategories(env))
- return tostring(root)
- end
- ----------------------------------------------------------------------------
- -- Environment settings
- ----------------------------------------------------------------------------
- function p.getEnvironment(args)
- --[[
- -- Returns a table with information about the environment, including title objects and other namespace- or
- -- path-related data.
- -- @args - table of arguments passed by the user
- --
- -- Title objects include:
- -- env.title - the page we are making documentation for (usually the current title)
- -- env.templateTitle - the template (or module, file, etc.)
- -- env.docTitle - the /doc subpage.
- -- env.sandboxTitle - the /sandbox subpage.
- -- env.testcasesTitle - the /testcases subpage.
- -- env.printTitle - the print version of the template, located at the /Print subpage.
- --
- -- Data includes:
- -- env.protectionLevels - the protection levels table of the title object.
- -- env.subjectSpace - the number of the title's subject namespace.
- -- env.docSpace - the number of the namespace the title puts its documentation in.
- -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.
- -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.
- --
- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value
- -- returned will be nil.
- --]]
- local env, envFuncs = {}, {}
- -- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value
- -- returned by that function is memoized in the env table so that we don't call any of the functions
- -- more than once. (Nils won't be memoized.)
- setmetatable(env, {
- __index = function (t, key)
- local envFunc = envFuncs[key]
- if envFunc then
- local success, val = pcall(envFunc)
- if success then
- env[key] = val -- Memoise the value.
- return val
- end
- end
- return nil
- end
- })
- function envFuncs.title()
- -- The title object for the current page, or a test page passed with args.page.
- local title
- local titleArg = args.page
- if titleArg then
- title = mw.title.new(titleArg)
- else
- title = mw.title.getCurrentTitle()
- end
- return title
- end
- function envFuncs.templateTitle()
- --[[
- -- The template (or module, etc.) title object.
- -- Messages:
- -- 'sandbox-subpage' --> 'sandbox'
- -- 'testcases-subpage' --> 'testcases'
- --]]
- local subjectSpace = env.subjectSpace
- local title = env.title
- local subpage = title.subpageText
- if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then
- return mw.title.makeTitle(subjectSpace, title.baseText)
- else
- return mw.title.makeTitle(subjectSpace, title.text)
- end
- end
- function envFuncs.docTitle()
- --[[
- -- Title object of the /doc subpage.
- -- Messages:
- -- 'doc-subpage' --> 'doc'
- --]]
- local title = env.title
- local docname = args[1] -- User-specified doc page.
- local docpage
- if docname then
- docpage = docname
- else
- docpage = env.docpageBase .. '/' .. message('doc-subpage')
- end
- return mw.title.new(docpage)
- end
- function envFuncs.sandboxTitle()
- --[[
- -- Title object for the /sandbox subpage.
- -- Messages:
- -- 'sandbox-subpage' --> 'sandbox'
- --]]
- return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
- end
- function envFuncs.testcasesTitle()
- --[[
- -- Title object for the /testcases subpage.
- -- Messages:
- -- 'testcases-subpage' --> 'testcases'
- --]]
- return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
- end
- function envFuncs.printTitle()
- --[[
- -- Title object for the /Print subpage.
- -- Messages:
- -- 'print-subpage' --> 'Print'
- --]]
- return env.templateTitle:subPageTitle(message('print-subpage'))
- end
- function envFuncs.protectionLevels()
- -- The protection levels table of the title object.
- return env.title.protectionLevels
- end
- function envFuncs.subjectSpace()
- -- The subject namespace number.
- return mw.site.namespaces[env.title.namespace].subject.id
- end
- function envFuncs.docSpace()
- -- The documentation namespace number. For most namespaces this is the same as the
- -- subject namespace. However, pages in the Article, File, MediaWiki or Category
- -- namespaces must have their /doc, /sandbox and /testcases pages in talk space.
- local subjectSpace = env.subjectSpace
- if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then
- return subjectSpace + 1
- else
- return subjectSpace
- end
- end
- function envFuncs.docpageBase()
- -- The base page of the /doc, /sandbox, and /testcases subpages.
- -- For some namespaces this is the talk page, rather than the template page.
- local templateTitle = env.templateTitle
- local docSpace = env.docSpace
- local docSpaceText = mw.site.namespaces[docSpace].name
- -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.
- return docSpaceText .. ':' .. templateTitle.text
- end
- function envFuncs.compareUrl()
- -- Diff link between the sandbox and the main template using [[Special:ComparePages]].
- local templateTitle = env.templateTitle
- local sandboxTitle = env.sandboxTitle
- if templateTitle.exists and sandboxTitle.exists then
- local compareUrl = mw.uri.fullUrl(
- 'Special:ComparePages',
- {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}
- )
- return tostring(compareUrl)
- else
- return nil
- end
- end
- return env
- end
- ----------------------------------------------------------------------------
- -- Auxiliary templates
- ----------------------------------------------------------------------------
- function p.sandboxNotice(args, env)
- --[=[
- -- Generates a sandbox notice for display above sandbox pages.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'sandbox-notice-image' --> '[[Image:Sandbox.svg|50px|alt=|link=]]'
- -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.'
- -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).'
- -- 'sandbox-notice-pagetype-template' --> '[[Wikipedia:Template test cases|template sandbox]] page'
- -- 'sandbox-notice-pagetype-module' --> '[[Wikipedia:Template test cases|module sandbox]] page'
- -- 'sandbox-notice-pagetype-other' --> 'sandbox page'
- -- 'sandbox-notice-compare-link-display' --> 'diff'
- -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.'
- -- 'sandbox-notice-testcases-link-display' --> 'test cases'
- -- 'sandbox-category' --> 'Template sandboxes'
- --]=]
- local title = env.title
- local sandboxTitle = env.sandboxTitle
- local templateTitle = env.templateTitle
- local subjectSpace = env.subjectSpace
- if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then
- return nil
- end
- -- Build the table of arguments to pass to {{ombox}}. We need just two fields, "image" and "text".
- local omargs = {}
- omargs.image = message('sandbox-notice-image')
- -- Get the text. We start with the opening blurb, which is something like
- -- "This is the template sandbox for [[Template:Foo]] (diff)."
- local text = ''
- local pagetype
- if subjectSpace == 10 then
- pagetype = message('sandbox-notice-pagetype-template')
- elseif subjectSpace == 828 then
- pagetype = message('sandbox-notice-pagetype-module')
- else
- pagetype = message('sandbox-notice-pagetype-other')
- end
- local templateLink = makeWikilink(templateTitle.prefixedText)
- local compareUrl = env.compareUrl
- if compareUrl then
- local compareDisplay = message('sandbox-notice-compare-link-display')
- local compareLink = makeUrlLink(compareUrl, compareDisplay)
- text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})
- else
- text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})
- end
- -- Get the test cases page blurb if the page exists. This is something like
- -- "See also the companion subpage for [[Template:Foo/testcases|test cases]]."
- local testcasesTitle = env.testcasesTitle
- if testcasesTitle and testcasesTitle.exists then
- if testcasesTitle.namespace == mw.site.namespaces.Module.id then
- local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
- local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')
- local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
- local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
- text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})
- else
- local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')
- local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)
- text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink})
- end
- end
- -- Add the sandbox to the sandbox category.
- text = text .. makeCategoryLink(message('sandbox-category'))
- omargs.text = text
- local ret = '<div style="clear: both;"></div>'
- ret = ret .. messageBox.main('ombox', omargs)
- return ret
- end
- function p.protectionTemplate(env)
- -- Generates the padlock icon in the top right.
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- -- Messages:
- -- 'protection-template' --> 'pp-template'
- -- 'protection-template-args' --> {docusage = 'yes'}
- local protectionLevels, mProtectionBanner
- local title = env.title
- protectionLevels = env.protectionLevels
- if not protectionLevels then
- return nil
- end
- local editProt = protectionLevels.edit and protectionLevels.edit[1]
- local moveProt = protectionLevels.move and protectionLevels.move[1]
- if editProt then
- -- The page is edit-protected.
- mProtectionBanner = require('Module:Protection banner')
- local reason = message('protection-reason-edit')
- return mProtectionBanner._main{reason, small = true}
- elseif moveProt and moveProt ~= 'autoconfirmed' then
- -- The page is move-protected but not edit-protected. Exclude move
- -- protection with the level "autoconfirmed", as this is equivalent to
- -- no move protection at all.
- mProtectionBanner = require('Module:Protection banner')
- return mProtectionBanner._main{action = 'move', small = true}
- else
- return nil
- end
- end
- ----------------------------------------------------------------------------
- -- Start box
- ----------------------------------------------------------------------------
- p.startBox = makeInvokeFunc('_startBox')
- function p._startBox(args, env)
- --[[
- -- This function generates the start box.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make
- -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox
- -- which generate the box HTML.
- --]]
- env = env or p.getEnvironment(args)
- local links
- local content = args.content
- if not content then
- -- No need to include the links if the documentation is on the template page itself.
- local linksData = p.makeStartBoxLinksData(args, env)
- if linksData then
- links = p.renderStartBoxLinks(linksData)
- end
- end
- -- Generate the start box html.
- local data = p.makeStartBoxData(args, env, links)
- if data then
- return p.renderStartBox(data)
- else
- -- User specified no heading.
- return nil
- end
- end
- function p.makeStartBoxLinksData(args, env)
- --[[
- -- Does initial processing of data to make the [view] [edit] [history] [purge] links.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'view-link-display' --> 'view'
- -- 'edit-link-display' --> 'edit'
- -- 'history-link-display' --> 'history'
- -- 'purge-link-display' --> 'purge'
- -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace'
- -- 'module-preload' --> 'Template:Documentation/preload-module-doc'
- -- 'docpage-preload' --> 'Template:Documentation/preload'
- -- 'create-link-display' --> 'create'
- --]]
- local subjectSpace = env.subjectSpace
- local title = env.title
- local docTitle = env.docTitle
- if not title or not docTitle then
- return nil
- end
- local data = {}
- data.title = title
- data.docTitle = docTitle
- -- View, display, edit, and purge links if /doc exists.
- data.viewLinkDisplay = message('view-link-display')
- data.editLinkDisplay = message('edit-link-display')
- data.historyLinkDisplay = message('history-link-display')
- data.purgeLinkDisplay = message('purge-link-display')
- -- Create link if /doc doesn't exist.
- local preload = args.preload
- if not preload then
- if subjectSpace == 6 then -- File namespace
- preload = message('file-docpage-preload')
- elseif subjectSpace == 828 then -- Module namespace
- preload = message('module-preload')
- else
- preload = message('docpage-preload')
- end
- end
- data.preload = preload
- data.createLinkDisplay = message('create-link-display')
- return data
- end
- function p.renderStartBoxLinks(data)
- --[[
- -- Generates the [view][edit][history][purge] or [create] links from the data table.
- -- @data - a table of data generated by p.makeStartBoxLinksData
- --]]
- local function escapeBrackets(s)
- -- Escapes square brackets with HTML entities.
- s = s:gsub('%[', '&#91;') -- Replace square brackets with HTML entities.
- s = s:gsub('%]', '&#93;')
- return s
- end
- local ret
- local docTitle = data.docTitle
- local title = data.title
- if docTitle.exists then
- local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)
- local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)
- local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)
- local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)
- ret = '[%s] [%s] [%s] [%s]'
- ret = escapeBrackets(ret)
- ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)
- else
- local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)
- ret = '[%s]'
- ret = escapeBrackets(ret)
- ret = mw.ustring.format(ret, createLink)
- end
- return ret
- end
- function p.makeStartBoxData(args, env, links)
- --[=[
- -- Does initial processing of data to pass to the start-box render function, p.renderStartBox.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- -- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.
- --
- -- Messages:
- -- 'documentation-icon-wikitext' --> '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
- -- 'template-namespace-heading' --> 'Template documentation'
- -- 'module-namespace-heading' --> 'Module documentation'
- -- 'file-namespace-heading' --> 'Summary'
- -- 'other-namespaces-heading' --> 'Documentation'
- -- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks'
- -- 'start-box-link-id' --> 'doc_editlinks'
- -- 'testcases-create-link-display' --> 'create'
- --]=]
- local subjectSpace = env.subjectSpace
- if not subjectSpace then
- -- Default to an "other namespaces" namespace, so that we get at least some output
- -- if an error occurs.
- subjectSpace = 2
- end
- local data = {}
- -- Heading
- local heading = args.heading -- Blank values are not removed.
- if heading == '' then
- -- Don't display the start box if the heading arg is defined but blank.
- return nil
- end
- if heading then
- data.heading = heading
- elseif subjectSpace == 10 then -- Template namespace
- data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')
- elseif subjectSpace == 828 then -- Module namespace
- data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')
- elseif subjectSpace == 6 then -- File namespace
- data.heading = message('file-namespace-heading')
- else
- data.heading = message('other-namespaces-heading')
- end
- -- Heading CSS
- local headingStyle = args['heading-style']
- if headingStyle then
- data.headingStyleText = headingStyle
- elseif subjectSpace == 10 then
- -- We are in the template or template talk namespaces.
- data.headingFontWeight = 'bold'
- data.headingFontSize = '125%'
- else
- data.headingFontSize = '150%'
- end
- -- Data for the [view][edit][history][purge] or [create] links.
- if links then
- data.linksClass = message('start-box-linkclasses')
- data.linksId = message('start-box-link-id')
- data.links = links
- end
- return data
- end
- function p.renderStartBox(data)
- -- Renders the start box html.
- -- @data - a table of data generated by p.makeStartBoxData.
- local sbox = mw.html.create('div')
- sbox
- :css('padding-bottom', '3px')
- :css('border-bottom', '1px solid #aaa')
- :css('margin-bottom', '1ex')
- :newline()
- :tag('span')
- :cssText(data.headingStyleText)
- :css('font-weight', data.headingFontWeight)
- :css('font-size', data.headingFontSize)
- :wikitext(data.heading)
- local links = data.links
- if links then
- sbox:tag('span')
- :addClass(data.linksClass)
- :attr('id', data.linksId)
- :wikitext(links)
- end
- return tostring(sbox)
- end
- ----------------------------------------------------------------------------
- -- Documentation content
- ----------------------------------------------------------------------------
- p.content = makeInvokeFunc('_content')
- function p._content(args, env)
- -- Displays the documentation contents
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- env = env or p.getEnvironment(args)
- local docTitle = env.docTitle
- local content = args.content
- if not content and docTitle and docTitle.exists then
- content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}
- end
- -- The line breaks below are necessary so that "=== Headings ===" at the start and end
- -- of docs are interpreted correctly.
- return '\n' .. (content or '') .. '\n'
- end
- p.contentTitle = makeInvokeFunc('_contentTitle')
- function p._contentTitle(args, env)
- env = env or p.getEnvironment(args)
- local docTitle = env.docTitle
- if not args.content and docTitle and docTitle.exists then
- return docTitle.prefixedText
- else
- return ''
- end
- end
- ----------------------------------------------------------------------------
- -- End box
- ----------------------------------------------------------------------------
- p.endBox = makeInvokeFunc('_endBox')
- function p._endBox(args, env)
- --[=[
- -- This function generates the end box (also known as the link box).
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'fmbox-id' --> 'documentation-meta-data'
- -- 'fmbox-style' --> 'background-color: #ecfcf4'
- -- 'fmbox-textstyle' --> 'font-style: italic'
- --
- -- The HTML is generated by the {{fmbox}} template, courtesy of [[Module:Message box]].
- --]=]
- -- Get environment data.
- env = env or p.getEnvironment(args)
- local subjectSpace = env.subjectSpace
- local docTitle = env.docTitle
- if not subjectSpace or not docTitle then
- return nil
- end
- -- Check whether we should output the end box at all. Add the end
- -- box by default if the documentation exists or if we are in the
- -- user, module or template namespaces.
- local linkBox = args['link box']
- if linkBox == 'off'
- or not (
- docTitle.exists
- or subjectSpace == 2
- or subjectSpace == 828
- or subjectSpace == 10
- )
- then
- return nil
- end
- -- Assemble the arguments for {{fmbox}}.
- local fmargs = {}
- fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data'
- fmargs.image = 'none'
- fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4'
- fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;'
- -- Assemble the fmbox text field.
- local text = ''
- if linkBox then
- text = text .. linkBox
- else
- text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
- if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
- -- We are in the user, template or module namespaces.
- -- Add sandbox and testcases links.
- -- "Editors can experiment in this template's sandbox and testcases pages."
- text = text .. (p.makeExperimentBlurb(args, env) or '')
- text = text .. '<br />'
- if not args.content and not args[1] then
- -- "Please add categories to the /doc subpage."
- -- Don't show this message with inline docs or with an explicitly specified doc page,
- -- as then it is unclear where to add the categories.
- text = text .. (p.makeCategoriesBlurb(args, env) or '')
- end
- text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
- local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
- if printBlurb then
- text = text .. '<br />' .. printBlurb
- end
- end
- end
- fmargs.text = text
- return messageBox.main('fmbox', fmargs)
- end
- function p.makeDocPageBlurb(args, env)
- --[=[
- -- Makes the blurb "This documentation is transcluded from [[Template:Foo]] (edit, history)".
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'edit-link-display' --> 'edit'
- -- 'history-link-display' --> 'history'
- -- 'transcluded-from-blurb' -->
- -- 'The above [[Wikipedia:Template documentation|documentation]]
- -- is [[Wikipedia:Transclusion|transcluded]] from $1.'
- -- 'module-preload' --> 'Template:Documentation/preload-module-doc'
- -- 'create-link-display' --> 'create'
- -- 'create-module-doc-blurb' -->
- -- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
- --]=]
- local docTitle = env.docTitle
- if not docTitle then
- return nil
- end
- local ret
- if docTitle.exists then
- -- /doc exists; link to it.
- local docLink = makeWikilink(docTitle.prefixedText)
- local editUrl = docTitle:fullUrl{action = 'edit'}
- local editDisplay = message('edit-link-display')
- local editLink = makeUrlLink(editUrl, editDisplay)
- local historyUrl = docTitle:fullUrl{action = 'history'}
- local historyDisplay = message('history-link-display')
- local historyLink = makeUrlLink(historyUrl, historyDisplay)
- ret = message('transcluded-from-blurb', {docLink})
- .. ' '
- .. makeToolbar(editLink, historyLink)
- .. '<br />'
- elseif env.subjectSpace == 828 then
- -- /doc does not exist; ask to create it.
- local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}
- local createDisplay = message('create-link-display')
- local createLink = makeUrlLink(createUrl, createDisplay)
- ret = message('create-module-doc-blurb', {createLink})
- .. '<br />'
- end
- return ret
- end
- function p.makeExperimentBlurb(args, env)
- --[[
- -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages."
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'sandbox-link-display' --> 'sandbox'
- -- 'sandbox-edit-link-display' --> 'edit'
- -- 'compare-link-display' --> 'diff'
- -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox'
- -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
- -- 'sandbox-create-link-display' --> 'create'
- -- 'mirror-edit-summary' --> 'Create sandbox version of $1'
- -- 'mirror-link-display' --> 'mirror'
- -- 'mirror-link-preload' --> 'Template:Documentation/mirror'
- -- 'sandbox-link-display' --> 'sandbox'
- -- 'testcases-link-display' --> 'testcases'
- -- 'testcases-edit-link-display'--> 'edit'
- -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox'
- -- 'testcases-create-link-display' --> 'create'
- -- 'testcases-link-display' --> 'testcases'
- -- 'testcases-edit-link-display' --> 'edit'
- -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases'
- -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases'
- -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.'
- -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.'
- --]]
- local subjectSpace = env.subjectSpace
- local templateTitle = env.templateTitle
- local sandboxTitle = env.sandboxTitle
- local testcasesTitle = env.testcasesTitle
- local templatePage = templateTitle.prefixedText
- if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then
- return nil
- end
- -- Make links.
- local sandboxLinks, testcasesLinks
- if sandboxTitle.exists then
- local sandboxPage = sandboxTitle.prefixedText
- local sandboxDisplay = message('sandbox-link-display')
- local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)
- local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}
- local sandboxEditDisplay = message('sandbox-edit-link-display')
- local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)
- local compareUrl = env.compareUrl
- local compareLink
- if compareUrl then
- local compareDisplay = message('compare-link-display')
- compareLink = makeUrlLink(compareUrl, compareDisplay)
- end
- sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)
- else
- local sandboxPreload
- if subjectSpace == 828 then
- sandboxPreload = message('module-sandbox-preload')
- else
- sandboxPreload = message('template-sandbox-preload')
- end
- local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}
- local sandboxCreateDisplay = message('sandbox-create-link-display')
- local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)
- local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})
- local mirrorPreload = message('mirror-link-preload')
- local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}
- if subjectSpace == 828 then
- mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}
- end
- local mirrorDisplay = message('mirror-link-display')
- local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)
- sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)
- end
- if testcasesTitle.exists then
- local testcasesPage = testcasesTitle.prefixedText
- local testcasesDisplay = message('testcases-link-display')
- local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)
- local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}
- local testcasesEditDisplay = message('testcases-edit-link-display')
- local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)
- -- for Modules, add testcases run link if exists
- if subjectSpace == 828 and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then
- local testcasesRunLinkDisplay = message('testcases-run-link-display')
- local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)
- testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)
- else
- testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)
- end
- else
- local testcasesPreload
- if subjectSpace == 828 then
- testcasesPreload = message('module-testcases-preload')
- else
- testcasesPreload = message('template-testcases-preload')
- end
- local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}
- local testcasesCreateDisplay = message('testcases-create-link-display')
- local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)
- testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)
- end
- local messageName
- if subjectSpace == 828 then
- messageName = 'experiment-blurb-module'
- else
- messageName = 'experiment-blurb-template'
- end
- return message(messageName, {sandboxLinks, testcasesLinks})
- end
- function p.makeCategoriesBlurb(args, env)
- --[[
- -- Generates the text "Please add categories to the /doc subpage."
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- -- Messages:
- -- 'doc-link-display' --> '/doc'
- -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.'
- --]]
- local docTitle = env.docTitle
- if not docTitle then
- return nil
- end
- local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
- return message('add-categories-blurb', {docPathLink})
- end
- function p.makeSubpagesBlurb(args, env)
- --[[
- -- Generates the "Subpages of this template" link.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- -- Messages:
- -- 'template-pagetype' --> 'template'
- -- 'module-pagetype' --> 'module'
- -- 'default-pagetype' --> 'page'
- -- 'subpages-link-display' --> 'Subpages of this $1'
- --]]
- local subjectSpace = env.subjectSpace
- local templateTitle = env.templateTitle
- if not subjectSpace or not templateTitle then
- return nil
- end
- local pagetype
- if subjectSpace == 10 then
- pagetype = message('template-pagetype')
- elseif subjectSpace == 828 then
- pagetype = message('module-pagetype')
- else
- pagetype = message('default-pagetype')
- end
- local subpagesLink = makeWikilink(
- 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
- message('subpages-link-display', {pagetype})
- )
- return message('subpages-blurb', {subpagesLink})
- end
- function p.makePrintBlurb(args, env)
- --[=[
- -- Generates the blurb displayed when there is a print version of the template available.
- -- @args - a table of arguments passed by the user
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- --
- -- Messages:
- -- 'print-link-display' --> '/Print'
- -- 'print-blurb' --> 'A [[Help:Books/for experts#Improving the book layout|print version]]'
- -- .. ' of this template exists at $1.'
- -- .. ' If you make a change to this template, please update the print version as well.'
- -- 'display-print-category' --> true
- -- 'print-category' --> 'Templates with print versions'
- --]=]
- local printTitle = env.printTitle
- if not printTitle then
- return nil
- end
- local ret
- if printTitle.exists then
- local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))
- ret = message('print-blurb', {printLink})
- local displayPrintCategory = message('display-print-category', nil, 'boolean')
- if displayPrintCategory then
- ret = ret .. makeCategoryLink(message('print-category'))
- end
- end
- return ret
- end
- ----------------------------------------------------------------------------
- -- Tracking categories
- ----------------------------------------------------------------------------
- function p.addTrackingCategories(env)
- --[[
- -- Check if {{documentation}} is transcluded on a /doc or /testcases page.
- -- @env - environment table containing title objects, etc., generated with p.getEnvironment
- -- Messages:
- -- 'display-strange-usage-category' --> true
- -- 'doc-subpage' --> 'doc'
- -- 'testcases-subpage' --> 'testcases'
- -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage'
- --
- -- /testcases pages in the module namespace are not categorised, as they may have
- -- {{documentation}} transcluded automatically.
- --]]
- local title = env.title
- local subjectSpace = env.subjectSpace
- if not title or not subjectSpace then
- return nil
- end
- local subpage = title.subpageText
- local ret = ''
- if message('display-strange-usage-category', nil, 'boolean')
- and (
- subpage == message('doc-subpage')
- or subjectSpace ~= 828 and subpage == message('testcases-subpage')
- )
- then
- ret = ret .. makeCategoryLink(message('strange-usage-category'))
- end
- return ret
- end
- return p</text>
- <sha1>jf2f51u5rzim7qgb93sv92cvfe6ak0s</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Documentation/config</title>
- <ns>828</ns>
- <id>41520829</id>
- <revision>
- <id>729280654</id>
- <parentid>717457729</parentid>
- <timestamp>2016-07-11T04:32:48Z</timestamp>
- <contributor>
- <username>Andy M. Wang</username>
- <id>516856</id>
- </contributor>
- <comment>rm alt text on icon, since the adjacent text is sufficient alternative text (per [[Special:Diff/729145419|edit request]])</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="18622">----------------------------------------------------------------------------------------------------
- --
- -- Configuration for Module:Documentation
- --
- -- Here you can set the values of the parameters and messages used in Module:Documentation to
- -- localise it to your wiki and your language. Unless specified otherwise, values given here
- -- should be string values.
- ----------------------------------------------------------------------------------------------------
- local cfg = {} -- Do not edit this line.
- ----------------------------------------------------------------------------------------------------
- -- Protection template configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['protection-reason-edit']
- -- The protection reason for edit-protected templates to pass to
- -- [[Module:Protection banner]].
- cfg['protection-reason-edit'] = 'template'
- --[[
- ----------------------------------------------------------------------------------------------------
- -- Sandbox notice configuration
- --
- -- On sandbox pages the module can display a template notifying users that the current page is a
- -- sandbox, and the location of test cases pages, etc. The module decides whether the page is a
- -- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the
- -- messages that the notices contains.
- ----------------------------------------------------------------------------------------------------
- --]]
- -- cfg['sandbox-notice-image']
- -- The image displayed in the sandbox notice.
- cfg['sandbox-notice-image'] = '[[Image:Sandbox.svg|50px|alt=|link=]]'
- --[[
- -- cfg['sandbox-notice-pagetype-template']
- -- cfg['sandbox-notice-pagetype-module']
- -- cfg['sandbox-notice-pagetype-other']
- -- The page type of the sandbox page. The message that is displayed depends on the current subject
- -- namespace. This message is used in either cfg['sandbox-notice-blurb'] or
- -- cfg['sandbox-notice-diff-blurb'].
- --]]
- cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'
- cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'
- cfg['sandbox-notice-pagetype-other'] = 'sandbox page'
- --[[
- -- cfg['sandbox-notice-blurb']
- -- cfg['sandbox-notice-diff-blurb']
- -- cfg['sandbox-notice-diff-display']
- -- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence
- -- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page
- -- type, which is either cfg['sandbox-notice-pagetype-template'],
- -- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what
- -- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between
- -- the sandbox and the main template. The display value of the diff link is set by
- -- cfg['sandbox-notice-compare-link-display'].
- --]]
- cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'
- cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'
- cfg['sandbox-notice-compare-link-display'] = 'diff'
- --[[
- -- cfg['sandbox-notice-testcases-blurb']
- -- cfg['sandbox-notice-testcases-link-display']
- -- cfg['sandbox-notice-testcases-run-blurb']
- -- cfg['sandbox-notice-testcases-run-link-display']
- -- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page
- -- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.
- -- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.
- -- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page
- -- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test
- -- cases page, and $2 is a link to the page to run it.
- -- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test
- -- cases.
- --]]
- cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'
- cfg['sandbox-notice-testcases-link-display'] = 'test cases'
- cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'
- cfg['sandbox-notice-testcases-run-link-display'] = 'run'
- -- cfg['sandbox-category']
- -- A category to add to all template sandboxes.
- cfg['sandbox-category'] = 'Template sandboxes'
- ----------------------------------------------------------------------------------------------------
- -- Start box configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['documentation-icon-wikitext']
- -- The wikitext for the icon shown at the top of the template.
- cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
- -- cfg['template-namespace-heading']
- -- The heading shown in the template namespace.
- cfg['template-namespace-heading'] = 'Template documentation'
- -- cfg['module-namespace-heading']
- -- The heading shown in the module namespace.
- cfg['module-namespace-heading'] = 'Module documentation'
- -- cfg['file-namespace-heading']
- -- The heading shown in the file namespace.
- cfg['file-namespace-heading'] = 'Summary'
- -- cfg['other-namespaces-heading']
- -- The heading shown in other namespaces.
- cfg['other-namespaces-heading'] = 'Documentation'
- -- cfg['view-link-display']
- -- The text to display for "view" links.
- cfg['view-link-display'] = 'view'
- -- cfg['edit-link-display']
- -- The text to display for "edit" links.
- cfg['edit-link-display'] = 'edit'
- -- cfg['history-link-display']
- -- The text to display for "history" links.
- cfg['history-link-display'] = 'history'
- -- cfg['purge-link-display']
- -- The text to display for "purge" links.
- cfg['purge-link-display'] = 'purge'
- -- cfg['create-link-display']
- -- The text to display for "create" links.
- cfg['create-link-display'] = 'create'
- ----------------------------------------------------------------------------------------------------
- -- Link box (end box) configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['transcluded-from-blurb']
- -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.
- cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'
- --[[
- -- cfg['create-module-doc-blurb']
- -- Notice displayed in the module namespace when the documentation subpage does not exist.
- -- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the
- -- display cfg['create-link-display'].
- --]]
- cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'
- ----------------------------------------------------------------------------------------------------
- -- Experiment blurb configuration
- ----------------------------------------------------------------------------------------------------
- --[[
- -- cfg['experiment-blurb-template']
- -- cfg['experiment-blurb-module']
- -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.
- -- It is only shown in the template and module namespaces. With the default English settings, it
- -- might look like this:
- --
- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.
- --
- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links.
- --
- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending
- -- on what namespace we are in.
- --
- -- Parameters:
- --
- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:
- --
- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])
- --
- -- If the sandbox doesn't exist, it is in the format:
- --
- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])
- --
- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']
- -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']
- -- loads a default edit summary of cfg['mirror-edit-summary'].
- --
- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:
- --
- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])
- --
- -- If the test cases page doesn't exist, it is in the format:
- --
- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display'])
- --
- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the
- -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current
- -- namespace.
- --]]
- cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages."
- cfg['experiment-blurb-module'] = "Editors can experiment in this module's $1 and $2 pages."
- ----------------------------------------------------------------------------------------------------
- -- Sandbox link configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['sandbox-subpage']
- -- The name of the template subpage typically used for sandboxes.
- cfg['sandbox-subpage'] = 'sandbox'
- -- cfg['template-sandbox-preload']
- -- Preload file for template sandbox pages.
- cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
- -- cfg['module-sandbox-preload']
- -- Preload file for Lua module sandbox pages.
- cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
- -- cfg['sandbox-link-display']
- -- The text to display for "sandbox" links.
- cfg['sandbox-link-display'] = 'sandbox'
- -- cfg['sandbox-edit-link-display']
- -- The text to display for sandbox "edit" links.
- cfg['sandbox-edit-link-display'] = 'edit'
- -- cfg['sandbox-create-link-display']
- -- The text to display for sandbox "create" links.
- cfg['sandbox-create-link-display'] = 'create'
- -- cfg['compare-link-display']
- -- The text to display for "compare" links.
- cfg['compare-link-display'] = 'diff'
- -- cfg['mirror-edit-summary']
- -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the
- -- template page.
- cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
- -- cfg['mirror-link-display']
- -- The text to display for "mirror" links.
- cfg['mirror-link-display'] = 'mirror'
- -- cfg['mirror-link-preload']
- -- The page to preload when a user clicks the "mirror" link.
- cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
- ----------------------------------------------------------------------------------------------------
- -- Test cases link configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['testcases-subpage']
- -- The name of the template subpage typically used for test cases.
- cfg['testcases-subpage'] = 'testcases'
- -- cfg['template-testcases-preload']
- -- Preload file for template test cases pages.
- cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
- -- cfg['module-testcases-preload']
- -- Preload file for Lua module test cases pages.
- cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
- -- cfg['testcases-link-display']
- -- The text to display for "testcases" links.
- cfg['testcases-link-display'] = 'testcases'
- -- cfg['testcases-edit-link-display']
- -- The text to display for test cases "edit" links.
- cfg['testcases-edit-link-display'] = 'edit'
- -- cfg['testcases-run-link-display']
- -- The text to display for test cases "run" links.
- cfg['testcases-run-link-display'] = 'run'
- -- cfg['testcases-create-link-display']
- -- The text to display for test cases "create" links.
- cfg['testcases-create-link-display'] = 'create'
- ----------------------------------------------------------------------------------------------------
- -- Add categories blurb configuration
- ----------------------------------------------------------------------------------------------------
- --[[
- -- cfg['add-categories-blurb']
- -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or
- -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a
- -- link to the /doc subpage with a display value of cfg['doc-link-display'].
- --]]
- cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'
- -- cfg['doc-link-display']
- -- The text to display when linking to the /doc subpage.
- cfg['doc-link-display'] = '/doc'
- ----------------------------------------------------------------------------------------------------
- -- Subpages link configuration
- ----------------------------------------------------------------------------------------------------
- --[[
- -- cfg['subpages-blurb']
- -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a
- -- display value of cfg['subpages-link-display']. In the English version this blurb is simply
- -- the link followed by a period, and the link display provides the actual text.
- --]]
- cfg['subpages-blurb'] = '$1.'
- --[[
- -- cfg['subpages-link-display']
- -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'],
- -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in
- -- the template namespace, the module namespace, or another namespace.
- --]]
- cfg['subpages-link-display'] = 'Subpages of this $1'
- -- cfg['template-pagetype']
- -- The pagetype to display for template pages.
- cfg['template-pagetype'] = 'template'
- -- cfg['module-pagetype']
- -- The pagetype to display for Lua module pages.
- cfg['module-pagetype'] = 'module'
- -- cfg['default-pagetype']
- -- The pagetype to display for pages other than templates or Lua modules.
- cfg['default-pagetype'] = 'page'
- ----------------------------------------------------------------------------------------------------
- -- Doc link configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['doc-subpage']
- -- The name of the subpage typically used for documentation pages.
- cfg['doc-subpage'] = 'doc'
- -- cfg['file-docpage-preload']
- -- Preload file for documentation page in the file namespace.
- cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
- -- cfg['docpage-preload']
- -- Preload file for template documentation pages in all namespaces.
- cfg['docpage-preload'] = 'Template:Documentation/preload'
- -- cfg['module-preload']
- -- Preload file for Lua module documentation pages.
- cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
- ----------------------------------------------------------------------------------------------------
- -- Print version configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['print-subpage']
- -- The name of the template subpage used for print versions.
- cfg['print-subpage'] = 'Print'
- -- cfg['print-link-display']
- -- The text to display when linking to the /Print subpage.
- cfg['print-link-display'] = '/Print'
- -- cfg['print-blurb']
- -- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display'].
- cfg['print-blurb'] = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1.'
- .. ' If you make a change to this template, please update the print version as well.'
- -- cfg['display-print-category']
- -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists.
- -- This should be a boolean value (either true or false).
- cfg['display-print-category'] = true
- -- cfg['print-category']
- -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists.
- cfg['print-category'] = 'Templates with print versions'
- ----------------------------------------------------------------------------------------------------
- -- HTML and CSS configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['main-div-id']
- -- The "id" attribute of the main HTML "div" tag.
- cfg['main-div-id'] = 'template-documentation'
- -- cfg['main-div-classes']
- -- The CSS classes added to the main HTML "div" tag.
- cfg['main-div-classes'] = 'template-documentation iezoomfix'
- -- cfg['start-box-linkclasses']
- -- The CSS classes used for the [view][edit][history] or [create] links in the start box.
- cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks'
- -- cfg['start-box-link-id']
- -- The HTML "id" attribute for the links in the start box.
- cfg['start-box-link-id'] = 'doc_editlinks'
- ----------------------------------------------------------------------------------------------------
- -- {{fmbox}} template configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['fmbox-id']
- -- The id sent to the "id" parameter of the {{fmbox}} template.
- cfg['fmbox-id'] = 'documentation-meta-data'
- -- cfg['fmbox-style']
- -- The value sent to the style parameter of {{fmbox}}.
- cfg['fmbox-style'] = 'background-color: #ecfcf4'
- -- cfg['fmbox-textstyle']
- -- The value sent to the "textstyle parameter of {{fmbox}}.
- cfg['fmbox-textstyle'] = 'font-style: italic'
- ----------------------------------------------------------------------------------------------------
- -- Tracking category configuration
- ----------------------------------------------------------------------------------------------------
- -- cfg['display-strange-usage-category']
- -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage
- -- or a /testcases subpage. This should be a boolean value (either true or false).
- cfg['display-strange-usage-category'] = true
- -- cfg['strange-usage-category']
- -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a
- -- /doc subpage or a /testcases subpage.
- cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
- --[[
- ----------------------------------------------------------------------------------------------------
- -- End configuration
- --
- -- Don't edit anything below this line.
- ----------------------------------------------------------------------------------------------------
- --]]
- return cfg</text>
- <sha1>6hym6c6py8yoseohy71qvk7kafcy1p5</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Effective protection expiry</title>
- <ns>828</ns>
- <id>48785459</id>
- <revision>
- <id>744227741</id>
- <parentid>740797535</parentid>
- <timestamp>2016-10-13T22:30:40Z</timestamp>
- <contributor>
- <username>Jackmcbarn</username>
- <id>19285809</id>
- </contributor>
- <comment>don't error if the page isn't under PC</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="1494">local p = {}
- -- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.
- -- If no title is specified, the title of the page being displayed is used.
- function p._main(action, pagename)
- local title
- if type(pagename) == 'table' and pagename.prefixedText then
- title = pagename
- elseif pagename then
- title = mw.title.new(pagename)
- else
- title = mw.title.getCurrentTitle()
- end
- pagename = title.prefixedText
- if action == 'autoreview' then
- local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)
- return stabilitySettings and stabilitySettings.expiry or 'unknown'
- elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
- error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
- end
- local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)
- if rawExpiry == 'infinity' then
- return 'infinity'
- elseif rawExpiry == '' then
- return 'unknown'
- else
- local year, month, day, hour, minute, second = rawExpiry:match(
- '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'
- )
- if year then
- return string.format(
- '%s-%s-%sT%s:%s:%s',
- year, month, day, hour, minute, second
- )
- else
- error('internal error in Module:Effective protection expiry; malformed expiry timestamp')
- end
- end
- end
- setmetatable(p, { __index = function(t, k)
- return function(frame)
- return t._main(k, frame.args[1])
- end
- end })
- return p</text>
- <sha1>i1wms02y1w048cq6uttka18a5pjzp63</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Effective protection level</title>
- <ns>828</ns>
- <id>41617327</id>
- <revision>
- <id>834561914</id>
- <parentid>713934935</parentid>
- <timestamp>2018-04-06T11:52:06Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>add user JSON subpage detection - see [[mw:Special:PermaLink/2750735#Tech News: 2018-14|Tech News: 2018-14]]</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="3056">local p = {}
- -- Returns the permission required to perform a given action on a given title.
- -- If no title is specified, the title of the page being displayed is used.
- function p._main(action, pagename)
- local title
- if type(pagename) == 'table' and pagename.prefixedText then
- title = pagename
- elseif pagename then
- title = mw.title.new(pagename)
- else
- title = mw.title.getCurrentTitle()
- end
- pagename = title.prefixedText
- if action == 'autoreview' then
- local level = mw.ext.FlaggedRevs.getStabilitySettings(title)
- level = level and level.autoreview
- if level == 'review' then
- return 'reviewer'
- elseif level ~= '' then
- return level
- else
- 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
- end
- elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then
- error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )
- end
- if title.namespace == 8 then -- MediaWiki namespace
- return 'sysop'
- 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
- return 'sysop'
- end
- local level = title.protectionLevels[action] and title.protectionLevels[action][1]
- if level == 'sysop' or level == 'editprotected' then
- return 'sysop'
- elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page
- return 'sysop'
- elseif level == 'templateeditor' then
- return 'templateeditor'
- elseif action == 'move' then
- 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.
- if blacklistentry and not blacklistentry.params.autoconfirmed then
- return 'templateeditor'
- elseif title.namespace == 6 then
- return 'filemover'
- elseif level == 'extendedconfirmed' then
- return 'extendedconfirmed'
- else
- return 'autoconfirmed'
- end
- end
- local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)
- if blacklistentry then
- if not blacklistentry.params.autoconfirmed then
- return 'templateeditor'
- elseif level == 'extendedconfirmed' then
- return 'extendedconfirmed'
- else
- return 'autoconfirmed'
- end
- elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason
- return 'autoconfirmed'
- elseif level then
- return level
- elseif action == 'upload' then
- return 'autoconfirmed'
- 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
- return 'user'
- else
- return '*'
- end
- end
- setmetatable(p, { __index = function(t, k)
- return function(frame)
- return t._main(k, frame.args[1])
- end
- end })
- return p</text>
- <sha1>ldr27zxzu0o1ofgaoty4jscx92ku0w7</sha1>
- </revision>
- </page>
- <page>
- <title>Module:File link</title>
- <ns>828</ns>
- <id>42903140</id>
- <revision>
- <id>638642222</id>
- <parentid>638639021</parentid>
- <timestamp>2014-12-18T14:05:07Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>when calling this from wikitext use a more readable error message for missing file parameters</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="2544">-- This module provides a library for formatting file wikilinks.
- local yesno = require('Module:Yesno')
- local checkType = require('libraryUtil').checkType
- local p = {}
- function p._main(args)
- checkType('_main', 1, args, 'table')
- -- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our
- -- own function to get the right error level.
- local function checkArg(key, val, level)
- if type(val) ~= 'string' then
- error(string.format(
- "type error in '%s' parameter of '_main' (expected string, got %s)",
- key, type(val)
- ), level)
- end
- end
- local ret = {}
- -- Adds a positional parameter to the buffer.
- local function addPositional(key)
- local val = args[key]
- if not val then
- return nil
- end
- checkArg(key, val, 4)
- ret[#ret + 1] = val
- end
- -- Adds a named parameter to the buffer. We assume that the parameter name
- -- is the same as the argument key.
- local function addNamed(key)
- local val = args[key]
- if not val then
- return nil
- end
- checkArg(key, val, 4)
- ret[#ret + 1] = key .. '=' .. val
- end
- -- Filename
- checkArg('file', args.file, 3)
- ret[#ret + 1] = 'File:' .. args.file
- -- Format
- if args.format then
- checkArg('format', args.format)
- if args.formatfile then
- checkArg('formatfile', args.formatfile)
- ret[#ret + 1] = args.format .. '=' .. args.formatfile
- else
- ret[#ret + 1] = args.format
- end
- end
- -- Border
- if yesno(args.border) then
- ret[#ret + 1] = 'border'
- end
- addPositional('location')
- addPositional('alignment')
- addPositional('size')
- addNamed('upright')
- addNamed('link')
- addNamed('alt')
- addNamed('page')
- addNamed('class')
- addNamed('lang')
- addNamed('start')
- addNamed('end')
- addNamed('thumbtime')
- addPositional('caption')
- return string.format('[[%s]]', table.concat(ret, '|'))
- end
- function p.main(frame)
- local origArgs = require('Module:Arguments').getArgs(frame, {
- wrappers = 'Template:File link'
- })
- if not origArgs.file then
- error("'file' parameter missing from [[Template:File link]]", 0)
- end
- -- Copy the arguments that were passed to a new table to avoid looking up
- -- every possible parameter in the frame object.
- local args = {}
- for k, v in pairs(origArgs) do
- -- Make _BLANK a special argument to add a blank parameter. For use in
- -- conditional templates etc. it is useful for blank arguments to be
- -- ignored, but we still need a way to specify them so that we can do
- -- things like [[File:Example.png|link=]].
- if v == '_BLANK' then
- v = ''
- end
- args[k] = v
- end
- return p._main(args)
- end
- return p</text>
- <sha1>bzc22v133v9z5yc4aisazripn6l94p8</sha1>
- </revision>
- </page>
- <page>
- <title>Module:For</title>
- <ns>828</ns>
- <id>50413050</id>
- <revision>
- <id>732878218</id>
- <parentid>726039274</parentid>
- <timestamp>2016-08-03T20:53:03Z</timestamp>
- <contributor>
- <username>Nihiltres</username>
- <id>236191</id>
- </contributor>
- <comment>Updated from sandbox: categorizes as unusual "other uses" by defaulting as well as typed-out "other uses"</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="982">local mArguments --initialize lazily
- local yesno = require('Module:Yesno')
- local mHatlist = require('Module:Hatnote list')
- local mHatnote = require('Module:Hatnote')
- local p = {}
- --Implements {{For}} from the frame
- --uses capitalized "For" to avoid collision with Lua reserved word "for"
- function p.For (frame)
- mArguments = require('Module:Arguments')
- return p._For(mArguments.getArgs(frame))
- end
- --Implements {{For}} but takes a manual arguments table
- function p._For (args)
- local use = args[1]
- local category = ''
- if (not use or use == 'other uses') and
- (not args.category or yesno(args.category)) then
- category = '[[Category:Hatnote templates using unusual parameters]]'
- end
- local pages = {}
- function two (a, b) return a, b, 1 end --lets us run ipairs from 2
- for k, v in two(ipairs(args)) do table.insert(pages, v) end
- return mHatnote._hatnote(
- mHatlist.forSeeTableToString({{use = use, pages = pages}}),
- {selfref = args.selfref}
- ) .. category
- end
- return p</text>
- <sha1>7cw7zffjg8qhj4fig5sqk2xg5uphgx0</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Hatnote</title>
- <ns>828</ns>
- <id>42498502</id>
- <revision>
- <id>779487706</id>
- <parentid>726656423</parentid>
- <timestamp>2017-05-09T05:20:32Z</timestamp>
- <contributor>
- <username>JJMC89</username>
- <id>24812038</id>
- </contributor>
- <comment>Add navigation-not-searchable class per [[Special:Permalink/779475248#Add navigation-not-searchable class|request]] (also see [[phab:T164781|T164781]])</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="6703">--------------------------------------------------------------------------------
- -- Module:Hatnote --
- -- --
- -- This module produces hatnote links and links to related articles. It --
- -- implements the {{hatnote}} and {{format link}} meta-templates and includes --
- -- helper functions for other Lua hatnote modules. --
- --------------------------------------------------------------------------------
- local libraryUtil = require('libraryUtil')
- local checkType = libraryUtil.checkType
- local mArguments -- lazily initialise [[Module:Arguments]]
- local yesno -- lazily initialise [[Module:Yesno]]
- local p = {}
- --------------------------------------------------------------------------------
- -- Helper functions
- --------------------------------------------------------------------------------
- local function getArgs(frame)
- -- Fetches the arguments from the parent frame. Whitespace is trimmed and
- -- blanks are removed.
- mArguments = require('Module:Arguments')
- return mArguments.getArgs(frame, {parentOnly = true})
- end
- local function removeInitialColon(s)
- -- Removes the initial colon from a string, if present.
- return s:match('^:?(.*)')
- end
- function p.findNamespaceId(link, removeColon)
- -- Finds the namespace id (namespace number) of a link or a pagename. This
- -- function will not work if the link is enclosed in double brackets. Colons
- -- are trimmed from the start of the link by default. To skip colon
- -- trimming, set the removeColon parameter to false.
- checkType('findNamespaceId', 1, link, 'string')
- checkType('findNamespaceId', 2, removeColon, 'boolean', true)
- if removeColon ~= false then
- link = removeInitialColon(link)
- end
- local namespace = link:match('^(.-):')
- if namespace then
- local nsTable = mw.site.namespaces[namespace]
- if nsTable then
- return nsTable.id
- end
- end
- return 0
- end
- function p.formatPages(...)
- -- Formats a list of pages using formatLink and returns it as an array. Nil
- -- values are not allowed.
- local pages = {...}
- local ret = {}
- for i, page in ipairs(pages) do
- ret[i] = p._formatLink(page)
- end
- return ret
- end
- function p.formatPageTables(...)
- -- Takes a list of page/display tables and returns it as a list of
- -- formatted links. Nil values are not allowed.
- local pages = {...}
- local links = {}
- for i, t in ipairs(pages) do
- checkType('formatPageTables', i, t, 'table')
- local link = t[1]
- local display = t[2]
- links[i] = p._formatLink(link, display)
- end
- return links
- end
- function p.makeWikitextError(msg, helpLink, addTrackingCategory, title)
- -- Formats an error message to be returned to wikitext. If
- -- addTrackingCategory is not false after being returned from
- -- [[Module:Yesno]], and if we are not on a talk page, a tracking category
- -- is added.
- checkType('makeWikitextError', 1, msg, 'string')
- checkType('makeWikitextError', 2, helpLink, 'string', true)
- yesno = require('Module:Yesno')
- title = title or mw.title.getCurrentTitle()
- -- Make the help link text.
- local helpText
- if helpLink then
- helpText = ' ([[' .. helpLink .. '|help]])'
- else
- helpText = ''
- end
- -- Make the category text.
- local category
- if not title.isTalkPage and yesno(addTrackingCategory) ~= false then
- category = 'Hatnote templates with errors'
- category = string.format(
- '[[%s:%s]]',
- mw.site.namespaces[14].name,
- category
- )
- else
- category = ''
- end
- return string.format(
- '<strong class="error">Error: %s%s.</strong>%s',
- msg,
- helpText,
- category
- )
- end
- function p.disambiguate(page, disambiguator)
- -- Formats a page title with a disambiguation parenthetical,
- -- i.e. "Example" → "Example (disambiguation)".
- checkType('disambiguate', 1, page, 'string')
- checkType('disambiguate', 2, disambiguator, 'string', true)
- disambiguator = disambiguator or 'disambiguation'
- return string.format('%s (%s)', page, disambiguator)
- end
- --------------------------------------------------------------------------------
- -- Format link
- --
- -- Makes a wikilink from the given link and display values. Links are escaped
- -- with colons if necessary, and links to sections are detected and displayed
- -- with " § " as a separator rather than the standard MediaWiki "#". Used in
- -- the {{format hatnote link}} template.
- --------------------------------------------------------------------------------
- function p.formatLink(frame)
- local args = getArgs(frame)
- local link = args[1]
- local display = args[2]
- if not link then
- return p.makeWikitextError(
- 'no link specified',
- 'Template:Format hatnote link#Errors',
- args.category
- )
- end
- return p._formatLink(link, display)
- end
- function p._formatLink(link, display)
- checkType('_formatLink', 1, link, 'string')
- checkType('_formatLink', 2, display, 'string', true)
- -- Remove the initial colon for links where it was specified manually.
- link = removeInitialColon(link)
- -- Find whether a faux display value has been added with the {{!}} magic
- -- word.
- if not display then
- local prePipe, postPipe = link:match('^(.-)|(.*)$')
- link = prePipe or link
- display = postPipe
- end
- -- Find the display value.
- if not display then
- local page, section = link:match('^(.-)#(.*)$')
- if page then
- display = page .. ' §&nbsp;' .. section
- end
- end
- -- Assemble the link.
- if display then
- return string.format(
- '[[:%s|%s]]',
- string.gsub(link, '|(.*)$', ''), --display overwrites manual piping
- display
- )
- else
- return string.format('[[:%s]]', link)
- end
- end
- --------------------------------------------------------------------------------
- -- Hatnote
- --
- -- Produces standard hatnote text. Implements the {{hatnote}} template.
- --------------------------------------------------------------------------------
- function p.hatnote(frame)
- local args = getArgs(frame)
- local s = args[1]
- local options = {}
- if not s then
- return p.makeWikitextError(
- 'no text specified',
- 'Template:Hatnote#Errors',
- args.category
- )
- end
- options.extraclasses = args.extraclasses
- options.selfref = args.selfref
- return p._hatnote(s, options)
- end
- function p._hatnote(s, options)
- checkType('_hatnote', 1, s, 'string')
- checkType('_hatnote', 2, options, 'table', true)
- options = options or {}
- local classes = {'hatnote', 'navigation-not-searchable'}
- local extraclasses = options.extraclasses
- local selfref = options.selfref
- if type(extraclasses) == 'string' then
- classes[#classes + 1] = extraclasses
- end
- if selfref then
- classes[#classes + 1] = 'selfref'
- end
- return string.format(
- '<div role="note" class="%s">%s</div>',
- table.concat(classes, ' '),
- s
- )
- end
- return p</text>
- <sha1>c5z31x97gktc3q7nnp8mf48t01l4qst</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Hatnote list</title>
- <ns>828</ns>
- <id>50085079</id>
- <revision>
- <id>833955078</id>
- <parentid>833954678</parentid>
- <timestamp>2018-04-03T05:19:54Z</timestamp>
- <contributor>
- <username>Galobtter</username>
- <id>19502780</id>
- </contributor>
- <comment>fix</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="7209">--------------------------------------------------------------------------------
- -- Module:Hatnote list --
- -- --
- -- This module produces and formats lists for use in hatnotes. In particular, --
- -- it implements the for-see list, i.e. lists of "For X, see Y" statements, --
- -- as used in {{about}}, {{redirect}}, and their variants. Also introduced --
- -- are andList & orList helpers for formatting lists with those conjunctions. --
- --------------------------------------------------------------------------------
- local mArguments --initialize lazily
- local mHatnote = require('Module:Hatnote')
- local libraryUtil = require('libraryUtil')
- local checkType = libraryUtil.checkType
- local p = {}
- --------------------------------------------------------------------------------
- -- List stringification helper functions
- --
- -- These functions are used for stringifying lists, usually page lists inside
- -- the "Y" portion of "For X, see Y" for-see items.
- --------------------------------------------------------------------------------
- --default options table used across the list stringification functions
- local stringifyListDefaultOptions = {
- conjunction = "and",
- separator = ",",
- altSeparator = ";",
- space = " ",
- formatted = false
- }
- -- Stringifies a list generically; probably shouldn't be used directly
- function stringifyList(list, options)
- -- Type-checks, defaults, and a shortcut
- checkType("stringifyList", 1, list, "table")
- if #list == 0 then return nil end
- checkType("stringifyList", 2, options, "table", true)
- options = options or {}
- for k, v in pairs(stringifyListDefaultOptions) do
- if options[k] == nil then options[k] = v end
- end
- local s = options.space
- -- Format the list if requested
- if options.formatted then list = mHatnote.formatPages(unpack(list)) end
- -- Set the separator; if any item contains it, use the alternate separator
- local separator = options.separator
- --searches display text only
- function searchDisp(t, f)
- return string.find(string.sub(t, (string.find(t, '|') or 0) + 1), f)
- end
- for k, v in pairs(list) do
- if searchDisp(v, separator) then
- separator = options.altSeparator
- break
- end
- end
- -- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§"
- local conjunction = s .. options.conjunction .. s
- if #list == 2 and searchDisp(list[1], "§") or #list > 2 then
- conjunction = separator .. conjunction
- end
- -- Return the formatted string
- return mw.text.listToText(list, separator .. s, conjunction)
- end
- --DRY function
- function conjList (conj, list, fmt)
- return stringifyList(list, {conjunction = conj, formatted = fmt})
- end
- -- Stringifies lists with "and" or "or"
- function p.andList (...) return conjList("and", ...) end
- function p.orList (...) return conjList("or", ...) end
- --------------------------------------------------------------------------------
- -- For see
- --
- -- Makes a "For X, see [[Y]]." list from raw parameters. Intended for the
- -- {{about}} and {{redirect}} templates and their variants.
- --------------------------------------------------------------------------------
- --default options table used across the forSee family of functions
- local forSeeDefaultOptions = {
- andKeyword = 'and',
- title = mw.title.getCurrentTitle().text,
- otherText = 'other uses',
- forSeeForm = 'For %s, see %s.',
- }
- --Collapses duplicate punctuation
- function punctuationCollapse (text)
- local replacements = {
- ["%.%.$"] = ".",
- ["%?%.$"] = "?",
- ["%!%.$"] = "!",
- ["%.%]%]%.$"] = ".]]",
- ["%?%]%]%.$"] = "?]]",
- ["%!%]%]%.$"] = "!]]"
- }
- for k, v in pairs(replacements) do text = string.gsub(text, k, v) end
- return text
- end
- -- Structures arguments into a table for stringification, & options
- function p.forSeeArgsToTable (args, from, options)
- -- Type-checks and defaults
- checkType("forSeeArgsToTable", 1, args, 'table')
- checkType("forSeeArgsToTable", 2, from, 'number', true)
- from = from or 1
- checkType("forSeeArgsToTable", 3, options, 'table', true)
- options = options or {}
- for k, v in pairs(forSeeDefaultOptions) do
- if options[k] == nil then options[k] = v end
- end
- -- maxArg's gotten manually because getArgs() and table.maxn aren't friends
- local maxArg = 0
- for k, v in pairs(args) do
- if type(k) == 'number' and k > maxArg then maxArg = k end
- end
- -- Structure the data out from the parameter list:
- -- * forTable is the wrapper table, with forRow rows
- -- * Rows are tables of a "use" string & a "pages" table of pagename strings
- -- * Blanks are left empty for defaulting elsewhere, but can terminate list
- local forTable = {}
- local i = from
- local terminated = false
- -- If there is extra text, and no arguments are given, give nil value
- -- to not produce default of "For other uses, see foo (disambiguation)"
- if options.extratext and i > maxArg then return nil end
- -- Loop to generate rows
- repeat
- -- New empty row
- local forRow = {}
- -- On blank use, assume list's ended & break at end of this loop
- forRow.use = args[i]
- if not args[i] then terminated = true end
- -- New empty list of pages
- forRow.pages = {}
- -- Insert first pages item if present
- table.insert(forRow.pages, args[i + 1])
- -- If the param after next is "and", do inner loop to collect params
- -- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3}
- while args[i + 2] == options.andKeyword do
- if args[i + 3] then
- table.insert(forRow.pages, args[i + 3])
- end
- -- Increment to next "and"
- i = i + 2
- end
- -- Increment to next use
- i = i + 2
- -- Append the row
- table.insert(forTable, forRow)
- until terminated or i > maxArg
- return forTable
- end
- -- Stringifies a table as formatted by forSeeArgsToTable
- function p.forSeeTableToString (forSeeTable, options)
- -- Type-checks and defaults
- checkType("forSeeTableToString", 1, forSeeTable, "table", true)
- checkType("forSeeTableToString", 2, options, "table", true)
- options = options or {}
- for k, v in pairs(forSeeDefaultOptions) do
- if options[k] == nil then options[k] = v end
- end
- -- Stringify each for-see item into a list
- local strList = {}
- if forSeeTable then
- for k, v in pairs(forSeeTable) do
- local useStr = v.use or options.otherText
- local pagesStr = p.andList(v.pages, true) or mHatnote._formatLink(mHatnote.disambiguate(options.title))
- local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr)
- forSeeStr = punctuationCollapse(forSeeStr)
- table.insert(strList, forSeeStr)
- end
- end
- if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end
- -- Return the concatenated list
- return table.concat(strList, ' ')
- end
- -- Produces a "For X, see [[Y]]" string from arguments. Expects index gaps
- -- but not blank/whitespace values. Ignores named args and args < "from".
- function p._forSee (args, from, options)
- local forSeeTable = p.forSeeArgsToTable(args, from, options)
- return p.forSeeTableToString(forSeeTable, options)
- end
- -- As _forSee, but uses the frame.
- function p.forSee (frame, from, options)
- mArguments = require('Module:Arguments')
- return p._forSee(mArguments.getArgs(frame), from, options)
- end
- return p</text>
- <sha1>2hmyydi47hep0hexbh8sw7ybxc07m5k</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Infobox</title>
- <ns>828</ns>
- <id>38808424</id>
- <revision>
- <id>849197215</id>
- <parentid>849089853</parentid>
- <timestamp>2018-07-07T07:04:41Z</timestamp>
- <contributor>
- <username>Jc86035</username>
- <id>17245768</id>
- </contributor>
- <minor/>
- <comment>the three other types of lists as well</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="15742">--
- -- This module implements {{Infobox}}
- --
- local p = {}
- local navbar = require('Module:Navbar')._navbar
- local args = {}
- local origArgs
- local root
- local function notempty( s ) return s and s:match( '%S' ) end
- local function fixChildBoxes(sval, tt)
- if notempty(sval) then
- local marker = '<span class=special_infobox_marker>'
- local s = sval
- s = mw.ustring.gsub(s, '(<%s*[Tt][Rr])', marker .. '%1')
- s = mw.ustring.gsub(s, '(</[Tt][Rr]%s*>)', '%1' .. marker)
- if s:match(marker) then
- s = mw.ustring.gsub(s, marker .. '%s*' .. marker, '')
- s = mw.ustring.gsub(s, '([\r\n]|-[^\r\n]*[\r\n])%s*' .. marker, '%1')
- s = mw.ustring.gsub(s, marker .. '%s*([\r\n]|-)', '%1')
- s = mw.ustring.gsub(s, '(</[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*>%s*)' .. marker, '%1')
- s = mw.ustring.gsub(s, '(<%s*[Tt][Aa][Bb][Ll][Ee][^<>]*>%s*)' .. marker, '%1')
- s = mw.ustring.gsub(s, '^(%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
- s = mw.ustring.gsub(s, '([\r\n]%{|[^\r\n]*[\r\n]%s*)' .. marker, '%1')
- s = mw.ustring.gsub(s, marker .. '(%s*</[Tt][Aa][Bb][Ll][Ee]%s*>)', '%1')
- s = mw.ustring.gsub(s, marker .. '(%s*\n|%})', '%1')
- end
- if s:match(marker) then
- local subcells = mw.text.split(s, marker)
- s = ''
- for k = 1, #subcells do
- if k == 1 then
- s = s .. subcells[k] .. '</' .. tt .. '></tr>'
- elseif k == #subcells then
- local rowstyle = ' style="display:none"'
- if notempty(subcells[k]) then rowstyle = '' end
- s = s .. '<tr' .. rowstyle ..'><' .. tt .. ' colspan=2>\n' .. subcells[k]
- elseif notempty(subcells[k]) then
- if (k % 2) == 0 then
- s = s .. subcells[k]
- else
- s = s .. '<tr><' .. tt .. ' colspan=2>\n' .. subcells[k] .. '</' .. tt .. '></tr>'
- end
- end
- end
- end
- -- the next two lines add a newline at the end of lists for the PHP parser
- -- https://en.wikipedia.org/w/index.php?title=Template_talk:Infobox_musical_artist&oldid=849054481
- s = mw.ustring.gsub(s, '([\r\n][%*#;:][^\r\n]*)$', '%1\n')
- s = mw.ustring.gsub(s, '^([%*#;:][^\r\n]*)$', '%1\n')
- return s
- else
- return sval
- end
- end
- local function union(t1, t2)
- -- Returns the union of the values of two tables, as a sequence.
- local vals = {}
- for k, v in pairs(t1) do
- vals[v] = true
- end
- for k, v in pairs(t2) do
- vals[v] = true
- end
- local ret = {}
- for k, v in pairs(vals) do
- table.insert(ret, k)
- end
- return ret
- end
- local function getArgNums(prefix)
- -- Returns a table containing the numbers of the arguments that exist
- -- for the specified prefix. For example, if the prefix was 'data', and
- -- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
- local nums = {}
- for k, v in pairs(args) do
- local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
- if num then table.insert(nums, tonumber(num)) end
- end
- table.sort(nums)
- return nums
- end
- local function addRow(rowArgs)
- -- Adds a row to the infobox, with either a header cell
- -- or a label/data cell combination.
- if rowArgs.header then
- root
- :tag('tr')
- :addClass(rowArgs.rowclass)
- :cssText(rowArgs.rowstyle)
- :attr('id', rowArgs.rowid)
- :tag('th')
- :attr('colspan', 2)
- :attr('id', rowArgs.headerid)
- :addClass(rowArgs.class)
- :addClass(args.headerclass)
- :css('text-align', 'center')
- :cssText(args.headerstyle)
- :cssText(rowArgs.rowcellstyle)
- :wikitext(fixChildBoxes(rowArgs.header, 'th'))
- elseif rowArgs.data then
- local row = root:tag('tr')
- row:addClass(rowArgs.rowclass)
- row:cssText(rowArgs.rowstyle)
- row:attr('id', rowArgs.rowid)
- if rowArgs.label then
- row
- :tag('th')
- :attr('scope', 'row')
- :attr('id', rowArgs.labelid)
- :cssText(args.labelstyle)
- :cssText(rowArgs.rowcellstyle)
- :wikitext(rowArgs.label)
- :done()
- end
- local dataCell = row:tag('td')
- if not rowArgs.label then
- dataCell
- :attr('colspan', 2)
- :css('text-align', 'center')
- end
- dataCell
- :attr('id', rowArgs.dataid)
- :addClass(rowArgs.class)
- :cssText(rowArgs.datastyle)
- :cssText(rowArgs.rowcellstyle)
- :newline()
- :wikitext(fixChildBoxes(rowArgs.data, 'td'))
- end
- end
- local function renderTitle()
- if not args.title then return end
- root
- :tag('caption')
- :addClass(args.titleclass)
- :cssText(args.titlestyle)
- :wikitext(args.title)
- end
- local function renderAboveRow()
- if not args.above then return end
- root
- :tag('tr')
- :tag('th')
- :attr('colspan', 2)
- :addClass(args.aboveclass)
- :css('text-align', 'center')
- :css('font-size', '125%')
- :css('font-weight', 'bold')
- :cssText(args.abovestyle)
- :wikitext(fixChildBoxes(args.above,'th'))
- end
- local function renderBelowRow()
- if not args.below then return end
- root
- :tag('tr')
- :tag('td')
- :attr('colspan', '2')
- :addClass(args.belowclass)
- :css('text-align', 'center')
- :cssText(args.belowstyle)
- :newline()
- :wikitext(fixChildBoxes(args.below,'td'))
- end
- local function renderSubheaders()
- if args.subheader then
- args.subheader1 = args.subheader
- end
- if args.subheaderrowclass then
- args.subheaderrowclass1 = args.subheaderrowclass
- end
- local subheadernums = getArgNums('subheader')
- for k, num in ipairs(subheadernums) do
- addRow({
- data = args['subheader' .. tostring(num)],
- datastyle = args.subheaderstyle or args['subheaderstyle' .. tostring(num)],
- class = args.subheaderclass,
- rowclass = args['subheaderrowclass' .. tostring(num)]
- })
- end
- end
- local function renderImages()
- if args.image then
- args.image1 = args.image
- end
- if args.caption then
- args.caption1 = args.caption
- end
- local imagenums = getArgNums('image')
- for k, num in ipairs(imagenums) do
- local caption = args['caption' .. tostring(num)]
- local data = mw.html.create():wikitext(args['image' .. tostring(num)])
- if caption then
- data
- :tag('div')
- :cssText(args.captionstyle)
- :wikitext(caption)
- end
- addRow({
- data = tostring(data),
- datastyle = args.imagestyle,
- class = args.imageclass,
- rowclass = args['imagerowclass' .. tostring(num)]
- })
- end
- end
- local function renderRows()
- -- Gets the union of the header and data argument numbers,
- -- and renders them all in order using addRow.
- local rownums = union(getArgNums('header'), getArgNums('data'))
- table.sort(rownums)
- for k, num in ipairs(rownums) do
- addRow({
- header = args['header' .. tostring(num)],
- label = args['label' .. tostring(num)],
- data = args['data' .. tostring(num)],
- datastyle = args.datastyle,
- class = args['class' .. tostring(num)],
- rowclass = args['rowclass' .. tostring(num)],
- rowstyle = args['rowstyle' .. tostring(num)],
- rowcellstyle = args['rowcellstyle' .. tostring(num)],
- dataid = args['dataid' .. tostring(num)],
- labelid = args['labelid' .. tostring(num)],
- headerid = args['headerid' .. tostring(num)],
- rowid = args['rowid' .. tostring(num)]
- })
- end
- end
- local function renderNavBar()
- if not args.name then return end
- root
- :tag('tr')
- :tag('td')
- :attr('colspan', '2')
- :css('text-align', 'right')
- :wikitext(navbar{
- args.name,
- mini = 1,
- })
- end
- local function renderItalicTitle()
- local italicTitle = args['italic title'] and mw.ustring.lower(args['italic title'])
- if italicTitle == '' or italicTitle == 'force' or italicTitle == 'yes' then
- root:wikitext(mw.getCurrentFrame():expandTemplate({title = 'italic title'}))
- end
- end
- local function renderTrackingCategories()
- if args.decat ~= 'yes' then
- if #(getArgNums('data')) == 0 and mw.title.getCurrentTitle().namespace == 0 then
- root:wikitext('[[Category:Articles which use infobox templates with no data rows]]')
- end
- if args.child == 'yes' and args.title then
- root:wikitext('[[Category:Pages which use embedded infobox templates with the title parameter]]')
- end
- end
- end
- local function _infobox()
- -- Specify the overall layout of the infobox, with special settings
- -- if the infobox is used as a 'child' inside another infobox.
- if args.child ~= 'yes' then
- root = mw.html.create('table')
- root
- :addClass((args.subbox ~= 'yes') and 'infobox' or nil)
- :addClass(args.bodyclass)
- if args.subbox == 'yes' then
- root
- :css('padding', '0')
- :css('border', 'none')
- :css('margin', '-3px')
- :css('width', 'auto')
- :css('min-width', '100%')
- :css('font-size', '100%')
- :css('clear', 'none')
- :css('float', 'none')
- :css('background-color', 'transparent')
- else
- root
- :css('width', '22em')
- end
- root
- :cssText(args.bodystyle)
- renderTitle()
- renderAboveRow()
- else
- root = mw.html.create()
- root
- :wikitext(args.title)
- end
- renderSubheaders()
- renderImages()
- renderRows()
- renderBelowRow()
- renderNavBar()
- renderItalicTitle()
- renderTrackingCategories()
- return tostring(root)
- end
- local function preprocessSingleArg(argName)
- -- If the argument exists and isn't blank, add it to the argument table.
- -- Blank arguments are treated as nil to match the behaviour of ParserFunctions.
- if origArgs[argName] and origArgs[argName] ~= '' then
- args[argName] = origArgs[argName]
- end
- end
- local function preprocessArgs(prefixTable, step)
- -- Assign the parameters with the given prefixes to the args table, in order, in batches
- -- of the step size specified. This is to prevent references etc. from appearing in the
- -- wrong order. The prefixTable should be an array containing tables, each of which has
- -- two possible fields, a "prefix" string and a "depend" table. The function always parses
- -- parameters containing the "prefix" string, but only parses parameters in the "depend"
- -- table if the prefix parameter is present and non-blank.
- if type(prefixTable) ~= 'table' then
- error("Non-table value detected for the prefix table", 2)
- end
- if type(step) ~= 'number' then
- error("Invalid step value detected", 2)
- end
- -- Get arguments without a number suffix, and check for bad input.
- for i,v in ipairs(prefixTable) do
- if type(v) ~= 'table' or type(v.prefix) ~= "string" or (v.depend and type(v.depend) ~= 'table') then
- error('Invalid input detected to preprocessArgs prefix table', 2)
- end
- preprocessSingleArg(v.prefix)
- -- Only parse the depend parameter if the prefix parameter is present and not blank.
- if args[v.prefix] and v.depend then
- for j, dependValue in ipairs(v.depend) do
- if type(dependValue) ~= 'string' then
- error('Invalid "depend" parameter value detected in preprocessArgs')
- end
- preprocessSingleArg(dependValue)
- end
- end
- end
- -- Get arguments with number suffixes.
- local a = 1 -- Counter variable.
- local moreArgumentsExist = true
- while moreArgumentsExist == true do
- moreArgumentsExist = false
- for i = a, a + step - 1 do
- for j,v in ipairs(prefixTable) do
- local prefixArgName = v.prefix .. tostring(i)
- if origArgs[prefixArgName] then
- moreArgumentsExist = true -- Do another loop if any arguments are found, even blank ones.
- preprocessSingleArg(prefixArgName)
- end
- -- Process the depend table if the prefix argument is present and not blank, or
- -- we are processing "prefix1" and "prefix" is present and not blank, and
- -- if the depend table is present.
- if v.depend and (args[prefixArgName] or (i == 1 and args[v.prefix])) then
- for j,dependValue in ipairs(v.depend) do
- local dependArgName = dependValue .. tostring(i)
- preprocessSingleArg(dependArgName)
- end
- end
- end
- end
- a = a + step
- end
- end
- function p.infobox(frame)
- -- If called via #invoke, use the args passed into the invoking template.
- -- Otherwise, for testing purposes, assume args are being passed directly in.
- if frame == mw.getCurrentFrame() then
- origArgs = frame:getParent().args
- else
- origArgs = frame
- end
- -- Parse the data parameters in the same order that the old {{infobox}} did, so that
- -- references etc. will display in the expected places. Parameters that depend on
- -- another parameter are only processed if that parameter is present, to avoid
- -- phantom references appearing in article reference lists.
- preprocessSingleArg('child')
- preprocessSingleArg('bodyclass')
- preprocessSingleArg('subbox')
- preprocessSingleArg('bodystyle')
- preprocessSingleArg('title')
- preprocessSingleArg('titleclass')
- preprocessSingleArg('titlestyle')
- preprocessSingleArg('above')
- preprocessSingleArg('aboveclass')
- preprocessSingleArg('abovestyle')
- preprocessArgs({
- {prefix = 'subheader', depend = {'subheaderstyle', 'subheaderrowclass'}}
- }, 10)
- preprocessSingleArg('subheaderstyle')
- preprocessSingleArg('subheaderclass')
- preprocessArgs({
- {prefix = 'image', depend = {'caption', 'imagerowclass'}}
- }, 10)
- preprocessSingleArg('captionstyle')
- preprocessSingleArg('imagestyle')
- preprocessSingleArg('imageclass')
- preprocessArgs({
- {prefix = 'header'},
- {prefix = 'data', depend = {'label'}},
- {prefix = 'rowclass'},
- {prefix = 'rowstyle'},
- {prefix = 'rowcellstyle'},
- {prefix = 'class'},
- {prefix = 'dataid'},
- {prefix = 'labelid'},
- {prefix = 'headerid'},
- {prefix = 'rowid'}
- }, 50)
- preprocessSingleArg('headerclass')
- preprocessSingleArg('headerstyle')
- preprocessSingleArg('labelstyle')
- preprocessSingleArg('datastyle')
- preprocessSingleArg('below')
- preprocessSingleArg('belowclass')
- preprocessSingleArg('belowstyle')
- preprocessSingleArg('name')
- args['italic title'] = origArgs['italic title'] -- different behaviour if blank or absent
- preprocessSingleArg('decat')
- return _infobox()
- end
- return p</text>
- <sha1>3lqvq40va735qhmz9ozwwkwt6n87qbr</sha1>
- </revision>
- </page>
- <page>
- <title>Module:InfoboxImage</title>
- <ns>828</ns>
- <id>38581924</id>
- <revision>
- <id>839038061</id>
- <parentid>769944044</parentid>
- <timestamp>2018-04-30T21:16:56Z</timestamp>
- <contributor>
- <username>WOSlinker</username>
- <id>3138265</id>
- </contributor>
- <comment>add Noimage.gif to placeholder list</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="9657">-- Inputs:
- -- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link
- -- page - page to display for multipage images (DjVu)
- -- size - size to display the image
- -- maxsize - maximum size for image
- -- sizedefault - default size to display the image if size param is blank
- -- alt - alt text for image
- -- title - title text for image
- -- border - set to yes if border
- -- center - set to yes, if the image has to be centered
- -- upright - upright image param
- -- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it
- -- link - page to visit when clicking on image
- -- Outputs:
- -- Formatted image.
- -- More details available at the "Module:InfoboxImage/doc" page
- local i = {};
- local placeholder_image = {
- "Blue - Replace this image female.svg",
- "Blue - Replace this image male.svg",
- "Female no free image yet.png",
- "Flag of None (square).svg",
- "Flag of None.svg",
- "Flag of.svg",
- "Green - Replace this image female.svg",
- "Green - Replace this image male.svg",
- "Image is needed female.svg",
- "Image is needed male.svg",
- "Location map of None.svg",
- "Male no free image yet.png",
- "Missing flag.png",
- "No flag.svg",
- "No free portrait.svg",
- "No portrait (female).svg",
- "No portrait (male).svg",
- "Red - Replace this image female.svg",
- "Red - Replace this image male.svg",
- "Replace this image female (blue).svg",
- "Replace this image female.svg",
- "Replace this image male (blue).svg",
- "Replace this image male.svg",
- "Silver - Replace this image female.svg",
- "Silver - Replace this image male.svg",
- "Replace this image.svg",
- "Cricket no pic.png",
- "CarersLogo.gif",
- "Diagram Needed.svg",
- "Example.jpg",
- "Image placeholder.png",
- "No male portrait.svg",
- "Nocover-upload.png",
- "NoDVDcover copy.png",
- "Noribbon.svg",
- "No portrait-BFD-test.svg",
- "Placeholder barnstar ribbon.png",
- "Project Trains no image.png",
- "Image-request.png",
- "Sin bandera.svg",
- "Sin escudo.svg",
- "Replace this image - temple.png",
- "Replace this image butterfly.png",
- "Replace this image.svg",
- "Replace this image1.svg",
- "Resolution angle.png",
- "Image-No portrait-text-BFD-test.svg",
- "Insert image here.svg",
- "No image available.png",
- "NO IMAGE YET square.png",
- "NO IMAGE YET.png",
- "No Photo Available.svg",
- "No Screenshot.svg",
- "No-image-available.jpg",
- "Null.png",
- "PictureNeeded.gif",
- "Place holder.jpg",
- "Unbenannt.JPG",
- "UploadACopyrightFreeImage.svg",
- "UploadAnImage.gif",
- "UploadAnImage.svg",
- "UploadAnImageShort.svg",
- "CarersLogo.gif",
- "Diagram Needed.svg",
- "No male portrait.svg",
- "NoDVDcover copy.png",
- "Placeholder barnstar ribbon.png",
- "Project Trains no image.png",
- "Image-request.png",
- "Noimage.gif",
- }
- function i.IsPlaceholder(image)
- -- change underscores to spaces
- image = mw.ustring.gsub(image, "_", " ");
- assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil')
- -- if image starts with [[ then remove that and anything after |
- if mw.ustring.sub(image,1,2) == "[[" then
- image = mw.ustring.sub(image,3);
- image = mw.ustring.gsub(image, "([^|]*)|.*", "%1");
- assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil')
- end
- -- Trim spaces
- image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
- assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil")
- -- remove prefix if exists
- local allNames = mw.site.namespaces[6].aliases
- allNames[#allNames + 1] = mw.site.namespaces[6].name
- allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
- for i, name in ipairs(allNames) do
- if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
- image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
- break
- end
- end
- -- Trim spaces
- image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
- -- capitalise first letter
- image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
- for i,j in pairs(placeholder_image) do
- if image == j then
- return true
- end
- end
- return false
- end
- function i.InfoboxImage(frame)
- local image = frame.args["image"];
- if image == "" or image == nil then
- return "";
- end
- if image == "&nbsp;" then
- return image;
- end
- if frame.args["suppressplaceholder"] ~= "no" then
- if i.IsPlaceholder(image) == true then
- return "";
- end
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then
- return "";
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then
- return "";
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then
- return "";
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then
- return "";
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then
- return "";
- end
- if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then
- return "";
- end
- if mw.ustring.sub(image,1,2) == "[[" then
- -- search for thumbnail images and add to tracking cat if found
- if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then
- return image .. "[[Category:Pages using infoboxes with thumbnail images]]";
- elseif mw.title.getCurrentTitle().namespace == 0 then
- return image .. "[[Category:Pages using deprecated image syntax]]";
- else
- return image;
- end
- elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then
- return image;
- elseif mw.ustring.sub(image,1,1) == "<" then
- return image;
- elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then
- -- Found strip marker at begining, so pass don't process at all
- return image;
- elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then
- -- Found strip marker at begining, so pass don't process at all
- return image;
- else
- local result = "";
- local page = frame.args["page"];
- local size = frame.args["size"];
- local maxsize = frame.args["maxsize"];
- local sizedefault = frame.args["sizedefault"];
- local alt = frame.args["alt"];
- local link = frame.args["link"];
- local title = frame.args["title"];
- local border = frame.args["border"];
- local upright = frame.args["upright"] or "";
- local thumbtime = frame.args["thumbtime"] or "";
- local center= frame.args["center"];
- -- remove prefix if exists
- local allNames = mw.site.namespaces[6].aliases
- allNames[#allNames + 1] = mw.site.namespaces[6].name
- allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName
- for i, name in ipairs(allNames) do
- if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then
- image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
- break
- end
- end
- if maxsize ~= "" and maxsize ~= nil then
- -- if no sizedefault then set to maxsize
- if sizedefault == "" or sizedefault == nil then
- sizedefault = maxsize
- end
- -- check to see if size bigger than maxsize
- if size ~= "" and size ~= nil then
- local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0;
- local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0;
- if sizenumber>maxsizenumber and maxsizenumber>0 then
- size = maxsize;
- end
- end
- end
- -- add px to size if just a number
- if (tonumber(size) or 0) > 0 then
- size = size .. "px";
- end
- -- add px to sizedefault if just a number
- if (tonumber(sizedefault) or 0) > 0 then
- sizedefault = sizedefault .. "px";
- end
- result = "[[File:" .. image;
- if page ~= "" and page ~= nil then
- result = result .. "|page=" .. page;
- end
- if size ~= "" and size ~= nil then
- result = result .. "|" .. size;
- elseif sizedefault ~= "" and sizedefault ~= nil then
- result = result .. "|" .. sizedefault;
- else
- result = result .. "|frameless";
- end
- if center == "yes" then
- result = result .. "|center"
- end
- if alt ~= "" and alt ~= nil then
- result = result .. "|alt=" .. alt;
- end
- if link ~= "" and link ~= nil then
- result = result .. "|link=" .. link;
- end
- if border == "yes" then
- result = result .. "|border";
- end
- if upright == "yes" then
- result = result .. "|upright";
- elseif upright ~= "" then
- result = result .. "|upright=" .. upright;
- end
- if thumbtime ~= "" then
- result = result .. "|thumbtime=" .. thumbtime;
- end
- if title ~= "" and title ~= nil then
- result = result .. "|" .. title;
- elseif alt ~= "" and alt ~= nil then
- result = result .. "|" .. alt;
- end
- result = result .. "]]";
- return result;
- end
- end
- return i;</text>
- <sha1>qtnddjnyefntigkcp7xwqp47j23hao6</sha1>
- </revision>
- </page>
- <page>
- <title>Module:IsValidPageName</title>
- <ns>828</ns>
- <id>42378350</id>
- <revision>
- <id>602409120</id>
- <parentid>602403765</parentid>
- <timestamp>2014-04-02T12:23:11Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>use pcall in case we are over the expensive function count</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="255">-- This module implements [[Template:isValidPageName]].
- local export = {}
- function export.isValidPageName(frame)
- local success, res = pcall(mw.title.new, frame.args[1])
- if success and res then
- return "valid"
- else
- return ""
- end
- end
- return export</text>
- <sha1>hoypn4rnht45b6h0cxlb6y0r0h6hpq2</sha1>
- </revision>
- </page>
- <page>
- <title>Module:List</title>
- <ns>828</ns>
- <id>41068627</id>
- <revision>
- <id>794511725</id>
- <parentid>788254921</parentid>
- <timestamp>2017-08-08T13:55:25Z</timestamp>
- <contributor>
- <username>Jdlrobson</username>
- <id>15999850</id>
- </contributor>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="5154">-- This module outputs different kinds of lists. At the moment, bulleted,
- -- unbulleted, horizontal, ordered, and horizontal ordered lists are supported.
- local libUtil = require('libraryUtil')
- local checkType = libUtil.checkType
- local mTableTools = require('Module:TableTools')
- local p = {}
- local listTypes = {
- ['bulleted'] = true,
- ['unbulleted'] = true,
- ['horizontal'] = true,
- ['ordered'] = true,
- ['horizontal_ordered'] = true
- }
- function p.makeListData(listType, args)
- -- Constructs a data table to be passed to p.renderList.
- local data = {}
- -- Classes
- data.classes = {}
- if listType == 'horizontal' or listType == 'horizontal_ordered' then
- table.insert(data.classes, 'hlist hlist-separated')
- elseif listType == 'unbulleted' then
- table.insert(data.classes, 'plainlist')
- end
- table.insert(data.classes, args.class)
- -- Main div style
- data.style = args.style
- -- Indent for horizontal lists
- if listType == 'horizontal' or listType == 'horizontal_ordered' then
- local indent = tonumber(args.indent)
- indent = indent and indent * 1.6 or 0
- if indent > 0 then
- data.marginLeft = indent .. 'em'
- end
- end
- -- List style types for ordered lists
- -- This could be "1, 2, 3", "a, b, c", or a number of others. The list style
- -- type is either set by the "type" attribute or the "list-style-type" CSS
- -- property.
- if listType == 'ordered' or listType == 'horizontal_ordered' then
- data.listStyleType = args.list_style_type or args['list-style-type']
- data.type = args['type']
- -- Detect invalid type attributes and attempt to convert them to
- -- list-style-type CSS properties.
- if data.type
- and not data.listStyleType
- and not tostring(data.type):find('^%s*[1AaIi]%s*$')
- then
- data.listStyleType = data.type
- data.type = nil
- end
- end
- -- List tag type
- if listType == 'ordered' or listType == 'horizontal_ordered' then
- data.listTag = 'ol'
- else
- data.listTag = 'ul'
- end
- -- Start number for ordered lists
- data.start = args.start
- if listType == 'horizontal_ordered' then
- -- Apply fix to get start numbers working with horizontal ordered lists.
- local startNum = tonumber(data.start)
- if startNum then
- data.counterReset = 'listitem ' .. tostring(startNum - 1)
- end
- end
- -- List style
- -- ul_style and ol_style are included for backwards compatibility. No
- -- distinction is made for ordered or unordered lists.
- data.listStyle = args.list_style
- -- List items
- -- li_style is included for backwards compatibility. item_style was included
- -- to be easier to understand for non-coders.
- data.itemStyle = args.item_style or args.li_style
- data.items = {}
- for i, num in ipairs(mTableTools.numKeys(args)) do
- local item = {}
- item.content = args[num]
- item.style = args['item' .. tostring(num) .. '_style']
- or args['item_style' .. tostring(num)]
- item.value = args['item' .. tostring(num) .. '_value']
- or args['item_value' .. tostring(num)]
- table.insert(data.items, item)
- end
- return data
- end
- function p.renderList(data)
- -- Renders the list HTML.
- -- Return the blank string if there are no list items.
- if type(data.items) ~= 'table' or #data.items < 1 then
- return ''
- end
- -- Render the main div tag.
- local root = mw.html.create('div')
- for i, class in ipairs(data.classes or {}) do
- root:addClass(class)
- end
- root:css{['margin-left'] = data.marginLeft}
- if data.style then
- root:cssText(data.style)
- end
- -- Render the list tag.
- local list = root:tag(data.listTag or 'ul')
- list
- :attr{start = data.start, type = data.type}
- :css{
- ['counter-reset'] = data.counterReset,
- ['list-style-type'] = data.listStyleType
- }
- if data.listStyle then
- list:cssText(data.listStyle)
- end
- -- Render the list items
- for i, t in ipairs(data.items or {}) do
- local item = list:tag('li')
- if data.itemStyle then
- item:cssText(data.itemStyle)
- end
- if t.style then
- item:cssText(t.style)
- end
- item
- :attr{value = t.value}
- :wikitext(t.content)
- end
- return tostring(root)
- end
- function p.renderTrackingCategories(args)
- local isDeprecated = false -- Tracks deprecated parameters.
- for k, v in pairs(args) do
- k = tostring(k)
- if k:find('^item_style%d+$') or k:find('^item_value%d+$') then
- isDeprecated = true
- break
- end
- end
- local ret = ''
- if isDeprecated then
- ret = ret .. '[[Category:List templates with deprecated parameters]]'
- end
- return ret
- end
- function p.makeList(listType, args)
- if not listType or not listTypes[listType] then
- error(string.format(
- "bad argument #1 to 'makeList' ('%s' is not a valid list type)",
- tostring(listType)
- ), 2)
- end
- checkType('makeList', 2, args, 'table')
- local data = p.makeListData(listType, args)
- local list = p.renderList(data)
- local trackingCategories = p.renderTrackingCategories(args)
- return list .. trackingCategories
- end
- for listType in pairs(listTypes) do
- p[listType] = function (frame)
- local mArguments = require('Module:Arguments')
- local origArgs = mArguments.getArgs(frame)
- -- Copy all the arguments to a new table, for faster indexing.
- local args = {}
- for k, v in pairs(origArgs) do
- args[k] = v
- end
- return p.makeList(listType, args)
- end
- end
- return p</text>
- <sha1>lkqmcmpfob2c6xhq46f675tm6p136ns</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Lua banner</title>
- <ns>828</ns>
- <id>42951651</id>
- <revision>
- <id>847256650</id>
- <parentid>837866503</parentid>
- <timestamp>2018-06-24T00:47:01Z</timestamp>
- <contributor>
- <username>Ahecht</username>
- <id>2016996</id>
- </contributor>
- <comment>Detect if on module page</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="3086">-- This module implements the {{lua}} template.
- local yesno = require('Module:Yesno')
- local mList = require('Module:List')
- local mTableTools = require('Module:TableTools')
- local mMessageBox = require('Module:Message box')
- local p = {}
- function p.main(frame)
- local origArgs = frame:getParent().args
- local args = {}
- for k, v in pairs(origArgs) do
- v = v:match('^%s*(.-)%s*$')
- if v ~= '' then
- args[k] = v
- end
- end
- return p._main(args)
- end
- function p._main(args)
- local modules = mTableTools.compressSparseArray(args)
- local box = p.renderBox(modules)
- local trackingCategories = p.renderTrackingCategories(args, modules)
- return box .. trackingCategories
- end
- function p.renderBox(modules)
- local boxArgs = {}
- if #modules < 1 then
- boxArgs.text = '<strong class="error">Error: no modules specified</strong>'
- else
- local moduleLinks = {}
- for i, module in ipairs(modules) do
- moduleLinks[i] = string.format('[[:%s]]', module)
- end
- local moduleList = mList.makeList('bulleted', moduleLinks)
- boxArgs.text = 'This ' ..
- (mw.title.getCurrentTitle():inNamespaces(828,829) and 'module' or 'template') ..
- ' uses [[Wikipedia:Lua|Lua]]:\n' .. moduleList
- end
- boxArgs.type = 'notice'
- boxArgs.small = true
- boxArgs.image = '[[File:Lua-logo-nolabel.svg|30px|alt=|link=]]'
- return mMessageBox.main('mbox', boxArgs)
- end
- function p.renderTrackingCategories(args, modules, titleObj)
- if yesno(args.nocat) then
- return ''
- end
- local cats = {}
- -- Error category
- if #modules < 1 then
- cats[#cats + 1] = 'Lua templates with errors'
- end
- -- Lua templates category
- titleObj = titleObj or mw.title.getCurrentTitle()
- local subpageBlacklist = {
- doc = true,
- sandbox = true,
- sandbox2 = true,
- testcases = true
- }
- if titleObj.namespace == 10
- and not subpageBlacklist[titleObj.subpageText]
- then
- local category = args.category
- if not category then
- local categories = {
- ['Module:String'] = 'Lua String-based templates',
- ['Module:Math'] = 'Templates based on the Math Lua module',
- ['Module:BaseConvert'] = 'Templates based on the BaseConvert Lua module',
- ['Module:Citation'] = 'Lua-based citation templates'
- }
- categories['Module:Citation/CS1'] = categories['Module:Citation']
- category = modules[1] and categories[modules[1]]
- category = category or 'Lua-based templates'
- end
- cats[#cats + 1] = category
- local protLevels = {
- autoconfirmed = 1,
- extendedconfirmed = 2,
- templateeditor = 3,
- sysop = 4
- }
- local currentProt = titleObj.protectionLevels["edit"][1]
- if currentProt == nil then currentProt = 0 else currentProt = protLevels[currentProt] end
- for i, module in ipairs(modules) do
- local moduleProt = mw.title.new(module).protectionLevels["edit"][1]
- if moduleProt == nil then moduleProt = 0 else moduleProt = protLevels[moduleProt] end
- if moduleProt < currentProt then
- cats[#cats + 1] = "Templates using under-protected Lua modules"
- break
- end
- end
- end
- for i, cat in ipairs(cats) do
- cats[i] = string.format('[[Category:%s]]', cat)
- end
- return table.concat(cats)
- end
- return p</text>
- <sha1>691clljhkwhpn2xemapk54m2k5fuame</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Message box</title>
- <ns>828</ns>
- <id>40574910</id>
- <revision>
- <id>835732555</id>
- <parentid>803399820</parentid>
- <timestamp>2018-04-10T12:58:17Z</timestamp>
- <contributor>
- <username>MSGJ</username>
- <id>42630</id>
- </contributor>
- <comment>ony load Category handler when needed, requested on talk page</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="17101">-- This is a meta-module for producing message box templates, including
- -- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.
- -- Load necessary modules.
- require('Module:No globals')
- local getArgs
- local yesno = require('Module:Yesno')
- -- Get a language object for formatDate and ucfirst.
- local lang = mw.language.getContentLanguage()
- -- Define constants
- local CONFIG_MODULE = 'Module:Message box/configuration'
- --------------------------------------------------------------------------------
- -- Helper functions
- --------------------------------------------------------------------------------
- local function getTitleObject(...)
- -- Get the title object, passing the function through pcall
- -- in case we are over the expensive function count limit.
- local success, title = pcall(mw.title.new, ...)
- if success then
- return title
- end
- end
- local function union(t1, t2)
- -- Returns the union of two arrays.
- local vals = {}
- for i, v in ipairs(t1) do
- vals[v] = true
- end
- for i, v in ipairs(t2) do
- vals[v] = true
- end
- local ret = {}
- for k in pairs(vals) do
- table.insert(ret, k)
- end
- table.sort(ret)
- return ret
- end
- local function getArgNums(args, prefix)
- local nums = {}
- for k, v in pairs(args) do
- local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')
- if num then
- table.insert(nums, tonumber(num))
- end
- end
- table.sort(nums)
- return nums
- end
- --------------------------------------------------------------------------------
- -- Box class definition
- --------------------------------------------------------------------------------
- local MessageBox = {}
- MessageBox.__index = MessageBox
- function MessageBox.new(boxType, args, cfg)
- args = args or {}
- local obj = {}
- -- Set the title object and the namespace.
- obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
- -- Set the config for our box type.
- obj.cfg = cfg[boxType]
- if not obj.cfg then
- local ns = obj.title.namespace
- -- boxType is "mbox" or invalid input
- if ns == 0 then
- obj.cfg = cfg.ambox -- main namespace
- elseif ns == 6 then
- obj.cfg = cfg.imbox -- file namespace
- elseif ns == 14 then
- obj.cfg = cfg.cmbox -- category namespace
- else
- local nsTable = mw.site.namespaces[ns]
- if nsTable and nsTable.isTalk then
- obj.cfg = cfg.tmbox -- any talk namespace
- else
- obj.cfg = cfg.ombox -- other namespaces or invalid input
- end
- end
- end
- -- Set the arguments, and remove all blank arguments except for the ones
- -- listed in cfg.allowBlankParams.
- do
- local newArgs = {}
- for k, v in pairs(args) do
- if v ~= '' then
- newArgs[k] = v
- end
- end
- for i, param in ipairs(obj.cfg.allowBlankParams or {}) do
- newArgs[param] = args[param]
- end
- obj.args = newArgs
- end
- -- Define internal data structure.
- obj.categories = {}
- obj.classes = {}
- -- For lazy loading of [[Module:Category handler]].
- obj.hasCategories = false
- return setmetatable(obj, MessageBox)
- end
- function MessageBox:addCat(ns, cat, sort)
- if not cat then
- return nil
- end
- if sort then
- cat = string.format('[[Category:%s|%s]]', cat, sort)
- else
- cat = string.format('[[Category:%s]]', cat)
- end
- self.hasCategories = true
- self.categories[ns] = self.categories[ns] or {}
- table.insert(self.categories[ns], cat)
- end
- function MessageBox:addClass(class)
- if not class then
- return nil
- end
- table.insert(self.classes, class)
- end
- function MessageBox:setParameters()
- local args = self.args
- local cfg = self.cfg
- -- Get type data.
- self.type = args.type
- local typeData = cfg.types[self.type]
- self.invalidTypeError = cfg.showInvalidTypeError
- and self.type
- and not typeData
- typeData = typeData or cfg.types[cfg.default]
- self.typeClass = typeData.class
- self.typeImage = typeData.image
- -- Find if the box has been wrongly substituted.
- self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
- -- Find whether we are using a small message box.
- self.isSmall = cfg.allowSmall and (
- cfg.smallParam and args.small == cfg.smallParam
- or not cfg.smallParam and yesno(args.small)
- )
- -- Add attributes, classes and styles.
- self.id = args.id
- if yesno(args.plainlinks) ~= false then
- self:addClass('plainlinks')
- end
- for _, class in ipairs(cfg.classes or {}) do
- self:addClass(class)
- end
- if self.isSmall then
- self:addClass(cfg.smallClass or 'mbox-small')
- end
- self:addClass(self.typeClass)
- self:addClass(args.class)
- self.style = args.style
- self.attrs = args.attrs
- -- Set text style.
- self.textstyle = args.textstyle
- -- Find if we are on the template page or not. This functionality is only
- -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory
- -- and cfg.templateCategoryRequireName are set.
- self.useCollapsibleTextFields = cfg.useCollapsibleTextFields
- if self.useCollapsibleTextFields
- or cfg.templateCategory
- and cfg.templateCategoryRequireName
- then
- self.name = args.name
- if self.name then
- local templateName = mw.ustring.match(
- self.name,
- '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'
- ) or self.name
- templateName = 'Template:' .. templateName
- self.templateTitle = getTitleObject(templateName)
- end
- self.isTemplatePage = self.templateTitle
- and mw.title.equals(self.title, self.templateTitle)
- end
- -- Process data for collapsible text fields. At the moment these are only
- -- used in {{ambox}}.
- if self.useCollapsibleTextFields then
- -- Get the self.issue value.
- if self.isSmall and args.smalltext then
- self.issue = args.smalltext
- else
- local sect
- if args.sect == '' then
- sect = 'This ' .. (cfg.sectionDefault or 'page')
- elseif type(args.sect) == 'string' then
- sect = 'This ' .. args.sect
- end
- local issue = args.issue
- issue = type(issue) == 'string' and issue ~= '' and issue or nil
- local text = args.text
- text = type(text) == 'string' and text or nil
- local issues = {}
- table.insert(issues, sect)
- table.insert(issues, issue)
- table.insert(issues, text)
- self.issue = table.concat(issues, ' ')
- end
- -- Get the self.talk value.
- local talk = args.talk
- -- Show talk links on the template page or template subpages if the talk
- -- parameter is blank.
- if talk == ''
- and self.templateTitle
- and (
- mw.title.equals(self.templateTitle, self.title)
- or self.title:isSubpageOf(self.templateTitle)
- )
- then
- talk = '#'
- elseif talk == '' then
- talk = nil
- end
- if talk then
- -- If the talk value is a talk page, make a link to that page. Else
- -- assume that it's a section heading, and make a link to the talk
- -- page of the current page with that section heading.
- local talkTitle = getTitleObject(talk)
- local talkArgIsTalkPage = true
- if not talkTitle or not talkTitle.isTalkPage then
- talkArgIsTalkPage = false
- talkTitle = getTitleObject(
- self.title.text,
- mw.site.namespaces[self.title.namespace].talk.id
- )
- end
- if talkTitle and talkTitle.exists then
- local talkText = 'Relevant discussion may be found on'
- if talkArgIsTalkPage then
- talkText = string.format(
- '%s [[%s|%s]].',
- talkText,
- talk,
- talkTitle.prefixedText
- )
- else
- talkText = string.format(
- '%s the [[%s#%s|talk page]].',
- talkText,
- talkTitle.prefixedText,
- talk
- )
- end
- self.talk = talkText
- end
- end
- -- Get other values.
- self.fix = args.fix ~= '' and args.fix or nil
- local date
- if args.date and args.date ~= '' then
- date = args.date
- elseif args.date == '' and self.isTemplatePage then
- date = lang:formatDate('F Y')
- end
- if date then
- self.date = string.format(" <small>''(%s)''</small>", date)
- end
- self.info = args.info
- if yesno(args.removalnotice) then
- self.removalNotice = cfg.removalNotice
- end
- end
- -- Set the non-collapsible text field. At the moment this is used by all box
- -- types other than ambox, and also by ambox when small=yes.
- if self.isSmall then
- self.text = args.smalltext or args.text
- else
- self.text = args.text
- end
- -- Set the below row.
- self.below = cfg.below and args.below
- -- General image settings.
- self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
- self.imageEmptyCell = cfg.imageEmptyCell
- if cfg.imageEmptyCellStyle then
- self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'
- end
- -- Left image settings.
- local imageLeft = self.isSmall and args.smallimage or args.image
- if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
- or not cfg.imageCheckBlank and imageLeft ~= 'none'
- then
- self.imageLeft = imageLeft
- if not imageLeft then
- local imageSize = self.isSmall
- and (cfg.imageSmallSize or '30x30px')
- or '40x40px'
- self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
- or 'Imbox notice.png', imageSize)
- end
- end
- -- Right image settings.
- local imageRight = self.isSmall and args.smallimageright or args.imageright
- if not (cfg.imageRightNone and imageRight == 'none') then
- self.imageRight = imageRight
- end
- end
- function MessageBox:setMainspaceCategories()
- local args = self.args
- local cfg = self.cfg
- if not cfg.allowMainspaceCategories then
- return nil
- end
- local nums = {}
- for _, prefix in ipairs{'cat', 'category', 'all'} do
- args[prefix .. '1'] = args[prefix]
- nums = union(nums, getArgNums(args, prefix))
- end
- -- The following is roughly equivalent to the old {{Ambox/category}}.
- local date = args.date
- date = type(date) == 'string' and date
- local preposition = 'from'
- for _, num in ipairs(nums) do
- local mainCat = args['cat' .. tostring(num)]
- or args['category' .. tostring(num)]
- local allCat = args['all' .. tostring(num)]
- mainCat = type(mainCat) == 'string' and mainCat
- allCat = type(allCat) == 'string' and allCat
- if mainCat and date and date ~= '' then
- local catTitle = string.format('%s %s %s', mainCat, preposition, date)
- self:addCat(0, catTitle)
- catTitle = getTitleObject('Category:' .. catTitle)
- if not catTitle or not catTitle.exists then
- self:addCat(0, 'Articles with invalid date parameter in template')
- end
- elseif mainCat and (not date or date == '') then
- self:addCat(0, mainCat)
- end
- if allCat then
- self:addCat(0, allCat)
- end
- end
- end
- function MessageBox:setTemplateCategories()
- local args = self.args
- local cfg = self.cfg
- -- Add template categories.
- if cfg.templateCategory then
- if cfg.templateCategoryRequireName then
- if self.isTemplatePage then
- self:addCat(10, cfg.templateCategory)
- end
- elseif not self.title.isSubpage then
- self:addCat(10, cfg.templateCategory)
- end
- end
- -- Add template error categories.
- if cfg.templateErrorCategory then
- local templateErrorCategory = cfg.templateErrorCategory
- local templateCat, templateSort
- if not self.name and not self.title.isSubpage then
- templateCat = templateErrorCategory
- elseif self.isTemplatePage then
- local paramsToCheck = cfg.templateErrorParamsToCheck or {}
- local count = 0
- for i, param in ipairs(paramsToCheck) do
- if not args[param] then
- count = count + 1
- end
- end
- if count > 0 then
- templateCat = templateErrorCategory
- templateSort = tostring(count)
- end
- if self.categoryNums and #self.categoryNums > 0 then
- templateCat = templateErrorCategory
- templateSort = 'C'
- end
- end
- self:addCat(10, templateCat, templateSort)
- end
- end
- function MessageBox:setAllNamespaceCategories()
- -- Set categories for all namespaces.
- if self.invalidTypeError then
- local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
- self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
- end
- if self.isSubstituted then
- self:addCat('all', 'Pages with incorrectly substituted templates')
- end
- end
- function MessageBox:setCategories()
- if self.title.namespace == 0 then
- self:setMainspaceCategories()
- elseif self.title.namespace == 10 then
- self:setTemplateCategories()
- end
- self:setAllNamespaceCategories()
- end
- function MessageBox:renderCategories()
- if not self.hasCategories then
- -- No categories added, no need to pass them to Category handler so,
- -- if it was invoked, it would return the empty string.
- -- So we shortcut and return the empty string.
- return ""
- end
- -- Convert category tables to strings and pass them through
- -- [[Module:Category handler]].
- return require('Module:Category handler')._main{
- main = table.concat(self.categories[0] or {}),
- template = table.concat(self.categories[10] or {}),
- all = table.concat(self.categories.all or {}),
- nocat = self.args.nocat,
- page = self.args.page
- }
- end
- function MessageBox:export()
- local root = mw.html.create()
- -- Add the subst check error.
- if self.isSubstituted and self.name then
- root:tag('b')
- :addClass('error')
- :wikitext(string.format(
- 'Template <code>%s[[Template:%s|%s]]%s</code> has been incorrectly substituted.',
- mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
- ))
- end
- -- Create the box table.
- local boxTable = root:tag('table')
- boxTable:attr('id', self.id or nil)
- for i, class in ipairs(self.classes or {}) do
- boxTable:addClass(class or nil)
- end
- boxTable
- :cssText(self.style or nil)
- :attr('role', 'presentation')
- if self.attrs then
- boxTable:attr(self.attrs)
- end
- -- Add the left-hand image.
- local row = boxTable:tag('tr')
- if self.imageLeft then
- local imageLeftCell = row:tag('td'):addClass('mbox-image')
- if self.imageCellDiv then
- -- If we are using a div, redefine imageLeftCell so that the image
- -- is inside it. Divs use style="width: 52px;", which limits the
- -- image width to 52px. If any images in a div are wider than that,
- -- they may overlap with the text or cause other display problems.
- imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
- end
- imageLeftCell:wikitext(self.imageLeft or nil)
- elseif self.imageEmptyCell then
- -- Some message boxes define an empty cell if no image is specified, and
- -- some don't. The old template code in templates where empty cells are
- -- specified gives the following hint: "No image. Cell with some width
- -- or padding necessary for text cell to have 100% width."
- row:tag('td')
- :addClass('mbox-empty-cell')
- :cssText(self.imageEmptyCellStyle or nil)
- end
- -- Add the text.
- local textCell = row:tag('td'):addClass('mbox-text')
- if self.useCollapsibleTextFields then
- -- The message box uses advanced text parameters that allow things to be
- -- collapsible. At the moment, only ambox uses this.
- textCell:cssText(self.textstyle or nil)
- local textCellDiv = textCell:tag('div')
- textCellDiv
- :addClass('mbox-text-span')
- :wikitext(self.issue or nil)
- if (self.talk or self.fix) and not self.isSmall then
- textCellDiv:tag('span')
- :addClass('hide-when-compact')
- :wikitext(self.talk and (' ' .. self.talk) or nil)
- :wikitext(self.fix and (' ' .. self.fix) or nil)
- end
- textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
- if self.info and not self.isSmall then
- textCellDiv
- :tag('span')
- :addClass('hide-when-compact')
- :wikitext(self.info and (' ' .. self.info) or nil)
- end
- if self.removalNotice then
- textCellDiv:tag('small')
- :addClass('hide-when-compact')
- :tag('i')
- :wikitext(string.format(" (%s)", self.removalNotice))
- end
- else
- -- Default text formatting - anything goes.
- textCell
- :cssText(self.textstyle or nil)
- :wikitext(self.text or nil)
- end
- -- Add the right-hand image.
- if self.imageRight then
- local imageRightCell = row:tag('td'):addClass('mbox-imageright')
- if self.imageCellDiv then
- -- If we are using a div, redefine imageRightCell so that the image
- -- is inside it.
- imageRightCell = imageRightCell:tag('div'):css('width', '52px')
- end
- imageRightCell
- :wikitext(self.imageRight or nil)
- end
- -- Add the below row.
- if self.below then
- boxTable:tag('tr')
- :tag('td')
- :attr('colspan', self.imageRight and '3' or '2')
- :addClass('mbox-text')
- :cssText(self.textstyle or nil)
- :wikitext(self.below or nil)
- end
- -- Add error message for invalid type parameters.
- if self.invalidTypeError then
- root:tag('div')
- :css('text-align', 'center')
- :wikitext(string.format(
- 'This message box is using an invalid "type=%s" parameter and needs fixing.',
- self.type or ''
- ))
- end
- -- Add categories.
- root:wikitext(self:renderCategories() or nil)
- return tostring(root)
- end
- --------------------------------------------------------------------------------
- -- Exports
- --------------------------------------------------------------------------------
- local p, mt = {}, {}
- function p._exportClasses()
- -- For testing.
- return {
- MessageBox = MessageBox
- }
- end
- function p.main(boxType, args, cfgTables)
- local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
- box:setParameters()
- box:setCategories()
- return box:export()
- end
- function mt.__index(t, k)
- return function (frame)
- if not getArgs then
- getArgs = require('Module:Arguments').getArgs
- end
- return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
- end
- end
- return setmetatable(p, mt)</text>
- <sha1>6r6gh40ujwjmoo5h9kc5j9ytuxwrvvy</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Message box/configuration</title>
- <ns>828</ns>
- <id>40627038</id>
- <revision>
- <id>742383738</id>
- <parentid>717357572</parentid>
- <timestamp>2016-10-03T11:04:13Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>allow all templates to disable the plainlinks class</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="6091">--------------------------------------------------------------------------------
- -- Message box configuration --
- -- --
- -- This module contains configuration data for [[Module:Message box]]. --
- --------------------------------------------------------------------------------
- return {
- ambox = {
- types = {
- speedy = {
- class = 'ambox-speedy',
- image = 'Ambox warning pn.svg'
- },
- delete = {
- class = 'ambox-delete',
- image = 'Ambox warning pn.svg'
- },
- content = {
- class = 'ambox-content',
- image = 'Ambox important.svg'
- },
- style = {
- class = 'ambox-style',
- image = 'Edit-clear.svg'
- },
- move = {
- class = 'ambox-move',
- image = 'Merge-split-transwiki default.svg'
- },
- protection = {
- class = 'ambox-protection',
- image = 'Padlock-silver-medium.svg'
- },
- notice = {
- class = 'ambox-notice',
- image = 'Information icon4.svg'
- }
- },
- default = 'notice',
- allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
- allowSmall = true,
- smallParam = 'left',
- smallClass = 'mbox-small-left',
- substCheck = true,
- classes = {'metadata', 'ambox'},
- imageEmptyCell = true,
- imageCheckBlank = true,
- imageSmallSize = '20x20px',
- imageCellDiv = true,
- useCollapsibleTextFields = true,
- imageRightNone = true,
- sectionDefault = 'article',
- allowMainspaceCategories = true,
- templateCategory = 'Article message templates',
- templateCategoryRequireName = true,
- templateErrorCategory = 'Article message templates with missing parameters',
- templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
- removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
- },
- cmbox = {
- types = {
- speedy = {
- class = 'cmbox-speedy',
- image = 'Ambox warning pn.svg'
- },
- delete = {
- class = 'cmbox-delete',
- image = 'Ambox warning pn.svg'
- },
- content = {
- class = 'cmbox-content',
- image = 'Ambox important.svg'
- },
- style = {
- class = 'cmbox-style',
- image = 'Edit-clear.svg'
- },
- move = {
- class = 'cmbox-move',
- image = 'Merge-split-transwiki default.svg'
- },
- protection = {
- class = 'cmbox-protection',
- image = 'Padlock-silver-medium.svg'
- },
- notice = {
- class = 'cmbox-notice',
- image = 'Information icon4.svg'
- }
- },
- default = 'notice',
- showInvalidTypeError = true,
- classes = {'cmbox'},
- imageEmptyCell = true
- },
- fmbox = {
- types = {
- warning = {
- class = 'fmbox-warning',
- image = 'Ambox warning pn.svg'
- },
- editnotice = {
- class = 'fmbox-editnotice',
- image = 'Information icon4.svg'
- },
- system = {
- class = 'fmbox-system',
- image = 'Information icon4.svg'
- }
- },
- default = 'system',
- showInvalidTypeError = true,
- classes = {'fmbox'},
- imageEmptyCell = false,
- imageRightNone = false
- },
- imbox = {
- types = {
- speedy = {
- class = 'imbox-speedy',
- image = 'Ambox warning pn.svg'
- },
- delete = {
- class = 'imbox-delete',
- image = 'Ambox warning pn.svg'
- },
- content = {
- class = 'imbox-content',
- image = 'Ambox important.svg'
- },
- style = {
- class = 'imbox-style',
- image = 'Edit-clear.svg'
- },
- move = {
- class = 'imbox-move',
- image = 'Merge-split-transwiki default.svg'
- },
- protection = {
- class = 'imbox-protection',
- image = 'Padlock-silver-medium.svg'
- },
- license = {
- class = 'imbox-license licensetpl',
- image = 'Imbox license.png' -- @todo We need an SVG version of this
- },
- featured = {
- class = 'imbox-featured',
- image = 'Cscr-featured.svg'
- },
- notice = {
- class = 'imbox-notice',
- image = 'Information icon4.svg'
- }
- },
- default = 'notice',
- showInvalidTypeError = true,
- classes = {'imbox'},
- imageEmptyCell = true,
- below = true,
- templateCategory = 'File message boxes'
- },
- ombox = {
- types = {
- speedy = {
- class = 'ombox-speedy',
- image = 'Ambox warning pn.svg'
- },
- delete = {
- class = 'ombox-delete',
- image = 'Ambox warning pn.svg'
- },
- content = {
- class = 'ombox-content',
- image = 'Ambox important.svg'
- },
- style = {
- class = 'ombox-style',
- image = 'Edit-clear.svg'
- },
- move = {
- class = 'ombox-move',
- image = 'Merge-split-transwiki default.svg'
- },
- protection = {
- class = 'ombox-protection',
- image = 'Padlock-silver-medium.svg'
- },
- notice = {
- class = 'ombox-notice',
- image = 'Information icon4.svg'
- }
- },
- default = 'notice',
- showInvalidTypeError = true,
- classes = {'ombox'},
- allowSmall = true,
- imageEmptyCell = true,
- imageRightNone = true
- },
- tmbox = {
- types = {
- speedy = {
- class = 'tmbox-speedy',
- image = 'Ambox warning pn.svg'
- },
- delete = {
- class = 'tmbox-delete',
- image = 'Ambox warning pn.svg'
- },
- content = {
- class = 'tmbox-content',
- image = 'Ambox important.svg'
- },
- style = {
- class = 'tmbox-style',
- image = 'Edit-clear.svg'
- },
- move = {
- class = 'tmbox-move',
- image = 'Merge-split-transwiki default.svg'
- },
- protection = {
- class = 'tmbox-protection',
- image = 'Padlock-silver-medium.svg'
- },
- notice = {
- class = 'tmbox-notice',
- image = 'Information icon4.svg'
- }
- },
- default = 'notice',
- showInvalidTypeError = true,
- classes = {'tmbox'},
- allowSmall = true,
- imageRightNone = true,
- imageEmptyCell = true,
- imageEmptyCellStyle = true,
- templateCategory = 'Talk message boxes'
- }
- }</text>
- <sha1>16xsc67jviirmw0nf2yuxvotqd7rygq</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Navbar</title>
- <ns>828</ns>
- <id>38827227</id>
- <revision>
- <id>835774036</id>
- <parentid>835562114</parentid>
- <timestamp>2018-04-10T17:55:58Z</timestamp>
- <contributor>
- <username>Primefac</username>
- <id>11508456</id>
- </contributor>
- <comment>another local</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="3091">local p = {}
- local getArgs
- local ul
- function p.addItem (mini, full, link, descrip, args, url)
- local l
- if url then
- l = {'[', '', ']'}
- else
- l = {'[[', '|', ']]'}
- end
- ul:tag('li')
- :addClass('nv-'..full)
- :wikitext(l[1] .. link .. l[2])
- :tag(args.mini and 'abbr' or 'span')
- :attr('title', descrip..' this template')
- :cssText(args.fontstyle)
- :wikitext(args.mini and mini or full)
- :done()
- :wikitext(l[3])
- end
- function p.brackets (position, c, args, div)
- if args.brackets then
- div
- :tag('span')
- :css('margin-'..position, '-0.125em')
- :cssText(args.fontstyle)
- :wikitext(c)
- end
- end
- function p._navbar(args)
- local show = {true, true, true, false, false, false}
- local titleArg = 1
- if args.collapsible then
- titleArg = 2
- if not args.plain then args.mini = 1 end
- if args.fontcolor then
- args.fontstyle = 'color:' .. args.fontcolor .. ';'
- end
- args.style = 'float:left; text-align:left'
- end
- if args.template then
- titleArg = 'template'
- show = {true, false, false, false, false, false}
- local index = {t = 2, d = 2, e = 3, h = 4, m = 5, w = 6, talk = 2, edit = 3, hist = 4, move = 5, watch = 6}
- for k,v in ipairs(require ('Module:TableTools').compressSparseArray(args)) do
- local num = index[v]
- if num then show[num] = true end
- end
- end
- if args.noedit then show[3] = false end
- local titleText = args[titleArg] or (':' .. mw.getCurrentFrame():getParent():getTitle())
- local title = mw.title.new(mw.text.trim(titleText), 'Template')
- if not title then
- error('Invalid title ' .. titleText)
- end
- local talkpage = title.talkPageTitle and title.talkPageTitle.fullText or ''
- local div = mw.html.create():tag('div')
- div
- :addClass('plainlinks')
- :addClass('hlist')
- :addClass('navbar')
- :cssText(args.style)
- if args.mini then div:addClass('mini') end
- if not (args.mini or args.plain) then
- div
- :tag('span')
- :css('word-spacing', 0)
- :cssText(args.fontstyle)
- :wikitext(args.text or 'This box:')
- :wikitext(' ')
- end
- p.brackets('right', '&#91; ', args, div)
- ul = div:tag('ul')
- if show[1] then p.addItem('v', 'view', title.fullText, 'View', args) end
- if show[2] then p.addItem('t', 'talk', talkpage, 'Discuss', args) end
- if show[3] then p.addItem('e', 'edit', title:fullUrl('action=edit'), 'Edit', args, true) end
- if show[4] then p.addItem('h', 'hist', title:fullUrl('action=history'), 'History of', args, true) end
- if show[5] then
- local move = mw.title.new ('Special:Movepage')
- p.addItem('m', 'move', move:fullUrl('target='..title.fullText), 'Move', args, true) end
- if show[6] then p.addItem('w', 'watch', title:fullUrl('action=watch'), 'Watch', args, true) end
- p.brackets('left', ' &#93;', args, div)
- if args.collapsible then
- div
- :done()
- :tag('div')
- :css('font-size', '114%')
- :css('margin', args.mini and '0 4em' or '0 7em')
- :cssText(args.fontstyle)
- :wikitext(args[1])
- end
- return tostring(div:done())
- end
- function p.navbar(frame)
- if not getArgs then
- getArgs = require('Module:Arguments').getArgs
- end
- return p._navbar(getArgs(frame))
- end
- return p</text>
- <sha1>0kto9e56pycr6rz0vadnqvghkpm06x9</sha1>
- </revision>
- </page>
- <page>
- <title>Module:No globals</title>
- <ns>828</ns>
- <id>42567026</id>
- <revision>
- <id>606781024</id>
- <parentid>605595284</parentid>
- <timestamp>2014-05-02T15:35:56Z</timestamp>
- <contributor>
- <username>Jackmcbarn</username>
- <id>19285809</id>
- </contributor>
- <comment>rm name exception</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="307">local mt = getmetatable(_G) or {}
- function mt.__index (t, k)
- if k ~= 'arg' then
- error('Tried to read nil global ' .. tostring(k), 2)
- end
- return nil
- end
- function mt.__newindex(t, k, v)
- if k ~= 'arg' then
- error('Tried to write global ' .. tostring(k), 2)
- end
- rawset(t, k, v)
- end
- setmetatable(_G, mt)</text>
- <sha1>gggsv54pq7f94l3up48hr91qtxnskdm</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Parameter names example</title>
- <ns>828</ns>
- <id>43325707</id>
- <revision>
- <id>804712407</id>
- <parentid>625611091</parentid>
- <timestamp>2017-10-10T17:47:29Z</timestamp>
- <contributor>
- <username>MusikAnimal</username>
- <id>14882394</id>
- </contributor>
- <minor/>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="1521">-- This module implements {{parameter names example}}.
- local p = {}
- local function makeParam(s)
- local lb = '&#123;'
- local rb = '&#125;'
- return lb:rep(3) .. s .. rb:rep(3)
- end
- local function italicize(s)
- return "''" .. s .. "''"
- end
- local function plain(s)
- return s
- end
- function p._main(args, frame)
- -- Find how we want to format the arguments to the template.
- local formatFunc
- if args._display == 'italics' or args._display == 'italic' then
- formatFunc = italicize
- elseif args._display == 'plain' then
- formatFunc = plain
- else
- formatFunc = makeParam
- end
- -- Build the table of template arguments.
- local targs = {}
- for k, v in pairs(args) do
- if type(k) == 'number' then
- targs[v] = formatFunc(v)
- elseif not k:find('^_') then
- targs[k] = v
- end
- end
- -- Find the template name.
- local template
- if args._template then
- template = args._template
- else
- local currentTitle = mw.title.getCurrentTitle()
- if currentTitle.prefixedText:find('/sandbox$') then
- template = currentTitle.prefixedText
- else
- template = currentTitle.basePageTitle.prefixedText
- end
- end
- -- Call the template with the arguments.
- frame = frame or mw.getCurrentFrame()
- local success, result = pcall(
- frame.expandTemplate,
- frame,
- {title = template, args = targs}
- )
- if success then
- return result
- else
- return ''
- end
- end
- function p.main(frame)
- local args = require('Module:Arguments').getArgs(frame, {
- wrappers = 'Template:Parameter names example'
- })
- return p._main(args, frame)
- end
- return p</text>
- <sha1>6o7ema5t5ok6u2ticvu2qjmkbqsdz1n</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Protection banner</title>
- <ns>828</ns>
- <id>42040984</id>
- <revision>
- <id>741795115</id>
- <parentid>732908599</parentid>
- <timestamp>2016-09-29T18:32:41Z</timestamp>
- <contributor>
- <username>Cenarium</username>
- <id>5711305</id>
- </contributor>
- <comment>remove expiry param (now also automatically retrieved for autoreview) and needsexpiry check</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="25486">-- This module implements {{pp-meta}} and its daughter templates such as
- -- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
- -- Initialise necessary modules.
- require('Module:No globals')
- local makeFileLink = require('Module:File link')._main
- local effectiveProtectionLevel = require('Module:Effective protection level')._main
- local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
- local yesno = require('Module:Yesno')
- -- Lazily initialise modules and objects we don't always need.
- local getArgs, makeMessageBox, lang
- -- Set constants.
- local CONFIG_MODULE = 'Module:Protection banner/config'
- --------------------------------------------------------------------------------
- -- Helper functions
- --------------------------------------------------------------------------------
- local function makeCategoryLink(cat, sort)
- if cat then
- return string.format(
- '[[%s:%s|%s]]',
- mw.site.namespaces[14].name,
- cat,
- sort
- )
- end
- end
- -- Validation function for the expiry and the protection date
- local function validateDate(dateString, dateType)
- if not lang then
- lang = mw.language.getContentLanguage()
- end
- local success, result = pcall(lang.formatDate, lang, 'U', dateString)
- if success then
- result = tonumber(result)
- if result then
- return result
- end
- end
- error(string.format(
- 'invalid %s: %s',
- dateType,
- tostring(dateString)
- ), 4)
- end
- local function makeFullUrl(page, query, display)
- return string.format(
- '[%s %s]',
- tostring(mw.uri.fullUrl(page, query)),
- display
- )
- end
- -- Given a directed graph formatted as node -> table of direct successors,
- -- get a table of all nodes reachable from a given node (though always
- -- including the given node).
- local function getReachableNodes(graph, start)
- local toWalk, retval = {[start] = true}, {}
- while true do
- -- Can't use pairs() since we're adding and removing things as we're iterating
- local k = next(toWalk) -- This always gets the "first" key
- if k == nil then
- return retval
- end
- toWalk[k] = nil
- retval[k] = true
- for _,v in ipairs(graph[k]) do
- if not retval[v] then
- toWalk[v] = true
- end
- end
- end
- end
- --------------------------------------------------------------------------------
- -- Protection class
- --------------------------------------------------------------------------------
- local Protection = {}
- Protection.__index = Protection
- Protection.supportedActions = {
- edit = true,
- move = true,
- autoreview = true,
- upload = true
- }
- Protection.bannerConfigFields = {
- 'text',
- 'explanation',
- 'tooltip',
- 'alt',
- 'link',
- 'image'
- }
- function Protection.new(args, cfg, title)
- local obj = {}
- obj._cfg = cfg
- obj.title = title or mw.title.getCurrentTitle()
- -- Set action
- if not args.action then
- obj.action = 'edit'
- elseif Protection.supportedActions[args.action] then
- obj.action = args.action
- else
- error(string.format(
- 'invalid action: %s',
- tostring(args.action)
- ), 3)
- end
- -- Set level
- obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
- if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
- -- Users need to be autoconfirmed to move pages anyway, so treat
- -- semi-move-protected pages as unprotected.
- obj.level = '*'
- end
- -- Set expiry
- local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
- if effectiveExpiry == 'infinity' then
- obj.expiry = 'indef'
- elseif effectiveExpiry ~= 'unknown' then
- obj.expiry = validateDate(effectiveExpiry, 'expiry date')
- end
- -- Set reason
- if args[1] then
- obj.reason = mw.ustring.lower(args[1])
- if obj.reason:find('|') then
- error('reasons cannot contain the pipe character ("|")', 3)
- end
- end
- -- Set protection date
- if args.date then
- obj.protectionDate = validateDate(args.date, 'protection date')
- end
- -- Set banner config
- do
- obj.bannerConfig = {}
- local configTables = {}
- if cfg.banners[obj.action] then
- configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
- end
- if cfg.defaultBanners[obj.action] then
- configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
- configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
- end
- configTables[#configTables + 1] = cfg.masterBanner
- for i, field in ipairs(Protection.bannerConfigFields) do
- for j, t in ipairs(configTables) do
- if t[field] then
- obj.bannerConfig[field] = t[field]
- break
- end
- end
- end
- end
- return setmetatable(obj, Protection)
- end
- function Protection:isProtected()
- return self.level ~= '*'
- end
- function Protection:isTemporary()
- return type(self.expiry) == 'number'
- end
- function Protection:makeProtectionCategory()
- local cfg = self._cfg
- local title = self.title
- -- Exit if the page is not protected.
- if not self:isProtected() then
- return ''
- end
- -- Get the expiry key fragment.
- local expiryFragment
- if self.expiry == 'indef' then
- expiryFragment = self.expiry
- elseif type(self.expiry) == 'number' then
- expiryFragment = 'temp'
- end
- -- Get the namespace key fragment.
- local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
- if not namespaceFragment and title.namespace % 2 == 1 then
- namespaceFragment = 'talk'
- end
- -- Define the order that key fragments are tested in. This is done with an
- -- array of tables containing the value to be tested, along with its
- -- position in the cfg.protectionCategories table.
- local order = {
- {val = expiryFragment, keypos = 1},
- {val = namespaceFragment, keypos = 2},
- {val = self.reason, keypos = 3},
- {val = self.level, keypos = 4},
- {val = self.action, keypos = 5}
- }
- --[[
- -- The old protection templates used an ad-hoc protection category system,
- -- with some templates prioritising namespaces in their categories, and
- -- others prioritising the protection reason. To emulate this in this module
- -- we use the config table cfg.reasonsWithNamespacePriority to set the
- -- reasons for which namespaces have priority over protection reason.
- -- If we are dealing with one of those reasons, move the namespace table to
- -- the end of the order table, i.e. give it highest priority. If not, the
- -- reason should have highest priority, so move that to the end of the table
- -- instead.
- --]]
- table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
- --[[
- -- Define the attempt order. Inactive subtables (subtables with nil "value"
- -- fields) are moved to the end, where they will later be given the key
- -- "all". This is to cut down on the number of table lookups in
- -- cfg.protectionCategories, which grows exponentially with the number of
- -- non-nil keys. We keep track of the number of active subtables with the
- -- noActive parameter.
- --]]
- local noActive, attemptOrder
- do
- local active, inactive = {}, {}
- for i, t in ipairs(order) do
- if t.val then
- active[#active + 1] = t
- else
- inactive[#inactive + 1] = t
- end
- end
- noActive = #active
- attemptOrder = active
- for i, t in ipairs(inactive) do
- attemptOrder[#attemptOrder + 1] = t
- end
- end
- --[[
- -- Check increasingly generic key combinations until we find a match. If a
- -- specific category exists for the combination of key fragments we are
- -- given, that match will be found first. If not, we keep trying different
- -- key fragment combinations until we match using the key
- -- "all-all-all-all-all".
- --
- -- To generate the keys, we index the key subtables using a binary matrix
- -- with indexes i and j. j is only calculated up to the number of active
- -- subtables. For example, if there were three active subtables, the matrix
- -- would look like this, with 0 corresponding to the key fragment "all", and
- -- 1 corresponding to other key fragments.
- --
- -- j 1 2 3
- -- i
- -- 1 1 1 1
- -- 2 0 1 1
- -- 3 1 0 1
- -- 4 0 0 1
- -- 5 1 1 0
- -- 6 0 1 0
- -- 7 1 0 0
- -- 8 0 0 0
- --
- -- Values of j higher than the number of active subtables are set
- -- to the string "all".
- --
- -- A key for cfg.protectionCategories is constructed for each value of i.
- -- The position of the value in the key is determined by the keypos field in
- -- each subtable.
- --]]
- local cats = cfg.protectionCategories
- for i = 1, 2^noActive do
- local key = {}
- for j, t in ipairs(attemptOrder) do
- if j > noActive then
- key[t.keypos] = 'all'
- else
- local quotient = i / 2 ^ (j - 1)
- quotient = math.ceil(quotient)
- if quotient % 2 == 1 then
- key[t.keypos] = t.val
- else
- key[t.keypos] = 'all'
- end
- end
- end
- key = table.concat(key, '|')
- local attempt = cats[key]
- if attempt then
- return makeCategoryLink(attempt, title.text)
- end
- end
- return ''
- end
- function Protection:isIncorrect()
- local expiry = self.expiry
- return not self:isProtected()
- or type(expiry) == 'number' and expiry < os.time()
- end
- function Protection:isTemplateProtectedNonTemplate()
- local action, namespace = self.action, self.title.namespace
- return self.level == 'templateeditor'
- and (
- (action ~= 'edit' and action ~= 'move')
- or (namespace ~= 10 and namespace ~= 828)
- )
- end
- function Protection:makeCategoryLinks()
- local msg = self._cfg.msg
- local ret = { self:makeProtectionCategory() }
- if self:isIncorrect() then
- ret[#ret + 1] = makeCategoryLink(
- msg['tracking-category-incorrect'],
- self.title.text
- )
- end
- if self:isTemplateProtectedNonTemplate() then
- ret[#ret + 1] = makeCategoryLink(
- msg['tracking-category-template'],
- self.title.text
- )
- end
- return table.concat(ret)
- end
- --------------------------------------------------------------------------------
- -- Blurb class
- --------------------------------------------------------------------------------
- local Blurb = {}
- Blurb.__index = Blurb
- Blurb.bannerTextFields = {
- text = true,
- explanation = true,
- tooltip = true,
- alt = true,
- link = true
- }
- function Blurb.new(protectionObj, args, cfg)
- return setmetatable({
- _cfg = cfg,
- _protectionObj = protectionObj,
- _args = args
- }, Blurb)
- end
- -- Private methods --
- function Blurb:_formatDate(num)
- -- Formats a Unix timestamp into dd Month, YYYY format.
- lang = lang or mw.language.getContentLanguage()
- local success, date = pcall(
- lang.formatDate,
- lang,
- self._cfg.msg['expiry-date-format'] or 'j F Y',
- '@' .. tostring(num)
- )
- if success then
- return date
- end
- end
- function Blurb:_getExpandedMessage(msgKey)
- return self:_substituteParameters(self._cfg.msg[msgKey])
- end
- function Blurb:_substituteParameters(msg)
- if not self._params then
- local parameterFuncs = {}
- parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
- parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
- parameterFuncs.EXPIRY = self._makeExpiryParameter
- parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
- parameterFuncs.IMAGELINK = self._makeImageLinkParameter
- parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
- parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
- parameterFuncs.PAGETYPE = self._makePagetypeParameter
- parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
- parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
- parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
- parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
- parameterFuncs.TALKPAGE = self._makeTalkPageParameter
- parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
- parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
- parameterFuncs.VANDAL = self._makeVandalTemplateParameter
- self._params = setmetatable({}, {
- __index = function (t, k)
- local param
- if parameterFuncs[k] then
- param = parameterFuncs[k](self)
- end
- param = param or ''
- t[k] = param
- return param
- end
- })
- end
- msg = msg:gsub('${(%u+)}', self._params)
- return msg
- end
- function Blurb:_makeCurrentVersionParameter()
- -- A link to the page history or the move log, depending on the kind of
- -- protection.
- local pagename = self._protectionObj.title.prefixedText
- if self._protectionObj.action == 'move' then
- -- We need the move log link.
- return makeFullUrl(
- 'Special:Log',
- {type = 'move', page = pagename},
- self:_getExpandedMessage('current-version-move-display')
- )
- else
- -- We need the history link.
- return makeFullUrl(
- pagename,
- {action = 'history'},
- self:_getExpandedMessage('current-version-edit-display')
- )
- end
- end
- function Blurb:_makeEditRequestParameter()
- local mEditRequest = require('Module:Submit an edit request')
- local action = self._protectionObj.action
- local level = self._protectionObj.level
- -- Get the edit request type.
- local requestType
- if action == 'edit' then
- if level == 'autoconfirmed' then
- requestType = 'semi'
- elseif level == 'extendedconfirmed' then
- requestType = 'extended'
- elseif level == 'templateeditor' then
- requestType = 'template'
- end
- end
- requestType = requestType or 'full'
- -- Get the display value.
- local display = self:_getExpandedMessage('edit-request-display')
- return mEditRequest._link{type = requestType, display = display}
- end
- function Blurb:_makeExpiryParameter()
- local expiry = self._protectionObj.expiry
- if type(expiry) == 'number' then
- return self:_formatDate(expiry)
- else
- return expiry
- end
- end
- function Blurb:_makeExplanationBlurbParameter()
- -- Cover special cases first.
- if self._protectionObj.title.namespace == 8 then
- -- MediaWiki namespace
- return self:_getExpandedMessage('explanation-blurb-nounprotect')
- end
- -- Get explanation blurb table keys
- local action = self._protectionObj.action
- local level = self._protectionObj.level
- local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
- -- Find the message in the explanation blurb table and substitute any
- -- parameters.
- local explanations = self._cfg.explanationBlurbs
- local msg
- if explanations[action][level] and explanations[action][level][talkKey] then
- msg = explanations[action][level][talkKey]
- elseif explanations[action][level] and explanations[action][level].default then
- msg = explanations[action][level].default
- elseif explanations[action].default and explanations[action].default[talkKey] then
- msg = explanations[action].default[talkKey]
- elseif explanations[action].default and explanations[action].default.default then
- msg = explanations[action].default.default
- else
- error(string.format(
- 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"',
- action,
- level,
- talkKey
- ), 8)
- end
- return self:_substituteParameters(msg)
- end
- function Blurb:_makeImageLinkParameter()
- local imageLinks = self._cfg.imageLinks
- local action = self._protectionObj.action
- local level = self._protectionObj.level
- local msg
- if imageLinks[action][level] then
- msg = imageLinks[action][level]
- elseif imageLinks[action].default then
- msg = imageLinks[action].default
- else
- msg = imageLinks.edit.default
- end
- return self:_substituteParameters(msg)
- end
- function Blurb:_makeIntroBlurbParameter()
- if self._protectionObj:isTemporary() then
- return self:_getExpandedMessage('intro-blurb-expiry')
- else
- return self:_getExpandedMessage('intro-blurb-noexpiry')
- end
- end
- function Blurb:_makeIntroFragmentParameter()
- if self._protectionObj:isTemporary() then
- return self:_getExpandedMessage('intro-fragment-expiry')
- else
- return self:_getExpandedMessage('intro-fragment-noexpiry')
- end
- end
- function Blurb:_makePagetypeParameter()
- local pagetypes = self._cfg.pagetypes
- return pagetypes[self._protectionObj.title.namespace]
- or pagetypes.default
- or error('no default pagetype defined', 8)
- end
- function Blurb:_makeProtectionBlurbParameter()
- local protectionBlurbs = self._cfg.protectionBlurbs
- local action = self._protectionObj.action
- local level = self._protectionObj.level
- local msg
- if protectionBlurbs[action][level] then
- msg = protectionBlurbs[action][level]
- elseif protectionBlurbs[action].default then
- msg = protectionBlurbs[action].default
- elseif protectionBlurbs.edit.default then
- msg = protectionBlurbs.edit.default
- else
- error('no protection blurb defined for protectionBlurbs.edit.default', 8)
- end
- return self:_substituteParameters(msg)
- end
- function Blurb:_makeProtectionDateParameter()
- local protectionDate = self._protectionObj.protectionDate
- if type(protectionDate) == 'number' then
- return self:_formatDate(protectionDate)
- else
- return protectionDate
- end
- end
- function Blurb:_makeProtectionLevelParameter()
- local protectionLevels = self._cfg.protectionLevels
- local action = self._protectionObj.action
- local level = self._protectionObj.level
- local msg
- if protectionLevels[action][level] then
- msg = protectionLevels[action][level]
- elseif protectionLevels[action].default then
- msg = protectionLevels[action].default
- elseif protectionLevels.edit.default then
- msg = protectionLevels.edit.default
- else
- error('no protection level defined for protectionLevels.edit.default', 8)
- end
- return self:_substituteParameters(msg)
- end
- function Blurb:_makeProtectionLogParameter()
- local pagename = self._protectionObj.title.prefixedText
- if self._protectionObj.action == 'autoreview' then
- -- We need the pending changes log.
- return makeFullUrl(
- 'Special:Log',
- {type = 'stable', page = pagename},
- self:_getExpandedMessage('pc-log-display')
- )
- else
- -- We need the protection log.
- return makeFullUrl(
- 'Special:Log',
- {type = 'protect', page = pagename},
- self:_getExpandedMessage('protection-log-display')
- )
- end
- end
- function Blurb:_makeTalkPageParameter()
- return string.format(
- '[[%s:%s#%s|%s]]',
- mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
- self._protectionObj.title.text,
- self._args.section or 'top',
- self:_getExpandedMessage('talk-page-link-display')
- )
- end
- function Blurb:_makeTooltipBlurbParameter()
- if self._protectionObj:isTemporary() then
- return self:_getExpandedMessage('tooltip-blurb-expiry')
- else
- return self:_getExpandedMessage('tooltip-blurb-noexpiry')
- end
- end
- function Blurb:_makeTooltipFragmentParameter()
- if self._protectionObj:isTemporary() then
- return self:_getExpandedMessage('tooltip-fragment-expiry')
- else
- return self:_getExpandedMessage('tooltip-fragment-noexpiry')
- end
- end
- function Blurb:_makeVandalTemplateParameter()
- return require('Module:Vandal-m')._main{
- self._args.user or self._protectionObj.title.baseText
- }
- end
- -- Public methods --
- function Blurb:makeBannerText(key)
- -- Validate input.
- if not key or not Blurb.bannerTextFields[key] then
- error(string.format(
- '"%s" is not a valid banner config field',
- tostring(key)
- ), 2)
- end
- -- Generate the text.
- local msg = self._protectionObj.bannerConfig[key]
- if type(msg) == 'string' then
- return self:_substituteParameters(msg)
- elseif type(msg) == 'function' then
- msg = msg(self._protectionObj, self._args)
- if type(msg) ~= 'string' then
- error(string.format(
- 'bad output from banner config function with key "%s"'
- .. ' (expected string, got %s)',
- tostring(key),
- type(msg)
- ), 4)
- end
- return self:_substituteParameters(msg)
- end
- end
- --------------------------------------------------------------------------------
- -- BannerTemplate class
- --------------------------------------------------------------------------------
- local BannerTemplate = {}
- BannerTemplate.__index = BannerTemplate
- function BannerTemplate.new(protectionObj, cfg)
- local obj = {}
- obj._cfg = cfg
- -- Set the image filename.
- local imageFilename = protectionObj.bannerConfig.image
- if imageFilename then
- obj._imageFilename = imageFilename
- else
- -- If an image filename isn't specified explicitly in the banner config,
- -- generate it from the protection status and the namespace.
- local action = protectionObj.action
- local level = protectionObj.level
- local namespace = protectionObj.title.namespace
- local reason = protectionObj.reason
- -- Deal with special cases first.
- if (
- namespace == 10
- or namespace == 828
- or reason and obj._cfg.indefImageReasons[reason]
- )
- and action == 'edit'
- and level == 'sysop'
- and not protectionObj:isTemporary()
- then
- -- Fully protected modules and templates get the special red "indef"
- -- padlock.
- obj._imageFilename = obj._cfg.msg['image-filename-indef']
- else
- -- Deal with regular protection types.
- local images = obj._cfg.images
- if images[action] then
- if images[action][level] then
- obj._imageFilename = images[action][level]
- elseif images[action].default then
- obj._imageFilename = images[action].default
- end
- end
- end
- end
- return setmetatable(obj, BannerTemplate)
- end
- function BannerTemplate:renderImage()
- local filename = self._imageFilename
- or self._cfg.msg['image-filename-default']
- or 'Transparent.gif'
- return makeFileLink{
- file = filename,
- size = (self.imageWidth or 20) .. 'px',
- alt = self._imageAlt,
- link = self._imageLink,
- caption = self.imageCaption
- }
- end
- --------------------------------------------------------------------------------
- -- Banner class
- --------------------------------------------------------------------------------
- local Banner = setmetatable({}, BannerTemplate)
- Banner.__index = Banner
- function Banner.new(protectionObj, blurbObj, cfg)
- local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
- obj.imageWidth = 40
- obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
- obj._reasonText = blurbObj:makeBannerText('text')
- obj._explanationText = blurbObj:makeBannerText('explanation')
- obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
- return setmetatable(obj, Banner)
- end
- function Banner:__tostring()
- -- Renders the banner.
- makeMessageBox = makeMessageBox or require('Module:Message box').main
- local reasonText = self._reasonText or error('no reason text set', 2)
- local explanationText = self._explanationText
- local mbargs = {
- page = self._page,
- type = 'protection',
- image = self:renderImage(),
- text = string.format(
- "'''%s'''%s",
- reasonText,
- explanationText and '<br />' .. explanationText or ''
- )
- }
- return makeMessageBox('mbox', mbargs)
- end
- --------------------------------------------------------------------------------
- -- Padlock class
- --------------------------------------------------------------------------------
- local Padlock = setmetatable({}, BannerTemplate)
- Padlock.__index = Padlock
- function Padlock.new(protectionObj, blurbObj, cfg)
- local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
- obj.imageWidth = 20
- obj.imageCaption = blurbObj:makeBannerText('tooltip')
- obj._imageAlt = blurbObj:makeBannerText('alt')
- obj._imageLink = blurbObj:makeBannerText('link')
- obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
- or cfg.padlockIndicatorNames.default
- or 'pp-default'
- return setmetatable(obj, Padlock)
- end
- function Padlock:__tostring()
- local frame = mw.getCurrentFrame()
- -- The nowiki tag helps prevent whitespace at the top of articles.
- return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
- name = 'indicator',
- args = {name = self._indicatorName},
- content = self:renderImage()
- }
- end
- --------------------------------------------------------------------------------
- -- Exports
- --------------------------------------------------------------------------------
- local p = {}
- function p._exportClasses()
- -- This is used for testing purposes.
- return {
- Protection = Protection,
- Blurb = Blurb,
- BannerTemplate = BannerTemplate,
- Banner = Banner,
- Padlock = Padlock,
- }
- end
- function p._main(args, cfg, title)
- args = args or {}
- cfg = cfg or require(CONFIG_MODULE)
- local protectionObj = Protection.new(args, cfg, title)
- local ret = {}
- -- If a page's edit protection is equally or more restrictive than its
- -- protection from some other action, then don't bother displaying anything
- -- for the other action (except categories).
- if protectionObj.action == 'edit' or
- args.demolevel or
- not getReachableNodes(
- cfg.hierarchy,
- protectionObj.level
- )[effectiveProtectionLevel('edit', protectionObj.title)]
- then
- -- Initialise the blurb object
- local blurbObj = Blurb.new(protectionObj, args, cfg)
- -- Render the banner
- if protectionObj:isProtected() then
- ret[#ret + 1] = tostring(
- (yesno(args.small) and Padlock or Banner)
- .new(protectionObj, blurbObj, cfg)
- )
- end
- end
- -- Render the categories
- if yesno(args.category) ~= false then
- ret[#ret + 1] = protectionObj:makeCategoryLinks()
- end
- return table.concat(ret)
- end
- function p.main(frame, cfg)
- cfg = cfg or require(CONFIG_MODULE)
- -- Find default args, if any.
- local parent = frame.getParent and frame:getParent()
- local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
- -- Find user args, and use the parent frame if we are being called from a
- -- wrapper template.
- getArgs = getArgs or require('Module:Arguments').getArgs
- local userArgs = getArgs(frame, {
- parentOnly = defaultArgs,
- frameOnly = not defaultArgs
- })
- -- Build the args table. User-specified args overwrite default args.
- local args = {}
- for k, v in pairs(defaultArgs or {}) do
- args[k] = v
- end
- for k, v in pairs(userArgs) do
- args[k] = v
- end
- return p._main(args, cfg)
- end
- return p</text>
- <sha1>ice162y8kua930ie41kredxjaxhzy3y</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Protection banner/config</title>
- <ns>828</ns>
- <id>42982788</id>
- <revision>
- <id>844849478</id>
- <parentid>844429869</parentid>
- <timestamp>2018-06-07T15:55:40Z</timestamp>
- <contributor>
- <username>SMcCandlish</username>
- <id>378390</id>
- </contributor>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="46786">-- This module provides configuration data for [[Module:Protection banner]].
- return {
- --------------------------------------------------------------------------------
- --
- -- BANNER DATA
- --
- --------------------------------------------------------------------------------
- --[[
- -- Banner data consists of six fields:
- -- * text - the main protection text that appears at the top of protection
- -- banners.
- -- * explanation - the text that appears below the main protection text, used
- -- to explain the details of the protection.
- -- * tooltip - the tooltip text you see when you move the mouse over a small
- -- padlock icon.
- -- * link - the page that the small padlock icon links to.
- -- * alt - the alt text for the small padlock icon. This is also used as tooltip
- -- text for the large protection banners.
- -- * image - the padlock image used in both protection banners and small padlock
- -- icons.
- --
- -- The module checks in three separate tables to find a value for each field.
- -- First it checks the banners table, which has values specific to the reason
- -- for the page being protected. Then the module checks the defaultBanners
- -- table, which has values specific to each protection level. Finally, the
- -- module checks the masterBanner table, which holds data for protection
- -- templates to use if no data has been found in the previous two tables.
- --
- -- The values in the banner data can take parameters. These are specified
- -- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
- -- enclosed in curly braces).
- --
- -- Available parameters:
- --
- -- ${CURRENTVERSION} - a link to the page history or the move log, with the
- -- display message "current-version-edit-display" or
- -- "current-version-move-display".
- --
- -- ${EDITREQUEST} - a link to create an edit request for the current page.
- --
- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes
- -- on the talk page; you may submit a request to ask an administrator to make
- -- an edit if it is minor or supported by consensus."
- --
- -- ${IMAGELINK} - a link to set the image to, depending on the protection
- -- action and protection level.
- --
- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
- -- is set. E.g. "Editing of this page by new or unregistered users is currently
- -- disabled until dd Month YYYY."
- --
- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
- -- so that it can be used in run-on sentences.
- --
- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template".
- -- Defined in the cfg.pagetypes table.
- --
- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
- -- "Editing of this page by new or unregistered users is currently disabled"
- --
- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
- -- template.
- --
- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or
- -- "semi-protected".
- --
- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
- -- depending on the protection action.
- --
- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links
- -- straight to that talk page section.
- --
- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
- -- create a blurb like "This template is semi-protected", or "This article is
- -- move-protected until DD Month YYYY".
- --
- -- ${VANDAL} - links for the specified username (or the root page name)
- -- using Module:Vandal-m.
- --
- -- Functions
- --
- -- For advanced users, it is possible to use Lua functions instead of strings
- -- in the banner config tables. Using functions gives flexibility that is not
- -- possible just by using parameters. Functions take two arguments, the
- -- protection object and the template arguments, and they must output a string.
- --
- -- For example:
- --
- -- text = function (protectionObj, args)
- -- if protectionObj.level == 'autoconfirmed' then
- -- return 'foo'
- -- else
- -- return 'bar'
- -- end
- -- end
- --
- -- Some protection object properties and methods that may be useful:
- -- protectionObj.action - the protection action
- -- protectionObj.level - the protection level
- -- protectionObj.reason - the protection reason
- -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set
- -- to indefinite, and the protection time in unix time if temporary.
- -- protectionObj.protectionDate - the protection date in unix time, or nil if
- -- unspecified.
- -- protectionObj.bannerConfig - the banner config found by the module. Beware
- -- of editing the config field used by the function, as it could create an
- -- infinite loop.
- -- protectionObj:isProtected - returns a boolean showing whether the page is
- -- protected.
- -- protectionObj:isTemporary - returns a boolean showing whether the expiry is
- -- temporary.
- -- protectionObj:isIncorrect - returns a boolean showing whether the protection
- -- template is incorrect.
- --]]
- -- The master banner data, used if no values have been found in banners or
- -- defaultBanners.
- masterBanner = {
- text = '${INTROBLURB}',
- explanation = '${EXPLANATIONBLURB}',
- tooltip = '${TOOLTIPBLURB}',
- link = '${IMAGELINK}',
- alt = 'Page ${PROTECTIONLEVEL}'
- },
- -- The default banner data. This holds banner data for different protection
- -- levels.
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- defaultBanners = {
- edit = {},
- move = {},
- autoreview = {
- autoconfirmed = {
- alt = 'Page protected with pending changes level 1',
- tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
- image = 'Padlock-silver-light.svg'
- },
- default = {
- alt = 'Page protected with pending changes level 2',
- tooltip = 'All edits by users who are not reviewers or administrators are'
- .. ' subject to review prior to becoming visible to unregistered users',
- image = 'Padlock-orange.svg'
- }
- },
- upload = {}
- },
- -- The banner data. This holds banner data for different protection reasons.
- -- In fact, the reasons specified in this table control which reasons are
- -- valid inputs to the first positional parameter.
- --
- -- There is also a non-standard "description" field that can be used for items
- -- in this table. This is a description of the protection reason for use in the
- -- module documentation.
- --
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- banners = {
- edit = {
- blp = {
- description = 'For pages protected to promote compliance with the'
- .. ' [[Wikipedia:Biographies of living persons'
- .. '|biographies of living persons]] policy',
- text = '${INTROFRAGMENT} to promote compliance with'
- .. ' [[Wikipedia:Biographies of living persons'
- .. "|Wikipedia's&nbsp;policy on&nbsp;the&nbsp;biographies"
- .. ' of&nbsp;living&nbsp;people]].',
- tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
- .. ' biographies of living people',
- },
- dmca = {
- description = 'For pages protected by the Wikimedia Foundation'
- .. ' due to [[Digital Millennium Copyright Act]] takedown requests',
- explanation = function (protectionObj, args)
- local ret = 'Pursuant to a rights owner notice under the Digital'
- .. ' Millennium Copyright Act (DMCA) regarding some content'
- .. ' in this article, the Wikimedia Foundation acted under'
- .. ' applicable law and took down and restricted the content'
- .. ' in question.'
- if args.notice then
- ret = ret .. ' A copy of the received notice can be found here: '
- .. args.notice .. '.'
- end
- ret = ret .. ' For more information, including websites discussing'
- .. ' how to file a counter-notice, please see'
- .. " [[Wikipedia:Office actions]] and the article's ${TALKPAGE}."
- .. "'''Do not remove this template from the article until the"
- .. " restrictions are withdrawn'''."
- return ret
- end,
- image = 'Padlock-black.svg',
- },
- dispute = {
- description = 'For pages protected due to editing disputes',
- text = function (protectionObj, args)
- -- Find the value of "disputes".
- local display = 'disputes'
- local disputes
- if args.section then
- disputes = string.format(
- '[[%s:%s#%s|%s]]',
- mw.site.namespaces[protectionObj.title.namespace].talk.name,
- protectionObj.title.text,
- args.section,
- display
- )
- else
- disputes = display
- end
- -- Make the blurb, depending on the expiry.
- local msg
- if type(protectionObj.expiry) == 'number' then
- msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
- else
- msg = '${INTROFRAGMENT} until editing %s have been resolved.'
- end
- return string.format(msg, disputes)
- end,
- explanation = "This protection is '''not''' an endorsement of the"
- .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
- tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
- },
- ecp = {
- description = 'For articles in topic areas authorized by'
- .. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
- .. ' meets the criteria for community use',
- tooltip = 'This ${PAGETYPE} is extended-confirmed protected',
- alt = 'Extended-protected ${PAGETYPE}',
- },
- mainpage = {
- description = 'For pages protected for being displayed on the [[Main Page]]',
- text = 'This file is currently'
- .. ' [[Wikipedia:This page is protected|protected]] from'
- .. ' editing because it is currently or will soon be displayed'
- .. ' on the [[Main Page]].',
- explanation = 'Images on the Main Page are protected due to their high'
- .. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
- .. '<br /><span style="font-size:90%;">'
- .. "'''Administrators:''' Once this image is definitely off the Main Page,"
- .. ' please unprotect this file, or reduce to semi-protection,'
- .. ' as appropriate.</span>',
- },
- office = {
- description = 'For pages protected by the Wikimedia Foundation',
- text = function (protectionObj, args)
- local ret = 'This ${PAGETYPE} is currently under the'
- .. ' scrutiny of the'
- .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
- .. ' and is protected.'
- if protectionObj.protectionDate then
- ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
- end
- return ret
- end,
- explanation = "If you can edit this page, please discuss all changes and"
- .. " additions on the ${TALKPAGE} first. '''Do not remove protection from this"
- .. " page unless you are authorized by the Wikimedia Foundation to do"
- .. " so.'''",
- image = 'Padlock-black.svg',
- },
- reset = {
- description = 'For pages protected by the Wikimedia Foundation and'
- .. ' "reset" to a bare-bones version',
- text = 'This ${PAGETYPE} is currently under the'
- .. ' scrutiny of the'
- .. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
- .. ' and is protected.',
- explanation = function (protectionObj, args)
- local ret = ''
- if protectionObj.protectionDate then
- ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
- else
- ret = ret .. 'This ${PAGETYPE} has been'
- end
- ret = ret .. ' reduced to a'
- .. ' simplified, "bare bones" version so that it may be completely'
- .. ' rewritten to ensure it meets the policies of'
- .. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
- .. ' Standard Wikipedia policies will apply to its rewriting—which'
- .. ' will eventually be open to all editors—and will be strictly'
- .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
- .. ' it is being rebuilt.\n\n'
- .. 'Any insertion of material directly from'
- .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
- .. ' will any material added to the ${PAGETYPE} that is not properly'
- .. ' sourced. The associated talk page(s) were also cleared on the'
- .. " same date.\n\n"
- .. "If you can edit this page, please discuss all changes and"
- .. " additions on the ${TALKPAGE} first. '''Do not override"
- .. " this action, and do not remove protection from this page,"
- .. " unless you are authorized by the Wikimedia Foundation"
- .. " to do so. No editor may remove this notice.'''"
- return ret
- end,
- image = 'Padlock-black.svg',
- },
- sock = {
- description = 'For pages protected due to'
- .. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
- text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
- .. ' [[Wikipedia:Blocking policy|blocked]] or'
- .. ' [[Wikipedia:Banning policy|banned users]]'
- .. ' from editing it.',
- tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
- .. ' editing it',
- },
- template = {
- description = 'For [[Wikipedia:High-risk templates|high-risk]]'
- .. ' templates and Lua modules',
- text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
- .. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
- explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
- .. ' ${EDITREQUEST} to ask an'
- .. ' [[Wikipedia:Administrators|administrator]] or'
- .. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
- .. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
- .. '|uncontroversial]] or supported by'
- .. ' [[Wikipedia:Consensus|consensus]]. You can also'
- .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
- .. ' unprotected.',
- tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
- .. ' to prevent vandalism',
- alt = 'Permanently protected ${PAGETYPE}',
- },
- usertalk = {
- description = 'For pages protected against disruptive edits by a'
- .. ' particular user',
- text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
- .. ' such as abusing the'
- .. ' &#123;&#123;[[Template:unblock|unblock]]&#125;&#125; template.',
- explanation = 'If you cannot edit this user talk page and you need to'
- .. ' make a change or leave a message, you can'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for edits to a protected page'
- .. '|request an edit]],'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for reduction in protection level'
- .. '|request unprotection]],'
- .. ' [[Special:Userlogin|log in]],'
- .. ' or [[Special:UserLogin/signup|create an account]].',
- },
- vandalism = {
- description = 'For pages protected against'
- .. ' [[Wikipedia:Vandalism|vandalism]]',
- text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
- explanation = function (protectionObj, args)
- local ret = ''
- if protectionObj.level == 'sysop' then
- ret = ret .. "This protection is '''not''' an endorsement of the"
- .. ' ${CURRENTVERSION}. '
- end
- return ret .. '${EXPLANATIONBLURB}'
- end,
- tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
- }
- },
- move = {
- dispute = {
- description = 'For pages protected against page moves due to'
- .. ' disputes over the page title',
- explanation = "This protection is '''not''' an endorsement of the"
- .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
- image = 'Padlock-olive.svg'
- },
- vandalism = {
- description = 'For pages protected against'
- .. ' [[Wikipedia:Vandalism#Page-move vandalism'
- .. ' |page-move vandalism]]'
- }
- },
- autoreview = {},
- upload = {}
- },
- --------------------------------------------------------------------------------
- --
- -- GENERAL DATA TABLES
- --
- --------------------------------------------------------------------------------
- --------------------------------------------------------------------------------
- -- Protection blurbs
- --------------------------------------------------------------------------------
- -- This table produces the protection blurbs available with the
- -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
- -- protection level, and is checked by the module in the following order:
- -- 1. page's protection action, page's protection level
- -- 2. page's protection action, default protection level
- -- 3. "edit" protection action, default protection level
- --
- -- It is possible to use banner parameters inside this table.
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- protectionBlurbs = {
- edit = {
- default = 'This ${PAGETYPE} is currently [[Help:Protection|'
- .. 'protected]] from editing',
- autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
- .. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
- .. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
- extendedconfirmed = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} as a result of'
- .. ' [[Wikipedia:Arbitration Committee|ArbCom]] enforcement or meets the'
- .. ' [[Wikipedia:Protection policy#extended|criteria for community use]]',
- },
- move = {
- default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
- .. ' from [[Help:Moving a page|page moves]]'
- },
- autoreview = {
- autoconfirmed = 'All edits made to this ${PAGETYPE} by'
- .. ' [[Wikipedia:User access levels#New users|new]] or'
- .. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
- .. ' users are currently'
- .. ' [[Wikipedia:Pending changes|subject to review]]',
- default = 'All edits made to this ${PAGETYPE} by users who are not'
- .. ' [[Wikipedia:Reviewing|reviewers]] or'
- .. ' [[Wikipedia:Administrators|administrators]] are currently'
- .. ' [[Wikipedia:Pending changes|subject to review]]'
- },
- upload = {
- default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
- }
- },
- --------------------------------------------------------------------------------
- -- Explanation blurbs
- --------------------------------------------------------------------------------
- -- This table produces the explanation blurbs available with the
- -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
- -- protection level, and whether the page is a talk page or not. If the page is
- -- a talk page it will have a talk key of "talk"; otherwise it will have a talk
- -- key of "subject". The table is checked in the following order:
- -- 1. page's protection action, page's protection level, page's talk key
- -- 2. page's protection action, page's protection level, default talk key
- -- 3. page's protection action, default protection level, page's talk key
- -- 4. page's protection action, default protection level, default talk key
- --
- -- It is possible to use banner parameters inside this table.
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- explanationBlurbs = {
- edit = {
- autoconfirmed = {
- subject = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
- .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
- .. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for reduction in protection level'
- .. '|request unprotection]], [[Special:Userlogin|log in]], or'
- .. ' [[Special:UserLogin/signup|create an account]].',
- default = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
- .. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for reduction in protection level'
- .. '|request unprotection]], [[Special:Userlogin|log in]], or'
- .. ' [[Special:UserLogin/signup|create an account]].',
- },
- extendedconfirmed = {
- default = 'Extended confirmed protection prevents edits from all IP editors'
- .. ' and registered users with fewer than 30 days tenure and 500 edits.'
- .. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
- .. ' specifies that extended confirmed protection can be applied to combat'
- .. ' disruption, if semi-protection has proven to be ineffective.'
- .. ' Please discuss any changes on the ${TALKPAGE}; you may'
- .. ' ${EDITREQUEST} to ask for unconversial changes supported by'
- .. ' [[Wikipedia:Consensus|consensus]].'
- },
- default = {
- subject = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' Please discuss any changes on the ${TALKPAGE}; you'
- .. ' may ${EDITREQUEST} to ask an'
- .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
- .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
- .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
- .. '|consensus]]. You may also [[Wikipedia:Requests for'
- .. ' page protection#Current requests for reduction in protection level'
- .. '|request]] that this page be unprotected.',
- default = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' You may [[Wikipedia:Requests for page'
- .. ' protection#Current requests for edits to a protected page|request an'
- .. ' edit]] to this page, or [[Wikipedia:Requests for'
- .. ' page protection#Current requests for reduction in protection level'
- .. '|ask]] for it to be unprotected.'
- }
- },
- move = {
- default = {
- subject = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' The page may still be edited but cannot be moved'
- .. ' until unprotected. Please discuss any suggested moves on the'
- .. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
- .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
- .. ' unprotected.',
- default = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' The page may still be edited but cannot be moved'
- .. ' until unprotected. Please discuss any suggested moves at'
- .. ' [[Wikipedia:Requested moves]]. You can also'
- .. ' [[Wikipedia:Requests for page protection|request]] that the page be'
- .. ' unprotected.'
- }
- },
- autoreview = {
- default = {
- reviewer = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' Edits to this ${PAGETYPE} will not be visible to readers'
- .. ' until they are accepted by a reviewer or an administrator.'
- .. ' To avoid the need for your edits to be reviewed, you may'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for reduction in protection level'
- .. '|request unprotection]]. Experienced editors may also'
- .. ' request the [[Wikipedia:Reviewing|reviewer user right]].',
- default = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' Edits to this ${PAGETYPE} by new and unregistered users'
- .. ' will not be visible to readers until they are accepted by'
- .. ' a reviewer. To avoid the need for your edits to be'
- .. ' reviewed, you may'
- .. ' [[Wikipedia:Requests for page protection'
- .. '#Current requests for reduction in protection level'
- .. '|request unprotection]], [[Special:Userlogin|log in]], or'
- .. ' [[Special:UserLogin/signup|create an account]].'
- },
- },
- upload = {
- default = {
- default = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' The page may still be edited but new versions of the file'
- .. ' cannot be uploaded until it is unprotected. You can'
- .. ' request that a new version be uploaded by using a'
- .. ' [[Wikipedia:Edit requests|protected edit request]], or you'
- .. ' can [[Wikipedia:Requests for page protection|request]]'
- .. ' that the file be unprotected.'
- }
- }
- },
- --------------------------------------------------------------------------------
- -- Protection levels
- --------------------------------------------------------------------------------
- -- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
- -- produces a short label for different protection levels. It is sorted by
- -- protection action and protection level, and is checked in the following
- -- order:
- -- 1. page's protection action, page's protection level
- -- 2. page's protection action, default protection level
- -- 3. "edit" protection action, default protection level
- --
- -- It is possible to use banner parameters inside this table.
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- protectionLevels = {
- edit = {
- default = 'protected',
- templateeditor = 'template-protected',
- extendedconfirmed = 'extended-protected',
- autoconfirmed = 'semi-protected',
- },
- move = {
- default = 'move-protected'
- },
- autoreview = {
- },
- upload = {
- default = 'upload-protected'
- }
- },
- --------------------------------------------------------------------------------
- -- Images
- --------------------------------------------------------------------------------
- -- This table lists different padlock images for each protection action and
- -- protection level. It is used if an image is not specified in any of the
- -- banner data tables, and if the page does not satisfy the conditions for using
- -- the ['image-filename-indef'] image. It is checked in the following order:
- -- 1. page's protection action, page's protection level
- -- 2. page's protection action, default protection level
- images = {
- edit = {
- default = 'Padlock.svg',
- templateeditor = 'Padlock-pink.svg',
- extendedconfirmed = 'Padlock-blue.svg',
- autoconfirmed = 'Padlock-silver.svg'
- },
- move = {
- default = 'Padlock-olive.svg',
- },
- autoreview = {
- autoconfirmed = 'Padlock-silver-light.svg',
- default = 'Padlock-orange.svg'
- },
- upload = {
- default = 'Padlock-purple.svg'
- }
- },
- -- Pages with a reason specified in this table will show the special "indef"
- -- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
- indefImageReasons = {
- template = true
- },
- --------------------------------------------------------------------------------
- -- Image links
- --------------------------------------------------------------------------------
- -- This table provides the data for the ${IMAGELINK} parameter, which gets
- -- the image link for small padlock icons based on the page's protection action
- -- and protection level. It is checked in the following order:
- -- 1. page's protection action, page's protection level
- -- 2. page's protection action, default protection level
- -- 3. "edit" protection action, default protection level
- --
- -- It is possible to use banner parameters inside this table.
- -- *required* - this table needs edit, move, autoreview and upload subtables.
- imageLinks = {
- edit = {
- default = 'Wikipedia:Protection policy#full',
- templateeditor = 'Wikipedia:Protection policy#template',
- extendedconfirmed = 'Wikipedia:Protection policy#extended',
- autoconfirmed = 'Wikipedia:Protection policy#semi'
- },
- move = {
- default = 'Wikipedia:Protection policy#move'
- },
- autoreview = {
- autoconfirmed = 'Wikipedia:Protection policy#pc1',
- reviewer = 'Wikipedia:Protection policy#pc2'
- },
- upload = {
- default = 'Wikipedia:Protection policy#upload'
- }
- },
- --------------------------------------------------------------------------------
- -- Padlock indicator names
- --------------------------------------------------------------------------------
- -- This table provides the "name" attribute for the <indicator> extension tag
- -- with which small padlock icons are generated. All indicator tags on a page
- -- are displayed in alphabetical order based on this attribute, and with
- -- indicator tags with duplicate names, the last tag on the page wins.
- -- The attribute is chosen based on the protection action; table keys must be a
- -- protection action name or the string "default".
- padlockIndicatorNames = {
- autoreview = 'pp-autoreview',
- default = 'pp-default'
- },
- --------------------------------------------------------------------------------
- -- Protection categories
- --------------------------------------------------------------------------------
- --[[
- -- The protection categories are stored in the protectionCategories table.
- -- Keys to this table are made up of the following strings:
- --
- -- 1. the expiry date
- -- 2. the namespace
- -- 3. the protection reason (e.g. "dispute" or "vandalism")
- -- 4. the protection level (e.g. "sysop" or "autoconfirmed")
- -- 5. the action (e.g. "edit" or "move")
- --
- -- When the module looks up a category in the table, first it will will check to
- -- see a key exists that corresponds to all five parameters. For example, a
- -- user page semi-protected from vandalism for two weeks would have the key
- -- "temp-user-vandalism-autoconfirmed-edit". If no match is found, the module
- -- changes the first part of the key to "all" and checks the table again. It
- -- keeps checking increasingly generic key combinations until it finds the
- -- field, or until it reaches the key "all-all-all-all-all".
- --
- -- The module uses a binary matrix to determine the order in which to search.
- -- This is best demonstrated by a table. In this table, the "0" values
- -- represent "all", and the "1" values represent the original data (e.g.
- -- "indef" or "file" or "vandalism").
- --
- -- expiry namespace reason level action
- -- order
- -- 1 1 1 1 1 1
- -- 2 0 1 1 1 1
- -- 3 1 0 1 1 1
- -- 4 0 0 1 1 1
- -- 5 1 1 0 1 1
- -- 6 0 1 0 1 1
- -- 7 1 0 0 1 1
- -- 8 0 0 0 1 1
- -- 9 1 1 1 0 1
- -- 10 0 1 1 0 1
- -- 11 1 0 1 0 1
- -- 12 0 0 1 0 1
- -- 13 1 1 0 0 1
- -- 14 0 1 0 0 1
- -- 15 1 0 0 0 1
- -- 16 0 0 0 0 1
- -- 17 1 1 1 1 0
- -- 18 0 1 1 1 0
- -- 19 1 0 1 1 0
- -- 20 0 0 1 1 0
- -- 21 1 1 0 1 0
- -- 22 0 1 0 1 0
- -- 23 1 0 0 1 0
- -- 24 0 0 0 1 0
- -- 25 1 1 1 0 0
- -- 26 0 1 1 0 0
- -- 27 1 0 1 0 0
- -- 28 0 0 1 0 0
- -- 29 1 1 0 0 0
- -- 30 0 1 0 0 0
- -- 31 1 0 0 0 0
- -- 32 0 0 0 0 0
- --
- -- In this scheme the action has the highest priority, as it is the last
- -- to change, and the expiry has the least priority, as it changes the most.
- -- The priorities of the expiry, the protection level and the action are
- -- fixed, but the priorities of the reason and the namespace can be swapped
- -- through the use of the cfg.bannerDataNamespaceHasPriority table.
- --]]
- -- If the reason specified to the template is listed in this table,
- -- namespace data will take priority over reason data in the protectionCategories
- -- table.
- reasonsWithNamespacePriority = {
- vandalism = true,
- },
- -- The string to use as a namespace key for the protectionCategories table for each
- -- namespace number.
- categoryNamespaceKeys = {
- [ 2] = 'user',
- [ 3] = 'user',
- [ 4] = 'project',
- [ 6] = 'file',
- [ 8] = 'mediawiki',
- [ 10] = 'template',
- [ 12] = 'project',
- [ 14] = 'category',
- [100] = 'portal',
- [828] = 'module',
- },
- protectionCategories = {
- ['all|all|all|all|all'] = 'Wikipedia fully protected pages',
- ['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
- ['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
- ['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
- ['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files',
- ['all|all|all|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
- ['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
- ['all|template|all|all|edit'] = 'Wikipedia fully-protected templates',
- ['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
- ['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
- ['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
- ['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
- ['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
- ['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
- ['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
- ['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
- ['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
- ['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
- ['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
- ['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
- ['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
- ['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
- ['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
- ['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
- ['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
- ['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
- ['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
- ['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
- ['all|category|all|sysop|edit'] = 'Wikipedia protected categories',
- ['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files',
- ['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages',
- ['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages',
- ['all|template|all|sysop|edit'] = 'Wikipedia fully-protected templates',
- ['all|user|all|sysop|edit'] = 'Wikipedia protected user and user talk pages',
- ['all|module|all|all|edit'] = 'Wikipedia fully-protected modules',
- ['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
- ['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
- ['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
- ['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
- ['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
- ['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
- ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
- ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
- ['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
- ['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
- ['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
- ['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
- ['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
- ['all|all|all|reviewer|autoreview'] = 'Wikipedia pending changes protected pages (level 2)',
- ['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
- },
- --------------------------------------------------------------------------------
- -- Expiry category config
- --------------------------------------------------------------------------------
- -- This table configures the expiry category behaviour for each protection
- -- action.
- -- * If set to true, setting that action will always categorise the page if
- -- an expiry parameter is not set.
- -- * If set to false, setting that action will never categorise the page.
- -- * If set to nil, the module will categorise the page if:
- -- 1) an expiry parameter is not set, and
- -- 2) a reason is provided, and
- -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
- -- table.
- expiryCheckActions = {
- edit = nil,
- move = false,
- autoreview = true,
- upload = false
- },
- reasonsWithoutExpiryCheck = {
- blp = true,
- template = true,
- },
- --------------------------------------------------------------------------------
- -- Pagetypes
- --------------------------------------------------------------------------------
- -- This table produces the page types available with the ${PAGETYPE} parameter.
- -- Keys are namespace numbers, or the string "default" for the default value.
- pagetypes = {
- [0] = 'article',
- [6] = 'file',
- [10] = 'template',
- [14] = 'category',
- [828] = 'module',
- default = 'page'
- },
- --------------------------------------------------------------------------------
- -- Strings marking indefinite protection
- --------------------------------------------------------------------------------
- -- This table contains values passed to the expiry parameter that mean the page
- -- is protected indefinitely.
- indefStrings = {
- ['indef'] = true,
- ['indefinite'] = true,
- ['indefinitely'] = true,
- ['infinite'] = true,
- },
- --------------------------------------------------------------------------------
- -- Group hierarchy
- --------------------------------------------------------------------------------
- -- This table maps each group to all groups that have a superset of the original
- -- group's page editing permissions.
- hierarchy = {
- sysop = {},
- reviewer = {'sysop'},
- filemover = {'sysop'},
- templateeditor = {'sysop'},
- extendedconfirmed = {'sysop'},
- autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
- user = {'autoconfirmed'},
- ['*'] = {'user'}
- },
- --------------------------------------------------------------------------------
- -- Wrapper templates and their default arguments
- --------------------------------------------------------------------------------
- -- This table contains wrapper templates used with the module, and their
- -- default arguments. Templates specified in this table should contain the
- -- following invocation, and no other template content:
- --
- -- {{#invoke:Protection banner|main}}
- --
- -- If other content is desired, it can be added between
- -- <noinclude>...</noinclude> tags.
- --
- -- When a user calls one of these wrapper templates, they will use the
- -- default arguments automatically. However, users can override any of the
- -- arguments.
- wrappers = {
- ['Template:Pp'] = {},
- ['Template:Pp-30-500'] = {'ecp'},
- ['Template:Pp-blp'] = {'blp'},
- -- we don't need Template:Pp-create
- ['Template:Pp-dispute'] = {'dispute'},
- ['Template:Pp-main-page'] = {'mainpage'},
- ['Template:Pp-move'] = {action = 'move'},
- ['Template:Pp-move-dispute'] = {'dispute', action = 'move'},
- -- we don't need Template:Pp-move-indef
- ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'},
- ['Template:Pp-office'] = {'office'},
- ['Template:Pp-office-dmca'] = {'dmca'},
- ['Template:Pp-pc1'] = {action = 'autoreview', small = true},
- ['Template:Pp-pc2'] = {action = 'autoreview', small = true},
- ['Template:Pp-reset'] = {'reset'},
- ['Template:Pp-semi-indef'] = {small = true},
- ['Template:Pp-sock'] = {'sock'},
- ['Template:Pp-template'] = {'template', small = true},
- ['Template:Pp-upload'] = {action = 'upload'},
- ['Template:Pp-usertalk'] = {'usertalk'},
- ['Template:Pp-vandalism'] = {'vandalism'},
- },
- --------------------------------------------------------------------------------
- --
- -- MESSAGES
- --
- --------------------------------------------------------------------------------
- msg = {
- --------------------------------------------------------------------------------
- -- Intro blurb and intro fragment
- --------------------------------------------------------------------------------
- -- These messages specify what is produced by the ${INTROBLURB} and
- -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
- -- intro-blurb-expiry or intro-fragment-expiry, and if not they use
- -- intro-blurb-noexpiry or intro-fragment-noexpiry.
- -- It is possible to use banner parameters in these messages.
- ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
- ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
- ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
- ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
- --------------------------------------------------------------------------------
- -- Tooltip blurb
- --------------------------------------------------------------------------------
- -- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
- -- If the protection is temporary the tooltip-blurb-expiry message is used, and
- -- if not the tooltip-blurb-noexpiry message is used.
- -- It is possible to use banner parameters in these messages.
- ['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
- ['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
- ['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
- ['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
- --------------------------------------------------------------------------------
- -- Special explanation blurb
- --------------------------------------------------------------------------------
- -- An explanation blurb for pages that cannot be unprotected, e.g. for pages
- -- in the MediaWiki namespace.
- -- It is possible to use banner parameters in this message.
- ['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
- .. 'protection policy]] and ${PROTECTIONLOG} for more details.'
- .. ' Please discuss any changes on the ${TALKPAGE}; you'
- .. ' may ${EDITREQUEST} to ask an'
- .. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
- .. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
- .. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
- .. '|consensus]].',
- --------------------------------------------------------------------------------
- -- Protection log display values
- --------------------------------------------------------------------------------
- -- These messages determine the display values for the protection log link
- -- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
- -- It is possible to use banner parameters in these messages.
- ['protection-log-display'] = 'protection log',
- ['pc-log-display'] = 'pending changes log',
- --------------------------------------------------------------------------------
- -- Current version display values
- --------------------------------------------------------------------------------
- -- These messages determine the display values for the page history link
- -- or the move log link produced by the ${CURRENTVERSION} parameter.
- -- It is possible to use banner parameters in these messages.
- ['current-version-move-display'] = 'current title',
- ['current-version-edit-display'] = 'current version',
- --------------------------------------------------------------------------------
- -- Talk page
- --------------------------------------------------------------------------------
- -- This message determines the display value of the talk page link produced
- -- with the ${TALKPAGE} parameter.
- -- It is possible to use banner parameters in this message.
- ['talk-page-link-display'] = 'talk page',
- --------------------------------------------------------------------------------
- -- Edit requests
- --------------------------------------------------------------------------------
- -- This message determines the display value of the edit request link produced
- -- with the ${EDITREQUEST} parameter.
- -- It is possible to use banner parameters in this message.
- ['edit-request-display'] = 'submit an edit request',
- --------------------------------------------------------------------------------
- -- Expiry date format
- --------------------------------------------------------------------------------
- -- This is the format for the blurb expiry date. It should be valid input for
- -- the first parameter of the #time parser function.
- ['expiry-date-format'] = 'F j, Y',
- --------------------------------------------------------------------------------
- -- Tracking categories
- --------------------------------------------------------------------------------
- -- These messages determine which tracking categories the module outputs.
- ['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
- ['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
- --------------------------------------------------------------------------------
- -- Images
- --------------------------------------------------------------------------------
- -- These are images that are not defined by their protection action and protection level.
- ['image-filename-indef'] = 'Padlock.svg',
- ['image-filename-default'] = 'Transparent.gif',
- --------------------------------------------------------------------------------
- -- End messages
- --------------------------------------------------------------------------------
- }
- --------------------------------------------------------------------------------
- -- End configuration
- --------------------------------------------------------------------------------
- }</text>
- <sha1>rws38o0t9lndqgh42vqj1de259tmqqo</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Separated entries</title>
- <ns>828</ns>
- <id>46440383</id>
- <revision>
- <id>847543373</id>
- <parentid>664185837</parentid>
- <timestamp>2018-06-26T03:05:37Z</timestamp>
- <contributor>
- <username>Jc86035</username>
- <id>17245768</id>
- </contributor>
- <minor/>
- <comment>allow the first positional parameter to be specified (useful in some templates)</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="1403">-- This module takes positional parameters as input and concatenates them with
- -- an optional separator. The final separator (the "conjunction") can be
- -- specified independently, enabling natural-language lists like
- -- "foo, bar, baz and qux". The starting parameter can also be specified.
- local compressSparseArray = require('Module:TableTools').compressSparseArray
- local p = {}
- function p._main(args)
- local separator = args.separator
- -- Decode (convert to Unicode) HTML escape sequences, such as "&#32;" for space.
- and mw.text.decode(args.separator) or ''
- local conjunction = args.conjunction and mw.text.decode(args.conjunction) or separator
- -- Discard values before the starting parameter.
- local start = tonumber(args.start)
- if start then
- for i = 1, start - 1 do args[i] = nil end
- end
- -- Discard named parameters.
- local values = compressSparseArray(args)
- return mw.text.listToText(values, separator, conjunction)
- end
- local function makeInvokeFunction(separator, conjunction, first)
- return function (frame)
- local args = require('Module:Arguments').getArgs(frame)
- args.separator = separator or args.separator
- args.conjunction = conjunction or args.conjunction
- args.first = first or args.first
- return p._main(args)
- end
- end
- p.main = makeInvokeFunction()
- p.br = makeInvokeFunction('<br />')
- p.comma = makeInvokeFunction(mw.message.new('comma-separator'):plain())
- return p</text>
- <sha1>r3n53qz4zycs3vxyo5ms9qjo1jm32bp</sha1>
- </revision>
- </page>
- <page>
- <title>Module:String</title>
- <ns>828</ns>
- <id>38569505</id>
- <revision>
- <id>552254999</id>
- <parentid>540627185</parentid>
- <timestamp>2013-04-26T10:52:01Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <comment>Add "rep" function per request by [[User:קיפודנחש]] at [[Wikipedia:Lua requests#Template:Loop and Template:Loop15]]. Copied from sandbox.</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="15731">--[[
- This module is intended to provide access to basic string functions.
- Most of the functions provided here can be invoked with named parameters,
- unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
- automatically remove any leading or trailing whitespace from the parameter.
- Depending on the intended use, it may be advantageous to either preserve or
- remove such whitespace.
- Global options
- ignore_errors: If set to 'true' or 1, any error condition will result in
- an empty string being returned rather than an error message.
- error_category: If an error occurs, specifies the name of a category to
- include with the error message. The default category is
- [Category:Errors reported by Module String].
- no_category: If set to 'true' or 1, no category will be added if an error
- is generated.
- Unit tests for this module are available at Module:String/tests.
- ]]
- local str = {}
- --[[
- len
- This function returns the length of the target string.
- Usage:
- {{#invoke:String|len|target_string|}}
- OR
- {{#invoke:String|len|s=target_string}}
- Parameters
- s: The string whose length to report
- If invoked using named parameters, Mediawiki will automatically remove any leading or
- trailing whitespace from the target string.
- ]]
- function str.len( frame )
- local new_args = str._getParameters( frame.args, {'s'} );
- local s = new_args['s'] or '';
- return mw.ustring.len( s )
- end
- --[[
- sub
- This function returns a substring of the target string at specified indices.
- Usage:
- {{#invoke:String|sub|target_string|start_index|end_index}}
- OR
- {{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
- Parameters
- s: The string to return a subset of
- i: The fist index of the substring to return, defaults to 1.
- j: The last index of the string to return, defaults to the last character.
- The first character of the string is assigned an index of 1. If either i or j
- is a negative value, it is interpreted the same as selecting a character by
- counting from the end of the string. Hence, a value of -1 is the same as
- selecting the last character of the string.
- If the requested indices are out of range for the given string, an error is
- reported.
- ]]
- function str.sub( frame )
- local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } );
- local s = new_args['s'] or '';
- local i = tonumber( new_args['i'] ) or 1;
- local j = tonumber( new_args['j'] ) or -1;
- local len = mw.ustring.len( s );
- -- Convert negatives for range checking
- if i < 0 then
- i = len + i + 1;
- end
- if j < 0 then
- j = len + j + 1;
- end
- if i > len or j > len or i < 1 or j < 1 then
- return str._error( 'String subset index out of range' );
- end
- if j < i then
- return str._error( 'String subset indices out of order' );
- end
- return mw.ustring.sub( s, i, j )
- end
- --[[
- This function implements that features of {{str sub old}} and is kept in order
- to maintain these older templates.
- ]]
- function str.sublength( frame )
- local i = tonumber( frame.args.i ) or 0
- local len = tonumber( frame.args.len )
- return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
- end
- --[[
- match
- This function returns a substring from the source string that matches a
- specified pattern.
- Usage:
- {{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
- OR
- {{#invoke:String|pos|s=source_string|pattern=pattern_string|start=start_index
- |match=match_number|plain=plain_flag|nomatch=nomatch_output}}
- Parameters
- s: The string to search
- pattern: The pattern or string to find within the string
- start: The index within the source string to start the search. The first
- character of the string has index 1. Defaults to 1.
- match: In some cases it may be possible to make multiple matches on a single
- string. This specifies which match to return, where the first match is
- match= 1. If a negative number is specified then a match is returned
- counting from the last match. Hence match = -1 is the same as requesting
- the last match. Defaults to 1.
- plain: A flag indicating that the pattern should be understood as plain
- text. Defaults to false.
- nomatch: If no match is found, output the "nomatch" value rather than an error.
- If invoked using named parameters, Mediawiki will automatically remove any leading or
- trailing whitespace from each string. In some circumstances this is desirable, in
- other cases one may want to preserve the whitespace.
- If the match_number or start_index are out of range for the string being queried, then
- this function generates an error. An error is also generated if no match is found.
- If one adds the parameter ignore_errors=true, then the error will be suppressed and
- an empty string will be returned on any failure.
- For information on constructing Lua patterns, a form of [regular expression], see:
- * http://www.lua.org/manual/5.1/manual.html#5.4.1
- * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
- * http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
- ]]
- function str.match( frame )
- local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} );
- local s = new_args['s'] or '';
- local start = tonumber( new_args['start'] ) or 1;
- local plain_flag = str._getBoolean( new_args['plain'] or false );
- local pattern = new_args['pattern'] or '';
- local match_index = math.floor( tonumber(new_args['match']) or 1 );
- local nomatch = new_args['nomatch'];
- if s == '' then
- return str._error( 'Target string is empty' );
- end
- if pattern == '' then
- return str._error( 'Pattern string is empty' );
- end
- if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then
- return str._error( 'Requested start is out of range' );
- end
- if match_index == 0 then
- return str._error( 'Match index is out of range' );
- end
- if plain_flag then
- pattern = str._escapePattern( pattern );
- end
- local result
- if match_index == 1 then
- -- Find first match is simple case
- result = mw.ustring.match( s, pattern, start )
- else
- if start > 1 then
- s = mw.ustring.sub( s, start );
- end
- local iterator = mw.ustring.gmatch(s, pattern);
- if match_index > 0 then
- -- Forward search
- for w in iterator do
- match_index = match_index - 1;
- if match_index == 0 then
- result = w;
- break;
- end
- end
- else
- -- Reverse search
- local result_table = {};
- local count = 1;
- for w in iterator do
- result_table[count] = w;
- count = count + 1;
- end
- result = result_table[ count + match_index ];
- end
- end
- if result == nil then
- if nomatch == nil then
- return str._error( 'Match not found' );
- else
- return nomatch;
- end
- else
- return result;
- end
- end
- --[[
- pos
- This function returns a single character from the target string at position pos.
- Usage:
- {{#invoke:String|pos|target_string|index_value}}
- OR
- {{#invoke:String|pos|target=target_string|pos=index_value}}
- Parameters
- target: The string to search
- pos: The index for the character to return
- If invoked using named parameters, Mediawiki will automatically remove any leading or
- trailing whitespace from the target string. In some circumstances this is desirable, in
- other cases one may want to preserve the whitespace.
- The first character has an index value of 1.
- If one requests a negative value, this function will select a character by counting backwards
- from the end of the string. In other words pos = -1 is the same as asking for the last character.
- A requested value of zero, or a value greater than the length of the string returns an error.
- ]]
- function str.pos( frame )
- local new_args = str._getParameters( frame.args, {'target', 'pos'} );
- local target_str = new_args['target'] or '';
- local pos = tonumber( new_args['pos'] ) or 0;
- if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then
- return str._error( 'String index out of range' );
- end
- return mw.ustring.sub( target_str, pos, pos );
- end
- --[[
- str_find
- This function duplicates the behavior of {{str_find}}, including all of its quirks.
- This is provided in order to support existing templates, but is NOT RECOMMENDED for
- new code and templates. New code is recommended to use the "find" function instead.
- Returns the first index in "source" that is a match to "target". Indexing is 1-based,
- and the function returns -1 if the "target" string is not present in "source".
- Important Note: If the "target" string is empty / missing, this function returns a
- value of "1", which is generally unexpected behavior, and must be accounted for
- separatetly.
- ]]
- function str.str_find( frame )
- local new_args = str._getParameters( frame.args, {'source', 'target'} );
- local source_str = new_args['source'] or '';
- local target_str = new_args['target'] or '';
- if target_str == '' then
- return 1;
- end
- local start = mw.ustring.find( source_str, target_str, 1, true )
- if start == nil then
- start = -1
- end
- return start
- end
- --[[
- find
- This function allows one to search for a target string or pattern within another
- string.
- Usage:
- {{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
- OR
- {{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
- Parameters
- source: The string to search
- target: The string or pattern to find within source
- start: The index within the source string to start the search, defaults to 1
- plain: Boolean flag indicating that target should be understood as plain
- text and not as a Lua style regular expression, defaults to true
- If invoked using named parameters, Mediawiki will automatically remove any leading or
- trailing whitespace from the parameter. In some circumstances this is desirable, in
- other cases one may want to preserve the whitespace.
- This function returns the first index >= "start" where "target" can be found
- within "source". Indices are 1-based. If "target" is not found, then this
- function returns 0. If either "source" or "target" are missing / empty, this
- function also returns 0.
- This function should be safe for UTF-8 strings.
- ]]
- function str.find( frame )
- local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } );
- local source_str = new_args['source'] or '';
- local pattern = new_args['target'] or '';
- local start_pos = tonumber(new_args['start']) or 1;
- local plain = new_args['plain'] or true;
- if source_str == '' or pattern == '' then
- return 0;
- end
- plain = str._getBoolean( plain );
- local start = mw.ustring.find( source_str, pattern, start_pos, plain )
- if start == nil then
- start = 0
- end
- return start
- end
- --[[
- replace
- This function allows one to replace a target string or pattern within another
- string.
- Usage:
- {{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
- OR
- {{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
- count=replacement_count|plain=plain_flag}}
- Parameters
- source: The string to search
- pattern: The string or pattern to find within source
- replace: The replacement text
- count: The number of occurences to replace, defaults to all.
- plain: Boolean flag indicating that pattern should be understood as plain
- text and not as a Lua style regular expression, defaults to true
- ]]
- function str.replace( frame )
- local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } );
- local source_str = new_args['source'] or '';
- local pattern = new_args['pattern'] or '';
- local replace = new_args['replace'] or '';
- local count = tonumber( new_args['count'] );
- local plain = new_args['plain'] or true;
- if source_str == '' or pattern == '' then
- return source_str;
- end
- plain = str._getBoolean( plain );
- if plain then
- pattern = str._escapePattern( pattern );
- replace = mw.ustring.gsub( replace, "%%", "%%%%" ); --Only need to escape replacement sequences.
- end
- local result;
- if count ~= nil then
- result = mw.ustring.gsub( source_str, pattern, replace, count );
- else
- result = mw.ustring.gsub( source_str, pattern, replace );
- end
- return result;
- end
- --[[
- simple function to pipe string.rep to templates.
- ]]
- function str.rep( frame )
- local repetitions = tonumber( frame.args[2] )
- if not repetitions then
- return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or '' ) .. '"' )
- end
- return string.rep( frame.args[1] or '', repetitions )
- end
- --[[
- Helper function that populates the argument list given that user may need to use a mix of
- named and unnamed parameters. This is relevant because named parameters are not
- identical to unnamed parameters due to string trimming, and when dealing with strings
- we sometimes want to either preserve or remove that whitespace depending on the application.
- ]]
- function str._getParameters( frame_args, arg_list )
- local new_args = {};
- local index = 1;
- local value;
- for i,arg in ipairs( arg_list ) do
- value = frame_args[arg]
- if value == nil then
- value = frame_args[index];
- index = index + 1;
- end
- new_args[arg] = value;
- end
- return new_args;
- end
- --[[
- Helper function to handle error messages.
- ]]
- function str._error( error_str )
- local frame = mw.getCurrentFrame();
- local error_category = frame.args.error_category or 'Errors reported by Module String';
- local ignore_errors = frame.args.ignore_errors or false;
- local no_category = frame.args.no_category or false;
- if str._getBoolean(ignore_errors) then
- return '';
- end
- local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>';
- if error_category ~= '' and not str._getBoolean( no_category ) then
- error_str = '[[Category:' .. error_category .. ']]' .. error_str;
- end
- return error_str;
- end
- --[[
- Helper Function to interpret boolean strings
- ]]
- function str._getBoolean( boolean_str )
- local boolean_value;
- if type( boolean_str ) == 'string' then
- boolean_str = boolean_str:lower();
- if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
- or boolean_str == '' then
- boolean_value = false;
- else
- boolean_value = true;
- end
- elseif type( boolean_str ) == 'boolean' then
- boolean_value = boolean_str;
- else
- error( 'No boolean value found' );
- end
- return boolean_value
- end
- --[[
- Helper function that escapes all pattern characters so that they will be treated
- as plain text.
- ]]
- function str._escapePattern( pattern_str )
- return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
- end
- return str</text>
- <sha1>l0shz7fzxb1bq626nihqwbptk7dfqd5</sha1>
- </revision>
- </page>
- <page>
- <title>Module:TableTools</title>
- <ns>828</ns>
- <id>41371028</id>
- <revision>
- <id>610073853</id>
- <parentid>587870113</parentid>
- <timestamp>2014-05-25T14:11:02Z</timestamp>
- <contributor>
- <username>Mr. Stradivarius</username>
- <id>4708675</id>
- </contributor>
- <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>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="8030">--[[
- ------------------------------------------------------------------------------------
- -- TableTools --
- -- --
- -- This module includes a number of functions for dealing with Lua tables. --
- -- It is a meta-module, meant to be called from other Lua modules, and should --
- -- not be called directly from #invoke. --
- ------------------------------------------------------------------------------------
- --]]
- local libraryUtil = require('libraryUtil')
- local p = {}
- -- Define often-used variables and functions.
- local floor = math.floor
- local infinity = math.huge
- local checkType = libraryUtil.checkType
- --[[
- ------------------------------------------------------------------------------------
- -- isPositiveInteger
- --
- -- This function returns true if the given value is a positive integer, and false
- -- if not. Although it doesn't operate on tables, it is included here as it is
- -- useful for determining whether a given table key is in the array part or the
- -- hash part of a table.
- ------------------------------------------------------------------------------------
- --]]
- function p.isPositiveInteger(v)
- if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
- return true
- else
- return false
- end
- end
- --[[
- ------------------------------------------------------------------------------------
- -- isNan
- --
- -- This function returns true if the given number is a NaN value, and false
- -- if not. Although it doesn't operate on tables, it is included here as it is
- -- useful for determining whether a value can be a valid table key. Lua will
- -- generate an error if a NaN is used as a table key.
- ------------------------------------------------------------------------------------
- --]]
- function p.isNan(v)
- if type(v) == 'number' and tostring(v) == '-nan' then
- return true
- else
- return false
- end
- end
- --[[
- ------------------------------------------------------------------------------------
- -- shallowClone
- --
- -- This returns a clone of a table. The value returned is a new table, but all
- -- subtables and functions are shared. Metamethods are respected, but the returned
- -- table will have no metatable of its own.
- ------------------------------------------------------------------------------------
- --]]
- function p.shallowClone(t)
- local ret = {}
- for k, v in pairs(t) do
- ret[k] = v
- end
- return ret
- end
- --[[
- ------------------------------------------------------------------------------------
- -- removeDuplicates
- --
- -- This removes duplicate values from an array. Non-positive-integer keys are
- -- ignored. The earliest value is kept, and all subsequent duplicate values are
- -- removed, but otherwise the array order is unchanged.
- ------------------------------------------------------------------------------------
- --]]
- function p.removeDuplicates(t)
- checkType('removeDuplicates', 1, t, 'table')
- local isNan = p.isNan
- local ret, exists = {}, {}
- for i, v in ipairs(t) do
- if isNan(v) then
- -- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
- ret[#ret + 1] = v
- else
- if not exists[v] then
- ret[#ret + 1] = v
- exists[v] = true
- end
- end
- end
- return ret
- end
- --[[
- ------------------------------------------------------------------------------------
- -- numKeys
- --
- -- This takes a table and returns an array containing the numbers of any numerical
- -- keys that have non-nil values, sorted in numerical order.
- ------------------------------------------------------------------------------------
- --]]
- function p.numKeys(t)
- checkType('numKeys', 1, t, 'table')
- local isPositiveInteger = p.isPositiveInteger
- local nums = {}
- for k, v in pairs(t) do
- if isPositiveInteger(k) then
- nums[#nums + 1] = k
- end
- end
- table.sort(nums)
- return nums
- end
- --[[
- ------------------------------------------------------------------------------------
- -- affixNums
- --
- -- This takes a table and returns an array containing the numbers of keys with the
- -- specified prefix and suffix. For example, for the table
- -- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
- -- return {1, 3, 6}.
- ------------------------------------------------------------------------------------
- --]]
- function p.affixNums(t, prefix, suffix)
- checkType('affixNums', 1, t, 'table')
- checkType('affixNums', 2, prefix, 'string', true)
- checkType('affixNums', 3, suffix, 'string', true)
- local function cleanPattern(s)
- -- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
- s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
- return s
- end
- prefix = prefix or ''
- suffix = suffix or ''
- prefix = cleanPattern(prefix)
- suffix = cleanPattern(suffix)
- local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'
- local nums = {}
- for k, v in pairs(t) do
- if type(k) == 'string' then
- local num = mw.ustring.match(k, pattern)
- if num then
- nums[#nums + 1] = tonumber(num)
- end
- end
- end
- table.sort(nums)
- return nums
- end
- --[[
- ------------------------------------------------------------------------------------
- -- numData
- --
- -- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
- -- of subtables in the format
- -- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
- -- Keys that don't end with an integer are stored in a subtable named "other".
- -- The compress option compresses the table so that it can be iterated over with
- -- ipairs.
- ------------------------------------------------------------------------------------
- --]]
- function p.numData(t, compress)
- checkType('numData', 1, t, 'table')
- checkType('numData', 2, compress, 'boolean', true)
- local ret = {}
- for k, v in pairs(t) do
- local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
- if num then
- num = tonumber(num)
- local subtable = ret[num] or {}
- if prefix == '' then
- -- Positional parameters match the blank string; put them at the start of the subtable instead.
- prefix = 1
- end
- subtable[prefix] = v
- ret[num] = subtable
- else
- local subtable = ret.other or {}
- subtable[k] = v
- ret.other = subtable
- end
- end
- if compress then
- local other = ret.other
- ret = p.compressSparseArray(ret)
- ret.other = other
- end
- return ret
- end
- --[[
- ------------------------------------------------------------------------------------
- -- compressSparseArray
- --
- -- This takes an array with one or more nil values, and removes the nil values
- -- while preserving the order, so that the array can be safely traversed with
- -- ipairs.
- ------------------------------------------------------------------------------------
- --]]
- function p.compressSparseArray(t)
- checkType('compressSparseArray', 1, t, 'table')
- local ret = {}
- local nums = p.numKeys(t)
- for _, num in ipairs(nums) do
- ret[#ret + 1] = t[num]
- end
- return ret
- end
- --[[
- ------------------------------------------------------------------------------------
- -- sparseIpairs
- --
- -- This is an iterator for sparse arrays. It can be used like ipairs, but can
- -- handle nil values.
- ------------------------------------------------------------------------------------
- --]]
- function p.sparseIpairs(t)
- checkType('sparseIpairs', 1, t, 'table')
- local nums = p.numKeys(t)
- local i = 0
- local lim = #nums
- return function ()
- i = i + 1
- if i <= lim then
- local key = nums[i]
- return key, t[key]
- else
- return nil, nil
- end
- end
- end
- --[[
- ------------------------------------------------------------------------------------
- -- size
- --
- -- This returns the size of a key/value pair table. It will also work on arrays,
- -- but for arrays it is more efficient to use the # operator.
- ------------------------------------------------------------------------------------
- --]]
- function p.size(t)
- checkType('size', 1, t, 'table')
- local i = 0
- for k in pairs(t) do
- i = i + 1
- end
- return i
- end
- return p</text>
- <sha1>k1omc17qij757n8hd68yihcqxo4biqi</sha1>
- </revision>
- </page>
- <page>
- <title>Module:Yesno</title>
- <ns>828</ns>
- <id>38665046</id>
- <revision>
- <id>828075573</id>
- <parentid>659459801</parentid>
- <timestamp>2018-02-28T12:14:32Z</timestamp>
- <contributor>
- <username>MSGJ</username>
- <id>42630</id>
- </contributor>
- <comment>+support for on/off</comment>
- <model>Scribunto</model>
- <format>text/plain</format>
- <text xml:space="preserve" bytes="745">-- Function allowing for consistent treatment of boolean-like wikitext input.
- -- It works similarly to the template {{yesno}}.
- return function (val, default)
- -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you
- -- should replace "val:lower()" with "mw.ustring.lower(val)" in the
- -- following line.
- val = type(val) == 'string' and val:lower() or val
- if val == nil then
- return nil
- elseif val == true
- or val == 'yes'
- or val == 'y'
- or val == 'true'
- or val == 't'
- or val == 'on'
- or tonumber(val) == 1
- then
- return true
- elseif val == false
- or val == 'no'
- or val == 'n'
- or val == 'false'
- or val == 'f'
- or val == 'off'
- or tonumber(val) == 0
- then
- return false
- else
- return default
- end
- end</text>
- <sha1>swdskn7svew8i9wuydn9uj5l3r2ghcs</sha1>
- </revision>
- </page>
- </mediawiki>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement