Page MenuHomeMiraheze

Wikipedia-20180211003858.xml

Authored By
Rob_Kam
Feb 24 2018, 14:27
Size
361 KB
Referenced Files
None
Subscribers
None

Wikipedia-20180211003858.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:N/a</title>
<ns>10</ns>
<id>2499787</id>
<revision>
<id>738385183</id>
<parentid>689743301</parentid>
<timestamp>2016-09-08T17:07:00Z</timestamp>
<contributor>
<username>Andy M. Wang</username>
<id>516856</id>
</contributor>
<comment>sync sandbox by [[User:Matt Fitzpatrick]]: default sort as blank cell requested by [[User:Masem]] and 50.53.1.33, unopposed</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="279">{| class=&quot;wikitable&quot;
|-
| &lt;onlyinclude&gt;data-sort-value=&quot;{{{sort|}}}&quot; style=&quot;background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-na&quot; &lt;!--
--&gt;| {{{1|N/A}}}&lt;/onlyinclude&gt;
|}
{{documentation}}</text>
<sha1>izdroi3sfz085omzs2a6c9gu7f6zyzd</sha1>
</revision>
</page>
<page>
<title>Template:=</title>
<ns>10</ns>
<id>5762361</id>
<revision>
<id>690395465</id>
<parentid>579820445</parentid>
<timestamp>2015-11-13T02:17:24Z</timestamp>
<contributor>
<username>Fuhghettaboutit</username>
<id>665998</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:=: when I changed this to add template editors, I didn't realize it had cascding protection—so all my change did was make it appear as if it could be edited by them ([Edit=Allow only administrators] (indefinite) [...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="43">=&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>81y2jvjxw3y0febsqx5xbr4ikdc7nr6</sha1>
</revision>
</page>
<page>
<title>Template:Active</title>
<ns>10</ns>
<id>3951718</id>
<revision>
<id>748993299</id>
<parentid>748981212</parentid>
<timestamp>2016-11-11T17:42:11Z</timestamp>
<contributor>
<username>Obsuser</username>
<id>22359926</id>
</contributor>
<comment>Undid revision 748981212 by [[Special:Contributions/52.87.153.83|52.87.153.83]] ([[User talk:52.87.153.83|talk]]): vandalism</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="274">style=&quot;background: #90FF90; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;active table-active&quot;| {{{1|Active}}}&lt;noinclude&gt;
{{Documentation|Template:Table cell templates/doc}}
[[Category:Software table cell templates]]
&lt;/noinclude&gt;</text>
<sha1>6f7qo9rsqzlygxvrv1t3cmarn2dcy38</sha1>
</revision>
</page>
<page>
<title>Template:Active fire</title>
<ns>10</ns>
<id>47413811</id>
<revision>
<id>678331137</id>
<parentid>678330821</parentid>
<timestamp>2015-08-28T18:33:47Z</timestamp>
<contributor>
<username>Zackmann08</username>
<id>15881234</id>
</contributor>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="247">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #faa; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;no table-no&quot;|Active {{nowrap|({{{1|}}})}}&lt;noinclude&gt;
|}
{{documentation}}&lt;/noinclude&gt;</text>
<sha1>hfi3fa45y39zdeez06kc26mjctw3nl7</sha1>
</revision>
</page>
<page>
<title>Template:Any</title>
<ns>10</ns>
<id>12347924</id>
<revision>
<id>544870285</id>
<parentid>349077447</parentid>
<timestamp>2013-03-17T07:05:31Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 4 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q6681541]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="294">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;any table-any&quot;|{{{1|Any}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[es:Plantilla:Alguno]]
&lt;/noinclude&gt;</text>
<sha1>99mtyenfx384kn81fuea9resxvis2gw</sha1>
</revision>
</page>
<page>
<title>Template:Available</title>
<ns>10</ns>
<id>26796140</id>
<revision>
<id>410652312</id>
<parentid>410652231</parentid>
<timestamp>2011-01-28T23:02:30Z</timestamp>
<contributor>
<username>WOSlinker</username>
<id>3138265</id>
</contributor>
<comment>docs</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="274">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #90ff90; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-yes&quot;|{{{1|Available}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>c8rf7d2de67ggbi7c2yg0c5ydjvgcpg</sha1>
</revision>
</page>
<page>
<title>Template:BLACK</title>
<ns>10</ns>
<id>10235306</id>
<revision>
<id>739572941</id>
<parentid>737805405</parentid>
<timestamp>2016-09-15T14:10:32Z</timestamp>
<contributor>
<ip>50.53.1.33</ip>
</contributor>
<comment>text to lightgray to adhere to WCAG 2 AAA Compliancy</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="286">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;data-sort-value=&quot;{{{sort|}}}&quot; style=&quot;background: black; color: lightgray; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-na&quot;|{{{1|N/A}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}</text>
<sha1>9t6jyhg2nbt5xurq85dqtvzgqtc68y9</sha1>
</revision>
</page>
<page>
<title>Template:Bad</title>
<ns>10</ns>
<id>26575979</id>
<revision>
<id>639907101</id>
<parentid>639907059</parentid>
<timestamp>2014-12-28T05:55:23Z</timestamp>
<contributor>
<username>Bijay chaurasia</username>
<id>22292860</id>
</contributor>
<minor/>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="267">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #faa; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;no table-no&quot;| {{{1|Bad}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>k0hb0wq7jzu40aorofdxm5hjme81cor</sha1>
</revision>
</page>
<page>
<title>Template:Beta</title>
<ns>10</ns>
<id>3623759</id>
<revision>
<id>730472451</id>
<parentid>730133775</parentid>
<timestamp>2016-07-19T06:36:26Z</timestamp>
<contributor>
<username>Nick Mitchell 98</username>
<id>19666637</id>
</contributor>
<comment>Restored to previous revision by [[User:Edokter|Edokter]]. Coding was damaged by previous edit.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="317">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DFDFFF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;beta table-beta&quot;|{{{1|[[software release life cycle#Beta{{!}}Beta]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>9rveg708dhzulli61gvya14vg4kbvwd</sha1>
</revision>
</page>
<page>
<title>Template:CAlso starring</title>
<ns>10</ns>
<id>56360120</id>
<revision>
<id>824726950</id>
<parentid>822964521</parentid>
<timestamp>2018-02-09T03:03:52Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<comment>TFD closed as no consensus ([[WP:XFDC|XFDcloser]])</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="259">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#afeeee;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; |{{{1|[[Ensemble cast|Also starring]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>gu0gs778yxdjs0pqhw4ngjyylc51g0g</sha1>
</revision>
</page>
<page>
<title>Template:CGuest</title>
<ns>10</ns>
<id>44127729</id>
<revision>
<id>819687193</id>
<parentid>723502916</parentid>
<timestamp>2018-01-10T19:21:15Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:CGuest]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefi...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="254">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#DAEBFF;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; |{{{1|[[Guest appearance|Guest]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>8atx8o5dbqdx70slvu5kz34pmonqgvw</sha1>
</revision>
</page>
<page>
<title>Template:CMain</title>
<ns>10</ns>
<id>44127692</id>
<revision>
<id>819687206</id>
<parentid>703427561</parentid>
<timestamp>2018-01-10T19:21:15Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:CMain]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefin...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="250">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#ddffdd;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; |{{{1|[[Ensemble cast|Main]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>oypuh0m90v3e5qhxmp9s2d8f6epr35t</sha1>
</revision>
</page>
<page>
<title>Template:CNone</title>
<ns>10</ns>
<id>51441664</id>
<revision>
<id>821200502</id>
<parentid>736708367</parentid>
<timestamp>2018-01-19T00:28:40Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:CNone]]&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="329">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#ececec;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; |{{{1|&lt;!-- Accessibility text for screen readers only --&gt;&lt;span style=&quot;display: none&quot;&gt;Does not appear&lt;/span&gt;}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>pr227hj74we71dxa4dt0yob3noybyiu</sha1>
</revision>
</page>
<page>
<title>Template:CRecurring</title>
<ns>10</ns>
<id>44127701</id>
<revision>
<id>819687194</id>
<parentid>703208906</parentid>
<timestamp>2018-01-10T19:21:15Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:CRecurring]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (in...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="261">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#ffe3e3;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; |{{{1|[[Recurring character|Recurring]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>b6pos58qawntdawfvxuwn1jy4navyca</sha1>
</revision>
</page>
<page>
<title>Template:Coming soon</title>
<ns>10</ns>
<id>22270336</id>
<revision>
<id>690336399</id>
<parentid>661114721</parentid>
<timestamp>2015-11-12T18:56:20Z</timestamp>
<contributor>
<username>Ahecht</username>
<id>2016996</id>
</contributor>
<comment>edit background to make consistent with [[:Template:Ya]] following recent changes</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="293">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: {{{color|#FFD2D2}}}; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;active table-siteactive&quot;|{{{1|Coming soon}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Coming soon/doc}}
&lt;/noinclude&gt;</text>
<sha1>rjueid3wwlycadznsh2mi1so6endoao</sha1>
</revision>
</page>
<page>
<title>Template:Contained</title>
<ns>10</ns>
<id>47413777</id>
<revision>
<id>678331407</id>
<parentid>674275166</parentid>
<timestamp>2015-08-28T18:35:44Z</timestamp>
<contributor>
<username>Zackmann08</username>
<id>15881234</id>
</contributor>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="233">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #99FF99; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;yes table-yes&quot;|Contained&lt;noinclude&gt;
|}
{{documentation}}&lt;/noinclude&gt;</text>
<sha1>3ajwpue83k3zvdetq2pojtk80rvg3bd</sha1>
</revision>
</page>
<page>
<title>Template:Depends</title>
<ns>10</ns>
<id>2499773</id>
<revision>
<id>677624608</id>
<parentid>642253187</parentid>
<timestamp>2015-08-24T14:01:45Z</timestamp>
<contributor>
<username>Steel1943</username>
<id>2952402</id>
</contributor>
<comment>Documentation</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="282">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FED; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;depends table-depends&quot;|{{{1|Depends}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>k5f0tfybyqm7m6yt6plwt0txykkhi7z</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:Draw</title>
<ns>10</ns>
<id>30679990</id>
<revision>
<id>804536471</id>
<parentid>549046384</parentid>
<timestamp>2017-10-09T17:20:34Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Draw]]&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="263">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#c5d2ea; color:black; vertical-align:middle; text-align:{{{align|center}}}; {{{style|}}}&quot; class=&quot;table-draw&quot; |{{{1|}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>syo1yjnhgk2f3q5596y2d9areyggabo</sha1>
</revision>
</page>
<page>
<title>Template:Dropped</title>
<ns>10</ns>
<id>2499768</id>
<revision>
<id>550409324</id>
<parentid>422967703</parentid>
<timestamp>2013-04-15T02:45:01Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 3 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q10951509]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="282">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FED; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;dropped table-dropped&quot;|{{{1|Dropped}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>e844dty585c314f15fdd5knxzjfuo52</sha1>
</revision>
</page>
<page>
<title>Template:Dunno</title>
<ns>10</ns>
<id>2859716</id>
<revision>
<id>819682154</id>
<parentid>715940422</parentid>
<timestamp>2018-01-10T18:58:57Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Dunno]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefin...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="175">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;{{Unknown|{{{1|?}}}|{{{align|}}}|{{{style|}}}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>grligd7b76zgob5y3j4bu8r5fq0xg00</sha1>
</revision>
</page>
<page>
<title>Template:Eliminated</title>
<ns>10</ns>
<id>37967925</id>
<revision>
<id>539283857</id>
<parentid>528677679</parentid>
<timestamp>2013-02-20T19:48:04Z</timestamp>
<contributor>
<ip>101.112.180.65</ip>
</contributor>
<comment>colour too light. The standard colour for &quot;Eliminated&quot; is salmon or #FA8072.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="274">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#FA8072; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no&quot; | {{{1|Eliminated}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>sirs980l9k4ptbcpqcqc35fyy065xp3</sha1>
</revision>
</page>
<page>
<title>Template:Failure</title>
<ns>10</ns>
<id>43113144</id>
<revision>
<id>722939237</id>
<parentid>613849608</parentid>
<timestamp>2016-05-31T01:19:14Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Create templates for launch outcome</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="277">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #ffbbbb; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-failure&quot; | {{{1|Failure}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>f2jdefnlea6j0wlemidra76kc6vp8ye</sha1>
</revision>
</page>
<page>
<title>Template:Free</title>
<ns>10</ns>
<id>4740161</id>
<revision>
<id>819687524</id>
<parentid>739604667</parentid>
<timestamp>2018-01-10T19:21:37Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Free]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefini...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="315">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #9FF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;free table-free&quot;|{{{1|Free}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[Category:Software table cell templates]]
&lt;/noinclude&gt;</text>
<sha1>gzmoj3251y0apqmfe58r81s4ygmen41</sha1>
</revision>
</page>
<page>
<title>Template:Good</title>
<ns>10</ns>
<id>26576004</id>
<revision>
<id>821201390</id>
<parentid>618072259</parentid>
<timestamp>2018-01-19T00:29:58Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Good]]&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="272">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #bfd; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;yes2 table-yes2&quot;| {{{1|Good}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>ozn5kq60ba8pfdh06596rcpyqj2uzx3</sha1>
</revision>
</page>
<page>
<title>Template:High-use</title>
<ns>10</ns>
<id>17406187</id>
<revision>
<id>777931378</id>
<parentid>752582011</parentid>
<timestamp>2017-04-30T04:28:05Z</timestamp>
<contributor>
<username>Matt Fitzpatrick</username>
<id>291848</id>
</contributor>
<minor/>
<comment>added equivalent alt text &quot;Warning&quot; to image</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="1473">{{Ombox
| type = style
| image = [[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]
| text =
'''This {{#switch:{{NAMESPACE}}|Module=Lua module|#default=template}} is used on [https://tools.wmflabs.org/templatecount/index.php?lang=en&amp;namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&amp;name={{urlencode:{{
#switch: {{SUBPAGENAME}}
| doc | sandbox = {{BASEPAGENAME}}
| #default = {{PAGENAME}}
}}}} {{High-use/num|1={{formatnum:{{#ifeq:{{str endswith|{{{1}}}|+}}|yes|{{str crop|{{{1}}}|1}}|{{{1}}}}}|R}}}} pages]''', so changes to it will be widely noticed. Please test any changes in the {{#switch:{{NAMESPACE}}|Module=module's|#default=template's}} [[{{#switch: {{SUBPAGENAME}}
| doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
| #default = {{SUBJECTPAGENAME}}
}}/sandbox|/sandbox]] or [[{{#switch: {{SUBPAGENAME}}
| doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}
| #default = {{SUBJECTPAGENAME}}
}}/testcases|/testcases]] subpages{{#switch:{{NAMESPACE}}|Module=.|#default=, or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].}} Please consider discussing changes {{#if:{{{2|}}}|at [[{{{2}}}]]|on the [[{{#switch: {{SUBPAGENAME}}
| doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}}
| #default = {{TALKPAGENAME}}
}}|talk page]]}} before implementing them.
}}&lt;noinclude&gt;
{{Documentation}}
&lt;!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! --&gt;
&lt;/noinclude&gt;</text>
<sha1>ggv9ira9l4ekmaa8ru4nhdrreym2q5h</sha1>
</revision>
</page>
<page>
<title>Template:High-use/num</title>
<ns>10</ns>
<id>52295942</id>
<revision>
<id>804536581</id>
<parentid>749847442</parentid>
<timestamp>2017-10-09T17:20:41Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:High-use/num]]&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="74">{{#iferror:{{#expr:0+{{{1}}}*1}}|many|approximately {{sigfig|{{{1}}}|2}}}}</text>
<sha1>4xf17czszr0cg49vcljmilmjdv8krz3</sha1>
</revision>
</page>
<page>
<title>Template:Included</title>
<ns>10</ns>
<id>3949894</id>
<revision>
<id>422988982</id>
<parentid>349076756</parentid>
<timestamp>2011-04-08T08:15:00Z</timestamp>
<contributor>
<username>MerlIwBot</username>
<id>14161758</id>
</contributor>
<minor/>
<comment>robot Removing: [[es:Plantilla:Incluido]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="288">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DDFBFF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;included table-included&quot;|{{{1|Included}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>320keqw0plxusilaewuywchiyngldxy</sha1>
</revision>
</page>
<page>
<title>Template:Incorrect</title>
<ns>10</ns>
<id>8569838</id>
<revision>
<id>550404107</id>
<parentid>494303782</parentid>
<timestamp>2013-04-15T02:02:45Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 5 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q10968967]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="272">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #F90; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;incorrect&quot;|{{{1|Incorrect}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>1dtocjms1sk850kgq52jufjfaq8p3fx</sha1>
</revision>
</page>
<page>
<title>Template:Longlisted</title>
<ns>10</ns>
<id>50222070</id>
<revision>
<id>715837930</id>
<timestamp>2016-04-18T08:57:53Z</timestamp>
<contributor>
<username>AnemoneProjectors</username>
<id>1597144</id>
</contributor>
<comment>[[WP:AES|←]]Created page with '&lt;noinclude&gt;{| class=&quot;wikitable&quot; |- |&lt;/noinclude&gt;style=&quot;background: #DDF; color: #2C2C2C; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; cl...'</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="274">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DDF; color: #2C2C2C; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no2&quot;|{{{1|Longlisted}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>t94vzdcfr6egn0pof7wih684b3byh4w</sha1>
</revision>
</page>
<page>
<title>Template:Lost</title>
<ns>10</ns>
<id>7170549</id>
<revision>
<id>615392470</id>
<parentid>414511871</parentid>
<timestamp>2014-07-03T06:19:16Z</timestamp>
<contributor>
<ip>65.94.171.126</ip>
</contributor>
<comment>[[WP:BOLD]] match usage of [[template:won]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="299">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#FA8072; color: {{{textcolor|black}}}; vertical-align: {{{valign|middle}}}; text-align: {{{halign|center}}}; {{{style|}}}&quot; class=&quot;table-no&quot; | {{{1|Lost}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>00nktlozdxhzk69i8jkdrlnnk00ws5a</sha1>
</revision>
</page>
<page>
<title>Template:Main other</title>
<ns>10</ns>
<id>17220251</id>
<revision>
<id>388689011</id>
<parentid>334818505</parentid>
<timestamp>2010-10-04T14:46:48Z</timestamp>
<contributor>
<username>WOSlinker</username>
<id>3138265</id>
</contributor>
<comment>remove {{pp-template}}</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="409">{{#switch:
&lt;!--If no or empty &quot;demospace&quot; parameter then detect namespace--&gt;
{{#if:{{{demospace|}}}
| {{lc: {{{demospace}}} }} &lt;!--Use lower case &quot;demospace&quot;--&gt;
| {{#ifeq:{{NAMESPACE}}|{{ns:0}}
| main
| other
}}
}}
| main = {{{1|}}}
| other
| #default = {{{2|}}}
}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1>
</revision>
</page>
<page>
<title>Template:Maybe</title>
<ns>10</ns>
<id>39467570</id>
<revision>
<id>821202511</id>
<parentid>595354673</parentid>
<timestamp>2018-01-19T00:31:23Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Maybe]]&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="274">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ffff90; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-maybe&quot;|{{{1|Maybe}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>apc8s7t3mfvr0070t3m75j22e7psxqv</sha1>
</revision>
</page>
<page>
<title>Template:MaybeCheck</title>
<ns>10</ns>
<id>40894160</id>
<revision>
<id>739603343</id>
<parentid>739602828</parentid>
<timestamp>2016-09-15T18:21:51Z</timestamp>
<contributor>
<ip>50.53.1.33</ip>
</contributor>
<comment>{{{color}}} and {{{rowspan}}}</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="397">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: {{{color|#FFB}}}; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot; {{#if:{{{rowspan|}}}|rowspan=&quot;{{{rowspan}}}&quot;}} |{{{text|[[File:yellow check.svg|13px|link={{{link|}}}|{{{1|Maybe}}}]]}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}&lt;/noinclude&gt;</text>
<sha1>3xitvgo7v7d238acalla91mjchhj6b1</sha1>
</revision>
</page>
<page>
<title>Template:N</title>
<ns>10</ns>
<id>1710479</id>
<redirect title="Template:Nay" />
<revision>
<id>802217541</id>
<parentid>488792168</parentid>
<timestamp>2017-09-24T19:11:35Z</timestamp>
<contributor>
<username>Massimocicc</username>
<id>13250591</id>
</contributor>
<minor/>
<comment>added rcat</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="55">#REDIRECT [[Template:Nay]]
{{R from template shortcut}}</text>
<sha1>jr81opitvcgyrlio82g3oiprsihrzca</sha1>
</revision>
</page>
<page>
<title>Template:N/a/doc</title>
<ns>10</ns>
<id>13941572</id>
<revision>
<id>746903116</id>
<parentid>692167984</parentid>
<timestamp>2016-10-30T07:37:50Z</timestamp>
<contributor>
<username>Numbermaniac</username>
<id>17157159</id>
</contributor>
<minor/>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="364">{{Documentation subpage}}
&lt;!-- Categories go where indicated at the bottom of this page, please; interwikis go to Wikidata (see also: [[Wikipedia:Wikidata]]) --&gt;
{{High-use| 15,800+}}
{{Table cell templates/doc}}
&lt;includeonly&gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||
&lt;!-- Categories go below this line, please; interwikis go to Wikidata, thank you! --&gt;
}}&lt;/includeonly&gt;</text>
<sha1>kmnkzij6ld8450j42taio0parifeaje</sha1>
</revision>
</page>
<page>
<title>Template:Na</title>
<ns>10</ns>
<id>34043929</id>
<revision>
<id>819689342</id>
<parentid>755386272</parentid>
<timestamp>2018-01-10T19:25:50Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Na]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space 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="415">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;data-sort-value=&quot;{{{sort|No}}}&quot; style=&quot;background: {{{color|#FFD2D2}}}; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no2&quot; {{#if:{{{rowspan|}}}|rowspan=&quot;{{{rowspan}}}&quot;}} | {{{text|[[File:Dark Red x.svg|13px|link={{{link|}}}|{{{1|No}}}]]}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}&lt;/noinclude&gt;</text>
<sha1>kydq4q3kwa02stgqxzehmpo81fh1umd</sha1>
</revision>
</page>
<page>
<title>Template:Nay</title>
<ns>10</ns>
<id>4894706</id>
<revision>
<id>810135930</id>
<parentid>713195618</parentid>
<timestamp>2017-11-13T15:06:49Z</timestamp>
<contributor>
<username>Fish and karate</username>
<id>224548</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Nay]]&quot;: [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="118">[[File:Red x.svg|13px|alt=Red X|link=]]&lt;span style=&quot;display: none;&quot;&gt;N&lt;/span&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>pv0kgw2wx2harjo87rxg5sjm9rs7iq2</sha1>
</revision>
</page>
<page>
<title>Template:Needs</title>
<ns>10</ns>
<id>18292810</id>
<revision>
<id>620129722</id>
<parentid>349075872</parentid>
<timestamp>2014-08-06T18:57:52Z</timestamp>
<contributor>
<username>FleetCommand</username>
<id>1069316</id>
</contributor>
<comment>Changing to a lighter color as its kins</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="304">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #F99; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;need table-needs&quot;|{{{1|Needs}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[es:Plantilla:Necesidades]]
&lt;/noinclude&gt;</text>
<sha1>liko5iigriezur8ihsychjkuiokk1qd</sha1>
</revision>
</page>
<page>
<title>Template:Nightly</title>
<ns>10</ns>
<id>25893761</id>
<revision>
<id>349075269</id>
<parentid>341687430</parentid>
<timestamp>2010-03-10T20:58:10Z</timestamp>
<contributor>
<username>Crissov</username>
<id>13025</id>
</contributor>
<minor/>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="305">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #fdd; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;nightly table-nightly&quot;|{{{1|[[Neutral build|Nightly build]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>7kszprm42lo37ap0dl135x94hl3hp6s</sha1>
</revision>
</page>
<page>
<title>Template:No</title>
<ns>10</ns>
<id>1818444</id>
<revision>
<id>691784809</id>
<parentid>690336509</parentid>
<timestamp>2015-11-22T04:07:39Z</timestamp>
<contributor>
<username>Codename Lisa</username>
<id>16847332</id>
</contributor>
<comment>Reverted [[WP:AGF|good faith]] edits by [[Special:Contributions/Ahecht|Ahecht]] ([[User talk:Ahecht|talk]]): We already have {{No2}} with this background.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="209">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#F99;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; class=&quot;table-no&quot;|{{{1|No}}}&lt;noinclude&gt;
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>9sy5yzld48zzicuuz6htc8iqyyy9es3</sha1>
</revision>
</page>
<page>
<title>Template:No2</title>
<ns>10</ns>
<id>5659034</id>
<revision>
<id>772147415</id>
<parentid>345040374</parentid>
<timestamp>2017-03-25T16:04:17Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:No2]]&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] (indefinite)...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="232">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ffdddd; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no2&quot; |{{{1|}}}&lt;noinclude&gt;
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>jjhp3x889jt9llk3hf1ra656wgzx29j</sha1>
</revision>
</page>
<page>
<title>Template:No result</title>
<ns>10</ns>
<id>17573683</id>
<revision>
<id>550418713</id>
<parentid>400220370</parentid>
<timestamp>2013-04-15T04:08:13Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 4 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q10992313]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="308">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DFDFFF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;noresult&quot;|{{{1|No result}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[es:Plantilla:Ningún resultado]]
&lt;/noinclude&gt;</text>
<sha1>e3b29ln3y0ois9m8lbqv4jhcmmcgawp</sha1>
</revision>
</page>
<page>
<title>Template:Nocontest</title>
<ns>10</ns>
<id>21524215</id>
<revision>
<id>819687865</id>
<parentid>496485920</parentid>
<timestamp>2018-01-10T19:22:02Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Nocontest]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (ind...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="193">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background-color: #c5d2ea; text-align:{{{align|center}}}&quot; |&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>2gh6ipt618flvxn8i8zmf77i8gysuwb</sha1>
</revision>
</page>
<page>
<title>Template:Nom</title>
<ns>10</ns>
<id>15351990</id>
<revision>
<id>677623416</id>
<parentid>578888597</parentid>
<timestamp>2015-08-24T13:50:32Z</timestamp>
<contributor>
<username>WJBscribe</username>
<id>2803535</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Nom: [[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="275">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FDD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;no table-no2&quot;|{{{1|Nominated}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>a7ppwmp1z0ocysf2mbfdhhqiv0zr7go</sha1>
</revision>
</page>
<page>
<title>Template:Non-album single</title>
<ns>10</ns>
<id>44383396</id>
<revision>
<id>821202931</id>
<parentid>813178321</parentid>
<timestamp>2018-01-19T00:31:55Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Non-album single]]&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="92">&lt;includeonly&gt;{{n/a|non-album single}}&lt;/includeonly&gt;
&lt;noinclude&gt;{{Documentation}}&lt;/noinclude&gt;</text>
<sha1>5sga149hcddgyw3au5jkw2orab98lw9</sha1>
</revision>
</page>
<page>
<title>Template:Nonfree</title>
<ns>10</ns>
<id>5858117</id>
<revision>
<id>821202938</id>
<parentid>566428007</parentid>
<timestamp>2018-01-19T00:31:55Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Nonfree]]&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="314">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #F9D; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;nonfree table-nonfree&quot;|{{{1|Non-free}}}&lt;noinclude&gt;
|}
{{confuse|Template:Non-free}}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>bceyrd7bqt7vi7gec5m0lmu9iypp33p</sha1>
</revision>
</page>
<page>
<title>Template:Nonpartisan</title>
<ns>10</ns>
<id>47534743</id>
<revision>
<id>739577741</id>
<parentid>676247590</parentid>
<timestamp>2016-09-15T14:49:40Z</timestamp>
<contributor>
<ip>50.53.1.33</ip>
</contributor>
<comment>default text;differentiate</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="308">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FFFFFF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Nonpartisan}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>39vuuyv8o236h0sqlodej0g1ensrqh2</sha1>
</revision>
</page>
<page>
<title>Template:Not yet</title>
<ns>10</ns>
<id>7019389</id>
<revision>
<id>739714696</id>
<parentid>482074561</parentid>
<timestamp>2016-09-16T14:01:56Z</timestamp>
<contributor>
<ip>80.221.159.67</ip>
</contributor>
<comment>Sync element styling with [[Template:Table cell templates/doc]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="233">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#ffd;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; | {{{1|Not Yet}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>ho2thbjxyyxm7jo7opts01bewbf5mt4</sha1>
</revision>
</page>
<page>
<title>Template:Nowrap</title>
<ns>10</ns>
<id>1627975</id>
<restrictions>edit=sysop:move=sysop</restrictions>
<revision>
<id>692794261</id>
<parentid>462345338</parentid>
<timestamp>2015-11-28T10:13:53Z</timestamp>
<contributor>
<username>Edokter</username>
<id>1624037</id>
</contributor>
<comment>Adapt comment; edits inside noinclude blocks should not affect job queue, but won't kill parser either way.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="145">&lt;span class=&quot;nowrap&quot;&gt;{{{1}}}&lt;/span&gt;&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc page; interwikis go to Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>avb5tcymgupik1ikutqclidkj9tnitx</sha1>
</revision>
</page>
<page>
<title>Template:Okay</title>
<ns>10</ns>
<id>26576018</id>
<revision>
<id>350643328</id>
<parentid>350193727</parentid>
<timestamp>2010-03-18T19:04:06Z</timestamp>
<contributor>
<username>Gyrobo</username>
<id>588529</id>
</contributor>
<comment>Capital letter.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="281">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #FFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;| {{{1|Neutral}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>nwqfatr5k4pv84ct4d4zfubuukcyj8w</sha1>
</revision>
</page>
<page>
<title>Template:Ombox</title>
<ns>10</ns>
<id>17522403</id>
<revision>
<id>577969039</id>
<parentid>463278061</parentid>
<timestamp>2013-10-20T12:45:08Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>switch to Lua version</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="146">{{#invoke:Message box|ombox}}&lt;noinclude&gt;
{{documentation}}
&lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&gt;
&lt;/noinclude&gt;</text>
<sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1>
</revision>
</page>
<page>
<title>Template:Operational</title>
<ns>10</ns>
<id>54339065</id>
<revision>
<id>786408870</id>
<timestamp>2017-06-19T08:40:57Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Add {{Operational}} for active spacecraft</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="281">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #aaccff; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-success&quot; | {{{1|Operational}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>gox70asf3sev7e3k83jvio753skewic</sha1>
</revision>
</page>
<page>
<title>Template:Optional</title>
<ns>10</ns>
<id>6029938</id>
<revision>
<id>821203088</id>
<parentid>595355634</parentid>
<timestamp>2018-01-19T00:32:09Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Optional]]&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="255">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ddffdd; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot;|{{{1|Optional}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>1dkkptn2jwnssn9zzn3iwa1266aoxgr</sha1>
</revision>
</page>
<page>
<title>Template:Order of magnitude</title>
<ns>10</ns>
<id>11656899</id>
<revision>
<id>772147393</id>
<parentid>522551188</parentid>
<timestamp>2017-03-25T16:04:16Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Order of magnitude]]&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...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="339">&lt;includeonly&gt;{{{{{|safesubst:}}}#ifexpr:{{{1|0}}}=0
|{{{{{|safesubst:}}}#ifexpr:abs{{{1|0}}}1=1
|0
|{{{{{|safesubst:}}}#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}
}}
|{{#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}&gt;1E100 or abs{{{1|0}}}&lt;1E-100)-14))}}
}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>o26s8fkrxrfa62h1s4cyrdxr33uqy8l</sha1>
</revision>
</page>
<page>
<title>Template:Partial</title>
<ns>10</ns>
<id>2499676</id>
<revision>
<id>819682637</id>
<parentid>793726504</parentid>
<timestamp>2018-01-10T18:59:35Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Partial]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indef...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="254">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#FFB;vertical-align:middle;text-align:{{{align|center}}}; {{{style|}}}&quot; class=&quot;table-partial&quot;|{{{1|Partial}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>k0tc2n8ju0l8aekqawi6oy1tc6jyh0z</sha1>
</revision>
</page>
<page>
<title>Template:Partial failure</title>
<ns>10</ns>
<id>50681222</id>
<revision>
<id>722939836</id>
<parentid>722939365</parentid>
<timestamp>2016-05-31T01:24:14Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Use existing table-partial class</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="283">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: wheat; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-partial&quot; | {{{1|Partial failure}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>4qu4k3wiofz9viga0fipa03f3wqltea</sha1>
</revision>
</page>
<page>
<title>Template:Partial success</title>
<ns>10</ns>
<id>52252516</id>
<revision>
<id>788398705</id>
<parentid>749023860</parentid>
<timestamp>2017-07-01T05:05:34Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Distinguish colors for partial success and partial failure</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="282">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #FFB; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-partial&quot; | {{{1|Partial success}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>j9bzbndzcte9k69kaqa9vfjpcwrensu</sha1>
</revision>
</page>
<page>
<title>Template:Pending</title>
<ns>10</ns>
<id>23537874</id>
<revision>
<id>545666227</id>
<parentid>462763411</parentid>
<timestamp>2013-03-20T12:05:03Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 2 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q6247483]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="314">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Pending}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>gausp9hdzytetnnocepdvkcil5aw5zs</sha1>
</revision>
</page>
<page>
<title>Template:Perhaps</title>
<ns>10</ns>
<id>2806870</id>
<revision>
<id>595355320</id>
<parentid>482073645</parentid>
<timestamp>2014-02-13T21:12:18Z</timestamp>
<contributor>
<username>Crissov</username>
<id>13025</id>
</contributor>
<comment>use unified code</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="289">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ffffdd; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;automatic table-automatic&quot;| {{{1|Perhaps}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>1d4cyn17nhttt7zemwp1m0ux22de2c4</sha1>
</revision>
</page>
<page>
<title>Template:Planned</title>
<ns>10</ns>
<id>50681350</id>
<revision>
<id>722942074</id>
<timestamp>2016-05-31T01:42:03Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Create templates for launch outcome</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="277">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #dfdfff; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-planned&quot; | {{{1|Planned}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>8cfls4d2les76kmzhwfv4jvei8wswfk</sha1>
</revision>
</page>
<page>
<title>Template:Proprietary</title>
<ns>10</ns>
<id>15126103</id>
<revision>
<id>821203494</id>
<parentid>628242215</parentid>
<timestamp>2018-01-19T00:32:42Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Proprietary]]&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="348">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ddf; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-proprietary&quot;|{{{1|[[Proprietary software|Proprietary]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[Category:Software table cell templates|Proprietary]]
&lt;/noinclude&gt;</text>
<sha1>cvxcm7uux4xl9avnw934xgh9r8xrw95</sha1>
</revision>
</page>
<page>
<title>Template:Rarely</title>
<ns>10</ns>
<id>31678206</id>
<revision>
<id>617957524</id>
<parentid>427469891</parentid>
<timestamp>2014-07-22T08:11:01Z</timestamp>
<contributor>
<username>Telpardec</username>
<id>13990502</id>
</contributor>
<comment>background a bit too dark - making a little lighter</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="314">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FC8; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Rarely}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>enwka5vt5gj6621vwoozb8tgwuvcqvr</sha1>
</revision>
</page>
<page>
<title>Template:Reflist</title>
<ns>10</ns>
<id>7585648</id>
<revision>
<id>794499661</id>
<parentid>794499298</parentid>
<timestamp>2017-08-08T12:05:27Z</timestamp>
<contributor>
<username>Anomie</username>
<id>301903</id>
</contributor>
<comment>Please stop, you apparently don't know what you're doing here and shouldn't fool around with heavily-used live templates. I'll post an explanation to the talk page momentarily.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="1008">&lt;div class=&quot;reflist &lt;!--
--&gt;{{#if: {{{1|}}} {{{colwidth|}}}
| columns references-column-width
}}&quot; style=&quot;&lt;!--
--&gt;{{#if: {{{1|}}}
| {{#iferror: {{#ifexpr: {{{1|1}}} &gt; 1 }}
| {{column-width|1={{{1}}}}}
| {{#switch:{{{1|}}}|1=|2={{column-width|1=30em}}|#default={{column-width|1=25em}}}} }}
| {{#if: {{{colwidth|}}}
| {{column-width|1={{{colwidth}}}}} }} }} list-style-type: &lt;!--
--&gt;{{{liststyle|{{#switch: {{{group|}}}
| upper-alpha
| upper-roman
| lower-alpha
| lower-greek
| lower-roman = {{{group}}}
| #default = decimal}}}}};&quot;&gt;
{{#tag:references|{{{refs|}}}|group={{{group|}}}|responsive={{#if:{{{1|}}}{{{colwidth|}}}|0|1}}}}&lt;/div&gt;{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using reflist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Reflist]] with unknown parameter &quot;_VALUE_&quot;|ignoreblank=y| 1 | colwidth | group | liststyle | refs }}&lt;noinclude&gt;
{{Documentation}}
&lt;/noinclude&gt;</text>
<sha1>2k096ppl7lxbcjqmfluu9x2sc91rmzl</sha1>
</revision>
</page>
<page>
<title>Template:Regional</title>
<ns>10</ns>
<id>54743863</id>
<revision>
<id>793726525</id>
<timestamp>2017-08-03T15:20:33Z</timestamp>
<contributor>
<username>Yejianfei</username>
<id>17164918</id>
</contributor>
<comment>[[WP:AES|←]]Created page with '&lt;noinclude&gt;{| class=&quot;wikitable&quot; |- |&lt;/noinclude&gt;style=&quot;background:#FFB;vertical-align:middle;text-align:{{{align|center}}}; {{{style|}}}&quot; class=&quot;table-partial&quot;|{...'</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="255">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#FFB;vertical-align:middle;text-align:{{{align|center}}}; {{{style|}}}&quot; class=&quot;table-partial&quot;|{{{1|Regional}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>2tcvxdd9hj7p8v0q9o1m4laootskqbk</sha1>
</revision>
</page>
<page>
<title>Template:Release-candidate</title>
<ns>10</ns>
<id>27685337</id>
<revision>
<id>371131647</id>
<parentid>367527307</parentid>
<timestamp>2010-07-01T02:38:08Z</timestamp>
<contributor>
<username>Gyrobo</username>
<id>588529</id>
</contributor>
<minor/>
<comment>Link fix.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="343">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #BFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-release-candidate&quot;|{{{1|[[Software release life cycle#Release candidate|Release candidate]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>lvqtcgp19zgoxq85rdowamt8pag67gg</sha1>
</revision>
</page>
<page>
<title>Template:Rh</title>
<ns>10</ns>
<id>2734578</id>
<revision>
<id>633760712</id>
<parentid>345040538</parentid>
<timestamp>2014-11-14T03:31:52Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Rh: [[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="238">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ececec; color: black; font-weight: bold; vertical-align: middle; text-align: {{{align|left}}}; {{{style|}}}&quot; class=&quot;table-rh&quot;&lt;noinclude&gt;
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>mve7sywn6k9a1gku1b6mknzfx9ohtmh</sha1>
</revision>
</page>
<page>
<title>Template:Rh2</title>
<ns>10</ns>
<id>20642750</id>
<revision>
<id>494970653</id>
<parentid>471805817</parentid>
<timestamp>2012-05-29T16:02:10Z</timestamp>
<contributor>
<ip>50.53.15.51</ip>
</contributor>
<comment>iw</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="271">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: {{Rh2/bgcolor}}; color: black; vertical-align: middle; text-align: {{{align|left}}}; font-weight: bolder; {{{style|}}}&quot; class=&quot;rh heading table-rh&quot;&lt;noinclude&gt;| Row Header
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>rsilmixg2rslearsq4doi96ve2h9jt8</sha1>
</revision>
</page>
<page>
<title>Template:Rh2/bgcolor</title>
<ns>10</ns>
<id>34405258</id>
<revision>
<id>471805820</id>
<parentid>471805760</parentid>
<timestamp>2012-01-17T03:59:39Z</timestamp>
<contributor>
<username>Tomchen1989</username>
<id>11110763</id>
</contributor>
<comment>[[Template_talk:Table_cell_templates#Background color for {{Rh2}}]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="21">&lt;nowiki&gt;#edf&lt;/nowiki&gt;</text>
<sha1>ryhrtp7orri5g8yezb22zknu80e8y65</sha1>
</revision>
</page>
<page>
<title>Template:Rnd</title>
<ns>10</ns>
<id>13373859</id>
<revision>
<id>772120890</id>
<parentid>539949680</parentid>
<timestamp>2017-03-25T12:38:46Z</timestamp>
<contributor>
<username>Jo-Jo Eumerus</username>
<id>17449355</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Rnd]]&quot;: Allowing template editors on some templates with full protection dating back to pre-[[WP:TPROT|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="323">&lt;includeonly&gt;{{#iferror:{{#expr:{{{2|0}}}}} |
[[Category:Pages with bad rounding precision]]{{hid|Bad rounding here}}&lt;!--
--&gt;{{#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|
{{#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>rx1gvq4bh1iryz29g6tt9b2a4ng2k7z</sha1>
</revision>
</page>
<page>
<title>Template:Safe</title>
<ns>10</ns>
<id>38443531</id>
<revision>
<id>536920418</id>
<timestamp>2013-02-06T18:55:47Z</timestamp>
<contributor>
<username>FrancDeBx</username>
<id>18370505</id>
</contributor>
<comment>[[WP:AES|←]]Created page with '&lt;noinclude&gt;{| class=&quot;wikitable&quot; |- |&lt;/noinclude&gt;style=&quot;background:#ffffff; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; cla...'</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="268">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#ffffff; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no&quot; | {{{1|Safe}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>5ywosaakvft53svwoo88a3wsr3i0nzl</sha1>
</revision>
</page>
<page>
<title>Template:Scheduled</title>
<ns>10</ns>
<id>50765157</id>
<revision>
<id>724460781</id>
<timestamp>2016-06-09T11:41:07Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Created template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="279">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #dfdfff; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-planned&quot; | {{{1|Scheduled}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>7yxc8idw2i7tb4ety3k2p4cuq9ywdkd</sha1>
</revision>
</page>
<page>
<title>Template:Sdash</title>
<ns>10</ns>
<id>28472460</id>
<revision>
<id>744093489</id>
<parentid>744091787</parentid>
<timestamp>2016-10-13T02:28:52Z</timestamp>
<contributor>
<ip>50.53.1.33</ip>
</contributor>
<comment>unneeded div</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="253">{| class=&quot;wikitable sortable&quot;
|-
| &lt;onlyinclude&gt;data-sort-value=&quot;{{{sort|}}}&quot; style=&quot;{{{style|vertical-align:middle; text-align:center}}}&quot; class=&quot;{{{class|table-na}}}&quot; | {{{1|—}}}&lt;/onlyinclude&gt;
|}
{{documentation|content={{Table cell templates/doc}}}}</text>
<sha1>m7zd32cnoeb8ggg8nvln2jh283xqmqz</sha1>
</revision>
</page>
<page>
<title>Template:Sho</title>
<ns>10</ns>
<id>21978134</id>
<revision>
<id>821204141</id>
<parentid>349078192</parentid>
<timestamp>2018-01-19T00:33:26Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Sho]]&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="276">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #f0e68c; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-no2&quot;|{{{1|Shortlisted}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>s9hrhg6nas7yunvf2j4bi43qf0jttk1</sha1>
</revision>
</page>
<page>
<title>Template:Sigfig</title>
<ns>10</ns>
<id>37772150</id>
<redirect title="Template:Significant figures" />
<revision>
<id>769931066</id>
<parentid>686429031</parentid>
<timestamp>2017-03-12T12:58:35Z</timestamp>
<contributor>
<username>Christian75</username>
<id>1306352</id>
</contributor>
<comment>{{redr}} is deprecated - converting to {{Redirect category shell}} using [[Project:AWB|AWB]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="118">#REDIRECT [[Template:Significant figures]]
{{Redirect category shell|
{{R from move}}
{{R from template shortcut}}
}}</text>
<sha1>6liq0tocaomv3w5pnzdg0n7d2hqs805</sha1>
</revision>
</page>
<page>
<title>Template:Significant figures</title>
<ns>10</ns>
<id>13120760</id>
<revision>
<id>638406869</id>
<parentid>594681521</parentid>
<timestamp>2014-12-16T21:22:35Z</timestamp>
<contributor>
<username>Jackmcbarn</username>
<id>19285809</id>
</contributor>
<minor/>
<comment>use the right doc template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="249">{{#ifeq:{{{1&lt;noinclude&gt;|0&lt;/noinclude&gt;}}}|0
|0
|{{significant figures/{{#if:{{{2|}}}
|rnd
|sum
}}
|1={{formatnum:{{{1}}}|R}}
|2={{{2}}}
|3={{Order of magnitude|{{formatnum:{{{1}}}|R}}}}
}}
}}&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>0w70ettzuwz10gi8sb1030t0ch78d2b</sha1>
</revision>
</page>
<page>
<title>Template:Significant figures/rnd</title>
<ns>10</ns>
<id>13248669</id>
<revision>
<id>804533777</id>
<parentid>617347527</parentid>
<timestamp>2017-10-09T17:05:03Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Significant figures/rnd]]&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="632">&lt;includeonly&gt;{{rnd|{{{1}}}|{{{2}}}-{{{3}}}-1}}&lt;/includeonly&gt;&lt;noinclude&gt;
{{doc|content=
A rounding subtemplate, it calls {{tl|rnd}}.
Examples:
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||7|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||6|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||5|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||4|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||3|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||2|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||1|||2}}
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||0|||2}}
[[Category:Subtemplates of template sigfig|rnd]]
}}
&lt;/noinclude&gt;</text>
<sha1>kzghuljvaaip7zd0yfn5yjvsyvsym83</sha1>
</revision>
</page>
<page>
<title>Template:Site active</title>
<ns>10</ns>
<id>23023301</id>
<revision>
<id>384304969</id>
<parentid>349079070</parentid>
<timestamp>2010-09-12T01:33:36Z</timestamp>
<contributor>
<username>Rich Farmbrough</username>
<id>82835</id>
</contributor>
<minor/>
<comment>moved [[Template:Siteactive]] to [[Template:Site active]]: Separate words</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="285">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #90FF90; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;active table-siteactive&quot;|{{{1|Active}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>om01olkcv6x2l9fmkxbfaar4ouf50ij</sha1>
</revision>
</page>
<page>
<title>Template:Site inactive</title>
<ns>10</ns>
<id>23023276</id>
<revision>
<id>384305072</id>
<parentid>349078960</parentid>
<timestamp>2010-09-12T01:34:21Z</timestamp>
<contributor>
<username>Rich Farmbrough</username>
<id>82835</id>
</contributor>
<minor/>
<comment>moved [[Template:Siteinactive]] to [[Template:Site inactive]]: Separate words</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="291">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FF9090; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;inactive table-siteinactive&quot;|{{{1|Inactive}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>tu0a2zsto2p7x29mvctbyeq27arc7u2</sha1>
</revision>
</page>
<page>
<title>Template:Some</title>
<ns>10</ns>
<id>5916261</id>
<revision>
<id>349077558</id>
<parentid>341483061</parentid>
<timestamp>2010-03-10T21:08:35Z</timestamp>
<contributor>
<username>Crissov</username>
<id>13025</id>
</contributor>
<minor/>
<comment>/doc</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="278">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Some}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>p9106p3u0jq1ynld7259ck5391bof45</sha1>
</revision>
</page>
<page>
<title>Template:Sometimes</title>
<ns>10</ns>
<id>36104869</id>
<revision>
<id>641377356</id>
<parentid>497027014</parentid>
<timestamp>2015-01-07T08:46:24Z</timestamp>
<contributor>
<username>Musashiaharon</username>
<id>826010</id>
</contributor>
<comment>displays preview now</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="296">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #b0c4de; color: black; vertical-align: middle; text-align: center; &quot; class=&quot;partial table-partial&quot;|{{{1|Sometimes}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>ox9im9z8q3qxedhmt0t2ldgzr3e3w90</sha1>
</revision>
</page>
<page>
<title>Template:Str crop</title>
<ns>10</ns>
<id>22792911</id>
<revision>
<id>656761583</id>
<parentid>638395630</parentid>
<timestamp>2015-04-16T14:37:18Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<comment>add safesubst:</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="179">&lt;includeonly&gt;{{safesubst:#invoke:String | sub | s={{{1|}}} | 1 | {{safesubst:#expr: -{{{2|1}}} - 1}} | ignore_errors=true }}&lt;/includeonly&gt;&lt;noinclude&gt;
{{documentation}}&lt;/noinclude&gt;</text>
<sha1>n0lrovj1bv85hf3j8hj0ny8majdzr3h</sha1>
</revision>
</page>
<page>
<title>Template:Str endswith</title>
<ns>10</ns>
<id>22860091</id>
<revision>
<id>752100802</id>
<parentid>748257234</parentid>
<timestamp>2016-11-29T14:22:27Z</timestamp>
<contributor>
<username>BU Rob13</username>
<id>25420061</id>
</contributor>
<minor/>
<comment>Changed protection level for &quot;[[Template:Str endswith]]&quot;: [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="71">{{#invoke:Str endswith|main}}&lt;noinclude&gt;
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>gkfardrqegdkd78zd99vm0nrkhvl505</sha1>
</revision>
</page>
<page>
<title>Template:Success</title>
<ns>10</ns>
<id>50681166</id>
<revision>
<id>722938970</id>
<parentid>722938147</parentid>
<timestamp>2016-05-31T01:17:02Z</timestamp>
<contributor>
<username>JFG</username>
<id>168812</id>
</contributor>
<comment>Fixed nowiki from subst</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="277">&lt;noinclude&gt;
{| class=&quot;wikitable&quot;
|&lt;/noinclude&gt;style=&quot;background: #bbffbb; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-success&quot; | {{{1|Success}}}&lt;noinclude&gt;
|}
{{documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>bljpz5hbrg1n6t1m4025ypmo183sif9</sha1>
</revision>
</page>
<page>
<title>Template:TBA</title>
<ns>10</ns>
<id>9677422</id>
<revision>
<id>804536871</id>
<parentid>721300818</parentid>
<timestamp>2017-10-09T17:20:54Z</timestamp>
<contributor>
<username>MusikAnimal</username>
<id>14882394</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:TBA]]&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="270">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DDF; color: #2C2C2C; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;no table-no2&quot;|{{{1|TBA}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>9d5b30prhmcuw2cindmhnr0il1k8mca</sha1>
</revision>
</page>
<page>
<title>Template:Table-experimental</title>
<ns>10</ns>
<id>16193258</id>
<revision>
<id>550388570</id>
<parentid>407247096</parentid>
<timestamp>2013-04-14T23:54:50Z</timestamp>
<contributor>
<username>Addbot</username>
<id>6569922</id>
</contributor>
<minor/>
<comment>[[User:Addbot|Bot:]] Migrating 4 interwiki links, now provided by [[Wikipedia:Wikidata|Wikidata]] on [[d:q10957496]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="336">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #DFDFFF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;experimental table-experimental&quot;|{{{1|Experimental}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[es:Plantilla:Tabla-experimental]]
&lt;/noinclude&gt;</text>
<sha1>0gbgrfuiiywm036ys2f5x7spdsmm091</sha1>
</revision>
</page>
<page>
<title>Template:Table cell templates</title>
<ns>10</ns>
<id>8584675</id>
<revision>
<id>737695775</id>
<parentid>542178014</parentid>
<timestamp>2016-09-04T13:36:51Z</timestamp>
<contributor>
<ip>50.53.1.33</ip>
</contributor>
<comment>sort</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="573">&lt;noinclude&gt;
{|
|&lt;/noinclude&gt;{{#if:{{{sort|}}}|data-sort-value=&quot;&lt;nowiki&gt;{{{sort|&lt;/nowiki&gt;{{{sort}}}&lt;nowiki&gt;}}}&lt;/nowiki&gt;&quot;}} style=&quot;background: {{{bg|white}}}; color: {{{color|black}}}; vertical-align: {{{valign|middle}}}; text-align: &lt;nowiki&gt;{{{align|&lt;/nowiki&gt;{{{align|center}}}&lt;nowiki&gt;}}}&lt;/nowiki&gt;; &lt;nowiki&gt;{{{style|}}}&lt;/nowiki&gt;&quot; class=&quot;{{{class|{{BASEPAGENAME}}}}} table-{{{class|{{BASEPAGENAME}}}}}&quot;| &lt;nowiki&gt;{{{1|&lt;/nowiki&gt;{{{text}}}&lt;nowiki&gt;}}}&lt;/nowiki&gt;&lt;noinclude&gt;
|}
{{Documentation}}
&lt;!-- ADD CATEGORIES BELOW THIS LINE --&gt;
[[Category:Table cell templates]]
&lt;/noinclude&gt;</text>
<sha1>fyfp8k8tm2vy4lpf81sz4hgn1nfj8iy</sha1>
</revision>
</page>
<page>
<title>Template:Table cell templates/doc</title>
<ns>10</ns>
<id>25941487</id>
<revision>
<id>821472842</id>
<parentid>793729887</parentid>
<timestamp>2018-01-20T18:10:53Z</timestamp>
<contributor>
<username>TheDoctorWho</username>
<id>31555064</id>
</contributor>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="15244">&lt;noinclude&gt;{{Documentation subpage}}&lt;/noinclude&gt;
{{#ifeq:{{FULLPAGENAME}}|Template:BLACK|{{For|the text color template|Template:Black}}}}
The templates in this series are designed to be used in a [[Help:Table|table]] to make a cell with text in that cell, with an appropriately colored background. They are commonly used in [[:Category:Comparisons|comparison tables]].
For example, {{Tlc|yes}} makes a cell with a green background. The text in the cell is taken from the [[Help:Template#Parameters|first parameter]]; &lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;yes|Sure}}&lt;/code&gt; would output &quot;Sure&quot; otherwise it defaults to &quot;Yes&quot;. Most templates allow authors to override the default text in this way, some require text put after the template call and some also need a vertical bar in between: &lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;''table cell template''}} ''text''&lt;/code&gt; or &lt;code&gt;&lt;nowiki&gt;{{&lt;/nowiki&gt;''table cell template''}} | ''text''&lt;/code&gt;. This information, the colors and default texts are found in the table below.
If you want to use other attributes for the table cells, ''e.g.'' &lt;code&gt;colspan&lt;/code&gt; or &lt;code&gt;rowspan&lt;/code&gt;, they need to be put before the template call and there must be no vertical bar &lt;code&gt;|&lt;/code&gt; in between them:
{| class=wikitable align=right
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
|}
&lt;pre&gt;...
!{{Yes}} ||{{No}} ||rowspan=2 {{n/a}}
|-
|colspan=2 {{Yes-No}}
...
&lt;/pre&gt;
== Templates ==
&lt;div style=&quot;overflow:auto;&quot;&gt;
{| class=&quot;wikitable&quot; style=&quot;text-align: left; width: auto;&quot;
|+ Table cell templates
! Class&lt;ref name=&quot;table-cell-templates-table-css&quot;&gt;The HTML class of table cell templates may be referenced in a [[m:help:User style|user stylesheet]] to change appearance.&lt;/ref&gt; !! Default syntax !! Preview (default) !! Customized syntax !! Preview (customized)
|-
|rowspan=2| &lt;code&gt;table-rh&lt;/code&gt; || {{tl|rh}} {{!}} Row header&lt;ref name=&quot;table-cell-templates-table-after+pipe&quot; /&gt; || {{rh}} | Row header || {{tlp|rh|2=align=right}} {{!}} Row header || {{rh|align=right}} | Row header
|-
| {{tl|rh2}} {{!}} Row header&lt;ref name=&quot;table-cell-templates-table-after+pipe&quot;&gt;Does not take a parameter; the content should be placed after the template call, separated by a pipe (|) character.&lt;/ref&gt; || {{rh2}} {{!}} Row header || {{tlp|rh2|2=align=right}} | Row header || {{rh2|align=right}} | Row header
|-
|rowspan=3| &lt;code&gt;table-yes&lt;/code&gt; || {{tl|yes}} || {{yes}} || {{tlp|yes|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} ||{{yes|Customized [[Plain text|text]]}}
|-
| {{tlp|available}} || {{available}} || {{tlp|available|Unused}} || {{available|Unused}}
|-
| {{tlp|contained}} || {{contained}} || ||
|-
| &lt;code&gt;table-maybe&lt;/code&gt; || {{tl|maybe}} || {{maybe}} || {{tlp|maybe|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} ||{{maybe|Customized [[Plain text|text]]}}
|-
|rowspan=6| &lt;code&gt;table-no&lt;/code&gt; || {{tl|no}} || {{no}} || {{tlp|no|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{no|Customized [[Plain text|text]]}}
|-
| {{tl|bad}} || {{bad}} || {{tlp|bad|F}} || {{bad|F}}
|-
| {{tl|eliminated}} || {{eliminated}} || {{tlp|eliminated|Dropped out}} || {{eliminated|Dropped out}}
|-
| {{tlp|active fire|12%}} || {{active fire|12%}} || ||
|-
| {{tl|lost}} || {{lost}} || {{tlp|lost|Missing}} || {{lost|Missing}}
|-
| {{tl|safe}} || {{safe}} || {{tlp|safe|Protected}} || {{safe|Protected}}
|-
| &lt;code&gt;table-active&lt;/code&gt; || {{tl|active}} || {{active}} || {{tlp|active|Lively}} || {{active|Lively}}
|-
|rowspan=2| &lt;code&gt;table-siteactive&lt;/code&gt; || {{tl|site active}} || {{site active}} || {{tlp|site active|Up}} || {{site active|Up}}
|-
| {{tl|coming soon}} || {{coming soon}} || {{tlp|coming soon|Second half of the year}} || {{coming soon|Second half of the year}}
|-
| &lt;code&gt;table-siteinactive&lt;/code&gt; || {{tl|site inactive}} || {{site inactive}} || {{tlp|site inactive|Down}} || {{site inactive|Down}}
|-
|rowspan=8| &lt;code&gt;table-yes2&lt;/code&gt; || {{tl|good}} || {{good}} || {{tlp|good|A}} || {{good|A}}
|-
| {{tl|yes2}} || {{yes2}} || {{tlp|yes2|Text}} || {{yes2|Text}}
|-
| {{tl|ya}} || {{ya}} || {{tlp|ya|text{{=}}Ya}} || {{ya|text=Ya}}
|-
| {{tlp|ya|Ya}} || {{ya|Ya}} || {{tlp|ya|text|link{{=}}WP:ALT}} || {{ya|text|link=WP:ALT}}
|-
| {{tl|won}} || {{won}} || {{tlp|won|text{{=}}white|color{{=}}darkblue}} || {{won|text=white|color=darkblue}}
|-
| {{tlp|won|place{{=}}1}} || {{won|place=1}} || {{tlp|won|place{{=}}Gold}} || {{won|place=Gold}}
|-
| {{tlp|won|place{{=}}2}} || {{won|place=2}} || {{tlp|won|place{{=}}Silver}} || {{won|place=Silver}}
|-
| {{tlp|won|place{{=}}3}} || {{won|place=3}} || {{tlp|won|place{{=}}Bronze}} || {{won|place=Bronze}}
|-
|rowspan=7| &lt;code&gt;table-no2&lt;/code&gt; || {{tl|no2}} || {{no2}} || {{tlp|no2|Text}} || {{no2|Text}}
|-
| {{tl|na}} || {{na}} || {{tlp|na|text{{=}}Na}} || {{na|text=Na}}
|-
| {{tlp|na|Na}} || {{na|Na}} || {{tlp|na|text|link{{=}}WP:ALT}} || {{na|text|link=WP:ALT}}
|-
| {{tl|nom}} || {{nom}} || {{tlp|nom|5}} || {{nom|5}}
|-
| {{tl|sho}} || {{sho}} || {{tlp|sho|Proposed}} || {{sho|Proposed}}
|-
| {{tl|longlisted}} || {{longlisted}} || {{tlp|longlisted|Rejected}} || {{longlisted|Rejected}}
|-
| {{tl|TBA}} || {{TBA}} || {{tlp|TBA|To be announced}} || {{TBA|To be announced}}
|-
| rowspan=2 |&lt;code&gt;table-success&lt;/code&gt; || {{tl|success}} || {{success}} || {{tlp|success|Mission complete}} || {{success|Mission complete}}
|-
| {{tl|operational}} || {{operational}} || {{tlp|operational|Returning data}} || {{operational|Returning data}}
|-
| &lt;code&gt;table-failure&lt;/code&gt; || {{tl|failure}} || {{failure}} || {{tlp|failure|Wrong orbit}} || {{failure|Wrong orbit}}
|-
| rowspan=16| &lt;code&gt;table-partial&lt;/code&gt; || {{tl|partial}} || {{partial}} || {{tlp|partial|Almost done}} ||{{partial|Almost done}}
|-
| {{tl|Regional}} || {{Regional}} || {{tlp|Regional|Uyghur}} || {{Regional|Uyghur}}
|-
| {{tl|MaybeCheck}} || {{MaybeCheck}} || {{tlp|MaybeCheck|text{{=}}Possibly}} || {{MaybeCheck|text=Possibly}}
|-
| {{tlp|MaybeCheck|Possibly}} || {{MaybeCheck|Possibly}} || {{tlp|MaybeCheck|text|link{{=}}WP:ALT}} || {{MaybeCheck|text|link=WP:ALT}}
|-
| {{tl|partial success}} || {{partial success}} || {{tlp|partial success|&lt;nowiki&gt;Reached orbit and returned pictures&lt;/nowiki&gt;}} || {{partial success|Reached orbit and returned pictures}}
|-
| {{tl|partial failure}} || {{partial failure}} || {{tlp|partial failure|&lt;nowiki&gt;[[Cubesat]] not deployed&lt;/nowiki&gt;}} || {{partial failure|[[Cubesat]] not deployed}}
|-
| {{tl|okay}} || {{okay}} || {{tlp|okay|C}} || {{okay|C}}
|-
| {{tl|Yes-No}} || {{Yes-No}} || {{tlp|Yes-No|Yes with an if; no with a but}} || {{Yes-No|Yes with an if; no with a but}}
|-
| {{tl|some}} || {{some}} || {{tlp|some|Many}} || {{some|Many}}
|-
| {{tl|nonpartisan}} || {{nonpartisan}} || {{tlp|nonpartisan|Impartial}} || {{nonpartisan|Impartial}}
|-
| {{tl|pending}} || {{pending}} || {{tlp|pending|Awaiting}} || {{pending|Awaiting}}
|-
| {{tl|unofficial}} || {{unofficial}} || {{tlp|unofficial|&lt;nowiki&gt;''De facto''&lt;/nowiki&gt;}} || {{unofficial|''De facto''}}
|-
| {{tl|unofficial2}} || {{unofficial2}} || {{tlp|unofficial2|&lt;nowiki&gt;''De facto''&lt;/nowiki&gt;}} || {{unofficial2|''De facto''}}
|-
| {{tl|usually}} || {{usually}} || {{tlp|usually|Commonly}} || {{usually|Commonly}}
|-
| {{tl|rarely}} || {{rarely}} || {{tlp|rarely|Seldom}}|| {{rarely|Seldom}}
|-
| {{tl|sometimes}} || {{sometimes}} || {{tlp|sometimes|Occasionally}} || {{sometimes|Occasionally}}
|-
| &lt;code&gt;table-any&lt;/code&gt; || {{tl|any}} || {{any}} || {{tlp|any|Anyone}}|| {{any|Anyone}}
|-
|rowspan=6| &lt;code&gt;table-na&lt;/code&gt; || {{tl|n/a}} || {{n/a}} || {{tlp|n/a|Unavailable}}|| {{n/a|Unavailable}}
|-
| {{tl|varies}} || {{varies}} || {{tlp|varies|Differs}}|| {{varies|Differs}}
|-
| {{tl|sdash}} || {{sdash}} || {{tlp|sdash|&lt;nowiki&gt;[[File:Dash.svg|13px|link=|dash icon]]&lt;/nowiki&gt;}}|| {{sdash|[[File:Dash.svg|13px|link=|dash]]}}
|-
| {{tl|BLACK}} || {{BLACK}} || {{tlp|BLACK|Banned}} || {{BLACK|Banned}}
|-
| {{tl|non-album single}} || {{non-album single}} || {{tlp|non-album single|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{non-album single|Customized [[Plain text|text]]}}
|-
| {{tl|unreleased}} || {{unreleased}} || {{tlp|unreleased|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{unreleased|Customized [[Plain text|text]]}}
|-
|rowspan=2| &lt;code&gt;table-unknown&lt;/code&gt; || {{tl|unknown}} || {{Unknown}} || {{tlp|unknown|?}} || {{unknown|?}}
|-
| {{tl|dunno}} || {{Dunno}} || {{tlp|dunno|Not sure}} || {{dunno|Not sure}}
|-
| &lt;code&gt;table-automatic&lt;/code&gt; || {{tl|perhaps}} || {{perhaps}} || {{tlp|perhaps|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{perhaps|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-depends&lt;/code&gt; || {{tl|depends}} || {{depends}} || {{tlp|depends|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{depends|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-included&lt;/code&gt; || {{tl|included}} || {{included}} || {{tlp|included|Incorporated}} || {{included|Incorporated}}
|-
|rowspan=2| &lt;code&gt;table-dropped&lt;/code&gt; || {{tl|dropped}} || {{dropped}} || {{tlp|dropped|Discontinued}} || {{dropped|Discontinued}}
|-
| {{tl|terminated}} || {{terminated}} || {{tlp|terminated|Fired}} || {{terminated|Fired}}
|-
| &lt;code&gt;table-beta&lt;/code&gt; || {{tl|beta}} || {{beta}} || {{tlp|beta|Preview}} || {{beta|Preview}}
|-
| &lt;code&gt;table-experimental&lt;/code&gt; || {{tl|table-experimental}} || {{table-experimental}} || {{tlp|table-experimental|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{table-experimental|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-free&lt;/code&gt; || {{tl|free}} || {{free}} || {{tlp|free|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{free|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-proprietary&lt;/code&gt; || {{tl|proprietary}} || {{proprietary}} || {{tlp|proprietary|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{proprietary|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-nonfree&lt;/code&gt; || {{tl|nonfree}} || {{nonfree}} || {{tlp|nonfree|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{nonfree|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-needs&lt;/code&gt; || {{tl|needs}} || {{needs}} || {{tlp|needs|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{needs|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-nightly&lt;/code&gt; || {{tl|nightly}} || {{nightly}} || {{tlp|nightly|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{nightly|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-release-candidate&lt;/code&gt; || {{tl|release-candidate}} || {{release-candidate}} || {{tlp|release-candidate|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{release-candidate|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;table-draw&lt;/code&gt; || {{tl|draw}} || {{draw}} || {{tlp|draw|Text}} || {{draw|Text}}
|-
| &lt;code&gt;table-planned&lt;/code&gt; || {{tl|planned}} || {{planned}} || {{tlp|planned|July 2018}} || {{planned|July 2018}}
|-
| &lt;code&gt;table-scheduled&lt;/code&gt; || {{tl|scheduled}} || {{scheduled}} || {{tlp|scheduled|3 March 2017}} || {{scheduled|3 March 2017}}
|-
| &lt;code&gt;incorrect&lt;/code&gt; || {{tl|incorrect}} || {{incorrect}} || {{tlp|incorrect|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{incorrect|Customized [[Plain text|text]]}}
|-
| &lt;code&gt;noresult&lt;/code&gt; || {{tl|no result}} || {{no result}} || {{tlp|no result|N.R.}} || {{no result|N.R.}}
|-
|rowspan=8| ''no class'' || {{tl|CMain}} || {{CMain}} || {{tlp|CMain|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{CMain|Customized [[Plain text|text]]}}
|-
| {{tl|CAlso starring}} || {{CAlso starring}} || {{tlp|CAlso starring|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{CAlso starring|Customized [[Plain text|text]]}}
|-
| {{tl|CRecurring}} || {{CRecurring}} || {{tlp|CRecurring|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{CRecurring|Customized [[Plain text|text]]}}
|-
| {{tl|CGuest}} || {{CGuest}} || {{tlp|CGuest|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{CGuest|Customized [[Plain text|text]]}}
|-
| {{tl|CNone}} || {{CNone}} || {{tlp|CNone|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{CNone|Customized [[Plain text|text]]}}
|-
| {{tl|nocontest}} || {{nocontest}} || {{tlp|nocontest|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{nocontest}}Customized [[Plain text|text]]
|-
| {{tl|not yet}} || {{not yet}} || {{tlp|not yet|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{not yet|Customized [[Plain text|text]]}}
|-
| {{tl|optional}} || {{optional}} || {{tlp|optional|&lt;nowiki&gt;Customized [[Plain text|text]]&lt;/nowiki&gt;}} || {{optional|Customized [[Plain text|text]]}}
|}&lt;/div&gt;
== Code ==
Common code to most if not all the templates in this series:
:&lt;code&gt;{{Table cell templates|class=''automatic''|text=''text''|bg=#''abcdef''}}&lt;/code&gt;
Code specific to this template:
:&lt;code&gt;{{ {{BASEPAGENAME}} }}&lt;/code&gt;
To make a new table cell template you can use:
&lt;syntaxhighlight lang=text enclose=&quot;div&quot;&gt;{{subst:Table cell templates|text= default text |bg= background color |class= a class name without prefix |align= standard horizontal alignment}}&lt;/syntaxhighlight&gt;
You should leave out the &lt;code&gt;align&lt;/code&gt; parameter and often the &lt;code&gt;class&lt;/code&gt; parameter is unnecessary, too.
Add the new template to the table in the [[Template:Table cell templates/doc|common documentation]] afterwards. Please consider reusing one of the other templates and please choose the color sensibly.
If you find a table cell template that does not take a parameter and you want to be able to change the text in the cell, ''do not'' duplicate the template! Instead, edit the template and change the text to a default parameter substitution. For example, if a template's text is &lt;code&gt;Dropped&lt;/code&gt;, change that to &lt;code&gt;&lt;nowiki&gt;{{{1|Dropped}}}&lt;/nowiki&gt;&lt;/code&gt;.
style=&quot;background: #abcdef; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;automatic table-automatic&quot;| {{{1|text}}}
== TemplateData ==
{{TemplateDataHeader}}
&lt;templatedata&gt;{
&quot;description&quot;: &quot;One of several templates for styling individual table cells with standard contents and colors.&quot;,
&quot;params&quot;: {
&quot;1&quot;: {
&quot;label&quot;: &quot;text&quot;,
&quot;description&quot;: &quot;text to be displayed instead of the default, if this doesn't work put the text after the template, possibly with a vertical bar | in between&quot;,
&quot;type&quot;: &quot;string/line&quot;,
&quot;default&quot;: &quot;(template dependent)&quot;,
&quot;required&quot;: false
},
&quot;align&quot;: {
&quot;label&quot;: &quot;horizontal align&quot;,
&quot;description&quot;: &quot;text alignment inside the cell, either 'left', 'right', 'center' or 'justified'&quot;,
&quot;default&quot;: &quot;center&quot;,
&quot;inherits&quot;: &quot;1&quot;
},
&quot;style&quot;: {
&quot;label&quot;: &quot;style&quot;,
&quot;description&quot;: &quot;a semicolon separated list of additional CSS rules to be applied to the table cell&quot;,
&quot;default&quot;: &quot;&quot;,
&quot;inherits&quot;: &quot;1&quot;
},
&quot;color&quot;: {
&quot;label&quot;: &quot;background color&quot;,
&quot;description&quot;: &quot;a valid CSS color value or name to override the standard the cell background, only available with some templates&quot;,
&quot;inherits&quot;: &quot;1&quot;
}
}}&lt;/templatedata&gt;
== See also ==
* {{tl|change}}: Calculates, displays and color-codes changes between two values
* {{tl|BSD-lic}}: Specialized redirect for {{tlf|free}}
* {{tl|GPL-lic}}: Specialized redirect for {{tlf|free}}
* {{tl|LGPL-lic}}: Specialized redirect for {{tlf|free}}
== Notes ==
{{reflist}}
&lt;includeonly&gt;{{#switch:{{SUBPAGENAME}}|doc|sandbox=|#default=
&lt;!-- ADD CATEGORIES BELOW THIS LINE --&gt;
[[Category:Unified table cell templates]]
}}&lt;/includeonly&gt;</text>
<sha1>0cyaeq7gn36gr9u2ge5zcehht2zehyu</sha1>
</revision>
</page>
<page>
<title>Template:TemplateDataHeader</title>
<ns>10</ns>
<id>46746520</id>
<redirect title="Template:TemplateData header" />
<revision>
<id>663071012</id>
<timestamp>2015-05-19T11:48:58Z</timestamp>
<contributor>
<username>MSGJ</username>
<id>42630</id>
</contributor>
<comment>MSGJ moved page [[Template:TemplateDataHeader]] to [[Template:TemplateData header]]: slightly clearer</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="58">#REDIRECT [[Template:TemplateData header]]
{{R from move}}</text>
<sha1>bfnm7z66t4q2d8otfa0y3vtgkcwrfao</sha1>
</revision>
</page>
<page>
<title>Template:TemplateData header</title>
<ns>10</ns>
<id>40047498</id>
<revision>
<id>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:Template link with parameters</title>
<ns>10</ns>
<id>1567462</id>
<revision>
<id>761532389</id>
<parentid>761532021</parentid>
<timestamp>2017-01-23T13:38:38Z</timestamp>
<contributor>
<username>MSGJ</username>
<id>42630</id>
</contributor>
<minor/>
<comment>tidy up</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="616">&lt;span class=&quot;nowrap&quot;&gt;&amp;#123;&amp;#123;[[Template:{{{1}}}|{{{1}}}]]&lt;!--
--&gt;{{#ifeq:{{{2|x}}}|{{{2|}}}| &amp;#124;{{{2}}} }}&lt;!--
--&gt;{{#ifeq:{{{3|x}}}|{{{3|}}}| &amp;#124;{{{3}}} }}&lt;!--
--&gt;{{#ifeq:{{{4|x}}}|{{{4|}}}| &amp;#124;{{{4}}} }}&lt;!--
--&gt;{{#ifeq:{{{5|x}}}|{{{5|}}}| &amp;#124;{{{5}}} }}&lt;!--
--&gt;{{#ifeq:{{{6|x}}}|{{{6|}}}| &amp;#124;{{{6}}} }}&lt;!--
--&gt;{{#ifeq:{{{7|x}}}|{{{7|}}}| &amp;#124;{{{7}}} }}&lt;!--
--&gt;{{#ifeq:{{{8|x}}}|{{{8|}}}| &amp;#124;{{{8}}} }}&lt;!--
--&gt;{{#ifeq:{{{9|x}}}|{{{9|}}}| &amp;#124;{{{9}}} }}&lt;!--
--&gt;&amp;#125;&amp;#125;&lt;/span&gt;&lt;noinclude&gt;
{{documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>lg9e22t66ubls217bck9o86z41sr30j</sha1>
</revision>
</page>
<page>
<title>Template:Terminated</title>
<ns>10</ns>
<id>5978558</id>
<revision>
<id>821204500</id>
<parentid>550381694</parentid>
<timestamp>2018-01-19T00:33:54Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Terminated]]&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="285">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #EDF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;dropped table-dropped&quot;|{{{1|Terminated}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>80o6crsbgp8l4l4xupomlezzsi0j4mm</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:Tlc</title>
<ns>10</ns>
<id>16451497</id>
<revision>
<id>651651640</id>
<parentid>558397105</parentid>
<timestamp>2015-03-16T16:28:33Z</timestamp>
<contributor>
<username>SlimVirgin</username>
<id>129409</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Tlc: per RfPP ([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="656">&lt;span class=&quot;nowrap&quot;&gt;&lt;code&gt;&amp;#123;&amp;#123;{{#if:{{{1|}}}|{{{1}}}| tlc&amp;#124;...}}&lt;!--
--&gt;{{#ifeq:{{{2|x}}}|{{{2|}}}| &amp;#124;{{{2}}} | }}&lt;!--
--&gt;{{#ifeq:{{{3|x}}}|{{{3|}}}| &amp;#124;{{{3}}} | }}&lt;!--
--&gt;{{#ifeq:{{{4|x}}}|{{{4|}}}| &amp;#124;{{{4}}} | }}&lt;!--
--&gt;{{#ifeq:{{{5|x}}}|{{{5|}}}| &amp;#124;{{{5}}} | }}&lt;!--
--&gt;{{#ifeq:{{{6|x}}}|{{{6|}}}| &amp;#124;{{{6}}} | }}&lt;!--
--&gt;{{#ifeq:{{{7|x}}}|{{{7|}}}| &amp;#124;{{{7}}} | }}&lt;!--
--&gt;{{#ifeq:{{{8|x}}}|{{{8|}}}| &amp;#124;{{{8}}} | }}&lt;!--
--&gt;{{#ifeq:{{{9|x}}}|{{{9|}}}| &amp;#124;{{{9}}} | }}&lt;!--
--&gt;&amp;#125;&amp;#125;&lt;/code&gt;&lt;/span&gt;&lt;noinclude&gt;
{{documentation}}
&lt;!-- Add categories and interwikis to the /doc subpage, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>hvz0y5fmfypqrh6hpdtjucpttl59h70</sha1>
</revision>
</page>
<page>
<title>Template:Tlf</title>
<ns>10</ns>
<id>16451586</id>
<revision>
<id>722494583</id>
<parentid>558397063</parentid>
<timestamp>2016-05-28T14:18:30Z</timestamp>
<contributor>
<username>Ymblanter</username>
<id>14596827</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Tlf: [[WP:High-risk templates|Highly visible template]] ([Edit=Require template editor access] (indefinite) [Move=Require administrator access] (indefinite))</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="644">&lt;span class=&quot;nowrap&quot;&gt;&amp;#123;&amp;#123;{{#if:{{{1|}}}|{{{1}}}| tlf&amp;#124;...}}&lt;!--
--&gt;{{#ifeq:{{{2|x}}}|{{{2|}}}| &amp;#124;{{{2}}} | }}&lt;!--
--&gt;{{#ifeq:{{{3|x}}}|{{{3|}}}| &amp;#124;{{{3}}} | }}&lt;!--
--&gt;{{#ifeq:{{{4|x}}}|{{{4|}}}| &amp;#124;{{{4}}} | }}&lt;!--
--&gt;{{#ifeq:{{{5|x}}}|{{{5|}}}| &amp;#124;{{{5}}} | }}&lt;!--
--&gt;{{#ifeq:{{{6|x}}}|{{{6|}}}| &amp;#124;{{{6}}} | }}&lt;!--
--&gt;{{#ifeq:{{{7|x}}}|{{{7|}}}| &amp;#124;{{{7}}} | }}&lt;!--
--&gt;{{#ifeq:{{{8|x}}}|{{{8|}}}| &amp;#124;{{{8}}} | }}&lt;!--
--&gt;{{#ifeq:{{{9|x}}}|{{{9|}}}| &amp;#124;{{{9}}} | }}&lt;!--
--&gt;&amp;#125;&amp;#125;&lt;/span&gt;&lt;noinclude&gt;
{{documentation}}
&lt;!-- Add categories and interwikis to the /doc sub-page, not here! --&gt;
&lt;/noinclude&gt;</text>
<sha1>mz6t9o5pdzfguxfj2q86tiqdtff1jpr</sha1>
</revision>
</page>
<page>
<title>Template:Tlp</title>
<ns>10</ns>
<id>52958709</id>
<redirect title="Template:Template link with parameters" />
<revision>
<id>761532023</id>
<timestamp>2017-01-23T13:35:17Z</timestamp>
<contributor>
<username>MSGJ</username>
<id>42630</id>
</contributor>
<comment>MSGJ moved page [[Template:Tlp]] to [[Template:Template link with parameters]]: expand name of template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="69">#REDIRECT [[Template:Template link with parameters]]
{{R from move}}</text>
<sha1>6l74hww4lk18kiq6ytyy69dsjvrnwju</sha1>
</revision>
</page>
<page>
<title>Template:Unknown</title>
<ns>10</ns>
<id>5916299</id>
<revision>
<id>718042598</id>
<parentid>716442660</parentid>
<timestamp>2016-05-01T06:22:39Z</timestamp>
<contributor>
<username>PhilipTerryGraham</username>
<id>15292794</id>
</contributor>
<comment>Harmonizing color scheme with Template:N/a</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="306">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #ececec; color: #2C2C2C; font-size: smaller; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;unknown table-unknown&quot;|{{{1|Unknown}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>hgo832orxm3cczwyq7cqxjr75za0pc2</sha1>
</revision>
</page>
<page>
<title>Template:Unofficial</title>
<ns>10</ns>
<id>27900223</id>
<revision>
<id>542388013</id>
<parentid>542242306</parentid>
<timestamp>2013-03-06T15:59:58Z</timestamp>
<contributor>
<username>Tntchn</username>
<id>15106502</id>
</contributor>
<comment>remove interwiki links</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="318">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #5FC; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Unofficial}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>eko97rhsgebtq18k0diglih1lzvzj5b</sha1>
</revision>
</page>
<page>
<title>Template:Unofficial2</title>
<ns>10</ns>
<id>48234891</id>
<revision>
<id>685930302</id>
<timestamp>2015-10-15T22:01:29Z</timestamp>
<contributor>
<username>Spartan7W</username>
<id>13723007</id>
</contributor>
<comment>New template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="321">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #adffe6; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Unofficial}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>l5ob0y5z51qxpr8dcf6qsq2p9fyv41e</sha1>
</revision>
</page>
<page>
<title>Template:Unreleased</title>
<ns>10</ns>
<id>50916894</id>
<revision>
<id>726978487</id>
<parentid>726978356</parentid>
<timestamp>2016-06-25T19:32:47Z</timestamp>
<contributor>
<ip>98.230.192.179</ip>
</contributor>
<comment>Doc</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="175">{| class=&quot;wikitable&quot;
|&lt;onlyinclude&gt;{{n/a|{{{1|Unreleased}}}}}&lt;/onlyinclude&gt;
|}
{{documentation|content={{Table cell templates/doc}}}}
[[Category:Unified table cell templates]]</text>
<sha1>e4f2008ygda1ni4t1j4plheccjv17hl</sha1>
</revision>
</page>
<page>
<title>Template:Usually</title>
<ns>10</ns>
<id>31678188</id>
<revision>
<id>427469480</id>
<timestamp>2011-05-04T20:53:46Z</timestamp>
<contributor>
<username>Jinnai</username>
<id>770829</id>
</contributor>
<comment>new template</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="315">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #8CF; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Usually}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>pv7w7av985y2m2a0diqrf7l9jux52jv</sha1>
</revision>
</page>
<page>
<title>Template:Varies</title>
<ns>10</ns>
<id>51895568</id>
<revision>
<id>743055387</id>
<timestamp>2016-10-07T14:25:13Z</timestamp>
<contributor>
<username>Allixpeeke</username>
<id>467798</id>
</contributor>
<comment>[[WP:AES|←]]Created page with '{| class=&quot;wikitable&quot; |- | &lt;onlyinclude&gt;data-sort-value=&quot;{{{sort|}}}&quot; style=&quot;background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; t...'</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="282">{| class=&quot;wikitable&quot;
|-
| &lt;onlyinclude&gt;data-sort-value=&quot;{{{sort|}}}&quot; style=&quot;background: #ececec; color: #2C2C2C; vertical-align: middle; font-size: smaller; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-na&quot; &lt;!--
--&gt;| {{{1|Varies}}}&lt;/onlyinclude&gt;
|}
{{documentation}}</text>
<sha1>pgsrp1himz5bu70pd03nd5o1oboviwz</sha1>
</revision>
</page>
<page>
<title>Template:Won</title>
<ns>10</ns>
<id>15351925</id>
<revision>
<id>718793861</id>
<parentid>695452880</parentid>
<timestamp>2016-05-05T17:27:57Z</timestamp>
<contributor>
<username>Nyuszika7H</username>
<id>19331273</id>
</contributor>
<comment>Use documentation at [[Template:Table cell templates/doc]]</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="548">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: {{
#switch: {{lc:{{{place|Won}}}}}
|won = {{{color|&lt;nowiki&gt;#&lt;/nowiki&gt;99FF99}}}
|1|1st|gold = {{{color|gold}}}
|2|2nd|silver = {{{color|silver}}}
|3|3rd|bronze = {{{color|&lt;nowiki&gt;#&lt;/nowiki&gt;D9A821}}}
|#default = {{{color|&lt;nowiki&gt;#&lt;/nowiki&gt;F8EABA}}}
}}; color: {{{text|black}}}; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;yes table-yes2&quot;|{{{1|{{{place|Won}}}}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;/noinclude&gt;</text>
<sha1>9oz068i12jhncy5pfpfk1lv7lby9foj</sha1>
</revision>
</page>
<page>
<title>Template:Ya</title>
<ns>10</ns>
<id>34043751</id>
<revision>
<id>819686595</id>
<parentid>755386161</parentid>
<timestamp>2018-01-10T19:17:59Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Ya]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space 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="464">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;data-sort-value=&quot;{{{sort|Yes}}}&quot; style=&quot;background: {{{color|#D2FFD2}}}; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;table-yes2&quot; {{#if:{{{rowspan|}}}|rowspan=&quot;{{{rowspan}}}&quot;}} |{{{text|[[File:Green check.svg|13px|link={{{link|}}}|{{{1|Yes}}}]]}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
[[Category:Checkmark insertion templates]]
&lt;/noinclude&gt;</text>
<sha1>ixn188e0v57o0f7tdcnodmm2soypsyr</sha1>
</revision>
</page>
<page>
<title>Template:Yes</title>
<ns>10</ns>
<id>1818440</id>
<revision>
<id>600725279</id>
<parentid>600688783</parentid>
<timestamp>2014-03-22T12:32:36Z</timestamp>
<contributor>
<username>Technical 13</username>
<id>14450599</id>
</contributor>
<comment>Trim some bits from this template as it is transcluded hundreds of times on some pages and should be as little as possible.</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="211">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#9F9;vertical-align:middle;text-align:{{{align|center}}};{{{style|}}}&quot; class=&quot;table-yes&quot;|{{{1|Yes}}}&lt;noinclude&gt;
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>g91zppg047mtml3pop7qqio29fjkezn</sha1>
</revision>
</page>
<page>
<title>Template:Yes-No</title>
<ns>10</ns>
<id>8170385</id>
<revision>
<id>819689823</id>
<parentid>544604575</parentid>
<timestamp>2018-01-10T19:26:25Z</timestamp>
<contributor>
<username>Primefac</username>
<id>11508456</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Template:Yes-No]]&quot;: [[WP:SEMI|semi-protecting]] highly-visible templates in response to recent template-space vandalism ([Edit=Require autoconfirmed or confirmed access] (indefinite) [Move=Require autoconfirmed or confirmed access] (indefi...</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="314">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background: #FFD; color: black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&quot; class=&quot;partial table-partial&quot;|{{{1|Yes/No}}}&lt;noinclude&gt;
|}
{{Documentation|Template:Table cell templates/doc}}
&lt;!-- interwikis &amp; categories --&gt;
&lt;/noinclude&gt;</text>
<sha1>6jfz2rjw6it0y5bw3a0k6229za610hi</sha1>
</revision>
</page>
<page>
<title>Template:Yes2</title>
<ns>10</ns>
<id>4365248</id>
<revision>
<id>677624593</id>
<parentid>350655741</parentid>
<timestamp>2015-08-24T14:01:41Z</timestamp>
<contributor>
<username>WJBscribe</username>
<id>2803535</id>
</contributor>
<minor/>
<comment>Changed protection level of Template:Yes2: [[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="226">&lt;noinclude&gt;{| class=&quot;wikitable&quot;
|-
|&lt;/noinclude&gt;style=&quot;background:#bfd; color:black; vertical-align:middle; text-align:{{{align|center}}}; {{{style|}}}&quot; class=&quot;table-yes2&quot; |{{{1|}}}&lt;noinclude&gt;
|}
{{documentation}}
&lt;/noinclude&gt;</text>
<sha1>g8ru5wexcbkah1ii8j2dbutxe5g3wjx</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:Check for unknown parameters</title>
<ns>828</ns>
<id>42286729</id>
<revision>
<id>726655795</id>
<parentid>726655742</parentid>
<timestamp>2016-06-23T14:41:43Z</timestamp>
<contributor>
<username>Frietjes</username>
<id>13791031</id>
</contributor>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is
-- not on the list
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
local function isnotempty(s)
return s and trim(s) ~= ''
end
function p.check (frame)
local args = frame.args
local pargs = frame:getParent().args
local ignoreblank = isnotempty(frame.args['ignoreblank'])
local showblankpos = isnotempty(frame.args['showblankpositional'])
local knownargs = {}
local unknown = frame.args['unknown'] or 'Found _VALUE_, '
local preview = frame.args['preview']
local values = {}
local res = {}
local regexps = {}
-- create the list of known args, regular expressions, and the return string
for k, v in pairs(args) do
if type(k) == 'number' then
v = trim(v)
knownargs[v] = 1
elseif k:find('^regexp[1-9][0-9]*$') then
table.insert(regexps, '^' .. v .. '$')
end
end
if isnotempty(preview) then
preview = '&lt;div class=&quot;hatnote&quot; style=&quot;color:red&quot;&gt;&lt;strong&gt;Warning:&lt;/strong&gt; ' .. preview .. ' (this message is shown only in preview).&lt;/div&gt;'
elseif preview == nil then
preview = unknown
end
-- loop over the parent args, and make sure they are on the list
for k, v in pairs(pargs) do
if type(k) == 'string' and knownargs[k] == nil then
local knownflag = false
for i, regexp in ipairs(regexps) do
if mw.ustring.match(k, regexp) then
knownflag = true
break
end
end
if not knownflag and ( not ignoreblank or isnotempty(v) ) then
k = mw.ustring.gsub(k, '[^%w\-_ ]', '?')
table.insert(values, k)
end
elseif type(k) == 'number' and
knownargs[tostring(k)] == nil and
( showblankpos or isnotempty(v) )
then
local vlen = mw.ustring.len(v)
v = mw.ustring.sub(v, 1, (vlen &lt; 25) and vlen or 25)
v = mw.ustring.gsub(v, '[^%w\-_ ]', '?')
table.insert(values, k .. ' = ' .. v .. ((vlen &gt;= 25) and ' ...' or ''))
end
end
-- add resuls to the output tables
if #values &gt; 0 then
if frame:preprocess( &quot;{{REVISIONID}}&quot; ) == &quot;&quot; then
unknown = preview
end
for k, v in pairs(values) do
if v == '' then
-- Fix odd bug for | = which gets stripped to the empty string and
-- breaks category links
v = ' '
end
local r = unknown:gsub('_VALUE_', v)
table.insert(res, r)
end
end
return table.concat(res)
end
return p</text>
<sha1>hrayw1t1r2ij1wg65qi0jh0x6y31ba4</sha1>
</revision>
</page>
<page>
<title>Module:Documentation</title>
<ns>828</ns>
<id>40256557</id>
<revision>
<id>729280556</id>
<parentid>725653683</parentid>
<timestamp>2016-07-11T04:31:31Z</timestamp>
<contributor>
<username>Andy M. Wang</username>
<id>516856</id>
</contributor>
<comment>rm alt text on icon, since the adjacent text, &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:Math</title>
<ns>828</ns>
<id>38591527</id>
<revision>
<id>712321332</id>
<parentid>613638641</parentid>
<timestamp>2016-03-28T12:15:51Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>simplify using a new binary_fold function, per protected edit request by [[User:Esquivalience]]</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="12811">--[[
This module provides a number of basic mathematical operations.
]]
local yesno, getArgs -- lazily initialized
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.
--[[
Helper functions used to avoid redundant code.
]]
local function err(msg)
-- Generates wikitext error messages.
return mw.ustring.format('&lt;strong class=&quot;error&quot;&gt;Formatting error: %s&lt;/strong&gt;', msg)
end
local function unpackNumberArgs(args)
-- Returns an unpacked list of arguments specified with numerical keys.
local ret = {}
for k, v in pairs(args) do
if type(k) == 'number' then
table.insert(ret, v)
end
end
return unpack(ret)
end
local function makeArgArray(...)
-- Makes an array of arguments from a list of arguments that might include nils.
local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.
local nums = {} -- Stores the numbers of valid numerical arguments.
local ret = {}
for k, v in pairs(args) do
v = p._cleanNumber(v)
if v then
nums[#nums + 1] = k
args[k] = v
end
end
table.sort(nums)
for i, num in ipairs(nums) do
ret[#ret + 1] = args[num]
end
return ret
end
local function fold(func, ...)
-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,
-- and must return a number as an output. This number is then supplied as input to the next function call.
local vals = makeArgArray(...)
local count = #vals -- The number of valid arguments
if count == 0 then return
-- Exit if we have no valid args, otherwise removing the first arg would cause an error.
nil, 0
end
local ret = table.remove(vals, 1)
for _, val in ipairs(vals) do
ret = func(ret, val)
end
return ret, count
end
--[[
Fold arguments by selectively choosing values (func should return when to choose the current &quot;dominant&quot; value).
]]
local function binary_fold(func, ...)
local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)
return value
end
--[[
random
Generate a random number
Usage:
{{#invoke: Math | random }}
{{#invoke: Math | random | maximum value }}
{{#invoke: Math | random | minimum value | maximum value }}
]]
function wrap.random(args)
local first = p._cleanNumber(args[1])
local second = p._cleanNumber(args[2])
return p._random(first, second)
end
function p._random(first, second)
math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))
-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.
if first and second then
if first &lt;= second then -- math.random doesn't allow the first number to be greater than the second.
return math.random(first, second)
end
elseif first then
return math.random(first)
else
return math.random()
end
end
--[[
order
Determine order of magnitude of a number
Usage:
{{#invoke: Math | order | value }}
]]
function wrap.order(args)
local input_string = (args[1] or args.x or '0');
local input_number = p._cleanNumber(input_string);
if input_number == nil then
return err('order of magnitude input appears non-numeric')
else
return p._order(input_number)
end
end
function p._order(x)
if x == 0 then return 0 end
return math.floor(math.log10(math.abs(x)))
end
--[[
precision
Detemines the precision of a number using the string representation
Usage:
{{ #invoke: Math | precision | value }}
]]
function wrap.precision(args)
local input_string = (args[1] or args.x or '0');
local trap_fraction = args.check_fraction;
local input_number;
if not yesno then
yesno = require('Module:Yesno')
end
if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, &quot;no&quot;, &quot;n&quot;, &quot;0&quot; and a few others. See [[Module:Yesno]].
local pos = string.find(input_string, '/', 1, true);
if pos ~= nil then
if string.find(input_string, '/', pos + 1, true) == nil then
local denominator = string.sub(input_string, pos+1, -1);
local denom_value = tonumber(denominator);
if denom_value ~= nil then
return math.log10(denom_value);
end
end
end
end
input_number, input_string = p._cleanNumber(input_string);
if input_string == nil then
return err('precision input appears non-numeric')
else
return p._precision(input_string)
end
end
function p._precision(x)
if type(x) == 'number' then
x = tostring(x)
end
x = string.upper(x)
local decimal = x:find('%.')
local exponent_pos = x:find('E')
local result = 0;
if exponent_pos ~= nil then
local exponent = string.sub(x, exponent_pos + 1)
x = string.sub(x, 1, exponent_pos - 1)
result = result - tonumber(exponent)
end
if decimal ~= nil then
result = result + string.len(x) - decimal
return result
end
local pos = string.len(x);
while x:byte(pos) == string.byte('0') do
pos = pos - 1
result = result - 1
if pos &lt;= 0 then
return 0
end
end
return result
end
--[[
max
Finds the maximum argument
Usage:
{{#invoke:Math| max | value1 | value2 | ... }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.max(args)
return p._max(unpackNumberArgs(args))
end
function p._max(...)
local max_value = binary_fold((function(a, b) return a &gt; b end), ...)
if max_value then
return max_value
end
end
--[[
min
Finds the minimum argument
Usage:
{{#invoke:Math| min | value1 | value2 | ... }}
OR
{{#invoke:Math| min }}
When used with no arguments, it takes its input from the parent
frame. Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.min(args)
return p._min(unpackNumberArgs(args))
end
function p._min(...)
local min_value = binary_fold((function(a, b) return a &lt; b end), ...)
if min_value then
return min_value
end
end
--[[
average
Finds the average
Usage:
{{#invoke:Math| average | value1 | value2 | ... }}
OR
{{#invoke:Math| average }}
Note, any values that do not evaluate to numbers are ignored.
]]
function wrap.average(args)
return p._average(unpackNumberArgs(args))
end
function p._average(...)
local sum, count = fold((function(a, b) return a + b end), ...)
if not sum then
return 0
else
return sum / count
end
end
--[[
round
Rounds a number to specified precision
Usage:
{{#invoke:Math | round | value | precision }}
--]]
function wrap.round(args)
local value = p._cleanNumber(args[1] or args.value or 0)
local precision = p._cleanNumber(args[2] or args.precision or 0)
if value == nil or precision == nil then
return err('round input appears non-numeric')
else
return p._round(value, precision)
end
end
function p._round(value, precision)
local rescale = math.pow(10, precision or 0);
return math.floor(value * rescale + 0.5) / rescale;
end
--[[
mod
Implements the modulo operator
Usage:
{{#invoke:Math | mod | x | y }}
--]]
function wrap.mod(args)
local x = p._cleanNumber(args[1])
local y = p._cleanNumber(args[2])
if not x then
return err('first argument to mod appears non-numeric')
elseif not y then
return err('second argument to mod appears non-numeric')
else
return p._mod(x, y)
end
end
function p._mod(x, y)
local ret = x % y
if not (0 &lt;= ret and ret &lt; y) then
ret = 0
end
return ret
end
--[[
gcd
Calculates the greatest common divisor of multiple numbers
Usage:
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}
--]]
function wrap.gcd(args)
return p._gcd(unpackNumberArgs(args))
end
function p._gcd(...)
local function findGcd(a, b)
local r = b
local oldr = a
while r ~= 0 do
local quotient = math.floor(oldr / r)
oldr, r = r, oldr - quotient * r
end
if oldr &lt; 0 then
oldr = oldr * -1
end
return oldr
end
local result, count = fold(findGcd, ...)
return result
end
--[[
precision_format
Rounds a number to the specified precision and formats according to rules
originally used for {{template:Rnd}}. Output is a string.
Usage:
{{#invoke: Math | precision_format | number | precision }}
]]
function wrap.precision_format(args)
local value_string = args[1] or 0
local precision = args[2] or 0
return p._precision_format(value_string, precision)
end
function p._precision_format(value_string, precision)
-- For access to Mediawiki built-in formatter.
local lang = mw.getContentLanguage();
local value
value, value_string = p._cleanNumber(value_string)
precision = p._cleanNumber(precision)
-- Check for non-numeric input
if value == nil or precision == nil then
return err('invalid input when rounding')
end
local current_precision = p._precision(value)
local order = p._order(value)
-- Due to round-off effects it is neccesary to limit the returned precision under
-- some circumstances because the terminal digits will be inaccurately reported.
if order + precision &gt;= 14 then
orig_precision = p._precision(value_string)
if order + orig_precision &gt;= 14 then
precision = 13 - order;
end
end
-- If rounding off, truncate extra digits
if precision &lt; current_precision then
value = p._round(value, precision)
current_precision = p._precision(value)
end
local formatted_num = lang:formatNum(math.abs(value))
local sign
-- Use proper unary minus sign rather than ASCII default
if value &lt; 0 then
sign = '−'
else
sign = ''
end
-- Handle cases requiring scientific notation
if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) &gt;= 9 then
value = value * math.pow(10, -order)
current_precision = current_precision + order
precision = precision + order
formatted_num = lang:formatNum(math.abs(value))
else
order = 0;
end
formatted_num = sign .. formatted_num
-- Pad with zeros, if needed
if current_precision &lt; precision then
local padding
if current_precision &lt;= 0 then
if precision &gt; 0 then
local zero_sep = lang:formatNum(1.1)
formatted_num = formatted_num .. zero_sep:sub(2,2)
padding = precision
if padding &gt; 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
else
padding = precision - current_precision
if padding &gt; 20 then
padding = 20
end
formatted_num = formatted_num .. string.rep('0', padding)
end
end
-- Add exponential notation, if necessary.
if order ~= 0 then
-- Use proper unary minus sign rather than ASCII default
if order &lt; 0 then
order = '−' .. lang:formatNum(math.abs(order))
else
order = lang:formatNum(order)
end
formatted_num = formatted_num .. '&lt;span style=&quot;margin:0 .15em 0 .25em&quot;&gt;×&lt;/span&gt;10&lt;sup&gt;' .. order .. '&lt;/sup&gt;'
end
return formatted_num
end
--[[
Helper function that interprets the input numerically. If the
input does not appear to be a number, attempts evaluating it as
a parser functions expression.
]]
function p._cleanNumber(number_string)
if type(number_string) == 'number' then
-- We were passed a number, so we don't need to do any processing.
return number_string, tostring(number_string)
elseif type(number_string) ~= 'string' or not number_string:find('%S') then
-- We were passed a non-string or a blank string, so exit.
return nil, nil;
end
-- Attempt basic conversion
local number = tonumber(number_string)
-- If failed, attempt to evaluate input as an expression
if number == nil then
local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)
if success then
number = tonumber(result)
number_string = tostring(number)
else
number = nil
number_string = nil
end
else
number_string = number_string:match(&quot;^%s*(.-)%s*$&quot;) -- String is valid but may contain padding, clean it.
number_string = number_string:match(&quot;^%+(.*)$&quot;) or number_string -- Trim any leading + signs.
if number_string:find('^%-?0[xX]') then
-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.
number_string = tostring(number)
end
end
return number, number_string
end
--[[
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.
]]
local mt = { __index = function(t, k)
return function(frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return wrap[k](getArgs(frame)) -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.
end
end }
return setmetatable(p, mt)</text>
<sha1>2oc32zmcprh43j49a7jjarc5hix02hn</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
end
end
-- Set the non-collapsible text field. At the moment this is used by all box
-- types other than ambox, and also by ambox when small=yes.
if self.isSmall then
self.text = args.smalltext or args.text
else
self.text = args.text
end
-- Set the below row.
self.below = cfg.below and args.below
-- General image settings.
self.imageCellDiv = not self.isSmall and cfg.imageCellDiv
self.imageEmptyCell = cfg.imageEmptyCell
if cfg.imageEmptyCellStyle then
self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'
end
-- Left image settings.
local imageLeft = self.isSmall and args.smallimage or args.image
if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'
or not cfg.imageCheckBlank and imageLeft ~= 'none'
then
self.imageLeft = imageLeft
if not imageLeft then
local imageSize = self.isSmall
and (cfg.imageSmallSize or '30x30px')
or '40x40px'
self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage
or 'Imbox notice.png', imageSize)
end
end
-- Right image settings.
local imageRight = self.isSmall and args.smallimageright or args.imageright
if not (cfg.imageRightNone and imageRight == 'none') then
self.imageRight = imageRight
end
end
function MessageBox:setMainspaceCategories()
local args = self.args
local cfg = self.cfg
if not cfg.allowMainspaceCategories then
return nil
end
local nums = {}
for _, prefix in ipairs{'cat', 'category', 'all'} do
args[prefix .. '1'] = args[prefix]
nums = union(nums, getArgNums(args, prefix))
end
-- The following is roughly equivalent to the old {{Ambox/category}}.
local date = args.date
date = type(date) == 'string' and date
local preposition = 'from'
for _, num in ipairs(nums) do
local mainCat = args['cat' .. tostring(num)]
or args['category' .. tostring(num)]
local allCat = args['all' .. tostring(num)]
mainCat = type(mainCat) == 'string' and mainCat
allCat = type(allCat) == 'string' and allCat
if mainCat and date and date ~= '' then
local catTitle = string.format('%s %s %s', mainCat, preposition, date)
self:addCat(0, catTitle)
catTitle = getTitleObject('Category:' .. catTitle)
if not catTitle or not catTitle.exists then
self:addCat(0, 'Articles with invalid date parameter in template')
end
elseif mainCat and (not date or date == '') then
self:addCat(0, mainCat)
end
if allCat then
self:addCat(0, allCat)
end
end
end
function MessageBox:setTemplateCategories()
local args = self.args
local cfg = self.cfg
-- Add template categories.
if cfg.templateCategory then
if cfg.templateCategoryRequireName then
if self.isTemplatePage then
self:addCat(10, cfg.templateCategory)
end
elseif not self.title.isSubpage then
self:addCat(10, cfg.templateCategory)
end
end
-- Add template error categories.
if cfg.templateErrorCategory then
local templateErrorCategory = cfg.templateErrorCategory
local templateCat, templateSort
if not self.name and not self.title.isSubpage then
templateCat = templateErrorCategory
elseif self.isTemplatePage then
local paramsToCheck = cfg.templateErrorParamsToCheck or {}
local count = 0
for i, param in ipairs(paramsToCheck) do
if not args[param] then
count = count + 1
end
end
if count &gt; 0 then
templateCat = templateErrorCategory
templateSort = tostring(count)
end
if self.categoryNums and #self.categoryNums &gt; 0 then
templateCat = templateErrorCategory
templateSort = 'C'
end
end
self:addCat(10, templateCat, templateSort)
end
end
function MessageBox:setAllNamespaceCategories()
-- Set categories for all namespaces.
if self.invalidTypeError then
local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText
self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)
end
if self.isSubstituted then
self:addCat('all', 'Pages with incorrectly substituted templates')
end
end
function MessageBox:setCategories()
if self.title.namespace == 0 then
self:setMainspaceCategories()
elseif self.title.namespace == 10 then
self:setTemplateCategories()
end
self:setAllNamespaceCategories()
end
function MessageBox:renderCategories()
-- Convert category tables to strings and pass them through
-- [[Module:Category handler]].
return categoryHandler{
main = table.concat(self.categories[0] or {}),
template = table.concat(self.categories[10] or {}),
all = table.concat(self.categories.all or {}),
nocat = self.args.nocat,
page = self.args.page
}
end
function MessageBox:export()
local root = mw.html.create()
-- Add the subst check error.
if self.isSubstituted and self.name then
root:tag('b')
:addClass('error')
:wikitext(string.format(
'Template &lt;code&gt;%s[[Template:%s|%s]]%s&lt;/code&gt; has been incorrectly substituted.',
mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')
))
end
-- Create the box table.
local boxTable = root:tag('table')
boxTable:attr('id', self.id or nil)
for i, class in ipairs(self.classes or {}) do
boxTable:addClass(class or nil)
end
boxTable
:cssText(self.style or nil)
:attr('role', 'presentation')
if self.attrs then
boxTable:attr(self.attrs)
end
-- Add the left-hand image.
local row = boxTable:tag('tr')
if self.imageLeft then
local imageLeftCell = row:tag('td'):addClass('mbox-image')
if self.imageCellDiv then
-- If we are using a div, redefine imageLeftCell so that the image
-- is inside it. Divs use style=&quot;width: 52px;&quot;, which limits the
-- image width to 52px. If any images in a div are wider than that,
-- they may overlap with the text or cause other display problems.
imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')
end
imageLeftCell:wikitext(self.imageLeft or nil)
elseif self.imageEmptyCell then
-- Some message boxes define an empty cell if no image is specified, and
-- some don't. The old template code in templates where empty cells are
-- specified gives the following hint: &quot;No image. Cell with some width
-- or padding necessary for text cell to have 100% width.&quot;
row:tag('td')
:addClass('mbox-empty-cell')
:cssText(self.imageEmptyCellStyle or nil)
end
-- Add the text.
local textCell = row:tag('td'):addClass('mbox-text')
if self.useCollapsibleTextFields then
-- The message box uses advanced text parameters that allow things to be
-- collapsible. At the moment, only ambox uses this.
textCell:cssText(self.textstyle or nil)
local textCellDiv = textCell:tag('div')
textCellDiv
:addClass('mbox-text-span')
:wikitext(self.issue or nil)
if (self.talk or self.fix) and not self.isSmall then
textCellDiv:tag('span')
:addClass('hide-when-compact')
:wikitext(self.talk and (' ' .. self.talk) or nil)
:wikitext(self.fix and (' ' .. self.fix) or nil)
end
textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)
if self.info and not self.isSmall then
textCellDiv
:tag('span')
:addClass('hide-when-compact')
:wikitext(self.info and (' ' .. self.info) or nil)
end
if self.removalNotice then
textCellDiv:tag('small')
:addClass('hide-when-compact')
:tag('i')
:wikitext(string.format(&quot; (%s)&quot;, self.removalNotice))
end
else
-- Default text formatting - anything goes.
textCell
:cssText(self.textstyle or nil)
:wikitext(self.text or nil)
end
-- Add the right-hand image.
if self.imageRight then
local imageRightCell = row:tag('td'):addClass('mbox-imageright')
if self.imageCellDiv then
-- If we are using a div, redefine imageRightCell so that the image
-- is inside it.
imageRightCell = imageRightCell:tag('div'):css('width', '52px')
end
imageRightCell
:wikitext(self.imageRight or nil)
end
-- Add the below row.
if self.below then
boxTable:tag('tr')
:tag('td')
:attr('colspan', self.imageRight and '3' or '2')
:addClass('mbox-text')
:cssText(self.textstyle or nil)
:wikitext(self.below or nil)
end
-- Add error message for invalid type parameters.
if self.invalidTypeError then
root:tag('div')
:css('text-align', 'center')
:wikitext(string.format(
'This message box is using an invalid &quot;type=%s&quot; parameter and needs fixing.',
self.type or ''
))
end
-- Add categories.
root:wikitext(self:renderCategories() or nil)
return tostring(root)
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p, mt = {}, {}
function p._exportClasses()
-- For testing.
return {
MessageBox = MessageBox
}
end
function p.main(boxType, args, cfgTables)
local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))
box:setParameters()
box:setCategories()
return box:export()
end
function mt.__index(t, k)
return function (frame)
if not getArgs then
getArgs = require('Module:Arguments').getArgs
end
return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))
end
end
return setmetatable(p, mt)</text>
<sha1>o82985w14pvc3irjmn280op991seq7t</sha1>
</revision>
</page>
<page>
<title>Module:Message box/configuration</title>
<ns>828</ns>
<id>40627038</id>
<revision>
<id>742383738</id>
<parentid>717357572</parentid>
<timestamp>2016-10-03T11:04:13Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>allow all templates to disable the plainlinks class</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="6091">--------------------------------------------------------------------------------
-- Message box configuration --
-- --
-- This module contains configuration data for [[Module:Message box]]. --
--------------------------------------------------------------------------------
return {
ambox = {
types = {
speedy = {
class = 'ambox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ambox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ambox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ambox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ambox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ambox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'ambox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},
allowSmall = true,
smallParam = 'left',
smallClass = 'mbox-small-left',
substCheck = true,
classes = {'metadata', 'ambox'},
imageEmptyCell = true,
imageCheckBlank = true,
imageSmallSize = '20x20px',
imageCellDiv = true,
useCollapsibleTextFields = true,
imageRightNone = true,
sectionDefault = 'article',
allowMainspaceCategories = true,
templateCategory = 'Article message templates',
templateCategoryRequireName = true,
templateErrorCategory = 'Article message templates with missing parameters',
templateErrorParamsToCheck = {'issue', 'fix', 'subst'},
removalNotice = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'
},
cmbox = {
types = {
speedy = {
class = 'cmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'cmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'cmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'cmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'cmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'cmbox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'cmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'cmbox'},
imageEmptyCell = true
},
fmbox = {
types = {
warning = {
class = 'fmbox-warning',
image = 'Ambox warning pn.svg'
},
editnotice = {
class = 'fmbox-editnotice',
image = 'Information icon4.svg'
},
system = {
class = 'fmbox-system',
image = 'Information icon4.svg'
}
},
default = 'system',
showInvalidTypeError = true,
classes = {'fmbox'},
imageEmptyCell = false,
imageRightNone = false
},
imbox = {
types = {
speedy = {
class = 'imbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'imbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'imbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'imbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'imbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'imbox-protection',
image = 'Padlock-silver-medium.svg'
},
license = {
class = 'imbox-license licensetpl',
image = 'Imbox license.png' -- @todo We need an SVG version of this
},
featured = {
class = 'imbox-featured',
image = 'Cscr-featured.svg'
},
notice = {
class = 'imbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'imbox'},
imageEmptyCell = true,
below = true,
templateCategory = 'File message boxes'
},
ombox = {
types = {
speedy = {
class = 'ombox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'ombox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'ombox-content',
image = 'Ambox important.svg'
},
style = {
class = 'ombox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'ombox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'ombox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'ombox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'ombox'},
allowSmall = true,
imageEmptyCell = true,
imageRightNone = true
},
tmbox = {
types = {
speedy = {
class = 'tmbox-speedy',
image = 'Ambox warning pn.svg'
},
delete = {
class = 'tmbox-delete',
image = 'Ambox warning pn.svg'
},
content = {
class = 'tmbox-content',
image = 'Ambox important.svg'
},
style = {
class = 'tmbox-style',
image = 'Edit-clear.svg'
},
move = {
class = 'tmbox-move',
image = 'Merge-split-transwiki default.svg'
},
protection = {
class = 'tmbox-protection',
image = 'Padlock-silver-medium.svg'
},
notice = {
class = 'tmbox-notice',
image = 'Information icon4.svg'
}
},
default = 'notice',
showInvalidTypeError = true,
classes = {'tmbox'},
allowSmall = true,
imageRightNone = true,
imageEmptyCell = true,
imageEmptyCellStyle = true,
templateCategory = 'Talk message boxes'
}
}</text>
<sha1>16xsc67jviirmw0nf2yuxvotqd7rygq</sha1>
</revision>
</page>
<page>
<title>Module:Namespace detect/config</title>
<ns>828</ns>
<id>42256703</id>
<revision>
<id>602886681</id>
<parentid>602823531</parentid>
<timestamp>2014-04-05T17:03:49Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>use cfg.demopage rather than cfg.page now that the default parameter has been changed on the /data page</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="3545">--------------------------------------------------------------------------------
-- Namespace detect configuration data --
-- --
-- This module stores configuration data for Module:Namespace detect. Here --
-- you can localise the module to your wiki's language. --
-- --
-- To activate a configuration item, you need to uncomment it. This means --
-- that you need to remove the text &quot;-- &quot; at the start of the line. --
--------------------------------------------------------------------------------
local cfg = {} -- Don't edit this line.
--------------------------------------------------------------------------------
-- Parameter names --
-- These configuration items specify custom parameter names. Values added --
-- here will work in addition to the default English parameter names. --
-- To add one extra name, you can use this format: --
-- --
-- cfg.foo = 'parameter name' --
-- --
-- To add multiple names, you can use this format: --
-- --
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'} --
--------------------------------------------------------------------------------
---- This parameter displays content for the main namespace:
-- cfg.main = 'main'
---- This parameter displays in talk namespaces:
-- cfg.talk = 'talk'
---- This parameter displays content for &quot;other&quot; namespaces (namespaces for which
---- parameters have not been specified):
-- cfg.other = 'other'
---- This parameter makes talk pages behave as though they are the corresponding
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].
---- Edit that module to change the default values of &quot;yes&quot;, &quot;no&quot;, etc.
-- cfg.subjectns = 'subjectns'
---- This parameter sets a demonstration namespace:
-- cfg.demospace = 'demospace'
---- This parameter sets a specific page to compare:
cfg.demopage = 'page'
--------------------------------------------------------------------------------
-- Table configuration --
-- These configuration items allow customisation of the &quot;table&quot; function, --
-- used to generate a table of possible parameters in the module --
-- documentation. --
--------------------------------------------------------------------------------
---- The header for the namespace column in the wikitable containing the list of
---- possible subject-space parameters.
-- cfg.wikitableNamespaceHeader = 'Namespace'
---- The header for the wikitable containing the list of possible subject-space
---- parameters.
-- cfg.wikitableAliasesHeader = 'Aliases'
--------------------------------------------------------------------------------
-- End of configuration data --
--------------------------------------------------------------------------------
return cfg -- Don't edit this line.</text>
<sha1>1o6ozz56i8q0xgyl6xa41n2v7kelhli</sha1>
</revision>
</page>
<page>
<title>Module:Namespace detect/data</title>
<ns>828</ns>
<id>42257476</id>
<revision>
<id>602886511</id>
<parentid>602823622</parentid>
<timestamp>2014-04-05T17:02:16Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>bug fix - use the demospace parameter as both key and value in the argKeys table</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="2569">--------------------------------------------------------------------------------
-- Namespace detect data --
-- This module holds data for [[Module:Namespace detect]] to be loaded per --
-- page, rather than per #invoke, for performance reasons. --
--------------------------------------------------------------------------------
local cfg = require('Module:Namespace detect/config')
local function addKey(t, key, defaultKey)
if key ~= defaultKey then
t[#t + 1] = key
end
end
-- Get a table of parameters to query for each default parameter name.
-- This allows wikis to customise parameter names in the cfg table while
-- ensuring that default parameter names will always work. The cfg table
-- values can be added as a string, or as an array of strings.
local defaultKeys = {
'main',
'talk',
'other',
'subjectns',
'demospace',
'demopage'
}
local argKeys = {}
for i, defaultKey in ipairs(defaultKeys) do
argKeys[defaultKey] = {defaultKey}
end
for defaultKey, t in pairs(argKeys) do
local cfgValue = cfg[defaultKey]
local cfgValueType = type(cfgValue)
if cfgValueType == 'string' then
addKey(t, cfgValue, defaultKey)
elseif cfgValueType == 'table' then
for i, key in ipairs(cfgValue) do
addKey(t, key, defaultKey)
end
end
cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.
end
local function getParamMappings()
--[[
-- Returns a table of how parameter names map to namespace names. The keys
-- are the actual namespace names, in lower case, and the values are the
-- possible parameter names for that namespace, also in lower case. The
-- table entries are structured like this:
-- {
-- [''] = {'main'},
-- ['wikipedia'] = {'wikipedia', 'project', 'wp'},
-- ...
-- }
--]]
local mappings = {}
local mainNsName = mw.site.subjectNamespaces[0].name
mainNsName = mw.ustring.lower(mainNsName)
mappings[mainNsName] = mw.clone(argKeys.main)
mappings['talk'] = mw.clone(argKeys.talk)
for nsid, ns in pairs(mw.site.subjectNamespaces) do
if nsid ~= 0 then -- Exclude main namespace.
local nsname = mw.ustring.lower(ns.name)
local canonicalName = mw.ustring.lower(ns.canonicalName)
mappings[nsname] = {nsname}
if canonicalName ~= nsname then
table.insert(mappings[nsname], canonicalName)
end
for _, alias in ipairs(ns.aliases) do
table.insert(mappings[nsname], mw.ustring.lower(alias))
end
end
end
return mappings
end
return {
argKeys = argKeys,
cfg = cfg,
mappings = getParamMappings()
}</text>
<sha1>ojp6d3pc8mql5nufaqdg576c9so3479</sha1>
</revision>
</page>
<page>
<title>Module:No globals</title>
<ns>828</ns>
<id>42567026</id>
<revision>
<id>606781024</id>
<parentid>605595284</parentid>
<timestamp>2014-05-02T15:35:56Z</timestamp>
<contributor>
<username>Jackmcbarn</username>
<id>19285809</id>
</contributor>
<comment>rm name exception</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="307">local mt = getmetatable(_G) or {}
function mt.__index (t, k)
if k ~= 'arg' then
error('Tried to read nil global ' .. tostring(k), 2)
end
return nil
end
function mt.__newindex(t, k, v)
if k ~= 'arg' then
error('Tried to write global ' .. tostring(k), 2)
end
rawset(t, k, v)
end
setmetatable(_G, mt)</text>
<sha1>gggsv54pq7f94l3up48hr91qtxnskdm</sha1>
</revision>
</page>
<page>
<title>Module:Protection banner</title>
<ns>828</ns>
<id>42040984</id>
<revision>
<id>741795115</id>
<parentid>732908599</parentid>
<timestamp>2016-09-29T18:32:41Z</timestamp>
<contributor>
<username>Cenarium</username>
<id>5711305</id>
</contributor>
<comment>remove expiry param (now also automatically retrieved for autoreview) and needsexpiry check</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="25486">-- This module implements {{pp-meta}} and its daughter templates such as
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.
-- Initialise necessary modules.
require('Module:No globals')
local makeFileLink = require('Module:File link')._main
local effectiveProtectionLevel = require('Module:Effective protection level')._main
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main
local yesno = require('Module:Yesno')
-- Lazily initialise modules and objects we don't always need.
local getArgs, makeMessageBox, lang
-- Set constants.
local CONFIG_MODULE = 'Module:Protection banner/config'
--------------------------------------------------------------------------------
-- Helper functions
--------------------------------------------------------------------------------
local function makeCategoryLink(cat, sort)
if cat then
return string.format(
'[[%s:%s|%s]]',
mw.site.namespaces[14].name,
cat,
sort
)
end
end
-- Validation function for the expiry and the protection date
local function validateDate(dateString, dateType)
if not lang then
lang = mw.language.getContentLanguage()
end
local success, result = pcall(lang.formatDate, lang, 'U', dateString)
if success then
result = tonumber(result)
if result then
return result
end
end
error(string.format(
'invalid %s: %s',
dateType,
tostring(dateString)
), 4)
end
local function makeFullUrl(page, query, display)
return string.format(
'[%s %s]',
tostring(mw.uri.fullUrl(page, query)),
display
)
end
-- Given a directed graph formatted as node -&gt; table of direct successors,
-- get a table of all nodes reachable from a given node (though always
-- including the given node).
local function getReachableNodes(graph, start)
local toWalk, retval = {[start] = true}, {}
while true do
-- Can't use pairs() since we're adding and removing things as we're iterating
local k = next(toWalk) -- This always gets the &quot;first&quot; key
if k == nil then
return retval
end
toWalk[k] = nil
retval[k] = true
for _,v in ipairs(graph[k]) do
if not retval[v] then
toWalk[v] = true
end
end
end
end
--------------------------------------------------------------------------------
-- Protection class
--------------------------------------------------------------------------------
local Protection = {}
Protection.__index = Protection
Protection.supportedActions = {
edit = true,
move = true,
autoreview = true,
upload = true
}
Protection.bannerConfigFields = {
'text',
'explanation',
'tooltip',
'alt',
'link',
'image'
}
function Protection.new(args, cfg, title)
local obj = {}
obj._cfg = cfg
obj.title = title or mw.title.getCurrentTitle()
-- Set action
if not args.action then
obj.action = 'edit'
elseif Protection.supportedActions[args.action] then
obj.action = args.action
else
error(string.format(
'invalid action: %s',
tostring(args.action)
), 3)
end
-- Set level
obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)
if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then
-- Users need to be autoconfirmed to move pages anyway, so treat
-- semi-move-protected pages as unprotected.
obj.level = '*'
end
-- Set expiry
local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)
if effectiveExpiry == 'infinity' then
obj.expiry = 'indef'
elseif effectiveExpiry ~= 'unknown' then
obj.expiry = validateDate(effectiveExpiry, 'expiry date')
end
-- Set reason
if args[1] then
obj.reason = mw.ustring.lower(args[1])
if obj.reason:find('|') then
error('reasons cannot contain the pipe character (&quot;|&quot;)', 3)
end
end
-- Set protection date
if args.date then
obj.protectionDate = validateDate(args.date, 'protection date')
end
-- Set banner config
do
obj.bannerConfig = {}
local configTables = {}
if cfg.banners[obj.action] then
configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]
end
if cfg.defaultBanners[obj.action] then
configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]
configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default
end
configTables[#configTables + 1] = cfg.masterBanner
for i, field in ipairs(Protection.bannerConfigFields) do
for j, t in ipairs(configTables) do
if t[field] then
obj.bannerConfig[field] = t[field]
break
end
end
end
end
return setmetatable(obj, Protection)
end
function Protection:isProtected()
return self.level ~= '*'
end
function Protection:isTemporary()
return type(self.expiry) == 'number'
end
function Protection:makeProtectionCategory()
local cfg = self._cfg
local title = self.title
-- Exit if the page is not protected.
if not self:isProtected() then
return ''
end
-- Get the expiry key fragment.
local expiryFragment
if self.expiry == 'indef' then
expiryFragment = self.expiry
elseif type(self.expiry) == 'number' then
expiryFragment = 'temp'
end
-- Get the namespace key fragment.
local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]
if not namespaceFragment and title.namespace % 2 == 1 then
namespaceFragment = 'talk'
end
-- Define the order that key fragments are tested in. This is done with an
-- array of tables containing the value to be tested, along with its
-- position in the cfg.protectionCategories table.
local order = {
{val = expiryFragment, keypos = 1},
{val = namespaceFragment, keypos = 2},
{val = self.reason, keypos = 3},
{val = self.level, keypos = 4},
{val = self.action, keypos = 5}
}
--[[
-- The old protection templates used an ad-hoc protection category system,
-- with some templates prioritising namespaces in their categories, and
-- others prioritising the protection reason. To emulate this in this module
-- we use the config table cfg.reasonsWithNamespacePriority to set the
-- reasons for which namespaces have priority over protection reason.
-- If we are dealing with one of those reasons, move the namespace table to
-- the end of the order table, i.e. give it highest priority. If not, the
-- reason should have highest priority, so move that to the end of the table
-- instead.
--]]
table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil &quot;value&quot;
-- fields) are moved to the end, where they will later be given the key
-- &quot;all&quot;. This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[
-- Check increasingly generic key combinations until we find a match. If a
-- specific category exists for the combination of key fragments we are
-- given, that match will be found first. If not, we keep trying different
-- key fragment combinations until we match using the key
-- &quot;all-all-all-all-all&quot;.
--
-- To generate the keys, we index the key subtables using a binary matrix
-- with indexes i and j. j is only calculated up to the number of active
-- subtables. For example, if there were three active subtables, the matrix
-- would look like this, with 0 corresponding to the key fragment &quot;all&quot;, and
-- 1 corresponding to other key fragments.
--
-- j 1 2 3
-- i
-- 1 1 1 1
-- 2 0 1 1
-- 3 1 0 1
-- 4 0 0 1
-- 5 1 1 0
-- 6 0 1 0
-- 7 1 0 0
-- 8 0 0 0
--
-- Values of j higher than the number of active subtables are set
-- to the string &quot;all&quot;.
--
-- A key for cfg.protectionCategories is constructed for each value of i.
-- The position of the value in the key is determined by the keypos field in
-- each subtable.
--]]
local cats = cfg.protectionCategories
for i = 1, 2^noActive do
local key = {}
for j, t in ipairs(attemptOrder) do
if j &gt; noActive then
key[t.keypos] = 'all'
else
local quotient = i / 2 ^ (j - 1)
quotient = math.ceil(quotient)
if quotient % 2 == 1 then
key[t.keypos] = t.val
else
key[t.keypos] = 'all'
end
end
end
key = table.concat(key, '|')
local attempt = cats[key]
if attempt then
return makeCategoryLink(attempt, title.text)
end
end
return ''
end
function Protection:isIncorrect()
local expiry = self.expiry
return not self:isProtected()
or type(expiry) == 'number' and expiry &lt; os.time()
end
function Protection:isTemplateProtectedNonTemplate()
local action, namespace = self.action, self.title.namespace
return self.level == 'templateeditor'
and (
(action ~= 'edit' and action ~= 'move')
or (namespace ~= 10 and namespace ~= 828)
)
end
function Protection:makeCategoryLinks()
local msg = self._cfg.msg
local ret = { self:makeProtectionCategory() }
if self:isIncorrect() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-incorrect'],
self.title.text
)
end
if self:isTemplateProtectedNonTemplate() then
ret[#ret + 1] = makeCategoryLink(
msg['tracking-category-template'],
self.title.text
)
end
return table.concat(ret)
end
--------------------------------------------------------------------------------
-- Blurb class
--------------------------------------------------------------------------------
local Blurb = {}
Blurb.__index = Blurb
Blurb.bannerTextFields = {
text = true,
explanation = true,
tooltip = true,
alt = true,
link = true
}
function Blurb.new(protectionObj, args, cfg)
return setmetatable({
_cfg = cfg,
_protectionObj = protectionObj,
_args = args
}, Blurb)
end
-- Private methods --
function Blurb:_formatDate(num)
-- Formats a Unix timestamp into dd Month, YYYY format.
lang = lang or mw.language.getContentLanguage()
local success, date = pcall(
lang.formatDate,
lang,
self._cfg.msg['expiry-date-format'] or 'j F Y',
'@' .. tostring(num)
)
if success then
return date
end
end
function Blurb:_getExpandedMessage(msgKey)
return self:_substituteParameters(self._cfg.msg[msgKey])
end
function Blurb:_substituteParameters(msg)
if not self._params then
local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter
parameterFuncs.EDITREQUEST = self._makeEditRequestParameter
parameterFuncs.EXPIRY = self._makeExpiryParameter
parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter
parameterFuncs.IMAGELINK = self._makeImageLinkParameter
parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter
parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter
parameterFuncs.PAGETYPE = self._makePagetypeParameter
parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter
parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter
parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter
parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter
parameterFuncs.TALKPAGE = self._makeTalkPageParameter
parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter
parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter
parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, {
__index = function (t, k)
local param
if parameterFuncs[k] then
param = parameterFuncs[k](self)
end
param = param or ''
t[k] = param
return param
end
})
end
msg = msg:gsub('${(%u+)}', self._params)
return msg
end
function Blurb:_makeCurrentVersionParameter()
-- A link to the page history or the move log, depending on the kind of
-- protection.
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'move' then
-- We need the move log link.
return makeFullUrl(
'Special:Log',
{type = 'move', page = pagename},
self:_getExpandedMessage('current-version-move-display')
)
else
-- We need the history link.
return makeFullUrl(
pagename,
{action = 'history'},
self:_getExpandedMessage('current-version-edit-display')
)
end
end
function Blurb:_makeEditRequestParameter()
local mEditRequest = require('Module:Submit an edit request')
local action = self._protectionObj.action
local level = self._protectionObj.level
-- Get the edit request type.
local requestType
if action == 'edit' then
if level == 'autoconfirmed' then
requestType = 'semi'
elseif level == 'extendedconfirmed' then
requestType = 'extended'
elseif level == 'templateeditor' then
requestType = 'template'
end
end
requestType = requestType or 'full'
-- Get the display value.
local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display}
end
function Blurb:_makeExpiryParameter()
local expiry = self._protectionObj.expiry
if type(expiry) == 'number' then
return self:_formatDate(expiry)
else
return expiry
end
end
function Blurb:_makeExplanationBlurbParameter()
-- Cover special cases first.
if self._protectionObj.title.namespace == 8 then
-- MediaWiki namespace
return self:_getExpandedMessage('explanation-blurb-nounprotect')
end
-- Get explanation blurb table keys
local action = self._protectionObj.action
local level = self._protectionObj.level
local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any
-- parameters.
local explanations = self._cfg.explanationBlurbs
local msg
if explanations[action][level] and explanations[action][level][talkKey] then
msg = explanations[action][level][talkKey]
elseif explanations[action][level] and explanations[action][level].default then
msg = explanations[action][level].default
elseif explanations[action].default and explanations[action].default[talkKey] then
msg = explanations[action].default[talkKey]
elseif explanations[action].default and explanations[action].default.default then
msg = explanations[action].default.default
else
error(string.format(
'could not find explanation blurb for action &quot;%s&quot;, level &quot;%s&quot; and talk key &quot;%s&quot;',
action,
level,
talkKey
), 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeImageLinkParameter()
local imageLinks = self._cfg.imageLinks
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if imageLinks[action][level] then
msg = imageLinks[action][level]
elseif imageLinks[action].default then
msg = imageLinks[action].default
else
msg = imageLinks.edit.default
end
return self:_substituteParameters(msg)
end
function Blurb:_makeIntroBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-blurb-expiry')
else
return self:_getExpandedMessage('intro-blurb-noexpiry')
end
end
function Blurb:_makeIntroFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('intro-fragment-expiry')
else
return self:_getExpandedMessage('intro-fragment-noexpiry')
end
end
function Blurb:_makePagetypeParameter()
local pagetypes = self._cfg.pagetypes
return pagetypes[self._protectionObj.title.namespace]
or pagetypes.default
or error('no default pagetype defined', 8)
end
function Blurb:_makeProtectionBlurbParameter()
local protectionBlurbs = self._cfg.protectionBlurbs
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionBlurbs[action][level] then
msg = protectionBlurbs[action][level]
elseif protectionBlurbs[action].default then
msg = protectionBlurbs[action].default
elseif protectionBlurbs.edit.default then
msg = protectionBlurbs.edit.default
else
error('no protection blurb defined for protectionBlurbs.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionDateParameter()
local protectionDate = self._protectionObj.protectionDate
if type(protectionDate) == 'number' then
return self:_formatDate(protectionDate)
else
return protectionDate
end
end
function Blurb:_makeProtectionLevelParameter()
local protectionLevels = self._cfg.protectionLevels
local action = self._protectionObj.action
local level = self._protectionObj.level
local msg
if protectionLevels[action][level] then
msg = protectionLevels[action][level]
elseif protectionLevels[action].default then
msg = protectionLevels[action].default
elseif protectionLevels.edit.default then
msg = protectionLevels.edit.default
else
error('no protection level defined for protectionLevels.edit.default', 8)
end
return self:_substituteParameters(msg)
end
function Blurb:_makeProtectionLogParameter()
local pagename = self._protectionObj.title.prefixedText
if self._protectionObj.action == 'autoreview' then
-- We need the pending changes log.
return makeFullUrl(
'Special:Log',
{type = 'stable', page = pagename},
self:_getExpandedMessage('pc-log-display')
)
else
-- We need the protection log.
return makeFullUrl(
'Special:Log',
{type = 'protect', page = pagename},
self:_getExpandedMessage('protection-log-display')
)
end
end
function Blurb:_makeTalkPageParameter()
return string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[self._protectionObj.title.namespace].talk.name,
self._protectionObj.title.text,
self._args.section or 'top',
self:_getExpandedMessage('talk-page-link-display')
)
end
function Blurb:_makeTooltipBlurbParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-blurb-expiry')
else
return self:_getExpandedMessage('tooltip-blurb-noexpiry')
end
end
function Blurb:_makeTooltipFragmentParameter()
if self._protectionObj:isTemporary() then
return self:_getExpandedMessage('tooltip-fragment-expiry')
else
return self:_getExpandedMessage('tooltip-fragment-noexpiry')
end
end
function Blurb:_makeVandalTemplateParameter()
return require('Module:Vandal-m')._main{
self._args.user or self._protectionObj.title.baseText
}
end
-- Public methods --
function Blurb:makeBannerText(key)
-- Validate input.
if not key or not Blurb.bannerTextFields[key] then
error(string.format(
'&quot;%s&quot; is not a valid banner config field',
tostring(key)
), 2)
end
-- Generate the text.
local msg = self._protectionObj.bannerConfig[key]
if type(msg) == 'string' then
return self:_substituteParameters(msg)
elseif type(msg) == 'function' then
msg = msg(self._protectionObj, self._args)
if type(msg) ~= 'string' then
error(string.format(
'bad output from banner config function with key &quot;%s&quot;'
.. ' (expected string, got %s)',
tostring(key),
type(msg)
), 4)
end
return self:_substituteParameters(msg)
end
end
--------------------------------------------------------------------------------
-- BannerTemplate class
--------------------------------------------------------------------------------
local BannerTemplate = {}
BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg)
local obj = {}
obj._cfg = cfg
-- Set the image filename.
local imageFilename = protectionObj.bannerConfig.image
if imageFilename then
obj._imageFilename = imageFilename
else
-- If an image filename isn't specified explicitly in the banner config,
-- generate it from the protection status and the namespace.
local action = protectionObj.action
local level = protectionObj.level
local namespace = protectionObj.title.namespace
local reason = protectionObj.reason
-- Deal with special cases first.
if (
namespace == 10
or namespace == 828
or reason and obj._cfg.indefImageReasons[reason]
)
and action == 'edit'
and level == 'sysop'
and not protectionObj:isTemporary()
then
-- Fully protected modules and templates get the special red &quot;indef&quot;
-- padlock.
obj._imageFilename = obj._cfg.msg['image-filename-indef']
else
-- Deal with regular protection types.
local images = obj._cfg.images
if images[action] then
if images[action][level] then
obj._imageFilename = images[action][level]
elseif images[action].default then
obj._imageFilename = images[action].default
end
end
end
end
return setmetatable(obj, BannerTemplate)
end
function BannerTemplate:renderImage()
local filename = self._imageFilename
or self._cfg.msg['image-filename-default']
or 'Transparent.gif'
return makeFileLink{
file = filename,
size = (self.imageWidth or 20) .. 'px',
alt = self._imageAlt,
link = self._imageLink,
caption = self.imageCaption
}
end
--------------------------------------------------------------------------------
-- Banner class
--------------------------------------------------------------------------------
local Banner = setmetatable({}, BannerTemplate)
Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 40
obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.
obj._reasonText = blurbObj:makeBannerText('text')
obj._explanationText = blurbObj:makeBannerText('explanation')
obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.
return setmetatable(obj, Banner)
end
function Banner:__tostring()
-- Renders the banner.
makeMessageBox = makeMessageBox or require('Module:Message box').main
local reasonText = self._reasonText or error('no reason text set', 2)
local explanationText = self._explanationText
local mbargs = {
page = self._page,
type = 'protection',
image = self:renderImage(),
text = string.format(
&quot;'''%s'''%s&quot;,
reasonText,
explanationText and '&lt;br /&gt;' .. explanationText or ''
)
}
return makeMessageBox('mbox', mbargs)
end
--------------------------------------------------------------------------------
-- Padlock class
--------------------------------------------------------------------------------
local Padlock = setmetatable({}, BannerTemplate)
Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg)
local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.
obj.imageWidth = 20
obj.imageCaption = blurbObj:makeBannerText('tooltip')
obj._imageAlt = blurbObj:makeBannerText('alt')
obj._imageLink = blurbObj:makeBannerText('link')
obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]
or cfg.padlockIndicatorNames.default
or 'pp-default'
return setmetatable(obj, Padlock)
end
function Padlock:__tostring()
local frame = mw.getCurrentFrame()
-- The nowiki tag helps prevent whitespace at the top of articles.
return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{
name = 'indicator',
args = {name = self._indicatorName},
content = self:renderImage()
}
end
--------------------------------------------------------------------------------
-- Exports
--------------------------------------------------------------------------------
local p = {}
function p._exportClasses()
-- This is used for testing purposes.
return {
Protection = Protection,
Blurb = Blurb,
BannerTemplate = BannerTemplate,
Banner = Banner,
Padlock = Padlock,
}
end
function p._main(args, cfg, title)
args = args or {}
cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its
-- protection from some other action, then don't bother displaying anything
-- for the other action (except categories).
if protectionObj.action == 'edit' or
args.demolevel or
not getReachableNodes(
cfg.hierarchy,
protectionObj.level
)[effectiveProtectionLevel('edit', protectionObj.title)]
then
-- Initialise the blurb object
local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner
if protectionObj:isProtected() then
ret[#ret + 1] = tostring(
(yesno(args.small) and Padlock or Banner)
.new(protectionObj, blurbObj, cfg)
)
end
end
-- Render the categories
if yesno(args.category) ~= false then
ret[#ret + 1] = protectionObj:makeCategoryLinks()
end
return table.concat(ret)
end
function p.main(frame, cfg)
cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any.
local parent = frame.getParent and frame:getParent()
local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]
-- Find user args, and use the parent frame if we are being called from a
-- wrapper template.
getArgs = getArgs or require('Module:Arguments').getArgs
local userArgs = getArgs(frame, {
parentOnly = defaultArgs,
frameOnly = not defaultArgs
})
-- Build the args table. User-specified args overwrite default args.
local args = {}
for k, v in pairs(defaultArgs or {}) do
args[k] = v
end
for k, v in pairs(userArgs) do
args[k] = v
end
return p._main(args, cfg)
end
return p</text>
<sha1>ice162y8kua930ie41kredxjaxhzy3y</sha1>
</revision>
</page>
<page>
<title>Module:Protection banner/config</title>
<ns>828</ns>
<id>42982788</id>
<revision>
<id>822561967</id>
<parentid>819333371</parentid>
<timestamp>2018-01-27T02:46:16Z</timestamp>
<contributor>
<username>BrownHairedGirl</username>
<id>754619</id>
</contributor>
<comment>protectionCategories = { ['all|all|all|all|all'] = 'Wikipedia fully protected pages', // per [[Wikipedia:Categories_for_discussion/Log/2018_January_5#Category:Wikipedia_protected_pages]]</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="46794">-- This module provides configuration data for [[Module:Protection banner]].
return {
--------------------------------------------------------------------------------
--
-- BANNER DATA
--
--------------------------------------------------------------------------------
--[[
-- Banner data consists of six fields:
-- * text - the main protection text that appears at the top of protection
-- banners.
-- * explanation - the text that appears below the main protection text, used
-- to explain the details of the protection.
-- * tooltip - the tooltip text you see when you move the mouse over a small
-- padlock icon.
-- * link - the page that the small padlock icon links to.
-- * alt - the alt text for the small padlock icon. This is also used as tooltip
-- text for the large protection banners.
-- * image - the padlock image used in both protection banners and small padlock
-- icons.
--
-- The module checks in three separate tables to find a value for each field.
-- First it checks the banners table, which has values specific to the reason
-- for the page being protected. Then the module checks the defaultBanners
-- table, which has values specific to each protection level. Finally, the
-- module checks the masterBanner table, which holds data for protection
-- templates to use if no data has been found in the previous two tables.
--
-- The values in the banner data can take parameters. These are specified
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name
-- enclosed in curly braces).
--
-- Available parameters:
--
-- ${CURRENTVERSION} - a link to the page history or the move log, with the
-- display message &quot;current-version-edit-display&quot; or
-- &quot;current-version-move-display&quot;.
--
-- ${EDITREQUEST} - a link to create an edit request for the current page.
--
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. &quot;Please discuss any changes
-- on the talk page; you may submit a request to ask an administrator to make
-- an edit if it is minor or supported by consensus.&quot;
--
-- ${IMAGELINK} - a link to set the image to, depending on the protection
-- action and protection level.
--
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry
-- is set. E.g. &quot;Editing of this page by new or unregistered users is currently
-- disabled until dd Month YYYY.&quot;
--
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation
-- so that it can be used in run-on sentences.
--
-- ${PAGETYPE} - the type of the page, e.g. &quot;article&quot; or &quot;template&quot;.
-- Defined in the cfg.pagetypes table.
--
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.
-- &quot;Editing of this page by new or unregistered users is currently disabled&quot;
--
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the
-- template.
--
-- ${PROTECTIONLEVEL} - the protection level, e.g. &quot;fully protected&quot; or
-- &quot;semi-protected&quot;.
--
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,
-- depending on the protection action.
--
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links
-- straight to that talk page section.
--
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to
-- create a blurb like &quot;This template is semi-protected&quot;, or &quot;This article is
-- move-protected until DD Month YYYY&quot;.
--
-- ${VANDAL} - links for the specified username (or the root page name)
-- using Module:Vandal-m.
--
-- Functions
--
-- For advanced users, it is possible to use Lua functions instead of strings
-- in the banner config tables. Using functions gives flexibility that is not
-- possible just by using parameters. Functions take two arguments, the
-- protection object and the template arguments, and they must output a string.
--
-- For example:
--
-- text = function (protectionObj, args)
-- if protectionObj.level == 'autoconfirmed' then
-- return 'foo'
-- else
-- return 'bar'
-- end
-- end
--
-- Some protection object properties and methods that may be useful:
-- protectionObj.action - the protection action
-- protectionObj.level - the protection level
-- protectionObj.reason - the protection reason
-- protectionObj.expiry - the expiry. Nil if unset, the string &quot;indef&quot; if set
-- to indefinite, and the protection time in unix time if temporary.
-- protectionObj.protectionDate - the protection date in unix time, or nil if
-- unspecified.
-- protectionObj.bannerConfig - the banner config found by the module. Beware
-- of editing the config field used by the function, as it could create an
-- infinite loop.
-- protectionObj:isProtected - returns a boolean showing whether the page is
-- protected.
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is
-- temporary.
-- protectionObj:isIncorrect - returns a boolean showing whether the protection
-- template is incorrect.
--]]
-- The master banner data, used if no values have been found in banners or
-- defaultBanners.
masterBanner = {
text = '${INTROBLURB}',
explanation = '${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPBLURB}',
link = '${IMAGELINK}',
alt = 'Page ${PROTECTIONLEVEL}'
},
-- The default banner data. This holds banner data for different protection
-- levels.
-- *required* - this table needs edit, move, autoreview and upload subtables.
defaultBanners = {
edit = {},
move = {},
autoreview = {
autoconfirmed = {
alt = 'Page protected with pending changes level 1',
tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',
image = 'Padlock-silver-light.svg'
},
default = {
alt = 'Page protected with pending changes level 2',
tooltip = 'All edits by users who are not reviewers or administrators are'
.. ' subject to review prior to becoming visible to unregistered users',
image = 'Padlock-orange.svg'
}
},
upload = {}
},
-- The banner data. This holds banner data for different protection reasons.
-- In fact, the reasons specified in this table control which reasons are
-- valid inputs to the first positional parameter.
--
-- There is also a non-standard &quot;description&quot; field that can be used for items
-- in this table. This is a description of the protection reason for use in the
-- module documentation.
--
-- *required* - this table needs edit, move, autoreview and upload subtables.
banners = {
edit = {
blp = {
description = 'For pages protected to promote compliance with the'
.. ' [[Wikipedia:Biographies of living persons'
.. '|biographies of living persons]] policy',
text = '${INTROFRAGMENT} to promote compliance with'
.. ' [[Wikipedia:Biographies of living persons'
.. &quot;|Wikipedia's&amp;nbsp;policy on&amp;nbsp;the&amp;nbsp;biographies&quot;
.. ' of&amp;nbsp;living&amp;nbsp;people]].',
tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'
.. ' biographies of living people',
},
dmca = {
description = 'For pages protected by the Wikimedia Foundation'
.. ' due to [[Digital Millennium Copyright Act]] takedown requests',
explanation = function (protectionObj, args)
local ret = 'Pursuant to a rights owner notice under the Digital'
.. ' Millennium Copyright Act (DMCA) regarding some content'
.. ' in this article, the Wikimedia Foundation acted under'
.. ' applicable law and took down and restricted the content'
.. ' in question.'
if args.notice then
ret = ret .. ' A copy of the received notice can be found here: '
.. args.notice .. '.'
end
ret = ret .. ' For more information, including websites discussing'
.. ' how to file a counter-notice, please see'
.. &quot; [[Wikipedia:Office actions]] and the article's ${TALKPAGE}.&quot;
.. &quot;'''Do not remove this template from the article until the&quot;
.. &quot; restrictions are withdrawn'''.&quot;
return ret
end,
image = 'Padlock-black.svg',
},
dispute = {
description = 'For pages protected due to editing disputes',
text = function (protectionObj, args)
-- Find the value of &quot;disputes&quot;.
local display = 'disputes'
local disputes
if args.section then
disputes = string.format(
'[[%s:%s#%s|%s]]',
mw.site.namespaces[protectionObj.title.namespace].talk.name,
protectionObj.title.text,
args.section,
display
)
else
disputes = display
end
-- Make the blurb, depending on the expiry.
local msg
if type(protectionObj.expiry) == 'number' then
msg = '${INTROFRAGMENT} or until editing %s have been resolved.'
else
msg = '${INTROFRAGMENT} until editing %s have been resolved.'
end
return string.format(msg, disputes)
end,
explanation = &quot;This protection is '''not''' an endorsement of the&quot;
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',
},
ecp = {
description = 'For articles in topic areas authorized by'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'
.. ' meets the criteria for community use',
tooltip = 'This ${PAGETYPE} is extended-confirmed protected',
alt = 'Extended-protected ${PAGETYPE}',
},
mainpage = {
description = 'For pages protected for being displayed on the [[Main Page]]',
text = 'This file is currently'
.. ' [[Wikipedia:This page is protected|protected]] from'
.. ' editing because it is currently or will soon be displayed'
.. ' on the [[Main Page]].',
explanation = 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'
.. '&lt;br /&gt;&lt;span style=&quot;font-size:90%;&quot;&gt;'
.. &quot;'''Administrators:''' Once this image is definitely off the Main Page,&quot;
.. ' please unprotect this file, or reduce to semi-protection,'
.. ' as appropriate.&lt;/span&gt;',
},
office = {
description = 'For pages protected by the Wikimedia Foundation',
text = function (protectionObj, args)
local ret = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.'
if protectionObj.protectionDate then
ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'
end
return ret
end,
explanation = &quot;If you can edit this page, please discuss all changes and&quot;
.. &quot; additions on the ${TALKPAGE} first. '''Do not remove protection from this&quot;
.. &quot; page unless you are authorized by the Wikimedia Foundation to do&quot;
.. &quot; so.'''&quot;,
image = 'Padlock-black.svg',
},
reset = {
description = 'For pages protected by the Wikimedia Foundation and'
.. ' &quot;reset&quot; to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the'
.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'
.. ' and is protected.',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.protectionDate then
ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'
else
ret = ret .. 'This ${PAGETYPE} has been'
end
ret = ret .. ' reduced to a'
.. ' simplified, &quot;bare bones&quot; version so that it may be completely'
.. ' rewritten to ensure it meets the policies of'
.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'
.. ' Standard Wikipedia policies will apply to its rewriting—which'
.. ' will eventually be open to all editors—and will be strictly'
.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'
.. ' it is being rebuilt.\n\n'
.. 'Any insertion of material directly from'
.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'
.. ' will any material added to the ${PAGETYPE} that is not properly'
.. ' sourced. The associated talk page(s) were also cleared on the'
.. &quot; same date.\n\n&quot;
.. &quot;If you can edit this page, please discuss all changes and&quot;
.. &quot; additions on the ${TALKPAGE} first. '''Do not override&quot;
.. &quot; this action, and do not remove protection from this page,&quot;
.. &quot; unless you are authorized by the Wikimedia Foundation&quot;
.. &quot; to do so. No editor may remove this notice.'''&quot;
return ret
end,
image = 'Padlock-black.svg',
},
sock = {
description = 'For pages protected due to'
.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',
text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'
.. ' [[Wikipedia:Blocking policy|blocked]] or'
.. ' [[Wikipedia:Banning policy|banned users]]'
.. ' from editing it.',
tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'
.. ' editing it',
},
template = {
description = 'For [[Wikipedia:High-risk templates|high-risk]]'
.. ' templates and Lua modules',
text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'
.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',
explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] or'
.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'
.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by'
.. ' [[Wikipedia:Consensus|consensus]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'
.. ' to prevent vandalism',
alt = 'Permanently protected ${PAGETYPE}',
},
usertalk = {
description = 'For pages protected against disruptive edits by a'
.. ' particular user',
text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'
.. ' such as abusing the'
.. ' &amp;#123;&amp;#123;[[Template:unblock|unblock]]&amp;#125;&amp;#125; template.',
explanation = 'If you cannot edit this user talk page and you need to'
.. ' make a change or leave a message, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for edits to a protected page'
.. '|request an edit]],'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]],'
.. ' [[Special:Userlogin|log in]],'
.. ' or [[Special:UserLogin/signup|create an account]].',
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism|vandalism]]',
text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',
explanation = function (protectionObj, args)
local ret = ''
if protectionObj.level == 'sysop' then
ret = ret .. &quot;This protection is '''not''' an endorsement of the&quot;
.. ' ${CURRENTVERSION}. '
end
return ret .. '${EXPLANATIONBLURB}'
end,
tooltip = '${TOOLTIPFRAGMENT} due to vandalism',
}
},
move = {
dispute = {
description = 'For pages protected against page moves due to'
.. ' disputes over the page title',
explanation = &quot;This protection is '''not''' an endorsement of the&quot;
.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',
image = 'Padlock-olive.svg'
},
vandalism = {
description = 'For pages protected against'
.. ' [[Wikipedia:Vandalism#Page-move vandalism'
.. ' |page-move vandalism]]'
}
},
autoreview = {},
upload = {}
},
--------------------------------------------------------------------------------
--
-- GENERAL DATA TABLES
--
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- Protection blurbs
--------------------------------------------------------------------------------
-- This table produces the protection blurbs available with the
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and
-- protection level, and is checked by the module in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. &quot;edit&quot; protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionBlurbs = {
edit = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|'
.. 'protected]] from editing',
autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'
.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'
.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',
extendedconfirmed = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} as a result of'
.. ' [[Wikipedia:Arbitration Committee|ArbCom]] enforcement or meets the'
.. ' [[Wikipedia:Protection policy#extended|criteria for community use]]',
},
move = {
default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'
.. ' from [[Help:Moving a page|page moves]]'
},
autoreview = {
autoconfirmed = 'All edits made to this ${PAGETYPE} by'
.. ' [[Wikipedia:User access levels#New users|new]] or'
.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'
.. ' users are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]',
default = 'All edits made to this ${PAGETYPE} by users who are not'
.. ' [[Wikipedia:Reviewing|reviewers]] or'
.. ' [[Wikipedia:Administrators|administrators]] are currently'
.. ' [[Wikipedia:Pending changes|subject to review]]'
},
upload = {
default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'
}
},
--------------------------------------------------------------------------------
-- Explanation blurbs
--------------------------------------------------------------------------------
-- This table produces the explanation blurbs available with the
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,
-- protection level, and whether the page is a talk page or not. If the page is
-- a talk page it will have a talk key of &quot;talk&quot;; otherwise it will have a talk
-- key of &quot;subject&quot;. The table is checked in the following order:
-- 1. page's protection action, page's protection level, page's talk key
-- 2. page's protection action, page's protection level, default talk key
-- 3. page's protection action, default protection level, page's talk key
-- 4. page's protection action, default protection level, default talk key
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
explanationBlurbs = {
edit = {
autoconfirmed = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'
.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].',
},
extendedconfirmed = {
default = 'Extended confirmed protection prevents edits from all IP editors'
.. ' and registered users with fewer than 30 days tenure and 500 edits.'
.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'
.. ' specifies that extended confirmed protection can be applied to combat'
.. ' disruption, given that semi-protection has proven to be ineffective.'
.. ' Please discuss any changes on the ${TALKPAGE}; you may'
.. ' ${EDITREQUEST} to ask for unconversial changes supported by'
.. ' [[Wikipedia:Consensus|consensus]].'
},
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]]. You may also [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|request]] that this page be unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' You may [[Wikipedia:Requests for page'
.. ' protection#Current requests for edits to a protected page|request an'
.. ' edit]] to this page, or [[Wikipedia:Requests for'
.. ' page protection#Current requests for reduction in protection level'
.. '|ask]] for it to be unprotected.'
}
},
move = {
default = {
subject = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves on the'
.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but cannot be moved'
.. ' until unprotected. Please discuss any suggested moves at'
.. ' [[Wikipedia:Requested moves]]. You can also'
.. ' [[Wikipedia:Requests for page protection|request]] that the page be'
.. ' unprotected.'
}
},
autoreview = {
default = {
reviewer = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} will not be visible to readers'
.. ' until they are accepted by a reviewer or an administrator.'
.. ' To avoid the need for your edits to be reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]]. Experienced editors may also'
.. ' request the [[Wikipedia:Reviewing|reviewer user right]].',
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Edits to this ${PAGETYPE} by new and unregistered users'
.. ' will not be visible to readers until they are accepted by'
.. ' a reviewer. To avoid the need for your edits to be'
.. ' reviewed, you may'
.. ' [[Wikipedia:Requests for page protection'
.. '#Current requests for reduction in protection level'
.. '|request unprotection]], [[Special:Userlogin|log in]], or'
.. ' [[Special:UserLogin/signup|create an account]].'
},
},
upload = {
default = {
default = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' The page may still be edited but new versions of the file'
.. ' cannot be uploaded until it is unprotected. You can'
.. ' request that a new version be uploaded by using a'
.. ' [[Wikipedia:Edit requests|protected edit request]], or you'
.. ' can [[Wikipedia:Requests for page protection|request]]'
.. ' that the file be unprotected.'
}
}
},
--------------------------------------------------------------------------------
-- Protection levels
--------------------------------------------------------------------------------
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which
-- produces a short label for different protection levels. It is sorted by
-- protection action and protection level, and is checked in the following
-- order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. &quot;edit&quot; protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
protectionLevels = {
edit = {
default = 'protected',
templateeditor = 'template-protected',
extendedconfirmed = 'extended-protected',
autoconfirmed = 'semi-protected',
},
move = {
default = 'move-protected'
},
autoreview = {
},
upload = {
default = 'upload-protected'
}
},
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- This table lists different padlock images for each protection action and
-- protection level. It is used if an image is not specified in any of the
-- banner data tables, and if the page does not satisfy the conditions for using
-- the ['image-filename-indef'] image. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
images = {
edit = {
default = 'Padlock.svg',
templateeditor = 'Padlock-pink.svg',
extendedconfirmed = 'Padlock-blue.svg',
autoconfirmed = 'Padlock-silver.svg'
},
move = {
default = 'Padlock-olive.svg',
},
autoreview = {
autoconfirmed = 'Padlock-silver-light.svg',
default = 'Padlock-orange.svg'
},
upload = {
default = 'Padlock-purple.svg'
}
},
-- Pages with a reason specified in this table will show the special &quot;indef&quot;
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.
indefImageReasons = {
template = true
},
--------------------------------------------------------------------------------
-- Image links
--------------------------------------------------------------------------------
-- This table provides the data for the ${IMAGELINK} parameter, which gets
-- the image link for small padlock icons based on the page's protection action
-- and protection level. It is checked in the following order:
-- 1. page's protection action, page's protection level
-- 2. page's protection action, default protection level
-- 3. &quot;edit&quot; protection action, default protection level
--
-- It is possible to use banner parameters inside this table.
-- *required* - this table needs edit, move, autoreview and upload subtables.
imageLinks = {
edit = {
default = 'Wikipedia:Protection policy#full',
templateeditor = 'Wikipedia:Protection policy#template',
extendedconfirmed = 'Wikipedia:Protection policy#extended',
autoconfirmed = 'Wikipedia:Protection policy#semi'
},
move = {
default = 'Wikipedia:Protection policy#move'
},
autoreview = {
autoconfirmed = 'Wikipedia:Protection policy#pc1',
reviewer = 'Wikipedia:Protection policy#pc2'
},
upload = {
default = 'Wikipedia:Protection policy#upload'
}
},
--------------------------------------------------------------------------------
-- Padlock indicator names
--------------------------------------------------------------------------------
-- This table provides the &quot;name&quot; attribute for the &lt;indicator&gt; extension tag
-- with which small padlock icons are generated. All indicator tags on a page
-- are displayed in alphabetical order based on this attribute, and with
-- indicator tags with duplicate names, the last tag on the page wins.
-- The attribute is chosen based on the protection action; table keys must be a
-- protection action name or the string &quot;default&quot;.
padlockIndicatorNames = {
autoreview = 'pp-autoreview',
default = 'pp-default'
},
--------------------------------------------------------------------------------
-- Protection categories
--------------------------------------------------------------------------------
--[[
-- The protection categories are stored in the protectionCategories table.
-- Keys to this table are made up of the following strings:
--
-- 1. the expiry date
-- 2. the namespace
-- 3. the protection reason (e.g. &quot;dispute&quot; or &quot;vandalism&quot;)
-- 4. the protection level (e.g. &quot;sysop&quot; or &quot;autoconfirmed&quot;)
-- 5. the action (e.g. &quot;edit&quot; or &quot;move&quot;)
--
-- When the module looks up a category in the table, first it will will check to
-- see a key exists that corresponds to all five parameters. For example, a
-- user page semi-protected from vandalism for two weeks would have the key
-- &quot;temp-user-vandalism-autoconfirmed-edit&quot;. If no match is found, the module
-- changes the first part of the key to &quot;all&quot; and checks the table again. It
-- keeps checking increasingly generic key combinations until it finds the
-- field, or until it reaches the key &quot;all-all-all-all-all&quot;.
--
-- The module uses a binary matrix to determine the order in which to search.
-- This is best demonstrated by a table. In this table, the &quot;0&quot; values
-- represent &quot;all&quot;, and the &quot;1&quot; values represent the original data (e.g.
-- &quot;indef&quot; or &quot;file&quot; or &quot;vandalism&quot;).
--
-- expiry namespace reason level action
-- order
-- 1 1 1 1 1 1
-- 2 0 1 1 1 1
-- 3 1 0 1 1 1
-- 4 0 0 1 1 1
-- 5 1 1 0 1 1
-- 6 0 1 0 1 1
-- 7 1 0 0 1 1
-- 8 0 0 0 1 1
-- 9 1 1 1 0 1
-- 10 0 1 1 0 1
-- 11 1 0 1 0 1
-- 12 0 0 1 0 1
-- 13 1 1 0 0 1
-- 14 0 1 0 0 1
-- 15 1 0 0 0 1
-- 16 0 0 0 0 1
-- 17 1 1 1 1 0
-- 18 0 1 1 1 0
-- 19 1 0 1 1 0
-- 20 0 0 1 1 0
-- 21 1 1 0 1 0
-- 22 0 1 0 1 0
-- 23 1 0 0 1 0
-- 24 0 0 0 1 0
-- 25 1 1 1 0 0
-- 26 0 1 1 0 0
-- 27 1 0 1 0 0
-- 28 0 0 1 0 0
-- 29 1 1 0 0 0
-- 30 0 1 0 0 0
-- 31 1 0 0 0 0
-- 32 0 0 0 0 0
--
-- In this scheme the action has the highest priority, as it is the last
-- to change, and the expiry has the least priority, as it changes the most.
-- The priorities of the expiry, the protection level and the action are
-- fixed, but the priorities of the reason and the namespace can be swapped
-- through the use of the cfg.bannerDataNamespaceHasPriority table.
--]]
-- If the reason specified to the template is listed in this table,
-- namespace data will take priority over reason data in the protectionCategories
-- table.
reasonsWithNamespacePriority = {
vandalism = true,
},
-- The string to use as a namespace key for the protectionCategories table for each
-- namespace number.
categoryNamespaceKeys = {
[ 2] = 'user',
[ 3] = 'user',
[ 4] = 'project',
[ 6] = 'file',
[ 8] = 'mediawiki',
[ 10] = 'template',
[ 12] = 'project',
[ 14] = 'category',
[100] = 'portal',
[828] = 'module',
},
protectionCategories = {
['all|all|all|all|all'] = 'Wikipedia fully protected pages',
['all|all|office|all|all'] = 'Wikipedia Office-protected pages',
['all|all|reset|all|all'] = 'Wikipedia Office-protected pages',
['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages',
['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files',
['all|all|all|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction',
['all|template|all|all|edit'] = 'Wikipedia fully-protected templates',
['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages',
['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages',
['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people',
['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people',
['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute',
['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users',
['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',
['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories',
['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files',
['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals',
['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages',
['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages',
['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates',
['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages',
['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',
['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people',
['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people',
['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute',
['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users',
['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism',
['all|category|all|sysop|edit'] = 'Wikipedia protected categories',
['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files',
['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages',
['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages',
['all|template|all|sysop|edit'] = 'Wikipedia fully-protected templates',
['all|user|all|sysop|edit'] = 'Wikipedia protected user and user talk pages',
['all|module|all|all|edit'] = 'Wikipedia fully-protected modules',
['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules',
['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules',
['all|all|all|sysop|move'] = 'Wikipedia move-protected pages',
['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages',
['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute',
['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals',
['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages',
['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages',
['all|template|all|sysop|move'] = 'Wikipedia move-protected templates',
['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages',
['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',
['all|all|all|reviewer|autoreview'] = 'Wikipedia pending changes protected pages (level 2)',
['all|file|all|all|upload'] = 'Wikipedia upload-protected files',
},
--------------------------------------------------------------------------------
-- Expiry category config
--------------------------------------------------------------------------------
-- This table configures the expiry category behaviour for each protection
-- action.
-- * If set to true, setting that action will always categorise the page if
-- an expiry parameter is not set.
-- * If set to false, setting that action will never categorise the page.
-- * If set to nil, the module will categorise the page if:
-- 1) an expiry parameter is not set, and
-- 2) a reason is provided, and
-- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck
-- table.
expiryCheckActions = {
edit = nil,
move = false,
autoreview = true,
upload = false
},
reasonsWithoutExpiryCheck = {
blp = true,
template = true,
},
--------------------------------------------------------------------------------
-- Pagetypes
--------------------------------------------------------------------------------
-- This table produces the page types available with the ${PAGETYPE} parameter.
-- Keys are namespace numbers, or the string &quot;default&quot; for the default value.
pagetypes = {
[0] = 'article',
[6] = 'file',
[10] = 'template',
[14] = 'category',
[828] = 'module',
default = 'page'
},
--------------------------------------------------------------------------------
-- Strings marking indefinite protection
--------------------------------------------------------------------------------
-- This table contains values passed to the expiry parameter that mean the page
-- is protected indefinitely.
indefStrings = {
['indef'] = true,
['indefinite'] = true,
['indefinitely'] = true,
['infinite'] = true,
},
--------------------------------------------------------------------------------
-- Group hierarchy
--------------------------------------------------------------------------------
-- This table maps each group to all groups that have a superset of the original
-- group's page editing permissions.
hierarchy = {
sysop = {},
reviewer = {'sysop'},
filemover = {'sysop'},
templateeditor = {'sysop'},
extendedconfirmed = {'sysop'},
autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},
user = {'autoconfirmed'},
['*'] = {'user'}
},
--------------------------------------------------------------------------------
-- Wrapper templates and their default arguments
--------------------------------------------------------------------------------
-- This table contains wrapper templates used with the module, and their
-- default arguments. Templates specified in this table should contain the
-- following invocation, and no other template content:
--
-- {{#invoke:Protection banner|main}}
--
-- If other content is desired, it can be added between
-- &lt;noinclude&gt;...&lt;/noinclude&gt; tags.
--
-- When a user calls one of these wrapper templates, they will use the
-- default arguments automatically. However, users can override any of the
-- arguments.
wrappers = {
['Template:Pp'] = {},
['Template:Pp-30-500'] = {'ecp'},
['Template:Pp-blp'] = {'blp'},
-- we don't need Template:Pp-create
['Template:Pp-dispute'] = {'dispute'},
['Template:Pp-main-page'] = {'mainpage'},
['Template:Pp-move'] = {action = 'move'},
['Template:Pp-move-dispute'] = {'dispute', action = 'move'},
-- we don't need Template:Pp-move-indef
['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'},
['Template:Pp-office'] = {'office'},
['Template:Pp-office-dmca'] = {'dmca'},
['Template:Pp-pc1'] = {action = 'autoreview', small = true},
['Template:Pp-pc2'] = {action = 'autoreview', small = true},
['Template:Pp-reset'] = {'reset'},
['Template:Pp-semi-indef'] = {small = true},
['Template:Pp-sock'] = {'sock'},
['Template:Pp-template'] = {'template', small = true},
['Template:Pp-upload'] = {action = 'upload'},
['Template:Pp-usertalk'] = {'usertalk'},
['Template:Pp-vandalism'] = {'vandalism'},
},
--------------------------------------------------------------------------------
--
-- MESSAGES
--
--------------------------------------------------------------------------------
msg = {
--------------------------------------------------------------------------------
-- Intro blurb and intro fragment
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${INTROBLURB} and
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use
-- intro-blurb-noexpiry or intro-fragment-noexpiry.
-- It is possible to use banner parameters in these messages.
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
--------------------------------------------------------------------------------
-- Tooltip blurb
--------------------------------------------------------------------------------
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.
-- If the protection is temporary the tooltip-blurb-expiry message is used, and
-- if not the tooltip-blurb-noexpiry message is used.
-- It is possible to use banner parameters in these messages.
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
--------------------------------------------------------------------------------
-- Special explanation blurb
--------------------------------------------------------------------------------
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages
-- in the MediaWiki namespace.
-- It is possible to use banner parameters in this message.
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'
.. 'protection policy]] and ${PROTECTIONLOG} for more details.'
.. ' Please discuss any changes on the ${TALKPAGE}; you'
.. ' may ${EDITREQUEST} to ask an'
.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'
.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'
.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'
.. '|consensus]].',
--------------------------------------------------------------------------------
-- Protection log display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the protection log link
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.
-- It is possible to use banner parameters in these messages.
['protection-log-display'] = 'protection log',
['pc-log-display'] = 'pending changes log',
--------------------------------------------------------------------------------
-- Current version display values
--------------------------------------------------------------------------------
-- These messages determine the display values for the page history link
-- or the move log link produced by the ${CURRENTVERSION} parameter.
-- It is possible to use banner parameters in these messages.
['current-version-move-display'] = 'current title',
['current-version-edit-display'] = 'current version',
--------------------------------------------------------------------------------
-- Talk page
--------------------------------------------------------------------------------
-- This message determines the display value of the talk page link produced
-- with the ${TALKPAGE} parameter.
-- It is possible to use banner parameters in this message.
['talk-page-link-display'] = 'talk page',
--------------------------------------------------------------------------------
-- Edit requests
--------------------------------------------------------------------------------
-- This message determines the display value of the edit request link produced
-- with the ${EDITREQUEST} parameter.
-- It is possible to use banner parameters in this message.
['edit-request-display'] = 'submit an edit request',
--------------------------------------------------------------------------------
-- Expiry date format
--------------------------------------------------------------------------------
-- This is the format for the blurb expiry date. It should be valid input for
-- the first parameter of the #time parser function.
['expiry-date-format'] = 'F j, Y',
--------------------------------------------------------------------------------
-- Tracking categories
--------------------------------------------------------------------------------
-- These messages determine which tracking categories the module outputs.
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',
--------------------------------------------------------------------------------
-- Images
--------------------------------------------------------------------------------
-- These are images that are not defined by their protection action and protection level.
['image-filename-indef'] = 'Padlock.svg',
['image-filename-default'] = 'Transparent.gif',
--------------------------------------------------------------------------------
-- End messages
--------------------------------------------------------------------------------
}
--------------------------------------------------------------------------------
-- End configuration
--------------------------------------------------------------------------------
}</text>
<sha1>hhzqd28fj5olzin4eeygno4totrmfh7</sha1>
</revision>
</page>
<page>
<title>Module:Str endswith</title>
<ns>828</ns>
<id>52211643</id>
<revision>
<id>748257085</id>
<parentid>748249376</parentid>
<timestamp>2016-11-07T07:15:08Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<minor/>
<comment>Protected &quot;[[Module:Str endswith]]&quot;: [[WP:High-risk templates|High-risk Lua module]] ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="696">-- This module implements {{str endswith}}.
local TRUE_STRING = 'yes'
local FALSE_STRING = ''
local p = {}
local function trim(s)
return s:match('^%s*(.-)%s*$')
end
function p.main(frame)
local args = frame:getParent().args
local s = args[1]
local pattern = args[2]
if not s or not pattern then
-- TRUE_STRING is not the natural choice here, but is needed for
-- backwards compatibility.
return TRUE_STRING
end
s = trim(s)
pattern = trim(pattern)
if pattern == '' then
-- All strings end with the empty string.
return TRUE_STRING
end
if mw.ustring.sub(s, 0 - mw.ustring.len(pattern), -1) == pattern then
return TRUE_STRING
else
return FALSE_STRING
end
end
return p</text>
<sha1>7qezfyb967v2otj07a1m98bmibg4z2x</sha1>
</revision>
</page>
<page>
<title>Module:String</title>
<ns>828</ns>
<id>38569505</id>
<revision>
<id>552254999</id>
<parentid>540627185</parentid>
<timestamp>2013-04-26T10:52:01Z</timestamp>
<contributor>
<username>Mr. Stradivarius</username>
<id>4708675</id>
</contributor>
<comment>Add &quot;rep&quot; function per request by [[User:קיפודנחש]] at [[Wikipedia:Lua requests#Template:Loop and Template:Loop15]]. Copied from sandbox.</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="15731">--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters,
unnamed parameters, or a mixture. If named parameters are used, Mediawiki will
automatically remove any leading or trailing whitespace from the parameter.
Depending on the intended use, it may be advantageous to either preserve or
remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in
an empty string being returned rather than an error message.
error_category: If an error occurs, specifies the name of a category to
include with the error message. The default category is
[Category:Errors reported by Module String].
no_category: If set to 'true' or 1, no category will be added if an error
is generated.
Unit tests for this module are available at Module:String/tests.
]]
local str = {}
--[[
len
This function returns the length of the target string.
Usage:
{{#invoke:String|len|target_string|}}
OR
{{#invoke:String|len|s=target_string}}
Parameters
s: The string whose length to report
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string.
]]
function str.len( frame )
local new_args = str._getParameters( frame.args, {'s'} );
local s = new_args['s'] or '';
return mw.ustring.len( s )
end
--[[
sub
This function returns a substring of the target string at specified indices.
Usage:
{{#invoke:String|sub|target_string|start_index|end_index}}
OR
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}
Parameters
s: The string to return a subset of
i: The fist index of the substring to return, defaults to 1.
j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j
is a negative value, it is interpreted the same as selecting a character by
counting from the end of the string. Hence, a value of -1 is the same as
selecting the last character of the string.
If the requested indices are out of range for the given string, an error is
reported.
]]
function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } );
local s = new_args['s'] or '';
local i = tonumber( new_args['i'] ) or 1;
local j = tonumber( new_args['j'] ) or -1;
local len = mw.ustring.len( s );
-- Convert negatives for range checking
if i &lt; 0 then
i = len + i + 1;
end
if j &lt; 0 then
j = len + j + 1;
end
if i &gt; len or j &gt; len or i &lt; 1 or j &lt; 1 then
return str._error( 'String subset index out of range' );
end
if j &lt; i then
return str._error( 'String subset indices out of order' );
end
return mw.ustring.sub( s, i, j )
end
--[[
This function implements that features of {{str sub old}} and is kept in order
to maintain these older templates.
]]
function str.sublength( frame )
local i = tonumber( frame.args.i ) or 0
local len = tonumber( frame.args.len )
return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )
end
--[[
match
This function returns a substring from the source string that matches a
specified pattern.
Usage:
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}
OR
{{#invoke:String|pos|s=source_string|pattern=pattern_string|start=start_index
|match=match_number|plain=plain_flag|nomatch=nomatch_output}}
Parameters
s: The string to search
pattern: The pattern or string to find within the string
start: The index within the source string to start the search. The first
character of the string has index 1. Defaults to 1.
match: In some cases it may be possible to make multiple matches on a single
string. This specifies which match to return, where the first match is
match= 1. If a negative number is specified then a match is returned
counting from the last match. Hence match = -1 is the same as requesting
the last match. Defaults to 1.
plain: A flag indicating that the pattern should be understood as plain
text. Defaults to false.
nomatch: If no match is found, output the &quot;nomatch&quot; value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from each string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then
this function generates an error. An error is also generated if no match is found.
If one adds the parameter ignore_errors=true, then the error will be suppressed and
an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
* http://www.lua.org/manual/5.1/manual.html#5.4.1
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]]
function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} );
local s = new_args['s'] or '';
local start = tonumber( new_args['start'] ) or 1;
local plain_flag = str._getBoolean( new_args['plain'] or false );
local pattern = new_args['pattern'] or '';
local match_index = math.floor( tonumber(new_args['match']) or 1 );
local nomatch = new_args['nomatch'];
if s == '' then
return str._error( 'Target string is empty' );
end
if pattern == '' then
return str._error( 'Pattern string is empty' );
end
if math.abs(start) &lt; 1 or math.abs(start) &gt; mw.ustring.len( s ) then
return str._error( 'Requested start is out of range' );
end
if match_index == 0 then
return str._error( 'Match index is out of range' );
end
if plain_flag then
pattern = str._escapePattern( pattern );
end
local result
if match_index == 1 then
-- Find first match is simple case
result = mw.ustring.match( s, pattern, start )
else
if start &gt; 1 then
s = mw.ustring.sub( s, start );
end
local iterator = mw.ustring.gmatch(s, pattern);
if match_index &gt; 0 then
-- Forward search
for w in iterator do
match_index = match_index - 1;
if match_index == 0 then
result = w;
break;
end
end
else
-- Reverse search
local result_table = {};
local count = 1;
for w in iterator do
result_table[count] = w;
count = count + 1;
end
result = result_table[ count + match_index ];
end
end
if result == nil then
if nomatch == nil then
return str._error( 'Match not found' );
else
return nomatch;
end
else
return result;
end
end
--[[
pos
This function returns a single character from the target string at position pos.
Usage:
{{#invoke:String|pos|target_string|index_value}}
OR
{{#invoke:String|pos|target=target_string|pos=index_value}}
Parameters
target: The string to search
pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the target string. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards
from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error.
]]
function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} );
local target_str = new_args['target'] or '';
local pos = tonumber( new_args['pos'] ) or 0;
if pos == 0 or math.abs(pos) &gt; mw.ustring.len( target_str ) then
return str._error( 'String index out of range' );
end
return mw.ustring.sub( target_str, pos, pos );
end
--[[
str_find
This function duplicates the behavior of {{str_find}}, including all of its quirks.
This is provided in order to support existing templates, but is NOT RECOMMENDED for
new code and templates. New code is recommended to use the &quot;find&quot; function instead.
Returns the first index in &quot;source&quot; that is a match to &quot;target&quot;. Indexing is 1-based,
and the function returns -1 if the &quot;target&quot; string is not present in &quot;source&quot;.
Important Note: If the &quot;target&quot; string is empty / missing, this function returns a
value of &quot;1&quot;, which is generally unexpected behavior, and must be accounted for
separatetly.
]]
function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} );
local source_str = new_args['source'] or '';
local target_str = new_args['target'] or '';
if target_str == '' then
return 1;
end
local start = mw.ustring.find( source_str, target_str, 1, true )
if start == nil then
start = -1
end
return start
end
--[[
find
This function allows one to search for a target string or pattern within another
string.
Usage:
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}
OR
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}
Parameters
source: The string to search
target: The string or pattern to find within source
start: The index within the source string to start the search, defaults to 1
plain: Boolean flag indicating that target should be understood as plain
text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or
trailing whitespace from the parameter. In some circumstances this is desirable, in
other cases one may want to preserve the whitespace.
This function returns the first index &gt;= &quot;start&quot; where &quot;target&quot; can be found
within &quot;source&quot;. Indices are 1-based. If &quot;target&quot; is not found, then this
function returns 0. If either &quot;source&quot; or &quot;target&quot; are missing / empty, this
function also returns 0.
This function should be safe for UTF-8 strings.
]]
function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } );
local source_str = new_args['source'] or '';
local pattern = new_args['target'] or '';
local start_pos = tonumber(new_args['start']) or 1;
local plain = new_args['plain'] or true;
if source_str == '' or pattern == '' then
return 0;
end
plain = str._getBoolean( plain );
local start = mw.ustring.find( source_str, pattern, start_pos, plain )
if start == nil then
start = 0
end
return start
end
--[[
replace
This function allows one to replace a target string or pattern within another
string.
Usage:
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}
OR
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|
count=replacement_count|plain=plain_flag}}
Parameters
source: The string to search
pattern: The string or pattern to find within source
replace: The replacement text
count: The number of occurences to replace, defaults to all.
plain: Boolean flag indicating that pattern should be understood as plain
text and not as a Lua style regular expression, defaults to true
]]
function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } );
local source_str = new_args['source'] or '';
local pattern = new_args['pattern'] or '';
local replace = new_args['replace'] or '';
local count = tonumber( new_args['count'] );
local plain = new_args['plain'] or true;
if source_str == '' or pattern == '' then
return source_str;
end
plain = str._getBoolean( plain );
if plain then
pattern = str._escapePattern( pattern );
replace = mw.ustring.gsub( replace, &quot;%%&quot;, &quot;%%%%&quot; ); --Only need to escape replacement sequences.
end
local result;
if count ~= nil then
result = mw.ustring.gsub( source_str, pattern, replace, count );
else
result = mw.ustring.gsub( source_str, pattern, replace );
end
return result;
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] )
if not repetitions then
return str._error( 'function rep expects a number as second parameter, received &quot;' .. ( frame.args[2] or '' ) .. '&quot;' )
end
return string.rep( frame.args[1] or '', repetitions )
end
--[[
Helper function that populates the argument list given that user may need to use a mix of
named and unnamed parameters. This is relevant because named parameters are not
identical to unnamed parameters due to string trimming, and when dealing with strings
we sometimes want to either preserve or remove that whitespace depending on the application.
]]
function str._getParameters( frame_args, arg_list )
local new_args = {};
local index = 1;
local value;
for i,arg in ipairs( arg_list ) do
value = frame_args[arg]
if value == nil then
value = frame_args[index];
index = index + 1;
end
new_args[arg] = value;
end
return new_args;
end
--[[
Helper function to handle error messages.
]]
function str._error( error_str )
local frame = mw.getCurrentFrame();
local error_category = frame.args.error_category or 'Errors reported by Module String';
local ignore_errors = frame.args.ignore_errors or false;
local no_category = frame.args.no_category or false;
if str._getBoolean(ignore_errors) then
return '';
end
local error_str = '&lt;strong class=&quot;error&quot;&gt;String Module Error: ' .. error_str .. '&lt;/strong&gt;';
if error_category ~= '' and not str._getBoolean( no_category ) then
error_str = '[[Category:' .. error_category .. ']]' .. error_str;
end
return error_str;
end
--[[
Helper Function to interpret boolean strings
]]
function str._getBoolean( boolean_str )
local boolean_value;
if type( boolean_str ) == 'string' then
boolean_str = boolean_str:lower();
if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0'
or boolean_str == '' then
boolean_value = false;
else
boolean_value = true;
end
elseif type( boolean_str ) == 'boolean' then
boolean_value = boolean_str;
else
error( 'No boolean value found' );
end
return boolean_value
end
--[[
Helper function that escapes all pattern characters so that they will be treated
as plain text.
]]
function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, &quot;([%(%)%.%%%+%-%*%?%[%^%$%]])&quot;, &quot;%%%1&quot; );
end
return str</text>
<sha1>l0shz7fzxb1bq626nihqwbptk7dfqd5</sha1>
</revision>
</page>
<page>
<title>Module:Yesno</title>
<ns>828</ns>
<id>38665046</id>
<revision>
<id>659459801</id>
<parentid>604718900</parentid>
<timestamp>2015-04-27T10:43:30Z</timestamp>
<contributor>
<username>MSGJ</username>
<id>42630</id>
</contributor>
<comment>recognise &quot;t&quot; for true and &quot;f&quot; for false, per request</comment>
<model>Scribunto</model>
<format>text/plain</format>
<text xml:space="preserve" bytes="710">-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template {{yesno}}.
return function (val, default)
-- If your wiki uses non-ascii characters for any of &quot;yes&quot;, &quot;no&quot;, etc., you
-- should replace &quot;val:lower()&quot; with &quot;mw.ustring.lower(val)&quot; in the
-- following line.
val = type(val) == 'string' and val:lower() or val
if val == nil then
return nil
elseif val == true
or val == 'yes'
or val == 'y'
or val == 'true'
or val == 't'
or tonumber(val) == 1
then
return true
elseif val == false
or val == 'no'
or val == 'n'
or val == 'false'
or val == 'f'
or tonumber(val) == 0
then
return false
else
return default
end
end</text>
<sha1>266x81qzpz9iq1b5gft4zsdy5qzbnwi</sha1>
</revision>
</page>
</mediawiki>

File Metadata

Mime Type
text/html
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
6b/c0/28e23c52fde91b3debaedcf8381e
Default Alt Text
Wikipedia-20180211003858.xml (361 KB)

Event Timeline