Page MenuHomeMiraheze

Wikipedia-20180210164141.xml

Authored By
Rob_Kam
Feb 10 2018, 17:06
Size
524 KB
Referenced Files
None
Subscribers
None

Wikipedia-20180210164141.xml

This file is larger than 256 KB, so syntax highlighting was skipped.
<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.31.0-wmf.20</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 Wikipedia user</title>
<ns>10</ns>
<id>3615435</id>
<revision>
<id>812906942</id>
<parentid>812906843</parentid>
<timestamp>2017-11-30T16:11:42Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<comment>add parents (in documentation but not in template)</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="14438">{{Infobox
| bodyclass = vcard
| bodystyle = {{#if:{{{fontcolor|}}}|color: {{{fontcolor}}};}} {{#if:{{{width|}}}|width: {{{width}}};}} {{#if:{{{tablecolor|}}}|background-color: {{{tablecolor}}}}}
| headerstyle = {{#if:{{{color|}}}|background-color: {{{color}}}}}; {{#if:{{{headerfontcolor|}}}|color: {{{headerfontcolor}}}}}
| abovestyle = {{#if:{{{abovecolor|}}}|background-color: {{{abovecolor}}}|}}; {{#if:{{{abovefontcolor|}}}|color: {{{abovefontcolor}}}|}}
| title = &lt;includeonly&gt;{{#if:{{{abovefontcolor|}}}||{{{title|{{BASEPAGENAME}}}}} {{#if:{{{status|}}}|&lt;br /&gt;&lt;small&gt;{{{status}}}&lt;/small&gt;}}}}&lt;/includeonly&gt;
| above = {{#if:{{{abovefontcolor|}}}|{{{title|{{BASEPAGENAME}}}}} {{#if:{{{status|}}}|&lt;br /&gt;&lt;small&gt;{{{status}}}&lt;/small&gt;}}}}
| subheader = —&amp;nbsp;&lt;span class=&quot;role&quot;&gt;{{#if:{{{role|}}}|{{{role}}}|[[Wikipedia]]n}}&lt;/span&gt;&amp;nbsp;{{#switch:{{lc:{{{gender|{{Gender:{{#titleparts:{{BASEPAGENAME}}|1}}|m|f|NONE}}}}}}}|male|m={{Abbr|&amp;#9794;|male|class=gender|style=font-size: larger;|unicode}}[[Category:Male Wikipedians]]&amp;nbsp;|female|f={{Abbr|&amp;#9792;|female|class=gender|style=font-size: larger;|unicode}}[[Category:Female Wikipedians]]&amp;nbsp;|other|o={{abbr|1=&lt;span style=&quot;line-height: 12px;&quot;&gt;[[File:Gendersign.svg|x12px|alt=other gender|link=]]&lt;/span&gt;|2=other gender|class=gender}}&amp;nbsp;||none=|#default={{abbr|1=&lt;span style=&quot;line-height: 12px;&quot;&gt;[[File:Gendersign.svg|x12px|alt={{{gender}}}|link=]]&lt;/span&gt;|2={{{gender}}}|class=gender}}&amp;nbsp;}}—
| image = {{#invoke:InfoboxImage|InfoboxImage|image={{{image|}}}|size={{{image_width|238px}}}|title={{{image_caption|}}}}}
| caption = {{{image_caption|}}}
| label1 = Name
| data1 = {{#if:{{{honorific prefix|{{{honorific_prefix|}}}}}}|&lt;span class=&quot;honorific-prefix&quot;&gt;{{{honorific prefix|{{{honorific_prefix|}}}}}}&amp;nbsp;&lt;/span&gt;}}{{#if:{{{name|}}}|&lt;includeonly&gt;&lt;span class=&quot;fn&quot;&gt;{{{name|}}}&lt;/span&gt;&lt;/includeonly&gt;}}{{#if:{{{honorific suffix|{{{honorific_suffix|}}}}}}|&amp;nbsp;&lt;span class=&quot;honorific-suffix&quot;&gt;{{{honorific suffix|{{{honorific_suffix|}}}}}}&lt;/span&gt;}}
| label2 = Born
| data2 = {{br separated entries|1={{#if:{{{birthname|{{{birth_name|}}}}}}|&lt;span class=&quot;nickname&quot;&gt;{{{birthname|{{{birth_name}}}}}}&lt;/span&gt;}}|2={{{birthdate|{{{birth_date|}}}}}}|3={{#if:{{{birthplace|{{{birth_place|}}}}}}|&lt;span class=&quot;birthplace&quot;&gt;{{{birthplace|{{{birth_place}}}}}}&lt;/span&gt;}}}}
| label3 = Name in real life
| data3 = {{{real_name|}}}
| class3 = nickname
| label4 = Gender
| data4 = {{{custom_gender|}}}
| label5 = Preferred pronoun
| data5 = {{{pronoun|}}}
| label6 = Nationality
| data6 = {{{nationality|}}}
| class6 = category
| label7 = Country
| data7 = {{#ifexist:template:country data {{ucfirst:{{{country}}}}}|{{flag|{{ucfirst:{{{country}}}}}}}|{{ucfirst:{{{country|}}}}}}}
| label8 = Current&amp;nbsp;location
| data8 = {{#if:{{{location|}}}| {{#ifeq:{{#if:{{{country|}}}|1|0}}{{#ifexist:{{{location}}}, {{{country}}}|1|0}}|11&lt;!-- i.e. both conditions are met--&gt;|[[{{{location}}}, {{{country}}}|{{{location}}}]] | {{#ifeq:{{#ifeq:{{strfind short|{{{location|}}}|,|1}}|0|0|1}}{{#ifexist:{{{location|}}}|1|0}}|11&lt;!-- i.e. both conditions are met--&gt;| [[{{{location}}}]] | {{{location}}} }} }} }}
| class8 = label
| label9 = Languages
| data9 = {{{languages|}}}
| class9 = category
| label10 = Time&amp;nbsp;zone
| data10 = {{#if:{{{timezone|}}}|{{#if:{{isValidPageName|{{{timezone}}}}}|[[{{{timezone}}}]]|{{{timezone}}}}}}}
| label11 = Current&amp;nbsp;time
| data11 = {{{current_time|}}}
| label13 = Ethnicity
| data13 = {{{ethnicity|}}}
| class13 = category
| label14 = Race
| data14 = {{{race|}}}
| class14 = category
| label15 = Height
| data15 = {{{height|}}}
| label16 = Weight
| data16 = {{{weight|}}}
| label17 = Hair
| data17 = {{{hair|}}}
| label18 = Eyes
| data18 = {{{eyes|}}}
| label19 = [[Handedness]]
| data19 = {{{handedness|}}}
| label20 = [[Blood&amp;nbsp;type]]
| data20 = {{{blood_type|}}}
| label21 = Sexuality
| data21 = {{{sexuality|}}}
| class21 = category
| label22 = [[Intelligence quotient|IQ]]
| data22 = {{{iq|}}}
| label23 = [[Myers–Briggs Type Indicator|Personality&amp;nbsp;type]]
| data23 = {{{personality_type|}}}
| class23 = category
| label24 = {{#switch:{{lc:{{{alignment|}}}}}|lawful good|neutral good|chaotic good|lawful neutral|neutral|true neutral|chaotic neutral|lawful evil|neutral evil|chaotic evil=[[Alignment (Dungeons &amp; Dragons)|Alignment]]|light side|lightside|light|jedi|dark side|darkside|dark|sith=[[Alignment (role-playing games)#Star Wars|Alignment]]|#default=[[Alignment (role-playing games)|Alignment]]}}
| data24 = {{#switch:{{lc:{{{alignment|}}}}}|lawful good|neutral good|chaotic good|lawful neutral|neutral|true neutral|chaotic neutral|lawful evil|neutral evil|chaotic evil=[[{{{alignment|}}}]]|light side|lightside|light|jedi=[[Force (Star Wars)|Light Side]]|dark side|darkside|dark|sith=[[Dark side (Star Wars)|Dark Side]]|#default={{{alignment|}}}}}
| class24 = category
| header25 = {{#if:{{{marital status|}}}{{{spouse|}}}{{{girlfriend|}}}{{{boyfriend|}}}{{{children|}}}{{{siblings|}}}{{{pets|}}}|Family and friends}}
| label26 = Marital&amp;nbsp;status
| data26 = {{{marital status|}}}
| class26 = category
| label27 = Spouse
| data27 = {{{spouse|{{{partner|}}}}}}
| label28 = Girlfriend
| data28 = {{{girlfriend|}}}
| label29 = Boyfriend
| data29 = {{{boyfriend|}}}
| label30 = Children
| data30 = {{{children|}}}
| label31 = Siblings
| data31 = {{{siblings|}}}
| label32 = Parents
| data32 = {{{parents|}}}
| label33 = Pets
| data33 = {{{pets|}}}
| header34 = {{#if:{{{occupation|}}}{{{employer|}}}{{{education|}}}{{{college|}}}{{{university|}}}{{{highschool|}}}|Education and employment}}
| label35 = Occupation
| data35 = {{{occupation|}}}
| class35 = role
| label36 = Employer
| data36 = {{{employer|}}}
| class36 = org
| label37 = Education
| data37 = {{{education|}}}
| label38 = Primary school
| data38 = {{{primaryschool|}}}
| label39 = Intermediate school
| data39 = {{{intschool|}}}
| label40 = High school
| data40 = {{{highschool|}}}
| label41 = College
| data41 = {{{college|}}}
| label42 = University
| data42 = {{{university|}}}
| label43 = Classes
| data43 = {{{classes|}}}
| header44 = {{#if:{{{hobbies|}}}{{{religion|}}}{{{politics|}}}{{{aliases|}}}{{{movies|}}}{{{books|}}}|Hobbies, favourites and beliefs}}
| label45 = Hobbies
| data45 = {{{hobbies|}}}
| label46 = Religion
| data46 = {{{religion|}}}
| class46 = category
| label47 = Politics
| data47 = {{{politics|}}}
| label48 = [[Pseudonym|Aliases]]
| data48 = {{{aliases|}}}
| class48 = nickname
| label49 = Movies
| data49 = {{{movies|}}}
| label50 = Shows
| data50 = {{{shows|}}}
| label51 = Books
| data51 = {{{books|}}}
| header52 = {{#if:{{{interests|}}}|Interests}}
| data53 = {{#if:{{{interests|}}}|&lt;div style=&quot;text-align: left&quot;&gt;
{{{interests|}}}
&lt;/div&gt;}}
| header54 = {{#if:{{{website|}}}{{{blog|}}}{{{email|}}}{{{icq|}}}{{{aim|}}}{{{gtalk|}}}{{{jabber|}}}{{{skype|}}}{{{mac|}}}{{{irc|}}}{{{facebook|}}}{{{google+|}}}{{{instagram|}}}{{{linkedin|}}}{{{myspace|}}}{{{pinterest|}}}{{{twitter|}}}{{{youtube|}}}{{{flickr|}}}|Contact info}}
| label55 = Website
| data55 = {{{website|}}}
| label56 = Blog
| data56 = {{{blog|}}}
| label57 = Email
| data57 = {{{email|}}}
| label58 = [[ICQ]]
| data58 = {{#if:{{{icq|}}}|[https://people.icq.com/people/about_me.php?uin={{urlencode:{{{icq}}}}} {{{icq}}}]}}
| label59 = [[AOL Instant Messenger|AIM]]
| data59 = {{{aim|}}}
| label60 = [[GTalk]]
| data60 = {{{gtalk|}}}
| label61 = [[Extensible Messaging and Presence Protocol|XMPP]]
| data61 = {{{jabber|}}}
| label62 = [[Skype]]
| data62 = {{{skype|}}}
| label63 = .Mac
| data63 = {{{mac|}}}
| label64 = [[IRC]]
| data64 = {{{irc|}}}
| label65 = [[Facebook]]
| data65 = {{#if:{{{facebook|}}}|[https://www.facebook.com/{{urlencode:{{{facebook}}}}} {{{facebook}}}]}}
| label66 = [[Google+]]
| data66 = {{#if:{{{google+|}}}|[https://plus.google.com/+{{urlencode:{{{google+}}}}} +{{{google+}}}]}}
| label67 = [[Instagram]]
| data67 = {{#if:{{{instagram|}}}|[https://www.instagram.com/{{urlencode:{{{instagram}}}}} {{{instagram}}}]}}
| label68 = [[LinkedIn]]
| data68 = {{#if:{{{linkedin|}}}|[https://www.linkedin.com/profile/view?&amp;name={{urlencode:{{{linkedin}}}}} {{{linkedin}}}]}}
| label69 = [[Myspace]]
| data69 = {{{myspace|}}}
| label70 = [[Pinterest]]
| data70 = {{{pinterest|}}}
| label71 = [[Twitter]]
| data71 = {{#if:{{{twitter|}}}|[https://twitter.com/{{urlencode:{{{twitter}}}}} {{{twitter}}}]}}
| label72 = [[YouTube]]
| data72 = {{#if:{{{youtube|}}}|[https://www.youtube.com/user/{{urlencode:{{{youtube}}}}} {{{youtube}}}]}}
| label73 = [[Flickr]]
| data73 = {{#if:{{{flickr|}}}|[https://www.flickr.com/photos/{{urlencode:{{{flickr}}}}} {{{flickr}}}]}}
| header74 = {{#if:{{{subpages|}}}|[[Special:Prefixindex/User:{{BASEPAGENAMEE}}|{{BASEPAGENAME}} subpages]]}}
| data75 = {{#if:{{{subpages|}}}|&lt;div style=&quot;text-align: left&quot;&gt;
{{{subpages|}}}
&lt;/div&gt;}}
| header76 = {{#if:{{{joined_date|}}}{{{first_edit|}}}{{{edit_count|}}}{{{permissions|}}}|Account statistics}}
| label77 = Joined
| data77 = {{{joined_date|}}}
| label78 = First edit
| data78 = {{{first_edit|}}}
| label79 = [[WP:CONFIRM|{{#if:{{{autoconfirmed|}}}|{{#if:{{{confirmed|}}}|Confirmed&lt;br /&gt;}}Autoconfirmed|{{#if:{{{confirmed|}}}|Confirmed}}}}]]
| data79 = {{#if:{{{autoconfirmed|}}}|{{#if:{{{confirmed|}}}|{{{confirmed}}}&lt;br /&gt;}}{{{autoconfirmed}}}|{{#if:{{{confirmed|}}}|{{{confirmed}}}}}}}
| label80 = [[WP:Account creator|Account creator]]
| data80 = {{{account_creator|}}}
| label81 = [[WP:Autopatrolled|Autopatrolled]]
| data81 = {{{autopatrolled|}}}
| label82 = [[WP:File mover|File mover]]
| data82 = {{{file_mover|}}}
| label83 = [[WP:Mass message senders|{{Abbr|MMS|Mass message sender}}]]
| data83 = {{{mass_message_sender|}}}
| label84 = [[WP:NPR|New page reviewer]]
| data84 = {{{new_page_reviewer|}}}
| label85 = [[WP:Page mover|Page mover]]
| data85 = {{{page_mover|}}}
| label86 = [[WP:Reviewing pending changes|Pending changes reviewer]]
| data86 = {{{reviewer|}}}
| label87 = [[WP:Rollback|Rollbacker]]
| data87 = {{{rollbacker|}}}
| label88 = [[WP:Template editor|Template editor]]
| data88 = {{{template_editor|}}}
| label89 = [[WP:EFM|Edit filter manager]]
| data89 = {{{edit_filter_manager|}}}
| label90 = [[WP:Administrators|Administrator]]
| data90 = {{{admin|}}}
| label91 = [[WP:Bureaucrats|Bureaucrat]]
| data91 = {{{bureaucrat|}}}
| label92 = [[WP:CheckUser|CheckUser]]
| data92 = {{{check_user|}}}
| label93 = [[WP:Oversight|Oversighter]]
| data93 = {{{overseer|}}}
| data94 = {{#ifeq:{{Yesno|1={{{adminstats|no}}}}}|yes|{{Adminstats|1={{BASEPAGENAME}}|style={{#ifeq:{{Yesno|1={{{adminstats_style|no}}}}}|yes|{{{adminstats_style|{{BASEPAGENAME}}/Mystyle}}}}}}}}}
| label95 = [//tools.wmflabs.org/supercount/index.php?user={{urlencode:{{BASEPAGENAME}}}}&amp;project=en.wikipedia Edit count]
| data95 = {{{edit_count|}}}
| label96 = {{#if:{{{permissions|}}}|&lt;span class=&quot;plainlinks&quot;&gt;[{{fullurl:Special:ListUsers|limit=1&amp;username={{ROOTPAGENAMEE}}}} Permissions]&lt;/span&gt;}}
| data96 = {{{permissions|}}}
| label98 = Signature
| data98 = {{{signature|}}}
| data101 = {{{module|}}}
| data102 = {{{module2|}}}
| data103 = {{{module3|}}}
| header104 = {{#if:{{{userboxes|}}}|Userboxes}}
| data105 = {{#if:{{{userboxes|}}}|
&lt;table style=&quot;background: transparent; vertical-align: middle !important; text-align: center; font-size: 95%; color: {{{fontcolor|#000000}}}; margin: auto; border-spacing: 0px; border-collapse: collapse;&quot;&gt;
&lt;tr&gt;&lt;td&gt;
{{{userboxes|}}}
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;
}}
| header106 = {{{custom_header|}}}
| data107 = {{#if:{{{custom_data|}}}|&lt;div style=&quot;text-align: left&quot;&gt;
{{{custom_data|}}}
&lt;/div&gt;}}
| label111 = {{{custom_label1|}}}
| data111 = {{{custom_data1|}}}
| label112 = {{{custom_label2|}}}
| data112 = {{{custom_data2|}}}
| label113 = {{{custom_label3|}}}
| data113 = {{{custom_data3|}}}
| label114 = {{{custom_label4|}}}
| data114 = {{{custom_data4|}}}
| label115 = {{{custom_label5|}}}
| data115 = {{{custom_data5|}}}
| label116 = {{{custom_label6|}}}
| data116 = {{{custom_data6|}}}
| label117 = {{{custom_label7|}}}
| data117 = {{{custom_data7|}}}
| label118 = {{{custom_label8|}}}
| data118 = {{{custom_data8|}}}
| label119 = {{{custom_label9|}}}
| data119 = {{{custom_data9|}}}
}}{{#ifeq:{{{nocat|false}}}|false|{{#ifexist:Category:Wikipedians in {{{location|}}}, {{{country|}}} | [[Category:Wikipedians in {{{location|}}}, {{{country|}}}]] | {{#ifexist:Category:Wikipedians in {{{location|}}}|[[Category:Wikipedians in {{{location}}}]]| {{#ifexist:Category:Wikipedians in {{substr_any|{{{location|}}}| {{str find0|{{{location|}}}|,}}+2| 50-{{strlen quick|{{{location|}}}}} }} | [[Category:Wikipedians in {{substr_any|{{{location|}}}| {{str find0|{{{location|}}}|,}}+2| 50-{{strlen quick|{{{location|}}}}} }}]] | {{#if:{{{country|}}} | {{#ifeq:{{{country|}}}| UK | [[Category:Wikipedians in the United Kingdom]] | {{#ifexist:Category:Wikipedians in {{{country|}}} | [[Category:Wikipedians in {{{country}}}]] | {{#ifexist:Category:Wikipedians in the {{{country|}}} | [[Category:Wikipedians in the {{{country}}}]] | {{#ifexist:Category:Wikipedians in {{getalias|{{{country|}}}}} | [[Category:Wikipedians in {{getalias|{{{country|}}}}}]] | {{#ifexist:Category:Wikipedians in the {{getalias|{{{country|}}}}} | [[Category:Wikipedians in the {{getalias|{{{country|}}}}}]] }} }} }} }} }} }} }} }} }} }}&lt;noinclude&gt;{{Documentation}}&lt;/noinclude&gt;</text>
<sha1>fltthm27hah6zqtomatoudf3936tx9v</sha1>
</revision>
</page>
<page>
<title>Template:Userboxtop</title>
<ns>10</ns>
<id>3455965</id>
<revision>
<id>629406674</id>
<parentid>558575540</parentid>
<timestamp>2014-10-13T07:20:48Z</timestamp>
<contributor>
<username>Callanecc</username>
<id>10440891</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Userboxtop: [[WP:High-risk templates|Highly visible template]]: Allowing template editors, around 44000 transclusions ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and ad</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="675">{|class=&quot;userboxes&quot; style=&quot;margin-left: {{{left|1}}}em;; margin-bottom: 0.5em; width: 248px; border: {{{bordercolor|#99B3FF}}} solid 1px; background-color: {{{backgroundcolor|#FFFFFF}}}; color: {{{textcolor|#000000}}}; float: {{{2|{{{align|right}}}}}}; {{{extra-css|}}}&quot;
|&lt;div style=&quot;text-align: center; font-size: 120%; font-weight: bold;&quot;&gt;{{{1|{{{toptext|[[Wikipedia:Userboxes|Userboxes]]}}}}}}&lt;/div&gt;&lt;includeonly&gt;{{ns0|[[category:articles incorrectly using userbox templates]]}}&lt;/includeonly&gt;&lt;noinclude&gt;
|}
&lt;!--
PLEASE DO NOT ADD DOCUMENTATION/CATEGORIES/INTERWIKIS HERE
--&gt;
{{Documentation}}
&lt;!--
MAKE ADDITIONS TO THE /doc SUBPAGE INSTEAD, THANKS
--&gt;
&lt;/noinclude&gt;</text>
<sha1>on0stjfh0pm4osk3rq6qejncyzxivf9</sha1>
</revision>
</page>
<page>
<title>Template:Userboxbottom</title>
<ns>10</ns>
<id>3455977</id>
<revision>
<id>651351551</id>
<parentid>374573698</parentid>
<timestamp>2015-03-14T16:19:40Z</timestamp>
<contributor>
<username>Huon</username>
<id>654492</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Userboxbottom: Allow template editors consistently with [[Template:Userboxtop]] ([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="71">&lt;includeonly&gt;|}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>etvr1dix8054kr1xr047lvyxd8q8zeh</sha1>
</revision>
</page>
<page>
<title>Template:User Asia</title>
<ns>10</ns>
<id>20355530</id>
<revision>
<id>725588995</id>
<parentid>567183393</parentid>
<timestamp>2016-06-16T16:30:08Z</timestamp>
<contributor>
<username>مجتبیٰ</username>
<id>28145866</id>
</contributor>
<comment>Color</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="309">{{userbox
| border-c = #000000
| id = [[File:LocationAsia.svg|60px]]
| id-c = white
| info = This user is an '''[[Asian people|Asian]]'''.
| info-c = lightblue
| info-fc = {{{info-fc|black}}}
| info-s = {{{info-s|8}}}
}}&lt;noinclude&gt;
[[Category:WikiProject user templates|Asia]]
&lt;/noinclude&gt;</text>
<sha1>m2vm7qiufzv8ygqhzh3rgqtv7yn49uj</sha1>
</revision>
</page>
<page>
<title>Template:User Asian</title>
<ns>10</ns>
<id>45606054</id>
<revision>
<id>725906423</id>
<parentid>725588824</parentid>
<timestamp>2016-06-18T17:02:52Z</timestamp>
<contributor>
<username>Godsy</username>
<id>23257138</id>
</contributor>
<comment>Undid revision 725588824 by [[Special:Contributions/مجتبیٰ|مجتبیٰ]] ([[User talk:مجتبیٰ|talk]]) please gain consensus to add that commentary to this template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="490">{{userbox-2
| border-c = {{{1|#000}}}
| border-s = {{{9|1}}}
| id1 = {{{3|[[Image:RegionsofAsia-Census.PNG|52px]]}}}
| id1-c = {{{1|#000}}}
| id1-s = 12
| id2 = {{{5|[[Image:Kemonomimi rabbit.svg|30px]]}}}
| id2-c = {{{7|#000}}}
| id2-s = 12
| info = {{{4|This user is of '''[[Asian people|Asian]]''' ancestry.}}}
| info-c = {{{2|#fff}}}
| info-fc = {{{8|#000}}}
| info-a = center
}}&lt;noinclude&gt;
[[Category:Asia ethnic group user templates|Asian]]
&lt;/noinclude&gt;</text>
<sha1>ncefcpyxc0yua44ryfty5dnlag26mr7</sha1>
</revision>
</page>
<page>
<title>Template:User Catholic</title>
<ns>10</ns>
<id>16513865</id>
<revision>
<id>791610330</id>
<parentid>757047639</parentid>
<timestamp>2017-07-21T10:39:30Z</timestamp>
<contributor>
<username>R'n'B</username>
<id>2300502</id>
</contributor>
<comment>category was redirected</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="361">{{userbox
| border-c = gold
| id = [[Image:Emblem of the Papacy.svg|30px]]
| id-c = gold
| info = This user is '''[[Catholic Church|Catholic]]'''.
| info-c = white
| info-a = center
| usercategory = Catholic Wikipedians
| nocat = {{{nocat|}}}
}}&lt;noinclude&gt;
[[Category:Catholic Wikipedians]]
[[Category:Catholic user templates| ]]
&lt;/noinclude&gt;</text>
<sha1>lhn5t45x2ezwoj1lt0vw61e99ozdddx</sha1>
</revision>
</page>
<page>
<title>Template:User male</title>
<ns>10</ns>
<id>11244667</id>
<revision>
<id>804536923</id>
<parentid>800332153</parentid>
<timestamp>2017-10-09T17:20:56Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:User male]]&quot;: [[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="477">{{userbox
| border-c = #1C8EBF
| id-c = #87CEFA
| id-op = font-size:xx-large;
| id = ♂
| info-c = #87CEFA
| info-s = 8
| info-fc = #1C8EBF
| info-a = center
| info = This contributor to Wikipedia is '''[[Male|&lt;span style=&quot;color: #1C8EBF;&quot;&gt;Male&lt;/span&gt;]]'''{{#if:{{{humour|}}}|, so don't call him female!|.}}
| usercategory = Male Wikipedians
| nocat = {{{nocat|}}}
}}&lt;noinclude&gt;{{-}}&lt;br&gt;
{{User male|humour=yes}}
{{-}}&lt;br&gt;
{{doc}}&lt;/noinclude&gt;</text>
<sha1>nxajw50754e09bnb6q9uz3sqh2g4bti</sha1>
</revision>
</page>
<page>
<title>Template:User Teen</title>
<ns>10</ns>
<id>3988440</id>
<revision>
<id>499245041</id>
<parentid>328626165</parentid>
<timestamp>2012-06-25T06:56:39Z</timestamp>
<contributor>
<username>WOSlinker</username>
<id>3138265</id>
</contributor>
<minor/>
<comment>add cat</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="273">{{userbox
| border-c = black
| id = [[Image:Xbox_and_controller.jpeg|40px]]
| id-c = white
| info = This user is a [[Teen]].
| info-c = white
| info-fc = {{{info-fc|black}}}
| info-s = {{{info-s|8}}}
}}&lt;noinclude&gt;
[[Category:Userboxes|Teen]]
&lt;/noinclude&gt;</text>
<sha1>6tnhjgavlv9bfpuzxbj8zzvw4dmqnxk</sha1>
</revision>
</page>
<page>
<title>Template:=)</title>
<ns>10</ns>
<id>30498131</id>
<redirect title="Template:Smiley" />
<revision>
<id>488795640</id>
<parentid>408259056</parentid>
<timestamp>2012-04-23T11:05:20Z</timestamp>
<contributor>
<username>AGK</username>
<id>1000453</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:=): [[Wikipedia:High-risk templates|Highly-visible template]] (thousands of transclusions) (‎[edit=autoconfirmed] (indefinite) ‎[move=sysop] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="29">#REDIRECT [[Template:Smiley]]</text>
<sha1>mazrue3wmolfu85l825mw92pp5r6obr</sha1>
</revision>
</page>
<page>
<title>Template:Current time</title>
<ns>10</ns>
<id>4489555</id>
<revision>
<id>821200871</id>
<parentid>800967541</parentid>
<timestamp>2018-01-19T00:29:13Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Current time]]&quot;: [[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] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="2559">{{#switch:{{{1}}}
|Coordinated Universal Time=Current UTC is {{CURRENTTIME}}
|UTC-1=Current time for {{{1}}} is {{utc|23}}
|UTC-2=Current time for {{{1}}} is {{utc|22}}
|UTC-2:30=Current time for {{{1}}} is {{utc|21|30}}
|UTC-3=Current time for {{{1}}} is {{utc|21}}
|UTC-3:30=Current time for {{{1}}} is {{utc|20|30}}
|UTC-4=Current time for {{{1}}} is {{utc|20}}
|UTC-5=Current time for {{{1}}} is {{utc|19}}
|UTC-6=Current time for {{{1}}} is {{utc|18}}
|UTC-7=Current time for {{{1}}} is {{utc|17}}
|UTC-8=Current time for {{{1}}} is {{utc|16}}
|UTC-9=Current time for {{{1}}} is {{utc|15}}
|UTC-9:30=Current time for {{{1}}} is {{utc|14|30}}
|UTC-10=Current time for {{{1}}} is {{utc|14}}
|UTC-11=Current time for {{{1}}} is {{utc|13}}
|UTC-12=Current time for {{{1}}} is {{utc|12}}
|UTC+0:20=Current time for {{{1}}} is {{utc|0|20}}
|UTC+0:30=Current time for {{{1}}} is {{utc|0|30}}
|UTC+1=Current time for {{{1}}} is {{utc|1}}
|UTC+2=Current time for {{{1}}} is {{utc|2}}
|UTC+3=Current time for {{{1}}} is {{utc|3}}
|UTC+3:30=Current time for {{{1}}} is {{utc|3|30}}
|UTC+4=Current time for {{{1}}} is {{utc|4}}
|UTC+4:30=Current time for {{{1}}} is {{utc|4|30}}
|UTC+4:51=Current time for {{{1}}} is {{utc|4|51}}
|UTC+5=Current time for {{{1}}} is {{utc|5}}
|UTC+5:30=Current time for {{{1}}} is {{utc|5|30}}
|UTC+5:40=Current time for {{{1}}} is {{utc|5|40}}
|UTC+5:45=Current time for {{{1}}} is {{utc|5|45}}
|UTC+6=Current time for {{{1}}} is {{utc|6}}
|UTC+6:30=Current time for {{{1}}} is {{utc|6|30}}
|UTC+7=Current time for {{{1}}} is {{utc|7}}
|UTC+7:20=Current time for {{{1}}} is {{utc|7|20}}
|UTC+7:30=Current time for {{{1}}} is {{utc|7|30}}
|UTC+8=Current time for {{{1}}} is {{utc|8}}
|UTC+8:30=Current time for {{{1}}} is {{utc|8|30}}
|UTC+8:45=Current time for {{{1}}} is {{utc|8|45}}
|UTC+9=Current time for {{{1}}} is {{utc|9}}
|UTC+9:30=Current time for {{{1}}} is {{utc|9|30}}
|UTC+10=Current time for {{{1}}} is {{utc|10}}
|UTC+10:30=Current time for {{{1}}} is {{utc|10|30}}
|UTC+11=Current time for {{{1}}} is {{utc|11}}
|UTC+11:30=Current time for {{{1}}} is {{utc|11|30}}
|UTC+12=Current time for {{{1}}} is {{utc|12}}
|UTC+12:45=Current time for {{{1}}} is {{utc|12|45}}
|UTC+13=Current time for {{{1}}} is {{utc|13}}
|UTC+13:45=Current time for {{{1}}} is {{utc|13|45}}
|UTC+14=Current time for {{{1}}} is {{utc|14}}
|#default=Current UTC is {{CURRENTTIME}}
}}&lt;noinclude&gt;
[[Category:Date-computing templates based on current time]]
{{DEFAULTSORT:current time}}
&lt;/noinclude&gt;</text>
<sha1>ivj7uebyaiqaoxvf6rh5yvcyu2y7c13</sha1>
</revision>
</page>
<page>
<title>Template:Smiley</title>
<ns>10</ns>
<id>2329835</id>
<revision>
<id>818315659</id>
<parentid>818313896</parentid>
<timestamp>2018-01-02T21:25:17Z</timestamp>
<contributor>
<username>Ahecht</username>
<id>2016996</id>
</contributor>
<comment>Fix winking smiley having blushing tooltip</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="2699">&lt;noinclude&gt;{{pp-template|small=yes}}&lt;/noinclude&gt;&lt;noinclude&gt;{{distinguish|Template:Smile}}
&lt;/noinclude&gt;&lt;abbr title=&quot;{{SAFESUBST:&lt;noinclude/&gt;#ifeq:{{{title|{{{desc|}}}}}}||{{SAFESUBST:&lt;noinclude/&gt;#switch:{{SAFESUBST:&lt;noinclude/&gt;lc:{{{1|}}}}}
|1|:)|:-)|smile|23|{{SAFESUBST:&lt;noinclude/&gt;=}}v{{SAFESUBST:&lt;noinclude/&gt;=}}|vsmile|#default = Smiling face
|2|(|:(|:-(|sad|sadface|sad face|frown = Sad face
|3|;|;)|;-)|wink|12|wink2|13|wink3 = Winking face
|4|:$|:-$|blush|embarrassed = Blushing face
|5|d|:d|:-d|grin = Grinning face
|6|o|:o|:-o|surprise|surprised = Surprised face
|7|p|:p|:-p|tongue = Sticking tongue out
|8|%)|%-)|confused = Confused face
|9|8)|8-)|shade|shades = Shades because everything is cool
|10|,|:'(|:'-(|cry|crying|tears = Crying face
|11|lightbulb|idea = Lightbulb
|14|big-grin|biggrin = Big grin face
|15|devil-grin|devil|evil = Evil grin face
|16|kiss = Kissing face
|17|smirk = Smirking face
|18|big-cry|bigcry|sob = Crying face
|19|glasses|nerd = Nerd with glasses face
|20|0:)|0:-)|angel = Angelic face
|21|ttth = Talk to the hand!
|22|awesome = Awesome face
|24|dp|dontpanic = Don't panic!
|25|teeth = Toothy grin
|26|angry = Angry face
|27|raspberry = Raspberry
|28|very-confused = Very confused face
|29|sarcastic = Sarcastic}}|{{{title|{{{desc|}}}}}}}}&quot; style=&quot;border-bottom: none;&quot;&gt;[[File:{{SAFESUBST:&lt;noinclude/&gt;#switch:{{SAFESUBST:&lt;noinclude/&gt;lc:{{{1|}}}}}
|1|:)|:-)|smile|#default = Face-smile.svg
|2|(|:(|:-(|sad|sadface|sad face|frown = Face-sad.svg
|3|;|;)|;-)|wink = Face-wink.svg
|4|:$|:-$|blush|embarrassed = Face-blush.svg
|5|d|:d|:-d|grin = Face-grin.svg
|6|o|:o|:-o|surprise|surprised = Face-surprise.svg
|7|p|:p|:-p|tongue = Face-tongue.svg
|8|%)|%-)|confused = Face-confused.svg
|9|8)|8-)|shade|shades = Emblem-cool.svg
|10|,|:'(|:'-(|cry|crying|tears = Cry.png
|11|lightbulb|idea = Lightbulb.png
|12|wink2 = Smile_eye.png
|13|wink3 = Wink.png
|14|big-grin|biggrin = Face-grin.svg
|15|devil-grin|devil|evil = Face-devil-grin.svg
|16|kiss = Face-kiss.svg
|17|smirk = Face-smile-big.svg
|18|big-cry|bigcry|sob = Face-crying.svg
|19|glasses|nerd = Face-glasses.svg
|20|0:)|0:-)|angel = Face-angel.svg
|21|ttth = Face-hand.svg
|22|awesome = 718smiley.svg
|23|{{SAFESUBST:&lt;noinclude/&gt;=}}v{{SAFESUBST:&lt;noinclude/&gt;=}}|vsmile = Emoticon_{{SAFESUBST:&lt;noinclude/&gt;=}}v{{SAFESUBST:&lt;noinclude/&gt;=}}.svg
|24|dp|dontpanic = dont panic.svg
|25|teeth = Teeth.png
|26|angry = Face-angry red.png
|27|raspberry = Ras.gif
|28|very-confused = Confused.png
|29|sarcastic = Sarcastic.gif}}|{{SAFESUBST:&lt;noinclude/&gt;#if:{{{size|}}}|{{{size}}}|18px}}|link=]]&lt;/abbr&gt;&lt;noinclude&gt;
&lt;!-- Please add this template's categories to the /doc subpage - thanks! --&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>02uh7kw67g5mk97l93xm9nevyizpfqi</sha1>
</revision>
</page>
<page>
<title>Template:User Earth</title>
<ns>10</ns>
<id>9915699</id>
<revision>
<id>722339320</id>
<parentid>722334899</parentid>
<timestamp>2016-05-27T13:10:37Z</timestamp>
<contributor>
<username>Theroadislong</username>
<id>2001020</id>
</contributor>
<comment>Reverted 1 edit by [[Special:Contributions/Yes ji|Yes ji]] ([[User talk:Yes ji|talk]]): Please don't keep fiddling with templates without explanation. ([[WP:TW|TW]])</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="291">{{userbox
| border-c = black
| id = [[Image:The_Earth_seen_from_Apollo_17.jpg|40px]]
| id-c = black
| info = This user hails from or lives on '''[[Earth]]'''.
| info-c = #20B2AA
| info-fc = 11
}}&lt;noinclude&gt;
[[Category:Nation of residence user templates|Earth]]
&lt;/noinclude&gt;</text>
<sha1>czb5sy26xzp4vv0i87go5xo5lknlaib</sha1>
</revision>
</page>
<page>
<title>Template:User in Asia</title>
<ns>10</ns>
<id>29275259</id>
<revision>
<id>794123201</id>
<parentid>793163279</parentid>
<timestamp>2017-08-06T00:14:14Z</timestamp>
<contributor>
<username>Buaidh</username>
<id>122305</id>
</contributor>
<comment>|region=Asia|adj=Asian|demonym=Asian|an=an</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="507">&lt;includeonly&gt;{{uir
|region=Asia|adj=Asian|demonym=Asian|an=an
|title={{{title|'''[[Asia|&lt;span style=&quot;color:white;&quot;&gt;Asia&lt;/span&gt;]]'''}}}
|id={{{id|[[File:Asia (orthographic projection).svg|x39px]]}}}
|id-a={{{id-p|right}}}
|id-c={{{id-c|#346733}}}
|id-w={{{id-p|42}}}
|info-c={{{info-c|#346733}}}
|info-fc={{{info-fc|white}}}
|activity={{{activity|lives in}}}
|option={{{1|1}}}
|float={{{float|left}}}
|align={{{align|center}}}
|nocat={{{nocat|false}}}
}}&lt;/includeonly&gt;&lt;noinclude&gt;{{documentation}}&lt;/noinclude&gt;</text>
<sha1>pm1leyeghqolapfmpr42g7atebg3z5p</sha1>
</revision>
</page>
<page>
<title>Template:User time</title>
<ns>10</ns>
<id>3566217</id>
<revision>
<id>794414420</id>
<parentid>659667342</parentid>
<timestamp>2017-08-07T21:52:03Z</timestamp>
<contributor>
<username>Plastikspork</username>
<id>5075409</id>
</contributor>
<comment>Add float</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="448">{{userbox
| float = {{{float|}}}
| border-c = blue
| id = [[Image:Wall clock.jpg|40px]]
| id-c = white
| info = The time is currently '''{{CURRENTHOUR}}:{{CURRENTMINUTE}}:{{CURRENTSECOND}} &lt;b&gt;[[Coordinated Universal Time|&lt;span style=&quot;color:white;&quot;&gt;UTC&lt;/span&gt;]]&lt;/b&gt;.
| info-c = blue
| info-fc = {{{info-fc|white}}}
| info-s = {{{info-s|8}}}
| info-op = text-align:center;
}}&lt;noinclude&gt;
[[Category:Userboxes|time]]
&lt;/noinclude&gt;</text>
<sha1>1nx68us9rouvy2rn8xp6bt0g0a1wbyf</sha1>
</revision>
</page>
<page>
<title>Template:User time zone</title>
<ns>10</ns>
<id>6539105</id>
<revision>
<id>758179448</id>
<parentid>706420007</parentid>
<timestamp>2017-01-03T22:56:57Z</timestamp>
<contributor>
<username>FDMS4</username>
<id>19115920</id>
</contributor>
<minor/>
<comment>unlinking files requiring attribution</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="579">{{Userbox
|id = {{#switch:{{{2}}}|watch=[[File:Noia_64_apps_xclock.png{{!}}43px]]|clock=[[File:Wall clock.png{{!}}43px]]|alarm=[[File:Exquisite-kalarm.png{{!}}43px]]|world=[[File:Nuvola apps kworldclock.png{{!}}43px]]|{{#if:{{{2|}}}|{{#if:{{{3|}}}|[[{{{3}}}{{!}}{{{2}}}]]|[[Template:User time zone{{!}}{{{2}}}]]}}|[[Template:User time zone{{!}}{{{1}}}]]}}}}
|id-c = #ccc
|id-s = 12
|info = This user's time zone is '''{{#if:{{{3|}}}|[[{{{3}}}|{{{1}}}]]|[[{{{1}}}]]}}'''.
|info-c = #fff
|border-c = #ccc
}}&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>ti1syuq4igmk8nlr0mfumgl3d2m6byq</sha1>
</revision>
</page>
<page>
<title>Template:Ping</title>
<ns>10</ns>
<id>22255387</id>
<redirect title="Template:Reply to" />
<revision>
<id>772296594</id>
<parentid>772147409</parentid>
<timestamp>2017-03-26T13:07:18Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<comment>Per talk page request</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="91">#REDIRECT [[Template:Reply to]]
{{Redirect category shell|
{{R from template shortcut}}
}}</text>
<sha1>biae8ilj870ah18wwsc7nxe05fi2yjz</sha1>
</revision>
</page>
<page>
<title>Template:Abbr</title>
<ns>10</ns>
<id>2557713</id>
<revision>
<id>729977787</id>
<parentid>717635601</parentid>
<timestamp>2016-07-15T21:52:51Z</timestamp>
<contributor>
<username>Matt Fitzpatrick</username>
<id>291848</id>
</contributor>
<comment>escaping &quot; as &amp;amp;quot; in title attribute per talk page request</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="304">&lt;abbr {{#if:{{{class|}}}|class=&quot;{{{class}}}&quot;}} {{#if:{{{id|}}}|id=&quot;{{{id}}}&quot;}} {{#if:{{{style|}}}|style=&quot;{{{style}}}&quot;}} title=&quot;{{#tag:nowiki|{{#invoke:String|replace|{{{2|}}}|&quot;|&amp;quot;}}}}&quot;&gt;{{#switch: {{{3|}}}
| i | IPA = {{IPA|{{{1|}}}}}
| {{{1|}}} }}&lt;/abbr&gt;&lt;noinclude&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>lsg55nurv2zqn8xx8h6dxaaqq3y08tu</sha1>
</revision>
</page>
<page>
<title>Template:Age</title>
<ns>10</ns>
<id>4844043</id>
<revision>
<id>755586875</id>
<parentid>690395460</parentid>
<timestamp>2016-12-19T00:05:46Z</timestamp>
<contributor>
<username>Nyttend</username>
<id>1960810</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Age]]&quot;: Discussion at WP:AN suggests that this is no longer cascade-protected ([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="228">&lt;includeonly&gt;{{#expr:({{{4|{{CURRENTYEAR}}}}})-({{{1}}})-(({{{5|{{CURRENTMONTH}}}}})&lt;({{{2}}})or({{{5|{{CURRENTMONTH}}}}})=({{{2}}})and({{{6|{{CURRENTDAY}}}}})&lt;({{{3}}}))}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>m4vdyerv7nnuns17to50awbav4tprsb</sha1>
</revision>
</page>
<page>
<title>Template:Birth date and age</title>
<ns>10</ns>
<id>6658694</id>
<revision>
<id>775997486</id>
<parentid>775997407</parentid>
<timestamp>2017-04-18T10:20:25Z</timestamp>
<contributor>
<username>CambridgeBayWeather</username>
<id>294180</id>
</contributor>
<comment>Protecvtion template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="1086">&lt;includeonly&gt;&lt;span style=&quot;display:none&quot;&gt; (&lt;span class=&quot;bday&quot;&gt;{{{1|{{{year}}}}}}-{{padleft:{{{2|{{{month}}}}}}|2|0}}-{{padleft:{{{3|{{{day}}}}}}|2|0}}&lt;/span&gt;) &lt;/span&gt;{{#if:{{{df|}}}|{{#expr:{{{3|{{{day}}}}}}}} {{MONTHNAME|{{{2|{{{month}}}}}}}}|{{MONTHNAME|{{{2|{{{month}}}}}}}} {{#expr:{{{3|{{{day}}}}}}}},}} {{{1|{{{year}}}}}}&lt;span class=&quot;noprint ForceAgeToShow&quot;&gt; (age&amp;nbsp;{{age | {{{1|{{{year}}}}}} | {{{2|{{{month}}}}}} | {{{3|{{{day}}}}}} }})&lt;/span&gt;&lt;!--
-- Error checks --
--&gt;{{#ifexpr: ( {{{1|{{{year}}}}}} &gt; {{CURRENTYEAR}} ) OR ( {{CURRENTYEAR}} - {{{1|{{{year}}}}}} &gt; 150 )
| &amp;#32;{{error|invalid year}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{2|{{{month}}}}}} &gt; 12 ) OR ( {{{2|{{{month}}}}}} &lt; 1 )
| &amp;#32;{{error|invalid month}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}{{#ifexpr: ( {{{3|{{{day}}}}}} &gt; 31 ) OR ( {{{3|{{{day}}}}}} &lt; 1 )
| &amp;#32;{{error|invalid day}}{{main other|[[Category:Pages using age template with invalid date]]}}
}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>3tbf0duyuz5tu786zv55afzmh4s1bc1</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">{{&lt;includeonly&gt;safesubst:&lt;/includeonly&gt;#invoke:Separated entries|br}}&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>3qzqyo0vc2bkjx7dik52fp751jwcnq3</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">&lt;div style=&quot;clear:{{{1|both}}};&quot;&gt;&lt;/div&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</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}}}}}}&lt;noinclude&gt;
&lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</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">&lt;includeonly&gt;&lt;!--
--&gt;{{#ifeq:{{lc:{{SUBPAGENAME}}}} |{{{override|doc}}}
| &lt;!--(this template has been transcluded on a /doc or /{{{override}}} page)--&gt;
&lt;/includeonly&gt;&lt;!--
--&gt;{{#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}}]]}}}'''.&lt;br /&gt;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}}}}}}}}.
}}
}}&lt;!--
--&gt;{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}&lt;!--
--&gt;{{#if:{{{inhibit|}}} |&lt;!--(don't categorize)--&gt;
| &lt;includeonly&gt;&lt;!--
--&gt;{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}
| [[Category:{{#switch:{{SUBJECTSPACE}} |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
| [[Category:Documentation subpages without corresponding pages]]
}}&lt;!--
--&gt;&lt;/includeonly&gt;
}}&lt;!--
(completing initial #ifeq: at start of template:)
--&gt;&lt;includeonly&gt;
| &lt;!--(this template has not been transcluded on a /doc or /{{{override}}} page)--&gt;
}}&lt;!--
--&gt;&lt;/includeonly&gt;&lt;noinclude&gt;{{Documentation}}&lt;/noinclude&gt;</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">&lt;div class=&quot;hlist&quot;&gt;{{{1}}}&lt;/div&gt;&lt;noinclude&gt;
{{documentation|content=A separate version of the flatlist template for use on the microformat documentation pages.}}
&lt;/noinclude&gt;</text>
<sha1>sxo2o920rctg4u89zzp6mnyzszcql6m</sha1>
</revision>
</page>
<page>
<title>Template:Getalias</title>
<ns>10</ns>
<id>12955867</id>
<revision>
<id>647326397</id>
<parentid>380731118</parentid>
<timestamp>2015-02-16T01:18:32Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Getalias: [[WP:High-risk templates|Highly visible template]]: allow template editors ([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="125">{{country data {{{1}}}|getalias/core|name={{{2|}}}|variant={{{variant|{{{3|}}}}}}}}&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>anrk3h1ng0trq4l9xqx1we1umkopk3n</sha1>
</revision>
</page>
<page>
<title>Template:Infobox</title>
<ns>10</ns>
<id>891845</id>
<revision>
<id>765690941</id>
<parentid>590143656</parentid>
<timestamp>2017-02-15T21:41:48Z</timestamp>
<contributor>
<username>Andrew Gray</username>
<id>126457</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Infobox]]&quot;: Degrade to template permission per request, in line with [[WP:PP]] ([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="145">{{#invoke:Infobox|infobox}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go in the /doc subpage, and interwikis go in Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>kavlqnbr7pew8bhy59a3n9jmoau5jt4</sha1>
</revision>
</page>
<page>
<title>Template:Infobox Wikipedia user/doc</title>
<ns>10</ns>
<id>15621539</id>
<revision>
<id>811852626</id>
<parentid>809881303</parentid>
<timestamp>2017-11-24T12:30:01Z</timestamp>
<contributor>
<username>Chicbyaccident</username>
<id>16917609</id>
</contributor>
<comment>Proposing to change the dummy profile picture to the inofficial thanks notification smilie of Wikipedia, for positivity</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="16757">{{Documentation subpage}}
&lt;!-- PLEASE ADD CATEGORIES AT THE BOTTOM OF THIS PAGE. --&gt;
== Usage ==
Copy and paste the template below. All parameters are optional. Parameter names '''must''' be in lower case.
{{Infobox Wikipedia user
&lt;!-- INFOBOX FORMATTING --------&gt;
| abovecolor =
| color =
| fontcolor =
| abovefontcolor =
| headerfontcolor =
| tablecolor =
&lt;!-- LEAD INFORMATION ----------&gt;
| status = {{{status}}}
| image = Echo_thanks.svg
| image_caption = {{{image_caption}}}
| honorific_prefix = {{{honorific_prefix}}}
| name = {{{name}}}
| honorific_suffix = {{{honorific_suffix}}}
| role = {{{role}}}
| birthname = {{{birthname}}}
| real_name = {{{real_name}}}
| gender = {{{gender}}}
| custom_gender = {{{custom_gender}}}
| pronoun = {{{pronoun}}}
| languages = {{{languages}}}
| birthdate = {{{birthdate}}}
| birthplace = {{{birthplace}}}
| location = {{{location}}}
| country = {{{country}}}
| timezone = {{{timezone}}}
| current_time = {{{current_time}}}
| nationality = {{{nationality}}}
| ethnicity = {{{ethnicity}}}
| race = {{{race}}}
| height = {{{height}}}
| weight = {{{height}}}
| hair = {{{hair}}}
| eyes = {{{eyes}}}
| handedness = {{{handedness}}}
| blood_type = {{{blood_type}}}
| sexuality = {{{sexuality}}}
| iq = {{{iq}}}
| personality_type = {{{personality_type}}}
| alignment = {{{alignment}}}
&lt;!-- FAMILY &amp; FRIENDS ----------&gt;
| marital status = {{{marital status}}}
| spouse = {{{spouse}}}
| girlfriend = {{{girlfriend}}}
| boyfriend = {{{boyfriend}}}
| parents = {{{parents}}}
| children = {{{children}}}
| siblings = {{{siblings}}}
| pets = {{{pets}}}
&lt;!-- EDUCATION &amp; EMPLOYMENT ----&gt;
| occupation = {{{occupation}}}
| employer = {{{employer}}}
| education = {{{education}}}
| primaryschool = {{{primaryschool}}}
| intschool = {{{intschool}}}
| highschool = {{{highschool}}}
| college = {{{college}}}
| university = {{{university}}}
| classes = {{{classes}}}
&lt;!-- INTERESTS &amp; BELIEFS -------&gt;
| hobbies = {{{hobbies}}}
| religion = {{{religion}}}
| politics = {{{politics}}}
| aliases = {{{aliases}}}
| movies = {{{movies}}}
| shows = {{{shows}}}
| books = {{{books}}}
| interests = {{{interests}}}
&lt;!-- CONTACT INFO --------------&gt;
| website = {{{website}}}
| blog = {{{blog}}}
| email = {{{email}}}
| icq = {{{icq}}}
| aim = {{{aim}}}
| gtalk = {{{gtalk}}}
| jabber = {{{jabber}}}
| skype = {{{skype}}}
| msn = {{{msn}}}
| yahoo = {{{yahoo}}}
| mac = {{{mac}}}
| irc = {{{irc}}}
| facebook = {{{facebook}}}
| google+ = {{{google+}}}
| instagram = {{{instagram}}}
| linkedin = {{{linkedin}}}
| myspace = {{{myspace}}}
| pinterest = {{{pinterest}}}
| twitter = {{{twitter}}}
| youtube = {{{youtube}}}
| flickr = {{{flickr}}}
&lt;!-- SUBPAGES -----------------&gt;
| subpages = {{{subpages}}}
&lt;!-- ACCOUNT STATISTICS -------&gt;
| joined_date = {{{joined_date}}}
| first_edit = {{{first_edit}}}
| autoconfirmed = {{{autoconfirmed}}}
| account_creator = {{{account_creator}}}
| autopatrolled = {{{autopatrolled}}}
| file_mover = {{{file_mover}}}
| mass_message_sender = {{{mass_message_sender}}}
| new_page_reviewer = {{{new_page_reviewer}}}
| reviewer = {{{reviewer}}}
| rollbacker = {{{rollbacker}}}
| template_editor = {{{template_editor}}}
| admin = {{{admin}}}
| edit_filter_manager = {{{edit_filter_manager}}}
| bureaucrat = {{{bureaucrat}}}
| check_user = {{{check_user}}}
| overseer = {{{overseer}}}
| edit_count = {{{edit_count}}}
| permissions = {{{permissions}}}
| signature = {{{signature}}}
&lt;!-- USERBOXES ----------------&gt;
| userboxes = {{{userboxes}}}
&lt;!-- CUSTOM FIELDS ------------&gt;
| custom_header = {{{custom_header}}}
| custom_data = {{{custom_data}}}
| custom_label1 = {{{custom_label1}}}
| custom_data1 = {{{custom_data1}}}
| custom_label2 = {{{custom_label2}}}
| custom_data2 = {{{custom_data2}}}
| custom_label3 = {{{custom_label3}}}
| custom_data3 = {{{custom_data3}}}
| custom_label4 = {{{custom_label4}}}
| custom_data4 = {{{custom_data4}}}
| custom_label5 = {{{custom_label5}}}
| custom_data5 = {{{custom_data5}}}
| custom_label6 = {{{custom_label6}}}
| custom_data6 = {{{custom_data6}}}
| custom_label7 = {{{custom_label7}}}
| custom_data7 = {{{custom_data7}}}
| custom_label8 = {{{custom_label8}}}
| custom_data8 = {{{custom_data8}}}
| custom_label9 = {{{custom_label9}}}
| custom_data9 = {{{custom_data9}}}
}}
&lt;pre style=&quot;overflow: auto&quot;&gt;
{{Infobox Wikipedia user
&lt;!-- INFOBOX FORMATTING --------&gt;
| abovecolor =
| color =
| fontcolor =
| abovefontcolor =
| headerfontcolor =
| tablecolor =
&lt;!-- LEAD INFORMATION ----------&gt;
| title = &lt;!-- optional, defaults to {{BASEPAGENAME}} --&gt;
| status =
| image =
| image_caption =
| image_width =
| name =
| birthname =
| real_name =
| gender = &lt;!-- used to display icon at top. Supports male, female, other, or a custom value. --&gt;
| custom_gender = &lt;!-- used to display &quot;Gender&quot; field in list --&gt;
| pronoun =
| languages =
| birthdate =
| birthplace =
| location =
| country =
| timezone =
| current_time = &lt;!-- example for San Francisco: {{current time|UTC-8}} --&gt;
| nationality =
| ethnicity =
| race =
| height =
| weight =
| hair =
| eyes =
| handedness =
| blood_type =
| sexuality =
| iq =
| personality_type =
| alignment =
&lt;!-- FAMILY &amp; FRIENDS ----------&gt;
| marital status =
| spouse =
| girlfriend =
| boyfriend =
| children =
| siblings =
| parents =
| pets =
&lt;!-- EDUCATION &amp; EMPLOYMENT ----&gt;
| occupation =
| employer =
| education =
| primaryschool =
| intschool =
| highschool =
| college =
| university =
| classes = &lt;!-- For use with Wikipedia Campus Ambassadors --&gt;
&lt;!-- INTERESTS &amp; BELIEFS -------&gt;
| hobbies =
| religion =
| politics =
| aliases =
| movies =
| shows =
| books =
| interests =
&lt;!-- CONTACT INFO --------------&gt;
| website = &lt;!-- {{URL|example.com}} --&gt;
| blog = &lt;!-- {{URL|example.com}} --&gt;
| email = &lt;!-- {{no spam|account|example.com}} --&gt;
| icq =
| aim =
| gtalk =
| jabber =
| skype =
| msn =
| yahoo =
| mac =
| irc =
| facebook =
| google+ =
| instagram =
| linkedin =
| myspace =
| pinterest =
| twitter =
| youtube =
| flickr =
&lt;!-- SUBPAGES -----------------&gt;
| subpages =
&lt;!-- ACCOUNT STATISTICS -------&gt;
| joined_date =
| first_edit =
| autoconfirmed = &lt;!-- overrides confirmed parameter --&gt;
| confirmed = &lt;!-- may be used in place of autoconfirmed parameter (displays &quot;Confirmed&quot; as label) --&gt;
| account_creator =
| autopatrolled =
| file_mover =
| mass_message_sender =
| new_page_reviewer =
| reviewer =
| rollbacker =
| template_editor =
| admin =
| edit_filter_manager =
| bureaucrat =
| check_user =
| overseer =
| edit_count =
| permissions =
| signature =
&lt;!-- USERBOXES ----------------&gt;
| userboxes =
&lt;!-- CUSTOM FIELDS ------------&gt;
| custom_header =
| custom_data =
| custom_label1 =
| custom_data1 =
| custom_label2 =
| custom_data2 =
| custom_label3 =
| custom_data3 =
| custom_label4 =
| custom_data4 =
| custom_label5 =
| custom_data5 =
| custom_label6 =
| custom_data6 =
| custom_label7 =
| custom_data7 =
| custom_label8 =
| custom_data8 =
| custom_label9 =
| custom_data9 =
}}
&lt;/pre&gt;
{{clear}}
===Microformats===
{{UF-hcard-person}}
==Example==
{{Infobox Wikipedia user
| name = Wikipedia user
| birthdate = {{Birth date and age|1986|1|1}}
| birthplace = [[Dearborn, Michigan|Dearborn, MI]]
| country = [[United States]]
| nationality = [[United States|American]]
| race = [[Caucasian race|Caucasian]]
| gender = Female
| location = [[Houghton, Michigan|Houghton, MI]]
| eyes = Brown
| blood_type = Type O
| sexuality = [[Heterosexual]]
| iq = 136
| height = 5'8&quot;
| weight = 116 lbs.
| timezone = Central Time Zone
| pets = 2 dogs &lt;!-- If you are supposed to put pet names, please fix this--&gt;
| children = 1
| marital status = Married
| occupation = Clerk
| highschool = [[Dearborn High School]]
| college = [[Henry Ford Community College]]
| hobbies = Camping, cooking
| religion = [[Presbyterian]]
| politics = [[Democratic Party (United States)|Democrat]]
| movies = [[Forrest Gump]], [[Avatar (2009 film)|Avatar]]
| shows = [[Friends (sitcom)|Friends]], [[The Big Bang Theory]]
| books = [[Harry Potter (series)|Harry Potter]]
| interests = History, Computers, Engineering
| joined_date = June 3, 2007
| userboxes = {{User in the United States}}
}}
&lt;!-- Please add more to the above --&gt;
&lt;pre style=&quot;overflow: auto&quot;&gt;
{{Infobox Wikipedia user
| name = Wikipedia user
| birthdate = {{Birth date and age|1986|1|1}}
| birthplace = [[Dearborn, Michigan|Dearborn, MI]]
| country = [[United States]]
| nationality = [[United States|American]]
| race = [[Caucasian race|Caucasian]]{{dn|date={{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}}}
| gender = Female
| location = [[Houghton, Michigan|Houghton, MI]]
| eyes = Brown
| blood_type = Type O
| sexuality = [[Heterosexual]]
| iq = 136
| height = 5'8&quot;
| weight = 116 lbs.
| timezone = Central Time Zone
| pets = 2 dogs &lt;!-- If you are supposed to put pet names, please fix this--&gt;
| children = 1
| marital status = Married
| occupation = Clerk
| highschool = [[Dearborn High School]]
| college = [[Henry Ford Community College]]
| hobbies = Camping, cooking
| religion = [[Presbyterian]]
| politics = [[Democratic Party (United States)|Democrat]]
| movies = [[Forrest Gump]], [[Avatar (2009 film)|Avatar]]
| shows = [[Friends (sitcom)|Friends]], [[The Big Bang Theory]]
| books = [[Harry Potter (series)|Harry Potter]]
| interests = History, Computers, Engineering
| joined_date = June 3, 2007
| userboxes = {{User in the United States}}
}}
&lt;/pre&gt;
{{clear}}
== TemplateData ==
{{TemplateData header}}
&lt;templatedata&gt;
{
&quot;description&quot;: &quot;Infobox about yourself. This template should only be used on user pages.&quot;,
&quot;params&quot;: {
&quot;status&quot;: {
&quot;label&quot;: &quot;Status&quot;
},
&quot;image_caption&quot;: {
&quot;label&quot;: &quot;Image caption&quot;
},
&quot;honorific_prefix&quot;: {
&quot;label&quot;: &quot;Honorific Prefix&quot;
},
&quot;name&quot;: {
&quot;label&quot;: &quot;Name&quot;
},
&quot;honorific_suffix&quot;: {
&quot;label&quot;: &quot;Honorific Suffix&quot;
},
&quot;role&quot;: {
&quot;label&quot;: &quot;Role&quot;
},
&quot;birthname&quot;: {
&quot;label&quot;: &quot;Birth name&quot;
},
&quot;real_name&quot;: {
&quot;label&quot;: &quot;Real name&quot;
},
&quot;gender&quot;: {
&quot;label&quot;: &quot;Gender&quot;
},
&quot;custom_gender&quot;: {
&quot;label&quot;: &quot;Custom gender&quot;
},
&quot;pronoun&quot;: {
&quot;label&quot;: &quot;Preferred pronoun&quot;
},
&quot;languages&quot;: {
&quot;label&quot;: &quot;Language&quot;
},
&quot;birthdate&quot;: {
&quot;label&quot;: &quot;Birthdate&quot;
},
&quot;birthplace&quot;: {
&quot;label&quot;: &quot;Birthplace&quot;
},
&quot;location&quot;: {
&quot;label&quot;: &quot;Location&quot;
},
&quot;country&quot;: {
&quot;label&quot;: &quot;Country&quot;
},
&quot;timezone&quot;: {
&quot;label&quot;: &quot;Timezone&quot;
},
&quot;current_time&quot;: {
&quot;label&quot;: &quot;Current Time&quot;
},
&quot;nationality&quot;: {
&quot;label&quot;: &quot;Nationality&quot;
},
&quot;ethnicity&quot;: {
&quot;label&quot;: &quot;Ethnicity&quot;
},
&quot;race&quot;: {
&quot;label&quot;: &quot;Race&quot;
},
&quot;height&quot;: {
&quot;label&quot;: &quot;Height&quot;
},
&quot;weight&quot;: {
&quot;label&quot;: &quot;Weight&quot;
},
&quot;hair&quot;: {
&quot;label&quot;: &quot;Hair&quot;
},
&quot;eyes&quot;: {
&quot;label&quot;: &quot;Eyes&quot;
},
&quot;handedness&quot;: {
&quot;label&quot;: &quot;Handedness&quot;
},
&quot;blood_type&quot;: {
&quot;label&quot;: &quot;Blood Type&quot;
},
&quot;sexuality&quot;: {
&quot;label&quot;: &quot;Sexuality&quot;
},
&quot;iq&quot;: {
&quot;label&quot;: &quot;IQ&quot;
},
&quot;personality_type&quot;: {
&quot;label&quot;: &quot;Personality Type&quot;
},
&quot;alignment&quot;: {
&quot;label&quot;: &quot;Alignment&quot;
},
&quot;marital status&quot;: {
&quot;label&quot;: &quot;Marital Status&quot;
},
&quot;spouse&quot;: {
&quot;label&quot;: &quot;Spouse&quot;
},
&quot;girlfriend&quot;: {
&quot;label&quot;: &quot;Girlfriend&quot;
},
&quot;boyfriend&quot;: {
&quot;label&quot;: &quot;Boyfriend&quot;
},
&quot;parents&quot;: {
&quot;label&quot;: &quot;Parents&quot;
},
&quot;children&quot;: {
&quot;label&quot;: &quot;Children&quot;
},
&quot;siblings&quot;: {
&quot;label&quot;: &quot;Siblings&quot;
},
&quot;pets&quot;: {
&quot;label&quot;: &quot;Pets&quot;
},
&quot;occupation&quot;: {
&quot;label&quot;: &quot;Occupation&quot;
},
&quot;employer&quot;: {
&quot;label&quot;: &quot;Employer&quot;
},
&quot;education&quot;: {
&quot;label&quot;: &quot;Education&quot;
},
&quot;primaryschool&quot;: {
&quot;label&quot;: &quot;Primary School&quot;
},
&quot;intschool&quot;: {
&quot;label&quot;: &quot;Intermediate School&quot;
},
&quot;highschool&quot;: {
&quot;label&quot;: &quot;High School&quot;
},
&quot;college&quot;: {
&quot;label&quot;: &quot;College&quot;
},
&quot;university&quot;: {
&quot;label&quot;: &quot;University&quot;
},
&quot;classes&quot;: {
&quot;label&quot;: &quot;Classes&quot;
},
&quot;hobbies&quot;: {
&quot;label&quot;: &quot;Hobbies&quot;
},
&quot;religion&quot;: {
&quot;label&quot;: &quot;Religion&quot;
},
&quot;politics&quot;: {
&quot;label&quot;: &quot;Politics&quot;
},
&quot;aliases&quot;: {
&quot;label&quot;: &quot;Aliases&quot;
},
&quot;movies&quot;: {
&quot;label&quot;: &quot;Movies&quot;
},
&quot;shows&quot;: {
&quot;label&quot;: &quot;Shows&quot;
},
&quot;books&quot;: {
&quot;label&quot;: &quot;Books&quot;
},
&quot;interests&quot;: {
&quot;label&quot;: &quot;Interests&quot;
},
&quot;website&quot;: {
&quot;label&quot;: &quot;Website&quot;
},
&quot;blog&quot;: {
&quot;label&quot;: &quot;Blog&quot;
},
&quot;email&quot;: {
&quot;label&quot;: &quot;Email&quot;
},
&quot;icq&quot;: {
&quot;label&quot;: &quot;ICQ&quot;
},
&quot;aim&quot;: {
&quot;label&quot;: &quot;AIM&quot;
},
&quot;gtalk&quot;: {
&quot;label&quot;: &quot;GTalk&quot;
},
&quot;jabber&quot;: {
&quot;label&quot;: &quot;Jabber&quot;
},
&quot;skype&quot;: {
&quot;label&quot;: &quot;Skype&quot;
},
&quot;msn&quot;: {
&quot;label&quot;: &quot;MSN&quot;
},
&quot;yahoo&quot;: {
&quot;label&quot;: &quot;Yahoo&quot;
},
&quot;mac&quot;: {
&quot;label&quot;: &quot;Mac&quot;
},
&quot;irc&quot;: {
&quot;label&quot;: &quot;IRC&quot;
},
&quot;facebook&quot;: {
&quot;label&quot;: &quot;Facebook&quot;
},
&quot;google+&quot;: {
&quot;label&quot;: &quot;Google+&quot;
},
&quot;instagram&quot;: {
&quot;label&quot;: &quot;Instagram&quot;
},
&quot;linkedin&quot;: {
&quot;label&quot;: &quot;LinkedIn&quot;
},
&quot;pinterest&quot;: {
&quot;label&quot;: &quot;Pinterest&quot;
},
&quot;twitter&quot;: {
&quot;label&quot;: &quot;Twitter&quot;
},
&quot;youtube&quot;: {
&quot;label&quot;: &quot;YouTube&quot;
},
&quot;flickr&quot;: {
&quot;label&quot;: &quot;Flickr&quot;
},
&quot;subpages&quot;: {
&quot;label&quot;: &quot;Subpages&quot;
},
&quot;joined_date&quot;: {
&quot;label&quot;: &quot;Joined Date&quot;
},
&quot;first_edit&quot;: {
&quot;label&quot;: &quot;First Edit&quot;
},
&quot;reviewer&quot;: {
&quot;label&quot;: &quot;Date granted reviewer&quot;
},
&quot;rollbacker&quot;: {
&quot;label&quot;: &quot;Date granted rollbacker&quot;
},
&quot;template_editor&quot;: {
&quot;label&quot;: &quot;Date granted template editor&quot;
},
&quot;file_mover&quot;: {
&quot;label&quot;: &quot;Date granted file mover&quot;
},
&quot;check_user&quot;: {
&quot;label&quot;: &quot;Date granted CheckUser&quot;
},
&quot;account_creator&quot;: {
&quot;label&quot;: &quot;Date granted account creator&quot;
},
&quot;admin&quot;: {
&quot;label&quot;: &quot;Date granted sysop&quot;
},
&quot;bureaucrat&quot;: {
&quot;label&quot;: &quot;Date granted bureaucrat&quot;
},
&quot;overseer&quot;: {
&quot;label&quot;: &quot;Date granted oversighter&quot;
},
&quot;edit_count&quot;: {
&quot;label&quot;: &quot;Edit Count&quot;
},
&quot;permissions&quot;: {
&quot;label&quot;: &quot;Permissions&quot;
},
&quot;signature&quot;: {
&quot;label&quot;: &quot;Signature&quot;
},
&quot;userboxes&quot;: {
&quot;label&quot;: &quot;User boxes&quot;
}
}
}
&lt;/templatedata&gt;
&lt;includeonly&gt;
&lt;!-- PLEASE ADD CATEGORIES BELOW THIS LINE, THANK YOU. --&gt;
[[Category:User namespace templates]]
[[Category:Infobox templates|User]]
[[Category:People and person infobox templates]]
&lt;/includeonly&gt;</text>
<sha1>4ahygeejkfzsmw30pqhf29cup2q1wte</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}}}}}}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>m87vggnewseew9faw9mw0pefjucksud</sha1>
</revision>
</page>
<page>
<title>Template:MONTHNAME</title>
<ns>10</ns>
<id>4858813</id>
<revision>
<id>772147331</id>
<parentid>388698949</parentid>
<timestamp>2017-03-25T16:04:13Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:MONTHNAME]]&quot;: 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] (indefi...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="387">&lt;includeonly&gt;{{#if:{{{1|}}}|{{#switch:{{MONTHNUMBER|{{{1}}}}}|1=January|2=February|3=March|4=April|5=May|6=June|7=July|8=August|9=September|10=October|11=November|12=December|Incorrect required parameter 1=''month''!}}|Missing required parameter 1=''month''!}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{Documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>4cf5sge5nt8b4gwjre9u8yifa3kstt2</sha1>
</revision>
</page>
<page>
<title>Template:MONTHNUMBER</title>
<ns>10</ns>
<id>4859929</id>
<restrictions>edit=sysop:move=sysop</restrictions>
<revision>
<id>388698933</id>
<parentid>383624540</parentid>
<timestamp>2010-10-04T15:40:33Z</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="655">&lt;includeonly&gt;{{#if:{{{1|}}}
|{{#switch:{{lc:{{{1}}}}}
|january|jan=1
|february|feb=2
|march|mar=3
|apr|april=4
|may=5
|june|jun=6
|july|jul=7
|august|aug=8
|september|sep|sept=9
|october|oct=10
|november|nov=11
|december|dec=12
|{{#ifexpr:{{{1}}}&lt;0
|{{#ifexpr:(({{{1}}})round 0)!=({{{1}}})
|{{#expr:12-(((0.5-({{{1}}}))round 0)mod 12)}}
|{{#expr:12-(((11.5-({{{1}}}))round 0)mod 12)}}
}}
|{{#expr:(((10.5+{{{1}}})round 0)mod 12)+1}}
}}
}}
|Missing required parameter 1=''month''!
}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{Documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>mqnyq8bnd6mmrrl70a3uwqgeo8aevfc</sha1>
</revision>
</page>
<page>
<title>Template:Str find0</title>
<ns>10</ns>
<id>31624801</id>
<revision>
<id>754106575</id>
<parentid>565160579</parentid>
<timestamp>2016-12-10T22:12:30Z</timestamp>
<contributor>
<username>BU Rob13</username>
<id>25420061</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Str find0]]&quot;: [[WP:High-risk templates|Highly visible template]] ([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="108">{{#expr:{{#invoke:String|find|source={{{1}}}|target={{{2}}}}} - 1}}&lt;noinclude&gt;
{{documentation}}&lt;/noinclude&gt;</text>
<sha1>sert5g7f8gacqtv1cs6edj7iu0d5b97</sha1>
</revision>
</page>
<page>
<title>Template:Str len</title>
<ns>10</ns>
<id>22144387</id>
<revision>
<id>774485346</id>
<parentid>538982020</parentid>
<timestamp>2017-04-08T19:49:02Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Str len]]&quot;: [[WP:High-risk templates|Highly visible template]]: Allowing template editors ([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="163">{{{{{|safesubst:}}}#invoke:String|len|s={{{1|}}}}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>b1x8qcqpdocnua2ihkd8pr5jd1jn7xn</sha1>
</revision>
</page>
<page>
<title>Template:Str sub old</title>
<ns>10</ns>
<id>21697321</id>
<revision>
<id>741880662</id>
<parentid>540178477</parentid>
<timestamp>2016-09-30T07:06:58Z</timestamp>
<contributor>
<username>Ymblanter</username>
<id>14596827</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Str sub old: [[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="150">&lt;includeonly&gt;{{{{{|safesubst:}}}#invoke:String|sublength|s={{{1}}}|i={{{2|0}}}|len={{{3|0}}}}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>2jb88dajnoqpjglvsm965ah7hjsjr9s</sha1>
</revision>
</page>
<page>
<title>Template:Strfind short</title>
<ns>10</ns>
<id>30226151</id>
<revision>
<id>623639581</id>
<parentid>623639482</parentid>
<timestamp>2014-08-31T23:39:01Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Strfind short: [[WP:High-risk templates|Highly visible template]] ([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="164">{{#Invoke:String|find|source={{{1|}}}|{{{2}}}}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>sng2qjm59mds7la9fh03t82f19ej3y4</sha1>
</revision>
</page>
<page>
<title>Template:Strlen quick</title>
<ns>10</ns>
<id>30688792</id>
<redirect title="Template:Str len" />
<revision>
<id>539596083</id>
<parentid>427603799</parentid>
<timestamp>2013-02-22T04:35:52Z</timestamp>
<contributor>
<username>Dragons flight</username>
<id>16980</id>
</contributor>
<comment>Now that str_len has converted to Lua and can handle arbitrary strings quickly, I don't think there is any reason to keep the short variants.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="30">#redirect [[Template:Str len]]</text>
<sha1>425hi9t6aazzby6m2igwprva98xj2za</sha1>
</revision>
</page>
<page>
<title>Template:Substr any</title>
<ns>10</ns>
<id>27264858</id>
<redirect title="Template:Str sub old" />
<revision>
<id>540198618</id>
<parentid>388760741</parentid>
<timestamp>2013-02-25T05:33:05Z</timestamp>
<contributor>
<username>Dragons flight</username>
<id>16980</id>
</contributor>
<comment>merge with lua version</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="34">#REDIRECT [[Template:Str sub old]]</text>
<sha1>lxzwquwzpz56po15op3js2ub9qrlee7</sha1>
</revision>
</page>
<page>
<title>Template:TemplateData header</title>
<ns>10</ns>
<id>40047498</id>
<revision>
<id>751699557</id>
<parentid>751697852</parentid>
<timestamp>2016-11-27T09:49:55Z</timestamp>
<contributor>
<username>Zyxw</username>
<id>473593</id>
</contributor>
<minor/>
<comment>fix prior edit</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="470">&lt;div class=&quot;templatedata-header&quot;&gt;{{#if:{{{noheader|}}}| |This is the {{#if:{{{nolink|}}}|TemplateData|[[Wikipedia:TemplateData|TemplateData]]}} documentation for this template used by [[Wikipedia:VisualEditor|VisualEditor]] and other tools.}}
{{Template error report}}
'''TemplateData for {{{1|{{BASEPAGENAME}}}}}'''
&lt;/div&gt;&lt;includeonly&gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||
[[Category:TemplateData documentation]]
}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>3ft4xbyvsxu6dppn5iqepshqcb43e27</sha1>
</revision>
</page>
<page>
<title>Template:Template error report</title>
<ns>10</ns>
<id>51792646</id>
<revision>
<id>804532230</id>
<parentid>761214908</parentid>
<timestamp>2017-10-09T16:54:31Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Template error report]]&quot;: [[WP:High-risk templates|Highly visible template]]; thousands of transclusions ([Edit=Require autoconfirmed or confirmed access] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="241">See the [https://tools.wmflabs.org/bambots/TemplateParam.php?wiki=enwiki&amp;template={{Urlencode:{{{1|{{ROOTPAGENAME}}}}}}} monthly error report] for this template.&lt;noinclude&gt;
{{documentation}}
[[Category:External link templates]]&lt;/noinclude&gt;</text>
<sha1>khv3elmnd6elbaw07i91b5bhw2zus66</sha1>
</revision>
</page>
<page>
<title>Template:Tl</title>
<ns>10</ns>
<id>1487430</id>
<revision>
<id>776260390</id>
<parentid>622723682</parentid>
<timestamp>2017-04-19T22:28:34Z</timestamp>
<contributor>
<username>Lectonar</username>
<id>128863</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Tl]]&quot;: request at rfp ([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="168">&amp;#123;&amp;#123;[[Template:{{{1}}}|{{{1}}}]]&amp;#125;&amp;#125;&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc subpage and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1>
</revision>
</page>
<page>
<title>Template:UF-hcard-person</title>
<ns>10</ns>
<id>10730642</id>
<revision>
<id>670952666</id>
<parentid>670952607</parentid>
<timestamp>2015-07-11T10:16:53Z</timestamp>
<contributor>
<username>Gonnym</username>
<id>14984434</id>
</contributor>
<comment>Undid revision 670952607 by [[Special:Contributions/Gonnym|Gonnym]] ([[User talk:Gonnym|talk]]) wrong page</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 (&quot;bday&quot;) 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.'''&lt;includeonly&gt;{{#ifeq:{{SUBPAGENAME}}|doc | |{{#ifeq:{{SUBPAGENAME}}|sandbox | |[[Category:Templates generating hCards]]}} }}&lt;/includeonly&gt;&lt;noinclude&gt;
[[Category:Templates generating hCards]]
[[Category:Microformat (uF) message templates]]
&lt;/noinclude&gt;</text>
<sha1>axz1fcq74yk4k48upkzdbv1ne3ifwdf</sha1>
</revision>
</page>
<page>
<title>Template:Uir</title>
<ns>10</ns>
<id>29819859</id>
<revision>
<id>822863728</id>
<parentid>821525868</parentid>
<timestamp>2018-01-28T23:14:38Z</timestamp>
<contributor>
<username>Buaidh</username>
<id>122305</id>
</contributor>
<comment>Updated after testing in sandbox.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="20263">&lt;includeonly&gt;{{#ifeq:{{{option|1}}}|0||{{userbox
|float={{{float|left}}}
|bodyclass={{{bodyclass|}}}
|info-class={{{info-class|}}}
|border-c={{{border-c|black}}}
|id={{{id|[[File:{{{image|Flag of {{#if:{{{the|}}}|the&amp;#32;}}{{{simple|{{{region|}}}}}}.svg}}}|{{{width|}}}x45px]]}}}
|id-a={{{id-a|left}}}
|id-c={{#if:{{{id-c|}}}|{{{id-c|}}}|{{#if:{{{width|}}}|{{{color|white}}}|{{{border-c|black}}}}}}}
|id-w={{{id-w|1}}}
|info={{{info|{{#switch:{{{option|1}}}
|A={{{title|'''Error!'''}}}
|ROL=[[Outline of {{#if:{{{the|}}}|the&amp;#32;}}{{{simple|{{{region|}}}}}}|'''&lt;span style=&quot;font-size:{{{wp-s|10}}}pt&quot;&gt;Outline of {{#if:{{{the|}}}|the&amp;#32;}}{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{simple|{{{region|}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}&lt;/span&gt;''']]
|RWP='''&lt;span style=&quot;font-size:{{{wp-s|10}}}pt&quot;&gt;{{#ifeq:{{{group|WikiProject}}}|WikiProject|
[[Wikipedia:WikiProject {{{main|{{{simple|{{{region|}}}}}}}}}|WikiProject {{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{main|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}]]|[[Wikipedia:WikiProject {{{main|{{{simple|{{{region|}}}}}}}}}/{{{sub|{{{simple|{{{region|}}}}}}}}} {{{group|}}}|{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{sub|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}} {{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{group|}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}]]}}&lt;/span&gt;'''
|1=This user {{{activity|lives in}}} {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|2=This user resides in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|3=This user is a resident of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|4=This user is a part-time resident of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|5=This user is a student in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|6=This user currently studies in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|7=This user currently works in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|8=This user currently lives in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|9=This user is proud to be a resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|10=This user is a proud resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|11=This user is proud to be a resident native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|12=This user is a proud resident native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|13=This user is a resident native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|14=This user is a lifelong resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|15=This user was born and lives in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|16=This user is proud to be a naturalized {{#if:{{{nation|}}}|citizen of {{#if:{{{nthe|}}}|the&amp;#32;}}'''[[{{{nation|}}}]]''' living in {{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]|resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}
|17=This user is a proud naturalized {{#if:{{{nation|}}}|citizen of {{#if:{{{nthe|}}}|the&amp;#32;}}'''[[{{{nation|}}}]]''' living in {{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]|resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}
|18=This user is a naturalized {{#if:{{{nation|}}}|citizen of {{#if:{{{nthe|}}}|the&amp;#32;}}'''[[{{{nation|}}}]]''' living in {{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]|resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}
|19=This user is a resident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|20=This user is a citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|21=This user is a nonresident citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|22=This user is a nonresident native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|23=This user is a proud native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|24=This user is a native citizen of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|31=This user is a resident native citizen interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|32=This user is a resident citizen interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|33=This user is a resident interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|34=This user is a citizen interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|35=This user is a native interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|36=This user is a descendant interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|37=This user is a former resident interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|38=This user is interested in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|41=This user {{#ifeq:{{{group|WikiProject}}}|none|wishes to form|{{#switch:{{{member|member}}}|participant={{#if:{{{cpro|}}}|[[:Category:{{{cpro|}}} participants|participates]]|participates}} in|volunteer={{#if:{{{cpro|}}}|[[:Category:{{{cpro|}}} volunteers|volunteers]]|volunteers}} with|is a {{#if:{{{cpro|}}}|[[:Category:{{{cpro|}}} members|member]]|member}} of}}}}{{#if:{{#switch:{{{group|WikiProject}}}|WikiProject|none=yes}}|&lt;br/&gt;'''[[Wikipedia:WikiProject {{{main|{{{simple|{{{region|}}}}}}}}}|&lt;span style=&quot;font-size:{{{wp-s|10}}}pt;{{#if:{{{info-fc|}}}|color:{{{info-fc|}}};}}&quot;&gt;WikiProject {{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{main|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}&lt;/span&gt;]]'''|&amp;#32;the&lt;br/&gt;'''&lt;span style=&quot;font-size:{{{wp-s|10}}}pt&quot;&gt;[[Wikipedia:WikiProject {{{main|{{{simple|{{{region|}}}}}}}}}/{{{sub|{{{simple|{{{region|}}}}}}}}} {{{group|}}}|{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{sub|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}} {{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{group|}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}]]&lt;/span&gt;'''}}
|51=This user is a proud native of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|52=This user is a native of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|53=This user is a nonresident native of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|54=This user was born in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|55=This user is proud to be {{#if:{{{demonym|}}}|{{{an|a}}} &lt;br/&gt;[[{{{region|}}}|'''&lt;span style=&quot;font-size:{{{d-s|150%}}};{{#if:{{{info-fc|}}}|color:{{{info-fc|}}};}}&quot;&gt;{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{demonym|}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}&lt;/span&gt;''']]|from {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}
|56=This user is {{#if:{{{demonym|}}}|{{{an|a}}} &lt;br/&gt;[[{{{region|}}}|'''&lt;span style=&quot;font-size:{{{d-s|150%}}};{{#if:{{{info-fc|}}}|color:{{{info-fc|}}};}}&quot;&gt;{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{demonym|}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}&lt;/span&gt;''']]|from {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}
|61=This user is of [[{{{region|}}}|'''{{#if:{{{info-fc|}}}|&lt;span style=&quot;color:{{{info-fc|}}};&quot;&gt;}}{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{adj|{{{inflect|{{{simple|{{{region|}}}}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}{{#if:{{{info-fc|}}}|&lt;/span&gt;}}''']] ancestry
|62=This user is of [[{{{region|}}}|'''{{#if:{{{info-fc|}}}|&lt;span style=&quot;color:{{{info-fc|}}};&quot;&gt;}}{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{adj|{{{inflect|{{{simple|{{{region|}}}}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}{{#if:{{{info-fc|}}}|&lt;/span&gt;}}''']] descent
|63=This user is of [[{{{region|}}}|'''{{#if:{{{info-fc|}}}|&lt;span style=&quot;color:{{{info-fc|}}};&quot;&gt;}}{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{adj|{{{inflect|{{{simple|{{{region|}}}}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}{{#if:{{{info-fc|}}}|&lt;/span&gt;}}''']] heritage
|64=An ancestor of this user was born in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|72=This user is a former resident of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|73=This user has lived in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|74=This user has visited {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|75=This user frequently visits {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|76=This user wishes to visit {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|77=This user has hiked through {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|78=This user has hiked to the [[Lists of highest points|{{#if:{{{info-fc|}}}|&lt;span style=&quot;color:{{{info-fc|}}};&quot;&gt;}}highest point{{#if:{{{info-fc|}}}|&lt;/span&gt;}}]] in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|79=This user has visited the lowest point of {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|80=This user has cycled through {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|81=This user loves {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|82=This user longs for {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|83=This user wishes to be in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|84=This user plans to visit {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|91=This user has family in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|92=This user has friends in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|93=This user has associates in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|94=This user does business in {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}
|This user is associated with {{#if:{{{title|}}}|{{{title|}}}|{{#if:{{{the|}}}|the&amp;#32;}}[[{{{region|}}}|'''{{#if:{{{wrap|}}}||&lt;span style=&quot;white-space:nowrap&quot;&gt;}}{{{inflect|{{{simple|{{{region|}}}}}}}}}{{#if:{{{wrap|}}}||&lt;/span&gt;}}''']]}}}}.}}}
|info-a={{{align|center}}}
|info-c={{{info-c|{{{color|white}}}}}}
|info-fc={{{info-fc|black}}}
|info-lh={{{info-lh|{{#if:{{{demonym|}}}|{{#switch:{{{option|1}}}|55|56=150%|125%}}|125%}}}}}
|info-s={{{info-s|8}}}
}}}}{{#ifeq:{{{nocat|false}}}|false|{{#ifeq:{{NAMESPACE}}|User|
{{#if:{{{cres|}}}|{{#ifeq:{{#switch:{{{option|1}}}|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|31|32|33={{{res|yes}}}|{{{res|no}}}}}|yes|[[Category:{{{cres|}}}{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{ccit|}}}|{{#ifeq:{{#switch:{{{option|1}}}|9|10|11|12|13|14|15|16|17|18|19|20|21|22|31|32|34={{{cit|yes}}}|{{{cit|no}}}}}|yes|[[Category:{{{ccit|}}}{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{cint|}}}|{{#ifeq:{{#switch:{{{option|1}}}|31|32|33|34|35|36|37|38|41={{{int|yes}}}|{{{int|no}}}}}|yes|[[Category:{{{cint|}}}{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{cpro|}}}|{{#ifeq:{{#ifeq:{{{option|1}}}|41|{{{pro|yes}}}|{{{pro|no}}}}}|yes|[[Category:{{{cpro|}}} {{{member|member}}}s{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{cnres|}}}|{{#ifeq:{{#switch:{{{option|1}}}|1|2|3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|31|32|33={{{nres|yes}}}|{{{nres|no}}}}}|yes|[[Category:{{{cnres|}}}{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{cncit|}}}|{{#ifeq:{{#switch:{{{option|1}}}|9|10|11|12|13|14|15|16|17|18|19|20|21|22|23|24|31|32|34={{{ncit|yes}}}|{{{ncit|no}}}}}|yes|[[Category:{{{cncit|}}}{{!}}{{PAGENAME}}]]}}}}
{{#if:{{{cnint|}}}|{{#ifeq:{{{nint|no}}}|yes|[[Category:{{{cnint|}}}{{!}}{{PAGENAME}}]]}}}}
}}}}&lt;/includeonly&gt;&lt;noinclude&gt;{{documentation}}&lt;/noinclude&gt;</text>
<sha1>gkc410b5676s7jrwddjlc3r3w8olpdb</sha1>
</revision>
</page>
<page>
<title>Template:User in the United States</title>
<ns>10</ns>
<id>29968705</id>
<revision>
<id>771690051</id>
<parentid>680424879</parentid>
<timestamp>2017-03-22T23:52:04Z</timestamp>
<contributor>
<username>Buaidh</username>
<id>122305</id>
</contributor>
<comment>|color={{{color|#D5FFF4}}}</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="822">&lt;includeonly&gt;{{uir
|region=United States|the=the|adj=American|demonym=American|an=an
|title={{{title|the {{#switch:{{{1|1}}}|11|12|16|17|31=[[United States|'''United&amp;nbsp;States''']]|[[United States|'''United&amp;nbsp;States&amp;nbsp;of&amp;nbsp;America''']]}}}}}
|activity={{{activity|lives in}}}
|color={{{color|#D5FFF4}}}
|cres=Wikipedians in the United States
|ccit=American Wikipedians
|cint=Wikipedians interested in the United States
|cpro=WikiProject United States
|option={{{1|1}}}
|wp-s=9
|float={{{float|left}}}
|align={{{align|center}}}
|res{{#ifeq:{{{res|}}}|{{{res|-}}}||x}}={{{res|}}}
|cit{{#ifeq:{{{cit|}}}|{{{cit|-}}}||x}}={{{cit|}}}
|int{{#ifeq:{{{int|}}}|{{{int|-}}}||x}}={{{int|}}}
|pro{{#ifeq:{{{pro|}}}|{{{pro|-}}}||x}}={{{pro|}}}
|nocat={{{nocat|false}}}
}}&lt;/includeonly&gt;&lt;noinclude&gt;{{documentation}}&lt;/noinclude&gt;</text>
<sha1>g2xh9nvdtbddeq50v4malxuetr7quvx</sha1>
</revision>
</page>
<page>
<title>Template:Userbox</title>
<ns>10</ns>
<id>2159001</id>
<revision>
<id>589946042</id>
<parentid>580208085</parentid>
<timestamp>2014-01-09T17:16:29Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>switch to Lua version at [[Module:Userbox]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="144">{{#invoke:userbox|userbox}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>7xqp98n4frdf5oy8egh9oenx188107s</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">{{&lt;includeonly&gt;safesubst:&lt;/includeonly&gt;#switch: {{&lt;includeonly&gt;safesubst:&lt;/includeonly&gt;lc: {{{1|¬}}} }}
|no
|n
|false
|off
|0 = {{{no|&lt;!-- null --&gt;}}}
| = {{{blank|{{{no|&lt;!-- null --&gt;}}}}}}
|¬ = {{{¬|}}}
|yes
|y
|true
|on
|1 = {{{yes|yes}}}
|#default = {{{def|{{{yes|yes}}}}}}
}}&lt;noinclude&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>r1wh7ajnm478r67owpatavjany80n9e</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(
&quot;bad value assigned to option 'valueFunc'&quot;
.. '(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 &quot;'
.. tostring(key)
.. '&quot;; the table is read-only',
2
)
elseif options.noOverwrite and args[key] ~= nil then
error(
'could not write to argument table key &quot;'
.. tostring(key)
.. '&quot;; 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:Category handler</title>
<ns>828</ns>
<id>39772274</id>
<revision>
<id>617942873</id>
<parentid>616811662</parentid>
<timestamp>2014-07-22T05:08:26Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>allow invocations specifying the page parameter to use the mw.loadData optimisations, and don't call mw.title.new every time</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="7871">--------------------------------------------------------------------------------
-- --
-- CATEGORY HANDLER --
-- --
-- This module implements the {{category handler}} template in Lua, --
-- with a few improvements: all namespaces and all namespace aliases --
-- are supported, and namespace names are detected automatically for --
-- the local wiki. This module requires [[Module:Namespace detect]] --
-- and [[Module:Yesno]] to be available on the local wiki. It can be --
-- configured for different wikis by altering the values in --
-- [[Module:Category handler/config]], and pages can be blacklisted --
-- from categorisation by using [[Module:Category handler/blacklist]]. --
-- --
--------------------------------------------------------------------------------
-- Load required modules
local yesno = require('Module:Yesno')
-- Lazily load things we don't always need
local mShared, mappings
local p = {}
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function trimWhitespace(s, removeBlanks)
if type(s) ~= 'string' then
return s
end
s = s:match('^%s*(.-)%s*$')
if removeBlanks then
if s ~= '' then
return s
else
return nil
end
else
return s
end
end
--------------------------------------------------------------------------------
-- CategoryHandler class
--------------------------------------------------------------------------------
local CategoryHandler = {}
CategoryHandler.__index = CategoryHandler
function CategoryHandler.new(data, args)
local obj = setmetatable({ _data = data, _args = args }, CategoryHandler)
-- Set the title object
do
local pagename = obj:parameter('demopage')
local success, titleObj
if pagename then
success, titleObj = pcall(mw.title.new, pagename)
end
if success and titleObj then
obj.title = titleObj
if titleObj == mw.title.getCurrentTitle() then
obj._usesCurrentTitle = true
end
else
obj.title = mw.title.getCurrentTitle()
obj._usesCurrentTitle = true
end
end
-- Set suppression parameter values
for _, key in ipairs{'nocat', 'categories'} do
local value = obj:parameter(key)
value = trimWhitespace(value, true)
obj['_' .. key] = yesno(value)
end
do
local subpage = obj:parameter('subpage')
local category2 = obj:parameter('category2')
if type(subpage) == 'string' then
subpage = mw.ustring.lower(subpage)
end
if type(category2) == 'string' then
subpage = mw.ustring.lower(category2)
end
obj._subpage = trimWhitespace(subpage, true)
obj._category2 = trimWhitespace(category2) -- don't remove blank values
end
return obj
end
function CategoryHandler:parameter(key)
local parameterNames = self._data.parameters[key]
local pntype = type(parameterNames)
if pntype == 'string' or pntype == 'number' then
return self._args[parameterNames]
elseif pntype == 'table' then
for _, name in ipairs(parameterNames) do
local value = self._args[name]
if value ~= nil then
return value
end
end
return nil
else
error(string.format(
'invalid config key &quot;%s&quot;',
tostring(key)
), 2)
end
end
function CategoryHandler:isSuppressedByArguments()
return
-- See if a category suppression argument has been set.
self._nocat == true
or self._categories == false
or (
self._category2
and self._category2 ~= self._data.category2Yes
and self._category2 ~= self._data.category2Negative
)
-- Check whether we are on a subpage, and see if categories are
-- suppressed based on our subpage status.
or self._subpage == self._data.subpageNo and self.title.isSubpage
or self._subpage == self._data.subpageOnly and not self.title.isSubpage
end
function CategoryHandler:shouldSkipBlacklistCheck()
-- Check whether the category suppression arguments indicate we
-- should skip the blacklist check.
return self._nocat == false
or self._categories == true
or self._category2 == self._data.category2Yes
end
function CategoryHandler:matchesBlacklist()
if self._usesCurrentTitle then
return self._data.currentTitleMatchesBlacklist
else
mShared = mShared or require('Module:Category handler/shared')
return mShared.matchesBlacklist(
self.title.prefixedText,
mw.loadData('Module:Category handler/blacklist')
)
end
end
function CategoryHandler:isSuppressed()
-- Find if categories are suppressed by either the arguments or by
-- matching the blacklist.
return self:isSuppressedByArguments()
or not self:shouldSkipBlacklistCheck() and self:matchesBlacklist()
end
function CategoryHandler:getNamespaceParameters()
if self._usesCurrentTitle then
return self._data.currentTitleNamespaceParameters
else
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
return mShared.getNamespaceParameters(
self.title,
mappings
)
end
end
function CategoryHandler:namespaceParametersExist()
-- Find whether any namespace parameters have been specified.
-- We use the order &quot;all&quot; --&gt; namespace params --&gt; &quot;other&quot; as this is what
-- the old template did.
if self:parameter('all') then
return true
end
if not mappings then
mShared = mShared or require('Module:Category handler/shared')
mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData
end
for ns, params in pairs(mappings) do
for i, param in ipairs(params) do
if self._args[param] then
return true
end
end
end
if self:parameter('other') then
return true
end
return false
end
function CategoryHandler:getCategories()
local params = self:getNamespaceParameters()
local nsCategory
for i, param in ipairs(params) do
local value = self._args[param]
if value ~= nil then
nsCategory = value
break
end
end
if nsCategory ~= nil or self:namespaceParametersExist() then
-- Namespace parameters exist - advanced usage.
if nsCategory == nil then
nsCategory = self:parameter('other')
end
local ret = {self:parameter('all')}
local numParam = tonumber(nsCategory)
if numParam and numParam &gt;= 1 and math.floor(numParam) == numParam then
-- nsCategory is an integer
ret[#ret + 1] = self._args[numParam]
else
ret[#ret + 1] = nsCategory
end
if #ret &lt; 1 then
return nil
else
return table.concat(ret)
end
elseif self._data.defaultNamespaces[self.title.namespace] then
-- Namespace parameters don't exist, simple usage.
return self._args[1]
end
return nil
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- Used for testing purposes.
return {
CategoryHandler = CategoryHandler
}
end
function p._main(args, data)
data = data or mw.loadData('Module:Category handler/data')
local handler = CategoryHandler.new(data, args)
if handler:isSuppressed() then
return nil
end
return handler:getCategories()
end
function p.main(frame, data)
data = data or mw.loadData('Module:Category handler/data')
local args = require('Module:Arguments').getArgs(frame, {
wrappers = data.wrappers,
valueFunc = function (k, v)
v = trimWhitespace(v)
if type(k) == 'number' then
if v ~= '' then
return v
else
return nil
end
else
return v
end
end
})
return p._main(args, data)
end
return p</text>
<sha1>letwavu3yvlayfzew66uuwixmwebq5b</sha1>
</revision>
</page>
<page>
<title>Module:Category handler/blacklist</title>
<ns>828</ns>
<id>43232926</id>
<revision>
<id>757409491</id>
<parentid>757402070</parentid>
<timestamp>2016-12-30T14:53:53Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>on second thoughts, blacklisting sandboxes for all templates is probably a bad idea</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="764">-- This module contains the blacklist used by [[Module:Category handler]].
-- Pages that match Lua patterns in this list will not be categorised unless
-- categorisation is explicitly requested.
return {
'^Main Page$', -- don't categorise the main page.
-- Don't categorise the following pages or their subpages.
-- &quot;%f[/\0]&quot; matches if the next character is &quot;/&quot; or the end of the string.
'^Wikipedia:Cascade%-protected items%f[/\0]',
'^User:UBX%f[/\0]', -- The userbox &quot;template&quot; space.
'^User talk:UBX%f[/\0]',
-- Don't categorise subpages of these pages, but allow
-- categorisation of the base page.
'^Wikipedia:Template messages/.*$',
-- Don't categorise archives.
'/[aA]rchive',
&quot;^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$&quot;,
}</text>
<sha1>hwue3i1eua4tsdxlsbcs4f5syudywbe</sha1>
</revision>
</page>
<page>
<title>Module:Category handler/config</title>
<ns>828</ns>
<id>42291997</id>
<revision>
<id>616764079</id>
<parentid>616045566</parentid>
<timestamp>2014-07-13T09:05:36Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Protected Module:Category handler/config: [[WP:High-risk templates|High-risk Lua module]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="5755">--------------------------------------------------------------------------------
-- [[Module:Category handler]] configuration data --
-- Language-specific parameter names and values can be set here. --
-- For blacklist config, see [[Module:Category handler/blacklist]]. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Start configuration data --
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- foo = 'parameter name', --
-- --
-- To add multiple names, you can use this format: --
-- --
-- foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'}, --
--------------------------------------------------------------------------------
cfg.parameters = {
-- The nocat and categories parameter suppress
-- categorisation. They are used with Module:Yesno, and work as follows:
--
-- cfg.nocat:
-- Result of yesno() Effect
-- true Categorisation is suppressed
-- false Categorisation is allowed, and
-- the blacklist check is skipped
-- nil Categorisation is allowed
--
-- cfg.categories:
-- Result of yesno() Effect
-- true Categorisation is allowed, and
-- the blacklist check is skipped
-- false Categorisation is suppressed
-- nil Categorisation is allowed
nocat = 'nocat',
categories = 'categories',
-- The parameter name for the legacy &quot;category2&quot; parameter. This skips the
-- blacklist if set to the cfg.category2Yes value, and suppresses
-- categorisation if present but equal to anything other than
-- cfg.category2Yes or cfg.category2Negative.
category2 = 'category2',
-- cfg.subpage is the parameter name to specify how to behave on subpages.
subpage = 'subpage',
-- The parameter for data to return in all namespaces.
all = 'all',
-- The parameter name for data to return if no data is specified for the
-- namespace that is detected.
other = 'other',
-- The parameter name used to specify a page other than the current page;
-- used for testing and demonstration.
demopage = 'page',
}
--------------------------------------------------------------------------------
-- Parameter values --
-- These are set values that can be used with certain parameters. Only one --
-- value can be specified, like this: --
-- --
-- cfg.foo = 'value name' -- --
--------------------------------------------------------------------------------
-- The following settings are used with the cfg.category2 parameter. Setting
-- cfg.category2 to cfg.category2Yes skips the blacklist, and if cfg.category2
-- is present but equal to anything other than cfg.category2Yes or
-- cfg.category2Negative then it supresses cateogrisation.
cfg.category2Yes = 'yes'
cfg.category2Negative = '¬'
-- The following settings are used with the cfg.subpage parameter.
-- cfg.subpageNo is the value to specify to not categorise on subpages;
-- cfg.subpageOnly is the value to specify to only categorise on subpages.
cfg.subpageNo = 'no'
cfg.subpageOnly = 'only'
--------------------------------------------------------------------------------
-- Default namespaces --
-- This is a table of namespaces to categorise by default. The keys are the --
-- namespace numbers. --
--------------------------------------------------------------------------------
cfg.defaultNamespaces = {
[ 0] = true, -- main
[ 6] = true, -- file
[ 12] = true, -- help
[ 14] = true, -- category
[100] = true, -- portal
[108] = true, -- book
}
--------------------------------------------------------------------------------
-- Wrappers --
-- This is a wrapper template or a list of wrapper templates to be passed to --
-- [[Module:Arguments]]. --
--------------------------------------------------------------------------------
cfg.wrappers = 'Template:Category handler'
--------------------------------------------------------------------------------
-- End configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.</text>
<sha1>6ga9hbq2pdwalsvx68i53dmbr421rq5</sha1>
</revision>
</page>
<page>
<title>Module:Category handler/data</title>
<ns>828</ns>
<id>43233647</id>
<revision>
<id>616764105</id>
<parentid>616020360</parentid>
<timestamp>2014-07-13T09:05:55Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Protected Module:Category handler/data: [[WP:High-risk templates|High-risk Lua module]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="631">-- This module assembles data to be passed to [[Module:Category handler]] using
-- mw.loadData. This includes the configuration data and whether the current
-- page matches the title blacklist.
local data = require('Module:Category handler/config')
local mShared = require('Module:Category handler/shared')
local blacklist = require('Module:Category handler/blacklist')
local title = mw.title.getCurrentTitle()
data.currentTitleMatchesBlacklist = mShared.matchesBlacklist(
title.prefixedText,
blacklist
)
data.currentTitleNamespaceParameters = mShared.getNamespaceParameters(
title,
mShared.getParamMappings()
)
return data</text>
<sha1>k26mwixuaeijisfddb0sxkg82iux8v4</sha1>
</revision>
</page>
<page>
<title>Module:Category handler/shared</title>
<ns>828</ns>
<id>43232937</id>
<revision>
<id>616764145</id>
<parentid>616020201</parentid>
<timestamp>2014-07-13T09:06:15Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Protected Module:Category handler/shared: [[WP:High-risk templates|High-risk Lua module]] ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="888">-- This module contains shared functions used by [[Module:Category handler]]
-- and its submodules.
local p = {}
function p.matchesBlacklist(page, blacklist)
for i, pattern in ipairs(blacklist) do
local match = mw.ustring.match(page, pattern)
if match then
return true
end
end
return false
end
function p.getParamMappings(useLoadData)
local dataPage = 'Module:Namespace detect/data'
if useLoadData then
return mw.loadData(dataPage).mappings
else
return require(dataPage).mappings
end
end
function p.getNamespaceParameters(titleObj, mappings)
-- We don't use title.nsText for the namespace name because it adds
-- underscores.
local mappingsKey
if titleObj.isTalkPage then
mappingsKey = 'talk'
else
mappingsKey = mw.site.namespaces[titleObj.namespace].name
end
mappingsKey = mw.ustring.lower(mappingsKey)
return mappings[mappingsKey] or {}
end
return p</text>
<sha1>omlsnhudxz6juptvtxz7ns97jutbzc5</sha1>
</revision>
</page>
<page>
<title>Module:Color contrast</title>
<ns>828</ns>
<id>43027253</id>
<revision>
<id>823705246</id>
<parentid>823704630</parentid>
<timestamp>2018-02-02T22:01:27Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<comment>typo</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="6632">--
-- This module implements
-- {{Color contrast ratio}}
-- {{Greater color contrast ratio}}
-- {{ColorToLum}}
-- {{RGBColorToLum}}
--
local p = {}
local HTMLcolor = mw.loadData( 'Module:Color contrast/colors' )
local function sRGB ( v )
if (v &lt;= 0.03928) then
v = v / 12.92
else
v = math.pow((v+0.055)/1.055, 2.4)
end
return v
end
local function rgbdec2lum( R, G, B )
if ( 0 &lt;= R and R &lt; 256 and 0 &lt;= G and G &lt; 256 and 0 &lt;= B and B &lt; 256 ) then
return 0.2126 * sRGB(R/255) + 0.7152 * sRGB(G/255) + 0.0722 * sRGB(B/255)
else
return ''
end
end
local function hsl2lum( h, s, l )
if ( 0 &lt;= h and h &lt; 360 and 0 &lt;= s and s &lt;= 1 and 0 &lt;= l and l &lt;= 1 ) then
local c = (1 - math.abs(2*l - 1))*s
local x = c*(1 - math.abs( math.fmod(h/60, 2) - 1) )
local m = l - c/2
local r, g, b = m, m, m
if( 0 &lt;= h and h &lt; 60 ) then
r = r + c
g = g + x
elseif( 60 &lt;= h and h &lt; 120 ) then
r = r + x
g = g + c
elseif( 120 &lt;= h and h &lt; 180 ) then
g = g + c
b = b + x
elseif( 180 &lt;= h and h &lt; 240 ) then
g = g + x
b = b + c
elseif( 240 &lt;= h and h &lt; 300 ) then
r = r + x
b = b + c
elseif( 300 &lt;= h and h &lt; 360 ) then
r = r + c
b = b + x
end
return rgbdec2lum(255*r, 255*g, 255*b)
else
return ''
end
end
local function color2lum( c )
if (c == nil) then
return ''
end
-- whitespace
c = c:match( '^%s*(.-)[%s;]*$' )
-- unstrip nowiki strip markers
c = mw.text.unstripNoWiki(c)
-- lowercase
c = c:lower()
-- first try to look it up
local L = HTMLcolor[c]
if (L ~= nil) then
return L
end
-- convert from hsl
if mw.ustring.match(c,'^hsl%([%s]*[0-9][0-9%.]*[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local h, s, l = mw.ustring.match(c,'^hsl%([%s]*([0-9][0-9%.]*)[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return hsl2lum(tonumber(h), tonumber(s)/100, tonumber(l)/100)
end
-- convert from rgb
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*,[%s]*[0-9][0-9]*[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*,[%s]*([0-9][0-9]*)[%s]*%)$')
return rgbdec2lum(tonumber(R), tonumber(G), tonumber(B))
end
-- convert from rgb percent
if mw.ustring.match(c,'^rgb%([%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*,[%s]*[0-9][0-9%.]*%%[%s]*%)$') then
local R, G, B = mw.ustring.match(c,'^rgb%([%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*,[%s]*([0-9][0-9%.]*)%%[%s]*%)$')
return rgbdec2lum(255*tonumber(R)/100, 255*tonumber(G)/100, 255*tonumber(B)/100)
end
-- remove leading # (if there is one) and whitespace
c = mw.ustring.match(c, '^[%s#]*([a-f0-9]*)[%s]*$')
-- split into rgb
local cs = mw.text.split(c or '', '')
if( #cs == 6 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[2])
local G = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[4])
local B = 16*tonumber('0x' .. cs[5]) + tonumber('0x' .. cs[6])
return rgbdec2lum(R, G, B)
elseif ( #cs == 3 ) then
local R = 16*tonumber('0x' .. cs[1]) + tonumber('0x' .. cs[1])
local G = 16*tonumber('0x' .. cs[2]) + tonumber('0x' .. cs[2])
local B = 16*tonumber('0x' .. cs[3]) + tonumber('0x' .. cs[3])
return rgbdec2lum(R, G, B)
end
-- failure, return blank
return ''
end
function p._greatercontrast(args)
local bias = tonumber(args['bias'] or '0') or 0
local css = (args['css'] and args['css'] ~= '') and true or false
local v1 = color2lum(args[1] or '')
local c2 = args[2] or '#FFFFFF'
local v2 = color2lum(c2)
local c3 = args[3] or '#000000'
local v3 = color2lum(c3)
local ratio1 = -1;
local ratio2 = -1;
if (type(v1) == 'number' and type(v2) == 'number') then
ratio1 = (v2 + 0.05)/(v1 + 0.05)
ratio1 = (ratio1 &lt; 1) and 1/ratio1 or ratio1
end
if (type(v1) == 'number' and type(v3) == 'number') then
ratio2 = (v3 + 0.05)/(v1 + 0.05)
ratio2 = (ratio2 &lt; 1) and 1/ratio2 or ratio2
end
if css then
local c1 = args[1] or ''
if mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c1, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c1 = '#' .. c1
end
if mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(c2, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c2 = '#' .. c2
end
if mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') or
mw.ustring.match(v3, '^[A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9][A-Fa-f0-9]$') then
c3 = '#' .. c3
end
return 'background-color:' .. c1 .. '; color:' .. ((ratio1 &gt; 0) and (ratio2 &gt; 0) and ((ratio1 + bias &gt; ratio2) and c2 or c3) or '') .. ';'
end
return (ratio1 &gt; 0) and (ratio2 &gt; 0) and ((ratio1 + bias &gt; ratio2) and c2 or c3) or ''
end
function p._ratio(args)
local v1 = color2lum(args[1])
local v2 = color2lum(args[2])
if (type(v1) == 'number' and type(v2) == 'number') then
-- v1 should be the brighter of the two.
if v2 &gt; v1 then
v1, v2 = v2, v1
end
return (v1 + 0.05)/(v2 + 0.05)
else
return args['error'] or '?'
end
end
function p._styleratio(args)
local style = (args[1] or ''):lower()
local bg, fg = 'white', 'black'
local lum_bg, lum_fg = 1, 0
if args[2] then
local lum = color2lum(args[2])
if lum ~= '' then bg, lum_bg = args[2], lum end
end
if args[3] then
local lum = color2lum(args[3])
if lum ~= '' then fg, lum_fg = args[3], lum end
end
local slist = mw.text.split(mw.ustring.gsub(mw.ustring.gsub(style or '', '&amp;#[Xx]23;', '#'), '&amp;#35;', '#'), ';')
for k = 1,#slist do
local s = slist[k]
local k,v = s:match( '^[%s]*([^:]-):([^:]-)[%s;]*$' )
k = k or ''
v = v or ''
if (k:match('^[%s]*(background)[%s]*$') or k:match('^[%s]*(background%-color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_bg = v, lum end
elseif (k:match('^[%s]*(color)[%s]*$')) then
local lum = color2lum(v)
if( lum ~= '' ) then bg, lum_fg = v, lum end
end
end
if lum_bg &gt; lum_fg then
return (lum_bg + 0.05)/(lum_fg + 0.05)
else
return (lum_fg + 0.05)/(lum_bg + 0.05)
end
end
function p.lum(frame)
return color2lum(frame.args[1] or frame:getParent().args[1])
end
function p.ratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._ratio(args)
end
function p.styleratio(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._styleratio(args)
end
function p.greatercontrast(frame)
local args = frame.args[1] and frame.args or frame:getParent().args
return p._greatercontrast(args)
end
return p</text>
<sha1>43ryh3q2kthxzrpu56wy019djsecqot</sha1>
</revision>
</page>
<page>
<title>Module:Color contrast/colors</title>
<ns>828</ns>
<id>47337125</id>
<revision>
<id>673825843</id>
<parentid>673821532</parentid>
<timestamp>2015-07-30T19:00:09Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>tabularise, because you know it makes sense - https://github.com/godlygeek/tabular</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="6119">return {
aliceblue = 0.92880068253475,
antiquewhite = 0.84646951707754,
aqua = 0.7874,
aquamarine = 0.8078549208338,
azure = 0.97265264954166,
beige = 0.8988459998705,
bisque = 0.80732327372979,
black = 0,
blanchedalmond = 0.85084439608156,
blue = 0.0722,
blueviolet = 0.12622014321946,
brown = 0.098224287876511,
burlywood = 0.51559844533893,
cadetblue = 0.29424681085422,
chartreuse = 0.76032025902623,
chocolate = 0.23898526114557,
coral = 0.37017930872924,
cornflowerblue = 0.30318641994179,
cornsilk = 0.93562110372965,
crimson = 0.16042199953026,
cyan = 0.7874,
darkblue = 0.018640801980939,
darkcyan = 0.20329317839046,
darkgoldenrod = 0.27264703559993,
darkgray = 0.39675523072563,
darkgreen = 0.091143429047575,
darkgrey = 0.39675523072563,
darkkhaki = 0.45747326349994,
darkmagenta = 0.07353047651207,
darkolivegreen = 0.12651920884889,
darkorange = 0.40016167026524,
darkorchid = 0.13413142174857,
darkred = 0.054889674531132,
darksalmon = 0.40541471563381,
darkseagreen = 0.43789249325969,
darkslateblue = 0.065792846227988,
darkslategray = 0.067608151928044,
darkslategrey = 0.067608151928044,
darkturquoise = 0.4874606277449,
darkviolet = 0.10999048339343,
deeppink = 0.23866895828276,
deepskyblue = 0.44481603395575,
dimgray = 0.14126329114027,
dimgrey = 0.14126329114027,
dodgerblue = 0.27442536991456,
firebrick = 0.10724525535015,
floralwhite = 0.95922484825004,
forestgreen = 0.18920812076002,
fuchsia = 0.2848,
gainsboro = 0.71569350050648,
ghostwhite = 0.94311261886323,
gold = 0.69860877428159,
goldenrod = 0.41919977809569,
gray = 0.2158605001139,
green = 0.15438342968146,
greenyellow = 0.80609472611453,
grey = 0.2158605001139,
honeydew = 0.96336535554782,
hotpink = 0.34658438169715,
indianred = 0.21406134963884,
indigo = 0.03107561486337,
ivory = 0.99071270600615,
khaki = 0.77012343394121,
lavender = 0.80318750514521,
lavenderblush = 0.90172748631046,
lawngreen = 0.73905893124963,
lemonchiffon = 0.94038992245622,
lightblue = 0.63709141280807,
lightcoral = 0.35522120733135,
lightcyan = 0.94587293494829,
lightgoldenrodyellow = 0.93348351018297,
lightgray = 0.65140563741982,
lightgreen = 0.69091979956865,
lightgrey = 0.65140563741982,
lightpink = 0.58566152734898,
lightsalmon = 0.4780675225206,
lightseagreen = 0.35050145117042,
lightskyblue = 0.56195637618331,
lightslategray = 0.23830165007287,
lightslategrey = 0.23830165007287,
lightsteelblue = 0.53983888284666,
lightyellow = 0.98161818392882,
lime = 0.7152,
limegreen = 0.44571042246098,
linen = 0.88357340984379,
magenta = 0.2848,
maroon = 0.045891942324215,
mediumaquamarine = 0.49389703310801,
mediumblue = 0.044077780212328,
mediumorchid = 0.21639251153773,
mediumpurple = 0.22905858091648,
mediumseagreen = 0.34393112338131,
mediumslateblue = 0.20284629471622,
mediumspringgreen = 0.70704308194184,
mediumturquoise = 0.5133827926448,
mediumvioletred = 0.14371899849357,
midnightblue = 0.02071786635086,
mintcream = 0.97834604947588,
mistyrose = 0.82183047859185,
moccasin = 0.80083000991567,
navajowhite = 0.76519682342785,
navy = 0.015585128108224,
oldlace = 0.91900633405549,
olive = 0.20027537200568,
olivedrab = 0.22593150951929,
orange = 0.4817026703631,
orangered = 0.25516243753416,
orchid = 0.31348806761439,
palegoldenrod = 0.78792647887614,
palegreen = 0.77936759006353,
paleturquoise = 0.76436077921714,
palevioletred = 0.28754994117889,
papayawhip = 0.87797100199835,
peachpuff = 0.74905589878251,
peru = 0.30113074877936,
pink = 0.63271070702466,
plum = 0.45734221587969,
powderblue = 0.68254586500605,
purple = 0.061477070432439,
rebeccapurple = 0.07492341159447,
red = 0.2126,
rosybrown = 0.32319457649407,
royalblue = 0.16663210743188,
saddlebrown = 0.097922285020521,
salmon = 0.36977241527596,
sandybrown = 0.46628543696283,
seagreen = 0.19734199706275,
seashell = 0.92737862206922,
sienna = 0.13697631337098,
silver = 0.52711512570581,
skyblue = 0.55291668518184,
slateblue = 0.14784278062136,
slategray = 0.20896704076536,
slategrey = 0.20896704076536,
snow = 0.96533341834849,
springgreen = 0.73052306068529,
steelblue = 0.20562642207625,
tan = 0.48237604163921,
teal = 0.16996855778968,
thistle = 0.56818401093733,
tomato = 0.30638612719415,
turquoise = 0.5895536427578,
violet = 0.40315452986676,
wheat = 0.74909702820482,
white = 1,
whitesmoke = 0.91309865179342,
yellow = 0.9278,
yellowgreen = 0.50762957208707,
}</text>
<sha1>chi69ar1btd4wp6xbk3uez6sfu0vipn</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, &quot;Template documentation&quot; or &quot;Module documentation&quot;, 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 &quot;foo-message&quot; had the value 'Foo $2 bar $1.',
-- message('foo-message', {'baz', 'qux'}) would return &quot;Foo qux bar baz.&quot;
--]]
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 &lt; 1 then
return nil
end
for i = 1, lim do
ret[#ret + 1] = select(i, ...)
end
return '&lt;small style=&quot;font-style: normal;&quot;&gt;(' .. table.concat(ret, ' &amp;#124; ') .. ')&lt;/small&gt;'
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' --&gt; 'template-documentation'
-- 'main-div-classes' --&gt; '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' --&gt; 'sandbox'
-- 'testcases-subpage' --&gt; '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' --&gt; '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' --&gt; 'sandbox'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))
end
function envFuncs.testcasesTitle()
--[[
-- Title object for the /testcases subpage.
-- Messages:
-- 'testcases-subpage' --&gt; 'testcases'
--]]
return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))
end
function envFuncs.printTitle()
--[[
-- Title object for the /Print subpage.
-- Messages:
-- 'print-subpage' --&gt; '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' --&gt; '[[Image:Sandbox.svg|50px|alt=|link=]]'
-- 'sandbox-notice-blurb' --&gt; 'This is the $1 for $2.'
-- 'sandbox-notice-diff-blurb' --&gt; 'This is the $1 for $2 ($3).'
-- 'sandbox-notice-pagetype-template' --&gt; '[[Wikipedia:Template test cases|template sandbox]] page'
-- 'sandbox-notice-pagetype-module' --&gt; '[[Wikipedia:Template test cases|module sandbox]] page'
-- 'sandbox-notice-pagetype-other' --&gt; 'sandbox page'
-- 'sandbox-notice-compare-link-display' --&gt; 'diff'
-- 'sandbox-notice-testcases-blurb' --&gt; 'See also the companion subpage for $1.'
-- 'sandbox-notice-testcases-link-display' --&gt; 'test cases'
-- 'sandbox-category' --&gt; '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, &quot;image&quot; and &quot;text&quot;.
local omargs = {}
omargs.image = message('sandbox-notice-image')
-- Get the text. We start with the opening blurb, which is something like
-- &quot;This is the template sandbox for [[Template:Foo]] (diff).&quot;
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
-- &quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&quot;
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 .. '&lt;br /&gt;' .. 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 .. '&lt;br /&gt;' .. 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 = '&lt;div style=&quot;clear: both;&quot;&gt;&lt;/div&gt;'
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' --&gt; 'pp-template'
-- 'protection-template-args' --&gt; {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 &quot;autoconfirmed&quot;, 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' --&gt; 'view'
-- 'edit-link-display' --&gt; 'edit'
-- 'history-link-display' --&gt; 'history'
-- 'purge-link-display' --&gt; 'purge'
-- 'file-docpage-preload' --&gt; 'Template:Documentation/preload-filespace'
-- 'module-preload' --&gt; 'Template:Documentation/preload-module-doc'
-- 'docpage-preload' --&gt; 'Template:Documentation/preload'
-- 'create-link-display' --&gt; '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('%[', '&amp;#91;') -- Replace square brackets with HTML entities.
s = s:gsub('%]', '&amp;#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' --&gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'
-- 'template-namespace-heading' --&gt; 'Template documentation'
-- 'module-namespace-heading' --&gt; 'Module documentation'
-- 'file-namespace-heading' --&gt; 'Summary'
-- 'other-namespaces-heading' --&gt; 'Documentation'
-- 'start-box-linkclasses' --&gt; 'mw-editsection-like plainlinks'
-- 'start-box-link-id' --&gt; 'doc_editlinks'
-- 'testcases-create-link-display' --&gt; 'create'
--]=]
local subjectSpace = env.subjectSpace
if not subjectSpace then
-- Default to an &quot;other namespaces&quot; 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 &quot;=== Headings ===&quot; 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' --&gt; 'documentation-meta-data'
-- 'fmbox-style' --&gt; 'background-color: #ecfcf4'
-- 'fmbox-textstyle' --&gt; '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 '') -- &quot;This documentation is transcluded from [[Foo]].&quot;
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
-- We are in the user, template or module namespaces.
-- Add sandbox and testcases links.
-- &quot;Editors can experiment in this template's sandbox and testcases pages.&quot;
text = text .. (p.makeExperimentBlurb(args, env) or '')
text = text .. '&lt;br /&gt;'
if not args.content and not args[1] then
-- &quot;Please add categories to the /doc subpage.&quot;
-- 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 '') --&quot;Subpages of this template&quot;
local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
if printBlurb then
text = text .. '&lt;br /&gt;' .. printBlurb
end
end
end
fmargs.text = text
return messageBox.main('fmbox', fmargs)
end
function p.makeDocPageBlurb(args, env)
--[=[
-- Makes the blurb &quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&quot;.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'edit-link-display' --&gt; 'edit'
-- 'history-link-display' --&gt; 'history'
-- 'transcluded-from-blurb' --&gt;
-- 'The above [[Wikipedia:Template documentation|documentation]]
-- is [[Wikipedia:Transclusion|transcluded]] from $1.'
-- 'module-preload' --&gt; 'Template:Documentation/preload-module-doc'
-- 'create-link-display' --&gt; 'create'
-- 'create-module-doc-blurb' --&gt;
-- '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)
.. '&lt;br /&gt;'
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})
.. '&lt;br /&gt;'
end
return ret
end
function p.makeExperimentBlurb(args, env)
--[[
-- Renders the text &quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&quot;
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
--
-- Messages:
-- 'sandbox-link-display' --&gt; 'sandbox'
-- 'sandbox-edit-link-display' --&gt; 'edit'
-- 'compare-link-display' --&gt; 'diff'
-- 'module-sandbox-preload' --&gt; 'Template:Documentation/preload-module-sandbox'
-- 'template-sandbox-preload' --&gt; 'Template:Documentation/preload-sandbox'
-- 'sandbox-create-link-display' --&gt; 'create'
-- 'mirror-edit-summary' --&gt; 'Create sandbox version of $1'
-- 'mirror-link-display' --&gt; 'mirror'
-- 'mirror-link-preload' --&gt; 'Template:Documentation/mirror'
-- 'sandbox-link-display' --&gt; 'sandbox'
-- 'testcases-link-display' --&gt; 'testcases'
-- 'testcases-edit-link-display'--&gt; 'edit'
-- 'template-sandbox-preload' --&gt; 'Template:Documentation/preload-sandbox'
-- 'testcases-create-link-display' --&gt; 'create'
-- 'testcases-link-display' --&gt; 'testcases'
-- 'testcases-edit-link-display' --&gt; 'edit'
-- 'module-testcases-preload' --&gt; 'Template:Documentation/preload-module-testcases'
-- 'template-testcases-preload' --&gt; 'Template:Documentation/preload-testcases'
-- 'experiment-blurb-module' --&gt; 'Editors can experiment in this module's $1 and $2 pages.'
-- 'experiment-blurb-template' --&gt; '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 &quot;Please add categories to the /doc subpage.&quot;
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'doc-link-display' --&gt; '/doc'
-- 'add-categories-blurb' --&gt; '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 &quot;Subpages of this template&quot; link.
-- @args - a table of arguments passed by the user
-- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages:
-- 'template-pagetype' --&gt; 'template'
-- 'module-pagetype' --&gt; 'module'
-- 'default-pagetype' --&gt; 'page'
-- 'subpages-link-display' --&gt; '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' --&gt; '/Print'
-- 'print-blurb' --&gt; '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' --&gt; true
-- 'print-category' --&gt; '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' --&gt; true
-- 'doc-subpage' --&gt; 'doc'
-- 'testcases-subpage' --&gt; 'testcases'
-- 'strange-usage-category' --&gt; '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 &quot;view&quot; links.
cfg['view-link-display'] = 'view'
-- cfg['edit-link-display']
-- The text to display for &quot;edit&quot; links.
cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display']
-- The text to display for &quot;history&quot; links.
cfg['history-link-display'] = 'history'
-- cfg['purge-link-display']
-- The text to display for &quot;purge&quot; links.
cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display']
-- The text to display for &quot;create&quot; 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, &quot;sandbox&quot;, &quot;edit&quot;, &quot;diff&quot;, &quot;testcases&quot;, and &quot;edit&quot; 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'] = &quot;Editors can experiment in this template's $1 and $2 pages.&quot;
cfg['experiment-blurb-module'] = &quot;Editors can experiment in this module's $1 and $2 pages.&quot;
----------------------------------------------------------------------------------------------------
-- 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 &quot;sandbox&quot; links.
cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display']
-- The text to display for sandbox &quot;edit&quot; links.
cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display']
-- The text to display for sandbox &quot;create&quot; links.
cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display']
-- The text to display for &quot;compare&quot; links.
cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary']
-- The default edit summary to use when a user clicks the &quot;mirror&quot; 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 &quot;mirror&quot; links.
cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload']
-- The page to preload when a user clicks the &quot;mirror&quot; 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 &quot;testcases&quot; links.
cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display']
-- The text to display for test cases &quot;edit&quot; links.
cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display']
-- The text to display for test cases &quot;run&quot; links.
cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display']
-- The text to display for test cases &quot;create&quot; 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 &quot;content&quot; or
-- &quot;docname fed&quot; 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 &quot;Subpages of this template&quot; 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 &quot;subpages of this page&quot; 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 &quot;id&quot; attribute of the main HTML &quot;div&quot; tag.
cfg['main-div-id'] = 'template-documentation'
-- cfg['main-div-classes']
-- The CSS classes added to the main HTML &quot;div&quot; 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 &quot;id&quot; 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 &quot;id&quot; 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 &quot;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>713934935</id>
<parentid>708059351</parentid>
<timestamp>2016-04-06T17:04:11Z</timestamp>
<contributor>
<username>Jackmcbarn</username>
<id>19285809</id>
</contributor>
<comment>handle extendedconfirmed</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="3018">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' ) then -- user JS or CSS 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>6hocqvqqlqw255k1l856h6hwlqsf6e1</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(
&quot;type error in '%s' parameter of '_main' (expected string, got %s)&quot;,
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(&quot;'file' parameter missing from [[Template:File link]]&quot;, 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:Infobox</title>
<ns>828</ns>
<id>38808424</id>
<revision>
<id>822189612</id>
<parentid>786097736</parentid>
<timestamp>2018-01-24T22:39:59Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<comment>infobox class not needed for subbox since the parent box will set the class (and causes problems on mobile)</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="15447">--
-- 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 = '&lt;span class=special_infobox_marker&gt;'
local s = sval
s = mw.ustring.gsub(s, '(&lt;%s*[Tt][Rr])', marker .. '%1')
s = mw.ustring.gsub(s, '(&lt;/[Tt][Rr]%s*&gt;)', '%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, '(&lt;/[Cc][Aa][Pp][Tt][Ii][Oo][Nn]%s*&gt;%s*)' .. marker, '%1')
s = mw.ustring.gsub(s, '(&lt;%s*[Tt][Aa][Bb][Ll][Ee][^&lt;&gt;]*&gt;%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*&lt;/[Tt][Aa][Bb][Ll][Ee]%s*&gt;)', '%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] .. '&lt;/' .. tt .. '&gt;&lt;/tr&gt;'
elseif k == #subcells then
local rowstyle = ' style=&quot;display:none&quot;'
if notempty(subcells[k]) then rowstyle = '' end
s = s .. '&lt;tr' .. rowstyle ..'&gt;&lt;' .. tt .. ' colspan=2&gt;\n' .. subcells[k]
elseif notempty(subcells[k]) then
if (k % 2) == 0 then
s = s .. subcells[k]
else
s = s .. '&lt;tr&gt;&lt;' .. tt .. ' colspan=2&gt;\n' .. subcells[k] .. '&lt;/' .. tt .. '&gt;&lt;/tr&gt;'
end
end
end
end
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 &quot;prefix&quot; string and a &quot;depend&quot; table. The function always parses
-- parameters containing the &quot;prefix&quot; string, but only parses parameters in the &quot;depend&quot;
-- table if the prefix parameter is present and non-blank.
if type(prefixTable) ~= 'table' then
error(&quot;Non-table value detected for the prefix table&quot;, 2)
end
if type(step) ~= 'number' then
error(&quot;Invalid step value detected&quot;, 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) ~= &quot;string&quot; 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 &quot;depend&quot; 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 &quot;prefix1&quot; and &quot;prefix&quot; 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>70c4sw4coyjec1b3vfiyyrfzu3bapv8</sha1>
</revision>
</page>
<page>
<title>Module:InfoboxImage</title>
<ns>828</ns>
<id>38581924</id>
<revision>
<id>769944044</id>
<parentid>755884847</parentid>
<timestamp>2017-03-12T14:50:35Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<comment>add px to sizedefault if just a number</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="9641">-- 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 &quot;Module:InfoboxImage/doc&quot; page
local i = {};
local placeholder_image = {
&quot;Blue - Replace this image female.svg&quot;,
&quot;Blue - Replace this image male.svg&quot;,
&quot;Female no free image yet.png&quot;,
&quot;Flag of None (square).svg&quot;,
&quot;Flag of None.svg&quot;,
&quot;Flag of.svg&quot;,
&quot;Green - Replace this image female.svg&quot;,
&quot;Green - Replace this image male.svg&quot;,
&quot;Image is needed female.svg&quot;,
&quot;Image is needed male.svg&quot;,
&quot;Location map of None.svg&quot;,
&quot;Male no free image yet.png&quot;,
&quot;Missing flag.png&quot;,
&quot;No flag.svg&quot;,
&quot;No free portrait.svg&quot;,
&quot;No portrait (female).svg&quot;,
&quot;No portrait (male).svg&quot;,
&quot;Red - Replace this image female.svg&quot;,
&quot;Red - Replace this image male.svg&quot;,
&quot;Replace this image female (blue).svg&quot;,
&quot;Replace this image female.svg&quot;,
&quot;Replace this image male (blue).svg&quot;,
&quot;Replace this image male.svg&quot;,
&quot;Silver - Replace this image female.svg&quot;,
&quot;Silver - Replace this image male.svg&quot;,
&quot;Replace this image.svg&quot;,
&quot;Cricket no pic.png&quot;,
&quot;CarersLogo.gif&quot;,
&quot;Diagram Needed.svg&quot;,
&quot;Example.jpg&quot;,
&quot;Image placeholder.png&quot;,
&quot;No male portrait.svg&quot;,
&quot;Nocover-upload.png&quot;,
&quot;NoDVDcover copy.png&quot;,
&quot;Noribbon.svg&quot;,
&quot;No portrait-BFD-test.svg&quot;,
&quot;Placeholder barnstar ribbon.png&quot;,
&quot;Project Trains no image.png&quot;,
&quot;Image-request.png&quot;,
&quot;Sin bandera.svg&quot;,
&quot;Sin escudo.svg&quot;,
&quot;Replace this image - temple.png&quot;,
&quot;Replace this image butterfly.png&quot;,
&quot;Replace this image.svg&quot;,
&quot;Replace this image1.svg&quot;,
&quot;Resolution angle.png&quot;,
&quot;Image-No portrait-text-BFD-test.svg&quot;,
&quot;Insert image here.svg&quot;,
&quot;No image available.png&quot;,
&quot;NO IMAGE YET square.png&quot;,
&quot;NO IMAGE YET.png&quot;,
&quot;No Photo Available.svg&quot;,
&quot;No Screenshot.svg&quot;,
&quot;No-image-available.jpg&quot;,
&quot;Null.png&quot;,
&quot;PictureNeeded.gif&quot;,
&quot;Place holder.jpg&quot;,
&quot;Unbenannt.JPG&quot;,
&quot;UploadACopyrightFreeImage.svg&quot;,
&quot;UploadAnImage.gif&quot;,
&quot;UploadAnImage.svg&quot;,
&quot;UploadAnImageShort.svg&quot;,
&quot;CarersLogo.gif&quot;,
&quot;Diagram Needed.svg&quot;,
&quot;No male portrait.svg&quot;,
&quot;NoDVDcover copy.png&quot;,
&quot;Placeholder barnstar ribbon.png&quot;,
&quot;Project Trains no image.png&quot;,
&quot;Image-request.png&quot;,
}
function i.IsPlaceholder(image)
-- change underscores to spaces
image = mw.ustring.gsub(image, &quot;_&quot;, &quot; &quot;);
assert(image ~= nil, 'mw.ustring.gsub(image, &quot;_&quot;, &quot; &quot;) must not return nil')
-- if image starts with [[ then remove that and anything after |
if mw.ustring.sub(image,1,2) == &quot;[[&quot; then
image = mw.ustring.sub(image,3);
image = mw.ustring.gsub(image, &quot;([^|]*)|.*&quot;, &quot;%1&quot;);
assert(image ~= nil, 'mw.ustring.gsub(image, &quot;([^|]*)|.*&quot;, &quot;%1&quot;) must not return nil')
end
-- Trim spaces
image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1');
assert(image ~= nil, &quot;mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil&quot;)
-- 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 .. &quot;:&quot;) 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[&quot;image&quot;];
if image == &quot;&quot; or image == nil then
return &quot;&quot;;
end
if image == &quot;&amp;nbsp;&quot; then
return image;
end
if frame.args[&quot;suppressplaceholder&quot;] ~= &quot;no&quot; then
if i.IsPlaceholder(image) == true then
return &quot;&quot;;
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == &quot;http:&quot; then
return &quot;&quot;;
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == &quot;[http:&quot; then
return &quot;&quot;;
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == &quot;[[http:&quot; then
return &quot;&quot;;
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == &quot;https:&quot; then
return &quot;&quot;;
end
if mw.ustring.lower(mw.ustring.sub(image,1,7)) == &quot;[https:&quot; then
return &quot;&quot;;
end
if mw.ustring.lower(mw.ustring.sub(image,1,8)) == &quot;[[https:&quot; then
return &quot;&quot;;
end
if mw.ustring.sub(image,1,2) == &quot;[[&quot; then
-- search for thumbnail images and add to tracking cat if found
if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, &quot;|%s*thumb%s*[|%]]&quot;) or mw.ustring.find(image, &quot;|%s*thumbnail%s*[|%]]&quot;)) then
return image .. &quot;[[Category:Pages using infoboxes with thumbnail images]]&quot;;
elseif mw.title.getCurrentTitle().namespace == 0 then
return image .. &quot;[[Category:Pages using deprecated image syntax]]&quot;;
else
return image;
end
elseif mw.ustring.sub(image,1,2) == &quot;{{&quot; and mw.ustring.sub(image,1,3) ~= &quot;{{{&quot; then
return image;
elseif mw.ustring.sub(image,1,1) == &quot;&lt;&quot; then
return image;
elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127)..&quot;UNIQ&quot; then
-- Found strip marker at begining, so pass don't process at all
return image;
elseif mw.ustring.sub(image,4,9) == &quot;`UNIQ-&quot; then
-- Found strip marker at begining, so pass don't process at all
return image;
else
local result = &quot;&quot;;
local page = frame.args[&quot;page&quot;];
local size = frame.args[&quot;size&quot;];
local maxsize = frame.args[&quot;maxsize&quot;];
local sizedefault = frame.args[&quot;sizedefault&quot;];
local alt = frame.args[&quot;alt&quot;];
local link = frame.args[&quot;link&quot;];
local title = frame.args[&quot;title&quot;];
local border = frame.args[&quot;border&quot;];
local upright = frame.args[&quot;upright&quot;] or &quot;&quot;;
local thumbtime = frame.args[&quot;thumbtime&quot;] or &quot;&quot;;
local center= frame.args[&quot;center&quot;];
-- 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 .. &quot;:&quot;) then
image = mw.ustring.sub(image, mw.ustring.len(name) + 2);
break
end
end
if maxsize ~= &quot;&quot; and maxsize ~= nil then
-- if no sizedefault then set to maxsize
if sizedefault == &quot;&quot; or sizedefault == nil then
sizedefault = maxsize
end
-- check to see if size bigger than maxsize
if size ~= &quot;&quot; and size ~= nil then
local sizenumber = tonumber(mw.ustring.match(size,&quot;%d*&quot;)) or 0;
local maxsizenumber = tonumber(mw.ustring.match(maxsize,&quot;%d*&quot;)) or 0;
if sizenumber&gt;maxsizenumber and maxsizenumber&gt;0 then
size = maxsize;
end
end
end
-- add px to size if just a number
if (tonumber(size) or 0) &gt; 0 then
size = size .. &quot;px&quot;;
end
-- add px to sizedefault if just a number
if (tonumber(sizedefault) or 0) &gt; 0 then
sizedefault = sizedefault .. &quot;px&quot;;
end
result = &quot;[[File:&quot; .. image;
if page ~= &quot;&quot; and page ~= nil then
result = result .. &quot;|page=&quot; .. page;
end
if size ~= &quot;&quot; and size ~= nil then
result = result .. &quot;|&quot; .. size;
elseif sizedefault ~= &quot;&quot; and sizedefault ~= nil then
result = result .. &quot;|&quot; .. sizedefault;
else
result = result .. &quot;|frameless&quot;;
end
if center == &quot;yes&quot; then
result = result .. &quot;|center&quot;
end
if alt ~= &quot;&quot; and alt ~= nil then
result = result .. &quot;|alt=&quot; .. alt;
end
if link ~= &quot;&quot; and link ~= nil then
result = result .. &quot;|link=&quot; .. link;
end
if border == &quot;yes&quot; then
result = result .. &quot;|border&quot;;
end
if upright == &quot;yes&quot; then
result = result .. &quot;|upright&quot;;
elseif upright ~= &quot;&quot; then
result = result .. &quot;|upright=&quot; .. upright;
end
if thumbtime ~= &quot;&quot; then
result = result .. &quot;|thumbtime=&quot; .. thumbtime;
end
if title ~= &quot;&quot; and title ~= nil then
result = result .. &quot;|&quot; .. title;
elseif alt ~= &quot;&quot; and alt ~= nil then
result = result .. &quot;|&quot; .. alt;
end
result = result .. &quot;]]&quot;;
return result;
end
end
return i;</text>
<sha1>n4nldwdqxa2f7m558z3tw0vr90z070g</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 &quot;valid&quot;
else
return &quot;&quot;
end
end
return export</text>
<sha1>hoypn4rnht45b6h0cxlb6y0r0h6hpq2</sha1>
</revision>
</page>
<page>
<title>Module:Message box</title>
<ns>828</ns>
<id>40574910</id>
<revision>
<id>803399820</id>
<parentid>742383679</parentid>
<timestamp>2017-10-02T09:03:51Z</timestamp>
<contributor>
<username>WOSlinker</username>
<id>3138265</id>
</contributor>
<comment>change span to div to reduce lint errors</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="16807">-- 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 categoryHandler = require('Module:Category handler')._main
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 &quot;mbox&quot; 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 = {}
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.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(&quot; &lt;small&gt;''(%s)''&lt;/small&gt;&quot;, date)
end
self.info = args.info
if yesno(args.removalnotice) then
self.removalNotice = cfg.removalNotice