Template:Taxobox
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<siteinfo> <sitename>Wikipedia</sitename> <dbname>enwiki</dbname> <base>https://en.wikipedia.org/wiki/Main_Page</base> <generator>MediaWiki 1.32.0-wmf.1</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:Taxobox</title> <ns>10</ns> <id>689990</id> <revision> <id>787846838</id> <parentid>778610702</parentid> <timestamp>2017-06-27T22:24:34Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>better fix than a div for parser bug T18700</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="18505"><includeonly><!--See parser bug T18700--><nowiki/>Template:Taxobox/core</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8vdb4rdhdcoxq15noycs0sy6sn12tj2</sha1> </revision> </page> <page> <title>Template:;</title> <ns>10</ns> <id>24389988</id> <revision> <id>579820375</id> <parentid>328698152</parentid> <timestamp>2013-11-02T02:29:16Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:;: Enable access by 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="138">;<noinclude>
Template:Documentation <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --> </noinclude></text>
<sha1>jv515gqjn3e60s98b0od6potfps8h7b</sha1> </revision> </page> <page> <title>Template:Anglicise rank</title> <ns>10</ns> <id>27662093</id> <revision> <id>794829931</id> <parentid>764335048</parentid> <timestamp>2017-08-10T08:30:50Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated to tested sandbox version; highlights incorrect rank names in display of taxonomy template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="3647"><noinclude><!--Note that #titleparts: is used to replace underscores by spaces before other processing.
--></noinclude><includeonly>{{{1}}}</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>r7k7bb1fc2jyqjtct62iyeo65tioxvc</sha1> </revision> </page> <page> <title>Template:COLON</title> <ns>10</ns> <id>37858377</id> <redirect title="Template:Colon" /> <revision> <id>526845228</id> <timestamp>2012-12-07T10:41:53Z</timestamp> <contributor> <username>Scott</username> <id>9867</id> </contributor> <comment>Hex moved page Template:COLON to Template:Colon: Consistency with similarly-named templates.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="29">#REDIRECT Template:Colon
</text>
<sha1>bkz2dmpnak2hukdsi456pihydbyeyv5</sha1> </revision> </page> <page> <title>Template:Category link with count</title> <ns>10</ns> <id>30847816</id> <revision> <id>827250605</id> <parentid>804533676</parentid> <timestamp>2018-02-23T17:02:11Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Category link with count": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="307">[[:Category:{{{1}}}]] (0)<noinclude>
Template:Documentation </noinclude></text>
<sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1> </revision> </page> <page> <title>Template:Clc</title> <ns>10</ns> <id>52342109</id> <redirect title="Template:Category link with count" /> <revision> <id>827250628</id> <parentid>804533685</parentid> <timestamp>2018-02-23T17:02:12Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Clc": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model>
<format>text/x-wiki</format> <text xml:space="preserve" bytes="94">#REDIRECT Template:Category link with count</text> <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1> </revision> </page> <page> <title>Template:Clear</title> <ns>10</ns> <id>1239772</id> <revision> <id>684162145</id> <parentid>683948339</parentid> <timestamp>2015-10-04T23:53:36Z</timestamp> <contributor> <username>Nyttend</username> <id>1960810</id> </contributor> <minor/> <comment>Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="81"><div style="clear:both;"></div><noinclude>
Template:Documentation </noinclude></text>
<sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1> </revision> </page> <page> <title>Template:Colon</title> <ns>10</ns> <id>9794950</id> <revision> <id>579833044</id> <parentid>526846189</parentid> <timestamp>2013-11-02T05:07:28Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:Colon: Enable access by 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="45">:<noinclude>Template:Documentation</noinclude></text> <sha1>cc3ofm0i104e4kws9eikeit1yry2hki</sha1> </revision> </page> <page> <title>Template:Column-count</title> <ns>10</ns> <id>29216387</id> <revision> <id>638540848</id> <parentid>579833002</parentid> <timestamp>2014-12-17T20:09:11Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="156"><includeonly>-moz-column-count: 2; -webkit-column-count: 2; column-count: 2;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ctnrlv6otxn502jcjxtlgfdg09bq651</sha1> </revision> </page> <page> <title>Template:Column-width</title> <ns>10</ns> <id>29216399</id> <revision> <id>638540885</id> <parentid>579832996</parentid> <timestamp>2014-12-17T20:09:33Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1> </revision> </page> <page> <title>Template:Columns-list</title> <ns>10</ns> <id>15350623</id> <revision> <id>820270206</id> <parentid>780371550</parentid> <timestamp>2018-01-14T00:10:55Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>Add check for deprecated parameter 1=</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="717"><includeonly>Template:Main other</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>s0dkzmbtykj36zkmh42ixv59msksyse</sha1> </revision> </page> <page> <title>Template:Delink</title> <ns>10</ns> <id>28069338</id> <revision> <id>696877808</id> <parentid>695173639</parentid> <timestamp>2015-12-26T16:26:10Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <comment>Template:Documentation does this</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="179">{{<includeonly>safesubst:</includeonly>#invoke:delink|delink}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nxxwkb2lon9wgne4irg9ctbsle6zwiy</sha1> </revision> </page> <page> <title>Template:Div col</title> <ns>10</ns> <id>12679552</id> <revision> <id>820620173</id> <parentid>820604224</parentid> <timestamp>2018-01-15T17:35:00Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>/* top */ rm tfm notice, no need to have it here</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1405"><includeonly><div class="div-col columns <!-- -->column-count column-count-2" style="<!-- -->Template:Column-count <!-- --><!-- --><!--empty--> <!-- --> <!-- -->"><!-- --><!-- Inventory how many pages use small=yes --></includeonly>Script error: No such module "Check for unknown parameters".<!--
-->Template:Main other<noinclude> Template:Documentation </noinclude></text>
<sha1>d2gbqb2ziz4u4p13e6fy9t4aegzt2hy</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 Rich Farmbrough (talk)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="182">Script error: No such module "documentation".<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1> </revision> </page> <page> <title>Template:Documentation subpage</title> <ns>10</ns> <id>7890381</id> <revision> <id>617432645</id> <parentid>608599904</parentid> <timestamp>2014-07-18T09:37:22Z</timestamp> <contributor> <username>Sardanaphalus</username> <id>427947</id> </contributor> <comment>Added 1.0em margin so template looks less a part of subsequent content and amended code layout -- hope neither of these too controversial</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1667"><includeonly><!-- --><!--(this template has not been transcluded on a /doc or /{{{override}}} page)--><!--
--></includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1> </revision> </page> <page> <title>Template:Em</title> <ns>10</ns> <id>28990025</id> <revision> <id>800858570</id> <parentid>716632165</parentid> <timestamp>2017-09-16T03:11:40Z</timestamp> <contributor> <username>Matt Fitzpatrick</username> <id>291848</id> </contributor> <comment>added role parameter and attribute</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="306"><em >{{{1}}}</em><noinclude>
Template:Documentation <!-- Add categories to the /doc subpage, not here! --> </noinclude></text>
<sha1>g9i6h00ap35wxdar0fg1tibei9ktn9g</sha1> </revision> </page> <page> <title>Template:Fossil range</title> <ns>10</ns> <id>27601310</id> <redirect title="Template:Geological range" /> <revision> <id>577860864</id> <parentid>366046795</parentid> <timestamp>2013-10-19T16:30:26Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <minor/> <comment>Changed protection level of Template:Fossil range: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="39">#REDIRECT Template:Geological range</text> <sha1>7v75vz714j9z1uuwsspa0q3pkbqe3ku</sha1> </revision> </page> <page> <title>Template:Fossil range/bar</title> <ns>10</ns> <id>18704774</id> <revision> <id>772347989</id> <parentid>772195239</parentid> <timestamp>2017-03-26T19:33:26Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="704"><includeonly><onlyinclude><div style="position:absolute; height:100%; text-align:center; background-color:Template:Period color; left:Expression error: Unrecognized punctuation character "[".px; width:Expression error: Unrecognized punctuation character "[".px;">[[{{{1}}}|{{{2}}}]]</div></onlyinclude></includeonly><noinclude>
Template:Pp-template <!-- interwiki below this point--> ar:قالب:Fossil range/bar [[bn:টেমপ�লেট:Fossil range/bar]] [[ko:틀:화� 시기/막대]] id:Templat:Rentang fosil/baris la:Formula:Fossil range/bar pl:Szablon:Okres istnienia grupy organizmów 2/wykres </noinclude></text>
<sha1>h33mdmfvx5to36xnli0bd12rgbx8evh</sha1> </revision> </page> <page> <title>Template:Fossil range/marker</title> <ns>10</ns> <id>18705421</id> <revision> <id>772347793</id> <parentid>772195280</parentid> <timestamp>2017-03-26T19:32:08Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1001"><includeonly><onlyinclude>Expression error: Unrecognized punctuation character "{".</onlyinclude></includeonly><noinclude>
Template:Pp-template ar:قالب:Fossil range/marker id:Templat:Rentang fosil/marka la:Formula:Fossil range/marker pl:Szablon:Okres istnienia grupy organizmów 2/znacznik </noinclude></text>
<sha1>oulrk3za491l8g55lbflhw0k4bfezim</sha1> </revision> </page> <page> <title>Template:Geological range</title> <ns>10</ns> <id>13050925</id> <revision> <id>691122112</id> <parentid>691101758</parentid> <timestamp>2015-11-17T20:15:16Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>Fixed for now...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1271"><includeonly><span style="display:inline-block;"></span><span style="display:inline-block;">{{{1}}}</span> <span style="display:inline-block;"></span>Template:Phanerozoic 220px<!--
Fossil range marker
--><div name=Range style="margin:0 auto; line-height:0; clear:both; width:220px; padding:0px; height:8px; overflow:visible; background-color:transparent; position:relative; top:-4px; z-index:100;">Template:Fossil range/marker Template:Fossil range/marker </div Range> </div Timeline-row></includeonly><noinclude>Template:Template doc</noinclude></text>
<sha1>qhx7sh2rpo6099mfnaw3jrqbbflxxyu</sha1> </revision> </page> <page> <title>Template:High-risk</title> <ns>10</ns> <id>11453893</id> <revision> <id>826619452</id> <parentid>819682280</parentid> <timestamp>2018-02-20T03:34:02Z</timestamp> <contributor> <username>Wbm1058</username> <id>14383484</id> </contributor> <comment>add optional parameter to show additional information. using it on Template:Infobox documentation page.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1603">Template:Ombox<noinclude>
Template:Documentation <!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --> </noinclude></text>
<sha1>ri2f5z0xlo9bloylz6zogx67uowijqs</sha1> </revision> </page> <page> <title>Template:If empty</title> <ns>10</ns> <id>16635679</id> <revision> <id>639393821</id> <parentid>639393034</parentid> <timestamp>2014-12-23T22:03:50Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>make this substable</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="102">{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>Template:Documentation</noinclude></text> <sha1>dl9p9t1ge8vz1f67zrvu4lp7md161es</sha1> </revision> </page> <page> <title>Template:Image frame</title> <ns>10</ns> <id>5710011</id> <revision> <id>832269062</id> <parentid>832268204</parentid> <timestamp>2018-03-24T22:23:07Z</timestamp> <contributor> <username>GKFX</username> <id>14918984</id> </contributor> <comment>Add {{{innerstyle}}} to other if function</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="861"><includeonly><div class="thumb tright"><div class="thumbinner noresize" style=""><div class="thumbimage" style="">{{{content}}}</div><div class="thumbcaption"></div></div></div></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>lr1p8z2yxh5z329ok1eu3qfwkae0mvm</sha1> </revision> </page> <page> <title>Template:Intricate template</title> <ns>10</ns> <id>3212382</id> <revision> <id>791343927</id> <parentid>599780700</parentid> <timestamp>2017-07-19T16:54:52Z</timestamp> <contributor> <username>Train2104</username> <id>10341578</id> </contributor> <comment>reword</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1235">Template:Ombox<includeonly></includeonly><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>dh79njli0rchozlv8gxvabsm0gkseh1</sha1> </revision> </page> <page> <title>Template:Linear-gradient</title> <ns>10</ns> <id>34343126</id> <revision> <id>679780267</id> <parentid>679774821</parentid> <timestamp>2015-09-06T19:08:51Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>move code</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="579"><includeonly>background-image: -moz-linear-gradient(, ); background-image: -o-linear-gradient(, ); background-image: -webkit-linear-gradient(, ); background-image: linear-gradient({{{1}}}, );</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>d9q5b9t0m89azbiekg3lqbh549l2re0</sha1>
</revision>
</page>
<page>
<title>Template:Main</title>
<ns>10</ns>
<id>1208356</id>
<revision>
<id>827529543</id>
<parentid>826282491</parentid>
<timestamp>2018-02-25T07:02:12Z</timestamp>
<contributor>
<username>RMCD bot</username>
<id>17216044</id>
</contributor>
<comment>Removing notice of move discussion</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="138">Script error: No such module "main".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>jkpvpyms818jhpg2lkzsq5qur195qbr</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 Template:Pp-template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="409"><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1> </revision> </page> <page> <title>Template:MultiReplace</title> <ns>10</ns> <id>51070198</id> <revision> <id>836129739</id> <parentid>836116264</parentid> <timestamp>2018-04-12T20:54:48Z</timestamp> <contributor> <username>Ahecht</username> <id>2016996</id> </contributor> <comment>safesubst:<noinclude/></comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="70">{{safesubst:<noinclude/>#invoke:MultiReplace|main}}<noinclude>
Template:Doc</text>
<sha1>hpfo8bppd4vwcb5x8spcqhtcernv2lv</sha1> </revision> </page> <page> <title>Template:Next period</title> <ns>10</ns> <id>17129593</id> <revision> <id>784255100</id> <parentid>577842274</parentid> <timestamp>2017-06-07T09:03:07Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <comment>Add informal Ediacaran subdivisions</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="8491">Taxobox<noinclude>Template:Template doc</noinclude></text> <sha1>hf6999fb24tg7m8c7odtb26w166mq1u</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">Script error: No such module "Message box".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1> </revision> </page> <page> <title>Template:Para</title> <ns>10</ns> <id>16639086</id> <revision> <id>679823176</id> <parentid>660922353</parentid> <timestamp>2015-09-07T00:44:14Z</timestamp> <contributor> <username>HJ Mitchell</username> <id>9336033</id> </contributor> <minor/> <comment>Changed protection level of Template:Para: lower to TE per request; also removed from WP:CASC ([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="267"><code class="nowrap" >|</code><noinclude>
Template:Documentation <!--Categories and interwikis go near the bottom of the /doc subpage.--> </noinclude></text>
<sha1>byvvhmp41qjgp4713oxicsdwzjqb1b0</sha1> </revision> </page> <page> <title>Template:Period color</title> <ns>10</ns> <id>15654337</id> <revision> <id>830378120</id> <parentid>830359768</parentid> <timestamp>2018-03-14T13:20:10Z</timestamp> <contributor> <username>Hike395</username> <id>11639</id> </contributor> <comment>I had already swapped the colors in the previous edit</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="6714"><noinclude>
Template:Documentation </noinclude></text>
<sha1>k8780yise3btiho0veen3y26flpqdhx</sha1> </revision> </page> <page> <title>Template:Period end</title> <ns>10</ns> <id>17126181</id> <revision> <id>772147419</id> <parentid>433647208</parentid> <timestamp>2017-03-25T16:04:18Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Period end": 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] (indef...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="122"><includeonly>Template:Period start</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ggu56mt27u35n5ddg6fdrq8zc6iav8e</sha1> </revision> </page> <page> <title>Template:Period id</title> <ns>10</ns> <id>50980396</id> <revision> <id>825510865</id> <parentid>734737683</parentid> <timestamp>2018-02-13T20:32:22Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="460">Template:MultiReplace<noinclude>
Template:Documentation </noinclude></text>
<sha1>4lp28tuzowrcpwyb7wvkyue55cbj2di</sha1> </revision> </page> <page> <title>Template:Period start</title> <ns>10</ns> <id>17126152</id> <revision> <id>833980327</id> <parentid>802883274</parentid> <timestamp>2018-04-03T09:11:08Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <minor/> <comment>Update Chengjiang, per doi:10.1144/jgs2017-103</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="9422"><includeonly>Expression error: Unexpected round operator.</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>jcm6yf39q49llph8eh51qy8nod20p8h</sha1> </revision> </page> <page> <title>Template:Phanerozoic 220px</title> <ns>10</ns> <id>26179752</id> <revision> <id>694836256</id> <parentid>694836085</parentid> <timestamp>2015-12-11T22:20:22Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>linebreak</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1114"><div id="Timeline-row" style="margin: 4px auto 0; clear:both; width:220px; padding:0px; height:18px; overflow:visible; border:1px #666; border-style:solid none; position:relative; z-index:0; font-size:13px;">
<div style="position:absolute; height:100%; left:0px; width:Expression error: Unrecognized punctuation character "[".px; padding-left:5px; text-align:left; background-color:Template:Period color; Template:Linear-gradient">PreЄ</div> {{fossil
range/bar|Cambrian|Є}}
Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar <div id="end-border" style="position:absolute; height:100%; background-color:#666; width:1px; left:219px"></div><noinclude> </div> Template:Documentation </noinclude></text>
<sha1>ky1n0eet81iquci3yghyfw95ugey3d1</sha1> </revision> </page> <page> <title>Template:Redirect</title> <ns>10</ns> <id>1649987</id> <revision> <id>827943535</id> <parentid>826439889</parentid> <timestamp>2018-02-27T17:34:09Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <comment>Wikipedia:Templates for discussion/Log/2018 February 18#Template:Redirect3_and_Template:About2 closed as merge (XFDcloser)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="183"><includeonly>Script error: No such module "redirect hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nahryqse47xqenividwc88opp02rhjv</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"><div class="reflist <!-- -->" style="<!-- --> list-style-type: <!-- -->decimal;">
</div>Script error: No such module "Check for unknown parameters".<noinclude> Template:Documentation </noinclude></text>
<sha1>2k096ppl7lxbcjqmfluu9x2sc91rmzl</sha1> </revision> </page> <page> <title>Template:See also</title> <ns>10</ns> <id>1721254</id> <revision> <id>763260609</id> <parentid>725632232</parentid> <timestamp>2017-02-02T05:40:25Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Updated from sandbox to use Module:Labelled list hatnote</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="199"><includeonly>Script error: No such module "Labelled list hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>dn9i3dv2bt8lqifr6vkbycoya78rnav</sha1> </revision> </page> <page> <title>Template:Sets taxobox colour</title> <ns>10</ns> <id>52159696</id> <revision> <id>792252309</id> <parentid>751937313</parentid> <timestamp>2017-07-25T12:33:29Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="192"><includeonly></includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>17ktt6fduayqzzpcwd3sq3h059430w8</sha1> </revision> </page> <page> <title>Template:Str find</title> <ns>10</ns> <id>21725841</id> <revision> <id>772120912</id> <parentid>539724237</parentid> <timestamp>2017-03-25T12:38:47Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find": Allowing template editors on some templates with full protection dating back to pre-TPROT times which aren't too often or too sensitively used. ([Edit=Require template editor access] (i...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="93">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>3zfmbl429kcazgnewbtwkdoycus3e1m</sha1> </revision> </page> <page> <title>Template:Str find0</title> <ns>10</ns> <id>31624801</id> <revision> <id>754106575</id> <parentid>565160579</parentid> <timestamp>2016-12-10T22:12:30Z</timestamp> <contributor> <username>BU Rob13</username> <id>25420061</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find0": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="108">Expression error: Unexpected < operator.<noinclude>
Template:Documentation</noinclude></text>
<sha1>sert5g7f8gacqtv1cs6edj7iu0d5b97</sha1> </revision> </page> <page> <title>Template:Str left</title> <ns>10</ns> <id>21696393</id> <revision> <id>741880261</id> <parentid>605122708</parentid> <timestamp>2016-09-30T07:01:19Z</timestamp> <contributor> <username>Ymblanter</username> <id>14596827</id> </contributor> <minor/> <comment>Changed protection level of Template:Str left: Highly visible template: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="184"><includeonly></includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1> </revision> </page> <page> <title>Template:Str rep</title> <ns>10</ns> <id>24238435</id> <revision> <id>656461393</id> <parentid>656457182</parentid> <timestamp>2015-04-14T16:35:55Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <minor/> <comment>Protected Template:Str rep: Highly visible template: 167176 transclusions ([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="100">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>8aojqr2n3b0gv6drwu3safb8kuckf72</sha1> </revision> </page> <page> <title>Template:Taxobox/Error colour</title> <ns>10</ns> <id>29546546</id> <revision> <id>758431105</id> <parentid>740191216</parentid> <timestamp>2017-01-05T11:32:08Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated HTML comment</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="462"><includeonly>transparent; text-align:center; border: 2px solid red; error:colour</includeonly><noinclude><!--
-- The caller template must check invalid -- {{{colour}}} value to link because -- a wp:wikitable column format cannot contain a wikilinked page or category, -- as of September 2016. -- -- See check of {{{colour}}} in template {Taxobox/core}. -->Template:Documentation</noinclude></text>
<sha1>n8owfylnwasbq6p09fhl83wjdp5npqe</sha1> </revision> </page> <page> <title>Template:Taxobox/core</title> <ns>10</ns> <id>29471370</id> <revision> <id>809123045</id> <parentid>809122889</parentid>
<timestamp>2017-11-07T07:14:13Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>try again</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="21914">{| class="infobox biota" style="text-align: left; width: 200px; font-size: 100%"
|- ! colspan=2 style="text-align: center" | Taxobox |-
|- colspan=2 style="text-align: center"
|- |- ! colspan=2 style="min-width:15em; text-align: center" | Scientific classification |-
|-
|-
|- style="text-align: center"
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|}<!--
Define any categories to be displayed on the page here:
--><noinclude>Template:Documentation</noinclude></text>
<sha1>a2rm1euf6a6qovdh8d23gr3qknia9s4</sha1> </revision> </page> <page> <title>Template:Taxobox/doc</title> <ns>10</ns> <id>7342865</id> <revision> <id>839167972</id> <parentid>837111256</parentid> <timestamp>2018-05-01T18:24:33Z</timestamp> <contributor> <username>Plantdrew</username> <id>14423536</id> </contributor> <comment>update transclusion count</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="85800">Template:Redirect
Template:Documentation subpage <includeonly>Template:High-risk</includeonly> <noinclude>Template:MoS guideline</noinclude> Template:Intricate template
This template sets up a manual taxobox, as a right-side infobox table setting out the biological classification (taxonomy) for a group of living things. For guide to automated taxoboxes, see WP:Automated taxobox system/intro.
Although with a choice of over 160 parameters, the implementation is complicated, it is relatively simple to use. <!--For an example in practice, look at the edit page of "Killer whale" – [1].--> Most parameters are optional, so if a particular entry is not relevant for your case, just leave it out. See below section "All parameters" for a complete list.
This guide has come out of WikiProject Tree of life.
Usage[edit source]
Note that parameters in this template are case-sensitive. <pre style="overflow:auto"> <mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<siteinfo> <sitename>Wikipedia</sitename> <dbname>enwiki</dbname> <base>https://en.wikipedia.org/wiki/Main_Page</base> <generator>MediaWiki 1.32.0-wmf.1</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:Taxobox</title> <ns>10</ns> <id>689990</id> <revision> <id>787846838</id> <parentid>778610702</parentid> <timestamp>2017-06-27T22:24:34Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>better fix than a div for parser bug T18700</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="18505"><includeonly><!--See parser bug T18700--><nowiki/>Template:Taxobox/core</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8vdb4rdhdcoxq15noycs0sy6sn12tj2</sha1> </revision> </page> <page> <title>Template:;</title> <ns>10</ns> <id>24389988</id> <revision> <id>579820375</id> <parentid>328698152</parentid> <timestamp>2013-11-02T02:29:16Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:;: Enable access by 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="138">;<noinclude>
Template:Documentation <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --> </noinclude></text>
<sha1>jv515gqjn3e60s98b0od6potfps8h7b</sha1> </revision> </page> <page> <title>Template:Anglicise rank</title> <ns>10</ns> <id>27662093</id> <revision> <id>794829931</id> <parentid>764335048</parentid> <timestamp>2017-08-10T08:30:50Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated to tested sandbox version; highlights incorrect rank names in display of taxonomy template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="3647"><noinclude><!--Note that #titleparts: is used to replace underscores by spaces before other processing.
--></noinclude><includeonly><!--or 115 other parameters--></includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>r7k7bb1fc2jyqjtct62iyeo65tioxvc</sha1> </revision> </page> <page> <title>Template:COLON</title> <ns>10</ns> <id>37858377</id> <redirect title="Template:Colon" /> <revision> <id>526845228</id> <timestamp>2012-12-07T10:41:53Z</timestamp> <contributor> <username>Scott</username> <id>9867</id> </contributor> <comment>Hex moved page Template:COLON to Template:Colon: Consistency with similarly-named templates.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="29">#REDIRECT Template:Colon
</text>
<sha1>bkz2dmpnak2hukdsi456pihydbyeyv5</sha1> </revision> </page> <page> <title>Template:Category link with count</title> <ns>10</ns> <id>30847816</id> <revision> <id>827250605</id> <parentid>804533676</parentid> <timestamp>2018-02-23T17:02:11Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Category link with count": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="307">[[:Category:<!--or 115 other parameters-->]] (0)<noinclude>
Template:Documentation </noinclude></text>
<sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1> </revision> </page> <page> <title>Template:Clc</title> <ns>10</ns> <id>52342109</id> <redirect title="Template:Category link with count" /> <revision> <id>827250628</id> <parentid>804533685</parentid> <timestamp>2018-02-23T17:02:12Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Clc": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model>
<format>text/x-wiki</format> <text xml:space="preserve" bytes="94">#REDIRECT Template:Category link with count</text> <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1> </revision> </page> <page> <title>Template:Clear</title> <ns>10</ns> <id>1239772</id> <revision> <id>684162145</id> <parentid>683948339</parentid> <timestamp>2015-10-04T23:53:36Z</timestamp> <contributor> <username>Nyttend</username> <id>1960810</id> </contributor> <minor/> <comment>Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="81"><div style="clear: <!--or 115 other parameters-->
- "></div><noinclude>
Template:Documentation </noinclude></text>
<sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1> </revision> </page> <page> <title>Template:Colon</title> <ns>10</ns> <id>9794950</id> <revision> <id>579833044</id> <parentid>526846189</parentid> <timestamp>2013-11-02T05:07:28Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:Colon: Enable access by 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="45">:<noinclude>Template:Documentation</noinclude></text> <sha1>cc3ofm0i104e4kws9eikeit1yry2hki</sha1> </revision> </page> <page> <title>Template:Column-count</title> <ns>10</ns> <id>29216387</id> <revision> <id>638540848</id> <parentid>579833002</parentid> <timestamp>2014-12-17T20:09:11Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="156"><includeonly>-moz-column-count: <!--or 115 other parameters-->
- -webkit-column-count
- <!--or 115 other parameters-->
- column-count
- <!--or 115 other parameters-->
- </includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ctnrlv6otxn502jcjxtlgfdg09bq651</sha1> </revision> </page> <page> <title>Template:Column-width</title> <ns>10</ns> <id>29216399</id> <revision> <id>638540885</id> <parentid>579832996</parentid> <timestamp>2014-12-17T20:09:33Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: <!--or 115 other parameters-->
- -webkit-column-width
- <!--or 115 other parameters-->
- column-width
- <!--or 115 other parameters-->
- </includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1> </revision> </page> <page> <title>Template:Columns-list</title> <ns>10</ns> <id>15350623</id> <revision> <id>820270206</id> <parentid>780371550</parentid> <timestamp>2018-01-14T00:10:55Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>Add check for deprecated parameter 1=</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="717"><includeonly>{{div col <!-- Support for previous parameter 1= aka cols= has been removed after being deprecated for months for compatibility reasons, use more portable parameter colwidth= instead. --> | colwidth = | gap = | rules = | small = | style = | content = <!--or 115 other parameters-->
}}Template:Main other</includeonly><noinclude> Template:Documentation </noinclude></text>
<sha1>s0dkzmbtykj36zkmh42ixv59msksyse</sha1> </revision> </page> <page> <title>Template:Delink</title> <ns>10</ns> <id>28069338</id> <revision> <id>696877808</id> <parentid>695173639</parentid> <timestamp>2015-12-26T16:26:10Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <comment>Template:Documentation does this</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="179">{{<includeonly>safesubst:</includeonly>#invoke:delink|delink}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nxxwkb2lon9wgne4irg9ctbsle6zwiy</sha1> </revision> </page> <page> <title>Template:Div col</title> <ns>10</ns> <id>12679552</id> <revision> <id>820620173</id> <parentid>820604224</parentid> <timestamp>2018-01-15T17:35:00Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>/* top */ rm tfm notice, no need to have it here</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1405"><includeonly><div class="div-col columns <!-- -->column-count column-count-<!--or 115 other parameters-->" style="<!-- -->Template:Column-count <!-- --><!-- --><!--empty--> <!-- --> <!-- -->"><!-- --><!-- Inventory how many pages use small=yes --></includeonly>Script error: No such module "Check for unknown parameters".<!--
-->Template:Main other<noinclude> Template:Documentation </noinclude></text>
<sha1>d2gbqb2ziz4u4p13e6fy9t4aegzt2hy</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 Rich Farmbrough (talk)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="182">Script error: No such module "documentation".<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1> </revision> </page> <page> <title>Template:Documentation subpage</title> <ns>10</ns> <id>7890381</id> <revision> <id>617432645</id> <parentid>608599904</parentid> <timestamp>2014-07-18T09:37:22Z</timestamp> <contributor> <username>Sardanaphalus</username> <id>427947</id> </contributor> <comment>Added 1.0em margin so template looks less a part of subsequent content and amended code layout -- hope neither of these too controversial</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1667"><includeonly><!-- --><!--(this template has not been transcluded on a /doc or /{{{override}}} page)--><!--
--></includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1> </revision> </page> <page> <title>Template:Em</title> <ns>10</ns> <id>28990025</id> <revision> <id>800858570</id> <parentid>716632165</parentid> <timestamp>2017-09-16T03:11:40Z</timestamp> <contributor> <username>Matt Fitzpatrick</username> <id>291848</id> </contributor> <comment>added role parameter and attribute</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="306"><em > <!--or 115 other parameters-->
</em><noinclude> Template:Documentation <!-- Add categories to the /doc subpage, not here! --> </noinclude></text>
<sha1>g9i6h00ap35wxdar0fg1tibei9ktn9g</sha1> </revision> </page> <page> <title>Template:Fossil range</title> <ns>10</ns> <id>27601310</id> <redirect title="Template:Geological range" /> <revision> <id>577860864</id> <parentid>366046795</parentid> <timestamp>2013-10-19T16:30:26Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <minor/> <comment>Changed protection level of Template:Fossil range: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="39">#REDIRECT Template:Geological range</text> <sha1>7v75vz714j9z1uuwsspa0q3pkbqe3ku</sha1> </revision> </page> <page> <title>Template:Fossil range/bar</title> <ns>10</ns> <id>18704774</id> <revision> <id>772347989</id> <parentid>772195239</parentid> <timestamp>2017-03-26T19:33:26Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="704"><includeonly><onlyinclude><div style="position:absolute; height:100%; text-align:center; background-color:Template:Period color; left:Expression error: Unrecognized punctuation character "[".px; width:Expression error: Unrecognized punctuation character "[".px;">[[ <!--or 115 other parameters-->
|{{{2}}}]]</div></onlyinclude></includeonly><noinclude> Template:Pp-template <!-- interwiki below this point--> ar:قالب:Fossil range/bar [[bn:টেমপ�লেট:Fossil range/bar]] [[ko:틀:화� 시기/막대]] id:Templat:Rentang fosil/baris la:Formula:Fossil range/bar pl:Szablon:Okres istnienia grupy organizmów 2/wykres </noinclude></text>
<sha1>h33mdmfvx5to36xnli0bd12rgbx8evh</sha1> </revision> </page> <page> <title>Template:Fossil range/marker</title> <ns>10</ns> <id>18705421</id> <revision> <id>772347793</id> <parentid>772195280</parentid> <timestamp>2017-03-26T19:32:08Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1001"><includeonly><onlyinclude>Expression error: Unexpected < operator.</onlyinclude></includeonly><noinclude>
Template:Pp-template ar:قالب:Fossil range/marker id:Templat:Rentang fosil/marka la:Formula:Fossil range/marker pl:Szablon:Okres istnienia grupy organizmów 2/znacznik </noinclude></text>
<sha1>oulrk3za491l8g55lbflhw0k4bfezim</sha1> </revision> </page> <page> <title>Template:Geological range</title> <ns>10</ns> <id>13050925</id> <revision> <id>691122112</id> <parentid>691101758</parentid> <timestamp>2015-11-17T20:15:16Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>Fixed for now...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1271"><includeonly><span style="display:inline-block;"></span><span style="display:inline-block;"> <!--or 115 other parameters-->
</span> <span style="display:inline-block;"></span>Template:Phanerozoic 220px<!--
Fossil range marker
--><div name=Range style="margin:0 auto; line-height:0; clear:both; width:220px; padding:0px; height:8px; overflow:visible; background-color:transparent; position:relative; top:-4px; z-index:100;">Template:Fossil range/marker Template:Fossil range/marker </div Range> </div Timeline-row></includeonly><noinclude>Template:Template doc</noinclude></text>
<sha1>qhx7sh2rpo6099mfnaw3jrqbbflxxyu</sha1> </revision> </page> <page> <title>Template:High-risk</title> <ns>10</ns> <id>11453893</id> <revision> <id>826619452</id> <parentid>819682280</parentid> <timestamp>2018-02-20T03:34:02Z</timestamp> <contributor> <username>Wbm1058</username> <id>14383484</id> </contributor> <comment>add optional parameter to show additional information. using it on Template:Infobox documentation page.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1603">Template:Ombox<noinclude>
Template:Documentation <!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --> </noinclude></text>
<sha1>ri2f5z0xlo9bloylz6zogx67uowijqs</sha1> </revision> </page> <page> <title>Template:If empty</title> <ns>10</ns> <id>16635679</id> <revision> <id>639393821</id> <parentid>639393034</parentid> <timestamp>2014-12-23T22:03:50Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>make this substable</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="102">{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>Template:Documentation</noinclude></text> <sha1>dl9p9t1ge8vz1f67zrvu4lp7md161es</sha1> </revision> </page> <page> <title>Template:Image frame</title> <ns>10</ns> <id>5710011</id> <revision> <id>832269062</id> <parentid>832268204</parentid> <timestamp>2018-03-24T22:23:07Z</timestamp> <contributor> <username>GKFX</username> <id>14918984</id> </contributor> <comment>Add {{{innerstyle}}} to other if function</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="861"><includeonly><div class="thumb tright"><div class="thumbinner noresize" style=""><div class="thumbimage" style="">{{{content}}}</div><div class="thumbcaption"></div></div></div></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>lr1p8z2yxh5z329ok1eu3qfwkae0mvm</sha1> </revision> </page> <page> <title>Template:Intricate template</title> <ns>10</ns> <id>3212382</id> <revision> <id>791343927</id> <parentid>599780700</parentid> <timestamp>2017-07-19T16:54:52Z</timestamp> <contributor> <username>Train2104</username> <id>10341578</id> </contributor> <comment>reword</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1235">Template:Ombox<includeonly></includeonly><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>dh79njli0rchozlv8gxvabsm0gkseh1</sha1> </revision> </page> <page> <title>Template:Linear-gradient</title> <ns>10</ns> <id>34343126</id> <revision> <id>679780267</id> <parentid>679774821</parentid> <timestamp>2015-09-06T19:08:51Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>move code</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="579"><includeonly>background-image: -moz-linear-gradient( <!--or 115 other parameters-->
, ); background-image: -o-linear-gradient( <!--or 115 other parameters--> , ); background-image: -webkit-linear-gradient( <!--or 115 other parameters--> , ); background-image: linear-gradient(<!--or 115 other parameters-->, );</includeonly><noinclude> Template:Documentation </noinclude></text>
<sha1>d9q5b9t0m89azbiekg3lqbh549l2re0</sha1>
</revision>
</page>
<page>
<title>Template:Main</title>
<ns>10</ns>
<id>1208356</id>
<revision>
<id>827529543</id>
<parentid>826282491</parentid>
<timestamp>2018-02-25T07:02:12Z</timestamp>
<contributor>
<username>RMCD bot</username>
<id>17216044</id>
</contributor>
<comment>Removing notice of move discussion</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="138">Script error: No such module "main".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>jkpvpyms818jhpg2lkzsq5qur195qbr</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 Template:Pp-template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="409"><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1> </revision> </page> <page> <title>Template:MultiReplace</title> <ns>10</ns> <id>51070198</id> <revision> <id>836129739</id> <parentid>836116264</parentid> <timestamp>2018-04-12T20:54:48Z</timestamp> <contributor> <username>Ahecht</username> <id>2016996</id> </contributor> <comment>safesubst:<noinclude/></comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="70">{{safesubst:<noinclude/>#invoke:MultiReplace|main}}<noinclude>
Template:Doc</text>
<sha1>hpfo8bppd4vwcb5x8spcqhtcernv2lv</sha1> </revision> </page> <page> <title>Template:Next period</title> <ns>10</ns> <id>17129593</id> <revision> <id>784255100</id> <parentid>577842274</parentid> <timestamp>2017-06-07T09:03:07Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <comment>Add informal Ediacaran subdivisions</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="8491"><!--or 115 other parameters--><noinclude>Template:Template doc</noinclude></text> <sha1>hf6999fb24tg7m8c7odtb26w166mq1u</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">Script error: No such module "Message box".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1> </revision> </page> <page> <title>Template:Para</title> <ns>10</ns> <id>16639086</id> <revision> <id>679823176</id> <parentid>660922353</parentid> <timestamp>2015-09-07T00:44:14Z</timestamp> <contributor> <username>HJ Mitchell</username> <id>9336033</id> </contributor> <minor/> <comment>Changed protection level of Template:Para: lower to TE per request; also removed from WP:CASC ([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="267"><code class="nowrap" >|<!--or 115 other parameters-->
=</code><noinclude> Template:Documentation <!--Categories and interwikis go near the bottom of the /doc subpage.--> </noinclude></text>
<sha1>byvvhmp41qjgp4713oxicsdwzjqb1b0</sha1> </revision> </page> <page> <title>Template:Period color</title> <ns>10</ns> <id>15654337</id> <revision> <id>830378120</id> <parentid>830359768</parentid> <timestamp>2018-03-14T13:20:10Z</timestamp> <contributor> <username>Hike395</username> <id>11639</id> </contributor> <comment>I had already swapped the colors in the previous edit</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="6714"><noinclude>
Template:Documentation </noinclude></text>
<sha1>k8780yise3btiho0veen3y26flpqdhx</sha1> </revision> </page> <page> <title>Template:Period end</title> <ns>10</ns> <id>17126181</id> <revision> <id>772147419</id> <parentid>433647208</parentid> <timestamp>2017-03-25T16:04:18Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Period end": 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] (indef...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="122"><includeonly>Template:Period start</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ggu56mt27u35n5ddg6fdrq8zc6iav8e</sha1> </revision> </page> <page> <title>Template:Period id</title> <ns>10</ns> <id>50980396</id> <revision> <id>825510865</id> <parentid>734737683</parentid> <timestamp>2018-02-13T20:32:22Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="460">Template:MultiReplace<noinclude>
Template:Documentation </noinclude></text>
<sha1>4lp28tuzowrcpwyb7wvkyue55cbj2di</sha1> </revision> </page> <page> <title>Template:Period start</title> <ns>10</ns> <id>17126152</id> <revision> <id>833980327</id> <parentid>802883274</parentid> <timestamp>2018-04-03T09:11:08Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <minor/> <comment>Update Chengjiang, per doi:10.1144/jgs2017-103</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="9422"><includeonly>Expression error: Unexpected round operator.</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>jcm6yf39q49llph8eh51qy8nod20p8h</sha1> </revision> </page> <page> <title>Template:Phanerozoic 220px</title> <ns>10</ns> <id>26179752</id> <revision> <id>694836256</id> <parentid>694836085</parentid> <timestamp>2015-12-11T22:20:22Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>linebreak</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1114"><div id="Timeline-row" style="margin: 4px auto 0; clear:both; width:220px; padding:0px; height:18px; overflow:visible; border:1px #666; border-style:solid none; position:relative; z-index:0; font-size:13px;">
<div style="position:absolute; height:100%; left:0px; width:Expression error: Unrecognized punctuation character "[".px; padding-left:5px; text-align:left; background-color:Template:Period color; Template:Linear-gradient">PreЄ</div> {{fossil
range/bar|Cambrian|Є}}
Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar <div id="end-border" style="position:absolute; height:100%; background-color:#666; width:1px; left:219px"></div><noinclude> </div> Template:Documentation </noinclude></text>
<sha1>ky1n0eet81iquci3yghyfw95ugey3d1</sha1> </revision> </page> <page> <title>Template:Redirect</title> <ns>10</ns> <id>1649987</id> <revision> <id>827943535</id> <parentid>826439889</parentid> <timestamp>2018-02-27T17:34:09Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <comment>Wikipedia:Templates for discussion/Log/2018 February 18#Template:Redirect3_and_Template:About2 closed as merge (XFDcloser)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="183"><includeonly>Script error: No such module "redirect hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nahryqse47xqenividwc88opp02rhjv</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"><div class="reflist <!-- -->columns references-column-width" style="<!-- -->Template:Column-width list-style-type: <!-- -->decimal;">
</div>Script error: No such module "Check for unknown parameters".<noinclude> Template:Documentation </noinclude></text>
<sha1>2k096ppl7lxbcjqmfluu9x2sc91rmzl</sha1> </revision> </page> <page> <title>Template:See also</title> <ns>10</ns> <id>1721254</id> <revision> <id>763260609</id> <parentid>725632232</parentid> <timestamp>2017-02-02T05:40:25Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Updated from sandbox to use Module:Labelled list hatnote</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="199"><includeonly>Script error: No such module "Labelled list hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>dn9i3dv2bt8lqifr6vkbycoya78rnav</sha1> </revision> </page> <page> <title>Template:Sets taxobox colour</title> <ns>10</ns> <id>52159696</id> <revision> <id>792252309</id> <parentid>751937313</parentid> <timestamp>2017-07-25T12:33:29Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="192"><includeonly></includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>17ktt6fduayqzzpcwd3sq3h059430w8</sha1> </revision> </page> <page> <title>Template:Str find</title> <ns>10</ns> <id>21725841</id> <revision> <id>772120912</id> <parentid>539724237</parentid> <timestamp>2017-03-25T12:38:47Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find": Allowing template editors on some templates with full protection dating back to pre-TPROT times which aren't too often or too sensitively used. ([Edit=Require template editor access] (i...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="93">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>3zfmbl429kcazgnewbtwkdoycus3e1m</sha1> </revision> </page> <page> <title>Template:Str find0</title> <ns>10</ns> <id>31624801</id> <revision> <id>754106575</id> <parentid>565160579</parentid> <timestamp>2016-12-10T22:12:30Z</timestamp> <contributor> <username>BU Rob13</username> <id>25420061</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find0": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="108">Expression error: Unexpected < operator.<noinclude>
Template:Documentation</noinclude></text>
<sha1>sert5g7f8gacqtv1cs6edj7iu0d5b97</sha1> </revision> </page> <page> <title>Template:Str left</title> <ns>10</ns> <id>21696393</id> <revision> <id>741880261</id> <parentid>605122708</parentid> <timestamp>2016-09-30T07:01:19Z</timestamp> <contributor> <username>Ymblanter</username> <id>14596827</id> </contributor> <minor/> <comment>Changed protection level of Template:Str left: Highly visible template: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="184"><includeonly></includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1> </revision> </page> <page> <title>Template:Str rep</title> <ns>10</ns> <id>24238435</id> <revision> <id>656461393</id> <parentid>656457182</parentid> <timestamp>2015-04-14T16:35:55Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <minor/> <comment>Protected Template:Str rep: Highly visible template: 167176 transclusions ([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="100">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>8aojqr2n3b0gv6drwu3safb8kuckf72</sha1> </revision> </page> <page> <title>Template:Taxobox/Error colour</title> <ns>10</ns> <id>29546546</id> <revision> <id>758431105</id> <parentid>740191216</parentid> <timestamp>2017-01-05T11:32:08Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated HTML comment</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="462"><includeonly>transparent; text-align:center; border: 2px solid red; error:colour</includeonly><noinclude><!--
-- The caller template must check invalid -- {{{colour}}} value to link because -- a wp:wikitable column format cannot contain a wikilinked page or category, -- as of September 2016. -- -- See check of {{{colour}}} in template {Taxobox/core}. -->Template:Documentation</noinclude></text>
<sha1>n8owfylnwasbq6p09fhl83wjdp5npqe</sha1> </revision> </page> <page> <title>Template:Taxobox/core</title> <ns>10</ns> <id>29471370</id> <revision> <id>809123045</id> <parentid>809122889</parentid>
<timestamp>2017-11-07T07:14:13Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>try again</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="21914">{| class="infobox biota" style="text-align: left; width: 200px; font-size: 100%"
|- ! colspan=2 style="text-align: center" | Taxobox |-
|- colspan=2 style="text-align: center"
|- |- ! colspan=2 style="min-width:15em; text-align: center" | Scientific classification |-
|-
|-
|- style="text-align: center"
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
| colspan=2 style="text-align: center" | Script error: No such module "InfoboxImage". |-
|-
|}<!--
Define any categories to be displayed on the page here:
--><noinclude>Template:Documentation</noinclude></text>
<sha1>a2rm1euf6a6qovdh8d23gr3qknia9s4</sha1> </revision> </page> <page> <title>Template:Taxobox/doc</title> <ns>10</ns> <id>7342865</id> <revision> <id>839167972</id> <parentid>837111256</parentid> <timestamp>2018-05-01T18:24:33Z</timestamp> <contributor> <username>Plantdrew</username> <id>14423536</id> </contributor> <comment>update transclusion count</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="85800">Template:Redirect
Template:Documentation subpage <includeonly>Template:High-risk</includeonly> <noinclude>Template:MoS guideline</noinclude> Template:Intricate template
This template sets up a manual taxobox, as a right-side infobox table setting out the biological classification (taxonomy) for a group of living things. For guide to automated taxoboxes, see WP:Automated taxobox system/intro.
Although with a choice of over 160 parameters, the implementation is complicated, it is relatively simple to use. <!--For an example in practice, look at the edit page of "Killer whale" – [2].--> Most parameters are optional, so if a particular entry is not relevant for your case, just leave it out. See below section "All parameters" for a complete list.
This guide has come out of WikiProject Tree of life.
Usage[edit source]
Note that parameters in this template are case-sensitive. <pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Colors are automatically assigned based on the table below.
Template:Taxobox colour scheme
Quick start and examples[edit source]
Animals[edit source]
Animal species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Animal higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Plants[edit source]
The majority of plants are angiosperms ("flowering plants"). Wikipedia:WikiProject Plants consensus is to use the Angiosperm Phylogeny Group's APG III classification system for angiosperms. The APG III system does not have formally named divisions or classes, but includes several hierarchically nested, informally named clades. The hierarchy of informally named clades is presented by using parameters such as Template:Para in place of formal rank parameters. Articles on non-flowering plants (e.g. conifers, ferns) should continue to use formal divisions and classes in the Taxobox.
Flowering plant species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Flowering plant higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Parameters[edit source]
Name[edit source]
Provided under this parameter should be the single most common vernacular name when one is in widespread use, or a single current scientific name otherwise.
- Common names of higher taxa are always given in sentence case (rather than title case) and in the plural (e.g. marine hatchetfishes).
- Common names of species and subspecies are also to be given in sentence case but in the singular (e.g. black crowned crane, Colorado potato beetle).
The name parameter should not be used to incorporate more than one name. It is only a header and not meant to be an inclusive "names" field. One will suffice. Please assess the relevant literature in deciding which.
Color[edit source]
The color is automatically assigned based on the entry for a number of ranks from Template:Para upwards (see Template:Taxobox); there is normally no need to specify it manually, although Template:Para can be used.
Template:Taxobox colour scheme
Classification[edit source]
As noted above, the classification section includes some or all of the following:
<pre style="overflow:auto"> | regnum = | phylum = | classis = | ordo = | familia = | genus = | species = </pre>
Each entry corresponds to a containing group, except for the last, which should be the group under consideration. Note the entries use the Latin names for the ranks, to make porting between Wikipedias easier. Thus the above correspond to the kingdom, phylum, class, order, family, genus, and species.
Template loop detected: Template:Taxobox
Taxoboxes should include all major ranks above the taxon described in the article, plus minor ranks that are important to understanding the classification of the taxon described in the article, or which are discussed in the article. Other minor ranks should be omitted.
For example, in the taxobox for the genus Formica, it's appropriate to include entries for tribe and subfamily, since those are an aid to understanding how Formica relates to other genera in the family Formicidae. But it wouldn't be appropriate to include the superorder Endopterygota, since all genera of ants are in that superorder; it isn't particularly interesting at this level.
Another example is the subfamily Bambusoideae, the bamboos. This subfamily probably should be mentioned in the taxobox of every bamboo species, since it is a major grouping in this context, despite its minor rank.
Minor ranks are included in the same way as major ranks, for example:
<pre style="overflow:auto"> | classis = ... | subclassis = ... | superordo = ... | ordo = ... </pre>
Note that species and subspecies should be given using the abbreviated forms of their name — e.g. H. sapiens, H. s. sapiens. The epithets should not be given by themselves. The full form of the species or subspecies name is given in the binomial or trinomial section.
See #All parameters for a complete list.
Classification status[edit source]
With the Template:Para parameter, it is possible to introduce extra text within parentheses after "Scientific classification". For example, Template:Para will produce "Scientific classification (disputed)". See Veratalpa for a current example where this parameter is used. This parameter should only be used when the "Scientific classification" text would be misleading without it.
Divisions and sections[edit source]
These ranks have different meanings in zoology and botany.
In botany:
- Use divisio for division (a rank above class and below kingdom)
- Use sectio for section (a rank above species and below genus)
Note: Certain very large genera, e.g. Rhododendron include subsections
In zoology:
- Use zoodivisio for division (a rank above family and below order)
- Use zoosectio for section (a rank above family and below order)
Unranked taxa[edit source]
For each major taxon from family to phylum, you can add an unranked entry to the taxobox. The entry <tt>unranked_X</tt> appears above rank X, for example <tt>unranked_superfamilia</tt> appears above family and superfamily and below order, suborder, infraorder, etc.:
<pre style="overflow:auto"> | ordo = | unranked_superfamilia = | familia = </pre>
For animals and non-flowering plants, use unranked taxa sparingly. The need to include unranked taxa generally indicates that you are following phylogenetic nomenclature. It is usually better to abbreviate the classification to the major ranks and then discuss the classification in more detail in the article.
Unranked taxa of flowering plants[edit source]
Flowering plants (angiosperms) make frequent use of unranked taxa. The APG III system of classification used for flowering plants on Wikipedia does not have formally named ranks above order - e.g. divisions, classes, subclasses - but includes several hierarchically nested, informally named and unranked clades. For flowering plants the taxobox should include Template:Para in place of Template:Para, Template:Para in place of Template:Para, and possibly also Template:Para in place of Template:Para. Flowering plant taxoboxes may often include three to four informal hierarchical groups above the rank of order, making the use of Template:Para necessary, which sorts itself just above Template:Para where a formally named order is displayed. The unranked parameters only include ranks in their parameter names, such as "unranked divisio" to allow the editor to place content hierarchically; no approximation of rank is intended by the use of these parameter names. For flowering plant articles using the APG III system of classification, the regular parameters including Template:Para, Template:Para, and Template:Para should not be used or it will display between these unranked APG III clades.
To comply with #Classification above and its advice on the inclusion of major ranks, the following are considered major ranks in APG III and currently included in the appropriate flowering plant taxoboxes:
- Angiosperms
- Magnoliids
- Monocots
- Eudicots
- Core eudicots (displayed as a major rank when the plant is not included further nested in rosids or asterids)
Note: The rosids contain two clades, the fabids (also known as eurosids I) and malvids (also known as eurosids II), and the asterids contain two further clades, the lamiids (euasterids I) and campanulids (euasterids II). These are considered to be minor ranks and are only to be displayed on the articles on orders or families they immediately contain.
A taxobox for a flowering plant will thus generally include the following parameters: <pre style="overflow:auto"> | regnum = Plantae | unranked_divisio = Angiosperms | unranked_classis = | unranked_ordo = | ordo = </pre>
Viruses[edit source]
Viruses follow a slightly different system. They are not placed in taxa above the rank of order, and instead are treated in seven groups based on the type of nucleic acid they contain, referred to by the Roman numerals i to vii. These can be included in the taxobox using the Template:Para parameter. This also changes the link from scientific to virus classification, so it should not appear on boxes for non-viruses, even if it is left blank.
<pre style="overflow:auto"> | virus_group = iv </pre>
Bold/italic markup[edit source]
Italicization must be done manually in all parameters. If the entry for genus or species (with manually added italics) matches the page title,<ref group=note>If the page is called, for example, "Homo (genus)", then the taxobox will display "Homo" and the page title "Homo (genus)".</ref> then the name of the taxobox and the title of the page will be italicized. Note that if the Template:Para parameter is used the page title will not be automatically
italicized. The taxobox's name will be set to exactly what is specified in Template:Para – italics must be specified manually in this case.
Genus, species, and subspecies should be italicized whenever used, as is the biological standard. For instance, we talk about the genus Homo, the species Homo sapiens, and the subspecies Homo sapiens sapiens.
- In botany, it is important to include the rank for taxa below species. The rank is not italicized, e.g. Genus species subsp. subspecies var. variety.
- Some bacteria that have been characterized but not formally named are given Candidatus names. These should be written in the form Candidatus Genus species, rather than italicized normally.
Higher taxa like families may or may not be italicized in different publications. The prevalent standard for Wikipedia is not to italicize them, except in the case of viruses and other infectious particles.
Bolding is used to indicate the subject of the article. The Template:Para, Template:Para, and Template:Para parameters bold automatically. In the placement section – Template:Para through Template:Para – the final taxon should be bolded, as well as any higher groups that only include the final taxon. See green sulfur bacteria for an example.
Subdivisions[edit source]
Template loop detected: Template:Taxobox Groups above the rank of species (and even species if there are several notable subspecies) should usually include a list of subgroups. Use the Template:Para parameter for the list. The list can be formatted using a number of templates, such as the specialized Template:Tl and Template:Tl, which deal with authorities as well (see the documentation at Template:Taxon list for variant templates), or using a general list template such as Template:Tl. Use the Template:Para parameter to say what rank the subgroups have. For instance, for families in an order:
<pre style="overflow:auto"> | subdivision_ranks = Families | subdivision =
Template:Linked taxon list
</pre>
For lists with more than a few subgroups, the list can be bracketed with Template:Tl and Template:Tl, which will split the list into two columns (see Nettle example at right). In cases where a list would make the taxobox too long, or where the classification is too variable to allow a brief summary, the list should be replaced with a comment like "See text" or the subdivision section should be omitted. As a rule of thumb, when there are more than 100 subgroups the list should be in a separate article.
In cases where the classification is variable, a description like "Typical orders" or "Notable orders" may be used.
In cases where the ranks are uncertain, a description like "Subgroups" or "Taxa" may be preferable. Sometimes it is convenient to represent more than one level of classification in the list. In that case the lower level groups are moved over to the right by prefixing them with &nbsp; characters – usually three for the first level of indentation, and then one to three more for each subsequent level. Major grades may also be represented by bolded headers, as on plant and heterokont. Remember, though, these should mainly be done when the intermediate rank subgroups are not worthy of separate articles; taxoboxes are too small to include too much duplicate information.
Conservation status[edit source]
Conservation status may optionally be included; you can search the IUCN's database of threatened species to find the conservation status of many organisms. It is included via the Template:Para parameter, which takes a code or template. It is not appropriate for prehistoric organisms – the Template:Para parameter may be a more sensible option.
<pre style="overflow:auto;"> |status = code |status_system = classification system (see below)) – required |status_ref = <ref>...</ref> – optional |extinct = year of extinction – optional (only use if |status=EX and year of extinction is known) </pre>
Use the above syntax, choosing one of the status codes from the code list below. The code may be all upper or lower case, but the cases used in the table are preferred.
The following status codes are available (the third column shows the category that is automatically added to the article):
Status (as shown in taxobox) Code Category assigned Secure secure<ref name="invalid" group="IUCN" /> Domesticated DOM<ref name="invalid" group="IUCN" /> Category:Domesticated animals Least Concern (LC) LC Least Concern (LR/lc) LR/lc Near Threatened (NT) NT Near Threatened (LC/nt) LR/nt Conservation Dependent (LR/cd) LR/cd Vulnerable (VU) VU Endangered (EN) EN Category:Endangered species Critically Endangered CR Category:Critically endangered species Critically Endangered (CR), possibly extinct PE Category:Critically endangered species Extinct in the wild (EW) EW Category:Species extinct in the wild Extinct EX Data deficient (DD) DD Not evaluated (NE) NE Fossil fossil<ref name="invalid" group="IUCN">This is not a valid IUCN Red List category</ref><ref name="fossil" group="IUCN">Template:Para is deprecated in favour of Template:Para Template:Tlx (see the #Fossil range section below).</ref> Prehistoric pre<ref name="invalid" group="IUCN" /> See text See text<ref name="invalid" group="IUCN" /> Lower Risk <s>LR</s><ref name="invalid" group="IUCN" /><ref name="LR" group="IUCN">Template:Var is deprecated; use Template:Var or Template:Var or Template:Var instead.</ref>
- Notes
System[edit source]
Template:Main The criteria used by the IUCN should also be specified:
<pre style="overflow:auto">
| status_system = IUCN3.1 or | status_system = IUCN2.3 <!-- deprecated for new boxes, although some taxoboxes still exist and are supported for this version -->
</pre>
This parameter is required in order to display the proper conservation status graphic. Failure to use this parameter will result in no graphic appearing.
Other systems are listed at Wikipedia:Conservation status.
Referencing conservation status[edit source]
To add a reference for the status, use:
<nowiki> | status_ref = <</nowiki>ref<nowiki>>{{</nowiki>Cite journal<nowiki> | author = |title = | journal = The IUCN Red List of Threatened Species | volume = | page = | publisher = International Union for Conservation of Nature | date = | url = | doi = | access-date = }}</ref></nowiki>
See Template:Tlx or Template:Tlx for the parameters you need to supply to that template. And don't forget that Template:Xtag requires a corresponding Template:Tlx or Template:Xtag in the References section.
Fossil range[edit source]
The stratigraphic range for groups known as fossils may also be included, using the Template:Para parameter. For instance, for a group known from the Cambrian to the Permian:
<pre style="overflow:auto">
|fossil_range = Cambrian–Permian
</pre>
You may wish to add a
diagrammatic representation of the fossil range (as shown below), which can be created using the Template:Tl template, for example:
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
or
<pre style="overflow:auto">
| fossil_range = Template:Fossil range Cambrian–Permian
</pre>
For extant taxa that continue into the present day, the ending period should be set to "Recent" or as "Holocene" for Late Quaternary extinctions such as the moa, and the current status should be indicated using the Template:Para parameter.
For groups that only existed during a single period, simply list it without giving a range: e.g.: Template:Image frame
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
Images[edit source]
An image can be included using the parameter Template:Para. It is highly recommended that an image be provided if one is available. Do not include the "File:" part of the image file name!
If an image is included, alt text should be provided using parameter "Template:Para". Alt text should not repeat the caption; instead, it should describe the image contents to someone who can't see it (see WP:ALT).
A caption can be provided using parameter "Template:Para". A caption need not be provided if it would just repeat the title of the article. It should be provided if it can convey any additional information about the image, such as the sex or life stage of the individual, the location where the picture was taken, the artist (if an engraving or other illustration), or (for higher taxa) the particular species depicted. <pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana </pre>
By default, the image width is determined by each user's default thumbnail size preference. In general, it is recommended that these preferences be honoured. In some cases, however, it may be desirable to overrule the default size; this can be achieved by use of the Template:Para parameter, which scales the image. Thus Template:Para makes the image 10% larger than the user's default thumbnail size; Template:Para makes it 25% smaller. See MOS:IMGSIZE for more information.
<pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana | image_upright = 1.45 </pre>
Long or complex image captions, which should rarely be necessary, look better when left-aligned. This can be achieved using "Template:Para".
A second image may be added by use of the Template:Para, Template:Para, Template:Para and Template:Para parameters. Use this sparingly, and only when the article is long enough, and when it makes sense to include the second image inside the taxobox and not later in the article. Camel is a good example (a genus with two well-known representatives). A second image may also be useful for species that display sexual dimorphism so that both a male and female representative could be shown, e.g. Northern cardinal.
Authorities[edit source]
Generally, an authority should be given only for the taxa covered by the article. Higher groups which only include the article subject should also list authorities unless those are the same as for the taxa in question. In the case of species (or subspecies) the authority may be given in the binomial (or trinomial) section. Otherwise authorities may be listed in the placement section. For instance, for an order:
<pre style="overflow:auto"> | ordo = | ordo_authority = </pre>
The following examples illustrate the different conventions for names, dates, and punctuations in the different kingdoms.
- Animalia
- Plantae
- Bacteria
- Original name valid: Vibrio cholerae <small>R. Koch 1883</small>
- Organism reclassified: Streptococcus pneumoniae <small>(Klein 1884) Chester 1901</small> (originally Micrococcus pneumoniae)
- Old name revived: Salmonella enterica <small>(ex Kauffmann & Edwards 1952) Le Minor & Popoff 1987</small>
Authorities in scientific names are also abbreviated according to different standards for plants and animals. To decipher standard abbreviations, see
- List of botanists by author abbreviation or consult the International Plant Names Index.
- List of zoologists by author abbreviation
For more information refer to the article on binomial nomenclature.
Diversity[edit source]
In higher taxa, and taxa where the subdivision option does not indicate number of species, the Template:Para parameter may be used. This needs to be accompanied by Template:Para which links to an appropriate page, usually a List of ... species page. See, for example, Banksia: the subdivision lists only two subgenera, so the Template:Para option is used to specify the number of species.
<pre style="overflow:auto; font-size:80%"> | diversity_link = List of Quercus species | diversity = c. 120 species </pre>
It is not a good idea to be too precise about the number of species. New species are still being regularly described in many groups. Moreover, changing systematic treatment is liable to alter the species number even in well-known genera. Rounding off the species number and denoting this as approximate value will help decreasing maintenance.
Use the Template:Para parameter to give references for the number of species, for example: <pre style="overflow:auto; font-size:80%"> | diversity_ref = <nowiki><ref></nowiki>Hershler and Longley, 1986, p. 127<nowiki></ref></nowiki> </pre>
Range maps[edit source]
A range map may be included at the end of the taxobox. This uses the Template:Para, Template:Para, Template:Para, and Template:Para parameters, in the same manner as an image. Specifying range map width is unnecessary in most cases. See Leopard (land animal), Northern flicker (non-migratory bird), Lesser spotted eagle (migratory bird) and Killer whale (water animal) for examples.
<pre style="overflow:auto"> | range_map = Map.jpg | range_map_upright = 1.1 | range_map_alt = Map showing ... | range_map_caption = Range of ... </pre>
Up to four range maps can be included, via additional parameters such as Template:Para, Template:Para, etc.
You can generate maps using an appropriate blank map such as Image:BlankMap-World-noborders.png. Do not make the distribution map too large (a width of 300 to 400 should be sufficient, the purpose of the map being a rough global overview; more detailed maps can always go to the article body) and add the map to Category:Habitat maps, or, preferably, if you upload the map to Commons, to commons:Category:Animal distribution maps.
Synonyms[edit source]
Where a species has synonyms, the Template:Para parameter may be used. The list of synonyms can be formatted using the same approach as for Subdivisions, but synonyms should not normally be linked, so e.g. Template:Tl should be used for taxa whose names aren't italicized and Template:Tl for those whose names are.
<source lang="html" style="overflow:auto"> | synonyms =
Template:Species list
</source>
Nomenclator Zoologicus has data for all but the most recently established animal genera. This may be hard to understand for non-specialists, but it is a comprehensive source for the authorship of genus names, both valid ones and junior synonyms. Sometimes one will note that a new name has been established because the older, original name was "preoccupied". This means it has already been established for another taxon of the same rank in the same kingdom before – even if that name is now a synonym too. Taxa that preoccupy a name can be linked in the Synonyms section, such as Stenorhynchus here.
Use Template:Para to give references for the synonym list, for example: <pre style="overflow:auto; font-size:80%"> | synonyms_ref = <nowiki><ref></nowiki>Smith and Jones, 2009, p. 5 <nowiki></ref></nowiki> </pre>
Type species[edit source]
When the type species of a genus (or larger grouping) is known, the Template:Para and Template:Para can be used.
For botanical entries, i.e. names under the International Code of Nomenclature for algae, fungi, and plants
(ICN), the currently accepted name in the genus should be used. The term "type species" does not occur in the ICN, but is used here for convenience. The Index Nominum Genericorum is a useful source of information and can be used as a reference.
For animal entries, i.e. names under the International Code of Zoological Nomenclature (ICZN), the type species should be the Template:Em binomial name of the type species, but linked to its current article, and the authority should be plain (no parentheses). See Mirza for a type species example.
<pre style="overflow:auto"> | type_species = the original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature | type_species_authority = </pre>
This follows ICZN Recommendation 67B; be aware that this means the taxon used by the genus' original author – even if it is now invalid, e.g. a junior synonym. Ideally, it should only be used if the genus' original description can be verified first-hand. As per the following example given by the ICZN:
<blockquote>Astacus marinus Fabricius, 1775, one of the nominal species originally included in the decapod crustacean genus Homarus Weber, 1795, was subsequently designated by Fowler (1912) as the type species of Homarus. The type species is, and should be cited as, Astacus marinus Fabricius, 1775. Astacus marinus Fabricius is currently synonymized with Cancer gammarus Linnaeus, 1758, but the latter is not the type species of Homarus and should not be cited as such. If mention of the type species is required it should be made in some such manner as "Type species Astacus marinus Fabricius, 1775, a junior synonym of Cancer gammarus Linnaeus, 1758"; or "Type species Astacus marinus Fabricius, 1775, now regarded as a synonym of Homarus gammarus (Linnaeus, 1758)".</blockquote>
If you do not completely understand what this all means, please do not use this parameter. Instead, if possible denote the type species in the species listing, for example with a
<pre><small>(type species)</small></pre>
after the species' (currently valid) name.
Italic page titles[edit source]
If the value of Template:Para, Template:Para, or Template:Para exactly matches the title of the page, and Template:Para is unspecified, the taxobox and page title will be italicized automatically.<ref group=note>See note 1; the title of the page will be italicized using the <nowiki>Template:DISPLAYTITLE</nowiki> magic word. When the page name contains the disambiguator "(alga)" or "(genus)", this disambiguator will not be italicized (e.g., Ia (genus)).</ref> If necessary, it is also possible to force the page title to display in italics using the Template:Tl template.
If the Template:Para parameter is present, then the taxobox will display whatever is in Template:Para; the page title will NOT be italicized unless Template:Tl is used.
Complete blank template[edit source]
This section gives all parameters in the order that they will appear in the taxobox. No taxobox should use all of these. Keep it short! Note that parameters in this template are case-sensitive.
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre>
All parameters[edit source]
The full list of parameters is illustrated inside the infobox above, in the "Complete blank template".
color - typical color code <tr> name - name defaults to <nowiki>Taxobox</nowiki><tr> status - conservation status code <tr> status_system - status-system type <tr> status_ref - status reference <tr> regnum - (standard) kingdom name <tr> phylum - (standard) phylum name <tr> classis - (standard) class name <tr> ordo - (standard) order name <tr> familia - (standard) family name <tr> genus - (standard) genus name <tr> species - (standard) species name <tr> fossil_range - (as shown at top of box) <tr> image - (as shown in box) <tr> image_upright - (as shown in box) <tr> image_alt - (as shown in box) <tr> image_caption - (as shown in box) <tr> image2 - (as shown in box) <tr> image2_upright - (as shown in box) <tr> image2_alt - (as shown in box) <tr> image2_caption - (as shown in box) <tr> classification_status - (as shown in box) <tr> virus_group - (as shown in box) <tr> superdomain - (as shown in box) <tr> superdomain_authority - (as shown in box) <tr> unranked_superdomain - (as shown in box) <tr> unranked_superdomain_ authority - (as shown in box) <tr> domain - (as shown in box) <tr> domain_authority - (as shown in box) <tr> unranked_regnum - (as shown in box) <tr> unranked_regnum_authority - (as shown in box) <tr> superregnum - (as shown in box) <tr> superregnum_authority - (as shown in box) <tr> regnum_authority - (as shown in box) <tr> subregnum - (as shown in box) <tr> subregnum_authority - (as shown in box) <tr> unranked_phylum - (as shown in box) <tr> unranked_phylum_authority - (as shown in box) <tr> superdivisio - (as shown in box) <tr> superdivisio_authority - (as shown in box) <tr> superphylum - (as shown in box) <tr> superphylum_authority - (as shown in box) <tr> divisio - (as shown in box) <tr> divisio authority - (as shown in box) <tr> unranked_divisio - (as shown in box) <tr> unranked_divisio_authority - (as shown in box) <tr> phylum_authority - (as shown in box) <tr> subdivisio - (as shown in box) <tr> subdivisio_authority - (as shown in box) <tr> subphylum - (as shown in box) <tr> subphylum_authority - (as shown in box) <tr> infraphylum - (as shown in box) <tr> infraphylum_authority - (as shown in box) <tr> microphylum - (as shown in box) <tr> microphylum_authority - (as shown in box) <tr> nanophylum - (as shown in box) <tr> nanophylum_authority - (as shown in box) <tr> unranked_classis - (as shown in box) <tr> unranked_classis_authority - (as shown in box) <tr> superclassis - (as shown in box) <tr> superclassis_authority - (as shown in box) <tr> classis_authority - (as shown in box) <tr> unranked_subclassis - (as shown in box) <tr> unranked_subclassis_authority - (as shown in box) <tr> subclassis - (as shown in box) <tr> subclassis_authority - (as shown in box) <tr> unranked_infraclassis - (as shown in box) <tr> unranked_infraclassis_authority - (as shown in box) <tr> infraclassis - (as shown in box) <tr> infraclassis_authority - (as shown in box) <tr> unranked_ordo - (as shown in box) <tr> unranked_ordo_authority - (as shown in box) <tr> magnordo - (as shown in box) <tr> magnordo_authority - (as shown in box) <tr> superordo - (as shown in box) <tr> superordo_authority - (as shown in box) <tr> ordo_authority - (as shown in box) <tr> subordo - (as shown in box) <tr> subordo_authority - (as shown in box) <tr> infraordo - (as shown in box) <tr> infraordo_authority - (as shown in box) <tr> parvordo - (as shown in box) <tr> parvordo_authority - (as shown in box) <tr> zoodivisio - (as shown in box) <tr> zoodivisio_authority - (as shown in box) <tr> zoosectio - (as shown in box) <tr> zoosectio_authority - (as shown in box) <tr> zoosubsectio - (as shown in box) <tr> zoosubsectio_authority - (as shown in box) <tr> unranked_superfamilia - (as shown in box) <tr> unranked_superfamilia_authority - (as shown in box) <tr> superfamilia - (as shown in box) <tr> superfamilia_authority - (as shown in box) <tr> familia_authority - (as shown in box) <tr> subfamilia - (as shown in box) <tr> subfamilia_authority - (as shown in box) <tr> unranked_tribus - (as shown in box) <tr> unranked_tribus_authority - (as shown in box) <tr> supertribus - (as shown in box) <tr> supertribus_authority - (as shown in box) <tr> tribus - (as shown in box) <tr> tribus_authority - (as shown in box) <tr> subtribus - (as shown in box) <tr> subtribus_authority - (as shown in box) <tr> alliance - (as shown in box) <tr> alliance_authority - (as shown in box) <tr> unranked_genus - (as shown in box) <tr> unranked_genus_authority - (as shown in box) <tr> genus_authority - (as shown in box) <tr> subgenus - (as shown in box) <tr> subgenus_authority - (as shown in box) <tr> sectio - (as shown in box) <tr> sectio_authority - (as shown in box) <tr> subsectio - (as shown in box) <tr> subsectio_authority - (as shown in box) <tr> series - (as shown in box) <tr> series_authority - (as shown in box) <tr> subseries - (as shown in box) <tr> subseries_authority - (as shown in box) <tr> species_group - (as shown in box) <tr> species_group_authority - (as shown in box) <tr> species_subgroup - (as shown in box) <tr> species_subgroup_authority - (as shown in box) <tr> species_complex - (as shown in box) <tr> species_complex_authority - (as shown in box) <tr> species_authority - (as shown in box) <tr> subspecies - (as shown in box) <tr> subspecies_authority - (as shown in box) <tr> variety - (as shown in box) <tr> variety_authority - (as shown in box) <tr> forma - (as shown in box) <tr> forma_authority - (as shown in box) <tr> diversity_ref - (as shown in box) <tr> diversity - (as shown in box) <tr> diversity_link - (as shown in box) <tr> binomial - (as shown in box) <tr> binomial_authority - (as shown in box) <tr> trinomial - (as shown in box) <tr> trinomial_authority - (as shown in box) <tr> type_genus - (as shown in box) <tr> type_genus_authority - (as shown in box) <tr> type_species - (as shown in box) <tr> type_species_authority - (as shown in box) <tr> subdivision - (as shown in box) <tr> subdivision_ranks - (as shown in box) <tr> type_strain - (as shown in box) <tr> range_map - 1st map, bottom of box <tr> range_map_upright - 1st map scaling = 0.9 i.e. 90% of default size<tr> range_map_alt - 1st map ALT= text<tr> range_map_caption - 1st caption, under picture<tr> binomial2 - (as shown in box) <tr> binomial2_authority - (as shown in box) <tr> range_map2 - 2nd map in box <tr> range_map2_upright - 2nd map scaling = 0.9 <tr> range_map2_alt - 2nd map ALT= text <tr> range_map2_caption - 2nd map caption <tr> binomial3 - (as shown in box) <tr> binomial3_authority - (as shown in box) <tr> range_map3 - 3rd map in box <tr> range_map3_upright - 3rd map scaling = 0.9 <tr> range_map3_alt - 3rd map ALT= text <tr> range_map3_caption - 3rd maq caption <tr> binomial4 - (as shown in box) <tr> binomial4_authority - (as shown in box) <tr> range_map4 - 4th map in box <tr> range_map4_upright - 4th map scaling = 0.9 <tr> range_map4_alt - 4th map ALT= text <tr> range_map4_caption - 4th map caption <tr> synonyms_ref - reference for synonyms <tr> synonyms - (as at bottom of box)
Articles lacking taxoboxes[edit source]
For articles lacking taxoboxes, add Template:Missing-taxobox to the talk page. This may be done by typing <nowiki>Template:Missing-taxobox</nowiki> or <nowiki>Template:Needtaxobox</nowiki> at the top of the talk page.
Microformat[edit source]
Template Data[edit source]
Template:TemplateData header <templatedata> { "description": "An infobox for plants, animals and other biological taxa", "params": { "name":
{
"label": "Name", "description": "For plants, see Wikipedia:Naming conventions (flora). For all other living things, the name should be the most common vernacular name, when one is in widespread use, and a scientific name otherwise.", "type": "string" }, "image": { "label": "Image", "description": "An image to use, do not include the 'File:' part of the image file name.", "type": "wiki-file-name", "required": false, "suggested": true }, "image_width": { "label": "Image Width", "description": "(Deprecated) Width to display the image at. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "image width" ], "required": false, "deprecated": "Use image_upright" }, "image_upright": { "label": "Image Upright scale", "description": "Scale to display the image at. e.g. 1.1", "type": "string", "aliases": [ "image upright" ], "required": false }, "image_alt": { "label": "Image alt text", "description": "Alt text which describes the image to someone who can't see it", "type": "string", "aliases": [ "image alt" ], "required": false }, "image_caption": { "label": "Image caption", "description": "Caption displayed under the image", "type": "string", "suggested": true }, "image_caption_align": { "label": "Image caption alignment", "description": "Alignment of the caption displayed under the image, e.g. left. Should not normally be set.", "type": "string", "aliases": [ "image caption alignment" ], "required": false, "deprecated": true }, "regnum": { "label": "Kingdom", "description": "Kingdom: Animalia, Plantae, Fungi, other taxa may want to use domain or other ranks instead", "type": "string", "required": false }, "divisio": { "label": "Division", "description": "Division in botany, e.g. Bryophyta. Not for flowering plants using the APG III system", "type": "string", "required": false }, "phylum": { "label": "Phylum", "description": "Phylum in zoology, eg Chordata for chordates", "type": "string", "required": false }, "classis": { "label": "Class", "description": "Class/classis taxonomic rank", "type": "string", "required": false }, "ordo": { "label": "Order", "description": "Order/ordo taxonomic rank", "type": "string", "required": false }, "familia": { "label": "Family", "description": "Family/familia taxonomic rank", "type": "string", "required": false }, "genus": { "label": "Genus", "description": "Genus taxonomic rank, in italics, e.g. Homo", "type": "string", "required": false }, "species": { "label": "Species", "description": "Species taxonomic rank. Should be given in abbreviated forms and in italics, e.g. H. sapiens.", "type": "string", "required": false }, "binomial": { "label": "Binomial", "description": "Full binomial name of taxa, In full form with italics, e.g. Salix alba var. caerulea", "type": "string", "required": false }, "binomial_authority": { "label": "Binomial authority", "description": "Binomial authority using appropriate conventions, eg L. (for plants), Linnaeus, 1761 (for animals)", "type": "string", "required": false }, "range_map": { "label": "Range map", "description": "Map of range", "type": "string", "aliases": [ "range map" ], "required": false }, "range_map_width": { "label": "Range map width", "description": "Width to display range map. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "range map width" ], "required": false, "deprecated": true }, "range_map_alt": { "label": "Range map alt text", "description": "Alt text describing the range in words", "type": "string", "aliases": [ "range map alt" ], "required": false }, "range_map_caption": { "label": "Range map caption", "description": "Caption/key for the range map", "type": "string", "aliases": [ "range map caption" ], "required": false }, "status": { "label": "Conservation status", "description": "The conservation status code: 'secure', domesticated 'DOM', Least Concern 'LC', Lower Risk—Least Concern 'LR/lc', Near Threatened 'NT', Lower Risk—Near Threatened 'LR/nt', Lower Risk—Conservation Dependent 'LR/cd', Vulnerable 'VU', Endangered 'EN', Critically Endangered 'CR', Possibly Extinct 'PE', Extinct in the wild 'EW', Extinct 'EX', Data deficient 'DD', Not evaluated 'NE',Fossil 'fossil', Prehistoric 'pre', 'See text', Lower Risk 'LR'", "type": "string", "required": false }, "status_system": { "label": "Conservation status system", "description": "System used for Conservation status: 'IUCN3.1', 'IUCN2.3', 'EPBC' etc. Required if status given.", "type": "string", "aliases": [ "status system" ], "required": false }, "status_ref": { "label": "Status reference", "description": "Reference for status <ref>Template:Cite journal</ref>", "type": "string", "aliases": [ "status ref" ], "required": false }, "extinct": { "label": "Year of extinction", "description": "Year of extinction, if known", "type": "string", "required": false }, "fossil_range": { "label": "Fossil range", "description": "The stratigraphic range for groups known as fossils. E.g. Cambrian–Permian or Template:Fossil range to give a chart. Use 'Recent' for extant taxa and 'Holocene' for Late Quaternary extinctions.", "type": "string", "required": false }, "virus_group": { "label": "Virus group", "description": "Viruses not placed in taxa above the rank of order, instead a virus group is used, given by a Roman numeral from I to VII", "type": "string", "aliases": [ "virus group" ], "required": false }, "unranked_superdomain": { "label": "Unranked superdomain", "description": "For each major taxon you can add an unranked entry to the taxobox. The entry unranked X appears above rank X", "type": "string", "aliases": [ "unranked superdomain" ], "required": false }, "superdomain": { "label": "Superdomain", "description": "This and other minor ranks should only be used when they are important to understanding the classification of the taxon described in the article", "type": "string", "required": false }, "superdomain_authority": { "label": "Superdomain Authority", "description": "The authority used for this rank. Every rank has a rank authority field which are not currently listed", "type": "string", "aliases": [ "superdomain authority" ], "required": false }, "domain": { "label": "Domain", "description": "Domain for Archaea, Bacteria and Eukarya", "type": "string", "required": false }, "superregnum": { "label": "Superkingdom", "type": "string", "required":
false
}, "unranked_regnum": { "label": "Unranked kingdom", "type": "string", "required": false }, "subregnum": { "label": "Subkingdom", "type": "string", "required": false }, "superdivisio": { "label": "Superdivision", "type": "string", "required": false }, "superphylum": { "label": "Superphylum", "type": "string", "required": false }, "unranked_divisio": { "label": "Unranked division", "description": "For flowering plants using the APG IV system this should be set to Angiosperms rather than using division/divisio", "type": "string", "aliases": [ "unranked divisio" ], "required": false }, "unranked_phylum": { "label": "Unranked phylum", "type": "string", "required": false }, "subphylum": { "label": "Subphylum", "type": "string", "required": false }, "infraphylum": { "label": "Infraphylum", "type": "string", "required": false }, "microphylum": { "label": "Microphylum", "type": "string", "required": false }, "nanophylum": { "label": "Nanophylum", "type": "string", "required": false }, "superclassis": { "label": "Superclass", "type": "string", "required": false }, "unranked_classis": { "label": "Unranked class", "description": "For flowering plants using the APG IV system this should be used rather than class/classis", "type": "string", "aliases": [ "unranked classis" ], "required": false }, "unranked_subclassis": { "label": "Unranked subclass", "type": "string", "aliases": [ "unranked subclassis" ], "required": false }, "subclassis": { "label": "Subclass", "type": "string", "required": false }, "unranked_infraclassis": { "label": "Unranked infraclass", "type": "string", "aliases": [ "unranked infraclassis" ], "required": false }, "infraclassis": { "label": "Infraclass", "type": "string", "required": false }, "magnordo": { "label": "Magnorder", "type": "string", "required": false }, "superordo": { "label": "Superorder", "type": "string", "required": false }, "unranked_ordo": { "label": "Unranked order", "description": "Generally used for flowering plants using the APG IV system", "type": "string", "aliases": [ "unranked ordo" ], "required": false }, "subordo": { "label": "subordo", "type": "string", "required": false }, "infraordo": { "label": "infraordo", "type": "string", "required": false }, "parvordo": { "label": "parvordo", "type": "string", "required": false }, "zoodivisio": { "label": "zoodivision", "description": "Used in zoology, a different rank to the division used in botany.", "type": "string", "required": false }, "zoosectio": { "label": "zoosection", "description": "Used in zoology, a different rank to the section used in botany.", "type": "string", "required": false }, "zoosubsectio": { "label": "zoosubsection", "description": "Used in zoology, a different rank to the subsection used in botany.", "type": "string", "required": false }, "unranked_superfamilia": { "label": "Unranked Superfamily", "type": "string", "required": false }, "superfamilia": { "label": "Superfamily", "type": "string", "required": false }, "subfamilia": { "label": "Subfamily", "type": "string", "required": false }, "supertribus": { "label": "supertribus", "type": "string", "required": false }, "unranked_tribus": { "label": "unranked tribe", "type": "string", "aliases": [ "unranked tribus" ], "required": false }, "tribus": { "label": "Tribe", "type": "string", "required": false }, "subtribus": { "label": "Subtribe", "type": "string", "required": false }, "alliance": { "label": "alliance", "type": "string", "required": false, "deprecated": "Displays as a rank between subtribe and genus. " }, "unranked_genus": { "label": "Unranked genus", "type": "string", "aliases": [ "unranked genus" ], "required": false }, "subgenus": { "label": "Subgenus", "type": "string", "required": false }, "sectio": { "label": "Section", "description": "Used in botany, use zoosectio in zoology", "type": "string", "required": false }, "subsectio": { "label": "Subsection", "description": "Used in botany, use zoosubsectio in zoology", "type": "string", "required": false }, "series": { "label": "Series", "type": "string", "required": false }, "subseries": { "label": "Subseries", "type": "string", "required": false }, "species_group": { "label": "Species group", "type": "string", "aliases": [ "species group" ], "required": false }, "species_subgroup": { "label": "species subgroup", "type": "string", "aliases": [ "species subgroup" ], "required": false }, "species_complex": { "label": "species complex", "type": "string", "aliases": [ "species complex" ], "required": false }, "subspecies": { "label": "subspecies", "type": "string", "required": false }, "variety": { "label": "variety", "type": "string", "required": false, "deprecated": "use varietas" }, "forma": { "label": "form", "description": "Used in botany, not in zoology", "type": "string", "required": false }, "trinomial": { "label": "trinomial", "description": "The full trinomial name for subspecies, it should generally be in italics.", "type": "string", "required": false }, "trinomial_authority": { "label": "trinomial authority", "description": "The authority for a trinomial.", "type": "string", "aliases": [ "trinomial authority" ], "required": false }, "synonyms": { "label": "Synonyms", "description": "A list of synonyms for a species, e.g. species1 <small>Authority1</small><br/> species2 <small>Authority2</small>", "type": "string", "required": false }, "synonyms_ref": { "label": "Synonyms ref", "description": "References for the synonym lists, e.g.<ref>Smith and Jones, 2009, p. 5</ref>", "type": "string", "required": false }, "type_species": { "label":
"Type species",
"description": "The original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature.", "type": "string", "required": false }, "type_species_authority": { "label": "Type species authority", "description": "Authority for the type species, don't use parenthesis.", "type": "string", "aliases": [ "type species authority" ], "required": false }, "classification_status": { "label": "Classification status", "description": "Status of the scientific classification, e.g. disputed. Only use when the scientific classification text would be misleading without it.", "type": "string", "aliases": [ "classification status" ], "required": false }, "subdivision_ranks": { "label": "Subdivision ranks", "description": "Rank used for sub-divisions of this taxa, e.g. 'Families'", "type": "string", "aliases": [ "subdivision ranks" ], "required": false }, "subdivision": { "label": "Subdivision", "description": "List of sub divisions of this taxa, e.g. Family1<br/> Family2<br/> Family3", "type": "string", "required": false }, "image2": { "label": "Image 2", "description": "A second image, only use in rare circumstances.", "type": "string", "required": false }, "image2_width": { "label": "Image 2 Width", "description": "Deprecated. Width of the second image", "type": "number", "aliases": [ "image2 width" ], "required": false, "deprecated": true }, "image2_upright": { "label": "Image 2 Upright scale", "description": "Scale of the second image", "type": "number", "aliases": [ "image2 upright" ], "required": false }, "image2_alt": { "label": "Image 2 alt text", "description": "Alt text which describes the second image to someone who can't see it", "type": "string", "aliases": [ "image2 alt" ], "required": false }, "image2_caption": { "label": "Image 2 caption", "description": "Caption to display under the second image", "type": "string", "required": false }, "binomial2": { "label": "Binomial2", "description": "Second binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial2_authority": { "label": "Binomial authority 2", "description": "Authority of second binomial", "type": "string", "aliases": [ "binomial2 authority" ], "required": false }, "binomial3": { "label": "Binomial3", "description": "Third binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial3_authority": { "label": "Binomial authority 3", "description": "Authority of third binomial", "type": "string", "aliases": [ "binomial3 authority" ], "required": false }, "binomial4": { "label": "Binomial4", "description": "Fourth binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial4_authority": { "label": "Binomial authority 4", "description": "Authority of fourth binomial", "type": "string", "aliases": [ "binomial4 authority" ], "required": false }, "range_map2": { "label": "Range map 2", "description": "Second map of range", "type": "string", "aliases": [ "range map2" ], "required": false }, "range_map2_width": { "label": "Range map 2 width", "description": "Width of second range map", "type": "string", "aliases": [ "range map2 width" ], "required": false, "deprecated": true }, "range_map2_alt": { "label": "Range map 2 alt text", "description": "Alt text describing the second range map", "type": "string", "aliases": [ "range map2 alt" ], "required": false }, "range_map2_caption": { "label": "Range map 2 caption", "description": "Caption/key for the second range map", "type": "string", "aliases": [ "range map2 caption" ], "required": false }, "range_map3": { "label": "Range map 3", "description": "Third map of range", "type": "string", "aliases": [ "range map3" ], "required": false }, "range_map3_width": { "label": "Range map 3 width", "description": "Width of third range map", "type": "string", "aliases": [ "range map3 width" ], "required": false, "deprecated": true }, "range_map3_alt": { "label": "Range map 3 alt text", "description": "Alt text describing the third range map", "type": "string", "aliases": [ "range map3 alt" ], "required": false }, "range_map3_caption": { "label": "Range map 3 caption", "description": "Caption/key for the third range map", "type": "string", "aliases": [ "range map3 caption" ], "required": false }, "range_map4": { "label": "Range map 4", "description": "Forth map of range", "type": "string", "aliases": [ "range map4" ], "required": false }, "range_map4_width": { "label": "Range map 4 width", "description": "Width of forth range map", "type": "string", "aliases": [ "range map4 width" ], "required": false, "deprecated": true }, "range_map4_alt": { "label": "Range map 4 alt text", "description": "Alt text describing the forth range map", "type": "string", "aliases": [ "range map4 alt" ], "required": false }, "range_map4_caption": { "label": "Range map 4 caption", "description": "Caption/key for the fourth range map", "type": "string", "aliases": [ "range map4 caption" ], "required": false }, "color": { "label": "color", "description": "Generally not used as it is automatically assigned based on the entry for regnum, virus group, unranked phylum, phylum.", "type": "string", "required": false, "deprecated": true }, "genus_authority": { "label": "Genus authority", "type": "string" } }, "format": "Template:\n\n", "paramOrder": [ "name", "image", "image_width", "image_upright", "image_alt", "image_caption", "image_caption_align", "regnum", "divisio", "phylum", "classis", "ordo", "familia", "genus", "genus_authority", "species", "binomial", "binomial_authority", "range_map", "range_map_width", "range_map_alt", "range_map_caption", "status", "status_system", "status_ref", "extinct", "fossil_range", "virus_group", "unranked_superdomain", "superdomain", "superdomain_authority", "domain", "superregnum", "unranked_regnum", "subregnum", "superdivisio", "superphylum", "unranked_div isio", "unranked_phylum", "subphylum", "infraphylum", "microphylum", "nanophylum", "superclassis", "unranked_classis", "unranked_subclassis", "subclassis", "unranked_infraclassis", "infraclassis", "magnordo", "superordo", "unranked_ordo", "subordo", "infraordo", "parvordo", "zoodivisio", "zoosectio", "zoosubsectio", "unranked_superfamilia", "superfamilia", "subfamilia", "supertribus", "unranked_tribus", "tribus", "subtribus", "alliance", "unranked_genus", "subgenus", "sectio", "subsectio", "series", "subseries", "species_group", "species_subgroup", "species_complex", "subspecies", "variety", "forma", "trinomial", "trinomial_authority", "synonyms", "synonyms_ref", "type_species", "type_species_authority", "classification_status", "subdivision_ranks", "subdivision", "image2", "image2_width", "image2_upright", "image2_alt", "image2_caption", "binomial2", "binomial2_authority", "binomial3", "binomial3_authority", "binomial4", "binomial4_authority", "range_map2", "range_map2_width", "range_map2_alt", "range_map2_caption", "range_map3", "range_map3_width", "range_map3_alt", "range_map3_caption", "range_map4", "range_map4_width", "range_map4_alt", "range_map4_caption", "color" ] } </templatedata>
Supporting templates[edit source]
Tracking categories[edit source]
Hidden category added by Taxobox:
Hidden categories added by Taxobox/core:
Hidden categories added by Taxobox/species:
Hidden categories added by Taxobox/Error colour:
See also[edit source]
- Wikipedia:How to read a taxobox
- Wikipedia:Manual of Style/Infoboxes
- Template:Tl
- Automated taxobox system
<div style="display: none">Template:Reflist</div>
Notes[edit source]
<includeonly><!-- Categories below this line, please; interwikis at Wikidata --></includeonly><noinclude> </noinclude></text>
<sha1>6afkilzd4ifgvqza7rndjpt4vla93ce</sha1> </revision> </page> <page> <title>Template:Taxobox/species</title> <ns>10</ns> <id>24758980</id> <revision> <id>816767029</id> <parentid>775239827</parentid> <timestamp>2017-12-23T14:52:37Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>lower-case cat names per 2011 RFC that moved these categories</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="25863"><noinclude>Template:Documentation</noinclude></text> <sha1>blif8wgwyyodyvosdqfafwqlg86qhx4</sha1> </revision> </page> <page> <title>Template:Taxobox colour</title> <ns>10</ns> <id>12033623</id> <revision> <id>815446650</id> <parentid>755798033</parentid> <timestamp>2017-12-14T21:46:36Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>simplifying per Template talk:Taxobox#Colors</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="739"><includeonly>Template:Taxobox/Error colour<!--
--></includeonly><noinclude> Template:Template doc</noinclude></text>
<sha1>d3sx0a9ckwn8woa6b1351hr88ok2gsk</sha1> </revision> </page> <page> <title>Template:Taxobox colour scheme</title> <ns>10</ns> <id>14799909</id> <revision> <id>821289122</id> <parentid>821288988</parentid> <timestamp>2018-01-19T15:14:49Z</timestamp> <contributor> <username>Zzuuzz</username> <id>365454</id> </contributor> <minor/> <comment>Changed protection level for "Template:Taxobox colour scheme": High risk template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1660">{| class="wikitable"
|- ! style="background:Template:Taxobox colour" | Viruses || Template:Taxobox colour |also Viroids |- ! style="background:Template:Taxobox colour" | Bacteria || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaea || Template:Taxobox colour |also Nanoarchaeota (Nanarchaeota), Korarchaeota, Thaumarchaeota, Crenarchaeota and Euryarchaeota |- ! style="background:Template:Taxobox colour" | Eukaryota || Template:Taxobox colour |For eukaryotes with no other colour defined, including Excavata, Amoebozoa and Opisthokonta |- ! style="background:Template:Taxobox colour" | Animalia || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Fungi || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaeplastida || Template:Taxobox colour |also Plantae and Viridiplantae |- ! style="background:Template:Taxobox colour" | SAR || Template:Taxobox colour |also Chromalveolata |- ! style="background:Template:Taxobox colour" | incertae sedis || Template:Taxobox colour |- | colspan=2 | Colours not produced by this template: |- ! style='background:rgb(215,240,210)' | Ichnotaxa || rgb(215,240,210) |- ! style='background:rgb(250,250,220)' | Ootaxa || rgb(250,250,220) |}<noinclude>
</noinclude></text>
<sha1>56aaxhsqzcnbra7jrm9p9jn4uy34w03</sha1> </revision> </page> <page> <title>Template:Taxonomy</title> <ns>10</ns> <id>27661849</id> <revision> <id>764331794</id> <parentid>764331491</parentid> <timestamp>2017-02-08T09:08:14Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>switch statement is redundant, as never passed an italicizable rank</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="370"><includeonly></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8v5w4w6r2w9ofp9wsbfhgroqxd7g6h9</sha1> </revision> </page> <page> <title>Template:Taxonomy/nobreak</title> <ns>10</ns> <id>49415604</id> <revision> <id>804252870</id> <parentid>712712769</parentid> <timestamp>2017-10-07T19:38:00Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>replace br tag plus newline with just br tag</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="290">Script error: No such module "String".<noinclude>Template:Documentation</noinclude></text> <sha1>d30l7w1uufy6kabtzhr4oj3ny6xqrk6</sha1> </revision> </page> <page> <title>Template:TemplateData header</title> <ns>10</ns> <id>40047498</id> <revision> <id>827245794</id> <parentid>826349555</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:TemplateData header": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="501"><div class="templatedata-header">This is the TemplateData documentation for this template used by VisualEditor and other tools; Template:Template error report
TemplateData for <!--or 115 other parameters--> </div><includeonly></includeonly><noinclude> Template:Documentation </noinclude></text>
<sha1>1lgj007izalttlek052vptodul1clkt</sha1> </revision> </page> <page> <title>Template:Template error report</title> <ns>10</ns> <id>51792646</id> <revision> <id>827245762</id> <parentid>826348773</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Template error report": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="278">see the monthly error report for this template.<noinclude>
[[Category:External
link templates]]</noinclude></text> <sha1>58xkdtdvcn1dijd3bs4zlibe610r8r1</sha1> </revision> </page> <page> <title>Template:Tl</title> <ns>10</ns> <id>1487430</id> <revision> <id>836995080</id> <parentid>776260390</parentid> <timestamp>2018-04-18T02:46:37Z</timestamp> <contributor> <username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level for "Template:Tl": used in the mediawiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="168">{{[[Template: <!--or 115 other parameters-->
| <!--or 115 other parameters--> ]]}}<noinclude> Template:Documentation <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude></text>
<sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1> </revision> </page> <page> <title>Template:Tlx</title> <ns>10</ns> <id>4497810</id> <revision> <id>821674175</id> <parentid>618336566</parentid> <timestamp>2018-01-21T23:12:17Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>MOS:ELLIPSIS</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1051"><includeonly><!-- --><code><!-- --><nowiki>{{</nowiki><!-- -->[[Template: <!--or 115 other parameters-->
| <!--or 115 other parameters--> ]]<!--
--><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><nowiki>}}</nowiki><!-- --></code><!--
--></includeonly><noinclude> Template:Documentation</noinclude></text>
<sha1>0dyhbuugzgzyax8gcf5l4wyycg4mps7</sha1> </revision> </page> <page> <title>Template:UF-species</title> <ns>10</ns> <id>19258178</id> <revision> <id>714407463</id> <parentid>714407326</parentid> <timestamp>2016-04-09T15:45:58Z</timestamp> <contributor> <username>SMcCandlish</username> <id>378390</id> </contributor> <comment>ditto</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="951">This template emits a "species" (or "biota") microformat.
The microformat is created by the use of <code>class="biota"</code>, and classes for individual taxonomic ranks, such as <code>class="domain"</code> in a span around <nowiki>{{{domain}}}</nowiki> (full list). Please do not change or remove those classes other than as part of development of the microformat. For background information, see microformats on Wikipedia and the microformat specification.<includeonly></includeonly><noinclude> </noinclude></text>
<sha1>fuqlkggft305v01aekcgpirx6pma0tw</sha1> </revision> </page> <page> <title>Template:Var</title> <ns>10</ns> <id>19311880</id> <revision> <id>816459039</id> <parentid>684205355</parentid> <timestamp>2017-12-21T13:31:52Z</timestamp> <contributor> <username>Izno</username> <id>2927383</id> </contributor> <comment>nix xml lang invocation</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="322"><var style="padding-right: 1px;" > <!--or 115 other parameters-->
</var><noinclude> <!--Categories and interwikis go near the bottom of the /doc page.--> Template:Documentation </noinclude></text>
<sha1>1ph0r212s7cz1dvg2q4quotqwsozpa8</sha1> </revision> </page> <page> <title>Template:Xtag</title> <ns>10</ns> <id>33645369</id> <revision> <id>769239758</id> <parentid>707284440</parentid> <timestamp>2017-03-08T10:11:47Z</timestamp> <contributor> <username>Cedar101</username> <id>374440</id> </contributor> <comment>chem</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1808"><code class="nowrap"><tag><!--nothing--></code><noinclude>
Template:Documentation </noinclude></text>
<sha1>2smj06z8y5aivrb62i0f8z1e17c5dyq</sha1> </revision> </page> <page> <title>Template:Yesno</title> <ns>10</ns> <id>22255088</id> <revision> <id>821904792</id> <parentid>669640856</parentid> <timestamp>2018-01-23T08:37:08Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>add support for on/off, per discussion</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="366">{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: <!--or 115 other parameters--> }} |no |n |false |off |0 = <!-- null --> | = <!-- null --> |¬ = |yes |y |true |on |1 = yes |#default = yes
}}<noinclude> Template:Documentation </noinclude></text>
<sha1>r1wh7ajnm478r67owpatavjany80n9e</sha1> </revision> </page> <page> <title>Template:Yesno-no</title> <ns>10</ns> <id>48375573</id> <revision> <id>825510157</id> <parentid>804450734</parentid> <timestamp>2018-02-13T20:27:17Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="269">{{safesubst:<noinclude />yesno| <!--or 115 other parameters-->
|yes=yes|no=no|blank=no|¬=no|def=no}}<noinclude> Template:Documentation <!--Categories go in the doc page referenced above; interwikis go in Wikidata.--> </noinclude></text>
<sha1>34vmtxa9ubuh1vz2ulp78m5ela68riu</sha1> </revision> </page> <page> <title>Module:Arguments</title> <ns>828</ns> <id>41298065</id> <revision> <id>696500078</id> <parentid>668829606</parentid> <timestamp>2015-12-23T16:07:27Z</timestamp> <contributor>
<username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level of Module:Arguments: used in the mediawiki interface ex: MediaWiki:Watchlist-details ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="10054">-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly.
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it.
local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == then return nil else return val end else return val end end
local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end
local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end
local function tidyValNoChange(key, val) return val end
local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {}
--[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end
--[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', ) local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end
-- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end
-- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs
--[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end
--[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable)
local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end
--[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]]
metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end
metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end
local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this
won't cause stack overflow
return translatenext(invariant) else return backtranslate, v end end end
metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end
local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end
metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end
return args end
return arguments</text>
<sha1>5qx9tzlul9ser30uxj9nbasjt92cevn</sha1> </revision> </page> <page> <title>Module:Check for unknown parameters</title> <ns>828</ns> <id>42286729</id> <revision> <id>726655795</id> <parentid>726655742</parentid> <timestamp>2016-06-23T14:41:43Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is -- not on the list local p = {}
local function trim(s) return s:match('^%s*(.-)%s*$') end
local function isnotempty(s) return s and trim(s) ~= end
function p.check (frame) local args = frame.args local pargs = frame:getParent().args local ignoreblank = isnotempty(frame.args['ignoreblank']) local showblankpos = isnotempty(frame.args['showblankpositional']) local knownargs = {} local unknown = frame.args['unknown'] or 'Found _VALUE_, ' local preview = frame.args['preview']
local values = {} local res = {} local regexps = {}
-- create the list of known args, regular expressions, and the return string for k, v in pairs(args) do if type(k) == 'number' then v = trim(v) knownargs[v] = 1 elseif k:find('^regexp[1-9][0-9]*$') then table.insert(regexps, '^' .. v .. '$') end end if isnotempty(preview) then preview = '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview).</div>' elseif preview == nil then preview = unknown end
-- loop over the parent args, and make sure they are on the list for k, v in pairs(pargs) do if type(k) == 'string' and knownargs[k] == nil then local knownflag = false for i, regexp in ipairs(regexps) do if mw.ustring.match(k, regexp) then knownflag = true break end end if not knownflag and ( not ignoreblank or isnotempty(v) ) then k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') table.insert(values, k) end elseif type(k) == 'number' and knownargs[tostring(k)] == nil and ( showblankpos or isnotempty(v) ) then local vlen = mw.ustring.len(v) v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25) v = mw.ustring.gsub(v, '[^%w\-_ ]', '?') table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or )) end end
-- add resuls to the output tables if #values > 0 then if frame:preprocess( "-" ) == "" 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:Delink</title> <ns>828</ns> <id>38999128</id> <revision> <id>695173753</id> <parentid>617654635</parentid> <timestamp>2015-12-14T07:03:21Z</timestamp> <contributor> <username>The Earwig</username> <id>7418060</id> </contributor> <minor/> <comment>Protected "Module:Delink": Highly visible template: 55,000+ mainspace transclusions ([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="6545">-- This module de-links most wikitext.
require('Module:No globals')
local p = {}
local getArgs
local function delinkReversePipeTrick(s)
if s:match("^%[%[|.*[|\n]") then -- Check for newlines or multiple pipes. return s else return s:match("%[%[|(.*)%]%]") end
end
local function delinkPipeTrick(s)
local linkarea, display = "", "" -- We need to deal with colons, brackets, and commas, per Help:Pipe trick. -- First, remove the text before the first colon, if any. if s:match(":") then s = s:match("%[%[.-:(.*)|%]%]") -- If there are no colons, grab all of the text apart from the square brackets and the pipe. else s = s:match("%[%[(.*)|%]%]") end -- Next up, brackets and commas. if s:match("%(.-%)$") then -- Brackets trump commas. s = s:match("(.-) ?%(.-%)$") elseif s:match(",") then -- If there are no brackets, display only the text before the first comma. s = s:match("(.-),.*$") end return s
end
local function delinkWikilink(s)
local result = s -- Deal with the reverse pipe trick. if result:match("%[%[|") then return delinkReversePipeTrick(result) end result = mw.uri.decode(result, "PATH") -- decode percent-encoded entities. Leave underscores and plus signs. result = mw.text.decode(result, true) -- decode HTML entities. -- Check for bad titles. To do this we need to find the -- title area of the link, i.e. the part before any pipes. local titlearea if result:match("|") then -- Find if we're dealing with a piped link. titlearea = result:match("^%[%[(.-)|.*%]%]") else titlearea = result:match("^%[%[(.-)%]%]") end -- Check for bad characters. if mw.ustring.match(titlearea, "[%[%]<>{}%%?%c\n]") then return s end -- Check for categories, interwikis, and files. local colonprefix = result:match("%[%[(.-):.*%]%]") or "" -- Get the text before the first colon. local ns = mw.site.namespaces[colonprefix] -- see if this is a known namespace if mw.language.isKnownLanguageTag(colonprefix) or ( ns and ( ns.canonicalName == "File" or ns.canonicalName == "Category" ) ) then return "" end -- Remove the colon if the link is using the Help:Colon trick. if result:match("%[%[:") then result = "[[" .. result:match("%[%[:(.*%]%])") end -- Deal with links using the Help:Pipe trick. if mw.ustring.match(result, "^%[%[[^|]*|%]%]") then return delinkPipeTrick(result) end -- Find the display area of the wikilink if result:match("|") then -- Find if we're dealing with a piped link. result = result:match("^%[%[.-|(.+)%]%]") -- Remove new lines from the display of multiline piped links, -- where the pipe is before the first new line. result = result:gsub("\n", "") else result = result:match("^%[%[(.-)%]%]") end
return result
end
local function delinkURL(s)
-- Assume we have already delinked internal wikilinks, and that -- we have been passed some text between two square brackets [foo]. -- If the text contains a line break it is not formatted as a URL, regardless of other content. if s:match("\n") then return s end -- Check if the text has a valid URL prefix and at least one valid URL character. local valid_url_prefixes = {"//", "http://%22, "https://%22, "ftp://%22, "gopher://%22, "mailto:%22, "news:%22, "irc://%22} local url_prefix for i,v in ipairs(valid_url_prefixes) do if mw.ustring.match(s, '^%[' .. v ..'[^"%s?].*%]' ) then url_prefix = v break end end -- Get display text if not url_prefix then return s end s = s:match("^%[" .. url_prefix .. "(.*)%]") -- Grab all of the text after the URL prefix and before the final square bracket. s = s:match('^.-(["<> ?].*)') or "" -- Grab all of the text after the first URL separator character ("<> ). s = mw.ustring.match(s, "^%s*(%S.*)$") or "" -- If the separating character was a space, trim it off. local s_decoded = mw.text.decode(s, true) if mw.ustring.match(s_decoded, "%c") then return s else return s_decoded end
end
local function delinkLinkClass(s, pattern, delinkFunction)
if not type(s) == "string" then error("Attempt to de-link non-string input.", 2) end if not ( type(pattern) == "string" and mw.ustring.sub(pattern, 1, 1) == "^" ) then error('Invalid pattern detected. Patterns must begin with "^".', 2) end -- Iterate over the text string, and replace any matched text. using the -- delink function. We need to iterate character by character rather -- than just use gsub, otherwise nested links aren't detected properly. local result = ""
while s ~= do -- Replace text using one iteration of gsub. s = mw.ustring.gsub(s, pattern, delinkFunction, 1) -- Append the left-most character to the result string. result = result .. mw.ustring.sub(s, 1, 1) s = mw.ustring.sub(s, 2, -1) end return result
end
function p._delink(args)
local text = args[1] or "" if args.refs == "yes" then -- Remove any Help:Strip markers representing ref tags. In most situations -- this is not a good idea - only use it if you know what you are doing! text = mw.ustring.gsub(text, "?UNIQ%w*%-ref%-%d*%-QINU?", "") end if not (args.comments == "no") then text = text:gsub("<!%-%-.-%-%->", "") -- Remove html comments. end if not (args.wikilinks == "no") then text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink) -- De-link wikilinks. end if not (args.urls == "no") then text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs. end if not (args.whitespace == "no") then -- Replace single new lines with a single space, but leave double new lines -- and new lines only containing spaces or tabs before a second new line. text = mw.ustring.gsub(text, "([^\n \t][ \t]*)\n([ \t]*[^\n \t])", "%1 %2") text = text:gsub("[ \t]+", " ") -- Remove extra tabs and spaces. end return text
end
function p.delink(frame)
if not getArgs then getArgs = require('Module:Arguments').getArgs end return p._delink(getArgs(frame, {wrappers = 'Template:Delink'}))
end
return p</text>
<sha1>9uut60bk5e8nnvyxo8jbf7qt3b17a4v</sha1> </revision> </page> <page> <title>Module:Documentation</title> <ns>828</ns> <id>40256557</id> <revision> <id>729280556</id> <parentid>725653683</parentid> <timestamp>2016-07-11T04:31:31Z</timestamp> <contributor> <username>Andy M. Wang</username> <id>516856</id> </contributor> <comment>rm alt text on icon, since the adjacent text, "Template documentation" or "Module documentation", is sufficient alternative text (per edit request)</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="36685">-- This module implements Template:Documentation.
-- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box')
-- Get the config table. local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions. local ugsub = mw.ustring.gsub
-- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes.
local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2) end if not valArray then return msg end
local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4) end
local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal) return ret end
p.message = message
local function makeWikilink(page, display) if display then return mw.ustring.format('%s', page, display) else return mw.ustring.format('%s', page) end end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end return '<small style="font-style: normal;">(' .. table.concat(ret, ' | ') .. ')</small>' end
p.makeToolbar = makeToolbar
-- Argument processing
local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= then return value else return nil end else return value end end }) return p[funcName](args) end end
-- Main function
p.main = makeInvokeFunc('_main')
function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user -- -- Messages: -- 'main-div-id' --> 'template-documentation' -- 'main-div-classes' --> 'template-documentation iezoomfix' --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) -- This div tag is from Template:Documentation/start box, but moving it here -- so that we don't have to worry about unclosed tags. :tag('div') :attr('id', message('main-div-id')) :addClass(message('main-div-classes')) :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') :css('clear', 'both') -- So right or left floating items don't stick out of the doc box. :newline() :done() :done() :wikitext(p._endBox(args, env)) :wikitext(p.addTrackingCategories(env)) return tostring(root) end
-- Environment settings
function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title objects and other namespace- or -- path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end })
function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end
function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end
function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage
= env.docpageBase .. '/' .. message('doc-subpage')
end return mw.title.new(docpage) end
function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end
function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end
function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end
function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end
function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end
function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the same as the -- subject namespace. However, pages in the Article, File, MediaWiki or Category -- namespaces must have their /doc, /sandbox and /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end
function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end
function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using Special:ComparePages. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end
return env end
-- Auxiliary templates
function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '50px' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> 'template sandbox page' -- 'sandbox-notice-pagetype-module' --> 'module sandbox page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to Template:Ombox. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for Template:Foo (diff)." local text = local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if compareUrl then local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) else text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for test cases." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.namespace == mw.site.namespaces.Module.id then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. text = text .. makeCategoryLink(message('sandbox-category')) omargs.text = text local ret = '<div style="clear: both;"></div>' ret = ret .. messageBox.main('ombox', omargs) return ret end
function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local protectionLevels, mProtectionBanner local title = env.title protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editProt = protectionLevels.edit and protectionLevels.edit[1] local moveProt = protectionLevels.move and protectionLevels.move[1] if editProt then -- The page is edit-protected. mProtectionBanner = require('Module:Protection banner') local reason = message('protection-reason-edit') return mProtectionBanner._main{reason, small = true} elseif moveProt and moveProt ~= 'autoconfirmed' then -- The page is move-protected but not edit-protected. Exclude move -- protection with the level "autoconfirmed", as this is equivalent to -- no move protection at all. mProtectionBanner = require('Module:Protection banner') return mProtectionBanner._main{action = 'move', small = true} else return nil end end
-- Start box
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end
function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end
local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') --
Create link if /doc doesn't exist.
local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end
function p.renderStartBoxLinks(data) --[[ -- Generates the [view][edit][history][purge] or [create] links from the data table. -- @data - a table of data generated by p.makeStartBoxLinksData --]]
local function escapeBrackets(s) -- Escapes square brackets with HTML entities. s = s:gsub('%[', '[') -- Replace square brackets with HTML entities. s = s:gsub('%]', ']') 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' --> '50px' -- 'template-namespace-heading' --> 'Template documentation' -- 'module-namespace-heading' --> 'Module documentation' -- 'file-namespace-heading' --> 'Summary' -- 'other-namespaces-heading' --> 'Documentation' -- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks' -- 'start-box-link-id' --> 'doc_editlinks' -- 'testcases-create-link-display' --> 'create' --]=] local subjectSpace = env.subjectSpace if not subjectSpace then -- Default to an "other namespaces" namespace, so that we get at least some output -- if an error occurs. subjectSpace = 2 end local data = {}
-- Heading local heading = args.heading -- Blank values are not removed. if heading == then -- Don't display the start box if the heading arg is defined but blank. return nil end if heading then data.heading = heading elseif subjectSpace == 10 then -- Template namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading') elseif subjectSpace == 828 then -- Module namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading') elseif subjectSpace == 6 then -- File namespace data.heading = message('file-namespace-heading') else data.heading = message('other-namespaces-heading') end
-- Heading CSS local headingStyle = args['heading-style'] if headingStyle then data.headingStyleText = headingStyle elseif subjectSpace == 10 then -- We are in the template or template talk namespaces. data.headingFontWeight = 'bold' data.headingFontSize = '125%' else data.headingFontSize = '150%' end
-- Data for the [view][edit][history][purge] or [create] links. if links then data.linksClass = message('start-box-linkclasses') data.linksId = message('start-box-link-id') data.links = links end
return data end
function p.renderStartBox(data) -- Renders the start box html. -- @data - a table of data generated by p.makeStartBoxData. local sbox = mw.html.create('div') sbox :css('padding-bottom', '3px') :css('border-bottom', '1px solid #aaa') :css('margin-bottom', '1ex') :newline() :tag('span') :cssText(data.headingStyleText) :css('font-weight', data.headingFontWeight) :css('font-size', data.headingFontSize) :wikitext(data.heading) local links = data.links if links then sbox:tag('span') :addClass(data.linksClass) :attr('id', data.linksId) :wikitext(links) end return tostring(sbox) end
-- Documentation content
p.content = makeInvokeFunc('_content')
function p._content(args, env) -- Displays the documentation contents -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment env = env or p.getEnvironment(args) local docTitle = env.docTitle local content = args.content if not content and docTitle and docTitle.exists then content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText} end -- The line breaks below are necessary so that "=== Headings ===" at the start and end -- of docs are interpreted correctly. return '\n' .. (content or ) .. '\n' end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env) env = env or p.getEnvironment(args) local docTitle = env.docTitle if not args.content and docTitle and docTitle.exists then return docTitle.prefixedText else return end end
-- End box
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env) --[=[ -- This function generates the end box (also known as the link box). -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'fmbox-id' --> 'documentation-meta-data' -- 'fmbox-style' --> 'background-color: #ecfcf4' -- 'fmbox-textstyle' --> 'font-style: italic' -- -- The HTML is generated by the Template: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 Template:Fmbox. local fmargs = {} fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data' fmargs.image = 'none' fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4' fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;'
-- Assemble the fmbox text field. local text = if linkBox then text = text .. linkBox else text = text .. (p.makeDocPageBlurb(args, env) or ) -- "This documentation is transcluded from Foo." if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then -- We are in the user, template or module namespaces. -- Add sandbox and testcases links. -- "Editors can experiment in this template's sandbox and testcases pages." text = text .. (p.makeExperimentBlurb(args, env) or ) text = text .. '<br />' if not args.content and not args[1] then -- "Please add categories to the /doc subpage." -- Don't show this message with inline docs or with an explicitly specified doc page, -- as then it is unclear where to add the categories. text = text .. (p.makeCategoriesBlurb(args, env) or ) end text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or ) --"Subpages of this template" local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates. if printBlurb then text = text .. '<br />' .. printBlurb end end end fmargs.text = text
return messageBox.main('fmbox', fmargs) end
function p.makeDocPageBlurb(args, env) --[=[ -- Makes the blurb "This documentation is transcluded from Template:Foo (edit, history)". -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'transcluded-from-blurb' --> -- 'The above documentation -- is transcluded from $1.' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'create-link-display' --> 'create' -- 'create-module-doc-blurb' --> -- 'You might want to $1 a documentation page for this Scribunto module.' --]=] local docTitle = env.docTitle if not docTitle then return nil end local ret if docTitle.exists then -- /doc exists; link to it. local docLink = makeWikilink(docTitle.prefixedText) local editUrl = docTitle:fullUrl{action = 'edit'} local editDisplay = message('edit-link-display') local editLink = makeUrlLink(editUrl, editDisplay) local historyUrl = docTitle:fullUrl{action = 'history'} local historyDisplay
= message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay) ret = message('transcluded-from-blurb', {docLink}) .. ' ' .. makeToolbar(editLink, historyLink) .. '<br />' elseif env.subjectSpace == 828 then -- /doc does not exist; ask to create it. local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')} local createDisplay = message('create-link-display') local createLink = makeUrlLink(createUrl, createDisplay) ret = message('create-module-doc-blurb', {createLink}) .. '<br />' end return ret end
function p.makeExperimentBlurb(args, env) --[[ -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-link-display' --> 'sandbox' -- 'sandbox-edit-link-display' --> 'edit' -- 'compare-link-display' --> 'diff' -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'sandbox-create-link-display' --> 'create' -- 'mirror-edit-summary' --> 'Create sandbox version of $1' -- 'mirror-link-display' --> 'mirror' -- 'mirror-link-preload' --> 'Template:Documentation/mirror' -- 'sandbox-link-display' --> 'sandbox' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display'--> 'edit' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'testcases-create-link-display' --> 'create' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display' --> 'edit' -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases' -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases' -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.' -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle local testcasesTitle = env.testcasesTitle local templatePage = templateTitle.prefixedText if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then return nil end -- Make links. local sandboxLinks, testcasesLinks if sandboxTitle.exists then local sandboxPage = sandboxTitle.prefixedText local sandboxDisplay = message('sandbox-link-display') local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay) local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'} local sandboxEditDisplay = message('sandbox-edit-link-display') local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay) local compareUrl = env.compareUrl local compareLink if compareUrl then local compareDisplay = message('compare-link-display') compareLink = makeUrlLink(compareUrl, compareDisplay) end sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink) else local sandboxPreload if subjectSpace == 828 then sandboxPreload = message('module-sandbox-preload') else sandboxPreload = message('template-sandbox-preload') end local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload} local sandboxCreateDisplay = message('sandbox-create-link-display') local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay) local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)}) local mirrorPreload = message('mirror-link-preload') local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary} if subjectSpace == 828 then mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary} end local mirrorDisplay = message('mirror-link-display') local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) end if testcasesTitle.exists then local testcasesPage = testcasesTitle.prefixedText local testcasesDisplay = message('testcases-link-display') local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay) local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'} local testcasesEditDisplay = message('testcases-edit-link-display') local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) -- for Modules, add testcases run link if exists if subjectSpace == 828 and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then local testcasesRunLinkDisplay = message('testcases-run-link-display') local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink) else testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink) end else local testcasesPreload if subjectSpace == 828 then testcasesPreload = message('module-testcases-preload') else testcasesPreload = message('template-testcases-preload') end local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload} local testcasesCreateDisplay = message('testcases-create-link-display') local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay) testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink) end local messageName if subjectSpace == 828 then messageName = 'experiment-blurb-module' else messageName = 'experiment-blurb-template' end return message(messageName, {sandboxLinks, testcasesLinks}) end
function p.makeCategoriesBlurb(args, env) --[[ -- Generates the text "Please add categories to the /doc subpage." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'doc-link-display' --> '/doc' -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.' --]] local docTitle = env.docTitle if not docTitle then return nil end local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display')) return message('add-categories-blurb', {docPathLink}) end
function p.makeSubpagesBlurb(args, env) --[[ -- Generates the "Subpages of this template" link. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages: -- 'template-pagetype' --> 'template' -- 'module-pagetype' --> 'module' -- 'default-pagetype' --> 'page' -- 'subpages-link-display' --> 'Subpages of this $1' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle if not subjectSpace or not templateTitle then return nil end local pagetype if subjectSpace == 10 then pagetype = message('template-pagetype') elseif subjectSpace == 828 then pagetype = message('module-pagetype') else pagetype = message('default-pagetype') end local subpagesLink = makeWikilink( 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/', message('subpages-link-display', {pagetype}) ) return message('subpages-blurb', {subpagesLink}) end
function p.makePrintBlurb(args, env) --[=[ -- Generates the blurb displayed when there is a print version of the template available. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'print-link-display' --> '/Print' -- 'print-blurb' --> 'A print version' -- .. ' of this template exists at $1.' -- .. ' If you make a change to this template, please update the print version as well.' -- 'display-print-category' --> true -- 'print-category' --> 'Templates with print versions' --]=] local printTitle = env.printTitle if not printTitle then return nil end local ret if printTitle.exists then local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display')) ret = message('print-blurb', {printLink}) local displayPrintCategory = message('display-print-category', nil, 'boolean') if displayPrintCategory then ret = ret .. makeCategoryLink(message('print-category')) end end return ret end
-- Tracking categories
function p.addTrackingCategories(env) --[[ -- Check if Template:Documentation is transcluded on a /doc or /testcases page. -- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages: -- 'display-strange-usage-category' --> true -- 'doc-subpage' --> 'doc' -- 'testcases-subpage' --> 'testcases' -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage' -- -- /testcases pages in the module namespace are not categorised, as they may have -- Template: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 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'] = '50px'
--[[ -- 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'] = 'template sandbox page' cfg['sandbox-notice-pagetype-module'] = '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'] = '50px'
-- cfg['template-namespace-heading'] -- The heading shown in the template namespace. cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading'] -- The heading shown in the module namespace. cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading'] -- The heading shown in the file namespace. cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading'] -- The heading shown in other namespaces. cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display'] -- The text to display for "view" links. cfg['view-link-display'] = 'view'
-- cfg['edit-link-display'] -- The text to display for "edit" links. cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display'] -- The text to display for "history" links. cfg['history-link-display'] = 'history'
-- cfg['purge-link-display'] -- The text to display for "purge" links. cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display'] -- The text to display for "create" links. cfg['create-link-display'] = 'create'
-- Link box (end box) configuration
-- cfg['transcluded-from-blurb'] -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page. cfg['transcluded-from-blurb'] = 'The above documentation is 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 Scribunto module.'
-- Experiment blurb configuration
--[[ -- cfg['experiment-blurb-template'] -- cfg['experiment-blurb-module'] -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages. -- It is only shown in the template and module namespaces. With the default English settings, it -- might look like this: -- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. -- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links. -- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending -- on what namespace we are in. -- -- Parameters: -- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display']) -- -- If the sandbox doesn't exist, it is in the format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display']) -- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload'] -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display'] -- loads a default edit summary of cfg['mirror-edit-summary']. -- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format: -- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display']) -- -- If the test cases page doesn't exist, it is in the format: -- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display']) -- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current -- namespace. --]] cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages." cfg['experiment-blurb-module']
= "Editors can experiment in this module's $1 and $2 pages."
-- Sandbox link configuration
-- cfg['sandbox-subpage'] -- The name of the template subpage typically used for sandboxes. cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload'] -- Preload file for template sandbox pages. cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload'] -- Preload file for Lua module sandbox pages. cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display'] -- The text to display for "sandbox" links. cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display'] -- The text to display for sandbox "edit" links. cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display'] -- The text to display for sandbox "create" links. cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display'] -- The text to display for "compare" links. cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary'] -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the -- template page. cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display'] -- The text to display for "mirror" links. cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload'] -- The page to preload when a user clicks the "mirror" link. cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
-- Test cases link configuration
-- cfg['testcases-subpage'] -- The name of the template subpage typically used for test cases. cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload'] -- Preload file for template test cases pages. cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload'] -- Preload file for Lua module test cases pages. cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display'] -- The text to display for "testcases" links. cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display'] -- The text to display for test cases "edit" links. cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display'] -- The text to display for test cases "run" links. cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display'] -- The text to display for test cases "create" links. cfg['testcases-create-link-display'] = 'create'
-- Add categories blurb configuration
--[[ -- cfg['add-categories-blurb'] -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a -- link to the /doc subpage with a display value of cfg['doc-link-display']. --]] cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'
-- cfg['doc-link-display'] -- The text to display when linking to the /doc subpage. cfg['doc-link-display'] = '/doc'
-- Subpages link configuration
--[[ -- cfg['subpages-blurb'] -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a -- display value of cfg['subpages-link-display']. In the English version this blurb is simply -- the link followed by a period, and the link display provides the actual text. --]] cfg['subpages-blurb'] = '$1.'
--[[ -- cfg['subpages-link-display'] -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'], -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in -- the template namespace, the module namespace, or another namespace. --]] cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype'] -- The pagetype to display for template pages. cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype'] -- The pagetype to display for Lua module pages. cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype'] -- The pagetype to display for pages other than templates or Lua modules. cfg['default-pagetype'] = 'page'
-- Doc link configuration
-- cfg['doc-subpage'] -- The name of the subpage typically used for documentation pages. cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload'] -- Preload file for documentation page in the file namespace. cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload'] -- Preload file for template documentation pages in all namespaces. cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload'] -- Preload file for Lua module documentation pages. cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
-- Print version configuration
-- cfg['print-subpage'] -- The name of the template subpage used for print versions. cfg['print-subpage'] = 'Print'
-- cfg['print-link-display'] -- The text to display when linking to the /Print subpage. cfg['print-link-display'] = '/Print'
-- cfg['print-blurb'] -- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display']. cfg['print-blurb'] = 'A print version of this template exists at $1.' .. ' If you make a change to this template, please update the print version as well.'
-- cfg['display-print-category'] -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists. -- This should be a boolean value (either true or false). cfg['display-print-category'] = true
-- cfg['print-category'] -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists. cfg['print-category'] = 'Templates with print versions'
-- HTML and CSS configuration
-- cfg['main-div-id'] -- The "id" attribute of the main HTML "div" tag. cfg['main-div-id'] = 'template-documentation'
-- cfg['main-div-classes'] -- The CSS classes added to the main HTML "div" tag. cfg['main-div-classes'] = 'template-documentation iezoomfix'
-- cfg['start-box-linkclasses'] -- The CSS classes used for the [view][edit][history] or [create] links in the start box. cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks'
-- cfg['start-box-link-id'] -- The HTML "id" attribute for the links in the start box. cfg['start-box-link-id'] = 'doc_editlinks'
-- Template:Fmbox template configuration
-- cfg['fmbox-id'] -- The id sent to the "id" parameter of the Template:Fmbox template. cfg['fmbox-id'] = 'documentation-meta-data'
-- cfg['fmbox-style'] -- The value sent to the style parameter of Template:Fmbox. cfg['fmbox-style'] = 'background-color: #ecfcf4'
-- cfg['fmbox-textstyle'] -- The value sent to the "textstyle parameter of Template:Fmbox. cfg['fmbox-textstyle'] = 'font-style: italic'
-- Tracking category configuration
-- cfg['display-strange-usage-category'] -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage -- or a /testcases subpage. This should be a boolean value (either true or false). cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category'] -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a -- /doc subpage or a /testcases subpage. cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
-- End configuration -- -- Don't edit anything below this line.
--]]
return cfg</text>
<sha1>6hym6c6py8yoseohy71qvk7kafcy1p5</sha1> </revision> </page> <page> <title>Module:Effective protection expiry</title> <ns>828</ns> <id>48785459</id> <revision> <id>744227741</id> <parentid>740797535</parentid> <timestamp>2016-10-13T22:30:40Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>don't error if the page isn't under PC</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1494">local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title) return stabilitySettings and stabilitySettings.expiry or 'unknown' elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) end local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename) if rawExpiry == 'infinity' then return 'infinity' elseif rawExpiry == then return 'unknown' else local year, month, day, hour, minute, second = rawExpiry:match( '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' ) if year then return string.format( '%s-%s-%sT%s:%s:%s', year, month, day, hour, minute, second ) else error('internal error in Module:Effective protection expiry; malformed expiry timestamp') end end end
setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end })
return p</text>
<sha1>i1wms02y1w048cq6uttka18a5pjzp63</sha1> </revision> </page> <page> <title>Module:Effective protection level</title> <ns>828</ns> <id>41617327</id> <revision> <id>834561914</id> <parentid>713934935</parentid> <timestamp>2018-04-06T11:52:06Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>add user JSON subpage detection - see Tech News: 2018-14</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="3056">local p = {}
-- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local level = mw.ext.FlaggedRevs.getStabilitySettings(title) level = level and level.autoreview if level == 'review' then return 'reviewer' elseif level ~= then return level else return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not , as that would mean PC-protected but nobody can review end elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) end if title.namespace == 8 then -- MediaWiki namespace return 'sysop' elseif title.namespace == 2 and title.isSubpage and ( title.contentModel == 'javascript' or title.contentModel == 'css' or title.contentModel == 'json' ) then -- user JS, CSS or JSON page return 'sysop' end local level = title.protectionLevels[action] and title.protectionLevels[action][1] if level == 'sysop' or level == 'editprotected' then return 'sysop' elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page return 'sysop' elseif level == 'templateeditor' then return 'templateeditor' elseif action == 'move' then local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. if blacklistentry and not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif title.namespace == 6 then return 'filemover' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end end local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) if blacklistentry then if not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason return 'autoconfirmed' elseif level then return level elseif action == 'upload' then return 'autoconfirmed' elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts return 'user' else return '*' end end
setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end })
return p</text>
<sha1>ldr27zxzu0o1ofgaoty4jscx92ku0w7</sha1> </revision> </page> <page> <title>Module:File link</title> <ns>828</ns> <id>42903140</id> <revision> <id>638642222</id> <parentid>638639021</parentid> <timestamp>2014-12-18T14:05:07Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>when calling this from wikitext use a more readable error message for missing file parameters</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2544">-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args) checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "type error in '%s' parameter of '_main' (expected string, got %s)", key, type(val) ), level) end end
local ret = {}
-- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end
-- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end
-- Filename checkArg('file', args.file, 3) ret[#ret + 1] = 'File:' .. args.file
-- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end
-- Border if yesno(args.border) then ret[#ret + 1] = 'border' end
addPositional('location') addPositional('alignment') addPositional('size') addNamed('upright') addNamed('link') addNamed('alt') addNamed('page') addNamed('class') addNamed('lang') addNamed('start') addNamed('end') addNamed('thumbtime') addPositional('caption')
return string.format('%s', table.concat(ret, '|')) end
function p.main(frame) local origArgs = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:File link' }) if not origArgs.file then error("'file' parameter missing from Template:File link", 0) end
-- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like File:Example.png. 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:Hatnote</title> <ns>828</ns> <id>42498502</id> <revision> <id>779487706</id> <parentid>726656423</parentid> <timestamp>2017-05-09T05:20:32Z</timestamp> <contributor> <username>JJMC89</username> <id>24812038</id> </contributor> <comment>Add navigation-not-searchable class per request (also see T164781)</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="6703">--------------------------------------------------------------------------------
-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the Template:Hatnote and {{format
link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno
local p = {}
-- Helper functions
local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to false. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') title = title or mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '<strong class="error">Error: %s%s.</strong>%s', msg, helpText, category ) end
function p.disambiguate(page, disambiguator) -- Formats a page title with a disambiguation parenthetical, -- i.e. "Example" → "Example (disambiguation)". checkType('disambiguate', 1, page, 'string') checkType('disambiguate', 2, disambiguator, 'string', true) disambiguator = disambiguator or 'disambiguation' return string.format('%s (%s)', page, disambiguator) end
-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the Template:Format hatnote link template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display) checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true)
-- Remove the initial colon for links where it was specified manually. link = removeInitialColon(link)
-- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end
-- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end
-- Assemble the link. if display then return string.format( '%s', string.gsub(link, '|(.*)$', ), --display overwrites manual piping display ) else return string.format('%s', link) end end
-- Hatnote -- -- Produces standard hatnote text. Implements the Template:Hatnote template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) options = options or {} local classes = {'hatnote', 'navigation-not-searchable'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '<div role="note" class="%s">%s</div>', table.concat(classes, ' '), s ) end
return p</text>
<sha1>c5z31x97gktc3q7nnp8mf48t01l4qst</sha1> </revision> </page> <page> <title>Module:Hatnote list</title> <ns>828</ns> <id>50085079</id> <revision> <id>833955078</id> <parentid>833954678</parentid> <timestamp>2018-04-03T05:19:54Z</timestamp> <contributor> <username>Galobtter</username> <id>19502780</id> </contributor> <comment>fix</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="7209">--------------------------------------------------------------------------------
-- Module:Hatnote list -- -- -- -- This module produces and formats lists for use in hatnotes. In particular, -- -- it implements the for-see list, i.e. lists of "For X, see Y" statements, -- -- as used in Template:About, Template:Redirect, and their variants. Also introduced -- -- are andList & orList helpers for formatting lists with those conjunctions. --
local mArguments --initialize lazily local mHatnote = require('Module:Hatnote') local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local p = {}
-- List stringification helper functions -- -- These functions are used for stringifying lists, usually page lists inside -- the "Y" portion of "For X, see Y" for-see items.
--default options table used across the list stringification functions local stringifyListDefaultOptions = { conjunction = "and", separator = ",", altSeparator = ";", space = " ", formatted = false }
-- Stringifies a list generically; probably shouldn't be used directly function stringifyList(list, options) -- Type-checks, defaults, and a shortcut checkType("stringifyList", 1, list, "table") if #list == 0 then return nil end checkType("stringifyList", 2, options, "table", true) options = options or {} for k, v in pairs(stringifyListDefaultOptions) do if options[k] == nil then options[k] = v end end local s = options.space -- Format the list if requested if options.formatted then list = mHatnote.formatPages(unpack(list)) end -- Set the separator; if any item contains it, use the alternate separator local separator = options.separator --searches display text only function searchDisp(t, f) return string.find(string.sub(t, (string.find(t, '|') or 0) + 1), f) end for k, v in pairs(list) do if searchDisp(v, separator) then separator = options.altSeparator break end end -- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§" local conjunction = s .. options.conjunction .. s if #list == 2 and searchDisp(list[1], "§") or #list > 2 then conjunction = separator .. conjunction end -- Return the formatted string return mw.text.listToText(list, separator .. s, conjunction) end
--DRY function function conjList (conj, list, fmt) return stringifyList(list, {conjunction = conj, formatted = fmt}) end
-- Stringifies lists with "and" or
"or"
function p.andList (...) return conjList("and", ...) end function p.orList (...) return conjList("or", ...) end
-- For see -- -- Makes a "For X, see Y." list from raw parameters. Intended for the -- Template:About and Template:Redirect templates and their variants.
--default options table used across the forSee family of functions local forSeeDefaultOptions = { andKeyword = 'and', title = mw.title.getCurrentTitle().text, otherText = 'other uses', forSeeForm = 'For %s, see %s.', }
--Collapses duplicate punctuation function punctuationCollapse (text) local replacements = { ["%.%.$"] = ".", ["%?%.$"] = "?", ["%!%.$"] = "!", ["%.%]%]%.$"] = ".]]", ["%?%]%]%.$"] = "?]]", ["%!%]%]%.$"] = "!]]" } for k, v in pairs(replacements) do text = string.gsub(text, k, v) end return text end
-- Structures arguments into a table for stringification, & options function p.forSeeArgsToTable (args, from, options) -- Type-checks and defaults checkType("forSeeArgsToTable", 1, args, 'table') checkType("forSeeArgsToTable", 2, from, 'number', true) from = from or 1 checkType("forSeeArgsToTable", 3, options, 'table', true) options = options or {} for k, v in pairs(forSeeDefaultOptions) do if options[k] == nil then options[k] = v end end -- maxArg's gotten manually because getArgs() and table.maxn aren't friends local maxArg = 0 for k, v in pairs(args) do if type(k) == 'number' and k > maxArg then maxArg = k end end -- Structure the data out from the parameter list: -- * forTable is the wrapper table, with forRow rows -- * Rows are tables of a "use" string & a "pages" table of pagename strings -- * Blanks are left empty for defaulting elsewhere, but can terminate list local forTable = {} local i = from local terminated = false -- If there is extra text, and no arguments are given, give nil value -- to not produce default of "For other uses, see foo (disambiguation)" if options.extratext and i > maxArg then return nil end -- Loop to generate rows repeat -- New empty row local forRow = {} -- On blank use, assume list's ended & break at end of this loop forRow.use = args[i] if not args[i] then terminated = true end -- New empty list of pages forRow.pages = {} -- Insert first pages item if present table.insert(forRow.pages, args[i + 1]) -- If the param after next is "and", do inner loop to collect params -- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3} while args[i + 2] == options.andKeyword do if args[i + 3] then table.insert(forRow.pages, args[i + 3]) end -- Increment to next "and" i = i + 2 end -- Increment to next use i = i + 2 -- Append the row table.insert(forTable, forRow) until terminated or i > maxArg
return forTable end
-- Stringifies a table as formatted by forSeeArgsToTable function p.forSeeTableToString (forSeeTable, options) -- Type-checks and defaults checkType("forSeeTableToString", 1, forSeeTable, "table", true) checkType("forSeeTableToString", 2, options, "table", true) options = options or {} for k, v in pairs(forSeeDefaultOptions) do if options[k] == nil then options[k] = v end end -- Stringify each for-see item into a list local strList = {} if forSeeTable then for k, v in pairs(forSeeTable) do local useStr = v.use or options.otherText local pagesStr = p.andList(v.pages, true) or mHatnote._formatLink(mHatnote.disambiguate(options.title)) local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr) forSeeStr = punctuationCollapse(forSeeStr) table.insert(strList, forSeeStr) end end if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end -- Return the concatenated list return table.concat(strList, ' ') end
-- Produces a "For X, see Y" string from arguments. Expects index gaps -- but not blank/whitespace values. Ignores named args and args < "from". function p._forSee (args, from, options) local forSeeTable = p.forSeeArgsToTable(args, from, options) return p.forSeeTableToString(forSeeTable, options) end
-- As _forSee, but uses the frame. function p.forSee (frame, from, options) mArguments = require('Module:Arguments') return p._forSee(mArguments.getArgs(frame), from, options) end
return p</text>
<sha1>2hmyydi47hep0hexbh8sw7ybxc07m5k</sha1> </revision> </page> <page> <title>Module:If empty</title> <ns>828</ns> <id>44819040</id> <revision> <id>639392913</id> <parentid>639392817</parentid> <timestamp>2014-12-23T21:56:09Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>actually, only the first 8 need this check</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1018">local p = {}
function p.main(frame) local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank, -- even though there's really no legitimate use case for this. At some point, this will be removed. local lowestNil = math.huge for i = 8,1,-1 do if args[i] == nil then args[i] = lowestNil = i end end
for k,v in ipairs(args) do if v ~= then if lowestNil < k then -- If any uses of this template depend on the behavior above, add them to a tracking category. -- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified -- by it. frame:extensionTag('ref', , {group = 'TrackingCategory'}) frame:extensionTag('references', , {group = 'TrackingCategory'}) end return v end end end
return p</text>
<sha1>6qq12x2ek97w2n518wugesqunsqh778</sha1> </revision> </page> <page> <title>Module:InfoboxImage</title> <ns>828</ns> <id>38581924</id> <revision> <id>839038061</id> <parentid>769944044</parentid> <timestamp>2018-04-30T21:16:56Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>add Noimage.gif to placeholder list</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="9657">-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link -- page - page to display for multipage images (DjVu) -- size - size to display the image -- maxsize - maximum size for image -- sizedefault - default size to display the image if size param is blank -- alt - alt text for image -- title - title text for image -- border - set to yes if border -- center - set to yes, if the image has to be centered -- upright - upright image param -- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it -- link - page to visit when clicking on image -- Outputs: -- Formatted image. -- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg", "Blue - Replace this image male.svg", "Female no free image yet.png", "Flag of None (square).svg", "Flag of None.svg", "Flag of.svg", "Green - Replace this image female.svg", "Green - Replace this image male.svg", "Image is needed female.svg", "Image is needed male.svg", "Location map of None.svg", "Male no free image yet.png", "Missing flag.png", "No flag.svg", "No free portrait.svg", "No portrait (female).svg", "No portrait (male).svg", "Red - Replace this image female.svg", "Red - Replace this image male.svg", "Replace this image female (blue).svg", "Replace this image female.svg", "Replace this image male (blue).svg", "Replace this image male.svg", "Silver - Replace this image female.svg", "Silver - Replace this image male.svg", "Replace this image.svg",
"Cricket no pic.png", "CarersLogo.gif", "Diagram Needed.svg", "Example.jpg", "Image placeholder.png", "No male portrait.svg", "Nocover-upload.png", "NoDVDcover copy.png", "Noribbon.svg", "No portrait-BFD-test.svg", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Sin bandera.svg", "Sin escudo.svg", "Replace this image - temple.png", "Replace this image butterfly.png", "Replace this image.svg", "Replace this image1.svg", "Resolution angle.png", "Image-No portrait-text-BFD-test.svg", "Insert image here.svg", "No image available.png", "NO IMAGE YET square.png", "NO IMAGE YET.png", "No Photo Available.svg", "No
Screenshot.svg",
"No-image-available.jpg", "Null.png", "PictureNeeded.gif", "Place holder.jpg", "Unbenannt.JPG", "UploadACopyrightFreeImage.svg", "UploadAnImage.gif", "UploadAnImage.svg", "UploadAnImageShort.svg", "CarersLogo.gif", "Diagram Needed.svg", "No male portrait.svg", "NoDVDcover copy.png", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Noimage.gif", }
function i.IsPlaceholder(image)
-- change underscores to spaces image = mw.ustring.gsub(image, "_", " "); assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil') -- if image starts with [[then remove that and anything after | if mw.ustring.sub(image,1,2) == "[[" then image = mw.ustring.sub(image,3); image = mw.ustring.gsub(image, "([^|]*)|.*", "%1"); assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil') end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil") -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); -- capitalise first letter image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do if image == j then return true end end return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"]; if image == "" or image == nil then return ""; end if image == " " then return image; end if frame.args["suppressplaceholder"] ~= "no" then if i.IsPlaceholder(image) == true then return ""; end end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then return ""; end
if mw.ustring.sub(image,1,2) == "[[" then -- search for thumbnail images and add to tracking cat if found if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then return image .. ""; elseif mw.title.getCurrentTitle().namespace == 0 then return image .. ""; else return image; end elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then return image; elseif mw.ustring.sub(image,1,1) == "<" then return image; elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then -- Found strip marker at begining, so pass don't process at all return image; elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then -- Found strip marker at begining, so pass don't process at all return image; else local result = ""; local page = frame.args["page"]; local size = frame.args["size"]; local maxsize = frame.args["maxsize"]; local sizedefault = frame.args["sizedefault"]; local alt = frame.args["alt"]; local link = frame.args["link"]; local title = frame.args["title"]; local border = frame.args["border"]; local upright = frame.args["upright"] or ""; local thumbtime = frame.args["thumbtime"] or ""; local center= frame.args["center"]; -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end if maxsize ~= "" and maxsize ~= nil then -- if no sizedefault then set to maxsize if sizedefault == "" or sizedefault == nil then sizedefault = maxsize end -- check to see if size bigger than maxsize if size ~= "" and size ~= nil then local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0; local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0; if sizenumber>maxsizenumber and maxsizenumber>0 then size = maxsize; end end end -- add px to size if just a number if (tonumber(size) or 0) > 0 then size = size .. "px"; end -- add px to sizedefault if just a number if (tonumber(sizedefault) or 0) > 0 then sizedefault = sizedefault .. "px"; end result = "[[File:" .. image; if page ~= "" and page ~= nil then result = result .. "|page=" .. page; end if size ~= "" and size ~= nil then result = result .. "|" .. size; elseif sizedefault ~= "" and sizedefault ~= nil then result = result .. "|" .. sizedefault; else result = result .. "|frameless"; end if center == "yes" then result = result .. "|center" end if alt ~= "" and alt ~= nil then result = result .. "|alt=" .. alt; end if link ~= "" and link ~= nil then result = result .. "|link=" .. link; end if border == "yes" then result = result .. "|border"; end if upright == "yes" then result = result .. "|upright"; elseif upright ~= "" then result = result .. "|upright=" .. upright; end if thumbtime ~= "" then result = result .. "|thumbtime=" .. thumbtime; end if title ~= "" and title ~= nil then result = result .. "|" .. title; elseif alt ~= "" and alt ~= nil then result = result .. "|" .. alt; end result = result .. "]]"; return result; end
end
return i;</text>
<sha1>qtnddjnyefntigkcp7xwqp47j23hao6</sha1> </revision> </page> <page> <title>Module:Labelled list hatnote</title> <ns>828</ns> <id>50971703</id> <revision> <id>763259375</id> <parentid>745988142</parentid> <timestamp>2017-02-02T05:26:53Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <minor/> <comment>Protected "Module:Labelled list hatnote": Highly visible template ([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="3083">--------------------------------------------------------------------------------
-- Labelled list -- -- -- -- This module does the core work of creating a hatnote composed of a list -- -- prefixed by a colon-terminated label, i.e. "LABEL: [andList of pages]", -- -- for Template:See also and similar templates. --
local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mArguments --initialize lazily local p = {}
-- Defaults global to this module local defaults = { label = 'See also', --Final fallback
for label argument
labelForm = '%s: %s', prefixes = {'label', 'label ', 'l'}, template = 'Module:Labelled list hatnote' }
-- Helper function that pre-combines display parameters into page arguments. -- Also compresses sparse arrays, as a desirable side-effect. function p.preprocessDisplays (args, prefixes) -- Prefixes specify which parameters, in order, to check for display options -- They each have numbers auto-appended, e.g. 'label1', 'label 1', & 'l1' prefixes = prefixes or defaults.prefixes local pages = {} for k, v in pairs(args) do if type(k) == 'number' then local display for i = 1, #prefixes do display = args[prefixes[i] .. k] if display then break end end local page = display and string.format('%s|%s', string.gsub(v, '|.*$', ), display) or v pages[#pages + 1] = page end end return pages end
-- Produces a labelled pages-list hatnote. -- The main frame (template definition) takes 1 or 2 arguments, for a singular -- and (optionally) plural label respectively: -- * Script error: No such module "Labelled list hatnote". -- The resulting template takes pagename & label parameters normally. function p.labelledList (frame) mArguments = require('Module:Arguments') local labels = {frame.args[1] or defaults.label} labels[2] = frame.args[2] or labels[1] local template = frame:getParent():getTitle() local args = mArguments.getArgs(frame, {parentOnly = true}) local pages = p.preprocessDisplays(args) local options = { extraclasses = frame.args.extraclasses, category = args.category, selfref = frame.args.selfref or args.selfref, template = template } return p._labelledList(pages, labels, options) end
function p._labelledList (pages, labels, options) labels = labels or {} if #pages == 0 then return mHatnote.makeWikitextError( 'no page names specified', (options.template or defaults.template) .. '#Errors', options.category ) end label = (#pages == 1 and labels[1] or labels[2]) or defaults.label local text = string.format( options.labelForm or defaults.labelForm, label, mHatlist.andList(pages, true) ) local hnOptions = { extraclasses = options.extraclasses, selfref = options.selfref } return mHatnote._hatnote(text, hnOptions) end
return p</text>
<sha1>932zychfwl5xu5castj2k9j5qs6lzif</sha1> </revision> </page> <page> <title>Module:Main</title> <ns>828</ns> <id>42570919</id> <revision> <id>727437646</id> <parentid>727363620</parentid> <timestamp>2016-06-29T00:34:26Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Removed extraclasses option; those classes appear to be deprecated</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2239">--[[
-- This module produces a link to a main article or articles. It implements the -- template Template:Main. -- -- If the module is used in category or category talk space, it produces "The -- main article for this category is xxx". Otherwise, it produces -- "Main article: xxx". --]]
local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mArguments -- lazily initialise local p = {}
function p.main(frame) mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {parentOnly = true}) local pages = {} for k, v in pairs(args) do if type(k) == 'number' then local display = args['label ' .. k] or args['l' .. k] local page = display and string.format('%s|%s', string.gsub(v, '|.*$', ), display) or v pages[#pages + 1] = page end end if #pages == 0 and mw.title.getCurrentTitle().namespace == 0 then return mHatnote.makeWikitextError( 'no page names specified', 'Template:Main#Errors', args.category ) end local options = { selfref = args.selfref } return p._main(pages, options) end
function p._main(args, options) -- Get the list of pages. If no first page was specified we use the current -- page name. local currentTitle = mw.title.getCurrentTitle() if #args == 0 then args = {currentTitle.text} end local firstPage = string.gsub(args[1], '|.*$', ) -- Find the pagetype. local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'article' or 'page' -- Make the formatted link text list = mHatlist.andList(args, true) -- Build the text. local isPlural = #args > 1 local mainForm local curNs = currentTitle.namespace if (curNs == 14) or (curNs == 15) then --category/talk namespaces mainForm = isPlural and 'The main %ss for this category are %s' or 'The main %s for this category is %s' else mainForm = isPlural and 'Main %ss: %s' or 'Main %s: %s' end local text = string.format(mainForm, pageType, list) -- Process the options and pass the text to the _rellink function in -- Module:Hatnote. options = options or {} local hnOptions = { selfref = options.selfref } return mHatnote._hatnote(text, hnOptions) end
return p</text>
<sha1>9iplsr5jg1vj2lm6dkuiqtfon8648ne</sha1> </revision> </page> <page> <title>Module:Message box</title> <ns>828</ns> <id>40574910</id> <revision> <id>835732555</id> <parentid>803399820</parentid> <timestamp>2018-04-10T12:58:17Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>ony load Category handler when needed, requested on talk page</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="17101">-- This is a meta-module for producing message box templates, including
-- Template:Mbox, Template:Ambox, Template:Imbox, Template:Tmbox, Template:Ombox, Template:Cmbox and Template:Fmbox.
-- Load necessary modules. require('Module:No globals') local getArgs local yesno = require('Module:Yesno')
-- Get a language object for formatDate and ucfirst. local lang = mw.language.getContentLanguage()
-- Define constants local CONFIG_MODULE = 'Module:Message box/configuration'
-- Helper functions
local function getTitleObject(...) -- Get the title object, passing the function through pcall -- in case we are over the expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end
local function union(t1, t2) -- Returns the union of two arrays. local vals = {} for i, v in ipairs(t1) do vals[v] = true end for i, v in ipairs(t2) do vals[v] = true end local ret = {} for k in pairs(vals) do table.insert(ret, k) end table.sort(ret) return ret end
local function getArgNums(args, prefix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end
-- Box class definition
local MessageBox = {} MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg) args = args or {} local obj = {}
-- Set the title object and the namespace. obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type. obj.cfg = cfg[boxType] if not obj.cfg then local ns = obj.title.namespace -- boxType is "mbox" or invalid input if ns == 0 then obj.cfg = cfg.ambox -- main namespace elseif ns == 6 then obj.cfg = cfg.imbox -- file namespace elseif ns == 14 then obj.cfg = cfg.cmbox -- category namespace else local nsTable = mw.site.namespaces[ns] if nsTable and nsTable.isTalk then obj.cfg = cfg.tmbox -- any talk namespace else obj.cfg = cfg.ombox -- other namespaces or invalid input end end end
-- Set the arguments, and remove all blank arguments except for the ones -- listed in cfg.allowBlankParams. do local newArgs = {} for k, v in pairs(args) do if v ~= then newArgs[k] = v end end for i, param in ipairs(obj.cfg.allowBlankParams or {}) do newArgs[param] = args[param] end obj.args = newArgs end
-- Define internal data structure. obj.categories = {} obj.classes = {} -- For lazy loading of Module:Category handler. obj.hasCategories = false
return setmetatable(obj, MessageBox) end
function MessageBox:addCat(ns, cat, sort) if not cat then return nil end if sort then cat = string.format(, cat, sort) else cat = string.format(, cat) end self.hasCategories = true self.categories[ns] = self.categories[ns] or {} table.insert(self.categories[ns], cat) end
function MessageBox:addClass(class) if not class then return nil end table.insert(self.classes, class) end
function MessageBox:setParameters() local args = self.args local cfg = self.cfg
-- Get type data. self.type = args.type local typeData = cfg.types[self.type] self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData typeData = typeData or cfg.types[cfg.default] self.typeClass = typeData.class self.typeImage = typeData.image
-- Find if the box has been wrongly substituted. self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box. self.isSmall = cfg.allowSmall and ( cfg.smallParam and args.small == cfg.smallParam or not cfg.smallParam and yesno(args.small) )
-- Add attributes, classes and styles. self.id = args.id if yesno(args.plainlinks) ~=
false then
self:addClass('plainlinks') end for _, class in ipairs(cfg.classes or {}) do self:addClass(class) end if self.isSmall then self:addClass(cfg.smallClass or 'mbox-small') end self:addClass(self.typeClass) self:addClass(args.class) self.style = args.style self.attrs = args.attrs
-- Set text style. self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory -- and cfg.templateCategoryRequireName are set. self.useCollapsibleTextFields = cfg.useCollapsibleTextFields if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then self.name = args.name if self.name then local templateName = mw.ustring.match( self.name, '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$' ) or self.name templateName = 'Template:' .. templateName self.templateTitle = getTitleObject(templateName) end self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) end
-- Process data for collapsible text fields. At the moment these are only -- used in Template: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.', talkText, talk, talkTitle.prefixedText ) else talkText = string.format( '%s the talk page.', talkText, talkTitle.prefixedText, talk ) end self.talk = talkText end end
-- Get other values. self.fix = args.fix ~= and args.fix or nil local date if args.date and args.date ~= then date = args.date elseif args.date == and self.isTemplatePage then date = lang:formatDate('F Y') end if date then self.date = string.format(" <small>(%s)</small>", date) end self.info = args.info if yesno(args.removalnotice) then self.removalNotice = cfg.removalNotice end end
-- Set the non-collapsible text field. At the moment this is used by all box -- types other than ambox, and also by ambox when small=yes. if self.isSmall then self.text = args.smalltext or args.text else self.text = args.text end
-- Set the below row. self.below = cfg.below and args.below
-- General image settings. self.imageCellDiv = not self.isSmall and cfg.imageCellDiv self.imageEmptyCell = cfg.imageEmptyCell if cfg.imageEmptyCellStyle then self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px' end
-- Left image settings. local imageLeft = self.isSmall and args.smallimage or args.image if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none' or not cfg.imageCheckBlank and imageLeft ~= 'none' then self.imageLeft = imageLeft if not imageLeft then local imageSize = self.isSmall and (cfg.imageSmallSize or '30x30px') or '40x40px' self.imageLeft = string.format('%s', 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 Template:Ambox/category. local date = args.date date = type(date) == 'string' and date local preposition = 'from' for _, num in ipairs(nums) do local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)] local allCat = args['all' .. tostring(num)] mainCat = type(mainCat) == 'string' and mainCat allCat = type(allCat) == 'string' and allCat if mainCat and date and date ~= then local catTitle = string.format('%s %s %s', mainCat, preposition, date) self:addCat(0, catTitle) catTitle = getTitleObject('Category:' .. catTitle) if not catTitle or not catTitle.exists then self:addCat(0, 'Articles with invalid date parameter in template') end elseif mainCat and (not date or date == ) then self:addCat(0, mainCat) end if allCat then self:addCat(0, allCat) end end end
function MessageBox:setTemplateCategories() local args = self.args local cfg = self.cfg
-- Add template categories. if cfg.templateCategory then if cfg.templateCategoryRequireName then if self.isTemplatePage then self:addCat(10, cfg.templateCategory) end elseif not self.title.isSubpage then self:addCat(10, cfg.templateCategory) end end
-- Add template error categories. if cfg.templateErrorCategory then local templateErrorCategory = cfg.templateErrorCategory local templateCat, templateSort if not self.name and not self.title.isSubpage then templateCat = templateErrorCategory elseif self.isTemplatePage then local paramsToCheck = cfg.templateErrorParamsToCheck or {} local count = 0 for i, param in ipairs(paramsToCheck) do if not args[param] then count = count + 1 end end if count > 0 then templateCat = templateErrorCategory templateSort = tostring(count) end if self.categoryNums and #self.categoryNums > 0 then templateCat = templateErrorCategory templateSort = 'C' end end self:addCat(10, templateCat, templateSort) end end
function MessageBox:setAllNamespaceCategories() -- Set categories for all namespaces. if self.invalidTypeError then local allSort = (self.title.namespace == 0 and 'Main:' or ) .. self.title.prefixedText self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort) end if self.isSubstituted then self:addCat('all', 'Pages with incorrectly substituted templates') end end
function MessageBox:setCategories() if self.title.namespace == 0 then self:setMainspaceCategories() elseif self.title.namespace == 10 then self:setTemplateCategories() end self:setAllNamespaceCategories() end
function MessageBox:renderCategories() if not self.hasCategories then -- No categories added, no need to pass them to Category handler so, -- if it was invoked, it would return the empty string. -- So we shortcut and return the empty string. return "" end -- Convert category tables to strings and pass them through -- Module:Category handler. return require('Module:Category handler')._main{ main = table.concat(self.categories[0] or {}), template = table.concat(self.categories[10] or {}), all = table.concat(self.categories.all or {}), nocat = self.args.nocat, page = self.args.page } end
function MessageBox:export() local root = mw.html.create()
-- Add the subst check error. if self.isSubstituted and self.name then root:tag('b') :addClass('error') :wikitext(string.format( 'Template <code>%s%s%s</code> has been incorrectly substituted.', mw.text.nowiki('Template:'), self.name, self.name, mw.text.nowiki('') )) end
-- Create the box table. local boxTable = root:tag('table') boxTable:attr('id', self.id or nil) for i, class in ipairs(self.classes or {}) do boxTable:addClass(class or nil) end boxTable :cssText(self.style or nil) :attr('role', 'presentation')
if self.attrs then boxTable:attr(self.attrs) end
-- Add the left-hand image. local row = boxTable:tag('tr') if self.imageLeft then local imageLeftCell = row:tag('td'):addClass('mbox-image') if self.imageCellDiv then -- If we are using a div, redefine imageLeftCell so that the image -- is inside it. Divs use style="width: 52px;", which limits the -- image width to 52px. If any images in a div are wider than that, -- they may overlap with the text or cause other display problems. imageLeftCell = imageLeftCell:tag('div'):css('width', '52px') end imageLeftCell:wikitext(self.imageLeft or nil) elseif self.imageEmptyCell then -- Some message boxes define an empty cell if no image is specified, and -- some don't. The old template code in templates where
empty cells are
-- specified gives the following hint: "No image. Cell with some width -- or padding necessary for text cell to have 100% width." row:tag('td') :addClass('mbox-empty-cell') :cssText(self.imageEmptyCellStyle or nil) end
-- Add the text. local textCell = row:tag('td'):addClass('mbox-text') if self.useCollapsibleTextFields then -- The message box uses advanced text parameters that allow things to be -- collapsible. At the moment, only ambox uses this. textCell:cssText(self.textstyle or nil) local textCellDiv = textCell:tag('div') textCellDiv :addClass('mbox-text-span') :wikitext(self.issue or nil) if (self.talk or self.fix) and not self.isSmall then textCellDiv:tag('span') :addClass('hide-when-compact') :wikitext(self.talk and (' ' .. self.talk) or nil) :wikitext(self.fix and (' ' .. self.fix) or nil) end textCellDiv:wikitext(self.date and (' ' .. self.date) or nil) if self.info and not self.isSmall then textCellDiv :tag('span') :addClass('hide-when-compact') :wikitext(self.info and (' ' .. self.info) or nil) end if self.removalNotice then textCellDiv:tag('small') :addClass('hide-when-compact') :tag('i') :wikitext(string.format(" (%s)", self.removalNotice)) end else -- Default text formatting - anything goes. textCell :cssText(self.textstyle or nil) :wikitext(self.text or nil) end
-- Add the right-hand image. if self.imageRight then local imageRightCell = row:tag('td'):addClass('mbox-imageright') if self.imageCellDiv then -- If we are using a div, redefine imageRightCell so that the image -- is inside it. imageRightCell = imageRightCell:tag('div'):css('width', '52px') end imageRightCell :wikitext(self.imageRight or nil) end
-- Add the below row. if self.below then boxTable:tag('tr') :tag('td') :attr('colspan', self.imageRight and '3' or '2') :addClass('mbox-text') :cssText(self.textstyle or nil) :wikitext(self.below or nil) end
-- Add error message for invalid type parameters. if self.invalidTypeError then root:tag('div') :css('text-align', 'center') :wikitext(string.format( 'This message box is using an invalid "type=%s" parameter and needs fixing.', self.type or )) end
-- Add categories. root:wikitext(self:renderCategories() or nil)
return tostring(root) end
-- Exports
local p, mt = {}, {}
function p._exportClasses() -- For testing. return { MessageBox = MessageBox } end
function p.main(boxType, args, cfgTables) local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE)) box:setParameters() box:setCategories() return box:export() end
function mt.__index(t, k) return function (frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return t.main(k, getArgs(frame, {trim = false, removeBlanks = false})) end end
return setmetatable(p, mt)</text>
<sha1>6r6gh40ujwjmoo5h9kc5j9ytuxwrvvy</sha1> </revision> </page> <page> <title>Module:Message box/configuration</title> <ns>828</ns> <id>40627038</id> <revision> <id>742383738</id> <parentid>717357572</parentid> <timestamp>2016-10-03T11:04:13Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>allow all templates to disable the plainlinks class</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="6091">--------------------------------------------------------------------------------
-- Message box configuration -- -- -- -- This module contains configuration data for Module:Message box. --
return { ambox = { types = { speedy = { class = 'ambox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ambox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ambox-content', image = 'Ambox important.svg' }, style = { class = 'ambox-style', image = 'Edit-clear.svg' }, move = { class = 'ambox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ambox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ambox-notice', image = 'Information icon4.svg' } }, default = 'notice', allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'}, allowSmall = true, smallParam = 'left', smallClass = 'mbox-small-left', substCheck = true, classes = {'metadata', 'ambox'}, imageEmptyCell = true, imageCheckBlank = true, imageSmallSize = '20x20px', imageCellDiv = true, useCollapsibleTextFields = true, imageRightNone = true, sectionDefault = 'article', allowMainspaceCategories = true, templateCategory = 'Article message templates', templateCategoryRequireName = true, templateErrorCategory = 'Article message templates with missing parameters', templateErrorParamsToCheck = {'issue', 'fix', 'subst'}, removalNotice = '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:MultiReplace</title> <ns>828</ns> <id>51070180</id> <revision> <id>838829574</id> <parentid>838232284</parentid> <timestamp>2018-04-29T15:19:30Z</timestamp> <contributor> <username>Petr Matas</username> <id>1050951</id> </contributor> <comment>Allow a call from Lua without curly braces</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1424">p = {}
local function MultiReplace(args) local input = args[1] or " <!--or 115 other parameters--> " local plain = args.plain == "yes"
local i = 1 local changeList = {} while args[i * 2] do local change = {pattern = args[i * 2], repl = args[i * 2 + 1]} if not change.repl then return require('Module:Error').error{ 'MultiReplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. change.pattern .. '</code>' } end changeList[i] = change i = i + 1 end
local matchList = {} local pos = 1 local len = mw.ustring.len(input) local result = "" while pos <= len do local bestStart = len + 1 local bestStop = len local bestChange for _, change in ipairs(changeList) do local start, stop = mw.ustring.find(input, change.pattern, pos, plain) if start and (start < bestStart) then bestStart = start bestStop = stop bestChange = change end end result = result .. mw.ustring.sub(input, pos, bestStart - 1) if bestChange then local fragment = mw.ustring.sub(input, bestStart, bestStop) result = result .. (plain and bestChange.repl or mw.ustring.gsub(fragment, bestChange.pattern, bestChange.repl, 1)) end pos = bestStop + 1 end return result end
function p.main(frame, ...) local args = type(frame) ~= 'table' and {frame, ...} or type(frame.args) ~= 'table' and frame or frame.args[1] and frame.args or frame:getParent().args return MultiReplace(args) end
return p</text>
<sha1>95xnv3yvolixngufi1jdsiwnf7fdf62</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 Template:Pp-meta and its daughter templates such as
-- Template:Pp-dispute, Template:Pp-vandalism and Template: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', mw.site.namespaces[14].name, cat, sort ) end end
-- Validation function for the expiry and the protection date local function validateDate(dateString, dateType) if not lang then lang = mw.language.getContentLanguage() end local success, result = pcall(lang.formatDate, lang, 'U', dateString) if success then result = tonumber(result) if result then return result end end error(string.format( 'invalid %s: %s', dateType, tostring(dateString) ), 4) end
local function makeFullUrl(page, query, display) return string.format( '[%s %s]', tostring(mw.uri.fullUrl(page, query)), display ) end
-- Given a directed graph formatted as node -> table of direct successors, -- get a table of all nodes reachable from a given node (though always -- including the given node). local function getReachableNodes(graph, start) local toWalk, retval = {[start] = true}, {} while true do -- Can't use pairs() since we're adding and removing things as we're iterating local k = next(toWalk) -- This always gets the "first" key if k == nil then return retval end toWalk[k] = nil retval[k] = true for _,v in ipairs(graph[k]) do if not retval[v] then toWalk[v] = true end end end end
-- Protection class
local Protection = {} Protection.__index = Protection
Protection.supportedActions = { edit = true, move = true, autoreview = true, upload = true }
Protection.bannerConfigFields = { 'text', 'explanation', 'tooltip', 'alt', 'link', 'image' }
function Protection.new(args, cfg, title) local obj = {} obj._cfg = cfg obj.title = title or mw.title.getCurrentTitle()
-- Set action if not args.action then obj.action = 'edit' elseif Protection.supportedActions[args.action] then obj.action = args.action else error(string.format( 'invalid action: %s', tostring(args.action) ), 3) end
-- Set level obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title) if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then -- Users need to be autoconfirmed to move pages anyway, so treat -- semi-move-protected pages as unprotected. obj.level = '*' end
-- Set expiry local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) if effectiveExpiry == 'infinity' then obj.expiry = 'indef' elseif effectiveExpiry ~= 'unknown' then obj.expiry = validateDate(effectiveExpiry, 'expiry date') end
-- Set reason if args[1] then obj.reason = mw.ustring.lower(args[1]) if obj.reason:find('|') then error('reasons cannot contain the pipe character ("|")', 3) end end
-- Set protection date if args.date then obj.protectionDate = validateDate(args.date, 'protection date') end
-- Set banner config do obj.bannerConfig = {} local configTables = {} if cfg.banners[obj.action] then configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason] end if cfg.defaultBanners[obj.action] then configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level] configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default end configTables[#configTables + 1] = cfg.masterBanner for i, field in ipairs(Protection.bannerConfigFields) do for j, t in ipairs(configTables) do if t[field] then obj.bannerConfig[field] = t[field] break end end end end return setmetatable(obj, Protection) end
function Protection:isProtected() return self.level ~= '*' end
function Protection:isTemporary() return type(self.expiry) == 'number' end
function Protection:makeProtectionCategory() local cfg = self._cfg local title = self.title
-- Exit if the page is not protected. if not self:isProtected() then return end
-- Get the expiry key fragment. local expiryFragment if self.expiry == 'indef' then expiryFragment = self.expiry elseif type(self.expiry) == 'number' then expiryFragment = 'temp' end
-- Get the namespace key fragment. local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace] if not namespaceFragment and title.namespace % 2 == 1 then namespaceFragment = 'talk' end
-- Define the order that key fragments are tested in. This is done with an -- array of tables containing the value to be tested, along with its -- position in the cfg.protectionCategories table. local order = { {val = expiryFragment, keypos = 1}, {val = namespaceFragment, keypos = 2}, {val = self.reason, keypos = 3}, {val = self.level, keypos = 4}, {val = self.action, keypos = 5} }
--[[ -- The old protection templates used an ad-hoc protection category system, -- with some templates prioritising namespaces in their categories, and -- others prioritising the protection reason. To emulate this in this module -- we use the config table cfg.reasonsWithNamespacePriority to set the -- reasons for which namespaces have priority over protection reason. -- If we are dealing with one of those reasons, move the namespace table to -- the end of the order table, i.e. give it highest priority. If not, the -- reason should have highest priority, so move that to the end of the table -- instead. --]] table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[ -- Check increasingly generic key combinations until we find a match. If a -- specific category exists for the combination of key fragments we are -- given, that match will be found first. If not, we keep trying different -- key fragment combinations until we match using the key -- "all-all-all-all-all". -- -- To generate the keys, we index the key subtables using a binary matrix -- with indexes i and j. j is only calculated up to the number of active -- subtables. For example, if there were three active subtables, the matrix -- would look like this, with 0 corresponding to the key fragment "all", and -- 1 corresponding to other key fragments. -- -- j 1 2 3 -- i -- 1 1 1 1 -- 2 0 1 1 -- 3 1 0 1 -- 4 0 0 1 -- 5 1 1 0 -- 6 0 1 0 -- 7 1 0 0 -- 8 0 0 0 -- -- Values of j higher than the number of active subtables are set -- to the string "all". -- -- A key for cfg.protectionCategories is constructed for each value of i. -- The position of the value in the key is determined by the keypos field in -- each subtable. --]] local cats = cfg.protectionCategories for i = 1, 2^noActive do local key = {} for j, t in ipairs(attemptOrder) do if j > noActive then key[t.keypos] = 'all' else local quotient = i / 2 ^ (j - 1) quotient = math.ceil(quotient) if quotient % 2 == 1 then key[t.keypos] = t.val else key[t.keypos] = 'all' end end end key = table.concat(key, '|') local attempt = cats[key] if attempt then return makeCategoryLink(attempt, title.text) end end return end
function Protection:isIncorrect() local expiry = self.expiry return not self:isProtected() or type(expiry) == 'number' and expiry < os.time() end
function Protection:isTemplateProtectedNonTemplate() local action, namespace = self.action, self.title.namespace return self.level == 'templateeditor' and ( (action ~= 'edit' and action ~= 'move') or (namespace ~= 10 and namespace ~= 828) ) end
function Protection:makeCategoryLinks() local msg = self._cfg.msg local ret = { self:makeProtectionCategory() } if self:isIncorrect() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-incorrect'], self.title.text ) end if self:isTemplateProtectedNonTemplate() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-template'], self.title.text ) end return table.concat(ret) end
-- Blurb class
local Blurb = {} Blurb.__index = Blurb
Blurb.bannerTextFields = { text = true, explanation = true, tooltip = true, alt = true, link = true }
function Blurb.new(protectionObj, args, cfg) return setmetatable({ _cfg = cfg, _protectionObj = protectionObj, _args = args }, Blurb) end
-- Private methods --
function Blurb:_formatDate(num) -- Formats a Unix timestamp into dd Month, YYYY format. lang = lang or mw.language.getContentLanguage() local success, date = pcall( lang.formatDate, lang, self._cfg.msg['expiry-date-format'] or 'j F Y', '@' .. tostring(num) ) if success then return date end end
function Blurb:_getExpandedMessage(msgKey) return self:_substituteParameters(self._cfg.msg[msgKey]) end
function Blurb:_substituteParameters(msg) if not self._params then local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter parameterFuncs.EDITREQUEST = self._makeEditRequestParameter parameterFuncs.EXPIRY = self._makeExpiryParameter parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter parameterFuncs.IMAGELINK = self._makeImageLinkParameter parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter parameterFuncs.PAGETYPE = self._makePagetypeParameter parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter parameterFuncs.TALKPAGE = self._makeTalkPageParameter parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, { __index = function (t, k) local param if parameterFuncs[k] then param = parameterFuncs[k](self) end param = param or t[k] = param return param end }) end
msg = msg:gsub('${(%u+)}', self._params) return msg end
function Blurb:_makeCurrentVersionParameter() -- A link to the page history or the move log, depending on the kind of -- protection. local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'move' then -- We need the move log link. return makeFullUrl( 'Special:Log', {type = 'move', page = pagename}, self:_getExpandedMessage('current-version-move-display') ) else -- We need the history link. return makeFullUrl( pagename, {action = 'history'}, self:_getExpandedMessage('current-version-edit-display') ) end end
function Blurb:_makeEditRequestParameter() local mEditRequest = require('Module:Submit an edit request') local action = self._protectionObj.action local level = self._protectionObj.level
-- Get the edit request type. local requestType if action == 'edit' then if level == 'autoconfirmed' then requestType = 'semi' elseif level == 'extendedconfirmed' then requestType = 'extended' elseif level == 'templateeditor' then requestType = 'template' end end requestType = requestType or 'full'
-- Get the display value. local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display} end
function Blurb:_makeExpiryParameter() local expiry = self._protectionObj.expiry if type(expiry) == 'number' then return self:_formatDate(expiry) else return expiry end end
function Blurb:_makeExplanationBlurbParameter() -- Cover special cases first. if self._protectionObj.title.namespace == 8 then -- MediaWiki namespace return self:_getExpandedMessage('explanation-blurb-nounprotect') end
-- Get explanation blurb table keys local action = self._protectionObj.action local level = self._protectionObj.level local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any -- parameters. local explanations = self._cfg.explanationBlurbs local msg if explanations[action][level] and explanations[action][level][talkKey] then msg = explanations[action][level][talkKey] elseif explanations[action][level] and explanations[action][level].default then msg = explanations[action][level].default elseif explanations[action].default and explanations[action].default[talkKey] then msg = explanations[action].default[talkKey] elseif explanations[action].default and explanations[action].default.default then msg = explanations[action].default.default else error(string.format( 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"', action, level, talkKey ), 8) end return self:_substituteParameters(msg) end
function Blurb:_makeImageLinkParameter() local imageLinks = self._cfg.imageLinks local action = self._protectionObj.action local level = self._protectionObj.level local msg if imageLinks[action][level] then msg = imageLinks[action][level] elseif imageLinks[action].default then msg = imageLinks[action].default else msg = imageLinks.edit.default end return self:_substituteParameters(msg) end
function Blurb:_makeIntroBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-blurb-expiry') else return self:_getExpandedMessage('intro-blurb-noexpiry') end end
function Blurb:_makeIntroFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-fragment-expiry') else return self:_getExpandedMessage('intro-fragment-noexpiry') end end
function Blurb:_makePagetypeParameter() local pagetypes = self._cfg.pagetypes return pagetypes[self._protectionObj.title.namespace] or pagetypes.default or error('no default pagetype defined', 8) end
function Blurb:_makeProtectionBlurbParameter() local protectionBlurbs = self._cfg.protectionBlurbs local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionBlurbs[action][level] then msg = protectionBlurbs[action][level] elseif protectionBlurbs[action].default then msg = protectionBlurbs[action].default elseif protectionBlurbs.edit.default then msg = protectionBlurbs.edit.default else error('no
protection blurb defined for protectionBlurbs.edit.default', 8)
end return self:_substituteParameters(msg) end
function Blurb:_makeProtectionDateParameter() local protectionDate = self._protectionObj.protectionDate if type(protectionDate) == 'number' then return self:_formatDate(protectionDate) else return protectionDate end end
function Blurb:_makeProtectionLevelParameter() local protectionLevels = self._cfg.protectionLevels local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionLevels[action][level] then msg = protectionLevels[action][level] elseif protectionLevels[action].default then msg = protectionLevels[action].default elseif protectionLevels.edit.default then msg = protectionLevels.edit.default else error('no protection level defined for protectionLevels.edit.default', 8) end return self:_substituteParameters(msg) end
function Blurb:_makeProtectionLogParameter() local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'autoreview' then -- We need the pending changes log. return makeFullUrl( 'Special:Log', {type = 'stable', page = pagename}, self:_getExpandedMessage('pc-log-display') ) else -- We need the protection log. return makeFullUrl( 'Special:Log', {type = 'protect', page = pagename}, self:_getExpandedMessage('protection-log-display') ) end end
function Blurb:_makeTalkPageParameter() return string.format( '%s', mw.site.namespaces[self._protectionObj.title.namespace].talk.name, self._protectionObj.title.text, self._args.section or 'top', self:_getExpandedMessage('talk-page-link-display') ) end
function Blurb:_makeTooltipBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-blurb-expiry') else return self:_getExpandedMessage('tooltip-blurb-noexpiry') end end
function Blurb:_makeTooltipFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-fragment-expiry') else return self:_getExpandedMessage('tooltip-fragment-noexpiry') end end
function Blurb:_makeVandalTemplateParameter() return require('Module:Vandal-m')._main{ self._args.user or self._protectionObj.title.baseText } end
-- Public methods --
function Blurb:makeBannerText(key) -- Validate input. if not key or not Blurb.bannerTextFields[key] then error(string.format( '"%s" is not a valid banner config field', tostring(key) ), 2) end
-- Generate the text. local msg = self._protectionObj.bannerConfig[key] if type(msg) == 'string' then return self:_substituteParameters(msg) elseif type(msg) == 'function' then msg = msg(self._protectionObj, self._args) if type(msg) ~= 'string' then error(string.format( 'bad output from banner config function with key "%s"' .. ' (expected string, got %s)', tostring(key), type(msg) ), 4) end return self:_substituteParameters(msg) end end
-- BannerTemplate class
local BannerTemplate = {} BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg) local obj = {} obj._cfg = cfg
-- Set the image filename. local imageFilename = protectionObj.bannerConfig.image if imageFilename then obj._imageFilename = imageFilename else -- If an image filename isn't specified explicitly in the banner config, -- generate it from the protection status and the namespace. local action = protectionObj.action local level = protectionObj.level local namespace = protectionObj.title.namespace local reason = protectionObj.reason
-- Deal with special cases first. if ( namespace == 10 or namespace == 828 or reason and obj._cfg.indefImageReasons[reason] ) and action == 'edit' and level == 'sysop' and not protectionObj:isTemporary() then -- Fully protected modules and templates get the special red "indef" -- padlock. obj._imageFilename = obj._cfg.msg['image-filename-indef'] else -- Deal with regular protection types. local images = obj._cfg.images if images[action] then if images[action][level] then obj._imageFilename = images[action][level] elseif images[action].default then obj._imageFilename = images[action].default end end end end return setmetatable(obj, BannerTemplate) end
function BannerTemplate:renderImage() local filename = self._imageFilename or self._cfg.msg['image-filename-default'] or 'Transparent.gif' return makeFileLink{ file = filename, size = (self.imageWidth or 20) .. 'px', alt = self._imageAlt, link = self._imageLink, caption = self.imageCaption } end
-- Banner class
local Banner = setmetatable({}, BannerTemplate) Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageWidth = 40 obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip. obj._reasonText = blurbObj:makeBannerText('text') obj._explanationText = blurbObj:makeBannerText('explanation') obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing. return setmetatable(obj, Banner) end
function Banner:__tostring() -- Renders the banner. makeMessageBox = makeMessageBox or require('Module:Message box').main local reasonText = self._reasonText or error('no reason text set', 2) local explanationText = self._explanationText local mbargs = { page = self._page, type = 'protection', image = self:renderImage(), text = string.format( "%s%s", reasonText, explanationText and '<br />' .. explanationText or ) } return makeMessageBox('mbox', mbargs) end
-- Padlock class
local Padlock = setmetatable({}, BannerTemplate) Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageWidth = 20 obj.imageCaption = blurbObj:makeBannerText('tooltip') obj._imageAlt = blurbObj:makeBannerText('alt') obj._imageLink = blurbObj:makeBannerText('link') obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action] or cfg.padlockIndicatorNames.default or 'pp-default' return setmetatable(obj, Padlock) end
function Padlock:__tostring() local frame = mw.getCurrentFrame() -- The nowiki tag helps prevent whitespace at the top of articles. return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{ name = 'indicator', args = {name = self._indicatorName}, content = self:renderImage() } end
-- Exports
local p = {}
function p._exportClasses() -- This is used for testing purposes. return { Protection = Protection, Blurb = Blurb, BannerTemplate = BannerTemplate, Banner = Banner, Padlock = Padlock, } end
function p._main(args, cfg, title) args = args or {} cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its -- protection from some other action, then don't bother displaying anything -- for the other action (except categories). if protectionObj.action == 'edit' or args.demolevel or not getReachableNodes( cfg.hierarchy, protectionObj.level )[effectiveProtectionLevel('edit', protectionObj.title)] then -- Initialise the blurb object local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner if protectionObj:isProtected() then ret[#ret + 1] = tostring( (yesno(args.small) and Padlock or Banner) .new(protectionObj, blurbObj, cfg) ) end end
-- Render the categories if yesno(args.category) ~= false then ret[#ret + 1] = protectionObj:makeCategoryLinks() end
return table.concat(ret) end
function p.main(frame, cfg) cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any. local parent = frame.getParent and frame:getParent() local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', )]
-- Find user args, and use the parent frame if we are being called from a -- wrapper template. getArgs = getArgs or require('Module:Arguments').getArgs local userArgs = getArgs(frame, { parentOnly = defaultArgs, frameOnly = not defaultArgs })
-- Build the args table. User-specified args overwrite default args. local args = {} for k, v in pairs(defaultArgs or {}) do args[k] = v end for k, v in pairs(userArgs) do args[k] = v end return p._main(args, cfg) end
return p</text>
<sha1>ice162y8kua930ie41kredxjaxhzy3y</sha1> </revision> </page> <page> <title>Module:Protection banner/config</title> <ns>828</ns> <id>42982788</id> <revision> <id>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 "current-version-edit-display" or -- "current-version-move-display". -- -- ${EDITREQUEST} - a link to create an edit request for the current page. -- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes -- on the talk page; you may submit a request to ask an administrator to make -- an edit if it is minor or supported by consensus." -- -- ${IMAGELINK} - a link to set the image to, depending on the protection -- action and protection level. -- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry -- is set. E.g. "Editing of this page by new or unregistered users is currently -- disabled until dd Month YYYY." -- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation -- so that it can be used in run-on sentences. -- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template". -- Defined in the cfg.pagetypes table. -- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g. -- "Editing of this page by new or unregistered users is currently disabled" -- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the -- template. -- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or -- "semi-protected". -- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log, -- depending on the protection action. -- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links -- straight to that talk page section. -- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to -- create a blurb like "This template is semi-protected", or "This article is -- move-protected until DD Month YYYY". -- -- ${VANDAL} - links for the specified username (or the root page name) -- using Module:Vandal-m. -- -- Functions -- -- For advanced users, it is possible to use Lua functions instead of strings -- in the banner config tables. Using functions gives flexibility that is not -- possible just by using parameters. Functions take two arguments, the -- protection object and the template arguments, and they must output a string. -- -- For example: -- -- text = function (protectionObj, args) -- if protectionObj.level == 'autoconfirmed' then -- return 'foo' -- else -- return 'bar' -- end -- end -- -- Some protection object properties and methods that may be useful: -- protectionObj.action - the protection action -- protectionObj.level - the protection level -- protectionObj.reason - the protection reason -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set -- to indefinite, and the protection time in unix time if temporary. -- protectionObj.protectionDate - the protection date in unix time, or nil if -- unspecified. -- protectionObj.bannerConfig - the banner config found by the module. Beware -- of editing the config field used by the function, as it could create an -- infinite loop. -- protectionObj:isProtected - returns a boolean showing whether the page is -- protected. -- protectionObj:isTemporary - returns a boolean showing whether the expiry is -- temporary. -- protectionObj:isIncorrect - returns a boolean showing whether the protection -- template is incorrect. --]]
-- The master banner data, used if no values have been found in banners or -- defaultBanners. masterBanner = { text = '${INTROBLURB}', explanation = '${EXPLANATIONBLURB}', tooltip = '${TOOLTIPBLURB}', link = '${IMAGELINK}', alt = 'Page ${PROTECTIONLEVEL}' },
-- The default banner data. This holds banner data for different protection -- levels. -- *required* - this table needs edit, move, autoreview and upload subtables. defaultBanners = { edit = {}, move = {}, autoreview = { autoconfirmed = { alt = 'Page protected with pending changes level 1', tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users', image = 'Padlock-silver-light.svg' }, default = { alt = 'Page protected with pending changes level 2', tooltip = 'All edits by users who are not reviewers or administrators are' .. ' subject to review prior to becoming visible to unregistered users', image = 'Padlock-orange.svg' } }, upload = {} },
-- The banner data. This holds banner data for different protection reasons. -- In fact, the reasons specified in this table control which reasons are -- valid inputs to the first positional parameter. -- -- There is also a non-standard "description" field that can be used for items -- in this table. This is a description of the protection reason for use in the -- module documentation. -- -- *required* - this table needs edit, move, autoreview and upload subtables. banners = { edit = { blp = { description = 'For pages protected to promote compliance with the' .. ' [[Wikipedia:Biographies of living persons' .. '|biographies of living persons]] policy', text = '${INTROFRAGMENT} to promote compliance with' .. ' [[Wikipedia:Biographies of living persons' .. "|Wikipedia's policy on the biographies" .. ' of living people]].', tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on' .. ' biographies of living people', }, dmca = { description = 'For pages protected by the Wikimedia Foundation' .. ' due to Digital Millennium Copyright Act takedown requests', explanation = function (protectionObj, args) local ret = 'Pursuant to a rights owner notice under the Digital' .. ' Millennium Copyright Act (DMCA) regarding some content' .. ' in this article, the Wikimedia Foundation acted under' .. ' applicable law and took down and restricted the content' .. ' in question.' if args.notice then ret = ret .. ' A copy of the received notice can be found here: ' .. args.notice .. '.' end ret = ret .. ' For more information, including websites discussing' .. ' how to file a counter-notice, please see' .. " Wikipedia:Office actions and the article's ${TALKPAGE}." .. "Do not remove this template from the article until the" .. " restrictions are withdrawn." return ret end, image = 'Padlock-black.svg', }, dispute = { description = 'For pages protected due to editing disputes', text = function (protectionObj, args) -- Find the value of "disputes". local display = 'disputes' local disputes if args.section then disputes = string.format( '%s', mw.site.namespaces[protectionObj.title.namespace].talk.name, protectionObj.title.text, args.section, display ) else disputes = display end
-- Make the blurb, depending on the expiry. local msg if type(protectionObj.expiry) == 'number' then msg = '${INTROFRAGMENT} or until editing %s have been resolved.' else msg = '${INTROFRAGMENT} until editing %s have been resolved.' end return string.format(msg, disputes) end, explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', tooltip = '${TOOLTIPFRAGMENT} due to editing disputes', }, ecp = { description = 'For articles in topic areas authorized by' .. ' 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' .. ' protected from' .. ' editing because it is currently or will soon be displayed' .. ' on the Main Page.', explanation
= 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.' .. '<br /><span style="font-size:90%;">' .. "Administrators: Once this image is definitely off the Main Page," .. ' please unprotect this file, or reduce to semi-protection,' .. ' as appropriate.</span>', }, office = { description = 'For pages protected by the Wikimedia Foundation', text = function (protectionObj, args) local ret = 'This ${PAGETYPE} is currently under the' .. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.' if protectionObj.protectionDate then ret = ret .. ' It has been protected since ${PROTECTIONDATE}.' end return ret end, explanation = "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not remove protection from this" .. " page unless you are authorized by the Wikimedia Foundation to do" .. " so.", image = 'Padlock-black.svg', }, reset = { description = 'For pages protected by the Wikimedia Foundation and' .. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.', explanation = function (protectionObj, args) local ret = if protectionObj.protectionDate then ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was' else ret = ret .. 'This ${PAGETYPE} has been' end ret = ret .. ' reduced to a' .. ' simplified, "bare bones" version so that it may be completely' .. ' rewritten to ensure it meets the policies of' .. ' Neutral Point of View and Verifiability.' .. ' Standard Wikipedia policies will apply to its rewriting—which' .. ' will eventually be open to all editors—and will be strictly' .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while' .. ' it is being rebuilt.\n\n' .. 'Any insertion of material directly from' .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as' .. ' will any material added to the ${PAGETYPE} that is not properly' .. ' sourced. The associated talk page(s) were also cleared on the' .. " same date.\n\n" .. "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not override" .. " this action, and do not remove protection from this page," .. " unless you are authorized by the Wikimedia Foundation" .. " to do so. No editor may remove this notice."
return ret end, image = 'Padlock-black.svg', }, sock = { description = 'For pages protected due to' .. ' sock puppetry', text = '${INTROFRAGMENT} to prevent sock puppets of' .. ' blocked or' .. ' banned users' .. ' from editing it.', tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from' .. ' editing it', }, template = { description = 'For high-risk' .. ' templates and Lua modules', text = 'This is a permanently protected ${PAGETYPE},' .. ' as it is high-risk.', explanation = 'Please discuss any changes on the ${TALKPAGE}; you may' .. ' ${EDITREQUEST} to ask an' .. ' administrator or' .. ' 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' .. ' consensus. You can also' .. ' 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' .. ' {{unblock}} 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]],' .. ' log in,' .. ' or create an account.', }, vandalism = { description = 'For pages protected against' .. ' vandalism', text = '${INTROFRAGMENT} due to vandalism.', explanation = function (protectionObj, args) local ret = if protectionObj.level == 'sysop' then ret = ret .. "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ' end return ret .. '${EXPLANATIONBLURB}' end, tooltip = '${TOOLTIPFRAGMENT} due to vandalism', } }, move = { dispute = { description = 'For pages protected against page moves due to' .. ' disputes over the page title', explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', image = 'Padlock-olive.svg' }, vandalism = { description = 'For pages protected against' .. ' [[Wikipedia:Vandalism#Page-move vandalism' .. ' |page-move vandalism]]' } }, autoreview = {}, upload = {} },
-- -- GENERAL DATA TABLES --
-- Protection blurbs
-- This table produces the protection blurbs available with the -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and -- protection level, and is checked by the module in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionBlurbs = { edit = { default = 'This ${PAGETYPE} is currently ' .. '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 disabled', extendedconfirmed = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} as a result of' .. ' ArbCom enforcement or meets the' .. ' criteria for community use', }, move = { default = 'This ${PAGETYPE} is currently protected' .. ' from page moves' }, autoreview = { autoconfirmed = 'All edits made to this ${PAGETYPE} by' .. ' new or' .. ' unregistered' .. ' users are currently' .. ' subject to review', default = 'All edits made to this ${PAGETYPE} by users who are not' .. ' reviewers or' .. ' administrators are currently' .. ' subject to review' }, upload = { default = 'Uploading new versions of this ${PAGETYPE} is currently disabled' } },
-- Explanation blurbs
-- This table produces the explanation blurbs available with the -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action, -- protection level, and whether the page is a talk page or not. If the page is -- a talk page it will have a talk key of "talk"; otherwise it will have a talk -- key of "subject". The table is checked in the following order: -- 1. page's protection action, page's protection level, page's talk key -- 2. page's protection action, page's protection level, default talk key -- 3. page's protection action, default protection level, page's talk key -- 4. page's protection action, default protection level, default talk key -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. explanationBlurbs = { edit = { autoconfirmed = { subject = 'See the ' .. '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]], log in, or' .. ' create an account.', default = 'See the ' .. '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]], log in, or' .. ' 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 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' .. ' consensus.' }, default = { subject = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' 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 ' .. '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 ' .. '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' .. ' request that the page be' .. ' unprotected.', default = 'See the ' .. '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' .. ' request that the page be' .. ' unprotected.' } }, autoreview = { default = { reviewer = 'See the ' .. '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 reviewer user right.', default = 'See the ' .. '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]], log in, or' .. ' create an account.' }, }, upload = { default = { default = 'See the ' .. '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' .. ' protected edit request, or you' .. ' can request' .. ' that the file be unprotected.' } } },
-- Protection levels
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which -- produces a short label for different protection levels. It is sorted by -- protection action and protection level, and is checked in the following -- order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionLevels = { edit = { default = 'protected', templateeditor = 'template-protected', extendedconfirmed = 'extended-protected', autoconfirmed = 'semi-protected', }, move = { default = 'move-protected' }, autoreview = { }, upload = { default = 'upload-protected' } },
-- Images
-- This table lists different padlock images for each protection action and -- protection level. It is used if an image is not specified in any of the -- banner data tables, and if the page does not satisfy the conditions for using -- the ['image-filename-indef'] image. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level images = { edit = { default = 'Padlock.svg', templateeditor = 'Padlock-pink.svg', extendedconfirmed = 'Padlock-blue.svg', autoconfirmed = 'Padlock-silver.svg' }, move = { default = 'Padlock-olive.svg', }, autoreview = { autoconfirmed = 'Padlock-silver-light.svg', default = 'Padlock-orange.svg' }, upload = { default = 'Padlock-purple.svg' } },
-- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true },
-- Image links
-- This table provides the data for the ${IMAGELINK} parameter, which gets -- the image link for small padlock icons based on the page's protection action -- and protection level. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. imageLinks = { edit = { default = 'Wikipedia:Protection policy#full', templateeditor = 'Wikipedia:Protection policy#template', extendedconfirmed = 'Wikipedia:Protection policy#extended', autoconfirmed = 'Wikipedia:Protection policy#semi' }, move = { default = 'Wikipedia:Protection policy#move' }, autoreview = { autoconfirmed = 'Wikipedia:Protection policy#pc1', reviewer = 'Wikipedia:Protection policy#pc2' }, upload = { default = 'Wikipedia:Protection policy#upload' } },
-- Padlock indicator names
-- This table provides the "name" attribute for the <indicator> extension tag -- with which small padlock icons are generated. All indicator tags on a page -- are displayed in alphabetical order based on this attribute, and with -- indicator tags with duplicate names, the last tag on the page wins. -- The attribute is chosen based on the protection action; table keys must be a -- protection action name or the string "default". padlockIndicatorNames = { autoreview = 'pp-autoreview', default = 'pp-default' },
-- Protection categories
--[[ -- The protection categories are stored in the protectionCategories table. -- Keys to this table are made up of the following strings: -- -- 1. the expiry date -- 2. the namespace -- 3. the protection reason (e.g. "dispute" or "vandalism") -- 4. the protection level (e.g. "sysop" or "autoconfirmed") -- 5. the action (e.g. "edit" or "move") -- -- When the module looks up a category in the table, first it will will check to -- see a key exists that corresponds to all five parameters. For example, a -- user page semi-protected from vandalism for two weeks would have the key -- "temp-user-vandalism-autoconfirmed-edit". If no
match is found, the module
-- changes the first part of the key to "all" and checks the table again. It -- keeps checking increasingly generic key combinations until it finds the -- field, or until it reaches the key "all-all-all-all-all". -- -- The module uses a binary matrix to determine the order in which to search. -- This is best demonstrated by a table. In this table, the "0" values -- represent "all", and the "1" values represent the original data (e.g. -- "indef" or "file" or "vandalism"). -- -- expiry namespace reason level action -- order -- 1 1 1 1 1 1 -- 2 0 1 1 1 1 -- 3 1 0 1 1 1 -- 4 0 0 1 1 1 -- 5 1 1 0 1 1 -- 6 0 1 0 1 1 -- 7 1 0 0 1 1 -- 8 0 0 0 1 1 -- 9 1 1 1 0 1 -- 10 0 1 1 0 1 -- 11 1 0 1 0 1 -- 12 0 0 1 0 1 -- 13 1 1 0 0 1 -- 14 0 1 0 0 1 -- 15 1 0 0 0 1 -- 16 0 0 0 0 1 -- 17 1 1 1 1 0 -- 18 0 1 1 1 0 -- 19 1 0 1 1 0 -- 20 0 0 1 1 0 -- 21 1 1 0 1 0 -- 22 0 1 0 1 0 -- 23 1 0 0 1 0 -- 24 0 0 0 1 0 -- 25 1 1 1 0 0 -- 26 0 1 1 0 0 -- 27 1 0 1 0 0 -- 28 0 0 1 0 0 -- 29 1 1 0 0 0 -- 30 0 1 0 0 0 -- 31 1 0 0 0 0 -- 32 0 0 0 0 0 -- -- In this scheme the action has the highest priority, as it is the last -- to change, and the expiry has the least priority, as it changes the most. -- The priorities of the expiry, the protection level and the action are -- fixed, but the priorities of the reason and the namespace can be swapped -- through the use of the cfg.bannerDataNamespaceHasPriority table. --]]
-- If the reason specified to the template is listed in this table, -- namespace data will take priority over reason data in the protectionCategories -- table. reasonsWithNamespacePriority = { vandalism = true, },
-- The string to use as a namespace key for the protectionCategories table for each -- namespace number. categoryNamespaceKeys = { [ 2] = 'user', [ 3] = 'user', [ 4] = 'project', [ 6] = 'file', [ 8] = 'mediawiki', [ 10] = 'template', [ 12] = 'project', [ 14] = 'category', [100] = 'portal', [828] = 'module', },
protectionCategories = { ['all|all|all|all|all'] = 'Wikipedia fully protected pages', ['all|all|office|all|all'] = 'Wikipedia Office-protected pages', ['all|all|reset|all|all'] = 'Wikipedia Office-protected pages', ['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages', ['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files', ['all|all|all|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction', ['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction', ['all|template|all|all|edit'] = 'Wikipedia fully-protected templates', ['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages', ['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages', ['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people', ['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people', ['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute', ['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users', ['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism', ['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories', ['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files', ['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals', ['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages', ['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages', ['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates', ['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages', ['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates', ['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people', ['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people', ['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute', ['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users', ['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism', ['all|category|all|sysop|edit'] = 'Wikipedia protected categories', ['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files', ['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages', ['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages', ['all|template|all|sysop|edit'] = 'Wikipedia fully-protected templates', ['all|user|all|sysop|edit'] = 'Wikipedia protected user and user talk pages', ['all|module|all|all|edit'] = 'Wikipedia fully-protected modules', ['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules', ['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules', ['all|all|all|sysop|move'] = 'Wikipedia move-protected pages', ['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages', ['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute', ['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism', ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', ['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages', ['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages', ['all|template|all|sysop|move'] = 'Wikipedia move-protected templates', ['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages', ['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages', ['all|all|all|reviewer|autoreview'] = 'Wikipedia pending changes protected pages (level 2)', ['all|file|all|all|upload'] = 'Wikipedia upload-protected files', },
-- Expiry category config
-- This table configures the expiry category behaviour for each protection -- action. -- * If set to true, setting that action will always categorise the page if -- an expiry parameter is not set. -- * If set to false, setting that action will never categorise the page. -- * If set to nil, the module will categorise the page if: -- 1) an expiry parameter is not set, and -- 2) a reason is provided, and -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck -- table.
expiryCheckActions = { edit = nil, move = false, autoreview = true, upload = false },
reasonsWithoutExpiryCheck = { blp = true, template = true, },
-- Pagetypes
-- This table produces the page types available with the ${PAGETYPE} parameter. -- Keys are namespace numbers, or the string "default" for the default value. pagetypes = { [0] = 'article', [6] = 'file', [10] = 'template', [14] = 'category', [828] = 'module', default = 'page' },
-- Strings marking indefinite protection
-- This table contains values passed to the expiry parameter that mean the page -- is protected indefinitely. indefStrings = { ['indef'] = true, ['indefinite'] = true, ['indefinitely'] = true, ['infinite'] = true, },
-- Group hierarchy
-- This table maps each group to all groups that have a superset of the original -- group's page editing permissions. hierarchy = { sysop = {}, reviewer = {'sysop'}, filemover = {'sysop'}, templateeditor = {'sysop'}, extendedconfirmed = {'sysop'}, autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'}, user
= {'autoconfirmed'},
['*'] = {'user'} },
-- Wrapper templates and their default arguments
-- This table contains wrapper templates used with the module, and their -- default arguments. Templates specified in this table should contain the -- following invocation, and no other template content: -- -- Script error: No such module "Protection banner". -- -- If other content is desired, it can be added between -- <noinclude>...</noinclude> tags. -- -- When a user calls one of these wrapper templates, they will use the -- default arguments automatically. However, users can override any of the -- arguments. wrappers = { ['Template:Pp'] = {}, ['Template:Pp-30-500'] = {'ecp'}, ['Template:Pp-blp'] = {'blp'}, -- we don't need Template:Pp-create ['Template:Pp-dispute'] = {'dispute'}, ['Template:Pp-main-page'] = {'mainpage'}, ['Template:Pp-move'] = {action = 'move'}, ['Template:Pp-move-dispute'] = {'dispute', action = 'move'}, -- we don't need Template:Pp-move-indef ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'}, ['Template:Pp-office'] = {'office'}, ['Template:Pp-office-dmca'] = {'dmca'}, ['Template:Pp-pc1'] = {action = 'autoreview', small = true}, ['Template:Pp-pc2'] = {action = 'autoreview', small = true}, ['Template:Pp-reset'] = {'reset'}, ['Template:Pp-semi-indef'] = {small = true}, ['Template:Pp-sock'] = {'sock'}, ['Template:Pp-template'] = {'template', small = true}, ['Template:Pp-upload'] = {action = 'upload'}, ['Template:Pp-usertalk'] = {'usertalk'}, ['Template:Pp-vandalism'] = {'vandalism'}, },
-- -- MESSAGES --
msg = {
-- Intro blurb and intro fragment
-- These messages specify what is produced by the ${INTROBLURB} and -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the -- intro-blurb-expiry or intro-fragment-expiry, and if not they use -- intro-blurb-noexpiry or intro-fragment-noexpiry. -- It is possible to use banner parameters in these messages. ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.', ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.', ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},', ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
-- Tooltip blurb
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter. -- If the protection is temporary the tooltip-blurb-expiry message is used, and -- if not the tooltip-blurb-noexpiry message is used. -- It is possible to use banner parameters in these messages. ['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.', ['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.', ['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},', ['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
-- Special explanation blurb
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages -- in the MediaWiki namespace. -- It is possible to use banner parameters in this message. ['explanation-blurb-nounprotect'] = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' 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:Redirect hatnote</title> <ns>828</ns> <id>42680232</id> <revision> <id>833409182</id> <parentid>726676462</parentid> <timestamp>2018-03-31T10:45:06Z</timestamp> <contributor> <username>Galobtter</username> <id>19502780</id> </contributor> <comment>text= option</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="3910">--[[
-- This module produces a "redirect" hatnote. It looks like this: -- '"X" redirects here. For other uses, see Y.' -- It implements the Template:Redirect template. --]]
local mHatnote = require('Module:Hatnote') local mHatList = require('Module:Hatnote list') local mArguments --lazily initialize local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local checkTypeMulti = libraryUtil.checkTypeMulti
local p = {}
local function getTitle(...) local success, titleObj = pcall(mw.title.new, ...) if success then return titleObj else return nil end end
function p.redirect(frame) mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {parentOnly=true}) --Get number of redirects local numRedirects = tonumber(frame.args[1]) or 1 -- Create the options table. local options = {} options.selfref = args.selfref return p._redirect(args, numRedirects, options) end
function p._redirect(args, numRedirects, options, currentTitle, redirectTitle, targetTitle) -- Validate the input. Don't bother checking currentTitle, redirectTitle or -- targetTitle, as they are only used in testing. checkType('_redirect', 1, args, 'table') checkType('_redirect', 2, numRedirects, 'number', true) numRedirects = numRedirects or 1 checkType('_redirect', 3, options, 'table', true) options = options or {} currentTitle = currentTitle
or mw.title.getCurrentTitle()
-- Get the table of redirects local redirect = {} for i = 1, numRedirects do -- Return an error if a redirect parameter is missing. if not args[i] then return mHatnote.makeWikitextError( 'missing redirect parameter', 'Template:Redirect#Errors', args.category ) end redirect[i] = args[i] end -- Generate the text. local formattedRedirect = {} for k,v in pairs(redirect) do formattedRedirect[k] = '"' .. v .. '"' end local text = { mHatList.andList(formattedRedirect) .. ' ' .. (#redirect == 1 and 'redirects' or 'redirect') .. ' here.', mHatList._forSee(args, #redirect + 1, {title = redirect[1], extratext = args.text}) } text = table.concat(text, ' ') -- Functionality for adding categories local categoryTable = {} function addCategory(cat) if cat and cat ~= then -- Add by index to avoid duplicates categoryTable[string.format(, cat)] = true end end --Generate tracking categories local mhOptions = {} for k,v in pairs(redirect) do -- We don't need a tracking category if the template invocation has been -- copied directly from the docs, or if we aren't in main- or category-space. if not v:find('^REDIRECT%d*$') and v ~= 'TERM' -- and currentTitle.namespace == 0 or currentTitle.namespace == 14 then redirectTitle = redirectTitle or getTitle(v) if not redirectTitle or not redirectTitle.exists then addCategory('Missing redirects') elseif not redirectTitle.isRedirect then addCategory('Articles with redirect hatnotes needing review') else local mRedirect = require('Module:Redirect') local target = mRedirect.getTarget(redirectTitle) targetTitle = targetTitle or target and getTitle(target) if targetTitle and targetTitle ~= currentTitle then addCategory('Articles with redirect hatnotes needing review') end end end
-- Generate the options to pass to Module:Hatnote. if currentTitle.namespace == 0 and not mhOptions.selfref and redirectTitle and redirectTitle.namespace ~= 0 then -- We are on a mainspace page, and the hatnote starts with something -- like "Wikipedia:Foo redirects here", so automatically label it as -- a self-reference. mhOptions.selfref = true else mhOptions.selfref = options.selfref end end --concatenate all the categories local category = for k,v in pairs(categoryTable) do category = category .. k end
return mHatnote._hatnote(text, mhOptions) .. category end
return p</text>
<sha1>shg1gl73yd4p5wk0fnxak9sr5559490</sha1> </revision> </page> <page> <title>Module:String</title> <ns>828</ns> <id>38569505</id> <revision> <id>552254999</id> <parentid>540627185</parentid> <timestamp>2013-04-26T10:52:01Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>Add "rep" function per request by User:×§×™×¤×•×“× ×—×© at Wikipedia:Lua requests#Template:Loop and Template:Loop15. Copied from sandbox.</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="15731">--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message. error_category: If an error occurs, specifies the name of a category to include with the error message. The default category is [Category:Errors reported by Module String]. no_category: If set to 'true' or 1, no category will be added if an error is generated.
Unit tests for this module are available at Module:String/tests. ]]
local str = {}
--[[ len
This function returns the length of the target string.
Usage: Script error: No such module "String". OR Script error: No such module "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: Script error: No such module "String". OR Script error: No such module "String".
Parameters
s: The string to return a subset of i: The fist index of the substring to return, defaults to 1. j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j is a negative value, it is interpreted the same as selecting a character by counting from the end of the string. Hence, a value of -1 is the same as selecting the last character of the string.
If the requested indices are out of range for the given string, an error is reported. ]] function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } ); local s = new_args['s'] or ; local i = tonumber( new_args['i'] ) or 1; local j = tonumber( new_args['j'] ) or -1; local len = mw.ustring.len( s );
-- Convert negatives for range checking if i < 0 then i = len + i + 1; end if j < 0 then j = len + j + 1; end if i > len or j > len or i < 1 or j < 1 then return str._error( 'String subset index out of range' ); end if j < i then return str._error( 'String subset indices out of order' ); end return mw.ustring.sub( s, i, j )
end
--[[ This function implements that features of Template: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: Script error: No such module "String". OR Script error: No such module "String".
Parameters
s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from each string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found. If one adds the parameter ignore_errors=true, then the error will be suppressed and an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
- http://www.lua.org/manual/5.1/manual.html#5.4.1
- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]] function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} ); local s = new_args['s'] or ; local start = tonumber( new_args['start'] ) or 1; local plain_flag = str._getBoolean( new_args['plain'] or false ); local pattern = new_args['pattern'] or ; local match_index = math.floor( tonumber(new_args['match']) or 1 ); local nomatch = new_args['nomatch']; if s == then return str._error( 'Target string is empty' ); end if pattern == then return str._error( 'Pattern string is empty' ); end if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then return str._error( 'Requested start is out of range' ); end if match_index == 0 then return str._error( 'Match index is out of range' ); end if plain_flag then pattern = str._escapePattern( pattern ); end local result if match_index == 1 then -- Find first match is simple case result = mw.ustring.match( s, pattern, start ) else if start > 1 then s = mw.ustring.sub( s, start ); end local iterator = mw.ustring.gmatch(s, pattern); if match_index > 0 then -- Forward search for w in iterator do match_index = match_index - 1; if match_index == 0 then result = w; break; end end else -- Reverse search local result_table = {}; local count = 1; for w in iterator do result_table[count] = w; count = count + 1; end result = result_table[ count + match_index ]; end end if result == nil then if nomatch == nil then return str._error( 'Match not found' ); else return nomatch; end else return result; end
end
--[[ pos
This function returns a single character from the target string at position pos.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
target: The string to search pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error. ]] function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} ); local target_str = new_args['target'] or ; local pos = tonumber( new_args['pos'] ) or 0;
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then return str._error( 'String index out of range' ); end return mw.ustring.sub( target_str, pos, pos );
end
--[[ str_find
This function duplicates the behavior of Template:Str find, including all of its quirks. This is provided in order to support existing templates, but is NOT RECOMMENDED for new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based, and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a value of "1", which is generally unexpected behavior, and must be accounted for separatetly. ]] function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} ); local source_str = new_args['source'] or ; local target_str = new_args['target'] or ;
if target_str == then return 1; end local start = mw.ustring.find( source_str, target_str, 1, true ) if start == nil then start = -1 end return start
end
--[[ find
This function allows one to search for a target string or pattern within another string.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
source: The string to search target: The string or pattern to find within source start: The index within the source string to start the search, defaults to 1 plain: Boolean flag indicating that target should be understood as plain text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found within "source". Indices are 1-based. If "target" is not found, then this function returns 0. If either "source" or "target" are missing / empty, this function also returns 0.
This function should be safe for UTF-8 strings. ]] function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ); local source_str = new_args['source'] or ; local pattern = new_args['target'] or ; local start_pos = tonumber(new_args['start']) or 1; local plain = new_args['plain'] or true; if source_str == or pattern == then return 0; end plain = str._getBoolean( plain );
local start = mw.ustring.find( source_str, pattern, start_pos, plain ) if start == nil then start = 0 end return start
end
--[[ replace
This function allows one to replace a target string or pattern within another string.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
source: The string to search pattern: The string or pattern to find within source replace: The replacement text count: The number of occurences to replace, defaults to all. plain: Boolean flag indicating that pattern should be understood as plain text and not as a Lua style regular expression, defaults to true
]] function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ); local source_str = new_args['source'] or ; local pattern = new_args['pattern'] or ; local replace = new_args['replace'] or ; local count = tonumber( new_args['count'] ); local plain = new_args['plain'] or true; if source_str == or pattern == then return source_str; end plain = str._getBoolean( plain );
if plain then pattern = str._escapePattern( pattern ); replace = mw.ustring.gsub( replace, "%%", "%%%%" ); --Only need to escape replacement sequences. end local result;
if count ~= nil then result = mw.ustring.gsub( source_str, pattern, replace, count ); else result = mw.ustring.gsub( source_str, pattern, replace ); end
return result;
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] ) if not repetitions then return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or ) .. '"' ) end return string.rep( frame.args[1] or , repetitions )
end
--[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function str._getParameters( frame_args, arg_list )
local new_args = {}; local index = 1; local value; for i,arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args;
end
--[[ Helper function to handle error messages. ]] function str._error( error_str )
local frame = mw.getCurrentFrame(); local error_category = frame.args.error_category or 'Errors reported by Module String'; local ignore_errors = frame.args.ignore_errors or false; local no_category = frame.args.no_category or false; if str._getBoolean(ignore_errors) then return ; end local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'; if error_category ~= and not str._getBoolean( no_category ) then error_str = .. error_str; end return error_str;
end
--[[ Helper Function to interpret boolean strings ]] function str._getBoolean( boolean_str )
local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == then boolean_value = false; else boolean_value = true; end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str; else error( 'No boolean value found' ); end return boolean_value
end
--[[ Helper function that escapes all pattern characters so that they will be treated as plain text. ]] function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
return str</text>
<sha1>l0shz7fzxb1bq626nihqwbptk7dfqd5</sha1> </revision> </page> <page> <title>Module:Yesno</title> <ns>828</ns> <id>38665046</id> <revision> <id>828075573</id> <parentid>659459801</parentid> <timestamp>2018-02-28T12:14:32Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>+support for on/off</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="745">-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template Template:Yesno.
return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end</text>
<sha1>swdskn7svew8i9wuydn9uj5l3r2ghcs</sha1> </revision> </page>
</mediawiki> </pre> Colors are automatically assigned based on the table below.
Template:Taxobox colour scheme
Quick start and examples[edit source]
Animals[edit source]
Animal species[edit source]
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<siteinfo> <sitename>Wikipedia</sitename> <dbname>enwiki</dbname> <base>https://en.wikipedia.org/wiki/Main_Page</base> <generator>MediaWiki 1.32.0-wmf.1</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:Taxobox</title> <ns>10</ns> <id>689990</id> <revision> <id>787846838</id> <parentid>778610702</parentid> <timestamp>2017-06-27T22:24:34Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>better fix than a div for parser bug T18700</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="18505"><includeonly><!--See parser bug T18700--><nowiki/>Template:Taxobox/core</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8vdb4rdhdcoxq15noycs0sy6sn12tj2</sha1> </revision> </page> <page> <title>Template:;</title> <ns>10</ns> <id>24389988</id> <revision> <id>579820375</id> <parentid>328698152</parentid> <timestamp>2013-11-02T02:29:16Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:;: Enable access by 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="138">;<noinclude>
Template:Documentation <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --> </noinclude></text>
<sha1>jv515gqjn3e60s98b0od6potfps8h7b</sha1> </revision> </page> <page> <title>Template:Anglicise rank</title> <ns>10</ns> <id>27662093</id> <revision> <id>794829931</id> <parentid>764335048</parentid> <timestamp>2017-08-10T08:30:50Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated to tested sandbox version; highlights incorrect rank names in display of taxonomy template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="3647"><noinclude><!--Note that #titleparts: is used to replace underscores by spaces before other processing.
--></noinclude><includeonly>{{{1}}}</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>r7k7bb1fc2jyqjtct62iyeo65tioxvc</sha1> </revision> </page> <page> <title>Template:COLON</title> <ns>10</ns> <id>37858377</id> <redirect title="Template:Colon" /> <revision> <id>526845228</id> <timestamp>2012-12-07T10:41:53Z</timestamp> <contributor> <username>Scott</username> <id>9867</id> </contributor> <comment>Hex moved page Template:COLON to Template:Colon: Consistency with similarly-named templates.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="29">#REDIRECT Template:Colon
</text>
<sha1>bkz2dmpnak2hukdsi456pihydbyeyv5</sha1> </revision> </page> <page> <title>Template:Category link with count</title> <ns>10</ns> <id>30847816</id> <revision> <id>827250605</id> <parentid>804533676</parentid> <timestamp>2018-02-23T17:02:11Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Category link with count": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="307">[[:Category:{{{1}}}]] (0)<noinclude>
Template:Documentation </noinclude></text>
<sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1> </revision> </page> <page> <title>Template:Clc</title> <ns>10</ns> <id>52342109</id> <redirect title="Template:Category link with count" /> <revision> <id>827250628</id> <parentid>804533685</parentid> <timestamp>2018-02-23T17:02:12Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Clc": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model>
<format>text/x-wiki</format> <text xml:space="preserve" bytes="94">#REDIRECT Template:Category link with count</text> <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1> </revision> </page> <page> <title>Template:Clear</title> <ns>10</ns> <id>1239772</id> <revision> <id>684162145</id> <parentid>683948339</parentid> <timestamp>2015-10-04T23:53:36Z</timestamp> <contributor> <username>Nyttend</username> <id>1960810</id> </contributor> <minor/> <comment>Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="81"><div style="clear:both;"></div><noinclude>
Template:Documentation </noinclude></text>
<sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1> </revision> </page> <page> <title>Template:Colon</title> <ns>10</ns> <id>9794950</id> <revision> <id>579833044</id> <parentid>526846189</parentid> <timestamp>2013-11-02T05:07:28Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:Colon: Enable access by 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="45">:<noinclude>Template:Documentation</noinclude></text> <sha1>cc3ofm0i104e4kws9eikeit1yry2hki</sha1> </revision> </page> <page> <title>Template:Column-count</title> <ns>10</ns> <id>29216387</id> <revision> <id>638540848</id> <parentid>579833002</parentid> <timestamp>2014-12-17T20:09:11Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="156"><includeonly>-moz-column-count: 2; -webkit-column-count: 2; column-count: 2;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ctnrlv6otxn502jcjxtlgfdg09bq651</sha1> </revision> </page> <page> <title>Template:Column-width</title> <ns>10</ns> <id>29216399</id> <revision> <id>638540885</id> <parentid>579832996</parentid> <timestamp>2014-12-17T20:09:33Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1> </revision> </page> <page> <title>Template:Columns-list</title> <ns>10</ns> <id>15350623</id> <revision> <id>820270206</id> <parentid>780371550</parentid> <timestamp>2018-01-14T00:10:55Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>Add check for deprecated parameter 1=</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="717"><includeonly>Template:Main other</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>s0dkzmbtykj36zkmh42ixv59msksyse</sha1> </revision> </page> <page> <title>Template:Delink</title> <ns>10</ns> <id>28069338</id> <revision> <id>696877808</id> <parentid>695173639</parentid> <timestamp>2015-12-26T16:26:10Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <comment>Template:Documentation does this</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="179">{{<includeonly>safesubst:</includeonly>#invoke:delink|delink}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nxxwkb2lon9wgne4irg9ctbsle6zwiy</sha1> </revision> </page> <page> <title>Template:Div col</title> <ns>10</ns> <id>12679552</id> <revision> <id>820620173</id> <parentid>820604224</parentid> <timestamp>2018-01-15T17:35:00Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>/* top */ rm tfm notice, no need to have it here</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1405"><includeonly><div class="div-col columns <!-- -->column-count column-count-2" style="<!-- -->Template:Column-count <!-- --><!-- --><!--empty--> <!-- --> <!-- -->"><!-- --><!-- Inventory how many pages use small=yes --></includeonly>Script error: No such module "Check for unknown parameters".<!--
-->Template:Main other<noinclude> Template:Documentation </noinclude></text>
<sha1>d2gbqb2ziz4u4p13e6fy9t4aegzt2hy</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 Rich Farmbrough (talk)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="182">Script error: No such module "documentation".<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1> </revision> </page> <page> <title>Template:Documentation subpage</title> <ns>10</ns> <id>7890381</id> <revision> <id>617432645</id> <parentid>608599904</parentid> <timestamp>2014-07-18T09:37:22Z</timestamp> <contributor> <username>Sardanaphalus</username> <id>427947</id> </contributor> <comment>Added 1.0em margin so template looks less a part of subsequent content and amended code layout -- hope neither of these too controversial</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1667"><includeonly><!-- --><!--(this template has not been transcluded on a /doc or /{{{override}}} page)--><!--
--></includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1> </revision> </page> <page> <title>Template:Em</title> <ns>10</ns> <id>28990025</id> <revision> <id>800858570</id> <parentid>716632165</parentid> <timestamp>2017-09-16T03:11:40Z</timestamp> <contributor> <username>Matt Fitzpatrick</username> <id>291848</id> </contributor> <comment>added role parameter and attribute</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="306"><em >{{{1}}}</em><noinclude>
Template:Documentation <!-- Add categories to the /doc subpage, not here! --> </noinclude></text>
<sha1>g9i6h00ap35wxdar0fg1tibei9ktn9g</sha1> </revision> </page> <page> <title>Template:Fossil range</title> <ns>10</ns> <id>27601310</id> <redirect title="Template:Geological range" /> <revision> <id>577860864</id> <parentid>366046795</parentid> <timestamp>2013-10-19T16:30:26Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <minor/> <comment>Changed protection level of Template:Fossil range: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="39">#REDIRECT Template:Geological range</text> <sha1>7v75vz714j9z1uuwsspa0q3pkbqe3ku</sha1> </revision> </page> <page> <title>Template:Fossil range/bar</title> <ns>10</ns> <id>18704774</id> <revision> <id>772347989</id> <parentid>772195239</parentid> <timestamp>2017-03-26T19:33:26Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="704"><includeonly><onlyinclude><div style="position:absolute; height:100%; text-align:center; background-color:Template:Period color; left:Expression error: Unrecognized punctuation character "[".px; width:Expression error: Unrecognized punctuation character "[".px;">[[{{{1}}}|{{{2}}}]]</div></onlyinclude></includeonly><noinclude>
Template:Pp-template <!-- interwiki below this point--> ar:قالب:Fossil range/bar [[bn:টেমপ�লেট:Fossil range/bar]] [[ko:틀:화� 시기/막대]] id:Templat:Rentang fosil/baris la:Formula:Fossil range/bar pl:Szablon:Okres istnienia grupy organizmów 2/wykres </noinclude></text>
<sha1>h33mdmfvx5to36xnli0bd12rgbx8evh</sha1> </revision> </page> <page> <title>Template:Fossil range/marker</title> <ns>10</ns> <id>18705421</id> <revision> <id>772347793</id> <parentid>772195280</parentid> <timestamp>2017-03-26T19:32:08Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1001"><includeonly><onlyinclude>Expression error: Unrecognized punctuation character "{".</onlyinclude></includeonly><noinclude>
Template:Pp-template ar:قالب:Fossil range/marker id:Templat:Rentang fosil/marka la:Formula:Fossil range/marker pl:Szablon:Okres istnienia grupy organizmów 2/znacznik </noinclude></text>
<sha1>oulrk3za491l8g55lbflhw0k4bfezim</sha1> </revision> </page> <page> <title>Template:Geological range</title> <ns>10</ns> <id>13050925</id> <revision> <id>691122112</id> <parentid>691101758</parentid> <timestamp>2015-11-17T20:15:16Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>Fixed for now...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1271"><includeonly><span style="display:inline-block;"></span><span style="display:inline-block;">{{{1}}}</span> <span style="display:inline-block;"></span>Template:Phanerozoic 220px<!--
Fossil range marker
--><div name=Range style="margin:0 auto; line-height:0; clear:both; width:220px; padding:0px; height:8px; overflow:visible; background-color:transparent; position:relative; top:-4px; z-index:100;">Template:Fossil range/marker Template:Fossil range/marker </div Range> </div Timeline-row></includeonly><noinclude>Template:Template doc</noinclude></text>
<sha1>qhx7sh2rpo6099mfnaw3jrqbbflxxyu</sha1> </revision> </page> <page> <title>Template:High-risk</title> <ns>10</ns> <id>11453893</id> <revision> <id>826619452</id> <parentid>819682280</parentid> <timestamp>2018-02-20T03:34:02Z</timestamp> <contributor> <username>Wbm1058</username> <id>14383484</id> </contributor> <comment>add optional parameter to show additional information. using it on Template:Infobox documentation page.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1603">Template:Ombox<noinclude>
Template:Documentation <!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --> </noinclude></text>
<sha1>ri2f5z0xlo9bloylz6zogx67uowijqs</sha1> </revision> </page> <page> <title>Template:If empty</title> <ns>10</ns> <id>16635679</id> <revision> <id>639393821</id> <parentid>639393034</parentid> <timestamp>2014-12-23T22:03:50Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>make this substable</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="102">{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>Template:Documentation</noinclude></text> <sha1>dl9p9t1ge8vz1f67zrvu4lp7md161es</sha1> </revision> </page> <page> <title>Template:Image frame</title> <ns>10</ns> <id>5710011</id> <revision> <id>832269062</id> <parentid>832268204</parentid> <timestamp>2018-03-24T22:23:07Z</timestamp> <contributor> <username>GKFX</username> <id>14918984</id> </contributor> <comment>Add {{{innerstyle}}} to other if function</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="861"><includeonly><div class="thumb tright"><div class="thumbinner noresize" style=""><div class="thumbimage" style="">{{{content}}}</div><div class="thumbcaption"></div></div></div></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>lr1p8z2yxh5z329ok1eu3qfwkae0mvm</sha1> </revision> </page> <page> <title>Template:Intricate template</title> <ns>10</ns> <id>3212382</id> <revision> <id>791343927</id> <parentid>599780700</parentid> <timestamp>2017-07-19T16:54:52Z</timestamp> <contributor> <username>Train2104</username> <id>10341578</id> </contributor> <comment>reword</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1235">Template:Ombox<includeonly></includeonly><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>dh79njli0rchozlv8gxvabsm0gkseh1</sha1> </revision> </page> <page> <title>Template:Linear-gradient</title> <ns>10</ns> <id>34343126</id> <revision> <id>679780267</id> <parentid>679774821</parentid> <timestamp>2015-09-06T19:08:51Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>move code</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="579"><includeonly>background-image: -moz-linear-gradient(, ); background-image: -o-linear-gradient(, ); background-image: -webkit-linear-gradient(, ); background-image: linear-gradient({{{1}}}, );</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>d9q5b9t0m89azbiekg3lqbh549l2re0</sha1>
</revision>
</page>
<page>
<title>Template:Main</title>
<ns>10</ns>
<id>1208356</id>
<revision>
<id>827529543</id>
<parentid>826282491</parentid>
<timestamp>2018-02-25T07:02:12Z</timestamp>
<contributor>
<username>RMCD bot</username>
<id>17216044</id>
</contributor>
<comment>Removing notice of move discussion</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="138">Script error: No such module "main".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>jkpvpyms818jhpg2lkzsq5qur195qbr</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 Template:Pp-template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="409"><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1> </revision> </page> <page> <title>Template:MultiReplace</title> <ns>10</ns> <id>51070198</id> <revision> <id>836129739</id> <parentid>836116264</parentid> <timestamp>2018-04-12T20:54:48Z</timestamp> <contributor> <username>Ahecht</username> <id>2016996</id> </contributor> <comment>safesubst:<noinclude/></comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="70">{{safesubst:<noinclude/>#invoke:MultiReplace|main}}<noinclude>
Template:Doc</text>
<sha1>hpfo8bppd4vwcb5x8spcqhtcernv2lv</sha1> </revision> </page> <page> <title>Template:Next period</title> <ns>10</ns> <id>17129593</id> <revision> <id>784255100</id> <parentid>577842274</parentid> <timestamp>2017-06-07T09:03:07Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <comment>Add informal Ediacaran subdivisions</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="8491">Taxobox<noinclude>Template:Template doc</noinclude></text> <sha1>hf6999fb24tg7m8c7odtb26w166mq1u</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">Script error: No such module "Message box".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1> </revision> </page> <page> <title>Template:Para</title> <ns>10</ns> <id>16639086</id> <revision> <id>679823176</id> <parentid>660922353</parentid> <timestamp>2015-09-07T00:44:14Z</timestamp> <contributor> <username>HJ Mitchell</username> <id>9336033</id> </contributor> <minor/> <comment>Changed protection level of Template:Para: lower to TE per request; also removed from WP:CASC ([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="267"><code class="nowrap" >|</code><noinclude>
Template:Documentation <!--Categories and interwikis go near the bottom of the /doc subpage.--> </noinclude></text>
<sha1>byvvhmp41qjgp4713oxicsdwzjqb1b0</sha1> </revision> </page> <page> <title>Template:Period color</title> <ns>10</ns> <id>15654337</id> <revision> <id>830378120</id> <parentid>830359768</parentid> <timestamp>2018-03-14T13:20:10Z</timestamp> <contributor> <username>Hike395</username> <id>11639</id> </contributor> <comment>I had already swapped the colors in the previous edit</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="6714"><noinclude>
Template:Documentation </noinclude></text>
<sha1>k8780yise3btiho0veen3y26flpqdhx</sha1> </revision> </page> <page> <title>Template:Period end</title> <ns>10</ns> <id>17126181</id> <revision> <id>772147419</id> <parentid>433647208</parentid> <timestamp>2017-03-25T16:04:18Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Period end": 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] (indef...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="122"><includeonly>Template:Period start</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ggu56mt27u35n5ddg6fdrq8zc6iav8e</sha1> </revision> </page> <page> <title>Template:Period id</title> <ns>10</ns> <id>50980396</id> <revision> <id>825510865</id> <parentid>734737683</parentid> <timestamp>2018-02-13T20:32:22Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="460">Template:MultiReplace<noinclude>
Template:Documentation </noinclude></text>
<sha1>4lp28tuzowrcpwyb7wvkyue55cbj2di</sha1> </revision> </page> <page> <title>Template:Period start</title> <ns>10</ns> <id>17126152</id> <revision> <id>833980327</id> <parentid>802883274</parentid> <timestamp>2018-04-03T09:11:08Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <minor/> <comment>Update Chengjiang, per doi:10.1144/jgs2017-103</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="9422"><includeonly>Expression error: Unexpected round operator.</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>jcm6yf39q49llph8eh51qy8nod20p8h</sha1> </revision> </page> <page> <title>Template:Phanerozoic 220px</title> <ns>10</ns> <id>26179752</id> <revision> <id>694836256</id> <parentid>694836085</parentid> <timestamp>2015-12-11T22:20:22Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>linebreak</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1114"><div id="Timeline-row" style="margin: 4px auto 0; clear:both; width:220px; padding:0px; height:18px; overflow:visible; border:1px #666; border-style:solid none; position:relative; z-index:0; font-size:13px;">
<div style="position:absolute; height:100%; left:0px; width:Expression error: Unrecognized punctuation character "[".px; padding-left:5px; text-align:left; background-color:Template:Period color; Template:Linear-gradient">PreЄ</div> {{fossil
range/bar|Cambrian|Є}}
Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar <div id="end-border" style="position:absolute; height:100%; background-color:#666; width:1px; left:219px"></div><noinclude> </div> Template:Documentation </noinclude></text>
<sha1>ky1n0eet81iquci3yghyfw95ugey3d1</sha1> </revision> </page> <page> <title>Template:Redirect</title> <ns>10</ns> <id>1649987</id> <revision> <id>827943535</id> <parentid>826439889</parentid> <timestamp>2018-02-27T17:34:09Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <comment>Wikipedia:Templates for discussion/Log/2018 February 18#Template:Redirect3_and_Template:About2 closed as merge (XFDcloser)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="183"><includeonly>Script error: No such module "redirect hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nahryqse47xqenividwc88opp02rhjv</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"><div class="reflist <!-- -->" style="<!-- --> list-style-type: <!-- -->decimal;">
</div>Script error: No such module "Check for unknown parameters".<noinclude> Template:Documentation </noinclude></text>
<sha1>2k096ppl7lxbcjqmfluu9x2sc91rmzl</sha1> </revision> </page> <page> <title>Template:See also</title> <ns>10</ns> <id>1721254</id> <revision> <id>763260609</id> <parentid>725632232</parentid> <timestamp>2017-02-02T05:40:25Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Updated from sandbox to use Module:Labelled list hatnote</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="199"><includeonly>Script error: No such module "Labelled list hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>dn9i3dv2bt8lqifr6vkbycoya78rnav</sha1> </revision> </page> <page> <title>Template:Sets taxobox colour</title> <ns>10</ns> <id>52159696</id> <revision> <id>792252309</id> <parentid>751937313</parentid> <timestamp>2017-07-25T12:33:29Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="192"><includeonly></includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>17ktt6fduayqzzpcwd3sq3h059430w8</sha1> </revision> </page> <page> <title>Template:Str find</title> <ns>10</ns> <id>21725841</id> <revision> <id>772120912</id> <parentid>539724237</parentid> <timestamp>2017-03-25T12:38:47Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find": Allowing template editors on some templates with full protection dating back to pre-TPROT times which aren't too often or too sensitively used. ([Edit=Require template editor access] (i...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="93">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>3zfmbl429kcazgnewbtwkdoycus3e1m</sha1> </revision> </page> <page> <title>Template:Str find0</title> <ns>10</ns> <id>31624801</id> <revision> <id>754106575</id> <parentid>565160579</parentid> <timestamp>2016-12-10T22:12:30Z</timestamp> <contributor> <username>BU Rob13</username> <id>25420061</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find0": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="108">Expression error: Unexpected < operator.<noinclude>
Template:Documentation</noinclude></text>
<sha1>sert5g7f8gacqtv1cs6edj7iu0d5b97</sha1> </revision> </page> <page> <title>Template:Str left</title> <ns>10</ns> <id>21696393</id> <revision> <id>741880261</id> <parentid>605122708</parentid> <timestamp>2016-09-30T07:01:19Z</timestamp> <contributor> <username>Ymblanter</username> <id>14596827</id> </contributor> <minor/> <comment>Changed protection level of Template:Str left: Highly visible template: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="184"><includeonly></includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1> </revision> </page> <page> <title>Template:Str rep</title> <ns>10</ns> <id>24238435</id> <revision> <id>656461393</id> <parentid>656457182</parentid> <timestamp>2015-04-14T16:35:55Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <minor/> <comment>Protected Template:Str rep: Highly visible template: 167176 transclusions ([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="100">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>8aojqr2n3b0gv6drwu3safb8kuckf72</sha1> </revision> </page> <page> <title>Template:Taxobox/Error colour</title> <ns>10</ns> <id>29546546</id> <revision> <id>758431105</id> <parentid>740191216</parentid> <timestamp>2017-01-05T11:32:08Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated HTML comment</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="462"><includeonly>transparent; text-align:center; border: 2px solid red; error:colour</includeonly><noinclude><!--
-- The caller template must check invalid -- {{{colour}}} value to link because -- a wp:wikitable column format cannot contain a wikilinked page or category, -- as of September 2016. -- -- See check of {{{colour}}} in template {Taxobox/core}. -->Template:Documentation</noinclude></text>
<sha1>n8owfylnwasbq6p09fhl83wjdp5npqe</sha1> </revision> </page> <page> <title>Template:Taxobox/core</title> <ns>10</ns> <id>29471370</id> <revision> <id>809123045</id> <parentid>809122889</parentid>
<timestamp>2017-11-07T07:14:13Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>try again</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="21914">{| class="infobox biota" style="text-align: left; width: 200px; font-size: 100%"
|- ! colspan=2 style="text-align: center" | Asian golden cat |- | colspan=2 style="text-align: center" | Script error: No such module "InfoboxImage". |-
|- colspan=2 style="text-align: center"
|- |- ! colspan=2 style="min-width:15em; text-align: center" | Scientific classification |-
|-
|- ! colspan=2 style="text-align: center" | Binomial name |- | colspan=2 style="text-align: center" | <b><span class="binomial">Catopuma temminckii</span></b><br /><small>(Vigors & Horsfield, 1827)</small> |- style="text-align: center"
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|}<!--
Define any categories to be displayed on the page here:
--><noinclude>Template:Documentation</noinclude></text>
<sha1>a2rm1euf6a6qovdh8d23gr3qknia9s4</sha1> </revision> </page> <page> <title>Template:Taxobox/doc</title> <ns>10</ns> <id>7342865</id> <revision> <id>839167972</id> <parentid>837111256</parentid> <timestamp>2018-05-01T18:24:33Z</timestamp> <contributor> <username>Plantdrew</username> <id>14423536</id> </contributor> <comment>update transclusion count</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="85800">Template:Redirect
Template:Documentation subpage <includeonly>Template:High-risk</includeonly> <noinclude>Template:MoS guideline</noinclude> Template:Intricate template
This template sets up a manual taxobox, as a right-side infobox table setting out the biological classification (taxonomy) for a group of living things. For guide to automated taxoboxes, see WP:Automated taxobox system/intro.
Although with a choice of over 160 parameters, the implementation is complicated, it is relatively simple to use. <!--For an example in practice, look at the edit page of "Killer whale" – [3].--> Most parameters are optional, so if a particular entry is not relevant for your case, just leave it out. See below section "All parameters" for a complete list.
This guide has come out of WikiProject Tree of life.
Usage[edit source]
Note that parameters in this template are case-sensitive. <pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Colors are automatically assigned based on the table below.
Template:Taxobox colour scheme
Quick start and examples[edit source]
Animals[edit source]
Animal species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Animal higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Plants[edit source]
The majority of plants are angiosperms ("flowering plants"). Wikipedia:WikiProject Plants consensus is to use the Angiosperm Phylogeny Group's APG III classification system for angiosperms. The APG III system does not have formally named divisions or classes, but includes several hierarchically nested, informally named clades. The hierarchy of informally named clades is presented by using parameters such as Template:Para in place of formal rank parameters. Articles on non-flowering plants (e.g. conifers, ferns) should continue to use formal divisions and classes in the Taxobox.
Flowering plant species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Flowering plant higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Parameters[edit source]
Name[edit source]
Provided under this parameter should be the single most common vernacular name when one is in widespread use, or a single current scientific name otherwise.
- Common names of higher taxa are always given in sentence case (rather than title case) and in the plural (e.g. marine hatchetfishes).
- Common names of species and subspecies are also to be given in sentence case but in the singular (e.g. black crowned crane, Colorado potato beetle).
The name parameter should not be used to incorporate more than one name. It is only a header and not meant to be an inclusive "names" field. One will suffice. Please assess the relevant literature in deciding which.
Color[edit source]
The color is automatically assigned based on the entry for a number of ranks from Template:Para upwards (see Template:Taxobox); there is normally no need to specify it manually, although Template:Para can be used.
Template:Taxobox colour scheme
Classification[edit source]
As noted above, the classification section includes some or all of the following:
<pre style="overflow:auto"> | regnum = | phylum = | classis = | ordo = | familia = | genus = | species = </pre>
Each entry corresponds to a containing group, except for the last, which should be the group under consideration. Note the entries use the Latin names for the ranks, to make porting between Wikipedias easier. Thus the above correspond to the kingdom, phylum, class, order, family, genus, and species.
Template loop detected: Template:Taxobox
Taxoboxes should include all major ranks above the taxon described in the article, plus minor ranks that are important to understanding the classification of the taxon described in the article, or which are discussed in the article. Other minor ranks should be omitted.
For example, in the taxobox for the genus Formica, it's appropriate to include entries for tribe and subfamily, since those are an aid to understanding how Formica relates to other genera in the family Formicidae. But it wouldn't be appropriate to include the superorder Endopterygota, since all genera of ants are in that superorder; it isn't particularly interesting at this level.
Another example is the subfamily Bambusoideae, the bamboos. This subfamily probably should be mentioned in the taxobox of every bamboo species, since it is a major grouping in this context, despite its minor rank.
Minor ranks are included in the same way as major ranks, for example:
<pre style="overflow:auto"> | classis = ... | subclassis = ... | superordo = ... | ordo = ... </pre>
Note that species and subspecies should be given using the abbreviated forms of their name — e.g. H. sapiens, H. s. sapiens. The epithets should not be given by themselves. The full form of the species or subspecies name is given in the binomial or trinomial section.
See #All parameters for a complete list.
Classification status[edit source]
With the Template:Para parameter, it is possible to introduce extra text within parentheses after "Scientific classification". For example, Template:Para will produce "Scientific classification (disputed)". See Veratalpa for a current example where this parameter is used. This parameter should only be used when the "Scientific classification" text would be misleading without it.
Divisions and sections[edit source]
These ranks have different meanings in zoology and botany.
In botany:
- Use divisio for division (a rank above class and below kingdom)
- Use sectio for section (a rank above species and below genus)
Note: Certain very large genera, e.g. Rhododendron include subsections
In zoology:
- Use zoodivisio for division (a rank above family and below order)
- Use zoosectio for section (a rank above family and below order)
Unranked taxa[edit source]
For each major taxon from family to phylum, you can add an unranked entry to the taxobox. The entry <tt>unranked_X</tt> appears above rank X, for example <tt>unranked_superfamilia</tt> appears above family and superfamily and below order, suborder, infraorder, etc.:
<pre style="overflow:auto"> | ordo = | unranked_superfamilia = | familia = </pre>
For animals and non-flowering plants, use unranked taxa sparingly. The need to include unranked taxa generally indicates that you are following phylogenetic nomenclature. It is usually better to abbreviate the classification to the major ranks and then discuss the classification in more detail in the article.
Unranked taxa of flowering plants[edit source]
Flowering plants (angiosperms) make frequent use of unranked taxa. The APG III system of classification used for flowering plants on Wikipedia does not have formally named ranks above order - e.g. divisions, classes, subclasses - but includes several hierarchically nested, informally named and unranked clades. For flowering plants the taxobox should include Template:Para in place of Template:Para, Template:Para in place of Template:Para, and possibly also Template:Para in place of Template:Para. Flowering plant taxoboxes may often include three to four informal hierarchical groups above the rank of order, making the use of Template:Para necessary, which sorts itself just above Template:Para where a formally named order is displayed. The unranked parameters only include ranks in their parameter names, such as "unranked divisio" to allow the editor to place content hierarchically; no approximation of rank is intended by the use of these parameter names. For flowering plant articles using the APG III system of classification, the regular parameters including Template:Para, Template:Para, and Template:Para should not be used or it will display between these unranked APG III clades.
To comply with #Classification above and its advice on the inclusion of major ranks, the following are considered major ranks in APG III and currently included in the appropriate flowering plant taxoboxes:
- Angiosperms
- Magnoliids
- Monocots
- Eudicots
- Core eudicots (displayed as a major rank when the plant is not included further nested in rosids or asterids)
Note: The rosids contain two clades, the fabids (also known as eurosids I) and malvids (also known as eurosids II), and the asterids contain two further clades, the lamiids (euasterids I) and campanulids (euasterids II). These are considered to be minor ranks and are only to be displayed on the articles on orders or families they immediately contain.
A taxobox for a flowering plant will thus generally include the following parameters: <pre style="overflow:auto"> | regnum = Plantae | unranked_divisio = Angiosperms | unranked_classis = | unranked_ordo = | ordo = </pre>
Viruses[edit source]
Viruses follow a slightly different system. They are not placed in taxa above the rank of order, and instead are treated in seven groups based on the type of nucleic acid they contain, referred to by the Roman numerals i to vii. These can be included in the taxobox using the Template:Para parameter. This also changes the link from scientific to virus classification, so it should not appear on boxes for non-viruses, even if it is left blank.
<pre style="overflow:auto"> | virus_group = iv </pre>
Bold/italic markup[edit source]
Italicization must be done manually in all parameters. If the entry for genus or species (with manually added italics) matches the page title,<ref group=note>If the page is called, for example, "Homo (genus)", then the taxobox will display "Homo" and the page title "Homo (genus)".</ref> then the name of the taxobox and the title of the page will be italicized. Note that if the Template:Para parameter is used the page title will not be automatically
italicized. The taxobox's name will be set to exactly what is specified in Template:Para – italics must be specified manually in this case.
Genus, species, and subspecies should be italicized whenever used, as is the biological standard. For instance, we talk about the genus Homo, the species Homo sapiens, and the subspecies Homo sapiens sapiens.
- In botany, it is important to include the rank for taxa below species. The rank is not italicized, e.g. Genus species subsp. subspecies var. variety.
- Some bacteria that have been characterized but not formally named are given Candidatus names. These should be written in the form Candidatus Genus species, rather than italicized normally.
Higher taxa like families may or may not be italicized in different publications. The prevalent standard for Wikipedia is not to italicize them, except in the case of viruses and other infectious particles.
Bolding is used to indicate the subject of the article. The Template:Para, Template:Para, and Template:Para parameters bold automatically. In the placement section – Template:Para through Template:Para – the final taxon should be bolded, as well as any higher groups that only include the final taxon. See green sulfur bacteria for an example.
Subdivisions[edit source]
Template loop detected: Template:Taxobox Groups above the rank of species (and even species if there are several notable subspecies) should usually include a list of subgroups. Use the Template:Para parameter for the list. The list can be formatted using a number of templates, such as the specialized Template:Tl and Template:Tl, which deal with authorities as well (see the documentation at Template:Taxon list for variant templates), or using a general list template such as Template:Tl. Use the Template:Para parameter to say what rank the subgroups have. For instance, for families in an order:
<pre style="overflow:auto"> | subdivision_ranks = Families | subdivision =
Template:Linked taxon list
</pre>
For lists with more than a few subgroups, the list can be bracketed with Template:Tl and Template:Tl, which will split the list into two columns (see Nettle example at right). In cases where a list would make the taxobox too long, or where the classification is too variable to allow a brief summary, the list should be replaced with a comment like "See text" or the subdivision section should be omitted. As a rule of thumb, when there are more than 100 subgroups the list should be in a separate article.
In cases where the classification is variable, a description like "Typical orders" or "Notable orders" may be used.
In cases where the ranks are uncertain, a description like "Subgroups" or "Taxa" may be preferable. Sometimes it is convenient to represent more than one level of classification in the list. In that case the lower level groups are moved over to the right by prefixing them with &nbsp; characters – usually three for the first level of indentation, and then one to three more for each subsequent level. Major grades may also be represented by bolded headers, as on plant and heterokont. Remember, though, these should mainly be done when the intermediate rank subgroups are not worthy of separate articles; taxoboxes are too small to include too much duplicate information.
Conservation status[edit source]
Conservation status may optionally be included; you can search the IUCN's database of threatened species to find the conservation status of many organisms. It is included via the Template:Para parameter, which takes a code or template. It is not appropriate for prehistoric organisms – the Template:Para parameter may be a more sensible option.
<pre style="overflow:auto;"> |status = code |status_system = classification system (see below)) – required |status_ref = <ref>...</ref> – optional |extinct = year of extinction – optional (only use if |status=EX and year of extinction is known) </pre>
Use the above syntax, choosing one of the status codes from the code list below. The code may be all upper or lower case, but the cases used in the table are preferred.
The following status codes are available (the third column shows the category that is automatically added to the article):
Status (as shown in taxobox) Code Category assigned Secure secure<ref name="invalid" group="IUCN" /> Domesticated DOM<ref name="invalid" group="IUCN" /> Category:Domesticated animals Least Concern (LC) LC Least Concern (LR/lc) LR/lc Near Threatened (NT) NT Near Threatened (LC/nt) LR/nt Conservation Dependent (LR/cd) LR/cd Vulnerable (VU) VU Endangered (EN) EN Category:Endangered species Critically Endangered CR Category:Critically endangered species Critically Endangered (CR), possibly extinct PE Category:Critically endangered species Extinct in the wild (EW) EW Category:Species extinct in the wild Extinct EX Data deficient (DD) DD Not evaluated (NE) NE Fossil fossil<ref name="invalid" group="IUCN">This is not a valid IUCN Red List category</ref><ref name="fossil" group="IUCN">Template:Para is deprecated in favour of Template:Para Template:Tlx (see the #Fossil range section below).</ref> Prehistoric pre<ref name="invalid" group="IUCN" /> See text See text<ref name="invalid" group="IUCN" /> Lower Risk <s>LR</s><ref name="invalid" group="IUCN" /><ref name="LR" group="IUCN">Template:Var is deprecated; use Template:Var or Template:Var or Template:Var instead.</ref>
- Notes
System[edit source]
Template:Main The criteria used by the IUCN should also be specified:
<pre style="overflow:auto">
| status_system = IUCN3.1 or | status_system = IUCN2.3 <!-- deprecated for new boxes, although some taxoboxes still exist and are supported for this version -->
</pre>
This parameter is required in order to display the proper conservation status graphic. Failure to use this parameter will result in no graphic appearing.
Other systems are listed at Wikipedia:Conservation status.
Referencing conservation status[edit source]
To add a reference for the status, use:
<nowiki> | status_ref = <</nowiki>ref<nowiki>>{{</nowiki>Cite journal<nowiki> | author = |title = | journal = The IUCN Red List of Threatened Species | volume = | page = | publisher = International Union for Conservation of Nature | date = | url = | doi = | access-date = }}</ref></nowiki>
See Template:Tlx or Template:Tlx for the parameters you need to supply to that template. And don't forget that Template:Xtag requires a corresponding Template:Tlx or Template:Xtag in the References section.
Fossil range[edit source]
The stratigraphic range for groups known as fossils may also be included, using the Template:Para parameter. For instance, for a group known from the Cambrian to the Permian:
<pre style="overflow:auto">
|fossil_range = Cambrian–Permian
</pre>
You may wish to add a
diagrammatic representation of the fossil range (as shown below), which can be created using the Template:Tl template, for example:
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
or
<pre style="overflow:auto">
| fossil_range = Template:Fossil range Cambrian–Permian
</pre>
For extant taxa that continue into the present day, the ending period should be set to "Recent" or as "Holocene" for Late Quaternary extinctions such as the moa, and the current status should be indicated using the Template:Para parameter.
For groups that only existed during a single period, simply list it without giving a range: e.g.: Template:Image frame
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
Images[edit source]
An image can be included using the parameter Template:Para. It is highly recommended that an image be provided if one is available. Do not include the "File:" part of the image file name!
If an image is included, alt text should be provided using parameter "Template:Para". Alt text should not repeat the caption; instead, it should describe the image contents to someone who can't see it (see WP:ALT).
A caption can be provided using parameter "Template:Para". A caption need not be provided if it would just repeat the title of the article. It should be provided if it can convey any additional information about the image, such as the sex or life stage of the individual, the location where the picture was taken, the artist (if an engraving or other illustration), or (for higher taxa) the particular species depicted. <pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana </pre>
By default, the image width is determined by each user's default thumbnail size preference. In general, it is recommended that these preferences be honoured. In some cases, however, it may be desirable to overrule the default size; this can be achieved by use of the Template:Para parameter, which scales the image. Thus Template:Para makes the image 10% larger than the user's default thumbnail size; Template:Para makes it 25% smaller. See MOS:IMGSIZE for more information.
<pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana | image_upright = 1.45 </pre>
Long or complex image captions, which should rarely be necessary, look better when left-aligned. This can be achieved using "Template:Para".
A second image may be added by use of the Template:Para, Template:Para, Template:Para and Template:Para parameters. Use this sparingly, and only when the article is long enough, and when it makes sense to include the second image inside the taxobox and not later in the article. Camel is a good example (a genus with two well-known representatives). A second image may also be useful for species that display sexual dimorphism so that both a male and female representative could be shown, e.g. Northern cardinal.
Authorities[edit source]
Generally, an authority should be given only for the taxa covered by the article. Higher groups which only include the article subject should also list authorities unless those are the same as for the taxa in question. In the case of species (or subspecies) the authority may be given in the binomial (or trinomial) section. Otherwise authorities may be listed in the placement section. For instance, for an order:
<pre style="overflow:auto"> | ordo = | ordo_authority = </pre>
The following examples illustrate the different conventions for names, dates, and punctuations in the different kingdoms.
- Animalia
- Plantae
- Bacteria
- Original name valid: Vibrio cholerae <small>R. Koch 1883</small>
- Organism reclassified: Streptococcus pneumoniae <small>(Klein 1884) Chester 1901</small> (originally Micrococcus pneumoniae)
- Old name revived: Salmonella enterica <small>(ex Kauffmann & Edwards 1952) Le Minor & Popoff 1987</small>
Authorities in scientific names are also abbreviated according to different standards for plants and animals. To decipher standard abbreviations, see
- List of botanists by author abbreviation or consult the International Plant Names Index.
- List of zoologists by author abbreviation
For more information refer to the article on binomial nomenclature.
Diversity[edit source]
In higher taxa, and taxa where the subdivision option does not indicate number of species, the Template:Para parameter may be used. This needs to be accompanied by Template:Para which links to an appropriate page, usually a List of ... species page. See, for example, Banksia: the subdivision lists only two subgenera, so the Template:Para option is used to specify the number of species.
<pre style="overflow:auto; font-size:80%"> | diversity_link = List of Quercus species | diversity = c. 120 species </pre>
It is not a good idea to be too precise about the number of species. New species are still being regularly described in many groups. Moreover, changing systematic treatment is liable to alter the species number even in well-known genera. Rounding off the species number and denoting this as approximate value will help decreasing maintenance.
Use the Template:Para parameter to give references for the number of species, for example: <pre style="overflow:auto; font-size:80%"> | diversity_ref = <nowiki><ref></nowiki>Hershler and Longley, 1986, p. 127<nowiki></ref></nowiki> </pre>
Range maps[edit source]
A range map may be included at the end of the taxobox. This uses the Template:Para, Template:Para, Template:Para, and Template:Para parameters, in the same manner as an image. Specifying range map width is unnecessary in most cases. See Leopard (land animal), Northern flicker (non-migratory bird), Lesser spotted eagle (migratory bird) and Killer whale (water animal) for examples.
<pre style="overflow:auto"> | range_map = Map.jpg | range_map_upright = 1.1 | range_map_alt = Map showing ... | range_map_caption = Range of ... </pre>
Up to four range maps can be included, via additional parameters such as Template:Para, Template:Para, etc.
You can generate maps using an appropriate blank map such as Image:BlankMap-World-noborders.png. Do not make the distribution map too large (a width of 300 to 400 should be sufficient, the purpose of the map being a rough global overview; more detailed maps can always go to the article body) and add the map to Category:Habitat maps, or, preferably, if you upload the map to Commons, to commons:Category:Animal distribution maps.
Synonyms[edit source]
Where a species has synonyms, the Template:Para parameter may be used. The list of synonyms can be formatted using the same approach as for Subdivisions, but synonyms should not normally be linked, so e.g. Template:Tl should be used for taxa whose names aren't italicized and Template:Tl for those whose names are.
<source lang="html" style="overflow:auto"> | synonyms =
Template:Species list
</source>
Nomenclator Zoologicus has data for all but the most recently established animal genera. This may be hard to understand for non-specialists, but it is a comprehensive source for the authorship of genus names, both valid ones and junior synonyms. Sometimes one will note that a new name has been established because the older, original name was "preoccupied". This means it has already been established for another taxon of the same rank in the same kingdom before – even if that name is now a synonym too. Taxa that preoccupy a name can be linked in the Synonyms section, such as Stenorhynchus here.
Use Template:Para to give references for the synonym list, for example: <pre style="overflow:auto; font-size:80%"> | synonyms_ref = <nowiki><ref></nowiki>Smith and Jones, 2009, p. 5 <nowiki></ref></nowiki> </pre>
Type species[edit source]
When the type species of a genus (or larger grouping) is known, the Template:Para and Template:Para can be used.
For botanical entries, i.e. names under the International Code of Nomenclature for algae, fungi, and plants
(ICN), the currently accepted name in the genus should be used. The term "type species" does not occur in the ICN, but is used here for convenience. The Index Nominum Genericorum is a useful source of information and can be used as a reference.
For animal entries, i.e. names under the International Code of Zoological Nomenclature (ICZN), the type species should be the Template:Em binomial name of the type species, but linked to its current article, and the authority should be plain (no parentheses). See Mirza for a type species example.
<pre style="overflow:auto"> | type_species = the original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature | type_species_authority = </pre>
This follows ICZN Recommendation 67B; be aware that this means the taxon used by the genus' original author – even if it is now invalid, e.g. a junior synonym. Ideally, it should only be used if the genus' original description can be verified first-hand. As per the following example given by the ICZN:
<blockquote>Astacus marinus Fabricius, 1775, one of the nominal species originally included in the decapod crustacean genus Homarus Weber, 1795, was subsequently designated by Fowler (1912) as the type species of Homarus. The type species is, and should be cited as, Astacus marinus Fabricius, 1775. Astacus marinus Fabricius is currently synonymized with Cancer gammarus Linnaeus, 1758, but the latter is not the type species of Homarus and should not be cited as such. If mention of the type species is required it should be made in some such manner as "Type species Astacus marinus Fabricius, 1775, a junior synonym of Cancer gammarus Linnaeus, 1758"; or "Type species Astacus marinus Fabricius, 1775, now regarded as a synonym of Homarus gammarus (Linnaeus, 1758)".</blockquote>
If you do not completely understand what this all means, please do not use this parameter. Instead, if possible denote the type species in the species listing, for example with a
<pre><small>(type species)</small></pre>
after the species' (currently valid) name.
Italic page titles[edit source]
If the value of Template:Para, Template:Para, or Template:Para exactly matches the title of the page, and Template:Para is unspecified, the taxobox and page title will be italicized automatically.<ref group=note>See note 1; the title of the page will be italicized using the <nowiki>Template:DISPLAYTITLE</nowiki> magic word. When the page name contains the disambiguator "(alga)" or "(genus)", this disambiguator will not be italicized (e.g., Ia (genus)).</ref> If necessary, it is also possible to force the page title to display in italics using the Template:Tl template.
If the Template:Para parameter is present, then the taxobox will display whatever is in Template:Para; the page title will NOT be italicized unless Template:Tl is used.
Complete blank template[edit source]
This section gives all parameters in the order that they will appear in the taxobox. No taxobox should use all of these. Keep it short! Note that parameters in this template are case-sensitive.
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre>
All parameters[edit source]
The full list of parameters is illustrated inside the infobox above, in the "Complete blank template".
color - typical color code <tr> name - name defaults to <nowiki>Taxobox</nowiki><tr> status - conservation status code <tr> status_system - status-system type <tr> status_ref - status reference <tr> regnum - (standard) kingdom name <tr> phylum - (standard) phylum name <tr> classis - (standard) class name <tr> ordo - (standard) order name <tr> familia - (standard) family name <tr> genus - (standard) genus name <tr> species - (standard) species name <tr> fossil_range - (as shown at top of box) <tr> image - (as shown in box) <tr> image_upright - (as shown in box) <tr> image_alt - (as shown in box) <tr> image_caption - (as shown in box) <tr> image2 - (as shown in box) <tr> image2_upright - (as shown in box) <tr> image2_alt - (as shown in box) <tr> image2_caption - (as shown in box) <tr> classification_status - (as shown in box) <tr> virus_group - (as shown in box) <tr> superdomain - (as shown in box) <tr> superdomain_authority - (as shown in box) <tr> unranked_superdomain - (as shown in box) <tr> unranked_superdomain_ authority - (as shown in box) <tr> domain - (as shown in box) <tr> domain_authority - (as shown in box) <tr> unranked_regnum - (as shown in box) <tr> unranked_regnum_authority - (as shown in box) <tr> superregnum - (as shown in box) <tr> superregnum_authority - (as shown in box) <tr> regnum_authority - (as shown in box) <tr> subregnum - (as shown in box) <tr> subregnum_authority - (as shown in box) <tr> unranked_phylum - (as shown in box) <tr> unranked_phylum_authority - (as shown in box) <tr> superdivisio - (as shown in box) <tr> superdivisio_authority - (as shown in box) <tr> superphylum - (as shown in box) <tr> superphylum_authority - (as shown in box) <tr> divisio - (as shown in box) <tr> divisio authority - (as shown in box) <tr> unranked_divisio - (as shown in box) <tr> unranked_divisio_authority - (as shown in box) <tr> phylum_authority - (as shown in box) <tr> subdivisio - (as shown in box) <tr> subdivisio_authority - (as shown in box) <tr> subphylum - (as shown in box) <tr> subphylum_authority - (as shown in box) <tr> infraphylum - (as shown in box) <tr> infraphylum_authority - (as shown in box) <tr> microphylum - (as shown in box) <tr> microphylum_authority - (as shown in box) <tr> nanophylum - (as shown in box) <tr> nanophylum_authority - (as shown in box) <tr> unranked_classis - (as shown in box) <tr> unranked_classis_authority - (as shown in box) <tr> superclassis - (as shown in box) <tr> superclassis_authority - (as shown in box) <tr> classis_authority - (as shown in box) <tr> unranked_subclassis - (as shown in box) <tr> unranked_subclassis_authority - (as shown in box) <tr> subclassis - (as shown in box) <tr> subclassis_authority - (as shown in box) <tr> unranked_infraclassis - (as shown in box) <tr> unranked_infraclassis_authority - (as shown in box) <tr> infraclassis - (as shown in box) <tr> infraclassis_authority - (as shown in box) <tr> unranked_ordo - (as shown in box) <tr> unranked_ordo_authority - (as shown in box) <tr> magnordo - (as shown in box) <tr> magnordo_authority - (as shown in box) <tr> superordo - (as shown in box) <tr> superordo_authority - (as shown in box) <tr> ordo_authority - (as shown in box) <tr> subordo - (as shown in box) <tr> subordo_authority - (as shown in box) <tr> infraordo - (as shown in box) <tr> infraordo_authority - (as shown in box) <tr> parvordo - (as shown in box) <tr> parvordo_authority - (as shown in box) <tr> zoodivisio - (as shown in box) <tr> zoodivisio_authority - (as shown in box) <tr> zoosectio - (as shown in box) <tr> zoosectio_authority - (as shown in box) <tr> zoosubsectio - (as shown in box) <tr> zoosubsectio_authority - (as shown in box) <tr> unranked_superfamilia - (as shown in box) <tr> unranked_superfamilia_authority - (as shown in box) <tr> superfamilia - (as shown in box) <tr> superfamilia_authority - (as shown in box) <tr> familia_authority - (as shown in box) <tr> subfamilia - (as shown in box) <tr> subfamilia_authority - (as shown in box) <tr> unranked_tribus - (as shown in box) <tr> unranked_tribus_authority - (as shown in box) <tr> supertribus - (as shown in box) <tr> supertribus_authority - (as shown in box) <tr> tribus - (as shown in box) <tr> tribus_authority - (as shown in box) <tr> subtribus - (as shown in box) <tr> subtribus_authority - (as shown in box) <tr> alliance - (as shown in box) <tr> alliance_authority - (as shown in box) <tr> unranked_genus - (as shown in box) <tr> unranked_genus_authority - (as shown in box) <tr> genus_authority - (as shown in box) <tr> subgenus - (as shown in box) <tr> subgenus_authority - (as shown in box) <tr> sectio - (as shown in box) <tr> sectio_authority - (as shown in box) <tr> subsectio - (as shown in box) <tr> subsectio_authority - (as shown in box) <tr> series - (as shown in box) <tr> series_authority - (as shown in box) <tr> subseries - (as shown in box) <tr> subseries_authority - (as shown in box) <tr> species_group - (as shown in box) <tr> species_group_authority - (as shown in box) <tr> species_subgroup - (as shown in box) <tr> species_subgroup_authority - (as shown in box) <tr> species_complex - (as shown in box) <tr> species_complex_authority - (as shown in box) <tr> species_authority - (as shown in box) <tr> subspecies - (as shown in box) <tr> subspecies_authority - (as shown in box) <tr> variety - (as shown in box) <tr> variety_authority - (as shown in box) <tr> forma - (as shown in box) <tr> forma_authority - (as shown in box) <tr> diversity_ref - (as shown in box) <tr> diversity - (as shown in box) <tr> diversity_link - (as shown in box) <tr> binomial - (as shown in box) <tr> binomial_authority - (as shown in box) <tr> trinomial - (as shown in box) <tr> trinomial_authority - (as shown in box) <tr> type_genus - (as shown in box) <tr> type_genus_authority - (as shown in box) <tr> type_species - (as shown in box) <tr> type_species_authority - (as shown in box) <tr> subdivision - (as shown in box) <tr> subdivision_ranks - (as shown in box) <tr> type_strain - (as shown in box) <tr> range_map - 1st map, bottom of box <tr> range_map_upright - 1st map scaling = 0.9 i.e. 90% of default size<tr> range_map_alt - 1st map ALT= text<tr> range_map_caption - 1st caption, under picture<tr> binomial2 - (as shown in box) <tr> binomial2_authority - (as shown in box) <tr> range_map2 - 2nd map in box <tr> range_map2_upright - 2nd map scaling = 0.9 <tr> range_map2_alt - 2nd map ALT= text <tr> range_map2_caption - 2nd map caption <tr> binomial3 - (as shown in box) <tr> binomial3_authority - (as shown in box) <tr> range_map3 - 3rd map in box <tr> range_map3_upright - 3rd map scaling = 0.9 <tr> range_map3_alt - 3rd map ALT= text <tr> range_map3_caption - 3rd maq caption <tr> binomial4 - (as shown in box) <tr> binomial4_authority - (as shown in box) <tr> range_map4 - 4th map in box <tr> range_map4_upright - 4th map scaling = 0.9 <tr> range_map4_alt - 4th map ALT= text <tr> range_map4_caption - 4th map caption <tr> synonyms_ref - reference for synonyms <tr> synonyms - (as at bottom of box)
Articles lacking taxoboxes[edit source]
For articles lacking taxoboxes, add Template:Missing-taxobox to the talk page. This may be done by typing <nowiki>Template:Missing-taxobox</nowiki> or <nowiki>Template:Needtaxobox</nowiki> at the top of the talk page.
Microformat[edit source]
Template Data[edit source]
Template:TemplateData header <templatedata> { "description": "An infobox for plants, animals and other biological taxa", "params": { "name":
{
"label": "Name", "description": "For plants, see Wikipedia:Naming conventions (flora). For all other living things, the name should be the most common vernacular name, when one is in widespread use, and a scientific name otherwise.", "type": "string" }, "image": { "label": "Image", "description": "An image to use, do not include the 'File:' part of the image file name.", "type": "wiki-file-name", "required": false, "suggested": true }, "image_width": { "label": "Image Width", "description": "(Deprecated) Width to display the image at. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "image width" ], "required": false, "deprecated": "Use image_upright" }, "image_upright": { "label": "Image Upright scale", "description": "Scale to display the image at. e.g. 1.1", "type": "string", "aliases": [ "image upright" ], "required": false }, "image_alt": { "label": "Image alt text", "description": "Alt text which describes the image to someone who can't see it", "type": "string", "aliases": [ "image alt" ], "required": false }, "image_caption": { "label": "Image caption", "description": "Caption displayed under the image", "type": "string", "suggested": true }, "image_caption_align": { "label": "Image caption alignment", "description": "Alignment of the caption displayed under the image, e.g. left. Should not normally be set.", "type": "string", "aliases": [ "image caption alignment" ], "required": false, "deprecated": true }, "regnum": { "label": "Kingdom", "description": "Kingdom: Animalia, Plantae, Fungi, other taxa may want to use domain or other ranks instead", "type": "string", "required": false }, "divisio": { "label": "Division", "description": "Division in botany, e.g. Bryophyta. Not for flowering plants using the APG III system", "type": "string", "required": false }, "phylum": { "label": "Phylum", "description": "Phylum in zoology, eg Chordata for chordates", "type": "string", "required": false }, "classis": { "label": "Class", "description": "Class/classis taxonomic rank", "type": "string", "required": false }, "ordo": { "label": "Order", "description": "Order/ordo taxonomic rank", "type": "string", "required": false }, "familia": { "label": "Family", "description": "Family/familia taxonomic rank", "type": "string", "required": false }, "genus": { "label": "Genus", "description": "Genus taxonomic rank, in italics, e.g. Homo", "type": "string", "required": false }, "species": { "label": "Species", "description": "Species taxonomic rank. Should be given in abbreviated forms and in italics, e.g. H. sapiens.", "type": "string", "required": false }, "binomial": { "label": "Binomial", "description": "Full binomial name of taxa, In full form with italics, e.g. Salix alba var. caerulea", "type": "string", "required": false }, "binomial_authority": { "label": "Binomial authority", "description": "Binomial authority using appropriate conventions, eg L. (for plants), Linnaeus, 1761 (for animals)", "type": "string", "required": false }, "range_map": { "label": "Range map", "description": "Map of range", "type": "string", "aliases": [ "range map" ], "required": false }, "range_map_width": { "label": "Range map width", "description": "Width to display range map. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "range map width" ], "required": false, "deprecated": true }, "range_map_alt": { "label": "Range map alt text", "description": "Alt text describing the range in words", "type": "string", "aliases": [ "range map alt" ], "required": false }, "range_map_caption": { "label": "Range map caption", "description": "Caption/key for the range map", "type": "string", "aliases": [ "range map caption" ], "required": false }, "status": { "label": "Conservation status", "description": "The conservation status code: 'secure', domesticated 'DOM', Least Concern 'LC', Lower Risk—Least Concern 'LR/lc', Near Threatened 'NT', Lower Risk—Near Threatened 'LR/nt', Lower Risk—Conservation Dependent 'LR/cd', Vulnerable 'VU', Endangered 'EN', Critically Endangered 'CR', Possibly Extinct 'PE', Extinct in the wild 'EW', Extinct 'EX', Data deficient 'DD', Not evaluated 'NE',Fossil 'fossil', Prehistoric 'pre', 'See text', Lower Risk 'LR'", "type": "string", "required": false }, "status_system": { "label": "Conservation status system", "description": "System used for Conservation status: 'IUCN3.1', 'IUCN2.3', 'EPBC' etc. Required if status given.", "type": "string", "aliases": [ "status system" ], "required": false }, "status_ref": { "label": "Status reference", "description": "Reference for status <ref>Template:Cite journal</ref>", "type": "string", "aliases": [ "status ref" ], "required": false }, "extinct": { "label": "Year of extinction", "description": "Year of extinction, if known", "type": "string", "required": false }, "fossil_range": { "label": "Fossil range", "description": "The stratigraphic range for groups known as fossils. E.g. Cambrian–Permian or Template:Fossil range to give a chart. Use 'Recent' for extant taxa and 'Holocene' for Late Quaternary extinctions.", "type": "string", "required": false }, "virus_group": { "label": "Virus group", "description": "Viruses not placed in taxa above the rank of order, instead a virus group is used, given by a Roman numeral from I to VII", "type": "string", "aliases": [ "virus group" ], "required": false }, "unranked_superdomain": { "label": "Unranked superdomain", "description": "For each major taxon you can add an unranked entry to the taxobox. The entry unranked X appears above rank X", "type": "string", "aliases": [ "unranked superdomain" ], "required": false }, "superdomain": { "label": "Superdomain", "description": "This and other minor ranks should only be used when they are important to understanding the classification of the taxon described in the article", "type": "string", "required": false }, "superdomain_authority": { "label": "Superdomain Authority", "description": "The authority used for this rank. Every rank has a rank authority field which are not currently listed", "type": "string", "aliases": [ "superdomain authority" ], "required": false }, "domain": { "label": "Domain", "description": "Domain for Archaea, Bacteria and Eukarya", "type": "string", "required": false }, "superregnum": { "label": "Superkingdom", "type": "string", "required":
false
}, "unranked_regnum": { "label": "Unranked kingdom", "type": "string", "required": false }, "subregnum": { "label": "Subkingdom", "type": "string", "required": false }, "superdivisio": { "label": "Superdivision", "type": "string", "required": false }, "superphylum": { "label": "Superphylum", "type": "string", "required": false }, "unranked_divisio": { "label": "Unranked division", "description": "For flowering plants using the APG IV system this should be set to Angiosperms rather than using division/divisio", "type": "string", "aliases": [ "unranked divisio" ], "required": false }, "unranked_phylum": { "label": "Unranked phylum", "type": "string", "required": false }, "subphylum": { "label": "Subphylum", "type": "string", "required": false }, "infraphylum": { "label": "Infraphylum", "type": "string", "required": false }, "microphylum": { "label": "Microphylum", "type": "string", "required": false }, "nanophylum": { "label": "Nanophylum", "type": "string", "required": false }, "superclassis": { "label": "Superclass", "type": "string", "required": false }, "unranked_classis": { "label": "Unranked class", "description": "For flowering plants using the APG IV system this should be used rather than class/classis", "type": "string", "aliases": [ "unranked classis" ], "required": false }, "unranked_subclassis": { "label": "Unranked subclass", "type": "string", "aliases": [ "unranked subclassis" ], "required": false }, "subclassis": { "label": "Subclass", "type": "string", "required": false }, "unranked_infraclassis": { "label": "Unranked infraclass", "type": "string", "aliases": [ "unranked infraclassis" ], "required": false }, "infraclassis": { "label": "Infraclass", "type": "string", "required": false }, "magnordo": { "label": "Magnorder", "type": "string", "required": false }, "superordo": { "label": "Superorder", "type": "string", "required": false }, "unranked_ordo": { "label": "Unranked order", "description": "Generally used for flowering plants using the APG IV system", "type": "string", "aliases": [ "unranked ordo" ], "required": false }, "subordo": { "label": "subordo", "type": "string", "required": false }, "infraordo": { "label": "infraordo", "type": "string", "required": false }, "parvordo": { "label": "parvordo", "type": "string", "required": false }, "zoodivisio": { "label": "zoodivision", "description": "Used in zoology, a different rank to the division used in botany.", "type": "string", "required": false }, "zoosectio": { "label": "zoosection", "description": "Used in zoology, a different rank to the section used in botany.", "type": "string", "required": false }, "zoosubsectio": { "label": "zoosubsection", "description": "Used in zoology, a different rank to the subsection used in botany.", "type": "string", "required": false }, "unranked_superfamilia": { "label": "Unranked Superfamily", "type": "string", "required": false }, "superfamilia": { "label": "Superfamily", "type": "string", "required": false }, "subfamilia": { "label": "Subfamily", "type": "string", "required": false }, "supertribus": { "label": "supertribus", "type": "string", "required": false }, "unranked_tribus": { "label": "unranked tribe", "type": "string", "aliases": [ "unranked tribus" ], "required": false }, "tribus": { "label": "Tribe", "type": "string", "required": false }, "subtribus": { "label": "Subtribe", "type": "string", "required": false }, "alliance": { "label": "alliance", "type": "string", "required": false, "deprecated": "Displays as a rank between subtribe and genus. " }, "unranked_genus": { "label": "Unranked genus", "type": "string", "aliases": [ "unranked genus" ], "required": false }, "subgenus": { "label": "Subgenus", "type": "string", "required": false }, "sectio": { "label": "Section", "description": "Used in botany, use zoosectio in zoology", "type": "string", "required": false }, "subsectio": { "label": "Subsection", "description": "Used in botany, use zoosubsectio in zoology", "type": "string", "required": false }, "series": { "label": "Series", "type": "string", "required": false }, "subseries": { "label": "Subseries", "type": "string", "required": false }, "species_group": { "label": "Species group", "type": "string", "aliases": [ "species group" ], "required": false }, "species_subgroup": { "label": "species subgroup", "type": "string", "aliases": [ "species subgroup" ], "required": false }, "species_complex": { "label": "species complex", "type": "string", "aliases": [ "species complex" ], "required": false }, "subspecies": { "label": "subspecies", "type": "string", "required": false }, "variety": { "label": "variety", "type": "string", "required": false, "deprecated": "use varietas" }, "forma": { "label": "form", "description": "Used in botany, not in zoology", "type": "string", "required": false }, "trinomial": { "label": "trinomial", "description": "The full trinomial name for subspecies, it should generally be in italics.", "type": "string", "required": false }, "trinomial_authority": { "label": "trinomial authority", "description": "The authority for a trinomial.", "type": "string", "aliases": [ "trinomial authority" ], "required": false }, "synonyms": { "label": "Synonyms", "description": "A list of synonyms for a species, e.g. species1 <small>Authority1</small><br/> species2 <small>Authority2</small>", "type": "string", "required": false }, "synonyms_ref": { "label": "Synonyms ref", "description": "References for the synonym lists, e.g.<ref>Smith and Jones, 2009, p. 5</ref>", "type": "string", "required": false }, "type_species": { "label":
"Type species",
"description": "The original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature.", "type": "string", "required": false }, "type_species_authority": { "label": "Type species authority", "description": "Authority for the type species, don't use parenthesis.", "type": "string", "aliases": [ "type species authority" ], "required": false }, "classification_status": { "label": "Classification status", "description": "Status of the scientific classification, e.g. disputed. Only use when the scientific classification text would be misleading without it.", "type": "string", "aliases": [ "classification status" ], "required": false }, "subdivision_ranks": { "label": "Subdivision ranks", "description": "Rank used for sub-divisions of this taxa, e.g. 'Families'", "type": "string", "aliases": [ "subdivision ranks" ], "required": false }, "subdivision": { "label": "Subdivision", "description": "List of sub divisions of this taxa, e.g. Family1<br/> Family2<br/> Family3", "type": "string", "required": false }, "image2": { "label": "Image 2", "description": "A second image, only use in rare circumstances.", "type": "string", "required": false }, "image2_width": { "label": "Image 2 Width", "description": "Deprecated. Width of the second image", "type": "number", "aliases": [ "image2 width" ], "required": false, "deprecated": true }, "image2_upright": { "label": "Image 2 Upright scale", "description": "Scale of the second image", "type": "number", "aliases": [ "image2 upright" ], "required": false }, "image2_alt": { "label": "Image 2 alt text", "description": "Alt text which describes the second image to someone who can't see it", "type": "string", "aliases": [ "image2 alt" ], "required": false }, "image2_caption": { "label": "Image 2 caption", "description": "Caption to display under the second image", "type": "string", "required": false }, "binomial2": { "label": "Binomial2", "description": "Second binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial2_authority": { "label": "Binomial authority 2", "description": "Authority of second binomial", "type": "string", "aliases": [ "binomial2 authority" ], "required": false }, "binomial3": { "label": "Binomial3", "description": "Third binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial3_authority": { "label": "Binomial authority 3", "description": "Authority of third binomial", "type": "string", "aliases": [ "binomial3 authority" ], "required": false }, "binomial4": { "label": "Binomial4", "description": "Fourth binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial4_authority": { "label": "Binomial authority 4", "description": "Authority of fourth binomial", "type": "string", "aliases": [ "binomial4 authority" ], "required": false }, "range_map2": { "label": "Range map 2", "description": "Second map of range", "type": "string", "aliases": [ "range map2" ], "required": false }, "range_map2_width": { "label": "Range map 2 width", "description": "Width of second range map", "type": "string", "aliases": [ "range map2 width" ], "required": false, "deprecated": true }, "range_map2_alt": { "label": "Range map 2 alt text", "description": "Alt text describing the second range map", "type": "string", "aliases": [ "range map2 alt" ], "required": false }, "range_map2_caption": { "label": "Range map 2 caption", "description": "Caption/key for the second range map", "type": "string", "aliases": [ "range map2 caption" ], "required": false }, "range_map3": { "label": "Range map 3", "description": "Third map of range", "type": "string", "aliases": [ "range map3" ], "required": false }, "range_map3_width": { "label": "Range map 3 width", "description": "Width of third range map", "type": "string", "aliases": [ "range map3 width" ], "required": false, "deprecated": true }, "range_map3_alt": { "label": "Range map 3 alt text", "description": "Alt text describing the third range map", "type": "string", "aliases": [ "range map3 alt" ], "required": false }, "range_map3_caption": { "label": "Range map 3 caption", "description": "Caption/key for the third range map", "type": "string", "aliases": [ "range map3 caption" ], "required": false }, "range_map4": { "label": "Range map 4", "description": "Forth map of range", "type": "string", "aliases": [ "range map4" ], "required": false }, "range_map4_width": { "label": "Range map 4 width", "description": "Width of forth range map", "type": "string", "aliases": [ "range map4 width" ], "required": false, "deprecated": true }, "range_map4_alt": { "label": "Range map 4 alt text", "description": "Alt text describing the forth range map", "type": "string", "aliases": [ "range map4 alt" ], "required": false }, "range_map4_caption": { "label": "Range map 4 caption", "description": "Caption/key for the fourth range map", "type": "string", "aliases": [ "range map4 caption" ], "required": false }, "color": { "label": "color", "description": "Generally not used as it is automatically assigned based on the entry for regnum, virus group, unranked phylum, phylum.", "type": "string", "required": false, "deprecated": true }, "genus_authority": { "label": "Genus authority", "type": "string" } }, "format": "Template:\n\n", "paramOrder": [ "name", "image", "image_width", "image_upright", "image_alt", "image_caption", "image_caption_align", "regnum", "divisio", "phylum", "classis", "ordo", "familia", "genus", "genus_authority", "species", "binomial", "binomial_authority", "range_map", "range_map_width", "range_map_alt", "range_map_caption", "status", "status_system", "status_ref", "extinct", "fossil_range", "virus_group", "unranked_superdomain", "superdomain", "superdomain_authority", "domain", "superregnum", "unranked_regnum", "subregnum", "superdivisio", "superphylum", "unranked_div isio", "unranked_phylum", "subphylum", "infraphylum", "microphylum", "nanophylum", "superclassis", "unranked_classis", "unranked_subclassis", "subclassis", "unranked_infraclassis", "infraclassis", "magnordo", "superordo", "unranked_ordo", "subordo", "infraordo", "parvordo", "zoodivisio", "zoosectio", "zoosubsectio", "unranked_superfamilia", "superfamilia", "subfamilia", "supertribus", "unranked_tribus", "tribus", "subtribus", "alliance", "unranked_genus", "subgenus", "sectio", "subsectio", "series", "subseries", "species_group", "species_subgroup", "species_complex", "subspecies", "variety", "forma", "trinomial", "trinomial_authority", "synonyms", "synonyms_ref", "type_species", "type_species_authority", "classification_status", "subdivision_ranks", "subdivision", "image2", "image2_width", "image2_upright", "image2_alt", "image2_caption", "binomial2", "binomial2_authority", "binomial3", "binomial3_authority", "binomial4", "binomial4_authority", "range_map2", "range_map2_width", "range_map2_alt", "range_map2_caption", "range_map3", "range_map3_width", "range_map3_alt", "range_map3_caption", "range_map4", "range_map4_width", "range_map4_alt", "range_map4_caption", "color" ] } </templatedata>
Supporting templates[edit source]
Tracking categories[edit source]
Hidden category added by Taxobox:
Hidden categories added by Taxobox/core:
Hidden categories added by Taxobox/species:
Hidden categories added by Taxobox/Error colour:
See also[edit source]
- Wikipedia:How to read a taxobox
- Wikipedia:Manual of Style/Infoboxes
- Template:Tl
- Automated taxobox system
<div style="display: none">Template:Reflist</div>
Notes[edit source]
<includeonly><!-- Categories below this line, please; interwikis at Wikidata --></includeonly><noinclude> </noinclude></text>
<sha1>6afkilzd4ifgvqza7rndjpt4vla93ce</sha1> </revision> </page> <page> <title>Template:Taxobox/species</title> <ns>10</ns> <id>24758980</id> <revision> <id>816767029</id> <parentid>775239827</parentid> <timestamp>2017-12-23T14:52:37Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>lower-case cat names per 2011 RFC that moved these categories</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="25863"><noinclude>Template:Documentation</noinclude></text> <sha1>blif8wgwyyodyvosdqfafwqlg86qhx4</sha1> </revision> </page> <page> <title>Template:Taxobox colour</title> <ns>10</ns> <id>12033623</id> <revision> <id>815446650</id> <parentid>755798033</parentid> <timestamp>2017-12-14T21:46:36Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>simplifying per Template talk:Taxobox#Colors</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="739"><includeonly>Template:Taxobox/Error colour<!--
--></includeonly><noinclude> Template:Template doc</noinclude></text>
<sha1>d3sx0a9ckwn8woa6b1351hr88ok2gsk</sha1> </revision> </page> <page> <title>Template:Taxobox colour scheme</title> <ns>10</ns> <id>14799909</id> <revision> <id>821289122</id> <parentid>821288988</parentid> <timestamp>2018-01-19T15:14:49Z</timestamp> <contributor> <username>Zzuuzz</username> <id>365454</id> </contributor> <minor/> <comment>Changed protection level for "Template:Taxobox colour scheme": High risk template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1660">{| class="wikitable"
|- ! style="background:Template:Taxobox colour" | Viruses || Template:Taxobox colour |also Viroids |- ! style="background:Template:Taxobox colour" | Bacteria || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaea || Template:Taxobox colour |also Nanoarchaeota (Nanarchaeota), Korarchaeota, Thaumarchaeota, Crenarchaeota and Euryarchaeota |- ! style="background:Template:Taxobox colour" | Eukaryota || Template:Taxobox colour |For eukaryotes with no other colour defined, including Excavata, Amoebozoa and Opisthokonta |- ! style="background:Template:Taxobox colour" | Animalia || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Fungi || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaeplastida || Template:Taxobox colour |also Plantae and Viridiplantae |- ! style="background:Template:Taxobox colour" | SAR || Template:Taxobox colour |also Chromalveolata |- ! style="background:Template:Taxobox colour" | incertae sedis || Template:Taxobox colour |- | colspan=2 | Colours not produced by this template: |- ! style='background:rgb(215,240,210)' | Ichnotaxa || rgb(215,240,210) |- ! style='background:rgb(250,250,220)' | Ootaxa || rgb(250,250,220) |}<noinclude>
</noinclude></text>
<sha1>56aaxhsqzcnbra7jrm9p9jn4uy34w03</sha1> </revision> </page> <page> <title>Template:Taxonomy</title> <ns>10</ns> <id>27661849</id> <revision> <id>764331794</id> <parentid>764331491</parentid> <timestamp>2017-02-08T09:08:14Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>switch statement is redundant, as never passed an italicizable rank</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="370"><includeonly></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8v5w4w6r2w9ofp9wsbfhgroqxd7g6h9</sha1> </revision> </page> <page> <title>Template:Taxonomy/nobreak</title> <ns>10</ns> <id>49415604</id> <revision> <id>804252870</id> <parentid>712712769</parentid> <timestamp>2017-10-07T19:38:00Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>replace br tag plus newline with just br tag</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="290">Script error: No such module "String".<noinclude>Template:Documentation</noinclude></text> <sha1>d30l7w1uufy6kabtzhr4oj3ny6xqrk6</sha1> </revision> </page> <page> <title>Template:TemplateData header</title> <ns>10</ns> <id>40047498</id> <revision> <id>827245794</id> <parentid>826349555</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:TemplateData header": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="501"><div class="templatedata-header">This is the TemplateData documentation for this template used by VisualEditor and other tools; Template:Template error report
TemplateData for Taxobox </div><includeonly></includeonly><noinclude> Template:Documentation </noinclude></text>
<sha1>1lgj007izalttlek052vptodul1clkt</sha1> </revision> </page> <page> <title>Template:Template error report</title> <ns>10</ns> <id>51792646</id> <revision> <id>827245762</id> <parentid>826348773</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Template error report": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="278">see the monthly error report for this template.<noinclude>
[[Category:External
link templates]]</noinclude></text> <sha1>58xkdtdvcn1dijd3bs4zlibe610r8r1</sha1> </revision> </page> <page> <title>Template:Tl</title> <ns>10</ns> <id>1487430</id> <revision> <id>836995080</id> <parentid>776260390</parentid> <timestamp>2018-04-18T02:46:37Z</timestamp> <contributor> <username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level for "Template:Tl": used in the mediawiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="168">{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude></text>
<sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1> </revision> </page> <page> <title>Template:Tlx</title> <ns>10</ns> <id>4497810</id> <revision> <id>821674175</id> <parentid>618336566</parentid> <timestamp>2018-01-21T23:12:17Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>MOS:ELLIPSIS</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1051"><includeonly><!-- --><code><!-- --><nowiki>{{</nowiki><!-- -->[[Template:|]]<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><nowiki>}}</nowiki><!-- --></code><!--
--></includeonly><noinclude> Template:Documentation</noinclude></text>
<sha1>0dyhbuugzgzyax8gcf5l4wyycg4mps7</sha1> </revision> </page> <page> <title>Template:UF-species</title> <ns>10</ns> <id>19258178</id> <revision> <id>714407463</id> <parentid>714407326</parentid> <timestamp>2016-04-09T15:45:58Z</timestamp> <contributor> <username>SMcCandlish</username> <id>378390</id> </contributor> <comment>ditto</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="951">This template emits a "species" (or "biota") microformat.
The microformat is created by the use of <code>class="biota"</code>, and classes for individual taxonomic ranks, such as <code>class="domain"</code> in a span around <nowiki>{{{domain}}}</nowiki> (full list). Please do not change or remove those classes other than as part of development of the microformat. For background information, see microformats on Wikipedia and the microformat specification.<includeonly></includeonly><noinclude> </noinclude></text>
<sha1>fuqlkggft305v01aekcgpirx6pma0tw</sha1> </revision> </page> <page> <title>Template:Var</title> <ns>10</ns> <id>19311880</id> <revision> <id>816459039</id> <parentid>684205355</parentid> <timestamp>2017-12-21T13:31:52Z</timestamp> <contributor> <username>Izno</username> <id>2927383</id> </contributor> <comment>nix xml lang invocation</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="322"><var style="padding-right: 1px;" >{{{1}}}</var><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.--> Template:Documentation </noinclude></text>
<sha1>1ph0r212s7cz1dvg2q4quotqwsozpa8</sha1> </revision> </page> <page> <title>Template:Xtag</title> <ns>10</ns> <id>33645369</id> <revision> <id>769239758</id> <parentid>707284440</parentid> <timestamp>2017-03-08T10:11:47Z</timestamp> <contributor> <username>Cedar101</username> <id>374440</id> </contributor> <comment>chem</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1808"><code class="nowrap"><tag><!--nothing--></code><noinclude>
Template:Documentation </noinclude></text>
<sha1>2smj06z8y5aivrb62i0f8z1e17c5dyq</sha1> </revision> </page> <page> <title>Template:Yesno</title> <ns>10</ns> <id>22255088</id> <revision> <id>821904792</id> <parentid>669640856</parentid> <timestamp>2018-01-23T08:37:08Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>add support for on/off, per discussion</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="366">{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: ¬ }} |no |n |false |off |0 = <!-- null --> | = <!-- null --> |¬ = |yes |y |true |on |1 = yes |#default = yes
}}<noinclude> Template:Documentation </noinclude></text>
<sha1>r1wh7ajnm478r67owpatavjany80n9e</sha1> </revision> </page> <page> <title>Template:Yesno-no</title> <ns>10</ns> <id>48375573</id> <revision> <id>825510157</id> <parentid>804450734</parentid> <timestamp>2018-02-13T20:27:17Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="269">{{safesubst:<noinclude />yesno|{{{1}}}|yes=yes|no=no|blank=no|¬=no|def=no}}<noinclude>
Template:Documentation <!--Categories go in the doc page referenced above; interwikis go in Wikidata.--> </noinclude></text>
<sha1>34vmtxa9ubuh1vz2ulp78m5ela68riu</sha1> </revision> </page> <page> <title>Module:Arguments</title> <ns>828</ns> <id>41298065</id> <revision> <id>696500078</id> <parentid>668829606</parentid> <timestamp>2015-12-23T16:07:27Z</timestamp> <contributor>
<username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level of Module:Arguments: used in the mediawiki interface ex: MediaWiki:Watchlist-details ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="10054">-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly.
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it.
local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == then return nil else return val end else return val end end
local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end
local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end
local function tidyValNoChange(key, val) return val end
local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {}
--[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end
--[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', ) local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end
-- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end
-- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs
--[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end
--[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable)
local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end
--[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]]
metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end
metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end
local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this
won't cause stack overflow
return translatenext(invariant) else return backtranslate, v end end end
metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end
local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end
metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end
return args end
return arguments</text>
<sha1>5qx9tzlul9ser30uxj9nbasjt92cevn</sha1> </revision> </page> <page> <title>Module:Check for unknown parameters</title> <ns>828</ns> <id>42286729</id> <revision> <id>726655795</id> <parentid>726655742</parentid> <timestamp>2016-06-23T14:41:43Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is -- not on the list local p = {}
local function trim(s) return s:match('^%s*(.-)%s*$') end
local function isnotempty(s) return s and trim(s) ~= end
function p.check (frame) local args = frame.args local pargs = frame:getParent().args local ignoreblank = isnotempty(frame.args['ignoreblank']) local showblankpos = isnotempty(frame.args['showblankpositional']) local knownargs = {} local unknown = frame.args['unknown'] or 'Found _VALUE_, ' local preview = frame.args['preview']
local values = {} local res = {} local regexps = {}
-- create the list of known args, regular expressions, and the return string for k, v in pairs(args) do if type(k) == 'number' then v = trim(v) knownargs[v] = 1 elseif k:find('^regexp[1-9][0-9]*$') then table.insert(regexps, '^' .. v .. '$') end end if isnotempty(preview) then preview = '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview).</div>' elseif preview == nil then preview = unknown end
-- loop over the parent args, and make sure they are on the list for k, v in pairs(pargs) do if type(k) == 'string' and knownargs[k] == nil then local knownflag = false for i, regexp in ipairs(regexps) do if mw.ustring.match(k, regexp) then knownflag = true break end end if not knownflag and ( not ignoreblank or isnotempty(v) ) then k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') table.insert(values, k) end elseif type(k) == 'number' and knownargs[tostring(k)] == nil and ( showblankpos or isnotempty(v) ) then local vlen = mw.ustring.len(v) v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25) v = mw.ustring.gsub(v, '[^%w\-_ ]', '?') table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or )) end end
-- add resuls to the output tables if #values > 0 then if frame:preprocess( "-" ) == "" 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:Delink</title> <ns>828</ns> <id>38999128</id> <revision> <id>695173753</id> <parentid>617654635</parentid> <timestamp>2015-12-14T07:03:21Z</timestamp> <contributor> <username>The Earwig</username> <id>7418060</id> </contributor> <minor/> <comment>Protected "Module:Delink": Highly visible template: 55,000+ mainspace transclusions ([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="6545">-- This module de-links most wikitext.
require('Module:No globals')
local p = {}
local getArgs
local function delinkReversePipeTrick(s)
if s:match("^%[%[|.*[|\n]") then -- Check for newlines or multiple pipes. return s else return s:match("%[%[|(.*)%]%]") end
end
local function delinkPipeTrick(s)
local linkarea, display = "", "" -- We need to deal with colons, brackets, and commas, per Help:Pipe trick. -- First, remove the text before the first colon, if any. if s:match(":") then s = s:match("%[%[.-:(.*)|%]%]") -- If there are no colons, grab all of the text apart from the square brackets and the pipe. else s = s:match("%[%[(.*)|%]%]") end -- Next up, brackets and commas. if s:match("%(.-%)$") then -- Brackets trump commas. s = s:match("(.-) ?%(.-%)$") elseif s:match(",") then -- If there are no brackets, display only the text before the first comma. s = s:match("(.-),.*$") end return s
end
local function delinkWikilink(s)
local result = s -- Deal with the reverse pipe trick. if result:match("%[%[|") then return delinkReversePipeTrick(result) end result = mw.uri.decode(result, "PATH") -- decode percent-encoded entities. Leave underscores and plus signs. result = mw.text.decode(result, true) -- decode HTML entities. -- Check for bad titles. To do this we need to find the -- title area of the link, i.e. the part before any pipes. local titlearea if result:match("|") then -- Find if we're dealing with a piped link. titlearea = result:match("^%[%[(.-)|.*%]%]") else titlearea = result:match("^%[%[(.-)%]%]") end -- Check for bad characters. if mw.ustring.match(titlearea, "[%[%]<>{}%%?%c\n]") then return s end -- Check for categories, interwikis, and files. local colonprefix = result:match("%[%[(.-):.*%]%]") or "" -- Get the text before the first colon. local ns = mw.site.namespaces[colonprefix] -- see if this is a known namespace if mw.language.isKnownLanguageTag(colonprefix) or ( ns and ( ns.canonicalName == "File" or ns.canonicalName == "Category" ) ) then return "" end -- Remove the colon if the link is using the Help:Colon trick. if result:match("%[%[:") then result = "[[" .. result:match("%[%[:(.*%]%])") end -- Deal with links using the Help:Pipe trick. if mw.ustring.match(result, "^%[%[[^|]*|%]%]") then return delinkPipeTrick(result) end -- Find the display area of the wikilink if result:match("|") then -- Find if we're dealing with a piped link. result = result:match("^%[%[.-|(.+)%]%]") -- Remove new lines from the display of multiline piped links, -- where the pipe is before the first new line. result = result:gsub("\n", "") else result = result:match("^%[%[(.-)%]%]") end
return result
end
local function delinkURL(s)
-- Assume we have already delinked internal wikilinks, and that -- we have been passed some text between two square brackets [foo]. -- If the text contains a line break it is not formatted as a URL, regardless of other content. if s:match("\n") then return s end -- Check if the text has a valid URL prefix and at least one valid URL character. local valid_url_prefixes = {"//", "http://%22, "https://%22, "ftp://%22, "gopher://%22, "mailto:%22, "news:%22, "irc://%22} local url_prefix for i,v in ipairs(valid_url_prefixes) do if mw.ustring.match(s, '^%[' .. v ..'[^"%s?].*%]' ) then url_prefix = v break end end -- Get display text if not url_prefix then return s end s = s:match("^%[" .. url_prefix .. "(.*)%]") -- Grab all of the text after the URL prefix and before the final square bracket. s = s:match('^.-(["<> ?].*)') or "" -- Grab all of the text after the first URL separator character ("<> ). s = mw.ustring.match(s, "^%s*(%S.*)$") or "" -- If the separating character was a space, trim it off. local s_decoded = mw.text.decode(s, true) if mw.ustring.match(s_decoded, "%c") then return s else return s_decoded end
end
local function delinkLinkClass(s, pattern, delinkFunction)
if not type(s) == "string" then error("Attempt to de-link non-string input.", 2) end if not ( type(pattern) == "string" and mw.ustring.sub(pattern, 1, 1) == "^" ) then error('Invalid pattern detected. Patterns must begin with "^".', 2) end -- Iterate over the text string, and replace any matched text. using the -- delink function. We need to iterate character by character rather -- than just use gsub, otherwise nested links aren't detected properly. local result = ""
while s ~= do -- Replace text using one iteration of gsub. s = mw.ustring.gsub(s, pattern, delinkFunction, 1) -- Append the left-most character to the result string. result = result .. mw.ustring.sub(s, 1, 1) s = mw.ustring.sub(s, 2, -1) end return result
end
function p._delink(args)
local text = args[1] or "" if args.refs == "yes" then -- Remove any Help:Strip markers representing ref tags. In most situations -- this is not a good idea - only use it if you know what you are doing! text = mw.ustring.gsub(text, "?UNIQ%w*%-ref%-%d*%-QINU?", "") end if not (args.comments == "no") then text = text:gsub("<!%-%-.-%-%->", "") -- Remove html comments. end if not (args.wikilinks == "no") then text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink) -- De-link wikilinks. end if not (args.urls == "no") then text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs. end if not (args.whitespace == "no") then -- Replace single new lines with a single space, but leave double new lines -- and new lines only containing spaces or tabs before a second new line. text = mw.ustring.gsub(text, "([^\n \t][ \t]*)\n([ \t]*[^\n \t])", "%1 %2") text = text:gsub("[ \t]+", " ") -- Remove extra tabs and spaces. end return text
end
function p.delink(frame)
if not getArgs then getArgs = require('Module:Arguments').getArgs end return p._delink(getArgs(frame, {wrappers = 'Template:Delink'}))
end
return p</text>
<sha1>9uut60bk5e8nnvyxo8jbf7qt3b17a4v</sha1> </revision> </page> <page> <title>Module:Documentation</title> <ns>828</ns> <id>40256557</id> <revision> <id>729280556</id> <parentid>725653683</parentid> <timestamp>2016-07-11T04:31:31Z</timestamp> <contributor> <username>Andy M. Wang</username> <id>516856</id> </contributor> <comment>rm alt text on icon, since the adjacent text, "Template documentation" or "Module documentation", is sufficient alternative text (per edit request)</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="36685">-- This module implements Template:Documentation.
-- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box')
-- Get the config table. local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions. local ugsub = mw.ustring.gsub
-- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes.
local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2) end if not valArray then return msg end
local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4) end
local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal) return ret end
p.message = message
local function makeWikilink(page, display) if display then return mw.ustring.format('%s', page, display) else return mw.ustring.format('%s', page) end end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end return '<small style="font-style: normal;">(' .. table.concat(ret, ' | ') .. ')</small>' end
p.makeToolbar = makeToolbar
-- Argument processing
local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= then return value else return nil end else return value end end }) return p[funcName](args) end end
-- Main function
p.main = makeInvokeFunc('_main')
function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user -- -- Messages: -- 'main-div-id' --> 'template-documentation' -- 'main-div-classes' --> 'template-documentation iezoomfix' --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) -- This div tag is from Template:Documentation/start box, but moving it here -- so that we don't have to worry about unclosed tags. :tag('div') :attr('id', message('main-div-id')) :addClass(message('main-div-classes')) :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') :css('clear', 'both') -- So right or left floating items don't stick out of the doc box. :newline() :done() :done() :wikitext(p._endBox(args, env)) :wikitext(p.addTrackingCategories(env)) return tostring(root) end
-- Environment settings
function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title objects and other namespace- or -- path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end })
function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end
function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end
function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage
= env.docpageBase .. '/' .. message('doc-subpage')
end return mw.title.new(docpage) end
function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end
function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end
function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end
function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end
function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end
function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the same as the -- subject namespace. However, pages in the Article, File, MediaWiki or Category -- namespaces must have their /doc, /sandbox and /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end
function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end
function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using Special:ComparePages. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end
return env end
-- Auxiliary templates
function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '50px' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> 'template sandbox page' -- 'sandbox-notice-pagetype-module' --> 'module sandbox page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to Template:Ombox. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for Template:Foo (diff)." local text = local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if compareUrl then local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) else text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for test cases." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.namespace == mw.site.namespaces.Module.id then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. text = text .. makeCategoryLink(message('sandbox-category')) omargs.text = text local ret = '<div style="clear: both;"></div>' ret = ret .. messageBox.main('ombox', omargs) return ret end
function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local protectionLevels, mProtectionBanner local title = env.title protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editProt = protectionLevels.edit and protectionLevels.edit[1] local moveProt = protectionLevels.move and protectionLevels.move[1] if editProt then -- The page is edit-protected. mProtectionBanner = require('Module:Protection banner') local reason = message('protection-reason-edit') return mProtectionBanner._main{reason, small = true} elseif moveProt and moveProt ~= 'autoconfirmed' then -- The page is move-protected but not edit-protected. Exclude move -- protection with the level "autoconfirmed", as this is equivalent to -- no move protection at all. mProtectionBanner = require('Module:Protection banner') return mProtectionBanner._main{action = 'move', small = true} else return nil end end
-- Start box
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end
function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end
local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') --
Create link if /doc doesn't exist.
local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end
function p.renderStartBoxLinks(data) --[[ -- Generates the [view][edit][history][purge] or [create] links from the data table. -- @data - a table of data generated by p.makeStartBoxLinksData --]]
local function escapeBrackets(s) -- Escapes square brackets with HTML entities. s = s:gsub('%[', '[') -- Replace square brackets with HTML entities. s = s:gsub('%]', ']') 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' --> '50px' -- 'template-namespace-heading' --> 'Template documentation' -- 'module-namespace-heading' --> 'Module documentation' -- 'file-namespace-heading' --> 'Summary' -- 'other-namespaces-heading' --> 'Documentation' -- 'start-box-linkclasses' --> 'mw-editsection-like plainlinks' -- 'start-box-link-id' --> 'doc_editlinks' -- 'testcases-create-link-display' --> 'create' --]=] local subjectSpace = env.subjectSpace if not subjectSpace then -- Default to an "other namespaces" namespace, so that we get at least some output -- if an error occurs. subjectSpace = 2 end local data = {}
-- Heading local heading = args.heading -- Blank values are not removed. if heading == then -- Don't display the start box if the heading arg is defined but blank. return nil end if heading then data.heading = heading elseif subjectSpace == 10 then -- Template namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading') elseif subjectSpace == 828 then -- Module namespace data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading') elseif subjectSpace == 6 then -- File namespace data.heading = message('file-namespace-heading') else data.heading = message('other-namespaces-heading') end
-- Heading CSS local headingStyle = args['heading-style'] if headingStyle then data.headingStyleText = headingStyle elseif subjectSpace == 10 then -- We are in the template or template talk namespaces. data.headingFontWeight = 'bold' data.headingFontSize = '125%' else data.headingFontSize = '150%' end
-- Data for the [view][edit][history][purge] or [create] links. if links then data.linksClass = message('start-box-linkclasses') data.linksId = message('start-box-link-id') data.links = links end
return data end
function p.renderStartBox(data) -- Renders the start box html. -- @data - a table of data generated by p.makeStartBoxData. local sbox = mw.html.create('div') sbox :css('padding-bottom', '3px') :css('border-bottom', '1px solid #aaa') :css('margin-bottom', '1ex') :newline() :tag('span') :cssText(data.headingStyleText) :css('font-weight', data.headingFontWeight) :css('font-size', data.headingFontSize) :wikitext(data.heading) local links = data.links if links then sbox:tag('span') :addClass(data.linksClass) :attr('id', data.linksId) :wikitext(links) end return tostring(sbox) end
-- Documentation content
p.content = makeInvokeFunc('_content')
function p._content(args, env) -- Displays the documentation contents -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment env = env or p.getEnvironment(args) local docTitle = env.docTitle local content = args.content if not content and docTitle and docTitle.exists then content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText} end -- The line breaks below are necessary so that "=== Headings ===" at the start and end -- of docs are interpreted correctly. return '\n' .. (content or ) .. '\n' end
p.contentTitle = makeInvokeFunc('_contentTitle')
function p._contentTitle(args, env) env = env or p.getEnvironment(args) local docTitle = env.docTitle if not args.content and docTitle and docTitle.exists then return docTitle.prefixedText else return end end
-- End box
p.endBox = makeInvokeFunc('_endBox')
function p._endBox(args, env) --[=[ -- This function generates the end box (also known as the link box). -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'fmbox-id' --> 'documentation-meta-data' -- 'fmbox-style' --> 'background-color: #ecfcf4' -- 'fmbox-textstyle' --> 'font-style: italic' -- -- The HTML is generated by the Template: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 Template:Fmbox. local fmargs = {} fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data' fmargs.image = 'none' fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4' fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;'
-- Assemble the fmbox text field. local text = if linkBox then text = text .. linkBox else text = text .. (p.makeDocPageBlurb(args, env) or ) -- "This documentation is transcluded from Foo." if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then -- We are in the user, template or module namespaces. -- Add sandbox and testcases links. -- "Editors can experiment in this template's sandbox and testcases pages." text = text .. (p.makeExperimentBlurb(args, env) or ) text = text .. '<br />' if not args.content and not args[1] then -- "Please add categories to the /doc subpage." -- Don't show this message with inline docs or with an explicitly specified doc page, -- as then it is unclear where to add the categories. text = text .. (p.makeCategoriesBlurb(args, env) or ) end text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or ) --"Subpages of this template" local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates. if printBlurb then text = text .. '<br />' .. printBlurb end end end fmargs.text = text
return messageBox.main('fmbox', fmargs) end
function p.makeDocPageBlurb(args, env) --[=[ -- Makes the blurb "This documentation is transcluded from Template:Foo (edit, history)". -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'transcluded-from-blurb' --> -- 'The above documentation -- is transcluded from $1.' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'create-link-display' --> 'create' -- 'create-module-doc-blurb' --> -- 'You might want to $1 a documentation page for this Scribunto module.' --]=] local docTitle = env.docTitle if not docTitle then return nil end local ret if docTitle.exists then -- /doc exists; link to it. local docLink = makeWikilink(docTitle.prefixedText) local editUrl = docTitle:fullUrl{action = 'edit'} local editDisplay = message('edit-link-display') local editLink = makeUrlLink(editUrl, editDisplay) local historyUrl = docTitle:fullUrl{action = 'history'} local historyDisplay
= message('history-link-display')
local historyLink = makeUrlLink(historyUrl, historyDisplay) ret = message('transcluded-from-blurb', {docLink}) .. ' ' .. makeToolbar(editLink, historyLink) .. '<br />' elseif env.subjectSpace == 828 then -- /doc does not exist; ask to create it. local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')} local createDisplay = message('create-link-display') local createLink = makeUrlLink(createUrl, createDisplay) ret = message('create-module-doc-blurb', {createLink}) .. '<br />' end return ret end
function p.makeExperimentBlurb(args, env) --[[ -- Renders the text "Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-link-display' --> 'sandbox' -- 'sandbox-edit-link-display' --> 'edit' -- 'compare-link-display' --> 'diff' -- 'module-sandbox-preload' --> 'Template:Documentation/preload-module-sandbox' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'sandbox-create-link-display' --> 'create' -- 'mirror-edit-summary' --> 'Create sandbox version of $1' -- 'mirror-link-display' --> 'mirror' -- 'mirror-link-preload' --> 'Template:Documentation/mirror' -- 'sandbox-link-display' --> 'sandbox' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display'--> 'edit' -- 'template-sandbox-preload' --> 'Template:Documentation/preload-sandbox' -- 'testcases-create-link-display' --> 'create' -- 'testcases-link-display' --> 'testcases' -- 'testcases-edit-link-display' --> 'edit' -- 'module-testcases-preload' --> 'Template:Documentation/preload-module-testcases' -- 'template-testcases-preload' --> 'Template:Documentation/preload-testcases' -- 'experiment-blurb-module' --> 'Editors can experiment in this module's $1 and $2 pages.' -- 'experiment-blurb-template' --> 'Editors can experiment in this template's $1 and $2 pages.' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle local testcasesTitle = env.testcasesTitle local templatePage = templateTitle.prefixedText if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then return nil end -- Make links. local sandboxLinks, testcasesLinks if sandboxTitle.exists then local sandboxPage = sandboxTitle.prefixedText local sandboxDisplay = message('sandbox-link-display') local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay) local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'} local sandboxEditDisplay = message('sandbox-edit-link-display') local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay) local compareUrl = env.compareUrl local compareLink if compareUrl then local compareDisplay = message('compare-link-display') compareLink = makeUrlLink(compareUrl, compareDisplay) end sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink) else local sandboxPreload if subjectSpace == 828 then sandboxPreload = message('module-sandbox-preload') else sandboxPreload = message('template-sandbox-preload') end local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload} local sandboxCreateDisplay = message('sandbox-create-link-display') local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay) local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)}) local mirrorPreload = message('mirror-link-preload') local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary} if subjectSpace == 828 then mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary} end local mirrorDisplay = message('mirror-link-display') local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay) sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink) end if testcasesTitle.exists then local testcasesPage = testcasesTitle.prefixedText local testcasesDisplay = message('testcases-link-display') local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay) local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'} local testcasesEditDisplay = message('testcases-edit-link-display') local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay) -- for Modules, add testcases run link if exists if subjectSpace == 828 and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then local testcasesRunLinkDisplay = message('testcases-run-link-display') local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink) else testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink) end else local testcasesPreload if subjectSpace == 828 then testcasesPreload = message('module-testcases-preload') else testcasesPreload = message('template-testcases-preload') end local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload} local testcasesCreateDisplay = message('testcases-create-link-display') local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay) testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink) end local messageName if subjectSpace == 828 then messageName = 'experiment-blurb-module' else messageName = 'experiment-blurb-template' end return message(messageName, {sandboxLinks, testcasesLinks}) end
function p.makeCategoriesBlurb(args, env) --[[ -- Generates the text "Please add categories to the /doc subpage." -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'doc-link-display' --> '/doc' -- 'add-categories-blurb' --> 'Please add categories to the $1 subpage.' --]] local docTitle = env.docTitle if not docTitle then return nil end local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display')) return message('add-categories-blurb', {docPathLink}) end
function p.makeSubpagesBlurb(args, env) --[[ -- Generates the "Subpages of this template" link. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages: -- 'template-pagetype' --> 'template' -- 'module-pagetype' --> 'module' -- 'default-pagetype' --> 'page' -- 'subpages-link-display' --> 'Subpages of this $1' --]] local subjectSpace = env.subjectSpace local templateTitle = env.templateTitle if not subjectSpace or not templateTitle then return nil end local pagetype if subjectSpace == 10 then pagetype = message('template-pagetype') elseif subjectSpace == 828 then pagetype = message('module-pagetype') else pagetype = message('default-pagetype') end local subpagesLink = makeWikilink( 'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/', message('subpages-link-display', {pagetype}) ) return message('subpages-blurb', {subpagesLink}) end
function p.makePrintBlurb(args, env) --[=[ -- Generates the blurb displayed when there is a print version of the template available. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'print-link-display' --> '/Print' -- 'print-blurb' --> 'A print version' -- .. ' of this template exists at $1.' -- .. ' If you make a change to this template, please update the print version as well.' -- 'display-print-category' --> true -- 'print-category' --> 'Templates with print versions' --]=] local printTitle = env.printTitle if not printTitle then return nil end local ret if printTitle.exists then local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display')) ret = message('print-blurb', {printLink}) local displayPrintCategory = message('display-print-category', nil, 'boolean') if displayPrintCategory then ret = ret .. makeCategoryLink(message('print-category')) end end return ret end
-- Tracking categories
function p.addTrackingCategories(env) --[[ -- Check if Template:Documentation is transcluded on a /doc or /testcases page. -- @env - environment table containing title objects, etc., generated with p.getEnvironment
-- Messages: -- 'display-strange-usage-category' --> true -- 'doc-subpage' --> 'doc' -- 'testcases-subpage' --> 'testcases' -- 'strange-usage-category' --> 'Wikipedia pages with strange ((documentation)) usage' -- -- /testcases pages in the module namespace are not categorised, as they may have -- Template: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 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'] = '50px'
--[[ -- 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'] = 'template sandbox page' cfg['sandbox-notice-pagetype-module'] = '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'] = '50px'
-- cfg['template-namespace-heading'] -- The heading shown in the template namespace. cfg['template-namespace-heading'] = 'Template documentation'
-- cfg['module-namespace-heading'] -- The heading shown in the module namespace. cfg['module-namespace-heading'] = 'Module documentation'
-- cfg['file-namespace-heading'] -- The heading shown in the file namespace. cfg['file-namespace-heading'] = 'Summary'
-- cfg['other-namespaces-heading'] -- The heading shown in other namespaces. cfg['other-namespaces-heading'] = 'Documentation'
-- cfg['view-link-display'] -- The text to display for "view" links. cfg['view-link-display'] = 'view'
-- cfg['edit-link-display'] -- The text to display for "edit" links. cfg['edit-link-display'] = 'edit'
-- cfg['history-link-display'] -- The text to display for "history" links. cfg['history-link-display'] = 'history'
-- cfg['purge-link-display'] -- The text to display for "purge" links. cfg['purge-link-display'] = 'purge'
-- cfg['create-link-display'] -- The text to display for "create" links. cfg['create-link-display'] = 'create'
-- Link box (end box) configuration
-- cfg['transcluded-from-blurb'] -- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page. cfg['transcluded-from-blurb'] = 'The above documentation is 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 Scribunto module.'
-- Experiment blurb configuration
--[[ -- cfg['experiment-blurb-template'] -- cfg['experiment-blurb-module'] -- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages. -- It is only shown in the template and module namespaces. With the default English settings, it -- might look like this: -- -- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages. -- -- In this example, "sandbox", "edit", "diff", "testcases", and "edit" would all be links. -- -- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending -- on what namespace we are in. -- -- Parameters: -- -- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display']) -- -- If the sandbox doesn't exist, it is in the format: -- -- cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display']) -- -- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload'] -- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display'] -- loads a default edit summary of cfg['mirror-edit-summary']. -- -- $2 is a link to the test cases page. If the test cases page exists, it is in the following format: -- -- cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display']) -- -- If the test cases page doesn't exist, it is in the format: -- -- cfg['testcases-link-display'] (cfg['testcases-create-link-display']) -- -- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the -- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current -- namespace. --]] cfg['experiment-blurb-template'] = "Editors can experiment in this template's $1 and $2 pages." cfg['experiment-blurb-module']
= "Editors can experiment in this module's $1 and $2 pages."
-- Sandbox link configuration
-- cfg['sandbox-subpage'] -- The name of the template subpage typically used for sandboxes. cfg['sandbox-subpage'] = 'sandbox'
-- cfg['template-sandbox-preload'] -- Preload file for template sandbox pages. cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'
-- cfg['module-sandbox-preload'] -- Preload file for Lua module sandbox pages. cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'
-- cfg['sandbox-link-display'] -- The text to display for "sandbox" links. cfg['sandbox-link-display'] = 'sandbox'
-- cfg['sandbox-edit-link-display'] -- The text to display for sandbox "edit" links. cfg['sandbox-edit-link-display'] = 'edit'
-- cfg['sandbox-create-link-display'] -- The text to display for sandbox "create" links. cfg['sandbox-create-link-display'] = 'create'
-- cfg['compare-link-display'] -- The text to display for "compare" links. cfg['compare-link-display'] = 'diff'
-- cfg['mirror-edit-summary'] -- The default edit summary to use when a user clicks the "mirror" link. $1 is a wikilink to the -- template page. cfg['mirror-edit-summary'] = 'Create sandbox version of $1'
-- cfg['mirror-link-display'] -- The text to display for "mirror" links. cfg['mirror-link-display'] = 'mirror'
-- cfg['mirror-link-preload'] -- The page to preload when a user clicks the "mirror" link. cfg['mirror-link-preload'] = 'Template:Documentation/mirror'
-- Test cases link configuration
-- cfg['testcases-subpage'] -- The name of the template subpage typically used for test cases. cfg['testcases-subpage'] = 'testcases'
-- cfg['template-testcases-preload'] -- Preload file for template test cases pages. cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'
-- cfg['module-testcases-preload'] -- Preload file for Lua module test cases pages. cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'
-- cfg['testcases-link-display'] -- The text to display for "testcases" links. cfg['testcases-link-display'] = 'testcases'
-- cfg['testcases-edit-link-display'] -- The text to display for test cases "edit" links. cfg['testcases-edit-link-display'] = 'edit'
-- cfg['testcases-run-link-display'] -- The text to display for test cases "run" links. cfg['testcases-run-link-display'] = 'run'
-- cfg['testcases-create-link-display'] -- The text to display for test cases "create" links. cfg['testcases-create-link-display'] = 'create'
-- Add categories blurb configuration
--[[ -- cfg['add-categories-blurb'] -- Text to direct users to add categories to the /doc subpage. Not used if the "content" or -- "docname fed" arguments are set, as then it is not clear where to add the categories. $1 is a -- link to the /doc subpage with a display value of cfg['doc-link-display']. --]] cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'
-- cfg['doc-link-display'] -- The text to display when linking to the /doc subpage. cfg['doc-link-display'] = '/doc'
-- Subpages link configuration
--[[ -- cfg['subpages-blurb'] -- The "Subpages of this template" blurb. $1 is a link to the main template's subpages with a -- display value of cfg['subpages-link-display']. In the English version this blurb is simply -- the link followed by a period, and the link display provides the actual text. --]] cfg['subpages-blurb'] = '$1.'
--[[ -- cfg['subpages-link-display'] -- The text to display for the "subpages of this page" link. $1 is cfg['template-pagetype'], -- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in -- the template namespace, the module namespace, or another namespace. --]] cfg['subpages-link-display'] = 'Subpages of this $1'
-- cfg['template-pagetype'] -- The pagetype to display for template pages. cfg['template-pagetype'] = 'template'
-- cfg['module-pagetype'] -- The pagetype to display for Lua module pages. cfg['module-pagetype'] = 'module'
-- cfg['default-pagetype'] -- The pagetype to display for pages other than templates or Lua modules. cfg['default-pagetype'] = 'page'
-- Doc link configuration
-- cfg['doc-subpage'] -- The name of the subpage typically used for documentation pages. cfg['doc-subpage'] = 'doc'
-- cfg['file-docpage-preload'] -- Preload file for documentation page in the file namespace. cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'
-- cfg['docpage-preload'] -- Preload file for template documentation pages in all namespaces. cfg['docpage-preload'] = 'Template:Documentation/preload'
-- cfg['module-preload'] -- Preload file for Lua module documentation pages. cfg['module-preload'] = 'Template:Documentation/preload-module-doc'
-- Print version configuration
-- cfg['print-subpage'] -- The name of the template subpage used for print versions. cfg['print-subpage'] = 'Print'
-- cfg['print-link-display'] -- The text to display when linking to the /Print subpage. cfg['print-link-display'] = '/Print'
-- cfg['print-blurb'] -- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display']. cfg['print-blurb'] = 'A print version of this template exists at $1.' .. ' If you make a change to this template, please update the print version as well.'
-- cfg['display-print-category'] -- Set to true to enable output of cfg['print-category'] if a /Print subpage exists. -- This should be a boolean value (either true or false). cfg['display-print-category'] = true
-- cfg['print-category'] -- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists. cfg['print-category'] = 'Templates with print versions'
-- HTML and CSS configuration
-- cfg['main-div-id'] -- The "id" attribute of the main HTML "div" tag. cfg['main-div-id'] = 'template-documentation'
-- cfg['main-div-classes'] -- The CSS classes added to the main HTML "div" tag. cfg['main-div-classes'] = 'template-documentation iezoomfix'
-- cfg['start-box-linkclasses'] -- The CSS classes used for the [view][edit][history] or [create] links in the start box. cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks'
-- cfg['start-box-link-id'] -- The HTML "id" attribute for the links in the start box. cfg['start-box-link-id'] = 'doc_editlinks'
-- Template:Fmbox template configuration
-- cfg['fmbox-id'] -- The id sent to the "id" parameter of the Template:Fmbox template. cfg['fmbox-id'] = 'documentation-meta-data'
-- cfg['fmbox-style'] -- The value sent to the style parameter of Template:Fmbox. cfg['fmbox-style'] = 'background-color: #ecfcf4'
-- cfg['fmbox-textstyle'] -- The value sent to the "textstyle parameter of Template:Fmbox. cfg['fmbox-textstyle'] = 'font-style: italic'
-- Tracking category configuration
-- cfg['display-strange-usage-category'] -- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage -- or a /testcases subpage. This should be a boolean value (either true or false). cfg['display-strange-usage-category'] = true
-- cfg['strange-usage-category'] -- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a -- /doc subpage or a /testcases subpage. cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'
--[[
-- End configuration -- -- Don't edit anything below this line.
--]]
return cfg</text>
<sha1>6hym6c6py8yoseohy71qvk7kafcy1p5</sha1> </revision> </page> <page> <title>Module:Effective protection expiry</title> <ns>828</ns> <id>48785459</id> <revision> <id>744227741</id> <parentid>740797535</parentid> <timestamp>2016-10-13T22:30:40Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>don't error if the page isn't under PC</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1494">local p = {}
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title) return stabilitySettings and stabilitySettings.expiry or 'unknown' elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) end local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename) if rawExpiry == 'infinity' then return 'infinity' elseif rawExpiry == then return 'unknown' else local year, month, day, hour, minute, second = rawExpiry:match( '^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$' ) if year then return string.format( '%s-%s-%sT%s:%s:%s', year, month, day, hour, minute, second ) else error('internal error in Module:Effective protection expiry; malformed expiry timestamp') end end end
setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end })
return p</text>
<sha1>i1wms02y1w048cq6uttka18a5pjzp63</sha1> </revision> </page> <page> <title>Module:Effective protection level</title> <ns>828</ns> <id>41617327</id> <revision> <id>834561914</id> <parentid>713934935</parentid> <timestamp>2018-04-06T11:52:06Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>add user JSON subpage detection - see Tech News: 2018-14</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="3056">local p = {}
-- Returns the permission required to perform a given action on a given title. -- If no title is specified, the title of the page being displayed is used. function p._main(action, pagename) local title if type(pagename) == 'table' and pagename.prefixedText then title = pagename elseif pagename then title = mw.title.new(pagename) else title = mw.title.getCurrentTitle() end pagename = title.prefixedText if action == 'autoreview' then local level = mw.ext.FlaggedRevs.getStabilitySettings(title) level = level and level.autoreview if level == 'review' then return 'reviewer' elseif level ~= then return level else return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not , as that would mean PC-protected but nobody can review end elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 ) end if title.namespace == 8 then -- MediaWiki namespace return 'sysop' elseif title.namespace == 2 and title.isSubpage and ( title.contentModel == 'javascript' or title.contentModel == 'css' or title.contentModel == 'json' ) then -- user JS, CSS or JSON page return 'sysop' end local level = title.protectionLevels[action] and title.protectionLevels[action][1] if level == 'sysop' or level == 'editprotected' then return 'sysop' elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page return 'sysop' elseif level == 'templateeditor' then return 'templateeditor' elseif action == 'move' then local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move. if blacklistentry and not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif title.namespace == 6 then return 'filemover' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end end local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename) if blacklistentry then if not blacklistentry.params.autoconfirmed then return 'templateeditor' elseif level == 'extendedconfirmed' then return 'extendedconfirmed' else return 'autoconfirmed' end elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason return 'autoconfirmed' elseif level then return level elseif action == 'upload' then return 'autoconfirmed' elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts return 'user' else return '*' end end
setmetatable(p, { __index = function(t, k) return function(frame) return t._main(k, frame.args[1]) end end })
return p</text>
<sha1>ldr27zxzu0o1ofgaoty4jscx92ku0w7</sha1> </revision> </page> <page> <title>Module:File link</title> <ns>828</ns> <id>42903140</id> <revision> <id>638642222</id> <parentid>638639021</parentid> <timestamp>2014-12-18T14:05:07Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>when calling this from wikitext use a more readable error message for missing file parameters</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2544">-- This module provides a library for formatting file wikilinks.
local yesno = require('Module:Yesno') local checkType = require('libraryUtil').checkType
local p = {}
function p._main(args) checkType('_main', 1, args, 'table')
-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our -- own function to get the right error level. local function checkArg(key, val, level) if type(val) ~= 'string' then error(string.format( "type error in '%s' parameter of '_main' (expected string, got %s)", key, type(val) ), level) end end
local ret = {}
-- Adds a positional parameter to the buffer. local function addPositional(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = val end
-- Adds a named parameter to the buffer. We assume that the parameter name -- is the same as the argument key. local function addNamed(key) local val = args[key] if not val then return nil end checkArg(key, val, 4) ret[#ret + 1] = key .. '=' .. val end
-- Filename checkArg('file', args.file, 3) ret[#ret + 1] = 'File:' .. args.file
-- Format if args.format then checkArg('format', args.format) if args.formatfile then checkArg('formatfile', args.formatfile) ret[#ret + 1] = args.format .. '=' .. args.formatfile else ret[#ret + 1] = args.format end end
-- Border if yesno(args.border) then ret[#ret + 1] = 'border' end
addPositional('location') addPositional('alignment') addPositional('size') addNamed('upright') addNamed('link') addNamed('alt') addNamed('page') addNamed('class') addNamed('lang') addNamed('start') addNamed('end') addNamed('thumbtime') addPositional('caption')
return string.format('%s', table.concat(ret, '|')) end
function p.main(frame) local origArgs = require('Module:Arguments').getArgs(frame, { wrappers = 'Template:File link' }) if not origArgs.file then error("'file' parameter missing from Template:File link", 0) end
-- Copy the arguments that were passed to a new table to avoid looking up -- every possible parameter in the frame object. local args = {} for k, v in pairs(origArgs) do -- Make _BLANK a special argument to add a blank parameter. For use in -- conditional templates etc. it is useful for blank arguments to be -- ignored, but we still need a way to specify them so that we can do -- things like File:Example.png. 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:Hatnote</title> <ns>828</ns> <id>42498502</id> <revision> <id>779487706</id> <parentid>726656423</parentid> <timestamp>2017-05-09T05:20:32Z</timestamp> <contributor> <username>JJMC89</username> <id>24812038</id> </contributor> <comment>Add navigation-not-searchable class per request (also see T164781)</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="6703">--------------------------------------------------------------------------------
-- Module:Hatnote -- -- -- -- This module produces hatnote links and links to related articles. It -- -- implements the Template:Hatnote and {{format
link}} meta-templates and includes --
-- helper functions for other Lua hatnote modules. --
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local mArguments -- lazily initialise Module:Arguments local yesno -- lazily initialise Module:Yesno
local p = {}
-- Helper functions
local function getArgs(frame) -- Fetches the arguments from the parent frame. Whitespace is trimmed and -- blanks are removed. mArguments = require('Module:Arguments') return mArguments.getArgs(frame, {parentOnly = true}) end
local function removeInitialColon(s) -- Removes the initial colon from a string, if present. return s:match('^:?(.*)') end
function p.findNamespaceId(link, removeColon) -- Finds the namespace id (namespace number) of a link or a pagename. This -- function will not work if the link is enclosed in double brackets. Colons -- are trimmed from the start of the link by default. To skip colon -- trimming, set the removeColon parameter to false. checkType('findNamespaceId', 1, link, 'string') checkType('findNamespaceId', 2, removeColon, 'boolean', true) if removeColon ~= false then link = removeInitialColon(link) end local namespace = link:match('^(.-):') if namespace then local nsTable = mw.site.namespaces[namespace] if nsTable then return nsTable.id end end return 0 end
function p.formatPages(...) -- Formats a list of pages using formatLink and returns it as an array. Nil -- values are not allowed. local pages = {...} local ret = {} for i, page in ipairs(pages) do ret[i] = p._formatLink(page) end return ret end
function p.formatPageTables(...) -- Takes a list of page/display tables and returns it as a list of -- formatted links. Nil values are not allowed. local pages = {...} local links = {} for i, t in ipairs(pages) do checkType('formatPageTables', i, t, 'table') local link = t[1] local display = t[2] links[i] = p._formatLink(link, display) end return links end
function p.makeWikitextError(msg, helpLink, addTrackingCategory, title) -- Formats an error message to be returned to wikitext. If -- addTrackingCategory is not false after being returned from -- Module:Yesno, and if we are not on a talk page, a tracking category -- is added. checkType('makeWikitextError', 1, msg, 'string') checkType('makeWikitextError', 2, helpLink, 'string', true) yesno = require('Module:Yesno') title = title or mw.title.getCurrentTitle() -- Make the help link text. local helpText if helpLink then helpText = ' (help)' else helpText = end -- Make the category text. local category if not title.isTalkPage and yesno(addTrackingCategory) ~= false then category = 'Hatnote templates with errors' category = string.format( '%s:%s', mw.site.namespaces[14].name, category ) else category = end return string.format( '<strong class="error">Error: %s%s.</strong>%s', msg, helpText, category ) end
function p.disambiguate(page, disambiguator) -- Formats a page title with a disambiguation parenthetical, -- i.e. "Example" → "Example (disambiguation)". checkType('disambiguate', 1, page, 'string') checkType('disambiguate', 2, disambiguator, 'string', true) disambiguator = disambiguator or 'disambiguation' return string.format('%s (%s)', page, disambiguator) end
-- Format link -- -- Makes a wikilink from the given link and display values. Links are escaped -- with colons if necessary, and links to sections are detected and displayed -- with " § " as a separator rather than the standard MediaWiki "#". Used in -- the Template:Format hatnote link template.
function p.formatLink(frame) local args = getArgs(frame) local link = args[1] local display = args[2] if not link then return p.makeWikitextError( 'no link specified', 'Template:Format hatnote link#Errors', args.category ) end return p._formatLink(link, display) end
function p._formatLink(link, display) checkType('_formatLink', 1, link, 'string') checkType('_formatLink', 2, display, 'string', true)
-- Remove the initial colon for links where it was specified manually. link = removeInitialColon(link)
-- Find whether a faux display value has been added with the | magic -- word. if not display then local prePipe, postPipe = link:match('^(.-)|(.*)$') link = prePipe or link display = postPipe end
-- Find the display value. if not display then local page, section = link:match('^(.-)#(.*)$') if page then display = page .. ' § ' .. section end end
-- Assemble the link. if display then return string.format( '%s', string.gsub(link, '|(.*)$', ), --display overwrites manual piping display ) else return string.format('%s', link) end end
-- Hatnote -- -- Produces standard hatnote text. Implements the Template:Hatnote template.
function p.hatnote(frame) local args = getArgs(frame) local s = args[1] local options = {} if not s then return p.makeWikitextError( 'no text specified', 'Template:Hatnote#Errors', args.category ) end options.extraclasses = args.extraclasses options.selfref = args.selfref return p._hatnote(s, options) end
function p._hatnote(s, options) checkType('_hatnote', 1, s, 'string') checkType('_hatnote', 2, options, 'table', true) options = options or {} local classes = {'hatnote', 'navigation-not-searchable'} local extraclasses = options.extraclasses local selfref = options.selfref if type(extraclasses) == 'string' then classes[#classes + 1] = extraclasses end if selfref then classes[#classes + 1] = 'selfref' end return string.format( '<div role="note" class="%s">%s</div>', table.concat(classes, ' '), s ) end
return p</text>
<sha1>c5z31x97gktc3q7nnp8mf48t01l4qst</sha1> </revision> </page> <page> <title>Module:Hatnote list</title> <ns>828</ns> <id>50085079</id> <revision> <id>833955078</id> <parentid>833954678</parentid> <timestamp>2018-04-03T05:19:54Z</timestamp> <contributor> <username>Galobtter</username> <id>19502780</id> </contributor> <comment>fix</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="7209">--------------------------------------------------------------------------------
-- Module:Hatnote list -- -- -- -- This module produces and formats lists for use in hatnotes. In particular, -- -- it implements the for-see list, i.e. lists of "For X, see Y" statements, -- -- as used in Template:About, Template:Redirect, and their variants. Also introduced -- -- are andList & orList helpers for formatting lists with those conjunctions. --
local mArguments --initialize lazily local mHatnote = require('Module:Hatnote') local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local p = {}
-- List stringification helper functions -- -- These functions are used for stringifying lists, usually page lists inside -- the "Y" portion of "For X, see Y" for-see items.
--default options table used across the list stringification functions local stringifyListDefaultOptions = { conjunction = "and", separator = ",", altSeparator = ";", space = " ", formatted = false }
-- Stringifies a list generically; probably shouldn't be used directly function stringifyList(list, options) -- Type-checks, defaults, and a shortcut checkType("stringifyList", 1, list, "table") if #list == 0 then return nil end checkType("stringifyList", 2, options, "table", true) options = options or {} for k, v in pairs(stringifyListDefaultOptions) do if options[k] == nil then options[k] = v end end local s = options.space -- Format the list if requested if options.formatted then list = mHatnote.formatPages(unpack(list)) end -- Set the separator; if any item contains it, use the alternate separator local separator = options.separator --searches display text only function searchDisp(t, f) return string.find(string.sub(t, (string.find(t, '|') or 0) + 1), f) end for k, v in pairs(list) do if searchDisp(v, separator) then separator = options.altSeparator break end end -- Set the conjunction, apply Oxford comma, and force a comma if #1 has "§" local conjunction = s .. options.conjunction .. s if #list == 2 and searchDisp(list[1], "§") or #list > 2 then conjunction = separator .. conjunction end -- Return the formatted string return mw.text.listToText(list, separator .. s, conjunction) end
--DRY function function conjList (conj, list, fmt) return stringifyList(list, {conjunction = conj, formatted = fmt}) end
-- Stringifies lists with "and" or
"or"
function p.andList (...) return conjList("and", ...) end function p.orList (...) return conjList("or", ...) end
-- For see -- -- Makes a "For X, see Y." list from raw parameters. Intended for the -- Template:About and Template:Redirect templates and their variants.
--default options table used across the forSee family of functions local forSeeDefaultOptions = { andKeyword = 'and', title = mw.title.getCurrentTitle().text, otherText = 'other uses', forSeeForm = 'For %s, see %s.', }
--Collapses duplicate punctuation function punctuationCollapse (text) local replacements = { ["%.%.$"] = ".", ["%?%.$"] = "?", ["%!%.$"] = "!", ["%.%]%]%.$"] = ".]]", ["%?%]%]%.$"] = "?]]", ["%!%]%]%.$"] = "!]]" } for k, v in pairs(replacements) do text = string.gsub(text, k, v) end return text end
-- Structures arguments into a table for stringification, & options function p.forSeeArgsToTable (args, from, options) -- Type-checks and defaults checkType("forSeeArgsToTable", 1, args, 'table') checkType("forSeeArgsToTable", 2, from, 'number', true) from = from or 1 checkType("forSeeArgsToTable", 3, options, 'table', true) options = options or {} for k, v in pairs(forSeeDefaultOptions) do if options[k] == nil then options[k] = v end end -- maxArg's gotten manually because getArgs() and table.maxn aren't friends local maxArg = 0 for k, v in pairs(args) do if type(k) == 'number' and k > maxArg then maxArg = k end end -- Structure the data out from the parameter list: -- * forTable is the wrapper table, with forRow rows -- * Rows are tables of a "use" string & a "pages" table of pagename strings -- * Blanks are left empty for defaulting elsewhere, but can terminate list local forTable = {} local i = from local terminated = false -- If there is extra text, and no arguments are given, give nil value -- to not produce default of "For other uses, see foo (disambiguation)" if options.extratext and i > maxArg then return nil end -- Loop to generate rows repeat -- New empty row local forRow = {} -- On blank use, assume list's ended & break at end of this loop forRow.use = args[i] if not args[i] then terminated = true end -- New empty list of pages forRow.pages = {} -- Insert first pages item if present table.insert(forRow.pages, args[i + 1]) -- If the param after next is "and", do inner loop to collect params -- until the "and"'s stop. Blanks are ignored: "1|and||and|3" → {1, 3} while args[i + 2] == options.andKeyword do if args[i + 3] then table.insert(forRow.pages, args[i + 3]) end -- Increment to next "and" i = i + 2 end -- Increment to next use i = i + 2 -- Append the row table.insert(forTable, forRow) until terminated or i > maxArg
return forTable end
-- Stringifies a table as formatted by forSeeArgsToTable function p.forSeeTableToString (forSeeTable, options) -- Type-checks and defaults checkType("forSeeTableToString", 1, forSeeTable, "table", true) checkType("forSeeTableToString", 2, options, "table", true) options = options or {} for k, v in pairs(forSeeDefaultOptions) do if options[k] == nil then options[k] = v end end -- Stringify each for-see item into a list local strList = {} if forSeeTable then for k, v in pairs(forSeeTable) do local useStr = v.use or options.otherText local pagesStr = p.andList(v.pages, true) or mHatnote._formatLink(mHatnote.disambiguate(options.title)) local forSeeStr = string.format(options.forSeeForm, useStr, pagesStr) forSeeStr = punctuationCollapse(forSeeStr) table.insert(strList, forSeeStr) end end if options.extratext then table.insert(strList, punctuationCollapse(options.extratext..'.')) end -- Return the concatenated list return table.concat(strList, ' ') end
-- Produces a "For X, see Y" string from arguments. Expects index gaps -- but not blank/whitespace values. Ignores named args and args < "from". function p._forSee (args, from, options) local forSeeTable = p.forSeeArgsToTable(args, from, options) return p.forSeeTableToString(forSeeTable, options) end
-- As _forSee, but uses the frame. function p.forSee (frame, from, options) mArguments = require('Module:Arguments') return p._forSee(mArguments.getArgs(frame), from, options) end
return p</text>
<sha1>2hmyydi47hep0hexbh8sw7ybxc07m5k</sha1> </revision> </page> <page> <title>Module:If empty</title> <ns>828</ns> <id>44819040</id> <revision> <id>639392913</id> <parentid>639392817</parentid> <timestamp>2014-12-23T21:56:09Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>actually, only the first 8 need this check</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1018">local p = {}
function p.main(frame) local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank, -- even though there's really no legitimate use case for this. At some point, this will be removed. local lowestNil = math.huge for i = 8,1,-1 do if args[i] == nil then args[i] = lowestNil = i end end
for k,v in ipairs(args) do if v ~= then if lowestNil < k then -- If any uses of this template depend on the behavior above, add them to a tracking category. -- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified -- by it. frame:extensionTag('ref', , {group = 'TrackingCategory'}) frame:extensionTag('references', , {group = 'TrackingCategory'}) end return v end end end
return p</text>
<sha1>6qq12x2ek97w2n518wugesqunsqh778</sha1> </revision> </page> <page> <title>Module:InfoboxImage</title> <ns>828</ns> <id>38581924</id> <revision> <id>839038061</id> <parentid>769944044</parentid> <timestamp>2018-04-30T21:16:56Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>add Noimage.gif to placeholder list</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="9657">-- Inputs:
-- image - Can either be a bare filename (with or without the File:/Image: prefix) or a fully formatted image link -- page - page to display for multipage images (DjVu) -- size - size to display the image -- maxsize - maximum size for image -- sizedefault - default size to display the image if size param is blank -- alt - alt text for image -- title - title text for image -- border - set to yes if border -- center - set to yes, if the image has to be centered -- upright - upright image param -- suppressplaceholder - if yes then checks to see if image is a placeholder and suppresses it -- link - page to visit when clicking on image -- Outputs: -- Formatted image. -- More details available at the "Module:InfoboxImage/doc" page
local i = {};
local placeholder_image = {
"Blue - Replace this image female.svg", "Blue - Replace this image male.svg", "Female no free image yet.png", "Flag of None (square).svg", "Flag of None.svg", "Flag of.svg", "Green - Replace this image female.svg", "Green - Replace this image male.svg", "Image is needed female.svg", "Image is needed male.svg", "Location map of None.svg", "Male no free image yet.png", "Missing flag.png", "No flag.svg", "No free portrait.svg", "No portrait (female).svg", "No portrait (male).svg", "Red - Replace this image female.svg", "Red - Replace this image male.svg", "Replace this image female (blue).svg", "Replace this image female.svg", "Replace this image male (blue).svg", "Replace this image male.svg", "Silver - Replace this image female.svg", "Silver - Replace this image male.svg", "Replace this image.svg",
"Cricket no pic.png", "CarersLogo.gif", "Diagram Needed.svg", "Example.jpg", "Image placeholder.png", "No male portrait.svg", "Nocover-upload.png", "NoDVDcover copy.png", "Noribbon.svg", "No portrait-BFD-test.svg", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Sin bandera.svg", "Sin escudo.svg", "Replace this image - temple.png", "Replace this image butterfly.png", "Replace this image.svg", "Replace this image1.svg", "Resolution angle.png", "Image-No portrait-text-BFD-test.svg", "Insert image here.svg", "No image available.png", "NO IMAGE YET square.png", "NO IMAGE YET.png", "No Photo Available.svg", "No
Screenshot.svg",
"No-image-available.jpg", "Null.png", "PictureNeeded.gif", "Place holder.jpg", "Unbenannt.JPG", "UploadACopyrightFreeImage.svg", "UploadAnImage.gif", "UploadAnImage.svg", "UploadAnImageShort.svg", "CarersLogo.gif", "Diagram Needed.svg", "No male portrait.svg", "NoDVDcover copy.png", "Placeholder barnstar ribbon.png", "Project Trains no image.png", "Image-request.png", "Noimage.gif", }
function i.IsPlaceholder(image)
-- change underscores to spaces image = mw.ustring.gsub(image, "_", " "); assert(image ~= nil, 'mw.ustring.gsub(image, "_", " ") must not return nil') -- if image starts with [[then remove that and anything after | if mw.ustring.sub(image,1,2) == "[[" then image = mw.ustring.sub(image,3); image = mw.ustring.gsub(image, "([^|]*)|.*", "%1"); assert(image ~= nil, 'mw.ustring.gsub(image, "([^|]*)|.*", "%1") must not return nil') end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); assert(image ~= nil, "mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1') must not return nil") -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end -- Trim spaces image = mw.ustring.gsub(image, '^[ ]*(.-)[ ]*$', '%1'); -- capitalise first letter image = mw.ustring.upper(mw.ustring.sub(image,1,1)) .. mw.ustring.sub(image,2);
for i,j in pairs(placeholder_image) do if image == j then return true end end return false
end
function i.InfoboxImage(frame)
local image = frame.args["image"]; if image == "" or image == nil then return ""; end if image == " " then return image; end if frame.args["suppressplaceholder"] ~= "no" then if i.IsPlaceholder(image) == true then return ""; end end
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[[http:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,7)) == "[https:" then return ""; end if mw.ustring.lower(mw.ustring.sub(image,1,8)) == "[[https:" then return ""; end
if mw.ustring.sub(image,1,2) == "[[" then -- search for thumbnail images and add to tracking cat if found if mw.title.getCurrentTitle().namespace == 0 and (mw.ustring.find(image, "|%s*thumb%s*[|%]]") or mw.ustring.find(image, "|%s*thumbnail%s*[|%]]")) then return image .. ""; elseif mw.title.getCurrentTitle().namespace == 0 then return image .. ""; else return image; end elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then return image; elseif mw.ustring.sub(image,1,1) == "<" then return image; elseif mw.ustring.sub(image,1,5) == mw.ustring.char(127).."UNIQ" then -- Found strip marker at begining, so pass don't process at all return image; elseif mw.ustring.sub(image,4,9) == "`UNIQ-" then -- Found strip marker at begining, so pass don't process at all return image; else local result = ""; local page = frame.args["page"]; local size = frame.args["size"]; local maxsize = frame.args["maxsize"]; local sizedefault = frame.args["sizedefault"]; local alt = frame.args["alt"]; local link = frame.args["link"]; local title = frame.args["title"]; local border = frame.args["border"]; local upright = frame.args["upright"] or ""; local thumbtime = frame.args["thumbtime"] or ""; local center= frame.args["center"]; -- remove prefix if exists local allNames = mw.site.namespaces[6].aliases allNames[#allNames + 1] = mw.site.namespaces[6].name allNames[#allNames + 1] = mw.site.namespaces[6].canonicalName for i, name in ipairs(allNames) do if mw.ustring.lower(mw.ustring.sub(image, 1, mw.ustring.len(name) + 1)) == mw.ustring.lower(name .. ":") then image = mw.ustring.sub(image, mw.ustring.len(name) + 2); break end end if maxsize ~= "" and maxsize ~= nil then -- if no sizedefault then set to maxsize if sizedefault == "" or sizedefault == nil then sizedefault = maxsize end -- check to see if size bigger than maxsize if size ~= "" and size ~= nil then local sizenumber = tonumber(mw.ustring.match(size,"%d*")) or 0; local maxsizenumber = tonumber(mw.ustring.match(maxsize,"%d*")) or 0; if sizenumber>maxsizenumber and maxsizenumber>0 then size = maxsize; end end end -- add px to size if just a number if (tonumber(size) or 0) > 0 then size = size .. "px"; end -- add px to sizedefault if just a number if (tonumber(sizedefault) or 0) > 0 then sizedefault = sizedefault .. "px"; end result = "[[File:" .. image; if page ~= "" and page ~= nil then result = result .. "|page=" .. page; end if size ~= "" and size ~= nil then result = result .. "|" .. size; elseif sizedefault ~= "" and sizedefault ~= nil then result = result .. "|" .. sizedefault; else result = result .. "|frameless"; end if center == "yes" then result = result .. "|center" end if alt ~= "" and alt ~= nil then result = result .. "|alt=" .. alt; end if link ~= "" and link ~= nil then result = result .. "|link=" .. link; end if border == "yes" then result = result .. "|border"; end if upright == "yes" then result = result .. "|upright"; elseif upright ~= "" then result = result .. "|upright=" .. upright; end if thumbtime ~= "" then result = result .. "|thumbtime=" .. thumbtime; end if title ~= "" and title ~= nil then result = result .. "|" .. title; elseif alt ~= "" and alt ~= nil then result = result .. "|" .. alt; end result = result .. "]]"; return result; end
end
return i;</text>
<sha1>qtnddjnyefntigkcp7xwqp47j23hao6</sha1> </revision> </page> <page> <title>Module:Labelled list hatnote</title> <ns>828</ns> <id>50971703</id> <revision> <id>763259375</id> <parentid>745988142</parentid> <timestamp>2017-02-02T05:26:53Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <minor/> <comment>Protected "Module:Labelled list hatnote": Highly visible template ([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="3083">--------------------------------------------------------------------------------
-- Labelled list -- -- -- -- This module does the core work of creating a hatnote composed of a list -- -- prefixed by a colon-terminated label, i.e. "LABEL: [andList of pages]", -- -- for Template:See also and similar templates. --
local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mArguments --initialize lazily local p = {}
-- Defaults global to this module local defaults = { label = 'See also', --Final fallback
for label argument
labelForm = '%s: %s', prefixes = {'label', 'label ', 'l'}, template = 'Module:Labelled list hatnote' }
-- Helper function that pre-combines display parameters into page arguments. -- Also compresses sparse arrays, as a desirable side-effect. function p.preprocessDisplays (args, prefixes) -- Prefixes specify which parameters, in order, to check for display options -- They each have numbers auto-appended, e.g. 'label1', 'label 1', & 'l1' prefixes = prefixes or defaults.prefixes local pages = {} for k, v in pairs(args) do if type(k) == 'number' then local display for i = 1, #prefixes do display = args[prefixes[i] .. k] if display then break end end local page = display and string.format('%s|%s', string.gsub(v, '|.*$', ), display) or v pages[#pages + 1] = page end end return pages end
-- Produces a labelled pages-list hatnote. -- The main frame (template definition) takes 1 or 2 arguments, for a singular -- and (optionally) plural label respectively: -- * Script error: No such module "Labelled list hatnote". -- The resulting template takes pagename & label parameters normally. function p.labelledList (frame) mArguments = require('Module:Arguments') local labels = {frame.args[1] or defaults.label} labels[2] = frame.args[2] or labels[1] local template = frame:getParent():getTitle() local args = mArguments.getArgs(frame, {parentOnly = true}) local pages = p.preprocessDisplays(args) local options = { extraclasses = frame.args.extraclasses, category = args.category, selfref = frame.args.selfref or args.selfref, template = template } return p._labelledList(pages, labels, options) end
function p._labelledList (pages, labels, options) labels = labels or {} if #pages == 0 then return mHatnote.makeWikitextError( 'no page names specified', (options.template or defaults.template) .. '#Errors', options.category ) end label = (#pages == 1 and labels[1] or labels[2]) or defaults.label local text = string.format( options.labelForm or defaults.labelForm, label, mHatlist.andList(pages, true) ) local hnOptions = { extraclasses = options.extraclasses, selfref = options.selfref } return mHatnote._hatnote(text, hnOptions) end
return p</text>
<sha1>932zychfwl5xu5castj2k9j5qs6lzif</sha1> </revision> </page> <page> <title>Module:Main</title> <ns>828</ns> <id>42570919</id> <revision> <id>727437646</id> <parentid>727363620</parentid> <timestamp>2016-06-29T00:34:26Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Removed extraclasses option; those classes appear to be deprecated</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2239">--[[
-- This module produces a link to a main article or articles. It implements the -- template Template:Main. -- -- If the module is used in category or category talk space, it produces "The -- main article for this category is xxx". Otherwise, it produces -- "Main article: xxx". --]]
local mHatnote = require('Module:Hatnote') local mHatlist = require('Module:Hatnote list') local mArguments -- lazily initialise local p = {}
function p.main(frame) mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {parentOnly = true}) local pages = {} for k, v in pairs(args) do if type(k) == 'number' then local display = args['label ' .. k] or args['l' .. k] local page = display and string.format('%s|%s', string.gsub(v, '|.*$', ), display) or v pages[#pages + 1] = page end end if #pages == 0 and mw.title.getCurrentTitle().namespace == 0 then return mHatnote.makeWikitextError( 'no page names specified', 'Template:Main#Errors', args.category ) end local options = { selfref = args.selfref } return p._main(pages, options) end
function p._main(args, options) -- Get the list of pages. If no first page was specified we use the current -- page name. local currentTitle = mw.title.getCurrentTitle() if #args == 0 then args = {currentTitle.text} end local firstPage = string.gsub(args[1], '|.*$', ) -- Find the pagetype. local pageType = mHatnote.findNamespaceId(firstPage) == 0 and 'article' or 'page' -- Make the formatted link text list = mHatlist.andList(args, true) -- Build the text. local isPlural = #args > 1 local mainForm local curNs = currentTitle.namespace if (curNs == 14) or (curNs == 15) then --category/talk namespaces mainForm = isPlural and 'The main %ss for this category are %s' or 'The main %s for this category is %s' else mainForm = isPlural and 'Main %ss: %s' or 'Main %s: %s' end local text = string.format(mainForm, pageType, list) -- Process the options and pass the text to the _rellink function in -- Module:Hatnote. options = options or {} local hnOptions = { selfref = options.selfref } return mHatnote._hatnote(text, hnOptions) end
return p</text>
<sha1>9iplsr5jg1vj2lm6dkuiqtfon8648ne</sha1> </revision> </page> <page> <title>Module:Message box</title> <ns>828</ns> <id>40574910</id> <revision> <id>835732555</id> <parentid>803399820</parentid> <timestamp>2018-04-10T12:58:17Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>ony load Category handler when needed, requested on talk page</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="17101">-- This is a meta-module for producing message box templates, including
-- Template:Mbox, Template:Ambox, Template:Imbox, Template:Tmbox, Template:Ombox, Template:Cmbox and Template:Fmbox.
-- Load necessary modules. require('Module:No globals') local getArgs local yesno = require('Module:Yesno')
-- Get a language object for formatDate and ucfirst. local lang = mw.language.getContentLanguage()
-- Define constants local CONFIG_MODULE = 'Module:Message box/configuration'
-- Helper functions
local function getTitleObject(...) -- Get the title object, passing the function through pcall -- in case we are over the expensive function count limit. local success, title = pcall(mw.title.new, ...) if success then return title end end
local function union(t1, t2) -- Returns the union of two arrays. local vals = {} for i, v in ipairs(t1) do vals[v] = true end for i, v in ipairs(t2) do vals[v] = true end local ret = {} for k in pairs(vals) do table.insert(ret, k) end table.sort(ret) return ret end
local function getArgNums(args, prefix) local nums = {} for k, v in pairs(args) do local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$') if num then table.insert(nums, tonumber(num)) end end table.sort(nums) return nums end
-- Box class definition
local MessageBox = {} MessageBox.__index = MessageBox
function MessageBox.new(boxType, args, cfg) args = args or {} local obj = {}
-- Set the title object and the namespace. obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()
-- Set the config for our box type. obj.cfg = cfg[boxType] if not obj.cfg then local ns = obj.title.namespace -- boxType is "mbox" or invalid input if ns == 0 then obj.cfg = cfg.ambox -- main namespace elseif ns == 6 then obj.cfg = cfg.imbox -- file namespace elseif ns == 14 then obj.cfg = cfg.cmbox -- category namespace else local nsTable = mw.site.namespaces[ns] if nsTable and nsTable.isTalk then obj.cfg = cfg.tmbox -- any talk namespace else obj.cfg = cfg.ombox -- other namespaces or invalid input end end end
-- Set the arguments, and remove all blank arguments except for the ones -- listed in cfg.allowBlankParams. do local newArgs = {} for k, v in pairs(args) do if v ~= then newArgs[k] = v end end for i, param in ipairs(obj.cfg.allowBlankParams or {}) do newArgs[param] = args[param] end obj.args = newArgs end
-- Define internal data structure. obj.categories = {} obj.classes = {} -- For lazy loading of Module:Category handler. obj.hasCategories = false
return setmetatable(obj, MessageBox) end
function MessageBox:addCat(ns, cat, sort) if not cat then return nil end if sort then cat = string.format(, cat, sort) else cat = string.format(, cat) end self.hasCategories = true self.categories[ns] = self.categories[ns] or {} table.insert(self.categories[ns], cat) end
function MessageBox:addClass(class) if not class then return nil end table.insert(self.classes, class) end
function MessageBox:setParameters() local args = self.args local cfg = self.cfg
-- Get type data. self.type = args.type local typeData = cfg.types[self.type] self.invalidTypeError = cfg.showInvalidTypeError and self.type and not typeData typeData = typeData or cfg.types[cfg.default] self.typeClass = typeData.class self.typeImage = typeData.image
-- Find if the box has been wrongly substituted. self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'
-- Find whether we are using a small message box. self.isSmall = cfg.allowSmall and ( cfg.smallParam and args.small == cfg.smallParam or not cfg.smallParam and yesno(args.small) )
-- Add attributes, classes and styles. self.id = args.id if yesno(args.plainlinks) ~=
false then
self:addClass('plainlinks') end for _, class in ipairs(cfg.classes or {}) do self:addClass(class) end if self.isSmall then self:addClass(cfg.smallClass or 'mbox-small') end self:addClass(self.typeClass) self:addClass(args.class) self.style = args.style self.attrs = args.attrs
-- Set text style. self.textstyle = args.textstyle
-- Find if we are on the template page or not. This functionality is only -- used if useCollapsibleTextFields is set, or if both cfg.templateCategory -- and cfg.templateCategoryRequireName are set. self.useCollapsibleTextFields = cfg.useCollapsibleTextFields if self.useCollapsibleTextFields or cfg.templateCategory and cfg.templateCategoryRequireName then self.name = args.name if self.name then local templateName = mw.ustring.match( self.name, '^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$' ) or self.name templateName = 'Template:' .. templateName self.templateTitle = getTitleObject(templateName) end self.isTemplatePage = self.templateTitle and mw.title.equals(self.title, self.templateTitle) end
-- Process data for collapsible text fields. At the moment these are only -- used in Template: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.', talkText, talk, talkTitle.prefixedText ) else talkText = string.format( '%s the talk page.', talkText, talkTitle.prefixedText, talk ) end self.talk = talkText end end
-- Get other values. self.fix = args.fix ~= and args.fix or nil local date if args.date and args.date ~= then date = args.date elseif args.date == and self.isTemplatePage then date = lang:formatDate('F Y') end if date then self.date = string.format(" <small>(%s)</small>", date) end self.info = args.info if yesno(args.removalnotice) then self.removalNotice = cfg.removalNotice end end
-- Set the non-collapsible text field. At the moment this is used by all box -- types other than ambox, and also by ambox when small=yes. if self.isSmall then self.text = args.smalltext or args.text else self.text = args.text end
-- Set the below row. self.below = cfg.below and args.below
-- General image settings. self.imageCellDiv = not self.isSmall and cfg.imageCellDiv self.imageEmptyCell = cfg.imageEmptyCell if cfg.imageEmptyCellStyle then self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px' end
-- Left image settings. local imageLeft = self.isSmall and args.smallimage or args.image if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none' or not cfg.imageCheckBlank and imageLeft ~= 'none' then self.imageLeft = imageLeft if not imageLeft then local imageSize = self.isSmall and (cfg.imageSmallSize or '30x30px') or '40x40px' self.imageLeft = string.format('%s', 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 Template:Ambox/category. local date = args.date date = type(date) == 'string' and date local preposition = 'from' for _, num in ipairs(nums) do local mainCat = args['cat' .. tostring(num)] or args['category' .. tostring(num)] local allCat = args['all' .. tostring(num)] mainCat = type(mainCat) == 'string' and mainCat allCat = type(allCat) == 'string' and allCat if mainCat and date and date ~= then local catTitle = string.format('%s %s %s', mainCat, preposition, date) self:addCat(0, catTitle) catTitle = getTitleObject('Category:' .. catTitle) if not catTitle or not catTitle.exists then self:addCat(0, 'Articles with invalid date parameter in template') end elseif mainCat and (not date or date == ) then self:addCat(0, mainCat) end if allCat then self:addCat(0, allCat) end end end
function MessageBox:setTemplateCategories() local args = self.args local cfg = self.cfg
-- Add template categories. if cfg.templateCategory then if cfg.templateCategoryRequireName then if self.isTemplatePage then self:addCat(10, cfg.templateCategory) end elseif not self.title.isSubpage then self:addCat(10, cfg.templateCategory) end end
-- Add template error categories. if cfg.templateErrorCategory then local templateErrorCategory = cfg.templateErrorCategory local templateCat, templateSort if not self.name and not self.title.isSubpage then templateCat = templateErrorCategory elseif self.isTemplatePage then local paramsToCheck = cfg.templateErrorParamsToCheck or {} local count = 0 for i, param in ipairs(paramsToCheck) do if not args[param] then count = count + 1 end end if count > 0 then templateCat = templateErrorCategory templateSort = tostring(count) end if self.categoryNums and #self.categoryNums > 0 then templateCat = templateErrorCategory templateSort = 'C' end end self:addCat(10, templateCat, templateSort) end end
function MessageBox:setAllNamespaceCategories() -- Set categories for all namespaces. if self.invalidTypeError then local allSort = (self.title.namespace == 0 and 'Main:' or ) .. self.title.prefixedText self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort) end if self.isSubstituted then self:addCat('all', 'Pages with incorrectly substituted templates') end end
function MessageBox:setCategories() if self.title.namespace == 0 then self:setMainspaceCategories() elseif self.title.namespace == 10 then self:setTemplateCategories() end self:setAllNamespaceCategories() end
function MessageBox:renderCategories() if not self.hasCategories then -- No categories added, no need to pass them to Category handler so, -- if it was invoked, it would return the empty string. -- So we shortcut and return the empty string. return "" end -- Convert category tables to strings and pass them through -- Module:Category handler. return require('Module:Category handler')._main{ main = table.concat(self.categories[0] or {}), template = table.concat(self.categories[10] or {}), all = table.concat(self.categories.all or {}), nocat = self.args.nocat, page = self.args.page } end
function MessageBox:export() local root = mw.html.create()
-- Add the subst check error. if self.isSubstituted and self.name then root:tag('b') :addClass('error') :wikitext(string.format( 'Template <code>%s%s%s</code> has been incorrectly substituted.', mw.text.nowiki('Template:'), self.name, self.name, mw.text.nowiki('') )) end
-- Create the box table. local boxTable = root:tag('table') boxTable:attr('id', self.id or nil) for i, class in ipairs(self.classes or {}) do boxTable:addClass(class or nil) end boxTable :cssText(self.style or nil) :attr('role', 'presentation')
if self.attrs then boxTable:attr(self.attrs) end
-- Add the left-hand image. local row = boxTable:tag('tr') if self.imageLeft then local imageLeftCell = row:tag('td'):addClass('mbox-image') if self.imageCellDiv then -- If we are using a div, redefine imageLeftCell so that the image -- is inside it. Divs use style="width: 52px;", which limits the -- image width to 52px. If any images in a div are wider than that, -- they may overlap with the text or cause other display problems. imageLeftCell = imageLeftCell:tag('div'):css('width', '52px') end imageLeftCell:wikitext(self.imageLeft or nil) elseif self.imageEmptyCell then -- Some message boxes define an empty cell if no image is specified, and -- some don't. The old template code in templates where
empty cells are
-- specified gives the following hint: "No image. Cell with some width -- or padding necessary for text cell to have 100% width." row:tag('td') :addClass('mbox-empty-cell') :cssText(self.imageEmptyCellStyle or nil) end
-- Add the text. local textCell = row:tag('td'):addClass('mbox-text') if self.useCollapsibleTextFields then -- The message box uses advanced text parameters that allow things to be -- collapsible. At the moment, only ambox uses this. textCell:cssText(self.textstyle or nil) local textCellDiv = textCell:tag('div') textCellDiv :addClass('mbox-text-span') :wikitext(self.issue or nil) if (self.talk or self.fix) and not self.isSmall then textCellDiv:tag('span') :addClass('hide-when-compact') :wikitext(self.talk and (' ' .. self.talk) or nil) :wikitext(self.fix and (' ' .. self.fix) or nil) end textCellDiv:wikitext(self.date and (' ' .. self.date) or nil) if self.info and not self.isSmall then textCellDiv :tag('span') :addClass('hide-when-compact') :wikitext(self.info and (' ' .. self.info) or nil) end if self.removalNotice then textCellDiv:tag('small') :addClass('hide-when-compact') :tag('i') :wikitext(string.format(" (%s)", self.removalNotice)) end else -- Default text formatting - anything goes. textCell :cssText(self.textstyle or nil) :wikitext(self.text or nil) end
-- Add the right-hand image. if self.imageRight then local imageRightCell = row:tag('td'):addClass('mbox-imageright') if self.imageCellDiv then -- If we are using a div, redefine imageRightCell so that the image -- is inside it. imageRightCell = imageRightCell:tag('div'):css('width', '52px') end imageRightCell :wikitext(self.imageRight or nil) end
-- Add the below row. if self.below then boxTable:tag('tr') :tag('td') :attr('colspan', self.imageRight and '3' or '2') :addClass('mbox-text') :cssText(self.textstyle or nil) :wikitext(self.below or nil) end
-- Add error message for invalid type parameters. if self.invalidTypeError then root:tag('div') :css('text-align', 'center') :wikitext(string.format( 'This message box is using an invalid "type=%s" parameter and needs fixing.', self.type or )) end
-- Add categories. root:wikitext(self:renderCategories() or nil)
return tostring(root) end
-- Exports
local p, mt = {}, {}
function p._exportClasses() -- For testing. return { MessageBox = MessageBox } end
function p.main(boxType, args, cfgTables) local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE)) box:setParameters() box:setCategories() return box:export() end
function mt.__index(t, k) return function (frame) if not getArgs then getArgs = require('Module:Arguments').getArgs end return t.main(k, getArgs(frame, {trim = false, removeBlanks = false})) end end
return setmetatable(p, mt)</text>
<sha1>6r6gh40ujwjmoo5h9kc5j9ytuxwrvvy</sha1> </revision> </page> <page> <title>Module:Message box/configuration</title> <ns>828</ns> <id>40627038</id> <revision> <id>742383738</id> <parentid>717357572</parentid> <timestamp>2016-10-03T11:04:13Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>allow all templates to disable the plainlinks class</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="6091">--------------------------------------------------------------------------------
-- Message box configuration -- -- -- -- This module contains configuration data for Module:Message box. --
return { ambox = { types = { speedy = { class = 'ambox-speedy', image = 'Ambox warning pn.svg' }, delete = { class = 'ambox-delete', image = 'Ambox warning pn.svg' }, content = { class = 'ambox-content', image = 'Ambox important.svg' }, style = { class = 'ambox-style', image = 'Edit-clear.svg' }, move = { class = 'ambox-move', image = 'Merge-split-transwiki default.svg' }, protection = { class = 'ambox-protection', image = 'Padlock-silver-medium.svg' }, notice = { class = 'ambox-notice', image = 'Information icon4.svg' } }, default = 'notice', allowBlankParams = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'}, allowSmall = true, smallParam = 'left', smallClass = 'mbox-small-left', substCheck = true, classes = {'metadata', 'ambox'}, imageEmptyCell = true, imageCheckBlank = true, imageSmallSize = '20x20px', imageCellDiv = true, useCollapsibleTextFields = true, imageRightNone = true, sectionDefault = 'article', allowMainspaceCategories = true, templateCategory = 'Article message templates', templateCategoryRequireName = true, templateErrorCategory = 'Article message templates with missing parameters', templateErrorParamsToCheck = {'issue', 'fix', 'subst'}, removalNotice = '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:MultiReplace</title> <ns>828</ns> <id>51070180</id> <revision> <id>838829574</id> <parentid>838232284</parentid> <timestamp>2018-04-29T15:19:30Z</timestamp> <contributor> <username>Petr Matas</username> <id>1050951</id> </contributor> <comment>Allow a call from Lua without curly braces</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="1424">p = {}
local function MultiReplace(args) local input = args[1] or "{{{1}}}" local plain = args.plain == "yes"
local i = 1 local changeList = {} while args[i * 2] do local change = {pattern = args[i * 2], repl = args[i * 2 + 1]} if not change.repl then return require('Module:Error').error{ 'MultiReplace: Unpaired argument: <code>' .. (i * 2) .. ' = ' .. change.pattern .. '</code>' } end changeList[i] = change i = i + 1 end
local matchList = {} local pos = 1 local len = mw.ustring.len(input) local result = "" while pos <= len do local bestStart = len + 1 local bestStop = len local bestChange for _, change in ipairs(changeList) do local start, stop = mw.ustring.find(input, change.pattern, pos, plain) if start and (start < bestStart) then bestStart = start bestStop = stop bestChange = change end end result = result .. mw.ustring.sub(input, pos, bestStart - 1) if bestChange then local fragment = mw.ustring.sub(input, bestStart, bestStop) result = result .. (plain and bestChange.repl or mw.ustring.gsub(fragment, bestChange.pattern, bestChange.repl, 1)) end pos = bestStop + 1 end return result end
function p.main(frame, ...) local args = type(frame) ~= 'table' and {frame, ...} or type(frame.args) ~= 'table' and frame or frame.args[1] and frame.args or frame:getParent().args return MultiReplace(args) end
return p</text>
<sha1>95xnv3yvolixngufi1jdsiwnf7fdf62</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 Template:Pp-meta and its daughter templates such as
-- Template:Pp-dispute, Template:Pp-vandalism and Template: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', mw.site.namespaces[14].name, cat, sort ) end end
-- Validation function for the expiry and the protection date local function validateDate(dateString, dateType) if not lang then lang = mw.language.getContentLanguage() end local success, result = pcall(lang.formatDate, lang, 'U', dateString) if success then result = tonumber(result) if result then return result end end error(string.format( 'invalid %s: %s', dateType, tostring(dateString) ), 4) end
local function makeFullUrl(page, query, display) return string.format( '[%s %s]', tostring(mw.uri.fullUrl(page, query)), display ) end
-- Given a directed graph formatted as node -> table of direct successors, -- get a table of all nodes reachable from a given node (though always -- including the given node). local function getReachableNodes(graph, start) local toWalk, retval = {[start] = true}, {} while true do -- Can't use pairs() since we're adding and removing things as we're iterating local k = next(toWalk) -- This always gets the "first" key if k == nil then return retval end toWalk[k] = nil retval[k] = true for _,v in ipairs(graph[k]) do if not retval[v] then toWalk[v] = true end end end end
-- Protection class
local Protection = {} Protection.__index = Protection
Protection.supportedActions = { edit = true, move = true, autoreview = true, upload = true }
Protection.bannerConfigFields = { 'text', 'explanation', 'tooltip', 'alt', 'link', 'image' }
function Protection.new(args, cfg, title) local obj = {} obj._cfg = cfg obj.title = title or mw.title.getCurrentTitle()
-- Set action if not args.action then obj.action = 'edit' elseif Protection.supportedActions[args.action] then obj.action = args.action else error(string.format( 'invalid action: %s', tostring(args.action) ), 3) end
-- Set level obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title) if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then -- Users need to be autoconfirmed to move pages anyway, so treat -- semi-move-protected pages as unprotected. obj.level = '*' end
-- Set expiry local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title) if effectiveExpiry == 'infinity' then obj.expiry = 'indef' elseif effectiveExpiry ~= 'unknown' then obj.expiry = validateDate(effectiveExpiry, 'expiry date') end
-- Set reason if args[1] then obj.reason = mw.ustring.lower(args[1]) if obj.reason:find('|') then error('reasons cannot contain the pipe character ("|")', 3) end end
-- Set protection date if args.date then obj.protectionDate = validateDate(args.date, 'protection date') end
-- Set banner config do obj.bannerConfig = {} local configTables = {} if cfg.banners[obj.action] then configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason] end if cfg.defaultBanners[obj.action] then configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level] configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default end configTables[#configTables + 1] = cfg.masterBanner for i, field in ipairs(Protection.bannerConfigFields) do for j, t in ipairs(configTables) do if t[field] then obj.bannerConfig[field] = t[field] break end end end end return setmetatable(obj, Protection) end
function Protection:isProtected() return self.level ~= '*' end
function Protection:isTemporary() return type(self.expiry) == 'number' end
function Protection:makeProtectionCategory() local cfg = self._cfg local title = self.title
-- Exit if the page is not protected. if not self:isProtected() then return end
-- Get the expiry key fragment. local expiryFragment if self.expiry == 'indef' then expiryFragment = self.expiry elseif type(self.expiry) == 'number' then expiryFragment = 'temp' end
-- Get the namespace key fragment. local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace] if not namespaceFragment and title.namespace % 2 == 1 then namespaceFragment = 'talk' end
-- Define the order that key fragments are tested in. This is done with an -- array of tables containing the value to be tested, along with its -- position in the cfg.protectionCategories table. local order = { {val = expiryFragment, keypos = 1}, {val = namespaceFragment, keypos = 2}, {val = self.reason, keypos = 3}, {val = self.level, keypos = 4}, {val = self.action, keypos = 5} }
--[[ -- The old protection templates used an ad-hoc protection category system, -- with some templates prioritising namespaces in their categories, and -- others prioritising the protection reason. To emulate this in this module -- we use the config table cfg.reasonsWithNamespacePriority to set the -- reasons for which namespaces have priority over protection reason. -- If we are dealing with one of those reasons, move the namespace table to -- the end of the order table, i.e. give it highest priority. If not, the -- reason should have highest priority, so move that to the end of the table -- instead. --]] table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))
--[[
-- Define the attempt order. Inactive subtables (subtables with nil "value"
-- fields) are moved to the end, where they will later be given the key
-- "all". This is to cut down on the number of table lookups in
-- cfg.protectionCategories, which grows exponentially with the number of
-- non-nil keys. We keep track of the number of active subtables with the
-- noActive parameter.
--]]
local noActive, attemptOrder
do
local active, inactive = {}, {}
for i, t in ipairs(order) do
if t.val then
active[#active + 1] = t
else
inactive[#inactive + 1] = t
end
end
noActive = #active
attemptOrder = active
for i, t in ipairs(inactive) do
attemptOrder[#attemptOrder + 1] = t
end
end
--[[ -- Check increasingly generic key combinations until we find a match. If a -- specific category exists for the combination of key fragments we are -- given, that match will be found first. If not, we keep trying different -- key fragment combinations until we match using the key -- "all-all-all-all-all". -- -- To generate the keys, we index the key subtables using a binary matrix -- with indexes i and j. j is only calculated up to the number of active -- subtables. For example, if there were three active subtables, the matrix -- would look like this, with 0 corresponding to the key fragment "all", and -- 1 corresponding to other key fragments. -- -- j 1 2 3 -- i -- 1 1 1 1 -- 2 0 1 1 -- 3 1 0 1 -- 4 0 0 1 -- 5 1 1 0 -- 6 0 1 0 -- 7 1 0 0 -- 8 0 0 0 -- -- Values of j higher than the number of active subtables are set -- to the string "all". -- -- A key for cfg.protectionCategories is constructed for each value of i. -- The position of the value in the key is determined by the keypos field in -- each subtable. --]] local cats = cfg.protectionCategories for i = 1, 2^noActive do local key = {} for j, t in ipairs(attemptOrder) do if j > noActive then key[t.keypos] = 'all' else local quotient = i / 2 ^ (j - 1) quotient = math.ceil(quotient) if quotient % 2 == 1 then key[t.keypos] = t.val else key[t.keypos] = 'all' end end end key = table.concat(key, '|') local attempt = cats[key] if attempt then return makeCategoryLink(attempt, title.text) end end return end
function Protection:isIncorrect() local expiry = self.expiry return not self:isProtected() or type(expiry) == 'number' and expiry < os.time() end
function Protection:isTemplateProtectedNonTemplate() local action, namespace = self.action, self.title.namespace return self.level == 'templateeditor' and ( (action ~= 'edit' and action ~= 'move') or (namespace ~= 10 and namespace ~= 828) ) end
function Protection:makeCategoryLinks() local msg = self._cfg.msg local ret = { self:makeProtectionCategory() } if self:isIncorrect() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-incorrect'], self.title.text ) end if self:isTemplateProtectedNonTemplate() then ret[#ret + 1] = makeCategoryLink( msg['tracking-category-template'], self.title.text ) end return table.concat(ret) end
-- Blurb class
local Blurb = {} Blurb.__index = Blurb
Blurb.bannerTextFields = { text = true, explanation = true, tooltip = true, alt = true, link = true }
function Blurb.new(protectionObj, args, cfg) return setmetatable({ _cfg = cfg, _protectionObj = protectionObj, _args = args }, Blurb) end
-- Private methods --
function Blurb:_formatDate(num) -- Formats a Unix timestamp into dd Month, YYYY format. lang = lang or mw.language.getContentLanguage() local success, date = pcall( lang.formatDate, lang, self._cfg.msg['expiry-date-format'] or 'j F Y', '@' .. tostring(num) ) if success then return date end end
function Blurb:_getExpandedMessage(msgKey) return self:_substituteParameters(self._cfg.msg[msgKey]) end
function Blurb:_substituteParameters(msg) if not self._params then local parameterFuncs = {}
parameterFuncs.CURRENTVERSION = self._makeCurrentVersionParameter parameterFuncs.EDITREQUEST = self._makeEditRequestParameter parameterFuncs.EXPIRY = self._makeExpiryParameter parameterFuncs.EXPLANATIONBLURB = self._makeExplanationBlurbParameter parameterFuncs.IMAGELINK = self._makeImageLinkParameter parameterFuncs.INTROBLURB = self._makeIntroBlurbParameter parameterFuncs.INTROFRAGMENT = self._makeIntroFragmentParameter parameterFuncs.PAGETYPE = self._makePagetypeParameter parameterFuncs.PROTECTIONBLURB = self._makeProtectionBlurbParameter parameterFuncs.PROTECTIONDATE = self._makeProtectionDateParameter parameterFuncs.PROTECTIONLEVEL = self._makeProtectionLevelParameter parameterFuncs.PROTECTIONLOG = self._makeProtectionLogParameter parameterFuncs.TALKPAGE = self._makeTalkPageParameter parameterFuncs.TOOLTIPBLURB = self._makeTooltipBlurbParameter parameterFuncs.TOOLTIPFRAGMENT = self._makeTooltipFragmentParameter parameterFuncs.VANDAL = self._makeVandalTemplateParameter
self._params = setmetatable({}, { __index = function (t, k) local param if parameterFuncs[k] then param = parameterFuncs[k](self) end param = param or t[k] = param return param end }) end
msg = msg:gsub('${(%u+)}', self._params) return msg end
function Blurb:_makeCurrentVersionParameter() -- A link to the page history or the move log, depending on the kind of -- protection. local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'move' then -- We need the move log link. return makeFullUrl( 'Special:Log', {type = 'move', page = pagename}, self:_getExpandedMessage('current-version-move-display') ) else -- We need the history link. return makeFullUrl( pagename, {action = 'history'}, self:_getExpandedMessage('current-version-edit-display') ) end end
function Blurb:_makeEditRequestParameter() local mEditRequest = require('Module:Submit an edit request') local action = self._protectionObj.action local level = self._protectionObj.level
-- Get the edit request type. local requestType if action == 'edit' then if level == 'autoconfirmed' then requestType = 'semi' elseif level == 'extendedconfirmed' then requestType = 'extended' elseif level == 'templateeditor' then requestType = 'template' end end requestType = requestType or 'full'
-- Get the display value. local display = self:_getExpandedMessage('edit-request-display')
return mEditRequest._link{type = requestType, display = display} end
function Blurb:_makeExpiryParameter() local expiry = self._protectionObj.expiry if type(expiry) == 'number' then return self:_formatDate(expiry) else return expiry end end
function Blurb:_makeExplanationBlurbParameter() -- Cover special cases first. if self._protectionObj.title.namespace == 8 then -- MediaWiki namespace return self:_getExpandedMessage('explanation-blurb-nounprotect') end
-- Get explanation blurb table keys local action = self._protectionObj.action local level = self._protectionObj.level local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'
-- Find the message in the explanation blurb table and substitute any -- parameters. local explanations = self._cfg.explanationBlurbs local msg if explanations[action][level] and explanations[action][level][talkKey] then msg = explanations[action][level][talkKey] elseif explanations[action][level] and explanations[action][level].default then msg = explanations[action][level].default elseif explanations[action].default and explanations[action].default[talkKey] then msg = explanations[action].default[talkKey] elseif explanations[action].default and explanations[action].default.default then msg = explanations[action].default.default else error(string.format( 'could not find explanation blurb for action "%s", level "%s" and talk key "%s"', action, level, talkKey ), 8) end return self:_substituteParameters(msg) end
function Blurb:_makeImageLinkParameter() local imageLinks = self._cfg.imageLinks local action = self._protectionObj.action local level = self._protectionObj.level local msg if imageLinks[action][level] then msg = imageLinks[action][level] elseif imageLinks[action].default then msg = imageLinks[action].default else msg = imageLinks.edit.default end return self:_substituteParameters(msg) end
function Blurb:_makeIntroBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-blurb-expiry') else return self:_getExpandedMessage('intro-blurb-noexpiry') end end
function Blurb:_makeIntroFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('intro-fragment-expiry') else return self:_getExpandedMessage('intro-fragment-noexpiry') end end
function Blurb:_makePagetypeParameter() local pagetypes = self._cfg.pagetypes return pagetypes[self._protectionObj.title.namespace] or pagetypes.default or error('no default pagetype defined', 8) end
function Blurb:_makeProtectionBlurbParameter() local protectionBlurbs = self._cfg.protectionBlurbs local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionBlurbs[action][level] then msg = protectionBlurbs[action][level] elseif protectionBlurbs[action].default then msg = protectionBlurbs[action].default elseif protectionBlurbs.edit.default then msg = protectionBlurbs.edit.default else error('no
protection blurb defined for protectionBlurbs.edit.default', 8)
end return self:_substituteParameters(msg) end
function Blurb:_makeProtectionDateParameter() local protectionDate = self._protectionObj.protectionDate if type(protectionDate) == 'number' then return self:_formatDate(protectionDate) else return protectionDate end end
function Blurb:_makeProtectionLevelParameter() local protectionLevels = self._cfg.protectionLevels local action = self._protectionObj.action local level = self._protectionObj.level local msg if protectionLevels[action][level] then msg = protectionLevels[action][level] elseif protectionLevels[action].default then msg = protectionLevels[action].default elseif protectionLevels.edit.default then msg = protectionLevels.edit.default else error('no protection level defined for protectionLevels.edit.default', 8) end return self:_substituteParameters(msg) end
function Blurb:_makeProtectionLogParameter() local pagename = self._protectionObj.title.prefixedText if self._protectionObj.action == 'autoreview' then -- We need the pending changes log. return makeFullUrl( 'Special:Log', {type = 'stable', page = pagename}, self:_getExpandedMessage('pc-log-display') ) else -- We need the protection log. return makeFullUrl( 'Special:Log', {type = 'protect', page = pagename}, self:_getExpandedMessage('protection-log-display') ) end end
function Blurb:_makeTalkPageParameter() return string.format( '%s', mw.site.namespaces[self._protectionObj.title.namespace].talk.name, self._protectionObj.title.text, self._args.section or 'top', self:_getExpandedMessage('talk-page-link-display') ) end
function Blurb:_makeTooltipBlurbParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-blurb-expiry') else return self:_getExpandedMessage('tooltip-blurb-noexpiry') end end
function Blurb:_makeTooltipFragmentParameter() if self._protectionObj:isTemporary() then return self:_getExpandedMessage('tooltip-fragment-expiry') else return self:_getExpandedMessage('tooltip-fragment-noexpiry') end end
function Blurb:_makeVandalTemplateParameter() return require('Module:Vandal-m')._main{ self._args.user or self._protectionObj.title.baseText } end
-- Public methods --
function Blurb:makeBannerText(key) -- Validate input. if not key or not Blurb.bannerTextFields[key] then error(string.format( '"%s" is not a valid banner config field', tostring(key) ), 2) end
-- Generate the text. local msg = self._protectionObj.bannerConfig[key] if type(msg) == 'string' then return self:_substituteParameters(msg) elseif type(msg) == 'function' then msg = msg(self._protectionObj, self._args) if type(msg) ~= 'string' then error(string.format( 'bad output from banner config function with key "%s"' .. ' (expected string, got %s)', tostring(key), type(msg) ), 4) end return self:_substituteParameters(msg) end end
-- BannerTemplate class
local BannerTemplate = {} BannerTemplate.__index = BannerTemplate
function BannerTemplate.new(protectionObj, cfg) local obj = {} obj._cfg = cfg
-- Set the image filename. local imageFilename = protectionObj.bannerConfig.image if imageFilename then obj._imageFilename = imageFilename else -- If an image filename isn't specified explicitly in the banner config, -- generate it from the protection status and the namespace. local action = protectionObj.action local level = protectionObj.level local namespace = protectionObj.title.namespace local reason = protectionObj.reason
-- Deal with special cases first. if ( namespace == 10 or namespace == 828 or reason and obj._cfg.indefImageReasons[reason] ) and action == 'edit' and level == 'sysop' and not protectionObj:isTemporary() then -- Fully protected modules and templates get the special red "indef" -- padlock. obj._imageFilename = obj._cfg.msg['image-filename-indef'] else -- Deal with regular protection types. local images = obj._cfg.images if images[action] then if images[action][level] then obj._imageFilename = images[action][level] elseif images[action].default then obj._imageFilename = images[action].default end end end end return setmetatable(obj, BannerTemplate) end
function BannerTemplate:renderImage() local filename = self._imageFilename or self._cfg.msg['image-filename-default'] or 'Transparent.gif' return makeFileLink{ file = filename, size = (self.imageWidth or 20) .. 'px', alt = self._imageAlt, link = self._imageLink, caption = self.imageCaption } end
-- Banner class
local Banner = setmetatable({}, BannerTemplate) Banner.__index = Banner
function Banner.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageWidth = 40 obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip. obj._reasonText = blurbObj:makeBannerText('text') obj._explanationText = blurbObj:makeBannerText('explanation') obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing. return setmetatable(obj, Banner) end
function Banner:__tostring() -- Renders the banner. makeMessageBox = makeMessageBox or require('Module:Message box').main local reasonText = self._reasonText or error('no reason text set', 2) local explanationText = self._explanationText local mbargs = { page = self._page, type = 'protection', image = self:renderImage(), text = string.format( "%s%s", reasonText, explanationText and '<br />' .. explanationText or ) } return makeMessageBox('mbox', mbargs) end
-- Padlock class
local Padlock = setmetatable({}, BannerTemplate) Padlock.__index = Padlock
function Padlock.new(protectionObj, blurbObj, cfg) local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb. obj.imageWidth = 20 obj.imageCaption = blurbObj:makeBannerText('tooltip') obj._imageAlt = blurbObj:makeBannerText('alt') obj._imageLink = blurbObj:makeBannerText('link') obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action] or cfg.padlockIndicatorNames.default or 'pp-default' return setmetatable(obj, Padlock) end
function Padlock:__tostring() local frame = mw.getCurrentFrame() -- The nowiki tag helps prevent whitespace at the top of articles. return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{ name = 'indicator', args = {name = self._indicatorName}, content = self:renderImage() } end
-- Exports
local p = {}
function p._exportClasses() -- This is used for testing purposes. return { Protection = Protection, Blurb = Blurb, BannerTemplate = BannerTemplate, Banner = Banner, Padlock = Padlock, } end
function p._main(args, cfg, title) args = args or {} cfg = cfg or require(CONFIG_MODULE)
local protectionObj = Protection.new(args, cfg, title)
local ret = {}
-- If a page's edit protection is equally or more restrictive than its -- protection from some other action, then don't bother displaying anything -- for the other action (except categories). if protectionObj.action == 'edit' or args.demolevel or not getReachableNodes( cfg.hierarchy, protectionObj.level )[effectiveProtectionLevel('edit', protectionObj.title)] then -- Initialise the blurb object local blurbObj = Blurb.new(protectionObj, args, cfg)
-- Render the banner if protectionObj:isProtected() then ret[#ret + 1] = tostring( (yesno(args.small) and Padlock or Banner) .new(protectionObj, blurbObj, cfg) ) end end
-- Render the categories if yesno(args.category) ~= false then ret[#ret + 1] = protectionObj:makeCategoryLinks() end
return table.concat(ret) end
function p.main(frame, cfg) cfg = cfg or require(CONFIG_MODULE)
-- Find default args, if any. local parent = frame.getParent and frame:getParent() local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', )]
-- Find user args, and use the parent frame if we are being called from a -- wrapper template. getArgs = getArgs or require('Module:Arguments').getArgs local userArgs = getArgs(frame, { parentOnly = defaultArgs, frameOnly = not defaultArgs })
-- Build the args table. User-specified args overwrite default args. local args = {} for k, v in pairs(defaultArgs or {}) do args[k] = v end for k, v in pairs(userArgs) do args[k] = v end return p._main(args, cfg) end
return p</text>
<sha1>ice162y8kua930ie41kredxjaxhzy3y</sha1> </revision> </page> <page> <title>Module:Protection banner/config</title> <ns>828</ns> <id>42982788</id> <revision> <id>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 "current-version-edit-display" or -- "current-version-move-display". -- -- ${EDITREQUEST} - a link to create an edit request for the current page. -- -- ${EXPLANATIONBLURB} - an explanation blurb, e.g. "Please discuss any changes -- on the talk page; you may submit a request to ask an administrator to make -- an edit if it is minor or supported by consensus." -- -- ${IMAGELINK} - a link to set the image to, depending on the protection -- action and protection level. -- -- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry -- is set. E.g. "Editing of this page by new or unregistered users is currently -- disabled until dd Month YYYY." -- -- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation -- so that it can be used in run-on sentences. -- -- ${PAGETYPE} - the type of the page, e.g. "article" or "template". -- Defined in the cfg.pagetypes table. -- -- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g. -- "Editing of this page by new or unregistered users is currently disabled" -- -- ${PROTECTIONDATE} - the protection date, if it has been supplied to the -- template. -- -- ${PROTECTIONLEVEL} - the protection level, e.g. "fully protected" or -- "semi-protected". -- -- ${PROTECTIONLOG} - a link to the protection log or the pending changes log, -- depending on the protection action. -- -- ${TALKPAGE} - a link to the talk page. If a section is specified, links -- straight to that talk page section. -- -- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to -- create a blurb like "This template is semi-protected", or "This article is -- move-protected until DD Month YYYY". -- -- ${VANDAL} - links for the specified username (or the root page name) -- using Module:Vandal-m. -- -- Functions -- -- For advanced users, it is possible to use Lua functions instead of strings -- in the banner config tables. Using functions gives flexibility that is not -- possible just by using parameters. Functions take two arguments, the -- protection object and the template arguments, and they must output a string. -- -- For example: -- -- text = function (protectionObj, args) -- if protectionObj.level == 'autoconfirmed' then -- return 'foo' -- else -- return 'bar' -- end -- end -- -- Some protection object properties and methods that may be useful: -- protectionObj.action - the protection action -- protectionObj.level - the protection level -- protectionObj.reason - the protection reason -- protectionObj.expiry - the expiry. Nil if unset, the string "indef" if set -- to indefinite, and the protection time in unix time if temporary. -- protectionObj.protectionDate - the protection date in unix time, or nil if -- unspecified. -- protectionObj.bannerConfig - the banner config found by the module. Beware -- of editing the config field used by the function, as it could create an -- infinite loop. -- protectionObj:isProtected - returns a boolean showing whether the page is -- protected. -- protectionObj:isTemporary - returns a boolean showing whether the expiry is -- temporary. -- protectionObj:isIncorrect - returns a boolean showing whether the protection -- template is incorrect. --]]
-- The master banner data, used if no values have been found in banners or -- defaultBanners. masterBanner = { text = '${INTROBLURB}', explanation = '${EXPLANATIONBLURB}', tooltip = '${TOOLTIPBLURB}', link = '${IMAGELINK}', alt = 'Page ${PROTECTIONLEVEL}' },
-- The default banner data. This holds banner data for different protection -- levels. -- *required* - this table needs edit, move, autoreview and upload subtables. defaultBanners = { edit = {}, move = {}, autoreview = { autoconfirmed = { alt = 'Page protected with pending changes level 1', tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users', image = 'Padlock-silver-light.svg' }, default = { alt = 'Page protected with pending changes level 2', tooltip = 'All edits by users who are not reviewers or administrators are' .. ' subject to review prior to becoming visible to unregistered users', image = 'Padlock-orange.svg' } }, upload = {} },
-- The banner data. This holds banner data for different protection reasons. -- In fact, the reasons specified in this table control which reasons are -- valid inputs to the first positional parameter. -- -- There is also a non-standard "description" field that can be used for items -- in this table. This is a description of the protection reason for use in the -- module documentation. -- -- *required* - this table needs edit, move, autoreview and upload subtables. banners = { edit = { blp = { description = 'For pages protected to promote compliance with the' .. ' [[Wikipedia:Biographies of living persons' .. '|biographies of living persons]] policy', text = '${INTROFRAGMENT} to promote compliance with' .. ' [[Wikipedia:Biographies of living persons' .. "|Wikipedia's policy on the biographies" .. ' of living people]].', tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on' .. ' biographies of living people', }, dmca = { description = 'For pages protected by the Wikimedia Foundation' .. ' due to Digital Millennium Copyright Act takedown requests', explanation = function (protectionObj, args) local ret = 'Pursuant to a rights owner notice under the Digital' .. ' Millennium Copyright Act (DMCA) regarding some content' .. ' in this article, the Wikimedia Foundation acted under' .. ' applicable law and took down and restricted the content' .. ' in question.' if args.notice then ret = ret .. ' A copy of the received notice can be found here: ' .. args.notice .. '.' end ret = ret .. ' For more information, including websites discussing' .. ' how to file a counter-notice, please see' .. " Wikipedia:Office actions and the article's ${TALKPAGE}." .. "Do not remove this template from the article until the" .. " restrictions are withdrawn." return ret end, image = 'Padlock-black.svg', }, dispute = { description = 'For pages protected due to editing disputes', text = function (protectionObj, args) -- Find the value of "disputes". local display = 'disputes' local disputes if args.section then disputes = string.format( '%s', mw.site.namespaces[protectionObj.title.namespace].talk.name, protectionObj.title.text, args.section, display ) else disputes = display end
-- Make the blurb, depending on the expiry. local msg if type(protectionObj.expiry) == 'number' then msg = '${INTROFRAGMENT} or until editing %s have been resolved.' else msg = '${INTROFRAGMENT} until editing %s have been resolved.' end return string.format(msg, disputes) end, explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', tooltip = '${TOOLTIPFRAGMENT} due to editing disputes', }, ecp = { description = 'For articles in topic areas authorized by' .. ' 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' .. ' protected from' .. ' editing because it is currently or will soon be displayed' .. ' on the Main Page.', explanation
= 'Images on the Main Page are protected due to their high'
.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.' .. '<br /><span style="font-size:90%;">' .. "Administrators: Once this image is definitely off the Main Page," .. ' please unprotect this file, or reduce to semi-protection,' .. ' as appropriate.</span>', }, office = { description = 'For pages protected by the Wikimedia Foundation', text = function (protectionObj, args) local ret = 'This ${PAGETYPE} is currently under the' .. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.' if protectionObj.protectionDate then ret = ret .. ' It has been protected since ${PROTECTIONDATE}.' end return ret end, explanation = "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not remove protection from this" .. " page unless you are authorized by the Wikimedia Foundation to do" .. " so.", image = 'Padlock-black.svg', }, reset = { description = 'For pages protected by the Wikimedia Foundation and' .. ' "reset" to a bare-bones version',
text = 'This ${PAGETYPE} is currently under the'
.. ' scrutiny of the' .. ' Wikimedia Foundation Office' .. ' and is protected.', explanation = function (protectionObj, args) local ret = if protectionObj.protectionDate then ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was' else ret = ret .. 'This ${PAGETYPE} has been' end ret = ret .. ' reduced to a' .. ' simplified, "bare bones" version so that it may be completely' .. ' rewritten to ensure it meets the policies of' .. ' Neutral Point of View and Verifiability.' .. ' Standard Wikipedia policies will apply to its rewriting—which' .. ' will eventually be open to all editors—and will be strictly' .. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while' .. ' it is being rebuilt.\n\n' .. 'Any insertion of material directly from' .. ' pre-protection revisions of the ${PAGETYPE} will be removed, as' .. ' will any material added to the ${PAGETYPE} that is not properly' .. ' sourced. The associated talk page(s) were also cleared on the' .. " same date.\n\n" .. "If you can edit this page, please discuss all changes and" .. " additions on the ${TALKPAGE} first. Do not override" .. " this action, and do not remove protection from this page," .. " unless you are authorized by the Wikimedia Foundation" .. " to do so. No editor may remove this notice."
return ret end, image = 'Padlock-black.svg', }, sock = { description = 'For pages protected due to' .. ' sock puppetry', text = '${INTROFRAGMENT} to prevent sock puppets of' .. ' blocked or' .. ' banned users' .. ' from editing it.', tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from' .. ' editing it', }, template = { description = 'For high-risk' .. ' templates and Lua modules', text = 'This is a permanently protected ${PAGETYPE},' .. ' as it is high-risk.', explanation = 'Please discuss any changes on the ${TALKPAGE}; you may' .. ' ${EDITREQUEST} to ask an' .. ' administrator or' .. ' 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' .. ' consensus. You can also' .. ' 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' .. ' {{unblock}} 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]],' .. ' log in,' .. ' or create an account.', }, vandalism = { description = 'For pages protected against' .. ' vandalism', text = '${INTROFRAGMENT} due to vandalism.', explanation = function (protectionObj, args) local ret = if protectionObj.level == 'sysop' then ret = ret .. "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ' end return ret .. '${EXPLANATIONBLURB}' end, tooltip = '${TOOLTIPFRAGMENT} due to vandalism', } }, move = { dispute = { description = 'For pages protected against page moves due to' .. ' disputes over the page title', explanation = "This protection is not an endorsement of the" .. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}', image = 'Padlock-olive.svg' }, vandalism = { description = 'For pages protected against' .. ' [[Wikipedia:Vandalism#Page-move vandalism' .. ' |page-move vandalism]]' } }, autoreview = {}, upload = {} },
-- -- GENERAL DATA TABLES --
-- Protection blurbs
-- This table produces the protection blurbs available with the -- ${PROTECTIONBLURB} parameter. It is sorted by protection action and -- protection level, and is checked by the module in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionBlurbs = { edit = { default = 'This ${PAGETYPE} is currently ' .. '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 disabled', extendedconfirmed = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} as a result of' .. ' ArbCom enforcement or meets the' .. ' criteria for community use', }, move = { default = 'This ${PAGETYPE} is currently protected' .. ' from page moves' }, autoreview = { autoconfirmed = 'All edits made to this ${PAGETYPE} by' .. ' new or' .. ' unregistered' .. ' users are currently' .. ' subject to review', default = 'All edits made to this ${PAGETYPE} by users who are not' .. ' reviewers or' .. ' administrators are currently' .. ' subject to review' }, upload = { default = 'Uploading new versions of this ${PAGETYPE} is currently disabled' } },
-- Explanation blurbs
-- This table produces the explanation blurbs available with the -- ${EXPLANATIONBLURB} parameter. It is sorted by protection action, -- protection level, and whether the page is a talk page or not. If the page is -- a talk page it will have a talk key of "talk"; otherwise it will have a talk -- key of "subject". The table is checked in the following order: -- 1. page's protection action, page's protection level, page's talk key -- 2. page's protection action, page's protection level, default talk key -- 3. page's protection action, default protection level, page's talk key -- 4. page's protection action, default protection level, default talk key -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. explanationBlurbs = { edit = { autoconfirmed = { subject = 'See the ' .. '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]], log in, or' .. ' create an account.', default = 'See the ' .. '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]], log in, or' .. ' 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 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' .. ' consensus.' }, default = { subject = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' 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 ' .. '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 ' .. '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' .. ' request that the page be' .. ' unprotected.', default = 'See the ' .. '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' .. ' request that the page be' .. ' unprotected.' } }, autoreview = { default = { reviewer = 'See the ' .. '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 reviewer user right.', default = 'See the ' .. '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]], log in, or' .. ' create an account.' }, }, upload = { default = { default = 'See the ' .. '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' .. ' protected edit request, or you' .. ' can request' .. ' that the file be unprotected.' } } },
-- Protection levels
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which -- produces a short label for different protection levels. It is sorted by -- protection action and protection level, and is checked in the following -- order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. protectionLevels = { edit = { default = 'protected', templateeditor = 'template-protected', extendedconfirmed = 'extended-protected', autoconfirmed = 'semi-protected', }, move = { default = 'move-protected' }, autoreview = { }, upload = { default = 'upload-protected' } },
-- Images
-- This table lists different padlock images for each protection action and -- protection level. It is used if an image is not specified in any of the -- banner data tables, and if the page does not satisfy the conditions for using -- the ['image-filename-indef'] image. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level images = { edit = { default = 'Padlock.svg', templateeditor = 'Padlock-pink.svg', extendedconfirmed = 'Padlock-blue.svg', autoconfirmed = 'Padlock-silver.svg' }, move = { default = 'Padlock-olive.svg', }, autoreview = { autoconfirmed = 'Padlock-silver-light.svg', default = 'Padlock-orange.svg' }, upload = { default = 'Padlock-purple.svg' } },
-- Pages with a reason specified in this table will show the special "indef" -- padlock, defined in the 'image-filename-indef' message, if no expiry is set. indefImageReasons = { template = true },
-- Image links
-- This table provides the data for the ${IMAGELINK} parameter, which gets -- the image link for small padlock icons based on the page's protection action -- and protection level. It is checked in the following order: -- 1. page's protection action, page's protection level -- 2. page's protection action, default protection level -- 3. "edit" protection action, default protection level -- -- It is possible to use banner parameters inside this table. -- *required* - this table needs edit, move, autoreview and upload subtables. imageLinks = { edit = { default = 'Wikipedia:Protection policy#full', templateeditor = 'Wikipedia:Protection policy#template', extendedconfirmed = 'Wikipedia:Protection policy#extended', autoconfirmed = 'Wikipedia:Protection policy#semi' }, move = { default = 'Wikipedia:Protection policy#move' }, autoreview = { autoconfirmed = 'Wikipedia:Protection policy#pc1', reviewer = 'Wikipedia:Protection policy#pc2' }, upload = { default = 'Wikipedia:Protection policy#upload' } },
-- Padlock indicator names
-- This table provides the "name" attribute for the <indicator> extension tag -- with which small padlock icons are generated. All indicator tags on a page -- are displayed in alphabetical order based on this attribute, and with -- indicator tags with duplicate names, the last tag on the page wins. -- The attribute is chosen based on the protection action; table keys must be a -- protection action name or the string "default". padlockIndicatorNames = { autoreview = 'pp-autoreview', default = 'pp-default' },
-- Protection categories
--[[ -- The protection categories are stored in the protectionCategories table. -- Keys to this table are made up of the following strings: -- -- 1. the expiry date -- 2. the namespace -- 3. the protection reason (e.g. "dispute" or "vandalism") -- 4. the protection level (e.g. "sysop" or "autoconfirmed") -- 5. the action (e.g. "edit" or "move") -- -- When the module looks up a category in the table, first it will will check to -- see a key exists that corresponds to all five parameters. For example, a -- user page semi-protected from vandalism for two weeks would have the key -- "temp-user-vandalism-autoconfirmed-edit". If no
match is found, the module
-- changes the first part of the key to "all" and checks the table again. It -- keeps checking increasingly generic key combinations until it finds the -- field, or until it reaches the key "all-all-all-all-all". -- -- The module uses a binary matrix to determine the order in which to search. -- This is best demonstrated by a table. In this table, the "0" values -- represent "all", and the "1" values represent the original data (e.g. -- "indef" or "file" or "vandalism"). -- -- expiry namespace reason level action -- order -- 1 1 1 1 1 1 -- 2 0 1 1 1 1 -- 3 1 0 1 1 1 -- 4 0 0 1 1 1 -- 5 1 1 0 1 1 -- 6 0 1 0 1 1 -- 7 1 0 0 1 1 -- 8 0 0 0 1 1 -- 9 1 1 1 0 1 -- 10 0 1 1 0 1 -- 11 1 0 1 0 1 -- 12 0 0 1 0 1 -- 13 1 1 0 0 1 -- 14 0 1 0 0 1 -- 15 1 0 0 0 1 -- 16 0 0 0 0 1 -- 17 1 1 1 1 0 -- 18 0 1 1 1 0 -- 19 1 0 1 1 0 -- 20 0 0 1 1 0 -- 21 1 1 0 1 0 -- 22 0 1 0 1 0 -- 23 1 0 0 1 0 -- 24 0 0 0 1 0 -- 25 1 1 1 0 0 -- 26 0 1 1 0 0 -- 27 1 0 1 0 0 -- 28 0 0 1 0 0 -- 29 1 1 0 0 0 -- 30 0 1 0 0 0 -- 31 1 0 0 0 0 -- 32 0 0 0 0 0 -- -- In this scheme the action has the highest priority, as it is the last -- to change, and the expiry has the least priority, as it changes the most. -- The priorities of the expiry, the protection level and the action are -- fixed, but the priorities of the reason and the namespace can be swapped -- through the use of the cfg.bannerDataNamespaceHasPriority table. --]]
-- If the reason specified to the template is listed in this table, -- namespace data will take priority over reason data in the protectionCategories -- table. reasonsWithNamespacePriority = { vandalism = true, },
-- The string to use as a namespace key for the protectionCategories table for each -- namespace number. categoryNamespaceKeys = { [ 2] = 'user', [ 3] = 'user', [ 4] = 'project', [ 6] = 'file', [ 8] = 'mediawiki', [ 10] = 'template', [ 12] = 'project', [ 14] = 'category', [100] = 'portal', [828] = 'module', },
protectionCategories = { ['all|all|all|all|all'] = 'Wikipedia fully protected pages', ['all|all|office|all|all'] = 'Wikipedia Office-protected pages', ['all|all|reset|all|all'] = 'Wikipedia Office-protected pages', ['all|all|dmca|all|all'] = 'Wikipedia Office-protected pages', ['all|all|mainpage|all|all'] = 'Wikipedia fully-protected main page files', ['all|all|all|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction', ['all|all|ecp|extendedconfirmed|all'] = 'Wikipedia pages under 30-500 editing restriction', ['all|template|all|all|edit'] = 'Wikipedia fully-protected templates', ['all|all|all|autoconfirmed|edit'] = 'Wikipedia semi-protected pages', ['indef|all|all|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected pages', ['all|all|blp|autoconfirmed|edit'] = 'Wikipedia indefinitely semi-protected biographies of living people', ['temp|all|blp|autoconfirmed|edit'] = 'Wikipedia temporarily semi-protected biographies of living people', ['all|all|dispute|autoconfirmed|edit'] = 'Wikipedia pages semi-protected due to dispute', ['all|all|sock|autoconfirmed|edit'] = 'Wikipedia pages semi-protected from banned users', ['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism', ['all|category|all|autoconfirmed|edit'] = 'Wikipedia semi-protected categories', ['all|file|all|autoconfirmed|edit'] = 'Wikipedia semi-protected files', ['all|portal|all|autoconfirmed|edit'] = 'Wikipedia semi-protected portals', ['all|project|all|autoconfirmed|edit'] = 'Wikipedia semi-protected project pages', ['all|talk|all|autoconfirmed|edit'] = 'Wikipedia semi-protected talk pages', ['all|template|all|autoconfirmed|edit'] = 'Wikipedia semi-protected templates', ['all|user|all|autoconfirmed|edit'] = 'Wikipedia semi-protected user and user talk pages', ['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates', ['all|all|blp|sysop|edit'] = 'Wikipedia indefinitely protected biographies of living people', ['temp|all|blp|sysop|edit'] = 'Wikipedia temporarily protected biographies of living people', ['all|all|dispute|sysop|edit'] = 'Wikipedia pages protected due to dispute', ['all|all|sock|sysop|edit'] = 'Wikipedia pages protected from banned users', ['all|all|vandalism|sysop|edit'] = 'Wikipedia pages protected against vandalism', ['all|category|all|sysop|edit'] = 'Wikipedia protected categories', ['all|file|all|sysop|edit'] = 'Wikipedia fully-protected files', ['all|project|all|sysop|edit'] = 'Wikipedia fully-protected project pages', ['all|talk|all|sysop|edit'] = 'Wikipedia fully-protected talk pages', ['all|template|all|sysop|edit'] = 'Wikipedia fully-protected templates', ['all|user|all|sysop|edit'] = 'Wikipedia protected user and user talk pages', ['all|module|all|all|edit'] = 'Wikipedia fully-protected modules', ['all|module|all|templateeditor|edit'] = 'Wikipedia template-protected modules', ['all|module|all|autoconfirmed|edit'] = 'Wikipedia semi-protected modules', ['all|all|all|sysop|move'] = 'Wikipedia move-protected pages', ['indef|all|all|sysop|move'] = 'Wikipedia indefinitely move-protected pages', ['all|all|dispute|sysop|move'] = 'Wikipedia pages move-protected due to dispute', ['all|all|vandalism|sysop|move'] = 'Wikipedia pages move-protected due to vandalism', ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', ['all|portal|all|sysop|move'] = 'Wikipedia move-protected portals', ['all|project|all|sysop|move'] = 'Wikipedia move-protected project pages', ['all|talk|all|sysop|move'] = 'Wikipedia move-protected talk pages', ['all|template|all|sysop|move'] = 'Wikipedia move-protected templates', ['all|user|all|sysop|move'] = 'Wikipedia move-protected user and user talk pages', ['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages', ['all|all|all|reviewer|autoreview'] = 'Wikipedia pending changes protected pages (level 2)', ['all|file|all|all|upload'] = 'Wikipedia upload-protected files', },
-- Expiry category config
-- This table configures the expiry category behaviour for each protection -- action. -- * If set to true, setting that action will always categorise the page if -- an expiry parameter is not set. -- * If set to false, setting that action will never categorise the page. -- * If set to nil, the module will categorise the page if: -- 1) an expiry parameter is not set, and -- 2) a reason is provided, and -- 3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck -- table.
expiryCheckActions = { edit = nil, move = false, autoreview = true, upload = false },
reasonsWithoutExpiryCheck = { blp = true, template = true, },
-- Pagetypes
-- This table produces the page types available with the ${PAGETYPE} parameter. -- Keys are namespace numbers, or the string "default" for the default value. pagetypes = { [0] = 'article', [6] = 'file', [10] = 'template', [14] = 'category', [828] = 'module', default = 'page' },
-- Strings marking indefinite protection
-- This table contains values passed to the expiry parameter that mean the page -- is protected indefinitely. indefStrings = { ['indef'] = true, ['indefinite'] = true, ['indefinitely'] = true, ['infinite'] = true, },
-- Group hierarchy
-- This table maps each group to all groups that have a superset of the original -- group's page editing permissions. hierarchy = { sysop = {}, reviewer = {'sysop'}, filemover = {'sysop'}, templateeditor = {'sysop'}, extendedconfirmed = {'sysop'}, autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'}, user
= {'autoconfirmed'},
['*'] = {'user'} },
-- Wrapper templates and their default arguments
-- This table contains wrapper templates used with the module, and their -- default arguments. Templates specified in this table should contain the -- following invocation, and no other template content: -- -- Script error: No such module "Protection banner". -- -- If other content is desired, it can be added between -- <noinclude>...</noinclude> tags. -- -- When a user calls one of these wrapper templates, they will use the -- default arguments automatically. However, users can override any of the -- arguments. wrappers = { ['Template:Pp'] = {}, ['Template:Pp-30-500'] = {'ecp'}, ['Template:Pp-blp'] = {'blp'}, -- we don't need Template:Pp-create ['Template:Pp-dispute'] = {'dispute'}, ['Template:Pp-main-page'] = {'mainpage'}, ['Template:Pp-move'] = {action = 'move'}, ['Template:Pp-move-dispute'] = {'dispute', action = 'move'}, -- we don't need Template:Pp-move-indef ['Template:Pp-move-vandalism'] = {'vandalism', action = 'move'}, ['Template:Pp-office'] = {'office'}, ['Template:Pp-office-dmca'] = {'dmca'}, ['Template:Pp-pc1'] = {action = 'autoreview', small = true}, ['Template:Pp-pc2'] = {action = 'autoreview', small = true}, ['Template:Pp-reset'] = {'reset'}, ['Template:Pp-semi-indef'] = {small = true}, ['Template:Pp-sock'] = {'sock'}, ['Template:Pp-template'] = {'template', small = true}, ['Template:Pp-upload'] = {action = 'upload'}, ['Template:Pp-usertalk'] = {'usertalk'}, ['Template:Pp-vandalism'] = {'vandalism'}, },
-- -- MESSAGES --
msg = {
-- Intro blurb and intro fragment
-- These messages specify what is produced by the ${INTROBLURB} and -- ${INTROFRAGMENT} parameters. If the protection is temporary they use the -- intro-blurb-expiry or intro-fragment-expiry, and if not they use -- intro-blurb-noexpiry or intro-fragment-noexpiry. -- It is possible to use banner parameters in these messages. ['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.', ['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.', ['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},', ['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',
-- Tooltip blurb
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter. -- If the protection is temporary the tooltip-blurb-expiry message is used, and -- if not the tooltip-blurb-noexpiry message is used. -- It is possible to use banner parameters in these messages. ['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.', ['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.', ['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},', ['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',
-- Special explanation blurb
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages -- in the MediaWiki namespace. -- It is possible to use banner parameters in this message. ['explanation-blurb-nounprotect'] = 'See the ' .. 'protection policy and ${PROTECTIONLOG} for more details.' .. ' Please discuss any changes on the ${TALKPAGE}; you' .. ' may ${EDITREQUEST} to ask an' .. ' 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:Redirect hatnote</title> <ns>828</ns> <id>42680232</id> <revision> <id>833409182</id> <parentid>726676462</parentid> <timestamp>2018-03-31T10:45:06Z</timestamp> <contributor> <username>Galobtter</username> <id>19502780</id> </contributor> <comment>text= option</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="3910">--[[
-- This module produces a "redirect" hatnote. It looks like this: -- '"X" redirects here. For other uses, see Y.' -- It implements the Template:Redirect template. --]]
local mHatnote = require('Module:Hatnote') local mHatList = require('Module:Hatnote list') local mArguments --lazily initialize local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType local checkTypeMulti = libraryUtil.checkTypeMulti
local p = {}
local function getTitle(...) local success, titleObj = pcall(mw.title.new, ...) if success then return titleObj else return nil end end
function p.redirect(frame) mArguments = require('Module:Arguments') local args = mArguments.getArgs(frame, {parentOnly=true}) --Get number of redirects local numRedirects = tonumber(frame.args[1]) or 1 -- Create the options table. local options = {} options.selfref = args.selfref return p._redirect(args, numRedirects, options) end
function p._redirect(args, numRedirects, options, currentTitle, redirectTitle, targetTitle) -- Validate the input. Don't bother checking currentTitle, redirectTitle or -- targetTitle, as they are only used in testing. checkType('_redirect', 1, args, 'table') checkType('_redirect', 2, numRedirects, 'number', true) numRedirects = numRedirects or 1 checkType('_redirect', 3, options, 'table', true) options = options or {} currentTitle = currentTitle
or mw.title.getCurrentTitle()
-- Get the table of redirects local redirect = {} for i = 1, numRedirects do -- Return an error if a redirect parameter is missing. if not args[i] then return mHatnote.makeWikitextError( 'missing redirect parameter', 'Template:Redirect#Errors', args.category ) end redirect[i] = args[i] end -- Generate the text. local formattedRedirect = {} for k,v in pairs(redirect) do formattedRedirect[k] = '"' .. v .. '"' end local text = { mHatList.andList(formattedRedirect) .. ' ' .. (#redirect == 1 and 'redirects' or 'redirect') .. ' here.', mHatList._forSee(args, #redirect + 1, {title = redirect[1], extratext = args.text}) } text = table.concat(text, ' ') -- Functionality for adding categories local categoryTable = {} function addCategory(cat) if cat and cat ~= then -- Add by index to avoid duplicates categoryTable[string.format(, cat)] = true end end --Generate tracking categories local mhOptions = {} for k,v in pairs(redirect) do -- We don't need a tracking category if the template invocation has been -- copied directly from the docs, or if we aren't in main- or category-space. if not v:find('^REDIRECT%d*$') and v ~= 'TERM' -- and currentTitle.namespace == 0 or currentTitle.namespace == 14 then redirectTitle = redirectTitle or getTitle(v) if not redirectTitle or not redirectTitle.exists then addCategory('Missing redirects') elseif not redirectTitle.isRedirect then addCategory('Articles with redirect hatnotes needing review') else local mRedirect = require('Module:Redirect') local target = mRedirect.getTarget(redirectTitle) targetTitle = targetTitle or target and getTitle(target) if targetTitle and targetTitle ~= currentTitle then addCategory('Articles with redirect hatnotes needing review') end end end
-- Generate the options to pass to Module:Hatnote. if currentTitle.namespace == 0 and not mhOptions.selfref and redirectTitle and redirectTitle.namespace ~= 0 then -- We are on a mainspace page, and the hatnote starts with something -- like "Wikipedia:Foo redirects here", so automatically label it as -- a self-reference. mhOptions.selfref = true else mhOptions.selfref = options.selfref end end --concatenate all the categories local category = for k,v in pairs(categoryTable) do category = category .. k end
return mHatnote._hatnote(text, mhOptions) .. category end
return p</text>
<sha1>shg1gl73yd4p5wk0fnxak9sr5559490</sha1> </revision> </page> <page> <title>Module:String</title> <ns>828</ns> <id>38569505</id> <revision> <id>552254999</id> <parentid>540627185</parentid> <timestamp>2013-04-26T10:52:01Z</timestamp> <contributor> <username>Mr. Stradivarius</username> <id>4708675</id> </contributor> <comment>Add "rep" function per request by User:×§×™×¤×•×“× ×—×© at Wikipedia:Lua requests#Template:Loop and Template:Loop15. Copied from sandbox.</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="15731">--[[
This module is intended to provide access to basic string functions.
Most of the functions provided here can be invoked with named parameters, unnamed parameters, or a mixture. If named parameters are used, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. Depending on the intended use, it may be advantageous to either preserve or remove such whitespace.
Global options
ignore_errors: If set to 'true' or 1, any error condition will result in an empty string being returned rather than an error message. error_category: If an error occurs, specifies the name of a category to include with the error message. The default category is [Category:Errors reported by Module String]. no_category: If set to 'true' or 1, no category will be added if an error is generated.
Unit tests for this module are available at Module:String/tests. ]]
local str = {}
--[[ len
This function returns the length of the target string.
Usage: Script error: No such module "String". OR Script error: No such module "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: Script error: No such module "String". OR Script error: No such module "String".
Parameters
s: The string to return a subset of i: The fist index of the substring to return, defaults to 1. j: The last index of the string to return, defaults to the last character.
The first character of the string is assigned an index of 1. If either i or j is a negative value, it is interpreted the same as selecting a character by counting from the end of the string. Hence, a value of -1 is the same as selecting the last character of the string.
If the requested indices are out of range for the given string, an error is reported. ]] function str.sub( frame )
local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } ); local s = new_args['s'] or ; local i = tonumber( new_args['i'] ) or 1; local j = tonumber( new_args['j'] ) or -1; local len = mw.ustring.len( s );
-- Convert negatives for range checking if i < 0 then i = len + i + 1; end if j < 0 then j = len + j + 1; end if i > len or j > len or i < 1 or j < 1 then return str._error( 'String subset index out of range' ); end if j < i then return str._error( 'String subset indices out of order' ); end return mw.ustring.sub( s, i, j )
end
--[[ This function implements that features of Template: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: Script error: No such module "String". OR Script error: No such module "String".
Parameters
s: The string to search pattern: The pattern or string to find within the string start: The index within the source string to start the search. The first character of the string has index 1. Defaults to 1. match: In some cases it may be possible to make multiple matches on a single string. This specifies which match to return, where the first match is match= 1. If a negative number is specified then a match is returned counting from the last match. Hence match = -1 is the same as requesting the last match. Defaults to 1. plain: A flag indicating that the pattern should be understood as plain text. Defaults to false. nomatch: If no match is found, output the "nomatch" value rather than an error.
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from each string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
If the match_number or start_index are out of range for the string being queried, then this function generates an error. An error is also generated if no match is found. If one adds the parameter ignore_errors=true, then the error will be suppressed and an empty string will be returned on any failure.
For information on constructing Lua patterns, a form of [regular expression], see:
- http://www.lua.org/manual/5.1/manual.html#5.4.1
- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns
- http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns
]] function str.match( frame )
local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} ); local s = new_args['s'] or ; local start = tonumber( new_args['start'] ) or 1; local plain_flag = str._getBoolean( new_args['plain'] or false ); local pattern = new_args['pattern'] or ; local match_index = math.floor( tonumber(new_args['match']) or 1 ); local nomatch = new_args['nomatch']; if s == then return str._error( 'Target string is empty' ); end if pattern == then return str._error( 'Pattern string is empty' ); end if math.abs(start) < 1 or math.abs(start) > mw.ustring.len( s ) then return str._error( 'Requested start is out of range' ); end if match_index == 0 then return str._error( 'Match index is out of range' ); end if plain_flag then pattern = str._escapePattern( pattern ); end local result if match_index == 1 then -- Find first match is simple case result = mw.ustring.match( s, pattern, start ) else if start > 1 then s = mw.ustring.sub( s, start ); end local iterator = mw.ustring.gmatch(s, pattern); if match_index > 0 then -- Forward search for w in iterator do match_index = match_index - 1; if match_index == 0 then result = w; break; end end else -- Reverse search local result_table = {}; local count = 1; for w in iterator do result_table[count] = w; count = count + 1; end result = result_table[ count + match_index ]; end end if result == nil then if nomatch == nil then return str._error( 'Match not found' ); else return nomatch; end else return result; end
end
--[[ pos
This function returns a single character from the target string at position pos.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
target: The string to search pos: The index for the character to return
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the target string. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
The first character has an index value of 1.
If one requests a negative value, this function will select a character by counting backwards from the end of the string. In other words pos = -1 is the same as asking for the last character.
A requested value of zero, or a value greater than the length of the string returns an error. ]] function str.pos( frame )
local new_args = str._getParameters( frame.args, {'target', 'pos'} ); local target_str = new_args['target'] or ; local pos = tonumber( new_args['pos'] ) or 0;
if pos == 0 or math.abs(pos) > mw.ustring.len( target_str ) then return str._error( 'String index out of range' ); end return mw.ustring.sub( target_str, pos, pos );
end
--[[ str_find
This function duplicates the behavior of Template:Str find, including all of its quirks. This is provided in order to support existing templates, but is NOT RECOMMENDED for new code and templates. New code is recommended to use the "find" function instead.
Returns the first index in "source" that is a match to "target". Indexing is 1-based, and the function returns -1 if the "target" string is not present in "source".
Important Note: If the "target" string is empty / missing, this function returns a value of "1", which is generally unexpected behavior, and must be accounted for separatetly. ]] function str.str_find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target'} ); local source_str = new_args['source'] or ; local target_str = new_args['target'] or ;
if target_str == then return 1; end local start = mw.ustring.find( source_str, target_str, 1, true ) if start == nil then start = -1 end return start
end
--[[ find
This function allows one to search for a target string or pattern within another string.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
source: The string to search target: The string or pattern to find within source start: The index within the source string to start the search, defaults to 1 plain: Boolean flag indicating that target should be understood as plain text and not as a Lua style regular expression, defaults to true
If invoked using named parameters, Mediawiki will automatically remove any leading or trailing whitespace from the parameter. In some circumstances this is desirable, in other cases one may want to preserve the whitespace.
This function returns the first index >= "start" where "target" can be found within "source". Indices are 1-based. If "target" is not found, then this function returns 0. If either "source" or "target" are missing / empty, this function also returns 0.
This function should be safe for UTF-8 strings. ]] function str.find( frame )
local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ); local source_str = new_args['source'] or ; local pattern = new_args['target'] or ; local start_pos = tonumber(new_args['start']) or 1; local plain = new_args['plain'] or true; if source_str == or pattern == then return 0; end plain = str._getBoolean( plain );
local start = mw.ustring.find( source_str, pattern, start_pos, plain ) if start == nil then start = 0 end return start
end
--[[ replace
This function allows one to replace a target string or pattern within another string.
Usage: Script error: No such module "String". OR Script error: No such module "String".
Parameters
source: The string to search pattern: The string or pattern to find within source replace: The replacement text count: The number of occurences to replace, defaults to all. plain: Boolean flag indicating that pattern should be understood as plain text and not as a Lua style regular expression, defaults to true
]] function str.replace( frame )
local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ); local source_str = new_args['source'] or ; local pattern = new_args['pattern'] or ; local replace = new_args['replace'] or ; local count = tonumber( new_args['count'] ); local plain = new_args['plain'] or true; if source_str == or pattern == then return source_str; end plain = str._getBoolean( plain );
if plain then pattern = str._escapePattern( pattern ); replace = mw.ustring.gsub( replace, "%%", "%%%%" ); --Only need to escape replacement sequences. end local result;
if count ~= nil then result = mw.ustring.gsub( source_str, pattern, replace, count ); else result = mw.ustring.gsub( source_str, pattern, replace ); end
return result;
end
--[[
simple function to pipe string.rep to templates.
]]
function str.rep( frame )
local repetitions = tonumber( frame.args[2] ) if not repetitions then return str._error( 'function rep expects a number as second parameter, received "' .. ( frame.args[2] or ) .. '"' ) end return string.rep( frame.args[1] or , repetitions )
end
--[[ Helper function that populates the argument list given that user may need to use a mix of named and unnamed parameters. This is relevant because named parameters are not identical to unnamed parameters due to string trimming, and when dealing with strings we sometimes want to either preserve or remove that whitespace depending on the application. ]] function str._getParameters( frame_args, arg_list )
local new_args = {}; local index = 1; local value; for i,arg in ipairs( arg_list ) do value = frame_args[arg] if value == nil then value = frame_args[index]; index = index + 1; end new_args[arg] = value; end return new_args;
end
--[[ Helper function to handle error messages. ]] function str._error( error_str )
local frame = mw.getCurrentFrame(); local error_category = frame.args.error_category or 'Errors reported by Module String'; local ignore_errors = frame.args.ignore_errors or false; local no_category = frame.args.no_category or false; if str._getBoolean(ignore_errors) then return ; end local error_str = '<strong class="error">String Module Error: ' .. error_str .. '</strong>'; if error_category ~= and not str._getBoolean( no_category ) then error_str = .. error_str; end return error_str;
end
--[[ Helper Function to interpret boolean strings ]] function str._getBoolean( boolean_str )
local boolean_value; if type( boolean_str ) == 'string' then boolean_str = boolean_str:lower(); if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' or boolean_str == then boolean_value = false; else boolean_value = true; end elseif type( boolean_str ) == 'boolean' then boolean_value = boolean_str; else error( 'No boolean value found' ); end return boolean_value
end
--[[ Helper function that escapes all pattern characters so that they will be treated as plain text. ]] function str._escapePattern( pattern_str )
return mw.ustring.gsub( pattern_str, "([%(%)%.%%%+%-%*%?%[%^%$%]])", "%%%1" );
end
return str</text>
<sha1>l0shz7fzxb1bq626nihqwbptk7dfqd5</sha1> </revision> </page> <page> <title>Module:Yesno</title> <ns>828</ns> <id>38665046</id> <revision> <id>828075573</id> <parentid>659459801</parentid> <timestamp>2018-02-28T12:14:32Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>+support for on/off</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="745">-- Function allowing for consistent treatment of boolean-like wikitext input.
-- It works similarly to the template Template:Yesno.
return function (val, default) -- If your wiki uses non-ascii characters for any of "yes", "no", etc., you -- should replace "val:lower()" with "mw.ustring.lower(val)" in the -- following line. val = type(val) == 'string' and val:lower() or val if val == nil then return nil elseif val == true or val == 'yes' or val == 'y' or val == 'true' or val == 't' or val == 'on' or tonumber(val) == 1 then return true elseif val == false or val == 'no' or val == 'n' or val == 'false' or val == 'f' or val == 'off' or tonumber(val) == 0 then return false else return default end end</text>
<sha1>swdskn7svew8i9wuydn9uj5l3r2ghcs</sha1> </revision> </page>
</mediawiki>
<pre style="overflow:auto"> <mediawiki xmlns="http://www.mediawiki.org/xml/export-0.10/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.10/ http://www.mediawiki.org/xml/export-0.10.xsd" version="0.10" xml:lang="en">
<siteinfo> <sitename>Wikipedia</sitename> <dbname>enwiki</dbname> <base>https://en.wikipedia.org/wiki/Main_Page</base> <generator>MediaWiki 1.32.0-wmf.1</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:Taxobox</title> <ns>10</ns> <id>689990</id> <revision> <id>787846838</id> <parentid>778610702</parentid> <timestamp>2017-06-27T22:24:34Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>better fix than a div for parser bug T18700</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="18505"><includeonly><!--See parser bug T18700--><nowiki/>Template:Taxobox/core</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8vdb4rdhdcoxq15noycs0sy6sn12tj2</sha1> </revision> </page> <page> <title>Template:;</title> <ns>10</ns> <id>24389988</id> <revision> <id>579820375</id> <parentid>328698152</parentid> <timestamp>2013-11-02T02:29:16Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:;: Enable access by 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="138">;<noinclude>
Template:Documentation <!-- PLEASE ADD THIS TEMPLATE'S CATEGORIES AND INTERWIKIS TO THE /doc SUBPAGE, THANKS --> </noinclude></text>
<sha1>jv515gqjn3e60s98b0od6potfps8h7b</sha1> </revision> </page> <page> <title>Template:Anglicise rank</title> <ns>10</ns> <id>27662093</id> <revision> <id>794829931</id> <parentid>764335048</parentid> <timestamp>2017-08-10T08:30:50Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated to tested sandbox version; highlights incorrect rank names in display of taxonomy template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="3647"><noinclude><!--Note that #titleparts: is used to replace underscores by spaces before other processing.
--></noinclude><includeonly>{{{1}}}</includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>r7k7bb1fc2jyqjtct62iyeo65tioxvc</sha1> </revision> </page> <page> <title>Template:COLON</title> <ns>10</ns> <id>37858377</id> <redirect title="Template:Colon" /> <revision> <id>526845228</id> <timestamp>2012-12-07T10:41:53Z</timestamp> <contributor> <username>Scott</username> <id>9867</id> </contributor> <comment>Hex moved page Template:COLON to Template:Colon: Consistency with similarly-named templates.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="29">#REDIRECT Template:Colon
</text>
<sha1>bkz2dmpnak2hukdsi456pihydbyeyv5</sha1> </revision> </page> <page> <title>Template:Category link with count</title> <ns>10</ns> <id>30847816</id> <revision> <id>827250605</id> <parentid>804533676</parentid> <timestamp>2018-02-23T17:02:11Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Category link with count": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="307">[[:Category:{{{1}}}]] (0)<noinclude>
Template:Documentation </noinclude></text>
<sha1>5h9duat6ms1mq6bpe5n7ochhcqi0htr</sha1> </revision> </page> <page> <title>Template:Clc</title> <ns>10</ns> <id>52342109</id> <redirect title="Template:Category link with count" /> <revision> <id>827250628</id> <parentid>804533685</parentid> <timestamp>2018-02-23T17:02:12Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Clc": high-risk template with 2000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model>
<format>text/x-wiki</format> <text xml:space="preserve" bytes="94">#REDIRECT Template:Category link with count</text> <sha1>0wg8cwrtejxmqn6jgp5uft9mqk2li1z</sha1> </revision> </page> <page> <title>Template:Clear</title> <ns>10</ns> <id>1239772</id> <revision> <id>684162145</id> <parentid>683948339</parentid> <timestamp>2015-10-04T23:53:36Z</timestamp> <contributor> <username>Nyttend</username> <id>1960810</id> </contributor> <minor/> <comment>Changed protection level of Template:Clear: Enable access by template editors; NeilN is okay with this move ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="81"><div style="clear:both;"></div><noinclude>
Template:Documentation </noinclude></text>
<sha1>6mk3e4afot6hzu6tzbljxxk83e14xv6</sha1> </revision> </page> <page> <title>Template:Colon</title> <ns>10</ns> <id>9794950</id> <revision> <id>579833044</id> <parentid>526846189</parentid> <timestamp>2013-11-02T05:07:28Z</timestamp> <contributor> <username>Fuhghettaboutit</username> <id>665998</id> </contributor> <minor/> <comment>Changed protection level of Template:Colon: Enable access by 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="45">:<noinclude>Template:Documentation</noinclude></text> <sha1>cc3ofm0i104e4kws9eikeit1yry2hki</sha1> </revision> </page> <page> <title>Template:Column-count</title> <ns>10</ns> <id>29216387</id> <revision> <id>638540848</id> <parentid>579833002</parentid> <timestamp>2014-12-17T20:09:11Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="156"><includeonly>-moz-column-count: 2; -webkit-column-count: 2; column-count: 2;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ctnrlv6otxn502jcjxtlgfdg09bq651</sha1> </revision> </page> <page> <title>Template:Column-width</title> <ns>10</ns> <id>29216399</id> <revision> <id>638540885</id> <parentid>579832996</parentid> <timestamp>2014-12-17T20:09:33Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>redundant</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="165"><includeonly>-moz-column-width: 30em; -webkit-column-width: 30em; column-width: 30em;</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>sum88q311kc02222mb4cgzbikcx7fqy</sha1> </revision> </page> <page> <title>Template:Columns-list</title> <ns>10</ns> <id>15350623</id> <revision> <id>820270206</id> <parentid>780371550</parentid> <timestamp>2018-01-14T00:10:55Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>Add check for deprecated parameter 1=</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="717"><includeonly>Template:Main other</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>s0dkzmbtykj36zkmh42ixv59msksyse</sha1> </revision> </page> <page> <title>Template:Delink</title> <ns>10</ns> <id>28069338</id> <revision> <id>696877808</id> <parentid>695173639</parentid> <timestamp>2015-12-26T16:26:10Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <comment>Template:Documentation does this</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="179">{{<includeonly>safesubst:</includeonly>#invoke:delink|delink}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nxxwkb2lon9wgne4irg9ctbsle6zwiy</sha1> </revision> </page> <page> <title>Template:Div col</title> <ns>10</ns> <id>12679552</id> <revision> <id>820620173</id> <parentid>820604224</parentid> <timestamp>2018-01-15T17:35:00Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>/* top */ rm tfm notice, no need to have it here</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1405"><includeonly><div class="div-col columns <!-- -->column-count column-count-2" style="<!-- -->Template:Column-count <!-- --><!-- --><!--empty--> <!-- --> <!-- -->"><!-- --><!-- Inventory how many pages use small=yes --></includeonly>Script error: No such module "Check for unknown parameters".<!--
-->Template:Main other<noinclude> Template:Documentation </noinclude></text>
<sha1>d2gbqb2ziz4u4p13e6fy9t4aegzt2hy</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 Rich Farmbrough (talk)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="182">Script error: No such module "documentation".<noinclude>
<!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>o4ddn701tao1ufdnkxe1wdgz5b5ga84</sha1> </revision> </page> <page> <title>Template:Documentation subpage</title> <ns>10</ns> <id>7890381</id> <revision> <id>617432645</id> <parentid>608599904</parentid> <timestamp>2014-07-18T09:37:22Z</timestamp> <contributor> <username>Sardanaphalus</username> <id>427947</id> </contributor> <comment>Added 1.0em margin so template looks less a part of subsequent content and amended code layout -- hope neither of these too controversial</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1667"><includeonly><!-- --><!--(this template has not been transcluded on a /doc or /{{{override}}} page)--><!--
--></includeonly><noinclude>Template:Documentation</noinclude></text>
<sha1>iwoex9r4jjje2jlwm8eygcyef0s6hzx</sha1> </revision> </page> <page> <title>Template:Em</title> <ns>10</ns> <id>28990025</id> <revision> <id>800858570</id> <parentid>716632165</parentid> <timestamp>2017-09-16T03:11:40Z</timestamp> <contributor> <username>Matt Fitzpatrick</username> <id>291848</id> </contributor> <comment>added role parameter and attribute</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="306"><em >{{{1}}}</em><noinclude>
Template:Documentation <!-- Add categories to the /doc subpage, not here! --> </noinclude></text>
<sha1>g9i6h00ap35wxdar0fg1tibei9ktn9g</sha1> </revision> </page> <page> <title>Template:Fossil range</title> <ns>10</ns> <id>27601310</id> <redirect title="Template:Geological range" /> <revision> <id>577860864</id> <parentid>366046795</parentid> <timestamp>2013-10-19T16:30:26Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <minor/> <comment>Changed protection level of Template:Fossil range: allow template editors to modify ([Edit=Protected template] (indefinite) [Move=Protected template] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="39">#REDIRECT Template:Geological range</text> <sha1>7v75vz714j9z1uuwsspa0q3pkbqe3ku</sha1> </revision> </page> <page> <title>Template:Fossil range/bar</title> <ns>10</ns> <id>18704774</id> <revision> <id>772347989</id> <parentid>772195239</parentid> <timestamp>2017-03-26T19:33:26Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="704"><includeonly><onlyinclude><div style="position:absolute; height:100%; text-align:center; background-color:Template:Period color; left:Expression error: Unrecognized punctuation character "[".px; width:Expression error: Unrecognized punctuation character "[".px;">[[{{{1}}}|{{{2}}}]]</div></onlyinclude></includeonly><noinclude>
Template:Pp-template <!-- interwiki below this point--> ar:قالب:Fossil range/bar [[bn:টেমপ�লেট:Fossil range/bar]] [[ko:틀:화� 시기/막대]] id:Templat:Rentang fosil/baris la:Formula:Fossil range/bar pl:Szablon:Okres istnienia grupy organizmów 2/wykres </noinclude></text>
<sha1>h33mdmfvx5to36xnli0bd12rgbx8evh</sha1> </revision> </page> <page> <title>Template:Fossil range/marker</title> <ns>10</ns> <id>18705421</id> <revision> <id>772347793</id> <parentid>772195280</parentid> <timestamp>2017-03-26T19:32:08Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>absolutely no need to have two <noinclude></noinclude> sections</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1001"><includeonly><onlyinclude>Expression error: Unrecognized punctuation character "{".</onlyinclude></includeonly><noinclude>
Template:Pp-template ar:قالب:Fossil range/marker id:Templat:Rentang fosil/marka la:Formula:Fossil range/marker pl:Szablon:Okres istnienia grupy organizmów 2/znacznik </noinclude></text>
<sha1>oulrk3za491l8g55lbflhw0k4bfezim</sha1> </revision> </page> <page> <title>Template:Geological range</title> <ns>10</ns> <id>13050925</id> <revision> <id>691122112</id> <parentid>691101758</parentid> <timestamp>2015-11-17T20:15:16Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>Fixed for now...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1271"><includeonly><span style="display:inline-block;"></span><span style="display:inline-block;">{{{1}}}</span> <span style="display:inline-block;"></span>Template:Phanerozoic 220px<!--
Fossil range marker
--><div name=Range style="margin:0 auto; line-height:0; clear:both; width:220px; padding:0px; height:8px; overflow:visible; background-color:transparent; position:relative; top:-4px; z-index:100;">Template:Fossil range/marker Template:Fossil range/marker </div Range> </div Timeline-row></includeonly><noinclude>Template:Template doc</noinclude></text>
<sha1>qhx7sh2rpo6099mfnaw3jrqbbflxxyu</sha1> </revision> </page> <page> <title>Template:High-risk</title> <ns>10</ns> <id>11453893</id> <revision> <id>826619452</id> <parentid>819682280</parentid> <timestamp>2018-02-20T03:34:02Z</timestamp> <contributor> <username>Wbm1058</username> <id>14383484</id> </contributor> <comment>add optional parameter to show additional information. using it on Template:Infobox documentation page.</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1603">Template:Ombox<noinclude>
Template:Documentation <!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --> </noinclude></text>
<sha1>ri2f5z0xlo9bloylz6zogx67uowijqs</sha1> </revision> </page> <page> <title>Template:If empty</title> <ns>10</ns> <id>16635679</id> <revision> <id>639393821</id> <parentid>639393034</parentid> <timestamp>2014-12-23T22:03:50Z</timestamp> <contributor> <username>Jackmcbarn</username> <id>19285809</id> </contributor> <comment>make this substable</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="102">{{<includeonly>safesubst:</includeonly>#invoke:If empty|main}}<noinclude>Template:Documentation</noinclude></text> <sha1>dl9p9t1ge8vz1f67zrvu4lp7md161es</sha1> </revision> </page> <page> <title>Template:Image frame</title> <ns>10</ns> <id>5710011</id> <revision> <id>832269062</id> <parentid>832268204</parentid> <timestamp>2018-03-24T22:23:07Z</timestamp> <contributor> <username>GKFX</username> <id>14918984</id> </contributor> <comment>Add {{{innerstyle}}} to other if function</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="861"><includeonly><div class="thumb tright"><div class="thumbinner noresize" style=""><div class="thumbimage" style="">{{{content}}}</div><div class="thumbcaption"></div></div></div></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>lr1p8z2yxh5z329ok1eu3qfwkae0mvm</sha1> </revision> </page> <page> <title>Template:Intricate template</title> <ns>10</ns> <id>3212382</id> <revision> <id>791343927</id> <parentid>599780700</parentid> <timestamp>2017-07-19T16:54:52Z</timestamp> <contributor> <username>Train2104</username> <id>10341578</id> </contributor> <comment>reword</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1235">Template:Ombox<includeonly></includeonly><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>dh79njli0rchozlv8gxvabsm0gkseh1</sha1> </revision> </page> <page> <title>Template:Linear-gradient</title> <ns>10</ns> <id>34343126</id> <revision> <id>679780267</id> <parentid>679774821</parentid> <timestamp>2015-09-06T19:08:51Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <comment>move code</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="579"><includeonly>background-image: -moz-linear-gradient(, ); background-image: -o-linear-gradient(, ); background-image: -webkit-linear-gradient(, ); background-image: linear-gradient({{{1}}}, );</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>d9q5b9t0m89azbiekg3lqbh549l2re0</sha1>
</revision>
</page>
<page>
<title>Template:Main</title>
<ns>10</ns>
<id>1208356</id>
<revision>
<id>827529543</id>
<parentid>826282491</parentid>
<timestamp>2018-02-25T07:02:12Z</timestamp>
<contributor>
<username>RMCD bot</username>
<id>17216044</id>
</contributor>
<comment>Removing notice of move discussion</comment>
<model>wikitext</model>
<format>text/x-wiki</format>
<text xml:space="preserve" bytes="138">Script error: No such module "main".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>jkpvpyms818jhpg2lkzsq5qur195qbr</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 Template:Pp-template</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="409"><noinclude>
Template:Documentation <!-- Add categories and interwikis to the /doc subpage, not here! --> </noinclude></text>
<sha1>ngt28vb1n5t4bh1su57btnqyofkd1d5</sha1> </revision> </page> <page> <title>Template:MultiReplace</title> <ns>10</ns> <id>51070198</id> <revision> <id>836129739</id> <parentid>836116264</parentid> <timestamp>2018-04-12T20:54:48Z</timestamp> <contributor> <username>Ahecht</username> <id>2016996</id> </contributor> <comment>safesubst:<noinclude/></comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="70">{{safesubst:<noinclude/>#invoke:MultiReplace|main}}<noinclude>
Template:Doc</text>
<sha1>hpfo8bppd4vwcb5x8spcqhtcernv2lv</sha1> </revision> </page> <page> <title>Template:Next period</title> <ns>10</ns> <id>17129593</id> <revision> <id>784255100</id> <parentid>577842274</parentid> <timestamp>2017-06-07T09:03:07Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <comment>Add informal Ediacaran subdivisions</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="8491">Taxobox<noinclude>Template:Template doc</noinclude></text> <sha1>hf6999fb24tg7m8c7odtb26w166mq1u</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">Script error: No such module "Message box".<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>1o93yrjvq6v2ylug2k0uaaltljurje2</sha1> </revision> </page> <page> <title>Template:Para</title> <ns>10</ns> <id>16639086</id> <revision> <id>679823176</id> <parentid>660922353</parentid> <timestamp>2015-09-07T00:44:14Z</timestamp> <contributor> <username>HJ Mitchell</username> <id>9336033</id> </contributor> <minor/> <comment>Changed protection level of Template:Para: lower to TE per request; also removed from WP:CASC ([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="267"><code class="nowrap" >|</code><noinclude>
Template:Documentation <!--Categories and interwikis go near the bottom of the /doc subpage.--> </noinclude></text>
<sha1>byvvhmp41qjgp4713oxicsdwzjqb1b0</sha1> </revision> </page> <page> <title>Template:Period color</title> <ns>10</ns> <id>15654337</id> <revision> <id>830378120</id> <parentid>830359768</parentid> <timestamp>2018-03-14T13:20:10Z</timestamp> <contributor> <username>Hike395</username> <id>11639</id> </contributor> <comment>I had already swapped the colors in the previous edit</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="6714"><noinclude>
Template:Documentation </noinclude></text>
<sha1>k8780yise3btiho0veen3y26flpqdhx</sha1> </revision> </page> <page> <title>Template:Period end</title> <ns>10</ns> <id>17126181</id> <revision> <id>772147419</id> <parentid>433647208</parentid> <timestamp>2017-03-25T16:04:18Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Period end": 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] (indef...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="122"><includeonly>Template:Period start</includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>ggu56mt27u35n5ddg6fdrq8zc6iav8e</sha1> </revision> </page> <page> <title>Template:Period id</title> <ns>10</ns> <id>50980396</id> <revision> <id>825510865</id> <parentid>734737683</parentid> <timestamp>2018-02-13T20:32:22Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="460">Template:MultiReplace<noinclude>
Template:Documentation </noinclude></text>
<sha1>4lp28tuzowrcpwyb7wvkyue55cbj2di</sha1> </revision> </page> <page> <title>Template:Period start</title> <ns>10</ns> <id>17126152</id> <revision> <id>833980327</id> <parentid>802883274</parentid> <timestamp>2018-04-03T09:11:08Z</timestamp> <contributor> <username>Smith609</username> <id>846901</id> </contributor> <minor/> <comment>Update Chengjiang, per doi:10.1144/jgs2017-103</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="9422"><includeonly>Expression error: Unexpected round operator.</includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>jcm6yf39q49llph8eh51qy8nod20p8h</sha1> </revision> </page> <page> <title>Template:Phanerozoic 220px</title> <ns>10</ns> <id>26179752</id> <revision> <id>694836256</id> <parentid>694836085</parentid> <timestamp>2015-12-11T22:20:22Z</timestamp> <contributor> <username>Edokter</username> <id>1624037</id> </contributor> <minor/> <comment>linebreak</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1114"><div id="Timeline-row" style="margin: 4px auto 0; clear:both; width:220px; padding:0px; height:18px; overflow:visible; border:1px #666; border-style:solid none; position:relative; z-index:0; font-size:13px;">
<div style="position:absolute; height:100%; left:0px; width:Expression error: Unrecognized punctuation character "[".px; padding-left:5px; text-align:left; background-color:Template:Period color; Template:Linear-gradient">PreЄ</div> {{fossil
range/bar|Cambrian|Є}}
Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar Template:Fossil range/bar <div id="end-border" style="position:absolute; height:100%; background-color:#666; width:1px; left:219px"></div><noinclude> </div> Template:Documentation </noinclude></text>
<sha1>ky1n0eet81iquci3yghyfw95ugey3d1</sha1> </revision> </page> <page> <title>Template:Redirect</title> <ns>10</ns> <id>1649987</id> <revision> <id>827943535</id> <parentid>826439889</parentid> <timestamp>2018-02-27T17:34:09Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <comment>Wikipedia:Templates for discussion/Log/2018 February 18#Template:Redirect3_and_Template:About2 closed as merge (XFDcloser)</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="183"><includeonly>Script error: No such module "redirect hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>nahryqse47xqenividwc88opp02rhjv</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"><div class="reflist <!-- -->" style="<!-- --> list-style-type: <!-- -->decimal;">
</div>Script error: No such module "Check for unknown parameters".<noinclude> Template:Documentation </noinclude></text>
<sha1>2k096ppl7lxbcjqmfluu9x2sc91rmzl</sha1> </revision> </page> <page> <title>Template:See also</title> <ns>10</ns> <id>1721254</id> <revision> <id>763260609</id> <parentid>725632232</parentid> <timestamp>2017-02-02T05:40:25Z</timestamp> <contributor> <username>Nihiltres</username> <id>236191</id> </contributor> <comment>Updated from sandbox to use Module:Labelled list hatnote</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="199"><includeonly>Script error: No such module "Labelled list hatnote".</includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>dn9i3dv2bt8lqifr6vkbycoya78rnav</sha1> </revision> </page> <page> <title>Template:Sets taxobox colour</title> <ns>10</ns> <id>52159696</id> <revision> <id>792252309</id> <parentid>751937313</parentid> <timestamp>2017-07-25T12:33:29Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="192"><includeonly></includeonly><noinclude>
Template:Documentation </noinclude></text>
<sha1>17ktt6fduayqzzpcwd3sq3h059430w8</sha1> </revision> </page> <page> <title>Template:Str find</title> <ns>10</ns> <id>21725841</id> <revision> <id>772120912</id> <parentid>539724237</parentid> <timestamp>2017-03-25T12:38:47Z</timestamp> <contributor> <username>Jo-Jo Eumerus</username> <id>17449355</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find": Allowing template editors on some templates with full protection dating back to pre-TPROT times which aren't too often or too sensitively used. ([Edit=Require template editor access] (i...</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="93">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>3zfmbl429kcazgnewbtwkdoycus3e1m</sha1> </revision> </page> <page> <title>Template:Str find0</title> <ns>10</ns> <id>31624801</id> <revision> <id>754106575</id> <parentid>565160579</parentid> <timestamp>2016-12-10T22:12:30Z</timestamp> <contributor> <username>BU Rob13</username> <id>25420061</id> </contributor> <minor/> <comment>Changed protection level for "Template:Str find0": Highly visible template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="108">Expression error: Unexpected < operator.<noinclude>
Template:Documentation</noinclude></text>
<sha1>sert5g7f8gacqtv1cs6edj7iu0d5b97</sha1> </revision> </page> <page> <title>Template:Str left</title> <ns>10</ns> <id>21696393</id> <revision> <id>741880261</id> <parentid>605122708</parentid> <timestamp>2016-09-30T07:01:19Z</timestamp> <contributor> <username>Ymblanter</username> <id>14596827</id> </contributor> <minor/> <comment>Changed protection level of Template:Str left: Highly visible template: RFPP request ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="184"><includeonly></includeonly><noinclude>
Template:Documentation <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> </noinclude></text>
<sha1>3rrdme1fpv80h1kdk9b7zwlkqd34dfk</sha1> </revision> </page> <page> <title>Template:Str rep</title> <ns>10</ns> <id>24238435</id> <revision> <id>656461393</id> <parentid>656457182</parentid> <timestamp>2015-04-14T16:35:55Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <minor/> <comment>Protected Template:Str rep: Highly visible template: 167176 transclusions ([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="100">Script error: No such module "String".<noinclude>
Template:Documentation</noinclude></text>
<sha1>8aojqr2n3b0gv6drwu3safb8kuckf72</sha1> </revision> </page> <page> <title>Template:Taxobox/Error colour</title> <ns>10</ns> <id>29546546</id> <revision> <id>758431105</id> <parentid>740191216</parentid> <timestamp>2017-01-05T11:32:08Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>updated HTML comment</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="462"><includeonly>transparent; text-align:center; border: 2px solid red; error:colour</includeonly><noinclude><!--
-- The caller template must check invalid -- {{{colour}}} value to link because -- a wp:wikitable column format cannot contain a wikilinked page or category, -- as of September 2016. -- -- See check of {{{colour}}} in template {Taxobox/core}. -->Template:Documentation</noinclude></text>
<sha1>n8owfylnwasbq6p09fhl83wjdp5npqe</sha1> </revision> </page> <page> <title>Template:Taxobox/core</title> <ns>10</ns> <id>29471370</id> <revision> <id>809123045</id> <parentid>809122889</parentid>
<timestamp>2017-11-07T07:14:13Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>try again</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="21914">{| class="infobox biota" style="text-align: left; width: 200px; font-size: 100%"
|- ! colspan=2 style="text-align: center" | Taxobox |-
|- colspan=2 style="text-align: center"
|- |- ! colspan=2 style="min-width:15em; text-align: center" | Scientific classification |-
|-
|-
|- style="text-align: center"
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|-
|}<!--
Define any categories to be displayed on the page here:
--><noinclude>Template:Documentation</noinclude></text>
<sha1>a2rm1euf6a6qovdh8d23gr3qknia9s4</sha1> </revision> </page> <page> <title>Template:Taxobox/doc</title> <ns>10</ns> <id>7342865</id> <revision> <id>839167972</id> <parentid>837111256</parentid> <timestamp>2018-05-01T18:24:33Z</timestamp> <contributor> <username>Plantdrew</username> <id>14423536</id> </contributor> <comment>update transclusion count</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="85800">Template:Redirect
Template:Documentation subpage <includeonly>Template:High-risk</includeonly> <noinclude>Template:MoS guideline</noinclude> Template:Intricate template
This template sets up a manual taxobox, as a right-side infobox table setting out the biological classification (taxonomy) for a group of living things. For guide to automated taxoboxes, see WP:Automated taxobox system/intro.
Although with a choice of over 160 parameters, the implementation is complicated, it is relatively simple to use. <!--For an example in practice, look at the edit page of "Killer whale" – [4].--> Most parameters are optional, so if a particular entry is not relevant for your case, just leave it out. See below section "All parameters" for a complete list.
This guide has come out of WikiProject Tree of life.
Usage[edit source]
Note that parameters in this template are case-sensitive. <pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Colors are automatically assigned based on the table below.
Template:Taxobox colour scheme
Quick start and examples[edit source]
Animals[edit source]
Animal species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Animal higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Plants[edit source]
The majority of plants are angiosperms ("flowering plants"). Wikipedia:WikiProject Plants consensus is to use the Angiosperm Phylogeny Group's APG III classification system for angiosperms. The APG III system does not have formally named divisions or classes, but includes several hierarchically nested, informally named clades. The hierarchy of informally named clades is presented by using parameters such as Template:Para in place of formal rank parameters. Articles on non-flowering plants (e.g. conifers, ferns) should continue to use formal divisions and classes in the Taxobox.
Flowering plant species[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Flowering plant higher taxon[edit source]
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre> Template:Clear
Parameters[edit source]
Name[edit source]
Provided under this parameter should be the single most common vernacular name when one is in widespread use, or a single current scientific name otherwise.
- Common names of higher taxa are always given in sentence case (rather than title case) and in the plural (e.g. marine hatchetfishes).
- Common names of species and subspecies are also to be given in sentence case but in the singular (e.g. black crowned crane, Colorado potato beetle).
The name parameter should not be used to incorporate more than one name. It is only a header and not meant to be an inclusive "names" field. One will suffice. Please assess the relevant literature in deciding which.
Color[edit source]
The color is automatically assigned based on the entry for a number of ranks from Template:Para upwards (see Template:Taxobox); there is normally no need to specify it manually, although Template:Para can be used.
Template:Taxobox colour scheme
Classification[edit source]
As noted above, the classification section includes some or all of the following:
<pre style="overflow:auto"> | regnum = | phylum = | classis = | ordo = | familia = | genus = | species = </pre>
Each entry corresponds to a containing group, except for the last, which should be the group under consideration. Note the entries use the Latin names for the ranks, to make porting between Wikipedias easier. Thus the above correspond to the kingdom, phylum, class, order, family, genus, and species.
Template loop detected: Template:Taxobox
Taxoboxes should include all major ranks above the taxon described in the article, plus minor ranks that are important to understanding the classification of the taxon described in the article, or which are discussed in the article. Other minor ranks should be omitted.
For example, in the taxobox for the genus Formica, it's appropriate to include entries for tribe and subfamily, since those are an aid to understanding how Formica relates to other genera in the family Formicidae. But it wouldn't be appropriate to include the superorder Endopterygota, since all genera of ants are in that superorder; it isn't particularly interesting at this level.
Another example is the subfamily Bambusoideae, the bamboos. This subfamily probably should be mentioned in the taxobox of every bamboo species, since it is a major grouping in this context, despite its minor rank.
Minor ranks are included in the same way as major ranks, for example:
<pre style="overflow:auto"> | classis = ... | subclassis = ... | superordo = ... | ordo = ... </pre>
Note that species and subspecies should be given using the abbreviated forms of their name — e.g. H. sapiens, H. s. sapiens. The epithets should not be given by themselves. The full form of the species or subspecies name is given in the binomial or trinomial section.
See #All parameters for a complete list.
Classification status[edit source]
With the Template:Para parameter, it is possible to introduce extra text within parentheses after "Scientific classification". For example, Template:Para will produce "Scientific classification (disputed)". See Veratalpa for a current example where this parameter is used. This parameter should only be used when the "Scientific classification" text would be misleading without it.
Divisions and sections[edit source]
These ranks have different meanings in zoology and botany.
In botany:
- Use divisio for division (a rank above class and below kingdom)
- Use sectio for section (a rank above species and below genus)
Note: Certain very large genera, e.g. Rhododendron include subsections
In zoology:
- Use zoodivisio for division (a rank above family and below order)
- Use zoosectio for section (a rank above family and below order)
Unranked taxa[edit source]
For each major taxon from family to phylum, you can add an unranked entry to the taxobox. The entry <tt>unranked_X</tt> appears above rank X, for example <tt>unranked_superfamilia</tt> appears above family and superfamily and below order, suborder, infraorder, etc.:
<pre style="overflow:auto"> | ordo = | unranked_superfamilia = | familia = </pre>
For animals and non-flowering plants, use unranked taxa sparingly. The need to include unranked taxa generally indicates that you are following phylogenetic nomenclature. It is usually better to abbreviate the classification to the major ranks and then discuss the classification in more detail in the article.
Unranked taxa of flowering plants[edit source]
Flowering plants (angiosperms) make frequent use of unranked taxa. The APG III system of classification used for flowering plants on Wikipedia does not have formally named ranks above order - e.g. divisions, classes, subclasses - but includes several hierarchically nested, informally named and unranked clades. For flowering plants the taxobox should include Template:Para in place of Template:Para, Template:Para in place of Template:Para, and possibly also Template:Para in place of Template:Para. Flowering plant taxoboxes may often include three to four informal hierarchical groups above the rank of order, making the use of Template:Para necessary, which sorts itself just above Template:Para where a formally named order is displayed. The unranked parameters only include ranks in their parameter names, such as "unranked divisio" to allow the editor to place content hierarchically; no approximation of rank is intended by the use of these parameter names. For flowering plant articles using the APG III system of classification, the regular parameters including Template:Para, Template:Para, and Template:Para should not be used or it will display between these unranked APG III clades.
To comply with #Classification above and its advice on the inclusion of major ranks, the following are considered major ranks in APG III and currently included in the appropriate flowering plant taxoboxes:
- Angiosperms
- Magnoliids
- Monocots
- Eudicots
- Core eudicots (displayed as a major rank when the plant is not included further nested in rosids or asterids)
Note: The rosids contain two clades, the fabids (also known as eurosids I) and malvids (also known as eurosids II), and the asterids contain two further clades, the lamiids (euasterids I) and campanulids (euasterids II). These are considered to be minor ranks and are only to be displayed on the articles on orders or families they immediately contain.
A taxobox for a flowering plant will thus generally include the following parameters: <pre style="overflow:auto"> | regnum = Plantae | unranked_divisio = Angiosperms | unranked_classis = | unranked_ordo = | ordo = </pre>
Viruses[edit source]
Viruses follow a slightly different system. They are not placed in taxa above the rank of order, and instead are treated in seven groups based on the type of nucleic acid they contain, referred to by the Roman numerals i to vii. These can be included in the taxobox using the Template:Para parameter. This also changes the link from scientific to virus classification, so it should not appear on boxes for non-viruses, even if it is left blank.
<pre style="overflow:auto"> | virus_group = iv </pre>
Bold/italic markup[edit source]
Italicization must be done manually in all parameters. If the entry for genus or species (with manually added italics) matches the page title,<ref group=note>If the page is called, for example, "Homo (genus)", then the taxobox will display "Homo" and the page title "Homo (genus)".</ref> then the name of the taxobox and the title of the page will be italicized. Note that if the Template:Para parameter is used the page title will not be automatically
italicized. The taxobox's name will be set to exactly what is specified in Template:Para – italics must be specified manually in this case.
Genus, species, and subspecies should be italicized whenever used, as is the biological standard. For instance, we talk about the genus Homo, the species Homo sapiens, and the subspecies Homo sapiens sapiens.
- In botany, it is important to include the rank for taxa below species. The rank is not italicized, e.g. Genus species subsp. subspecies var. variety.
- Some bacteria that have been characterized but not formally named are given Candidatus names. These should be written in the form Candidatus Genus species, rather than italicized normally.
Higher taxa like families may or may not be italicized in different publications. The prevalent standard for Wikipedia is not to italicize them, except in the case of viruses and other infectious particles.
Bolding is used to indicate the subject of the article. The Template:Para, Template:Para, and Template:Para parameters bold automatically. In the placement section – Template:Para through Template:Para – the final taxon should be bolded, as well as any higher groups that only include the final taxon. See green sulfur bacteria for an example.
Subdivisions[edit source]
Template loop detected: Template:Taxobox Groups above the rank of species (and even species if there are several notable subspecies) should usually include a list of subgroups. Use the Template:Para parameter for the list. The list can be formatted using a number of templates, such as the specialized Template:Tl and Template:Tl, which deal with authorities as well (see the documentation at Template:Taxon list for variant templates), or using a general list template such as Template:Tl. Use the Template:Para parameter to say what rank the subgroups have. For instance, for families in an order:
<pre style="overflow:auto"> | subdivision_ranks = Families | subdivision =
Template:Linked taxon list
</pre>
For lists with more than a few subgroups, the list can be bracketed with Template:Tl and Template:Tl, which will split the list into two columns (see Nettle example at right). In cases where a list would make the taxobox too long, or where the classification is too variable to allow a brief summary, the list should be replaced with a comment like "See text" or the subdivision section should be omitted. As a rule of thumb, when there are more than 100 subgroups the list should be in a separate article.
In cases where the classification is variable, a description like "Typical orders" or "Notable orders" may be used.
In cases where the ranks are uncertain, a description like "Subgroups" or "Taxa" may be preferable. Sometimes it is convenient to represent more than one level of classification in the list. In that case the lower level groups are moved over to the right by prefixing them with &nbsp; characters – usually three for the first level of indentation, and then one to three more for each subsequent level. Major grades may also be represented by bolded headers, as on plant and heterokont. Remember, though, these should mainly be done when the intermediate rank subgroups are not worthy of separate articles; taxoboxes are too small to include too much duplicate information.
Conservation status[edit source]
Conservation status may optionally be included; you can search the IUCN's database of threatened species to find the conservation status of many organisms. It is included via the Template:Para parameter, which takes a code or template. It is not appropriate for prehistoric organisms – the Template:Para parameter may be a more sensible option.
<pre style="overflow:auto;"> |status = code |status_system = classification system (see below)) – required |status_ref = <ref>...</ref> – optional |extinct = year of extinction – optional (only use if |status=EX and year of extinction is known) </pre>
Use the above syntax, choosing one of the status codes from the code list below. The code may be all upper or lower case, but the cases used in the table are preferred.
The following status codes are available (the third column shows the category that is automatically added to the article):
Status (as shown in taxobox) Code Category assigned Secure secure<ref name="invalid" group="IUCN" /> Domesticated DOM<ref name="invalid" group="IUCN" /> Category:Domesticated animals Least Concern (LC) LC Least Concern (LR/lc) LR/lc Near Threatened (NT) NT Near Threatened (LC/nt) LR/nt Conservation Dependent (LR/cd) LR/cd Vulnerable (VU) VU Endangered (EN) EN Category:Endangered species Critically Endangered CR Category:Critically endangered species Critically Endangered (CR), possibly extinct PE Category:Critically endangered species Extinct in the wild (EW) EW Category:Species extinct in the wild Extinct EX Data deficient (DD) DD Not evaluated (NE) NE Fossil fossil<ref name="invalid" group="IUCN">This is not a valid IUCN Red List category</ref><ref name="fossil" group="IUCN">Template:Para is deprecated in favour of Template:Para Template:Tlx (see the #Fossil range section below).</ref> Prehistoric pre<ref name="invalid" group="IUCN" /> See text See text<ref name="invalid" group="IUCN" /> Lower Risk <s>LR</s><ref name="invalid" group="IUCN" /><ref name="LR" group="IUCN">Template:Var is deprecated; use Template:Var or Template:Var or Template:Var instead.</ref>
- Notes
System[edit source]
Template:Main The criteria used by the IUCN should also be specified:
<pre style="overflow:auto">
| status_system = IUCN3.1 or | status_system = IUCN2.3 <!-- deprecated for new boxes, although some taxoboxes still exist and are supported for this version -->
</pre>
This parameter is required in order to display the proper conservation status graphic. Failure to use this parameter will result in no graphic appearing.
Other systems are listed at Wikipedia:Conservation status.
Referencing conservation status[edit source]
To add a reference for the status, use:
<nowiki> | status_ref = <</nowiki>ref<nowiki>>{{</nowiki>Cite journal<nowiki> | author = |title = | journal = The IUCN Red List of Threatened Species | volume = | page = | publisher = International Union for Conservation of Nature | date = | url = | doi = | access-date = }}</ref></nowiki>
See Template:Tlx or Template:Tlx for the parameters you need to supply to that template. And don't forget that Template:Xtag requires a corresponding Template:Tlx or Template:Xtag in the References section.
Fossil range[edit source]
The stratigraphic range for groups known as fossils may also be included, using the Template:Para parameter. For instance, for a group known from the Cambrian to the Permian:
<pre style="overflow:auto">
|fossil_range = Cambrian–Permian
</pre>
You may wish to add a
diagrammatic representation of the fossil range (as shown below), which can be created using the Template:Tl template, for example:
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
or
<pre style="overflow:auto">
| fossil_range = Template:Fossil range Cambrian–Permian
</pre>
For extant taxa that continue into the present day, the ending period should be set to "Recent" or as "Holocene" for Late Quaternary extinctions such as the moa, and the current status should be indicated using the Template:Para parameter.
For groups that only existed during a single period, simply list it without giving a range: e.g.: Template:Image frame
<pre style="overflow:auto">
| fossil_range = Template:Fossil range
</pre>
Images[edit source]
An image can be included using the parameter Template:Para. It is highly recommended that an image be provided if one is available. Do not include the "File:" part of the image file name!
If an image is included, alt text should be provided using parameter "Template:Para". Alt text should not repeat the caption; instead, it should describe the image contents to someone who can't see it (see WP:ALT).
A caption can be provided using parameter "Template:Para". A caption need not be provided if it would just repeat the title of the article. It should be provided if it can convey any additional information about the image, such as the sex or life stage of the individual, the location where the picture was taken, the artist (if an engraving or other illustration), or (for higher taxa) the particular species depicted. <pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana </pre>
By default, the image width is determined by each user's default thumbnail size preference. In general, it is recommended that these preferences be honoured. In some cases, however, it may be desirable to overrule the default size; this can be achieved by use of the Template:Para parameter, which scales the image. Thus Template:Para makes the image 10% larger than the user's default thumbnail size; Template:Para makes it 25% smaller. See MOS:IMGSIZE for more information.
<pre style="overflow:auto; font-size:80%"> | image = Sweetbay1082.jpg | image_alt = White flower surrounded by long green leaves | image_caption = Magnolia virginiana | image_upright = 1.45 </pre>
Long or complex image captions, which should rarely be necessary, look better when left-aligned. This can be achieved using "Template:Para".
A second image may be added by use of the Template:Para, Template:Para, Template:Para and Template:Para parameters. Use this sparingly, and only when the article is long enough, and when it makes sense to include the second image inside the taxobox and not later in the article. Camel is a good example (a genus with two well-known representatives). A second image may also be useful for species that display sexual dimorphism so that both a male and female representative could be shown, e.g. Northern cardinal.
Authorities[edit source]
Generally, an authority should be given only for the taxa covered by the article. Higher groups which only include the article subject should also list authorities unless those are the same as for the taxa in question. In the case of species (or subspecies) the authority may be given in the binomial (or trinomial) section. Otherwise authorities may be listed in the placement section. For instance, for an order:
<pre style="overflow:auto"> | ordo = | ordo_authority = </pre>
The following examples illustrate the different conventions for names, dates, and punctuations in the different kingdoms.
- Animalia
- Plantae
- Bacteria
- Original name valid: Vibrio cholerae <small>R. Koch 1883</small>
- Organism reclassified: Streptococcus pneumoniae <small>(Klein 1884) Chester 1901</small> (originally Micrococcus pneumoniae)
- Old name revived: Salmonella enterica <small>(ex Kauffmann & Edwards 1952) Le Minor & Popoff 1987</small>
Authorities in scientific names are also abbreviated according to different standards for plants and animals. To decipher standard abbreviations, see
- List of botanists by author abbreviation or consult the International Plant Names Index.
- List of zoologists by author abbreviation
For more information refer to the article on binomial nomenclature.
Diversity[edit source]
In higher taxa, and taxa where the subdivision option does not indicate number of species, the Template:Para parameter may be used. This needs to be accompanied by Template:Para which links to an appropriate page, usually a List of ... species page. See, for example, Banksia: the subdivision lists only two subgenera, so the Template:Para option is used to specify the number of species.
<pre style="overflow:auto; font-size:80%"> | diversity_link = List of Quercus species | diversity = c. 120 species </pre>
It is not a good idea to be too precise about the number of species. New species are still being regularly described in many groups. Moreover, changing systematic treatment is liable to alter the species number even in well-known genera. Rounding off the species number and denoting this as approximate value will help decreasing maintenance.
Use the Template:Para parameter to give references for the number of species, for example: <pre style="overflow:auto; font-size:80%"> | diversity_ref = <nowiki><ref></nowiki>Hershler and Longley, 1986, p. 127<nowiki></ref></nowiki> </pre>
Range maps[edit source]
A range map may be included at the end of the taxobox. This uses the Template:Para, Template:Para, Template:Para, and Template:Para parameters, in the same manner as an image. Specifying range map width is unnecessary in most cases. See Leopard (land animal), Northern flicker (non-migratory bird), Lesser spotted eagle (migratory bird) and Killer whale (water animal) for examples.
<pre style="overflow:auto"> | range_map = Map.jpg | range_map_upright = 1.1 | range_map_alt = Map showing ... | range_map_caption = Range of ... </pre>
Up to four range maps can be included, via additional parameters such as Template:Para, Template:Para, etc.
You can generate maps using an appropriate blank map such as Image:BlankMap-World-noborders.png. Do not make the distribution map too large (a width of 300 to 400 should be sufficient, the purpose of the map being a rough global overview; more detailed maps can always go to the article body) and add the map to Category:Habitat maps, or, preferably, if you upload the map to Commons, to commons:Category:Animal distribution maps.
Synonyms[edit source]
Where a species has synonyms, the Template:Para parameter may be used. The list of synonyms can be formatted using the same approach as for Subdivisions, but synonyms should not normally be linked, so e.g. Template:Tl should be used for taxa whose names aren't italicized and Template:Tl for those whose names are.
<source lang="html" style="overflow:auto"> | synonyms =
Template:Species list
</source>
Nomenclator Zoologicus has data for all but the most recently established animal genera. This may be hard to understand for non-specialists, but it is a comprehensive source for the authorship of genus names, both valid ones and junior synonyms. Sometimes one will note that a new name has been established because the older, original name was "preoccupied". This means it has already been established for another taxon of the same rank in the same kingdom before – even if that name is now a synonym too. Taxa that preoccupy a name can be linked in the Synonyms section, such as Stenorhynchus here.
Use Template:Para to give references for the synonym list, for example: <pre style="overflow:auto; font-size:80%"> | synonyms_ref = <nowiki><ref></nowiki>Smith and Jones, 2009, p. 5 <nowiki></ref></nowiki> </pre>
Type species[edit source]
When the type species of a genus (or larger grouping) is known, the Template:Para and Template:Para can be used.
For botanical entries, i.e. names under the International Code of Nomenclature for algae, fungi, and plants
(ICN), the currently accepted name in the genus should be used. The term "type species" does not occur in the ICN, but is used here for convenience. The Index Nominum Genericorum is a useful source of information and can be used as a reference.
For animal entries, i.e. names under the International Code of Zoological Nomenclature (ICZN), the type species should be the Template:Em binomial name of the type species, but linked to its current article, and the authority should be plain (no parentheses). See Mirza for a type species example.
<pre style="overflow:auto"> | type_species = the original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature | type_species_authority = </pre>
This follows ICZN Recommendation 67B; be aware that this means the taxon used by the genus' original author – even if it is now invalid, e.g. a junior synonym. Ideally, it should only be used if the genus' original description can be verified first-hand. As per the following example given by the ICZN:
<blockquote>Astacus marinus Fabricius, 1775, one of the nominal species originally included in the decapod crustacean genus Homarus Weber, 1795, was subsequently designated by Fowler (1912) as the type species of Homarus. The type species is, and should be cited as, Astacus marinus Fabricius, 1775. Astacus marinus Fabricius is currently synonymized with Cancer gammarus Linnaeus, 1758, but the latter is not the type species of Homarus and should not be cited as such. If mention of the type species is required it should be made in some such manner as "Type species Astacus marinus Fabricius, 1775, a junior synonym of Cancer gammarus Linnaeus, 1758"; or "Type species Astacus marinus Fabricius, 1775, now regarded as a synonym of Homarus gammarus (Linnaeus, 1758)".</blockquote>
If you do not completely understand what this all means, please do not use this parameter. Instead, if possible denote the type species in the species listing, for example with a
<pre><small>(type species)</small></pre>
after the species' (currently valid) name.
Italic page titles[edit source]
If the value of Template:Para, Template:Para, or Template:Para exactly matches the title of the page, and Template:Para is unspecified, the taxobox and page title will be italicized automatically.<ref group=note>See note 1; the title of the page will be italicized using the <nowiki>Template:DISPLAYTITLE</nowiki> magic word. When the page name contains the disambiguator "(alga)" or "(genus)", this disambiguator will not be italicized (e.g., Ia (genus)).</ref> If necessary, it is also possible to force the page title to display in italics using the Template:Tl template.
If the Template:Para parameter is present, then the taxobox will display whatever is in Template:Para; the page title will NOT be italicized unless Template:Tl is used.
Complete blank template[edit source]
This section gives all parameters in the order that they will appear in the taxobox. No taxobox should use all of these. Keep it short! Note that parameters in this template are case-sensitive.
Template loop detected: Template:Taxobox
<pre style="overflow:auto"> Template loop detected: Template:Taxobox </pre>
All parameters[edit source]
The full list of parameters is illustrated inside the infobox above, in the "Complete blank template".
color - typical color code <tr> name - name defaults to <nowiki>Taxobox</nowiki><tr> status - conservation status code <tr> status_system - status-system type <tr> status_ref - status reference <tr> regnum - (standard) kingdom name <tr> phylum - (standard) phylum name <tr> classis - (standard) class name <tr> ordo - (standard) order name <tr> familia - (standard) family name <tr> genus - (standard) genus name <tr> species - (standard) species name <tr> fossil_range - (as shown at top of box) <tr> image - (as shown in box) <tr> image_upright - (as shown in box) <tr> image_alt - (as shown in box) <tr> image_caption - (as shown in box) <tr> image2 - (as shown in box) <tr> image2_upright - (as shown in box) <tr> image2_alt - (as shown in box) <tr> image2_caption - (as shown in box) <tr> classification_status - (as shown in box) <tr> virus_group - (as shown in box) <tr> superdomain - (as shown in box) <tr> superdomain_authority - (as shown in box) <tr> unranked_superdomain - (as shown in box) <tr> unranked_superdomain_ authority - (as shown in box) <tr> domain - (as shown in box) <tr> domain_authority - (as shown in box) <tr> unranked_regnum - (as shown in box) <tr> unranked_regnum_authority - (as shown in box) <tr> superregnum - (as shown in box) <tr> superregnum_authority - (as shown in box) <tr> regnum_authority - (as shown in box) <tr> subregnum - (as shown in box) <tr> subregnum_authority - (as shown in box) <tr> unranked_phylum - (as shown in box) <tr> unranked_phylum_authority - (as shown in box) <tr> superdivisio - (as shown in box) <tr> superdivisio_authority - (as shown in box) <tr> superphylum - (as shown in box) <tr> superphylum_authority - (as shown in box) <tr> divisio - (as shown in box) <tr> divisio authority - (as shown in box) <tr> unranked_divisio - (as shown in box) <tr> unranked_divisio_authority - (as shown in box) <tr> phylum_authority - (as shown in box) <tr> subdivisio - (as shown in box) <tr> subdivisio_authority - (as shown in box) <tr> subphylum - (as shown in box) <tr> subphylum_authority - (as shown in box) <tr> infraphylum - (as shown in box) <tr> infraphylum_authority - (as shown in box) <tr> microphylum - (as shown in box) <tr> microphylum_authority - (as shown in box) <tr> nanophylum - (as shown in box) <tr> nanophylum_authority - (as shown in box) <tr> unranked_classis - (as shown in box) <tr> unranked_classis_authority - (as shown in box) <tr> superclassis - (as shown in box) <tr> superclassis_authority - (as shown in box) <tr> classis_authority - (as shown in box) <tr> unranked_subclassis - (as shown in box) <tr> unranked_subclassis_authority - (as shown in box) <tr> subclassis - (as shown in box) <tr> subclassis_authority - (as shown in box) <tr> unranked_infraclassis - (as shown in box) <tr> unranked_infraclassis_authority - (as shown in box) <tr> infraclassis - (as shown in box) <tr> infraclassis_authority - (as shown in box) <tr> unranked_ordo - (as shown in box) <tr> unranked_ordo_authority - (as shown in box) <tr> magnordo - (as shown in box) <tr> magnordo_authority - (as shown in box) <tr> superordo - (as shown in box) <tr> superordo_authority - (as shown in box) <tr> ordo_authority - (as shown in box) <tr> subordo - (as shown in box) <tr> subordo_authority - (as shown in box) <tr> infraordo - (as shown in box) <tr> infraordo_authority - (as shown in box) <tr> parvordo - (as shown in box) <tr> parvordo_authority - (as shown in box) <tr> zoodivisio - (as shown in box) <tr> zoodivisio_authority - (as shown in box) <tr> zoosectio - (as shown in box) <tr> zoosectio_authority - (as shown in box) <tr> zoosubsectio - (as shown in box) <tr> zoosubsectio_authority - (as shown in box) <tr> unranked_superfamilia - (as shown in box) <tr> unranked_superfamilia_authority - (as shown in box) <tr> superfamilia - (as shown in box) <tr> superfamilia_authority - (as shown in box) <tr> familia_authority - (as shown in box) <tr> subfamilia - (as shown in box) <tr> subfamilia_authority - (as shown in box) <tr> unranked_tribus - (as shown in box) <tr> unranked_tribus_authority - (as shown in box) <tr> supertribus - (as shown in box) <tr> supertribus_authority - (as shown in box) <tr> tribus - (as shown in box) <tr> tribus_authority - (as shown in box) <tr> subtribus - (as shown in box) <tr> subtribus_authority - (as shown in box) <tr> alliance - (as shown in box) <tr> alliance_authority - (as shown in box) <tr> unranked_genus - (as shown in box) <tr> unranked_genus_authority - (as shown in box) <tr> genus_authority - (as shown in box) <tr> subgenus - (as shown in box) <tr> subgenus_authority - (as shown in box) <tr> sectio - (as shown in box) <tr> sectio_authority - (as shown in box) <tr> subsectio - (as shown in box) <tr> subsectio_authority - (as shown in box) <tr> series - (as shown in box) <tr> series_authority - (as shown in box) <tr> subseries - (as shown in box) <tr> subseries_authority - (as shown in box) <tr> species_group - (as shown in box) <tr> species_group_authority - (as shown in box) <tr> species_subgroup - (as shown in box) <tr> species_subgroup_authority - (as shown in box) <tr> species_complex - (as shown in box) <tr> species_complex_authority - (as shown in box) <tr> species_authority - (as shown in box) <tr> subspecies - (as shown in box) <tr> subspecies_authority - (as shown in box) <tr> variety - (as shown in box) <tr> variety_authority - (as shown in box) <tr> forma - (as shown in box) <tr> forma_authority - (as shown in box) <tr> diversity_ref - (as shown in box) <tr> diversity - (as shown in box) <tr> diversity_link - (as shown in box) <tr> binomial - (as shown in box) <tr> binomial_authority - (as shown in box) <tr> trinomial - (as shown in box) <tr> trinomial_authority - (as shown in box) <tr> type_genus - (as shown in box) <tr> type_genus_authority - (as shown in box) <tr> type_species - (as shown in box) <tr> type_species_authority - (as shown in box) <tr> subdivision - (as shown in box) <tr> subdivision_ranks - (as shown in box) <tr> type_strain - (as shown in box) <tr> range_map - 1st map, bottom of box <tr> range_map_upright - 1st map scaling = 0.9 i.e. 90% of default size<tr> range_map_alt - 1st map ALT= text<tr> range_map_caption - 1st caption, under picture<tr> binomial2 - (as shown in box) <tr> binomial2_authority - (as shown in box) <tr> range_map2 - 2nd map in box <tr> range_map2_upright - 2nd map scaling = 0.9 <tr> range_map2_alt - 2nd map ALT= text <tr> range_map2_caption - 2nd map caption <tr> binomial3 - (as shown in box) <tr> binomial3_authority - (as shown in box) <tr> range_map3 - 3rd map in box <tr> range_map3_upright - 3rd map scaling = 0.9 <tr> range_map3_alt - 3rd map ALT= text <tr> range_map3_caption - 3rd maq caption <tr> binomial4 - (as shown in box) <tr> binomial4_authority - (as shown in box) <tr> range_map4 - 4th map in box <tr> range_map4_upright - 4th map scaling = 0.9 <tr> range_map4_alt - 4th map ALT= text <tr> range_map4_caption - 4th map caption <tr> synonyms_ref - reference for synonyms <tr> synonyms - (as at bottom of box)
Articles lacking taxoboxes[edit source]
For articles lacking taxoboxes, add Template:Missing-taxobox to the talk page. This may be done by typing <nowiki>Template:Missing-taxobox</nowiki> or <nowiki>Template:Needtaxobox</nowiki> at the top of the talk page.
Microformat[edit source]
Template Data[edit source]
Template:TemplateData header <templatedata> { "description": "An infobox for plants, animals and other biological taxa", "params": { "name":
{
"label": "Name", "description": "For plants, see Wikipedia:Naming conventions (flora). For all other living things, the name should be the most common vernacular name, when one is in widespread use, and a scientific name otherwise.", "type": "string" }, "image": { "label": "Image", "description": "An image to use, do not include the 'File:' part of the image file name.", "type": "wiki-file-name", "required": false, "suggested": true }, "image_width": { "label": "Image Width", "description": "(Deprecated) Width to display the image at. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "image width" ], "required": false, "deprecated": "Use image_upright" }, "image_upright": { "label": "Image Upright scale", "description": "Scale to display the image at. e.g. 1.1", "type": "string", "aliases": [ "image upright" ], "required": false }, "image_alt": { "label": "Image alt text", "description": "Alt text which describes the image to someone who can't see it", "type": "string", "aliases": [ "image alt" ], "required": false }, "image_caption": { "label": "Image caption", "description": "Caption displayed under the image", "type": "string", "suggested": true }, "image_caption_align": { "label": "Image caption alignment", "description": "Alignment of the caption displayed under the image, e.g. left. Should not normally be set.", "type": "string", "aliases": [ "image caption alignment" ], "required": false, "deprecated": true }, "regnum": { "label": "Kingdom", "description": "Kingdom: Animalia, Plantae, Fungi, other taxa may want to use domain or other ranks instead", "type": "string", "required": false }, "divisio": { "label": "Division", "description": "Division in botany, e.g. Bryophyta. Not for flowering plants using the APG III system", "type": "string", "required": false }, "phylum": { "label": "Phylum", "description": "Phylum in zoology, eg Chordata for chordates", "type": "string", "required": false }, "classis": { "label": "Class", "description": "Class/classis taxonomic rank", "type": "string", "required": false }, "ordo": { "label": "Order", "description": "Order/ordo taxonomic rank", "type": "string", "required": false }, "familia": { "label": "Family", "description": "Family/familia taxonomic rank", "type": "string", "required": false }, "genus": { "label": "Genus", "description": "Genus taxonomic rank, in italics, e.g. Homo", "type": "string", "required": false }, "species": { "label": "Species", "description": "Species taxonomic rank. Should be given in abbreviated forms and in italics, e.g. H. sapiens.", "type": "string", "required": false }, "binomial": { "label": "Binomial", "description": "Full binomial name of taxa, In full form with italics, e.g. Salix alba var. caerulea", "type": "string", "required": false }, "binomial_authority": { "label": "Binomial authority", "description": "Binomial authority using appropriate conventions, eg L. (for plants), Linnaeus, 1761 (for animals)", "type": "string", "required": false }, "range_map": { "label": "Range map", "description": "Map of range", "type": "string", "aliases": [ "range map" ], "required": false }, "range_map_width": { "label": "Range map width", "description": "Width to display range map. Should not normally be set. e.g. 320px", "type": "string", "aliases": [ "range map width" ], "required": false, "deprecated": true }, "range_map_alt": { "label": "Range map alt text", "description": "Alt text describing the range in words", "type": "string", "aliases": [ "range map alt" ], "required": false }, "range_map_caption": { "label": "Range map caption", "description": "Caption/key for the range map", "type": "string", "aliases": [ "range map caption" ], "required": false }, "status": { "label": "Conservation status", "description": "The conservation status code: 'secure', domesticated 'DOM', Least Concern 'LC', Lower Risk—Least Concern 'LR/lc', Near Threatened 'NT', Lower Risk—Near Threatened 'LR/nt', Lower Risk—Conservation Dependent 'LR/cd', Vulnerable 'VU', Endangered 'EN', Critically Endangered 'CR', Possibly Extinct 'PE', Extinct in the wild 'EW', Extinct 'EX', Data deficient 'DD', Not evaluated 'NE',Fossil 'fossil', Prehistoric 'pre', 'See text', Lower Risk 'LR'", "type": "string", "required": false }, "status_system": { "label": "Conservation status system", "description": "System used for Conservation status: 'IUCN3.1', 'IUCN2.3', 'EPBC' etc. Required if status given.", "type": "string", "aliases": [ "status system" ], "required": false }, "status_ref": { "label": "Status reference", "description": "Reference for status <ref>Template:Cite journal</ref>", "type": "string", "aliases": [ "status ref" ], "required": false }, "extinct": { "label": "Year of extinction", "description": "Year of extinction, if known", "type": "string", "required": false }, "fossil_range": { "label": "Fossil range", "description": "The stratigraphic range for groups known as fossils. E.g. Cambrian–Permian or Template:Fossil range to give a chart. Use 'Recent' for extant taxa and 'Holocene' for Late Quaternary extinctions.", "type": "string", "required": false }, "virus_group": { "label": "Virus group", "description": "Viruses not placed in taxa above the rank of order, instead a virus group is used, given by a Roman numeral from I to VII", "type": "string", "aliases": [ "virus group" ], "required": false }, "unranked_superdomain": { "label": "Unranked superdomain", "description": "For each major taxon you can add an unranked entry to the taxobox. The entry unranked X appears above rank X", "type": "string", "aliases": [ "unranked superdomain" ], "required": false }, "superdomain": { "label": "Superdomain", "description": "This and other minor ranks should only be used when they are important to understanding the classification of the taxon described in the article", "type": "string", "required": false }, "superdomain_authority": { "label": "Superdomain Authority", "description": "The authority used for this rank. Every rank has a rank authority field which are not currently listed", "type": "string", "aliases": [ "superdomain authority" ], "required": false }, "domain": { "label": "Domain", "description": "Domain for Archaea, Bacteria and Eukarya", "type": "string", "required": false }, "superregnum": { "label": "Superkingdom", "type": "string", "required":
false
}, "unranked_regnum": { "label": "Unranked kingdom", "type": "string", "required": false }, "subregnum": { "label": "Subkingdom", "type": "string", "required": false }, "superdivisio": { "label": "Superdivision", "type": "string", "required": false }, "superphylum": { "label": "Superphylum", "type": "string", "required": false }, "unranked_divisio": { "label": "Unranked division", "description": "For flowering plants using the APG IV system this should be set to Angiosperms rather than using division/divisio", "type": "string", "aliases": [ "unranked divisio" ], "required": false }, "unranked_phylum": { "label": "Unranked phylum", "type": "string", "required": false }, "subphylum": { "label": "Subphylum", "type": "string", "required": false }, "infraphylum": { "label": "Infraphylum", "type": "string", "required": false }, "microphylum": { "label": "Microphylum", "type": "string", "required": false }, "nanophylum": { "label": "Nanophylum", "type": "string", "required": false }, "superclassis": { "label": "Superclass", "type": "string", "required": false }, "unranked_classis": { "label": "Unranked class", "description": "For flowering plants using the APG IV system this should be used rather than class/classis", "type": "string", "aliases": [ "unranked classis" ], "required": false }, "unranked_subclassis": { "label": "Unranked subclass", "type": "string", "aliases": [ "unranked subclassis" ], "required": false }, "subclassis": { "label": "Subclass", "type": "string", "required": false }, "unranked_infraclassis": { "label": "Unranked infraclass", "type": "string", "aliases": [ "unranked infraclassis" ], "required": false }, "infraclassis": { "label": "Infraclass", "type": "string", "required": false }, "magnordo": { "label": "Magnorder", "type": "string", "required": false }, "superordo": { "label": "Superorder", "type": "string", "required": false }, "unranked_ordo": { "label": "Unranked order", "description": "Generally used for flowering plants using the APG IV system", "type": "string", "aliases": [ "unranked ordo" ], "required": false }, "subordo": { "label": "subordo", "type": "string", "required": false }, "infraordo": { "label": "infraordo", "type": "string", "required": false }, "parvordo": { "label": "parvordo", "type": "string", "required": false }, "zoodivisio": { "label": "zoodivision", "description": "Used in zoology, a different rank to the division used in botany.", "type": "string", "required": false }, "zoosectio": { "label": "zoosection", "description": "Used in zoology, a different rank to the section used in botany.", "type": "string", "required": false }, "zoosubsectio": { "label": "zoosubsection", "description": "Used in zoology, a different rank to the subsection used in botany.", "type": "string", "required": false }, "unranked_superfamilia": { "label": "Unranked Superfamily", "type": "string", "required": false }, "superfamilia": { "label": "Superfamily", "type": "string", "required": false }, "subfamilia": { "label": "Subfamily", "type": "string", "required": false }, "supertribus": { "label": "supertribus", "type": "string", "required": false }, "unranked_tribus": { "label": "unranked tribe", "type": "string", "aliases": [ "unranked tribus" ], "required": false }, "tribus": { "label": "Tribe", "type": "string", "required": false }, "subtribus": { "label": "Subtribe", "type": "string", "required": false }, "alliance": { "label": "alliance", "type": "string", "required": false, "deprecated": "Displays as a rank between subtribe and genus. " }, "unranked_genus": { "label": "Unranked genus", "type": "string", "aliases": [ "unranked genus" ], "required": false }, "subgenus": { "label": "Subgenus", "type": "string", "required": false }, "sectio": { "label": "Section", "description": "Used in botany, use zoosectio in zoology", "type": "string", "required": false }, "subsectio": { "label": "Subsection", "description": "Used in botany, use zoosubsectio in zoology", "type": "string", "required": false }, "series": { "label": "Series", "type": "string", "required": false }, "subseries": { "label": "Subseries", "type": "string", "required": false }, "species_group": { "label": "Species group", "type": "string", "aliases": [ "species group" ], "required": false }, "species_subgroup": { "label": "species subgroup", "type": "string", "aliases": [ "species subgroup" ], "required": false }, "species_complex": { "label": "species complex", "type": "string", "aliases": [ "species complex" ], "required": false }, "subspecies": { "label": "subspecies", "type": "string", "required": false }, "variety": { "label": "variety", "type": "string", "required": false, "deprecated": "use varietas" }, "forma": { "label": "form", "description": "Used in botany, not in zoology", "type": "string", "required": false }, "trinomial": { "label": "trinomial", "description": "The full trinomial name for subspecies, it should generally be in italics.", "type": "string", "required": false }, "trinomial_authority": { "label": "trinomial authority", "description": "The authority for a trinomial.", "type": "string", "aliases": [ "trinomial authority" ], "required": false }, "synonyms": { "label": "Synonyms", "description": "A list of synonyms for a species, e.g. species1 <small>Authority1</small><br/> species2 <small>Authority2</small>", "type": "string", "required": false }, "synonyms_ref": { "label": "Synonyms ref", "description": "References for the synonym lists, e.g.<ref>Smith and Jones, 2009, p. 5</ref>", "type": "string", "required": false }, "type_species": { "label":
"Type species",
"description": "The original name of the species that was initially used to describe the genus, without regard to its present-day nomenclature.", "type": "string", "required": false }, "type_species_authority": { "label": "Type species authority", "description": "Authority for the type species, don't use parenthesis.", "type": "string", "aliases": [ "type species authority" ], "required": false }, "classification_status": { "label": "Classification status", "description": "Status of the scientific classification, e.g. disputed. Only use when the scientific classification text would be misleading without it.", "type": "string", "aliases": [ "classification status" ], "required": false }, "subdivision_ranks": { "label": "Subdivision ranks", "description": "Rank used for sub-divisions of this taxa, e.g. 'Families'", "type": "string", "aliases": [ "subdivision ranks" ], "required": false }, "subdivision": { "label": "Subdivision", "description": "List of sub divisions of this taxa, e.g. Family1<br/> Family2<br/> Family3", "type": "string", "required": false }, "image2": { "label": "Image 2", "description": "A second image, only use in rare circumstances.", "type": "string", "required": false }, "image2_width": { "label": "Image 2 Width", "description": "Deprecated. Width of the second image", "type": "number", "aliases": [ "image2 width" ], "required": false, "deprecated": true }, "image2_upright": { "label": "Image 2 Upright scale", "description": "Scale of the second image", "type": "number", "aliases": [ "image2 upright" ], "required": false }, "image2_alt": { "label": "Image 2 alt text", "description": "Alt text which describes the second image to someone who can't see it", "type": "string", "aliases": [ "image2 alt" ], "required": false }, "image2_caption": { "label": "Image 2 caption", "description": "Caption to display under the second image", "type": "string", "required": false }, "binomial2": { "label": "Binomial2", "description": "Second binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial2_authority": { "label": "Binomial authority 2", "description": "Authority of second binomial", "type": "string", "aliases": [ "binomial2 authority" ], "required": false }, "binomial3": { "label": "Binomial3", "description": "Third binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial3_authority": { "label": "Binomial authority 3", "description": "Authority of third binomial", "type": "string", "aliases": [ "binomial3 authority" ], "required": false }, "binomial4": { "label": "Binomial4", "description": "Fourth binomial name of taxa, only used in rare circumstances", "type": "string", "required": false }, "binomial4_authority": { "label": "Binomial authority 4", "description": "Authority of fourth binomial", "type": "string", "aliases": [ "binomial4 authority" ], "required": false }, "range_map2": { "label": "Range map 2", "description": "Second map of range", "type": "string", "aliases": [ "range map2" ], "required": false }, "range_map2_width": { "label": "Range map 2 width", "description": "Width of second range map", "type": "string", "aliases": [ "range map2 width" ], "required": false, "deprecated": true }, "range_map2_alt": { "label": "Range map 2 alt text", "description": "Alt text describing the second range map", "type": "string", "aliases": [ "range map2 alt" ], "required": false }, "range_map2_caption": { "label": "Range map 2 caption", "description": "Caption/key for the second range map", "type": "string", "aliases": [ "range map2 caption" ], "required": false }, "range_map3": { "label": "Range map 3", "description": "Third map of range", "type": "string", "aliases": [ "range map3" ], "required": false }, "range_map3_width": { "label": "Range map 3 width", "description": "Width of third range map", "type": "string", "aliases": [ "range map3 width" ], "required": false, "deprecated": true }, "range_map3_alt": { "label": "Range map 3 alt text", "description": "Alt text describing the third range map", "type": "string", "aliases": [ "range map3 alt" ], "required": false }, "range_map3_caption": { "label": "Range map 3 caption", "description": "Caption/key for the third range map", "type": "string", "aliases": [ "range map3 caption" ], "required": false }, "range_map4": { "label": "Range map 4", "description": "Forth map of range", "type": "string", "aliases": [ "range map4" ], "required": false }, "range_map4_width": { "label": "Range map 4 width", "description": "Width of forth range map", "type": "string", "aliases": [ "range map4 width" ], "required": false, "deprecated": true }, "range_map4_alt": { "label": "Range map 4 alt text", "description": "Alt text describing the forth range map", "type": "string", "aliases": [ "range map4 alt" ], "required": false }, "range_map4_caption": { "label": "Range map 4 caption", "description": "Caption/key for the fourth range map", "type": "string", "aliases": [ "range map4 caption" ], "required": false }, "color": { "label": "color", "description": "Generally not used as it is automatically assigned based on the entry for regnum, virus group, unranked phylum, phylum.", "type": "string", "required": false, "deprecated": true }, "genus_authority": { "label": "Genus authority", "type": "string" } }, "format": "Template:\n\n", "paramOrder": [ "name", "image", "image_width", "image_upright", "image_alt", "image_caption", "image_caption_align", "regnum", "divisio", "phylum", "classis", "ordo", "familia", "genus", "genus_authority", "species", "binomial", "binomial_authority", "range_map", "range_map_width", "range_map_alt", "range_map_caption", "status", "status_system", "status_ref", "extinct", "fossil_range", "virus_group", "unranked_superdomain", "superdomain", "superdomain_authority", "domain", "superregnum", "unranked_regnum", "subregnum", "superdivisio", "superphylum", "unranked_div isio", "unranked_phylum", "subphylum", "infraphylum", "microphylum", "nanophylum", "superclassis", "unranked_classis", "unranked_subclassis", "subclassis", "unranked_infraclassis", "infraclassis", "magnordo", "superordo", "unranked_ordo", "subordo", "infraordo", "parvordo", "zoodivisio", "zoosectio", "zoosubsectio", "unranked_superfamilia", "superfamilia", "subfamilia", "supertribus", "unranked_tribus", "tribus", "subtribus", "alliance", "unranked_genus", "subgenus", "sectio", "subsectio", "series", "subseries", "species_group", "species_subgroup", "species_complex", "subspecies", "variety", "forma", "trinomial", "trinomial_authority", "synonyms", "synonyms_ref", "type_species", "type_species_authority", "classification_status", "subdivision_ranks", "subdivision", "image2", "image2_width", "image2_upright", "image2_alt", "image2_caption", "binomial2", "binomial2_authority", "binomial3", "binomial3_authority", "binomial4", "binomial4_authority", "range_map2", "range_map2_width", "range_map2_alt", "range_map2_caption", "range_map3", "range_map3_width", "range_map3_alt", "range_map3_caption", "range_map4", "range_map4_width", "range_map4_alt", "range_map4_caption", "color" ] } </templatedata>
Supporting templates[edit source]
Tracking categories[edit source]
Hidden category added by Taxobox:
Hidden categories added by Taxobox/core:
Hidden categories added by Taxobox/species:
Hidden categories added by Taxobox/Error colour:
See also[edit source]
- Wikipedia:How to read a taxobox
- Wikipedia:Manual of Style/Infoboxes
- Template:Tl
- Automated taxobox system
<div style="display: none">Template:Reflist</div>
Notes[edit source]
<includeonly><!-- Categories below this line, please; interwikis at Wikidata --></includeonly><noinclude> </noinclude></text>
<sha1>6afkilzd4ifgvqza7rndjpt4vla93ce</sha1> </revision> </page> <page> <title>Template:Taxobox/species</title> <ns>10</ns> <id>24758980</id> <revision> <id>816767029</id> <parentid>775239827</parentid> <timestamp>2017-12-23T14:52:37Z</timestamp> <contributor> <username>Jonesey95</username> <id>9755426</id> </contributor> <comment>lower-case cat names per 2011 RFC that moved these categories</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="25863"><noinclude>Template:Documentation</noinclude></text> <sha1>blif8wgwyyodyvosdqfafwqlg86qhx4</sha1> </revision> </page> <page> <title>Template:Taxobox colour</title> <ns>10</ns> <id>12033623</id> <revision> <id>815446650</id> <parentid>755798033</parentid> <timestamp>2017-12-14T21:46:36Z</timestamp> <contributor> <username>Kaldari</username> <id>59944</id> </contributor> <comment>simplifying per Template talk:Taxobox#Colors</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="739"><includeonly>Template:Taxobox/Error colour<!--
--></includeonly><noinclude> Template:Template doc</noinclude></text>
<sha1>d3sx0a9ckwn8woa6b1351hr88ok2gsk</sha1> </revision> </page> <page> <title>Template:Taxobox colour scheme</title> <ns>10</ns> <id>14799909</id> <revision> <id>821289122</id> <parentid>821288988</parentid> <timestamp>2018-01-19T15:14:49Z</timestamp> <contributor> <username>Zzuuzz</username> <id>365454</id> </contributor> <minor/> <comment>Changed protection level for "Template:Taxobox colour scheme": High risk template ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1660">{| class="wikitable"
|- ! style="background:Template:Taxobox colour" | Viruses || Template:Taxobox colour |also Viroids |- ! style="background:Template:Taxobox colour" | Bacteria || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaea || Template:Taxobox colour |also Nanoarchaeota (Nanarchaeota), Korarchaeota, Thaumarchaeota, Crenarchaeota and Euryarchaeota |- ! style="background:Template:Taxobox colour" | Eukaryota || Template:Taxobox colour |For eukaryotes with no other colour defined, including Excavata, Amoebozoa and Opisthokonta |- ! style="background:Template:Taxobox colour" | Animalia || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Fungi || Template:Taxobox colour |- ! style="background:Template:Taxobox colour" | Archaeplastida || Template:Taxobox colour |also Plantae and Viridiplantae |- ! style="background:Template:Taxobox colour" | SAR || Template:Taxobox colour |also Chromalveolata |- ! style="background:Template:Taxobox colour" | incertae sedis || Template:Taxobox colour |- | colspan=2 | Colours not produced by this template: |- ! style='background:rgb(215,240,210)' | Ichnotaxa || rgb(215,240,210) |- ! style='background:rgb(250,250,220)' | Ootaxa || rgb(250,250,220) |}<noinclude>
</noinclude></text>
<sha1>56aaxhsqzcnbra7jrm9p9jn4uy34w03</sha1> </revision> </page> <page> <title>Template:Taxonomy</title> <ns>10</ns> <id>27661849</id> <revision> <id>764331794</id> <parentid>764331491</parentid> <timestamp>2017-02-08T09:08:14Z</timestamp> <contributor> <username>Peter coxhead</username> <id>2153309</id> </contributor> <comment>switch statement is redundant, as never passed an italicizable rank</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="370"><includeonly></includeonly><noinclude>Template:Documentation</noinclude></text> <sha1>8v5w4w6r2w9ofp9wsbfhgroqxd7g6h9</sha1> </revision> </page> <page> <title>Template:Taxonomy/nobreak</title> <ns>10</ns> <id>49415604</id> <revision> <id>804252870</id> <parentid>712712769</parentid> <timestamp>2017-10-07T19:38:00Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>replace br tag plus newline with just br tag</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="290">Script error: No such module "String".<noinclude>Template:Documentation</noinclude></text> <sha1>d30l7w1uufy6kabtzhr4oj3ny6xqrk6</sha1> </revision> </page> <page> <title>Template:TemplateData header</title> <ns>10</ns> <id>40047498</id> <revision> <id>827245794</id> <parentid>826349555</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:TemplateData header": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="501"><div class="templatedata-header">This is the TemplateData documentation for this template used by VisualEditor and other tools; Template:Template error report
TemplateData for Taxobox </div><includeonly></includeonly><noinclude> Template:Documentation </noinclude></text>
<sha1>1lgj007izalttlek052vptodul1clkt</sha1> </revision> </page> <page> <title>Template:Template error report</title> <ns>10</ns> <id>51792646</id> <revision> <id>827245762</id> <parentid>826348773</parentid> <timestamp>2018-02-23T16:30:31Z</timestamp> <contributor> <username>Primefac</username> <id>11508456</id> </contributor> <minor/> <comment>Changed protection level for "Template:Template error report": high-risk template with 4000+ transclusions ([Edit=Require template editor access] (indefinite) [Move=Require template editor access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="278">see the monthly error report for this template.<noinclude>
[[Category:External
link templates]]</noinclude></text> <sha1>58xkdtdvcn1dijd3bs4zlibe610r8r1</sha1> </revision> </page> <page> <title>Template:Tl</title> <ns>10</ns> <id>1487430</id> <revision> <id>836995080</id> <parentid>776260390</parentid> <timestamp>2018-04-18T02:46:37Z</timestamp> <contributor> <username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level for "Template:Tl": used in the mediawiki interface ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite))</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="168">{{[[Template:{{{1}}}|{{{1}}}]]}}<noinclude>
Template:Documentation <!-- Categories go on the /doc subpage and interwikis go on Wikidata. --> </noinclude></text>
<sha1>h0vr3yvr9jdyd17x82vnav21ngwmxuk</sha1> </revision> </page> <page> <title>Template:Tlx</title> <ns>10</ns> <id>4497810</id> <revision> <id>821674175</id> <parentid>618336566</parentid> <timestamp>2018-01-21T23:12:17Z</timestamp> <contributor> <username>Redrose64</username> <id>9612106</id> </contributor> <comment>MOS:ELLIPSIS</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1051"><includeonly><!-- --><code><!-- --><nowiki>{{</nowiki><!-- -->[[Template:|]]<!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><!-- --><nowiki>}}</nowiki><!-- --></code><!--
--></includeonly><noinclude> Template:Documentation</noinclude></text>
<sha1>0dyhbuugzgzyax8gcf5l4wyycg4mps7</sha1> </revision> </page> <page> <title>Template:UF-species</title> <ns>10</ns> <id>19258178</id> <revision> <id>714407463</id> <parentid>714407326</parentid> <timestamp>2016-04-09T15:45:58Z</timestamp> <contributor> <username>SMcCandlish</username> <id>378390</id> </contributor> <comment>ditto</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="951">This template emits a "species" (or "biota") microformat.
The microformat is created by the use of <code>class="biota"</code>, and classes for individual taxonomic ranks, such as <code>class="domain"</code> in a span around <nowiki>{{{domain}}}</nowiki> (full list). Please do not change or remove those classes other than as part of development of the microformat. For background information, see microformats on Wikipedia and the microformat specification.<includeonly></includeonly><noinclude> </noinclude></text>
<sha1>fuqlkggft305v01aekcgpirx6pma0tw</sha1> </revision> </page> <page> <title>Template:Var</title> <ns>10</ns> <id>19311880</id> <revision> <id>816459039</id> <parentid>684205355</parentid> <timestamp>2017-12-21T13:31:52Z</timestamp> <contributor> <username>Izno</username> <id>2927383</id> </contributor> <comment>nix xml lang invocation</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="322"><var style="padding-right: 1px;" >{{{1}}}</var><noinclude>
<!--Categories and interwikis go near the bottom of the /doc page.--> Template:Documentation </noinclude></text>
<sha1>1ph0r212s7cz1dvg2q4quotqwsozpa8</sha1> </revision> </page> <page> <title>Template:Xtag</title> <ns>10</ns> <id>33645369</id> <revision> <id>769239758</id> <parentid>707284440</parentid> <timestamp>2017-03-08T10:11:47Z</timestamp> <contributor> <username>Cedar101</username> <id>374440</id> </contributor> <comment>chem</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="1808"><code class="nowrap"><tag><!--nothing--></code><noinclude>
Template:Documentation </noinclude></text>
<sha1>2smj06z8y5aivrb62i0f8z1e17c5dyq</sha1> </revision> </page> <page> <title>Template:Yesno</title> <ns>10</ns> <id>22255088</id> <revision> <id>821904792</id> <parentid>669640856</parentid> <timestamp>2018-01-23T08:37:08Z</timestamp> <contributor> <username>MSGJ</username> <id>42630</id> </contributor> <comment>add support for on/off, per discussion</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="366">{{<includeonly>safesubst:</includeonly>#switch: {{<includeonly>safesubst:</includeonly>lc: ¬ }} |no |n |false |off |0 = <!-- null --> | = <!-- null --> |¬ = |yes |y |true |on |1 = yes |#default = yes
}}<noinclude> Template:Documentation </noinclude></text>
<sha1>r1wh7ajnm478r67owpatavjany80n9e</sha1> </revision> </page> <page> <title>Template:Yesno-no</title> <ns>10</ns> <id>48375573</id> <revision> <id>825510157</id> <parentid>804450734</parentid> <timestamp>2018-02-13T20:27:17Z</timestamp> <contributor> <username>WOSlinker</username> <id>3138265</id> </contributor> <comment>separate pp-template not needed</comment> <model>wikitext</model> <format>text/x-wiki</format> <text xml:space="preserve" bytes="269">{{safesubst:<noinclude />yesno|{{{1}}}|yes=yes|no=no|blank=no|¬=no|def=no}}<noinclude>
Template:Documentation <!--Categories go in the doc page referenced above; interwikis go in Wikidata.--> </noinclude></text>
<sha1>34vmtxa9ubuh1vz2ulp78m5ela68riu</sha1> </revision> </page> <page> <title>Module:Arguments</title> <ns>828</ns> <id>41298065</id> <revision> <id>696500078</id> <parentid>668829606</parentid> <timestamp>2015-12-23T16:07:27Z</timestamp> <contributor>
<username>Xaosflux</username> <id>502540</id> </contributor> <minor/> <comment>Changed protection level of Module:Arguments: used in the mediawiki interface ex: MediaWiki:Watchlist-details ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite))</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="10054">-- This module provides easy processing of arguments passed to Scribunto from
-- #invoke. It is intended for use by other Lua modules, and should not be -- called from #invoke directly.
local libraryUtil = require('libraryUtil') local checkType = libraryUtil.checkType
local arguments = {}
-- Generate four different tidyVal functions, so that we don't have to check the -- options every time we call it.
local function tidyValDefault(key, val) if type(val) == 'string' then val = val:match('^%s*(.-)%s*$') if val == then return nil else return val end else return val end end
local function tidyValTrimOnly(key, val) if type(val) == 'string' then return val:match('^%s*(.-)%s*$') else return val end end
local function tidyValRemoveBlanksOnly(key, val) if type(val) == 'string' then if val:find('%S') then return val else return nil end else return val end end
local function tidyValNoChange(key, val) return val end
local function matchesTitle(given, title) local tp = type( given ) return (tp == 'string' or tp == 'number') and mw.title.new( given ).prefixedText == title end
local translate_mt = { __index = function(t, k) return k end }
function arguments.getArgs(frame, options) checkType('getArgs', 1, frame, 'table', true) checkType('getArgs', 2, options, 'table', true) frame = frame or {} options = options or {}
--[[ -- Set up argument translation. --]] options.translate = options.translate or {} if getmetatable(options.translate) == nil then setmetatable(options.translate, translate_mt) end if options.backtranslate == nil then options.backtranslate = {} for k,v in pairs(options.translate) do options.backtranslate[v] = k end end if options.backtranslate and getmetatable(options.backtranslate) == nil then setmetatable(options.backtranslate, { __index = function(t, k) if options.translate[k] ~= k then return nil else return k end end }) end
--[[ -- Get the argument tables. If we were passed a valid frame object, get the -- frame arguments (fargs) and the parent frame arguments (pargs), depending -- on the options set and on the parent frame's availability. If we weren't -- passed a valid frame object, we are being called from another Lua module -- or from the debug console, so assume that we were passed a table of args -- directly, and assign it to a new variable (luaArgs). --]] local fargs, pargs, luaArgs if type(frame.args) == 'table' and type(frame.getParent) == 'function' then if options.wrappers then --[[ -- The wrappers option makes Module:Arguments look up arguments in -- either the frame argument table or the parent argument table, but -- not both. This means that users can use either the #invoke syntax -- or a wrapper template without the loss of performance associated -- with looking arguments up in both the frame and the parent frame. -- Module:Arguments will look up arguments in the parent frame -- if it finds the parent frame's title in options.wrapper; -- otherwise it will look up arguments in the frame object passed -- to getArgs. --]] local parent = frame:getParent() if not parent then fargs = frame.args else local title = parent:getTitle():gsub('/sandbox$', ) local found = false if matchesTitle(options.wrappers, title) then found = true elseif type(options.wrappers) == 'table' then for _,v in pairs(options.wrappers) do if matchesTitle(v, title) then found = true break end end end
-- We test for false specifically here so that nil (the default) acts like true. if found or options.frameOnly == false then pargs = parent.args end if not found or options.parentOnly == false then fargs = frame.args end end else -- options.wrapper isn't set, so check the other options. if not options.parentOnly then fargs = frame.args end if not options.frameOnly then local parent = frame:getParent() pargs = parent and parent.args or nil end end if options.parentFirst then fargs, pargs = pargs, fargs end else luaArgs = frame end
-- Set the order of precedence of the argument tables. If the variables are -- nil, nothing will be added to the table, which is how we avoid clashes -- between the frame/parent args and the Lua args. local argTables = {fargs} argTables[#argTables + 1] = pargs argTables[#argTables + 1] = luaArgs
--[[ -- Generate the tidyVal function. If it has been specified by the user, we -- use that; if not, we choose one of four functions depending on the -- options chosen. This is so that we don't have to call the options table -- every time the function is called. --]] local tidyVal = options.valueFunc if tidyVal then if type(tidyVal) ~= 'function' then error( "bad value assigned to option 'valueFunc'" .. '(function expected, got ' .. type(tidyVal) .. ')', 2 ) end elseif options.trim ~= false then if options.removeBlanks ~= false then tidyVal = tidyValDefault else tidyVal = tidyValTrimOnly end else if options.removeBlanks ~= false then tidyVal = tidyValRemoveBlanksOnly else tidyVal = tidyValNoChange end end
--[[ -- Set up the args, metaArgs and nilArgs tables. args will be the one -- accessed from functions, and metaArgs will hold the actual arguments. Nil -- arguments are memoized in nilArgs, and the metatable connects all of them -- together. --]] local args, metaArgs, nilArgs, metatable = {}, {}, {}, {} setmetatable(args, metatable)
local function mergeArgs(tables) --[[ -- Accepts multiple tables as input and merges their keys and values -- into one table. If a value is already present it is not overwritten; -- tables listed earlier have precedence. We are also memoizing nil -- values, which can be overwritten if they are 's' (soft). --]] for _, t in ipairs(tables) do for key, val in pairs(t) do if metaArgs[key] == nil and nilArgs[key] ~= 'h' then local tidiedVal = tidyVal(key, val) if tidiedVal == nil then nilArgs[key] = 's' else metaArgs[key] = tidiedVal end end end end end
--[[ -- Define metatable behaviour. Arguments are memoized in the metaArgs table, -- and are only fetched from the argument tables once. Fetching arguments -- from the argument tables is the most resource-intensive step in this -- module, so we try and avoid it where possible. For this reason, nil -- arguments are also memoized, in the nilArgs table. Also, we keep a record -- in the metatable of when pairs and ipairs have been called, so we do not -- run pairs and ipairs on the argument tables more than once. We also do -- not run ipairs on fargs and pargs if pairs has already been run, as all -- the arguments will already have been copied over. --]]
metatable.__index = function (t, key) --[[ -- Fetches an argument when the args table is indexed. First we check -- to see if the value is memoized, and if not we try and fetch it from -- the argument tables. When we check memoization, we need to check -- metaArgs before nilArgs, as both can be non-nil at the same time. -- If the argument is not present in metaArgs, we also check whether -- pairs has been run yet. If pairs has already been run, we return nil. -- This is because all the arguments will have already been copied into -- metaArgs by the mergeArgs function, meaning that any other arguments -- must be nil. --]] if type(key) == 'string' then key = options.translate[key] end local val = metaArgs[key] if val ~= nil then return val elseif metatable.donePairs or nilArgs[key] then return nil end for _, argTable in ipairs(argTables) do local argTableVal = tidyVal(key, argTable[key]) if argTableVal ~= nil then metaArgs[key] = argTableVal return argTableVal end end nilArgs[key] = 'h' return nil end
metatable.__newindex = function (t, key, val) -- This function is called when a module tries to add a new value to the -- args table, or tries to change an existing value. if type(key) == 'string' then key = options.translate[key] end if options.readOnly then error( 'could not write to argument table key "' .. tostring(key) .. '"; the table is read-only', 2 ) elseif options.noOverwrite and args[key] ~= nil then error( 'could not write to argument table key "' .. tostring(key) .. '"; overwriting existing arguments is not permitted', 2 ) elseif val == nil then --[[ -- If the argument is to be overwritten with nil, we need to erase -- the value in metaArgs, so that __index, __pairs and __ipairs do -- not use a previous existing value, if present; and we also need -- to memoize the nil in nilArgs, so that the value isn't looked -- up in the argument tables if it is accessed again. --]] metaArgs[key] = nil nilArgs[key] = 'h' else metaArgs[key] = val end end
local function translatenext(invariant) local k, v = next(invariant.t, invariant.k) invariant.k = k if k == nil then return nil elseif type(k) ~= 'string' or not options.backtranslate then return k, v else local backtranslate = options.backtranslate[k] if backtranslate == nil then -- Skip this one. This is a tail call, so this
won't cause stack overflow
return translatenext(invariant) else return backtranslate, v end end end
metatable.__pairs = function () -- Called when pairs is run on the args table. if not metatable.donePairs then mergeArgs(argTables) metatable.donePairs = true end return translatenext, { t = metaArgs } end
local function inext(t, i) -- This uses our __index metamethod local v = t[i + 1] if v ~= nil then return i + 1, v end end
metatable.__ipairs = function (t) -- Called when ipairs is run on the args table. return inext, t, 0 end
return args end
return arguments</text>
<sha1>5qx9tzlul9ser30uxj9nbasjt92cevn</sha1> </revision> </page> <page> <title>Module:Check for unknown parameters</title> <ns>828</ns> <id>42286729</id> <revision> <id>726655795</id> <parentid>726655742</parentid> <timestamp>2016-06-23T14:41:43Z</timestamp> <contributor> <username>Frietjes</username> <id>13791031</id> </contributor> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="2400">-- This module may be used to compare the arguments passed to the parent
-- with a list of arguments, returning a specified result if an argument is -- not on the list local p = {}
local function trim(s) return s:match('^%s*(.-)%s*$') end
local function isnotempty(s) return s and trim(s) ~= end
function p.check (frame) local args = frame.args local pargs = frame:getParent().args local ignoreblank = isnotempty(frame.args['ignoreblank']) local showblankpos = isnotempty(frame.args['showblankpositional']) local knownargs = {} local unknown = frame.args['unknown'] or 'Found _VALUE_, ' local preview = frame.args['preview']
local values = {} local res = {} local regexps = {}
-- create the list of known args, regular expressions, and the return string for k, v in pairs(args) do if type(k) == 'number' then v = trim(v) knownargs[v] = 1 elseif k:find('^regexp[1-9][0-9]*$') then table.insert(regexps, '^' .. v .. '$') end end if isnotempty(preview) then preview = '<div class="hatnote" style="color:red"><strong>Warning:</strong> ' .. preview .. ' (this message is shown only in preview).</div>' elseif preview == nil then preview = unknown end
-- loop over the parent args, and make sure they are on the list for k, v in pairs(pargs) do if type(k) == 'string' and knownargs[k] == nil then local knownflag = false for i, regexp in ipairs(regexps) do if mw.ustring.match(k, regexp) then knownflag = true break end end if not knownflag and ( not ignoreblank or isnotempty(v) ) then k = mw.ustring.gsub(k, '[^%w\-_ ]', '?') table.insert(values, k) end elseif type(k) == 'number' and knownargs[tostring(k)] == nil and ( showblankpos or isnotempty(v) ) then local vlen = mw.ustring.len(v) v = mw.ustring.sub(v, 1, (vlen < 25) and vlen or 25) v = mw.ustring.gsub(v, '[^%w\-_ ]', '?') table.insert(values, k .. ' = ' .. v .. ((vlen >= 25) and ' ...' or )) end end
-- add resuls to the output tables if #values > 0 then if frame:preprocess( "-" ) == "" 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:Delink</title> <ns>828</ns> <id>38999128</id> <revision> <id>695173753</id> <parentid>617654635</parentid> <timestamp>2015-12-14T07:03:21Z</timestamp> <contributor> <username>The Earwig</username> <id>7418060</id> </contributor> <minor/> <comment>Protected "Module:Delink": Highly visible template: 55,000+ mainspace transclusions ([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="6545">-- This module de-links most wikitext.
require('Module:No globals')
local p = {}
local getArgs
local function delinkReversePipeTrick(s)
if s:match("^%[%[|.*[|\n]") then -- Check for newlines or multiple pipes. return s else return s:match("%[%[|(.*)%]%]") end
end
local function delinkPipeTrick(s)
local linkarea, display = "", "" -- We need to deal with colons, brackets, and commas, per Help:Pipe trick. -- First, remove the text before the first colon, if any. if s:match(":") then s = s:match("%[%[.-:(.*)|%]%]") -- If there are no colons, grab all of the text apart from the square brackets and the pipe. else s = s:match("%[%[(.*)|%]%]") end -- Next up, brackets and commas. if s:match("%(.-%)$") then -- Brackets trump commas. s = s:match("(.-) ?%(.-%)$") elseif s:match(",") then -- If there are no brackets, display only the text before the first comma. s = s:match("(.-),.*$") end return s
end
local function delinkWikilink(s)
local result = s -- Deal with the reverse pipe trick. if result:match("%[%[|") then return delinkReversePipeTrick(result) end result = mw.uri.decode(result, "PATH") -- decode percent-encoded entities. Leave underscores and plus signs. result = mw.text.decode(result, true) -- decode HTML entities. -- Check for bad titles. To do this we need to find the -- title area of the link, i.e. the part before any pipes. local titlearea if result:match("|") then -- Find if we're dealing with a piped link. titlearea = result:match("^%[%[(.-)|.*%]%]") else titlearea = result:match("^%[%[(.-)%]%]") end -- Check for bad characters. if mw.ustring.match(titlearea, "[%[%]<>{}%%?%c\n]") then return s end -- Check for categories, interwikis, and files. local colonprefix = result:match("%[%[(.-):.*%]%]") or "" -- Get the text before the first colon. local ns = mw.site.namespaces[colonprefix] -- see if this is a known namespace if mw.language.isKnownLanguageTag(colonprefix) or ( ns and ( ns.canonicalName == "File" or ns.canonicalName == "Category" ) ) then return "" end -- Remove the colon if the link is using the Help:Colon trick. if result:match("%[%[:") then result = "[[" .. result:match("%[%[:(.*%]%])") end -- Deal with links using the Help:Pipe trick. if mw.ustring.match(result, "^%[%[[^|]*|%]%]") then return delinkPipeTrick(result) end -- Find the display area of the wikilink if result:match("|") then -- Find if we're dealing with a piped link. result = result:match("^%[%[.-|(.+)%]%]") -- Remove new lines from the display of multiline piped links, -- where the pipe is before the first new line. result = result:gsub("\n", "") else result = result:match("^%[%[(.-)%]%]") end
return result
end
local function delinkURL(s)
-- Assume we have already delinked internal wikilinks, and that -- we have been passed some text between two square brackets [foo]. -- If the text contains a line break it is not formatted as a URL, regardless of other content. if s:match("\n") then return s end -- Check if the text has a valid URL prefix and at least one valid URL character. local valid_url_prefixes = {"//", "http://%22, "https://%22, "ftp://%22, "gopher://%22, "mailto:%22, "news:%22, "irc://%22} local url_prefix for i,v in ipairs(valid_url_prefixes) do if mw.ustring.match(s, '^%[' .. v ..'[^"%s?].*%]' ) then url_prefix = v break end end -- Get display text if not url_prefix then return s end s = s:match("^%[" .. url_prefix .. "(.*)%]") -- Grab all of the text after the URL prefix and before the final square bracket. s = s:match('^.-(["<> ?].*)') or "" -- Grab all of the text after the first URL separator character ("<> ). s = mw.ustring.match(s, "^%s*(%S.*)$") or "" -- If the separating character was a space, trim it off. local s_decoded = mw.text.decode(s, true) if mw.ustring.match(s_decoded, "%c") then return s else return s_decoded end
end
local function delinkLinkClass(s, pattern, delinkFunction)
if not type(s) == "string" then error("Attempt to de-link non-string input.", 2) end if not ( type(pattern) == "string" and mw.ustring.sub(pattern, 1, 1) == "^" ) then error('Invalid pattern detected. Patterns must begin with "^".', 2) end -- Iterate over the text string, and replace any matched text. using the -- delink function. We need to iterate character by character rather -- than just use gsub, otherwise nested links aren't detected properly. local result = ""
while s ~= do -- Replace text using one iteration of gsub. s = mw.ustring.gsub(s, pattern, delinkFunction, 1) -- Append the left-most character to the result string. result = result .. mw.ustring.sub(s, 1, 1) s = mw.ustring.sub(s, 2, -1) end return result
end
function p._delink(args)
local text = args[1] or "" if args.refs == "yes" then -- Remove any Help:Strip markers representing ref tags. In most situations -- this is not a good idea - only use it if you know what you are doing! text = mw.ustring.gsub(text, "?UNIQ%w*%-ref%-%d*%-QINU?", "") end if not (args.comments == "no") then text = text:gsub("<!%-%-.-%-%->", "") -- Remove html comments. end if not (args.wikilinks == "no") then text = delinkLinkClass(text, "^%[%[.-%]%]", delinkWikilink) -- De-link wikilinks. end if not (args.urls == "no") then text = delinkLinkClass(text, "^%[.-%]", delinkURL) -- De-link URLs. end if not (args.whitespace == "no") then -- Replace single new lines with a single space, but leave double new lines -- and new lines only containing spaces or tabs before a second new line. text = mw.ustring.gsub(text, "([^\n \t][ \t]*)\n([ \t]*[^\n \t])", "%1 %2") text = text:gsub("[ \t]+", " ") -- Remove extra tabs and spaces. end return text
end
function p.delink(frame)
if not getArgs then getArgs = require('Module:Arguments').getArgs end return p._delink(getArgs(frame, {wrappers = 'Template:Delink'}))
end
return p</text>
<sha1>9uut60bk5e8nnvyxo8jbf7qt3b17a4v</sha1> </revision> </page> <page> <title>Module:Documentation</title> <ns>828</ns> <id>40256557</id> <revision> <id>729280556</id> <parentid>725653683</parentid> <timestamp>2016-07-11T04:31:31Z</timestamp> <contributor> <username>Andy M. Wang</username> <id>516856</id> </contributor> <comment>rm alt text on icon, since the adjacent text, "Template documentation" or "Module documentation", is sufficient alternative text (per edit request)</comment> <model>Scribunto</model> <format>text/plain</format> <text xml:space="preserve" bytes="36685">-- This module implements Template:Documentation.
-- Get required modules. local getArgs = require('Module:Arguments').getArgs local messageBox = require('Module:Message box')
-- Get the config table. local cfg = mw.loadData('Module:Documentation/config')
local p = {}
-- Often-used functions. local ugsub = mw.ustring.gsub
-- Helper functions -- -- These are defined as local functions, but are made available in the p -- table for testing purposes.
local function message(cfgKey, valArray, expectType) --[[ -- Gets a message from the cfg table and formats it if appropriate. -- The function raises an error if the value from the cfg table is not -- of the type expectType. The default type for expectType is 'string'. -- If the table valArray is present, strings such as $1, $2 etc. in the -- message are substituted with values from the table keys [1], [2] etc. -- For example, if the message "foo-message" had the value 'Foo $2 bar $1.', -- message('foo-message', {'baz', 'qux'}) would return "Foo qux bar baz." --]] local msg = cfg[cfgKey] expectType = expectType or 'string' if type(msg) ~= expectType then error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2) end if not valArray then return msg end
local function getMessageVal(match) match = tonumber(match) return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4) end
local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal) return ret end
p.message = message
local function makeWikilink(page, display) if display then return mw.ustring.format('%s', page, display) else return mw.ustring.format('%s', page) end end
p.makeWikilink = makeWikilink
local function makeCategoryLink(cat, sort) local catns = mw.site.namespaces[14].name return makeWikilink(catns .. ':' .. cat, sort) end
p.makeCategoryLink = makeCategoryLink
local function makeUrlLink(url, display) return mw.ustring.format('[%s %s]', url, display) end
p.makeUrlLink = makeUrlLink
local function makeToolbar(...) local ret = {} local lim = select('#', ...) if lim < 1 then return nil end for i = 1, lim do ret[#ret + 1] = select(i, ...) end return '<small style="font-style: normal;">(' .. table.concat(ret, ' | ') .. ')</small>' end
p.makeToolbar = makeToolbar
-- Argument processing
local function makeInvokeFunc(funcName) return function (frame) local args = getArgs(frame, { valueFunc = function (key, value) if type(value) == 'string' then value = value:match('^%s*(.-)%s*$') -- Remove whitespace. if key == 'heading' or value ~= then return value else return nil end else return value end end }) return p[funcName](args) end end
-- Main function
p.main = makeInvokeFunc('_main')
function p._main(args) --[[ -- This function defines logic flow for the module. -- @args - table of arguments passed by the user -- -- Messages: -- 'main-div-id' --> 'template-documentation' -- 'main-div-classes' --> 'template-documentation iezoomfix' --]] local env = p.getEnvironment(args) local root = mw.html.create() root :wikitext(p.protectionTemplate(env)) :wikitext(p.sandboxNotice(args, env)) -- This div tag is from Template:Documentation/start box, but moving it here -- so that we don't have to worry about unclosed tags. :tag('div') :attr('id', message('main-div-id')) :addClass(message('main-div-classes')) :newline() :wikitext(p._startBox(args, env)) :wikitext(p._content(args, env)) :tag('div') :css('clear', 'both') -- So right or left floating items don't stick out of the doc box. :newline() :done() :done() :wikitext(p._endBox(args, env)) :wikitext(p.addTrackingCategories(env)) return tostring(root) end
-- Environment settings
function p.getEnvironment(args) --[[ -- Returns a table with information about the environment, including title objects and other namespace- or -- path-related data. -- @args - table of arguments passed by the user -- -- Title objects include: -- env.title - the page we are making documentation for (usually the current title) -- env.templateTitle - the template (or module, file, etc.) -- env.docTitle - the /doc subpage. -- env.sandboxTitle - the /sandbox subpage. -- env.testcasesTitle - the /testcases subpage. -- env.printTitle - the print version of the template, located at the /Print subpage. -- -- Data includes: -- env.protectionLevels - the protection levels table of the title object. -- env.subjectSpace - the number of the title's subject namespace. -- env.docSpace - the number of the namespace the title puts its documentation in. -- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace. -- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template. -- -- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value -- returned will be nil. --]]
local env, envFuncs = {}, {}
-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value -- returned by that function is memoized in the env table so that we don't call any of the functions -- more than once. (Nils won't be memoized.) setmetatable(env, { __index = function (t, key) local envFunc = envFuncs[key] if envFunc then local success, val = pcall(envFunc) if success then env[key] = val -- Memoise the value. return val end end return nil end })
function envFuncs.title() -- The title object for the current page, or a test page passed with args.page. local title local titleArg = args.page if titleArg then title = mw.title.new(titleArg) else title = mw.title.getCurrentTitle() end return title end
function envFuncs.templateTitle() --[[ -- The template (or module, etc.) title object. -- Messages: -- 'sandbox-subpage' --> 'sandbox' -- 'testcases-subpage' --> 'testcases' --]] local subjectSpace = env.subjectSpace local title = env.title local subpage = title.subpageText if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then return mw.title.makeTitle(subjectSpace, title.baseText) else return mw.title.makeTitle(subjectSpace, title.text) end end
function envFuncs.docTitle() --[[ -- Title object of the /doc subpage. -- Messages: -- 'doc-subpage' --> 'doc' --]] local title = env.title local docname = args[1] -- User-specified doc page. local docpage if docname then docpage = docname else docpage
= env.docpageBase .. '/' .. message('doc-subpage')
end return mw.title.new(docpage) end
function envFuncs.sandboxTitle() --[[ -- Title object for the /sandbox subpage. -- Messages: -- 'sandbox-subpage' --> 'sandbox' --]] return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage')) end
function envFuncs.testcasesTitle() --[[ -- Title object for the /testcases subpage. -- Messages: -- 'testcases-subpage' --> 'testcases' --]] return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage')) end
function envFuncs.printTitle() --[[ -- Title object for the /Print subpage. -- Messages: -- 'print-subpage' --> 'Print' --]] return env.templateTitle:subPageTitle(message('print-subpage')) end
function envFuncs.protectionLevels() -- The protection levels table of the title object. return env.title.protectionLevels end
function envFuncs.subjectSpace() -- The subject namespace number. return mw.site.namespaces[env.title.namespace].subject.id end
function envFuncs.docSpace() -- The documentation namespace number. For most namespaces this is the same as the -- subject namespace. However, pages in the Article, File, MediaWiki or Category -- namespaces must have their /doc, /sandbox and /testcases pages in talk space. local subjectSpace = env.subjectSpace if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then return subjectSpace + 1 else return subjectSpace end end
function envFuncs.docpageBase() -- The base page of the /doc, /sandbox, and /testcases subpages. -- For some namespaces this is the talk page, rather than the template page. local templateTitle = env.templateTitle local docSpace = env.docSpace local docSpaceText = mw.site.namespaces[docSpace].name -- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon. return docSpaceText .. ':' .. templateTitle.text end
function envFuncs.compareUrl() -- Diff link between the sandbox and the main template using Special:ComparePages. local templateTitle = env.templateTitle local sandboxTitle = env.sandboxTitle if templateTitle.exists and sandboxTitle.exists then local compareUrl = mw.uri.fullUrl( 'Special:ComparePages', {page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText} ) return tostring(compareUrl) else return nil end end
return env end
-- Auxiliary templates
function p.sandboxNotice(args, env) --[=[ -- Generates a sandbox notice for display above sandbox pages. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'sandbox-notice-image' --> '50px' -- 'sandbox-notice-blurb' --> 'This is the $1 for $2.' -- 'sandbox-notice-diff-blurb' --> 'This is the $1 for $2 ($3).' -- 'sandbox-notice-pagetype-template' --> 'template sandbox page' -- 'sandbox-notice-pagetype-module' --> 'module sandbox page' -- 'sandbox-notice-pagetype-other' --> 'sandbox page' -- 'sandbox-notice-compare-link-display' --> 'diff' -- 'sandbox-notice-testcases-blurb' --> 'See also the companion subpage for $1.' -- 'sandbox-notice-testcases-link-display' --> 'test cases' -- 'sandbox-category' --> 'Template sandboxes' --]=] local title = env.title local sandboxTitle = env.sandboxTitle local templateTitle = env.templateTitle local subjectSpace = env.subjectSpace if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then return nil end -- Build the table of arguments to pass to Template:Ombox. We need just two fields, "image" and "text". local omargs = {} omargs.image = message('sandbox-notice-image') -- Get the text. We start with the opening blurb, which is something like -- "This is the template sandbox for Template:Foo (diff)." local text = local pagetype if subjectSpace == 10 then pagetype = message('sandbox-notice-pagetype-template') elseif subjectSpace == 828 then pagetype = message('sandbox-notice-pagetype-module') else pagetype = message('sandbox-notice-pagetype-other') end local templateLink = makeWikilink(templateTitle.prefixedText) local compareUrl = env.compareUrl if compareUrl then local compareDisplay = message('sandbox-notice-compare-link-display') local compareLink = makeUrlLink(compareUrl, compareDisplay) text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink}) else text = text .. message('sandbox-notice-blurb', {pagetype, templateLink}) end -- Get the test cases page blurb if the page exists. This is something like -- "See also the companion subpage for test cases." local testcasesTitle = env.testcasesTitle if testcasesTitle and testcasesTitle.exists then if testcasesTitle.namespace == mw.site.namespaces.Module.id then local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink}) else local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display') local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay) text = text .. '<br />' .. message('sandbox-notice-testcases-blurb', {testcasesLink}) end end -- Add the sandbox to the sandbox category. text = text .. makeCategoryLink(message('sandbox-category')) omargs.text = text local ret = '<div style="clear: both;"></div>' ret = ret .. messageBox.main('ombox', omargs) return ret end
function p.protectionTemplate(env) -- Generates the padlock icon in the top right. -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- Messages: -- 'protection-template' --> 'pp-template' -- 'protection-template-args' --> {docusage = 'yes'} local protectionLevels, mProtectionBanner local title = env.title protectionLevels = env.protectionLevels if not protectionLevels then return nil end local editProt = protectionLevels.edit and protectionLevels.edit[1] local moveProt = protectionLevels.move and protectionLevels.move[1] if editProt then -- The page is edit-protected. mProtectionBanner = require('Module:Protection banner') local reason = message('protection-reason-edit') return mProtectionBanner._main{reason, small = true} elseif moveProt and moveProt ~= 'autoconfirmed' then -- The page is move-protected but not edit-protected. Exclude move -- protection with the level "autoconfirmed", as this is equivalent to -- no move protection at all. mProtectionBanner = require('Module:Protection banner') return mProtectionBanner._main{action = 'move', small = true} else return nil end end
-- Start box
p.startBox = makeInvokeFunc('_startBox')
function p._startBox(args, env) --[[ -- This function generates the start box. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make -- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox -- which generate the box HTML. --]] env = env or p.getEnvironment(args) local links local content = args.content if not content then -- No need to include the links if the documentation is on the template page itself. local linksData = p.makeStartBoxLinksData(args, env) if linksData then links = p.renderStartBoxLinks(linksData) end end -- Generate the start box html. local data = p.makeStartBoxData(args, env, links) if data then return p.renderStartBox(data) else -- User specified no heading. return nil end end
function p.makeStartBoxLinksData(args, env) --[[ -- Does initial processing of data to make the [view] [edit] [history] [purge] links. -- @args - a table of arguments passed by the user -- @env - environment table containing title objects, etc., generated with p.getEnvironment -- -- Messages: -- 'view-link-display' --> 'view' -- 'edit-link-display' --> 'edit' -- 'history-link-display' --> 'history' -- 'purge-link-display' --> 'purge' -- 'file-docpage-preload' --> 'Template:Documentation/preload-filespace' -- 'module-preload' --> 'Template:Documentation/preload-module-doc' -- 'docpage-preload' --> 'Template:Documentation/preload' -- 'create-link-display' --> 'create' --]] local subjectSpace = env.subjectSpace local title = env.title local docTitle = env.docTitle if not title or not docTitle then return nil end
local data = {} data.title = title data.docTitle = docTitle -- View, display, edit, and purge links if /doc exists. data.viewLinkDisplay = message('view-link-display') data.editLinkDisplay = message('edit-link-display') data.historyLinkDisplay = message('history-link-display') data.purgeLinkDisplay = message('purge-link-display') --
Create link if /doc doesn't exist.
local preload = args.preload if not preload then if subjectSpace == 6 then -- File namespace preload = message('file-docpage-preload') elseif subjectSpace == 828 then -- Module namespace preload = message('module-preload') else preload = message('docpage-preload') end end data.preload = preload data.createLinkDisplay = message('create-link-display') return data end