<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://chaldeanwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Test123</id>
		<title>ChaldeanWiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://chaldeanwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Test123"/>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/Special:Contributions/Test123"/>
		<updated>2026-04-29T19:35:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.0</generator>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Test&amp;diff=4817</id>
		<title>Test</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Test&amp;diff=4817"/>
				<updated>2021-03-27T17:15:05Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages /&amp;gt;&lt;br /&gt;
=Translation sample=&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
Stuff to translate&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Images=&lt;br /&gt;
[[File:CETA Virtual Event - April 9th.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
=Gallery=&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:CETA Virtual Event - April 9th.jpg&lt;br /&gt;
File:CETA Virtual Event - April 9th.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Twitter=&lt;br /&gt;
{{#widget:Twitter|user=perfplanet|id=353950675882885120}}&lt;br /&gt;
&lt;br /&gt;
=YouTube=&lt;br /&gt;
{{#widget:YouTube|id=bnztMTSGUV0|width=1280|height=720}} &lt;br /&gt;
&lt;br /&gt;
=Featured image=&lt;br /&gt;
&amp;lt;DPL&amp;gt;&lt;br /&gt;
category = Featured images&lt;br /&gt;
namespace = File&lt;br /&gt;
format    = &amp;lt;gallery widths=300px&amp;gt;,%PAGE%\n,,&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&amp;lt;/DPL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=Random show 5 articles=&lt;br /&gt;
&amp;lt;DPL&amp;gt;&lt;br /&gt;
namespace = &lt;br /&gt;
count=5&lt;br /&gt;
offset = 10&lt;br /&gt;
offset = 100&lt;br /&gt;
&amp;lt;/DPL&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=3X3 responsive gallery=&lt;br /&gt;
&amp;lt;div class=&amp;quot;table-cell highlights&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;ul class=&amp;quot;gallery3&amp;quot; style=&amp;quot;max-width:700px;margin:0 auto;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_01&amp;quot;&amp;gt;[[File:Wiki People 208.jpg|250px|link=Chaldean People]]&amp;lt;span&amp;gt;Chaldean People&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_02&amp;quot;&amp;gt;[[File:Wiki Modren History.jpg|250px|link=Modern History]]&amp;lt;span&amp;gt;Modern History&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_03&amp;quot;&amp;gt;[[File:Wiki Chaldean Family Trees.jpg|250px|link=Chaldean Family Trees]]&amp;lt;span&amp;gt;Chaldean Family Trees&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_04&amp;quot;&amp;gt;[[File:Wiki Chaldean Church.jpg|250px|link=Church]]&amp;lt;span&amp;gt;Church&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_05&amp;quot;&amp;gt;[[File:Wiki Chaldean Food.jpg|250px|link=Food]]&amp;lt;span&amp;gt;Food&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_06&amp;quot;&amp;gt;[[File:Wiki Language 208.jpg|250px|link=Chaldean Language]]&amp;lt;span&amp;gt;Chaldean Language&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_07&amp;quot;&amp;gt;[[File:Wiki Photos.jpg|250px|link=Photographs]]&amp;lt;span&amp;gt;Photographs&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_08&amp;quot;&amp;gt;[[File:Wiki Culture 208.jpg|250px|link=Chaldean Culture]]&amp;lt;span&amp;gt;Chaldean Culture&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li class=&amp;quot;collect_09&amp;quot;&amp;gt;[[File:Wiki Sound-Recordings 208.jpg|250px|link=Sound Recordings]]&amp;lt;span&amp;gt;Sound Recordings&amp;lt;/span&amp;gt;&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Chaldean_Timeline&amp;diff=4676</id>
		<title>Chaldean Timeline</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Chaldean_Timeline&amp;diff=4676"/>
				<updated>2019-03-18T12:20:09Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{EngvarB|date=September 2019}}&lt;br /&gt;
{{Use dmy dates|date=September 2019}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This is a '''timeline of Chaldean history''', comprising important legal and territorial changes and political events in Chaldea and Babylonia and its predecessor states.  To read about the background to these events, see [[Chaldeans]].  See also the [[lChaldean People]] .&amp;lt;ref&amp;gt;ChaldeanWiki.org, ''Chronology of Chaldean History'' (2019) has details for every year.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== {{Dynamic list}} ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toc&amp;quot;&amp;gt; '''Centuries''': [[#1st century|1st]]{{·}}[[#2nd century|2nd]]{{·}}[[#3rd century|3rd]]{{·}}[[#4th century|4th]]{{·}}[[#5th century|5th]]{{·}}[[#6th century|6th]]{{·}}[[#7th century|7th]]{{·}}[[#8th century|8th]]{{·}}[[#9th century|9th]]{{·}}[[#10th century|10th]]{{·}}[[#11th century|11th]]{{·}}[[#12th century|12th]]{{·}}[[#13th century|13th]]{{·}}[[#14th century|14th]]{{·}}[[#15th century|15th]]{{·}}[[#16th century|16th]]{{·}}[[#17th century|17th]]{{·}}[[#18th century|18th]]{{·}}[[#19th century|19th]]{{·}}[[#20th century|20th]]{{·}}[[#21st century|21st]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Dynamic list}}&lt;br /&gt;
&lt;br /&gt;
== BC centuries ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || Event&lt;br /&gt;
|-&lt;br /&gt;
| 848 ||   &lt;br /&gt;
&lt;br /&gt;
[[File:Chaldean Settlements Balawat Gate 848 BC.PNG|thumb|Chaldean Settlements Balawat Gate 848 BC]]&lt;br /&gt;
Chaldean Settlements Balawat Gate 848 BC of [[Chaldean People]].  This is a royal gate assembled by ancient Assyrian King to reflect on their occupation of Chaldea and the ethnic Chaldean tribes. Reference is The British Museum. &lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 745 || &lt;br /&gt;
[[File:Chaldeans in the Nimrud Letters 745 BC.PNG|thumb|Chaldeans in the Nimrud Letters 745 BC]] &lt;br /&gt;
[[Chaldean people]] and Chaldean cities are documented in 40 letters discovered with ancient Assyrian king Tiglath-pileser III during his military Campaigns and occupation of Chaldea and Chaldean cities.&lt;br /&gt;
&lt;br /&gt;
By: Profesor Henry W. F. Saggs, PHD&lt;br /&gt;
Dr. Saggs, a respected archoelogist and helped discover Nimrud city. He joined Max Mallowan's excavation at Nimrud under the aegis of the British School of Archaeology in Iraq.&lt;br /&gt;
&lt;br /&gt;
Dr. Saggs was awarded his PhD degree in 1953 for his dissertation titled A study of city administration in Assyria and Babylonia in the period 705 to 539 B.C. He joined SOAS as a lecturer in Akkadian.&lt;br /&gt;
&lt;br /&gt;
JOURNAL ARTICLE: Chaldeans in the Nimrud Letters&lt;br /&gt;
Wiener Zeitschrift für die Kunde des Morgenlandes&lt;br /&gt;
Vol. 86, (1996), pp. 379-390&lt;br /&gt;
&lt;br /&gt;
Published by: University of Vienna, Department of Oriental Studies&lt;br /&gt;
https://www.jstor.org/stable/23864750&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1 to 300 ||   Chaldean Astronomy in the Last Three Centuries BC&lt;br /&gt;
[[File:Chaldean Astronomy in three centuries BC.PNG|thumb|Chaldean Astronomy in three centuries BC]]&lt;br /&gt;
&lt;br /&gt;
An 8 page detailed research by the American Oriental Society published in 1955 describing the #Chaldean people impact on the world of science and astronomy. Listing Chaldean scientists from the 1st to 3rd Century BC such as Seleucus of Seleucia (south of #Baghdad and near #Babylon) and his contributions to #astronomy and study of stars and plants that impacted our knowledge until today.&lt;br /&gt;
&lt;br /&gt;
Reference: Journal of the American Oriental Society&lt;br /&gt;
Vol. 75, No. 3 (Jul. - Sep., 1955), pp. 166-173 (8 pages)&lt;br /&gt;
URL: https://www.jstor.org/stable/595168&lt;br /&gt;
|-&lt;br /&gt;
| 191 BC to 52 AD || &lt;br /&gt;
[[File:Chaldeans in Rome 191 BC to 52 AD.PNG|thumb|Chaldeans in Rome 191 BC to 52 AD]]&lt;br /&gt;
Chaldeans in the Roman Empire, Italy,  (191 BC to 52 AD)&lt;br /&gt;
&lt;br /&gt;
“Expulsion of Chaldeans from Rome”. Executed by various Roman Emperors.&lt;br /&gt;
&lt;br /&gt;
Chaldean people have uncovered a historical treasure of various documents describing Chaldeans in Rome and their expulsion by various Roman emperors such as Claudius (41 to 54 AD), Augustus (27 BC to 14 AD), Tiberius (14 AD to 37 AD).&lt;br /&gt;
&lt;br /&gt;
Chaldeans were active in the Roman empire as astronomers, mathematicians, philosophers, historians, theologians and astrologists.&lt;br /&gt;
&lt;br /&gt;
References: Diaspora, Jews amidst Greeks and Romans. Other references are also available and can be obtained from Google Books&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 1st century AD ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en;align:right&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
|  [[Saint Peter the Apostle|Peter the Apostle]] is in [[Babylon]] to establish to convert new Christians, 1 Peter 5:13.&lt;br /&gt;
|-&lt;br /&gt;
| 40&lt;br /&gt;
|   [[Saint Peter the Apostle|Thomas the Apostle]] are in [[Babylon]] to establish the Church of Adiabene (near Arbil) and Csiphon (near Baghdad). &lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Example.jpg|Caption1&lt;br /&gt;
Example.jpg|Caption2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[[thumbnail]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 52 AD || &lt;br /&gt;
[[File:Chaldeans in Rome 191 BC to 52 AD.PNG|thumb|Chaldeans in Rome 191 BC to 52 AD]]&lt;br /&gt;
Chaldeans in the Roman Empire, Italy,  (191 BC to 52 AD)&lt;br /&gt;
&lt;br /&gt;
“Expulsion of Chaldeans from Rome”. Executed by various Roman Emperors.&lt;br /&gt;
&lt;br /&gt;
Chaldean people have uncovered a historical treasure of various documents describing Chaldeans in Rome and their expulsion by various Roman emperors such as Claudius (41 to 54 AD), Augustus (27 BC to 14 AD), Tiberius (14 AD to 37 AD).&lt;br /&gt;
&lt;br /&gt;
Chaldeans were active in the Roman empire as astronomers, mathematicians, philosophers, historians, theologians and astrologists.&lt;br /&gt;
&lt;br /&gt;
References: Diaspora, Jews amidst Greeks and Romans. Other references are also available and can be obtained from Google Books&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2nd century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 122 || || Romans construct the [[Hadrian's Wall]].&lt;br /&gt;
|-&lt;br /&gt;
| 143 || || Romans construct the [[Antonine Wall]].&lt;br /&gt;
|-&lt;br /&gt;
| 163 || || Romans withdraw south to [[Trimontium (Newstead)|Trimontium]] and [[Hadrian's Wall]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3rd century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 300 || || The term [[Pict]] is first recorded in describing the federated tribes invaded by [[Constantius Chlorus]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 4th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 397 || || Traditional date at which [[Saint Ninian]] establishes a Christian mission at [[Whithorn]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 5th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 470 || || [[Votadini]] peoples form the kingdom of [[Gododdin]] in the region north of the [[River Tweed]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 6th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 547 || || [[Angles]] capture the Northumbrian fortress at [[Bamburgh]] and found the kingdom of [[Bernicia]].&lt;br /&gt;
|-&lt;br /&gt;
| 563 || || [[Saint Columba]] founds a monastery at [[Iona]] and begins his mission to the northern Picts.&lt;br /&gt;
|-&lt;br /&gt;
| 574 || || [[Áedán mac Gabráin]] begins reign over the [[Gaels|Gaelic]] kingdom of [[Dál Riata]].&lt;br /&gt;
|-&lt;br /&gt;
| 575 || ||  Western Scotland is granted independence from the Irish Dalriada, after a convention at Drum Ceatt near Derry.&lt;br /&gt;
|-&lt;br /&gt;
| 580 || || [[Riderch I of Alt Clut]] rules region later known as the kingdom of [[Kingdom of Strathclyde|Strathclyde]].&lt;br /&gt;
|-&lt;br /&gt;
| 584 || || [[Bridei I|Bruide, son of Maelchon,]] dies.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 7th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 604 || || [[Æthelfrith]] unites [[Bernicia]] and [[Deira (kingdom)|Deira]] to form the kingdom of [[Northumbria]].&lt;br /&gt;
|-&lt;br /&gt;
| 638 || || [[Northumbria]]ns capture [[Edinburgh]] from Gododdin.&lt;br /&gt;
|-&lt;br /&gt;
| 680 || || [[Trumwine]] Bishop of [[Abercorn]].&lt;br /&gt;
|-&lt;br /&gt;
| 681 || || [[Bridei III|Bruide mac Bili]], King of [[Fortriu]], campaigns against Orkney.&lt;br /&gt;
|-&lt;br /&gt;
| 685 || || Pictish King Bruide mac Bili defeats [[Ecgfrith of Northumbria]] at the [[Battle of Dun Nechtain]], halting the northern expansion of Northumbria.&lt;br /&gt;
|-&lt;br /&gt;
| 693 || || Bruide mac Bili dies.&lt;br /&gt;
|-&lt;br /&gt;
| 697 || || [[Bridei IV|Bruide mac Der-Ilei]] among the signatories of the [[Cáin Adomnáin]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 8th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 717 || || [[Nechtan IV of the Picts|Nechtan mac Der-Ilei]] expels [[Iona]]n clergy from Pictland and adopts Roman usages with the aid of Bishop [[Curetán]]; masons sent by Abbot [[Ceolfrid]] of [[Monkwearmouth-Jarrow Priory]] help build stone churches at [[Restenneth]], [[Rosemarkie]] and elsewhere in eastern Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 724 || || [[Drest VII|Drust]] and Nechtan mac Der-Ilei fight civil war (to 729).&lt;br /&gt;
|-&lt;br /&gt;
| 732 || || Death of Nechtan mac Der-Ilei; [[Óengus I|Óengus mac Fergusa]] becomes King of the Picts.&lt;br /&gt;
|-&lt;br /&gt;
| 735 || || Óengus mac Fergusa, King of the Picts, campaigns against Dál Riata, and seizes and burns the royal centre of [[Dunadd]].&lt;br /&gt;
|-&lt;br /&gt;
| 736 || || Battle of Cnoc Coirpi between Fortriu and Dál Riata.&lt;br /&gt;
|-&lt;br /&gt;
| 741 || || Battle of Druimm Cathmail between Fortriu and Dál Riata; the &amp;quot;smiting of Dál Riata&amp;quot;, in which Dál Riata is subdued by Óengus mac Fergusa.&lt;br /&gt;
|-&lt;br /&gt;
| 747 || || [[St Andrews]] founded by this time, death of Abbot [[Túathalán]].&lt;br /&gt;
|-&lt;br /&gt;
| 750 || || Picts defeated by Britons at the Battle of Catohic.&lt;br /&gt;
|-&lt;br /&gt;
| 756 || || Óengus mac Fergusa allied with the English of Northumbria attacks the Britons; the English army is destroyed.&lt;br /&gt;
|-&lt;br /&gt;
| 761 || || Death of Óengus mac Fergusa.&lt;br /&gt;
|-&lt;br /&gt;
| 763 || || Battle takes place in Fortriu between [[Ciniod I of the Picts|Ciniod]] and [[Áed Find]]; result unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 778 || || Death of Áed Find, King of Dál Riata.&lt;br /&gt;
|-&lt;br /&gt;
| 794 || || Annals of Ulster report the &amp;quot;wasting&amp;quot; of &amp;quot;all the islands of Britain by gentiles [Vikings]&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 9th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 802 || || Iona burned by [[Vikings]].&lt;br /&gt;
|-&lt;br /&gt;
| 806 || || The monasteries under Iona are attacked by Vikings, killing 68 monks.&lt;br /&gt;
|-&lt;br /&gt;
| 820 || || Death of [[Caustantín of the Picts|Caustantín mac Fergusa]].&lt;br /&gt;
|-&lt;br /&gt;
| 829 || || Abbot [[Diarmait of Iona|Diarmait]], [[abbot of Iona]], goes to ''Alba'' with relics of St Columba.&lt;br /&gt;
|-&lt;br /&gt;
| 831 || || Diarmait of Iona goes to Ireland with relics of St Columba.&lt;br /&gt;
|-&lt;br /&gt;
| 839 || || [[Uen of the Picts|Eóganan mac Óengusa]] and his brother Bran killed in battle with Vikings, end of dominance of [[Fortriu]].&lt;br /&gt;
|-&lt;br /&gt;
| 858 || || Death of [[Kenneth mac Alpin]], [[King of the Picts]]; &amp;quot;union of Picts and Scots&amp;quot; traditionally dated from his reign.&lt;br /&gt;
|-&lt;br /&gt;
| 870 || || Alt Clut—[[Dumbarton Rock]] — captured by the [[Norse-Gael]] or [[Viking]] leaders [[Amlaíb Conung]] and [[Ímar]] after a six-month of siege.&lt;br /&gt;
|-&lt;br /&gt;
| 878 || || Kenneth mac Alpin's son [[Áed of Scotland|Áed]] killed; [[Giric of Scotland|Giric]] becomes king.&lt;br /&gt;
|-&lt;br /&gt;
| 889 || || Death of Giric; [[Domnall mac Causantín]], grandson of Kenneth, becomes king.&lt;br /&gt;
|-&lt;br /&gt;
| 890 || || The Strathclyde Britons are exiled to the [[Kingdom of Gwynedd|Gwynedd]] in Wales.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 10th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 900 || || [[Causantín mac Áeda]] succeeds Domnall mac Causantín.&lt;br /&gt;
|-&lt;br /&gt;
| 937 || || [[Battle of Brunanburh]] English victory in 937 by the army of Æthelstan, King of England, and his brother Edmund over the combined armies of Olaf III Guthfrithson, the Norse-Gael King of Dublin, Constantine II, King of Scots, and Owen I, King of Strathclyde.&lt;br /&gt;
|-&lt;br /&gt;
| 940 || || Saint [[Catroe of Metz]] leaves Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 943 || || Causantín mac Áeda abdicates to become a [[culdee]] at St Andrews.&lt;br /&gt;
|-&lt;br /&gt;
| 952 || || Death of Causantín mac Áeda.&lt;br /&gt;
|-&lt;br /&gt;
| 954 || || [[Indulf of Scotland|Indulf]] captures Edinburgh from Northumbria.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 11th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1058 || || After defeating [[Macbeth of Scotland|Mac Bethad]] and [[Lulach]], [[Malcolm III of Scotland|Máel Coluim III]] is proclaimed king.&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || || [[Battle of Cruden Bay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 12th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:10en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1124 || || [[David I of Scotland|David I]] becomes king and introduces the feudal system of landholding to much of Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 1128 || || David I founds [[Holyrood Abbey]] at Edinburgh.&lt;br /&gt;
|-&lt;br /&gt;
| 1136 || || [[Glasgow Cathedral]] (St Kentigern's, begun 1123) consecrated in the presence of David I.&lt;br /&gt;
|-&lt;br /&gt;
| 1153 || || [[Somerled]] sacks Glasgow and its vicinity.&lt;br /&gt;
|-&lt;br /&gt;
| 1156 || || Somerled defeats the Norse [[King of Mann and the Isles]], establishing his own semi-independent rule as ''ri Innse Gall''-King of the Hebrides.&lt;br /&gt;
|-&lt;br /&gt;
| 1164 || || Somerled is defeated by [[Malcolm IV of Scotland|Malcolm IV]] in the [[Battle of Renfrew]].&lt;br /&gt;
|-&lt;br /&gt;
| 1174 || || [[William I of Scotland|William I]] signs the [[Treaty of Falaise]] in which he swears allegiance to [[Henry II of England]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 13th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1234 ||   Galloway's independent existence ends with the death of [[Alan, Lord of Galloway]].&lt;br /&gt;
|-&lt;br /&gt;
| 1237 ||   Southern border of Scotland established in the [[Treaty of York]].&lt;br /&gt;
|-&lt;br /&gt;
| 1259 ||   Chaldean People are in Pisa Italy [[Chaldean people]].&lt;br /&gt;
[[File:1259 Pisa.PNG|thumb|Chaldean people of Pisa, Italy 1259 AD]]&lt;br /&gt;
|-&lt;br /&gt;
| 1266 ||   [[Norway]] cedes the [[Hebrides]] and [[Isle of Man]] to Scotland in the [[Treaty of Perth]].&lt;br /&gt;
|-&lt;br /&gt;
| 1292 ||   [[Edward I of England]] intervenes in Scottish affairs and grants the Scottish throne to [[John Balliol]].&lt;br /&gt;
|-&lt;br /&gt;
| 1297 ||   [[Andrew Moray|Andrew de Moravia]] and [[William Wallace]] lead the Scots to victory over England at [[Battle of Stirling Bridge|Stirling Bridge]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 14th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || || [[William Wallace]] is executed in London.&lt;br /&gt;
|-&lt;br /&gt;
| 1314 || || [[Robert the Bruce]] defeats the English at [[Battle of Bannockburn|Bannockburn]].&lt;br /&gt;
|-&lt;br /&gt;
| 1320 || || Nobles assert Scottish independence in the [[Declaration of Arbroath]].&lt;br /&gt;
|-&lt;br /&gt;
| 1328 || || [[Treaty of Northampton]]. England recognises [[Scottish independence]].&lt;br /&gt;
|-&lt;br /&gt;
| 1329 || || Death of Robert the Bruce. His 5-year-old son, [[David II of Scotland|David II]] succeeds him.&lt;br /&gt;
|-&lt;br /&gt;
| 1371 || || [[Robert II of Scotland|Robert II]] becomes first [[House of Stuart|Stewart]] king.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 15th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year   || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1402 ||   English defeat Scots in the [[Battle of Nesbit Moor (1402)|Battle of Nesbit Moor]] and the [[Battle of Humbleton Hill]].&lt;br /&gt;
|-&lt;br /&gt;
| 1425 ||   Chaldeans by the British Library [[Chaldean people]].&lt;br /&gt;
[[File:1425 Chaldeans by the British Library.PNG|thumb|1425 Chaldeans by the British Library]]&lt;br /&gt;
|-&lt;br /&gt;
| 1442 ||   Chaldean People of Cyprus REJOINED the Catholic Faith [[Chaldean people]].&lt;br /&gt;
|-&lt;br /&gt;
| 1468 ||   [[Denmark]] cedes [[Orkney]] and [[Shetland]] from [[Norway]] to Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 1493 ||   [[Lord of the Isles|Lordship of the Isles]] abolished.  In 1540 the title was reserved to the crown.&lt;br /&gt;
|-&lt;br /&gt;
| 1495 ||   Creation of the [[University of Aberdeen]] (King's College).&lt;br /&gt;
|-&lt;br /&gt;
| 1496 ||   [[Education Act 1496|Education Act of 1496]] makes education compulsory for [[Baron#Scotland|baron]]s and wealthy landowners.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 16th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1513 || || [[James IV of Scotland|James IV]] and thousands of Scots are killed at [[Battle of Flodden Field|Flodden]].&lt;br /&gt;
|-&lt;br /&gt;
| 1532 || || Creation of the [[College of Justice]] and the [[Court of Session]].&lt;br /&gt;
|-&lt;br /&gt;
| 1542 || || Death of [[James V of Scotland|James V]].&lt;br /&gt;
|-&lt;br /&gt;
| 1559 || || [[John Knox]] returns to Scotland from [[Geneva]] to promote [[Calvinism]].&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || || [[Scottish Reformation Parliament|Parliament]] legislates [[Scottish Reformation|Protestant Reformation]] of the [[Church of Scotland]].&lt;br /&gt;
|-&lt;br /&gt;
| 1561 || || [[Mary, Queen of Scots]] returns from France.&lt;br /&gt;
|-&lt;br /&gt;
| 1568 || || Mary, Queen of Scots flees to England following the defeat of her army at the [[Battle of Langside]].&lt;br /&gt;
|-&lt;br /&gt;
| 1579 || || [[James VI and I|James VI]] takes over government from his regent, [[James Douglas, 4th Earl of Morton|James Douglas]].&lt;br /&gt;
|-&lt;br /&gt;
| 1582 || || Establishment of the [[University of Edinburgh]] by Royal Charter.&lt;br /&gt;
|-&lt;br /&gt;
| 1587 || || Mary is beheaded by the order of [[Queen Elizabeth I of England]].&lt;br /&gt;
|-&lt;br /&gt;
| 1589 || || James VI marries [[Anne of Denmark]] in Oslo.&lt;br /&gt;
|-&lt;br /&gt;
| 1592 || || James VI enacts the &amp;quot;Golden Act&amp;quot; recognising the power of [[Presbyterianism]] within the Scottish church.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 17th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1603 ||   The [[Union of the Crowns]]: [[James VI]] of Scotland becomes [[James I of England]].&lt;br /&gt;
|-&lt;br /&gt;
| 1614 ||  [[John Napier]] invents [[logarithm]]s and publishes a book promoting their use in mathematics.&lt;br /&gt;
|-&lt;br /&gt;
| 1626 ||   Chaldean language is shared by polyglot and genius Kricher [[Chaldean Language]].&lt;br /&gt;
[[File:1626 Chaldean Alphabet by Kricher.PNG|thumb|1626 Chaldean Alphabet by Kricher]]&lt;br /&gt;
|-&lt;br /&gt;
| 1633 ||  [[Education Act 1633|Education Act of 1633]] ordains a school in every [[Parish#Scotland|parish]] (partially successful).&lt;br /&gt;
|-&lt;br /&gt;
| 1699 ||   Chaldean language publication by Dr. Ellis Luis Dupin [[Chaldean Language]]&lt;br /&gt;
[[File:1699 AD Chaldean Language.PNG|thumb|1699 AD Chaldean Language]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 18th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1707 || || The Union of the Parliaments: the [[Acts of Union 1707|Acts of Union]] are passed by both the Scottish and English parliaments.&lt;br /&gt;
|-&lt;br /&gt;
| 1715 || || [[Jacobite rising of 1715]].&lt;br /&gt;
|-&lt;br /&gt;
| 1745 || || [[Jacobite rising of 1745]].&lt;br /&gt;
|-&lt;br /&gt;
| 1746 || || The [[Battle of Culloden]] ends the [[Jacobite rising of 1745|last Jacobite rising]].&lt;br /&gt;
|-&lt;br /&gt;
| 1748 || || [[David Hume]] publishes ''[[An Enquiry Concerning Human Understanding]]''.&lt;br /&gt;
|- January 25, 1759 the birth of Robert burns&lt;br /&gt;
| 1754 || || [[Joseph Black]] discovers &amp;quot;fixed air&amp;quot; ([[carbon dioxide]]).&lt;br /&gt;
|-&lt;br /&gt;
| 1768 || || The [[Encyclopædia Britannica First Edition]] commences publication.&lt;br /&gt;
|-&lt;br /&gt;
| 1769 || || [[James Watt]] patents idea for separate condensing chamber in the [[steam engine]].&lt;br /&gt;
|-&lt;br /&gt;
| 1775 || || Passage of the [[Colliers and Salters (Scotland) Act 1775]] commences the removal of life bondage of coal and salt workers.&amp;lt;ref&amp;gt;{{cite book|last=Mantoux|first=Paul|title=The Industrial Revolution in the Eighteenth Century|url=https://books.google.co.uk/books?id=5Q78AQAAQBAJ&amp;amp;lpg=PA74&amp;amp;ots=ygw03U9E1K&amp;amp;dq=Colliers%20and%20Salters%201775&amp;amp;pg=PA74#v=onepage&amp;amp;q=Colliers%20and%20Salters%201775&amp;amp;f=false|year=1964|publisher=Jonathan Cape|page=74}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1776 || || [[Adam Smith]] publishes ''[[The Wealth of Nations]]''.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 19th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year   || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1849 ||   [[Chaldean people]] of Kurdistan, Iraq witnessed by respected British archaeologist William Kenneth Luftus&lt;br /&gt;
[[File:1849 Chaldeans of Kurdistan.PNG|thumb|1849 Chaldeans of Kurdistan]]&lt;br /&gt;
|-&lt;br /&gt;
| 1850 ||   [[Chaldean Nation]] and [[Chaldean people]] recognition by British archaeologist William Kenneth Luftus&lt;br /&gt;
[[File:Chaldean Nation recognition 1850.PNG|thumb|Chaldean Nation recognition 1850]]&lt;br /&gt;
|-&lt;br /&gt;
| 1879 ||   Chaldean archaeologist Hormuzd Rassam reflects on his [[Chaldean people]], Chaldean nation and Chaldean ethnicity.&lt;br /&gt;
[[File:Hormuzd Rassam 1879.PNG|thumb|Hormuzd Rassam 1879]]&lt;br /&gt;
|-&lt;br /&gt;
| 1880 ||   Chaldean archaeologist Hormuzd Rassam reflects on his [[Chaldean people]], Chaldean nation and Chaldean ethnicity.&lt;br /&gt;
[[File:Hormuzd Rassam.PNG|thumb|Hormuzd Rassam]]&lt;br /&gt;
|-&lt;br /&gt;
| 1891 ||   [[Chaldean people]] census of Urmia, Iran (Persia). 25,000 Chaldeans of Nestorian faith.&lt;br /&gt;
[[File:1891 Census of Urmia.PNG|thumb|1891 Census of Urmia]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 20th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1906 ||   Chaldean people and country description by Al Maktabas publication (in Arabic language).&lt;br /&gt;
[[File:Chaldean Country by Al Maktabas 1906.PNG|thumb|Chaldean Country by Al Maktabas 1906]]&lt;br /&gt;
|-&lt;br /&gt;
| 1913 ||  [[Chaldean people]] are in New York City&lt;br /&gt;
[[File:Chaldeans of New York City 1913.PNG|thumb|Chaldeans of New York City 1913]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 21st century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 2004  || [[Chaldean people]] are ethnic people of [[Mesopotamia]] by Dr. Mary Sengstock, respected professor of sociology. Professor Sengstock supervised 16 PHD dissertations.&lt;br /&gt;
[[File:Chaldean Ethnicity by Mary Sengstock.PNG|thumb|Chaldean Ethnicity by Dr. Mary Sengstock]]&lt;br /&gt;
|-&lt;br /&gt;
| 2007 ||   Chaldean people ethnicity by Dr. Mary Sengstock&lt;br /&gt;
[[File:Chaldean Ethnicity by Mary Sengstock 2.PNG|thumb|Chaldean Ethnicity by Dr. Mary Sengstock 2]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[[Chaldean family tree]]&lt;br /&gt;
* [[Timeline of Chaldean history]]&lt;br /&gt;
*[[Timeline of prehistoric Chaldea]]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Chaldean history timelines| ]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Chaldean_Timeline&amp;diff=4675</id>
		<title>Chaldean Timeline</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Chaldean_Timeline&amp;diff=4675"/>
				<updated>2019-03-18T12:19:12Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: /* Notes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{short description|List of significant events in the history of Chaldeans}}&lt;br /&gt;
{{EngvarB|date=September 2019}}&lt;br /&gt;
{{Use dmy dates|date=September 2019}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
This is a '''timeline of Chaldean history''', comprising important legal and territorial changes and political events in Chaldea and Babylonia and its predecessor states.  To read about the background to these events, see [[Chaldeans]].  See also the [[lChaldean People]] .&amp;lt;ref&amp;gt;ChaldeanWiki.org, ''Chronology of Chaldean History'' (2019) has details for every year.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== {{Dynamic list}} ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;toc&amp;quot;&amp;gt; '''Centuries''': [[#1st century|1st]]{{·}}[[#2nd century|2nd]]{{·}}[[#3rd century|3rd]]{{·}}[[#4th century|4th]]{{·}}[[#5th century|5th]]{{·}}[[#6th century|6th]]{{·}}[[#7th century|7th]]{{·}}[[#8th century|8th]]{{·}}[[#9th century|9th]]{{·}}[[#10th century|10th]]{{·}}[[#11th century|11th]]{{·}}[[#12th century|12th]]{{·}}[[#13th century|13th]]{{·}}[[#14th century|14th]]{{·}}[[#15th century|15th]]{{·}}[[#16th century|16th]]{{·}}[[#17th century|17th]]{{·}}[[#18th century|18th]]{{·}}[[#19th century|19th]]{{·}}[[#20th century|20th]]{{·}}[[#21st century|21st]]&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Dynamic list}}&lt;br /&gt;
&lt;br /&gt;
== BC centuries ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || Event&lt;br /&gt;
|-&lt;br /&gt;
| 848 ||   &lt;br /&gt;
&lt;br /&gt;
[[File:Chaldean Settlements Balawat Gate 848 BC.PNG|thumb|Chaldean Settlements Balawat Gate 848 BC]]&lt;br /&gt;
Chaldean Settlements Balawat Gate 848 BC of [[Chaldean People]].  This is a royal gate assembled by ancient Assyrian King to reflect on their occupation of Chaldea and the ethnic Chaldean tribes. Reference is The British Museum. &lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| 745 || &lt;br /&gt;
[[File:Chaldeans in the Nimrud Letters 745 BC.PNG|thumb|Chaldeans in the Nimrud Letters 745 BC]] &lt;br /&gt;
[[Chaldean people]] and Chaldean cities are documented in 40 letters discovered with ancient Assyrian king Tiglath-pileser III during his military Campaigns and occupation of Chaldea and Chaldean cities.&lt;br /&gt;
&lt;br /&gt;
By: Profesor Henry W. F. Saggs, PHD&lt;br /&gt;
Dr. Saggs, a respected archoelogist and helped discover Nimrud city. He joined Max Mallowan's excavation at Nimrud under the aegis of the British School of Archaeology in Iraq.&lt;br /&gt;
&lt;br /&gt;
Dr. Saggs was awarded his PhD degree in 1953 for his dissertation titled A study of city administration in Assyria and Babylonia in the period 705 to 539 B.C. He joined SOAS as a lecturer in Akkadian.&lt;br /&gt;
&lt;br /&gt;
JOURNAL ARTICLE: Chaldeans in the Nimrud Letters&lt;br /&gt;
Wiener Zeitschrift für die Kunde des Morgenlandes&lt;br /&gt;
Vol. 86, (1996), pp. 379-390&lt;br /&gt;
&lt;br /&gt;
Published by: University of Vienna, Department of Oriental Studies&lt;br /&gt;
https://www.jstor.org/stable/23864750&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 1 to 300 ||   Chaldean Astronomy in the Last Three Centuries BC&lt;br /&gt;
[[File:Chaldean Astronomy in three centuries BC.PNG|thumb|Chaldean Astronomy in three centuries BC]]&lt;br /&gt;
&lt;br /&gt;
An 8 page detailed research by the American Oriental Society published in 1955 describing the #Chaldean people impact on the world of science and astronomy. Listing Chaldean scientists from the 1st to 3rd Century BC such as Seleucus of Seleucia (south of #Baghdad and near #Babylon) and his contributions to #astronomy and study of stars and plants that impacted our knowledge until today.&lt;br /&gt;
&lt;br /&gt;
Reference: Journal of the American Oriental Society&lt;br /&gt;
Vol. 75, No. 3 (Jul. - Sep., 1955), pp. 166-173 (8 pages)&lt;br /&gt;
URL: https://www.jstor.org/stable/595168&lt;br /&gt;
|-&lt;br /&gt;
| 191 BC to 52 AD || &lt;br /&gt;
[[File:Chaldeans in Rome 191 BC to 52 AD.PNG|thumb|Chaldeans in Rome 191 BC to 52 AD]]&lt;br /&gt;
Chaldeans in the Roman Empire, Italy,  (191 BC to 52 AD)&lt;br /&gt;
&lt;br /&gt;
“Expulsion of Chaldeans from Rome”. Executed by various Roman Emperors.&lt;br /&gt;
&lt;br /&gt;
Chaldean people have uncovered a historical treasure of various documents describing Chaldeans in Rome and their expulsion by various Roman emperors such as Claudius (41 to 54 AD), Augustus (27 BC to 14 AD), Tiberius (14 AD to 37 AD).&lt;br /&gt;
&lt;br /&gt;
Chaldeans were active in the Roman empire as astronomers, mathematicians, philosophers, historians, theologians and astrologists.&lt;br /&gt;
&lt;br /&gt;
References: Diaspora, Jews amidst Greeks and Romans. Other references are also available and can be obtained from Google Books&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 1st century AD ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en;align:right&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 35&lt;br /&gt;
|  [[Saint Peter the Apostle|Peter the Apostle]] is in [[Babylon]] to establish to convert new Christians, 1 Peter 5:13.&lt;br /&gt;
|-&lt;br /&gt;
| 40&lt;br /&gt;
|   [[Saint Peter the Apostle|Thomas the Apostle]] are in [[Babylon]] to establish the Church of Adiabene (near Arbil) and Csiphon (near Baghdad). &lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Example.jpg|Caption1&lt;br /&gt;
Example.jpg|Caption2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
[[thumbnail]]&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| 52 AD || &lt;br /&gt;
[[File:Chaldeans in Rome 191 BC to 52 AD.PNG|thumb|Chaldeans in Rome 191 BC to 52 AD]]&lt;br /&gt;
Chaldeans in the Roman Empire, Italy,  (191 BC to 52 AD)&lt;br /&gt;
&lt;br /&gt;
“Expulsion of Chaldeans from Rome”. Executed by various Roman Emperors.&lt;br /&gt;
&lt;br /&gt;
Chaldean people have uncovered a historical treasure of various documents describing Chaldeans in Rome and their expulsion by various Roman emperors such as Claudius (41 to 54 AD), Augustus (27 BC to 14 AD), Tiberius (14 AD to 37 AD).&lt;br /&gt;
&lt;br /&gt;
Chaldeans were active in the Roman empire as astronomers, mathematicians, philosophers, historians, theologians and astrologists.&lt;br /&gt;
&lt;br /&gt;
References: Diaspora, Jews amidst Greeks and Romans. Other references are also available and can be obtained from Google Books&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 2nd century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 122 || || Romans construct the [[Hadrian's Wall]].&lt;br /&gt;
|-&lt;br /&gt;
| 143 || || Romans construct the [[Antonine Wall]].&lt;br /&gt;
|-&lt;br /&gt;
| 163 || || Romans withdraw south to [[Trimontium (Newstead)|Trimontium]] and [[Hadrian's Wall]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 3rd century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 300 || || The term [[Pict]] is first recorded in describing the federated tribes invaded by [[Constantius Chlorus]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 4th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 397 || || Traditional date at which [[Saint Ninian]] establishes a Christian mission at [[Whithorn]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 5th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 470 || || [[Votadini]] peoples form the kingdom of [[Gododdin]] in the region north of the [[River Tweed]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 6th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 547 || || [[Angles]] capture the Northumbrian fortress at [[Bamburgh]] and found the kingdom of [[Bernicia]].&lt;br /&gt;
|-&lt;br /&gt;
| 563 || || [[Saint Columba]] founds a monastery at [[Iona]] and begins his mission to the northern Picts.&lt;br /&gt;
|-&lt;br /&gt;
| 574 || || [[Áedán mac Gabráin]] begins reign over the [[Gaels|Gaelic]] kingdom of [[Dál Riata]].&lt;br /&gt;
|-&lt;br /&gt;
| 575 || ||  Western Scotland is granted independence from the Irish Dalriada, after a convention at Drum Ceatt near Derry.&lt;br /&gt;
|-&lt;br /&gt;
| 580 || || [[Riderch I of Alt Clut]] rules region later known as the kingdom of [[Kingdom of Strathclyde|Strathclyde]].&lt;br /&gt;
|-&lt;br /&gt;
| 584 || || [[Bridei I|Bruide, son of Maelchon,]] dies.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 7th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 604 || || [[Æthelfrith]] unites [[Bernicia]] and [[Deira (kingdom)|Deira]] to form the kingdom of [[Northumbria]].&lt;br /&gt;
|-&lt;br /&gt;
| 638 || || [[Northumbria]]ns capture [[Edinburgh]] from Gododdin.&lt;br /&gt;
|-&lt;br /&gt;
| 680 || || [[Trumwine]] Bishop of [[Abercorn]].&lt;br /&gt;
|-&lt;br /&gt;
| 681 || || [[Bridei III|Bruide mac Bili]], King of [[Fortriu]], campaigns against Orkney.&lt;br /&gt;
|-&lt;br /&gt;
| 685 || || Pictish King Bruide mac Bili defeats [[Ecgfrith of Northumbria]] at the [[Battle of Dun Nechtain]], halting the northern expansion of Northumbria.&lt;br /&gt;
|-&lt;br /&gt;
| 693 || || Bruide mac Bili dies.&lt;br /&gt;
|-&lt;br /&gt;
| 697 || || [[Bridei IV|Bruide mac Der-Ilei]] among the signatories of the [[Cáin Adomnáin]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 8th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 717 || || [[Nechtan IV of the Picts|Nechtan mac Der-Ilei]] expels [[Iona]]n clergy from Pictland and adopts Roman usages with the aid of Bishop [[Curetán]]; masons sent by Abbot [[Ceolfrid]] of [[Monkwearmouth-Jarrow Priory]] help build stone churches at [[Restenneth]], [[Rosemarkie]] and elsewhere in eastern Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 724 || || [[Drest VII|Drust]] and Nechtan mac Der-Ilei fight civil war (to 729).&lt;br /&gt;
|-&lt;br /&gt;
| 732 || || Death of Nechtan mac Der-Ilei; [[Óengus I|Óengus mac Fergusa]] becomes King of the Picts.&lt;br /&gt;
|-&lt;br /&gt;
| 735 || || Óengus mac Fergusa, King of the Picts, campaigns against Dál Riata, and seizes and burns the royal centre of [[Dunadd]].&lt;br /&gt;
|-&lt;br /&gt;
| 736 || || Battle of Cnoc Coirpi between Fortriu and Dál Riata.&lt;br /&gt;
|-&lt;br /&gt;
| 741 || || Battle of Druimm Cathmail between Fortriu and Dál Riata; the &amp;quot;smiting of Dál Riata&amp;quot;, in which Dál Riata is subdued by Óengus mac Fergusa.&lt;br /&gt;
|-&lt;br /&gt;
| 747 || || [[St Andrews]] founded by this time, death of Abbot [[Túathalán]].&lt;br /&gt;
|-&lt;br /&gt;
| 750 || || Picts defeated by Britons at the Battle of Catohic.&lt;br /&gt;
|-&lt;br /&gt;
| 756 || || Óengus mac Fergusa allied with the English of Northumbria attacks the Britons; the English army is destroyed.&lt;br /&gt;
|-&lt;br /&gt;
| 761 || || Death of Óengus mac Fergusa.&lt;br /&gt;
|-&lt;br /&gt;
| 763 || || Battle takes place in Fortriu between [[Ciniod I of the Picts|Ciniod]] and [[Áed Find]]; result unknown.&lt;br /&gt;
|-&lt;br /&gt;
| 778 || || Death of Áed Find, King of Dál Riata.&lt;br /&gt;
|-&lt;br /&gt;
| 794 || || Annals of Ulster report the &amp;quot;wasting&amp;quot; of &amp;quot;all the islands of Britain by gentiles [Vikings]&amp;quot;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 9th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 802 || || Iona burned by [[Vikings]].&lt;br /&gt;
|-&lt;br /&gt;
| 806 || || The monasteries under Iona are attacked by Vikings, killing 68 monks.&lt;br /&gt;
|-&lt;br /&gt;
| 820 || || Death of [[Caustantín of the Picts|Caustantín mac Fergusa]].&lt;br /&gt;
|-&lt;br /&gt;
| 829 || || Abbot [[Diarmait of Iona|Diarmait]], [[abbot of Iona]], goes to ''Alba'' with relics of St Columba.&lt;br /&gt;
|-&lt;br /&gt;
| 831 || || Diarmait of Iona goes to Ireland with relics of St Columba.&lt;br /&gt;
|-&lt;br /&gt;
| 839 || || [[Uen of the Picts|Eóganan mac Óengusa]] and his brother Bran killed in battle with Vikings, end of dominance of [[Fortriu]].&lt;br /&gt;
|-&lt;br /&gt;
| 858 || || Death of [[Kenneth mac Alpin]], [[King of the Picts]]; &amp;quot;union of Picts and Scots&amp;quot; traditionally dated from his reign.&lt;br /&gt;
|-&lt;br /&gt;
| 870 || || Alt Clut—[[Dumbarton Rock]] — captured by the [[Norse-Gael]] or [[Viking]] leaders [[Amlaíb Conung]] and [[Ímar]] after a six-month of siege.&lt;br /&gt;
|-&lt;br /&gt;
| 878 || || Kenneth mac Alpin's son [[Áed of Scotland|Áed]] killed; [[Giric of Scotland|Giric]] becomes king.&lt;br /&gt;
|-&lt;br /&gt;
| 889 || || Death of Giric; [[Domnall mac Causantín]], grandson of Kenneth, becomes king.&lt;br /&gt;
|-&lt;br /&gt;
| 890 || || The Strathclyde Britons are exiled to the [[Kingdom of Gwynedd|Gwynedd]] in Wales.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 10th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 900 || || [[Causantín mac Áeda]] succeeds Domnall mac Causantín.&lt;br /&gt;
|-&lt;br /&gt;
| 937 || || [[Battle of Brunanburh]] English victory in 937 by the army of Æthelstan, King of England, and his brother Edmund over the combined armies of Olaf III Guthfrithson, the Norse-Gael King of Dublin, Constantine II, King of Scots, and Owen I, King of Strathclyde.&lt;br /&gt;
|-&lt;br /&gt;
| 940 || || Saint [[Catroe of Metz]] leaves Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 943 || || Causantín mac Áeda abdicates to become a [[culdee]] at St Andrews.&lt;br /&gt;
|-&lt;br /&gt;
| 952 || || Death of Causantín mac Áeda.&lt;br /&gt;
|-&lt;br /&gt;
| 954 || || [[Indulf of Scotland|Indulf]] captures Edinburgh from Northumbria.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 11th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1058 || || After defeating [[Macbeth of Scotland|Mac Bethad]] and [[Lulach]], [[Malcolm III of Scotland|Máel Coluim III]] is proclaimed king.&lt;br /&gt;
|-&lt;br /&gt;
| 1012 || || [[Battle of Cruden Bay]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 12th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:10en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1124 || || [[David I of Scotland|David I]] becomes king and introduces the feudal system of landholding to much of Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 1128 || || David I founds [[Holyrood Abbey]] at Edinburgh.&lt;br /&gt;
|-&lt;br /&gt;
| 1136 || || [[Glasgow Cathedral]] (St Kentigern's, begun 1123) consecrated in the presence of David I.&lt;br /&gt;
|-&lt;br /&gt;
| 1153 || || [[Somerled]] sacks Glasgow and its vicinity.&lt;br /&gt;
|-&lt;br /&gt;
| 1156 || || Somerled defeats the Norse [[King of Mann and the Isles]], establishing his own semi-independent rule as ''ri Innse Gall''-King of the Hebrides.&lt;br /&gt;
|-&lt;br /&gt;
| 1164 || || Somerled is defeated by [[Malcolm IV of Scotland|Malcolm IV]] in the [[Battle of Renfrew]].&lt;br /&gt;
|-&lt;br /&gt;
| 1174 || || [[William I of Scotland|William I]] signs the [[Treaty of Falaise]] in which he swears allegiance to [[Henry II of England]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 13th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1234 ||   Galloway's independent existence ends with the death of [[Alan, Lord of Galloway]].&lt;br /&gt;
|-&lt;br /&gt;
| 1237 ||   Southern border of Scotland established in the [[Treaty of York]].&lt;br /&gt;
|-&lt;br /&gt;
| 1259 ||   Chaldean People are in Pisa Italy [[Chaldean people]].&lt;br /&gt;
[[File:1259 Pisa.PNG|thumb|Chaldean people of Pisa, Italy 1259 AD]]&lt;br /&gt;
|-&lt;br /&gt;
| 1266 ||   [[Norway]] cedes the [[Hebrides]] and [[Isle of Man]] to Scotland in the [[Treaty of Perth]].&lt;br /&gt;
|-&lt;br /&gt;
| 1292 ||   [[Edward I of England]] intervenes in Scottish affairs and grants the Scottish throne to [[John Balliol]].&lt;br /&gt;
|-&lt;br /&gt;
| 1297 ||   [[Andrew Moray|Andrew de Moravia]] and [[William Wallace]] lead the Scots to victory over England at [[Battle of Stirling Bridge|Stirling Bridge]].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 14th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1305 || || [[William Wallace]] is executed in London.&lt;br /&gt;
|-&lt;br /&gt;
| 1314 || || [[Robert the Bruce]] defeats the English at [[Battle of Bannockburn|Bannockburn]].&lt;br /&gt;
|-&lt;br /&gt;
| 1320 || || Nobles assert Scottish independence in the [[Declaration of Arbroath]].&lt;br /&gt;
|-&lt;br /&gt;
| 1328 || || [[Treaty of Northampton]]. England recognises [[Scottish independence]].&lt;br /&gt;
|-&lt;br /&gt;
| 1329 || || Death of Robert the Bruce. His 5-year-old son, [[David II of Scotland|David II]] succeeds him.&lt;br /&gt;
|-&lt;br /&gt;
| 1371 || || [[Robert II of Scotland|Robert II]] becomes first [[House of Stuart|Stewart]] king.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 15th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year   || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1402 ||   English defeat Scots in the [[Battle of Nesbit Moor (1402)|Battle of Nesbit Moor]] and the [[Battle of Humbleton Hill]].&lt;br /&gt;
|-&lt;br /&gt;
| 1425 ||   Chaldeans by the British Library [[Chaldean people]].&lt;br /&gt;
[[File:1425 Chaldeans by the British Library.PNG|thumb|1425 Chaldeans by the British Library]]&lt;br /&gt;
|-&lt;br /&gt;
| 1442 ||   Chaldean People of Cyprus REJOINED the Catholic Faith [[Chaldean people]].&lt;br /&gt;
|-&lt;br /&gt;
| 1468 ||   [[Denmark]] cedes [[Orkney]] and [[Shetland]] from [[Norway]] to Scotland.&lt;br /&gt;
|-&lt;br /&gt;
| 1493 ||   [[Lord of the Isles|Lordship of the Isles]] abolished.  In 1540 the title was reserved to the crown.&lt;br /&gt;
|-&lt;br /&gt;
| 1495 ||   Creation of the [[University of Aberdeen]] (King's College).&lt;br /&gt;
|-&lt;br /&gt;
| 1496 ||   [[Education Act 1496|Education Act of 1496]] makes education compulsory for [[Baron#Scotland|baron]]s and wealthy landowners.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 16th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1513 || || [[James IV of Scotland|James IV]] and thousands of Scots are killed at [[Battle of Flodden Field|Flodden]].&lt;br /&gt;
|-&lt;br /&gt;
| 1532 || || Creation of the [[College of Justice]] and the [[Court of Session]].&lt;br /&gt;
|-&lt;br /&gt;
| 1542 || || Death of [[James V of Scotland|James V]].&lt;br /&gt;
|-&lt;br /&gt;
| 1559 || || [[John Knox]] returns to Scotland from [[Geneva]] to promote [[Calvinism]].&lt;br /&gt;
|-&lt;br /&gt;
| 1560 || || [[Scottish Reformation Parliament|Parliament]] legislates [[Scottish Reformation|Protestant Reformation]] of the [[Church of Scotland]].&lt;br /&gt;
|-&lt;br /&gt;
| 1561 || || [[Mary, Queen of Scots]] returns from France.&lt;br /&gt;
|-&lt;br /&gt;
| 1568 || || Mary, Queen of Scots flees to England following the defeat of her army at the [[Battle of Langside]].&lt;br /&gt;
|-&lt;br /&gt;
| 1579 || || [[James VI and I|James VI]] takes over government from his regent, [[James Douglas, 4th Earl of Morton|James Douglas]].&lt;br /&gt;
|-&lt;br /&gt;
| 1582 || || Establishment of the [[University of Edinburgh]] by Royal Charter.&lt;br /&gt;
|-&lt;br /&gt;
| 1587 || || Mary is beheaded by the order of [[Queen Elizabeth I of England]].&lt;br /&gt;
|-&lt;br /&gt;
| 1589 || || James VI marries [[Anne of Denmark]] in Oslo.&lt;br /&gt;
|-&lt;br /&gt;
| 1592 || || James VI enacts the &amp;quot;Golden Act&amp;quot; recognising the power of [[Presbyterianism]] within the Scottish church.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 17th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1603 ||   The [[Union of the Crowns]]: [[James VI]] of Scotland becomes [[James I of England]].&lt;br /&gt;
|-&lt;br /&gt;
| 1614 ||  [[John Napier]] invents [[logarithm]]s and publishes a book promoting their use in mathematics.&lt;br /&gt;
|-&lt;br /&gt;
| 1626 ||   Chaldean language is shared by polyglot and genius Kricher [[Chaldean Language]].&lt;br /&gt;
[[File:1626 Chaldean Alphabet by Kricher.PNG|thumb|1626 Chaldean Alphabet by Kricher]]&lt;br /&gt;
|-&lt;br /&gt;
| 1633 ||  [[Education Act 1633|Education Act of 1633]] ordains a school in every [[Parish#Scotland|parish]] (partially successful).&lt;br /&gt;
|-&lt;br /&gt;
| 1699 ||   Chaldean language publication by Dr. Ellis Luis Dupin [[Chaldean Language]]&lt;br /&gt;
[[File:1699 AD Chaldean Language.PNG|thumb|1699 AD Chaldean Language]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 18th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year || style=&amp;quot;width:15en&amp;quot; | Date || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1707 || || The Union of the Parliaments: the [[Acts of Union 1707|Acts of Union]] are passed by both the Scottish and English parliaments.&lt;br /&gt;
|-&lt;br /&gt;
| 1715 || || [[Jacobite rising of 1715]].&lt;br /&gt;
|-&lt;br /&gt;
| 1745 || || [[Jacobite rising of 1745]].&lt;br /&gt;
|-&lt;br /&gt;
| 1746 || || The [[Battle of Culloden]] ends the [[Jacobite rising of 1745|last Jacobite rising]].&lt;br /&gt;
|-&lt;br /&gt;
| 1748 || || [[David Hume]] publishes ''[[An Enquiry Concerning Human Understanding]]''.&lt;br /&gt;
|- January 25, 1759 the birth of Robert burns&lt;br /&gt;
| 1754 || || [[Joseph Black]] discovers &amp;quot;fixed air&amp;quot; ([[carbon dioxide]]).&lt;br /&gt;
|-&lt;br /&gt;
| 1768 || || The [[Encyclopædia Britannica First Edition]] commences publication.&lt;br /&gt;
|-&lt;br /&gt;
| 1769 || || [[James Watt]] patents idea for separate condensing chamber in the [[steam engine]].&lt;br /&gt;
|-&lt;br /&gt;
| 1775 || || Passage of the [[Colliers and Salters (Scotland) Act 1775]] commences the removal of life bondage of coal and salt workers.&amp;lt;ref&amp;gt;{{cite book|last=Mantoux|first=Paul|title=The Industrial Revolution in the Eighteenth Century|url=https://books.google.co.uk/books?id=5Q78AQAAQBAJ&amp;amp;lpg=PA74&amp;amp;ots=ygw03U9E1K&amp;amp;dq=Colliers%20and%20Salters%201775&amp;amp;pg=PA74#v=onepage&amp;amp;q=Colliers%20and%20Salters%201775&amp;amp;f=false|year=1964|publisher=Jonathan Cape|page=74}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1776 || || [[Adam Smith]] publishes ''[[The Wealth of Nations]]''.&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 19th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year   || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1849 ||   [[Chaldean people]] of Kurdistan, Iraq witnessed by respected British archaeologist William Kenneth Luftus&lt;br /&gt;
[[File:1849 Chaldeans of Kurdistan.PNG|thumb|1849 Chaldeans of Kurdistan]]&lt;br /&gt;
|-&lt;br /&gt;
| 1850 ||   [[Chaldean Nation]] and [[Chaldean people]] recognition by British archaeologist William Kenneth Luftus&lt;br /&gt;
[[File:Chaldean Nation recognition 1850.PNG|thumb|Chaldean Nation recognition 1850]]&lt;br /&gt;
|-&lt;br /&gt;
| 1879 ||   Chaldean archaeologist Hormuzd Rassam reflects on his [[Chaldean people]], Chaldean nation and Chaldean ethnicity.&lt;br /&gt;
[[File:Hormuzd Rassam 1879.PNG|thumb|Hormuzd Rassam 1879]]&lt;br /&gt;
|-&lt;br /&gt;
| 1880 ||   Chaldean archaeologist Hormuzd Rassam reflects on his [[Chaldean people]], Chaldean nation and Chaldean ethnicity.&lt;br /&gt;
[[File:Hormuzd Rassam.PNG|thumb|Hormuzd Rassam]]&lt;br /&gt;
|-&lt;br /&gt;
| 1891 ||   [[Chaldean people]] census of Urmia, Iran (Persia). 25,000 Chaldeans of Nestorian faith.&lt;br /&gt;
[[File:1891 Census of Urmia.PNG|thumb|1891 Census of Urmia]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 20th century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 1906 ||   Chaldean people and country description by Al Maktabas publication (in Arabic language).&lt;br /&gt;
[[File:Chaldean Country by Al Maktabas 1906.PNG|thumb|Chaldean Country by Al Maktabas 1906]]&lt;br /&gt;
|-&lt;br /&gt;
| 1913 ||  [[Chaldean people]] are in New York City&lt;br /&gt;
[[File:Chaldeans of New York City 1913.PNG|thumb|Chaldeans of New York City 1913]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 21st century ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! style=&amp;quot;width:6en&amp;quot; | Year  || Event&lt;br /&gt;
|-&lt;br /&gt;
| 2004  || [[Chaldean people]] are ethnic people of [[Mesopotamia]] by Dr. Mary Sengstock, respected professor of sociology. Professor Sengstock supervised 16 PHD dissertations.&lt;br /&gt;
[[File:Chaldean Ethnicity by Mary Sengstock.PNG|thumb|Chaldean Ethnicity by Dr. Mary Sengstock]]&lt;br /&gt;
|-&lt;br /&gt;
| 2007 ||   Chaldean people ethnicity by Dr. Mary Sengstock&lt;br /&gt;
[[File:Chaldean Ethnicity by Mary Sengstock 2.PNG|thumb|Chaldean Ethnicity by Dr. Mary Sengstock 2]]&lt;br /&gt;
|-&lt;br /&gt;
 &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*[[Chaldean family tree]]&lt;br /&gt;
* [[Timeline of Chaldean history]]&lt;br /&gt;
*[[Timeline of prehistoric Chaldea]]&lt;br /&gt;
&lt;br /&gt;
== Notes ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Chaldean history timelines| ]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:%C2%B7&amp;diff=4674</id>
		<title>Template:·</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:%C2%B7&amp;diff=4674"/>
				<updated>2019-03-18T12:12:51Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: Created page with &amp;quot;&amp;amp;nbsp;&amp;lt;b&amp;gt;&amp;amp;middot;&amp;lt;/b&amp;gt;&amp;amp;#32;&amp;lt;noinclude&amp;gt;  {{documentation}} &amp;lt;!-- Add categories and interwikis to the /doc subpage, not here! --&amp;gt; &amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;nbsp;&amp;lt;b&amp;gt;&amp;amp;middot;&amp;lt;/b&amp;gt;&amp;amp;#32;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories and interwikis to the /doc subpage, not here! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:String&amp;diff=4667</id>
		<title>Module:String</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:String&amp;diff=4667"/>
				<updated>2019-03-18T12:11:02Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[  &lt;br /&gt;
&lt;br /&gt;
This module is intended to provide access to basic string functions.&lt;br /&gt;
&lt;br /&gt;
Most of the functions provided here can be invoked with named parameters, &lt;br /&gt;
unnamed parameters, or a mixture.  If named parameters are used, Mediawiki will &lt;br /&gt;
automatically remove any leading or trailing whitespace from the parameter.  &lt;br /&gt;
Depending on the intended use, it may be advantageous to either preserve or&lt;br /&gt;
remove such whitespace.&lt;br /&gt;
&lt;br /&gt;
Global options&lt;br /&gt;
    ignore_errors: If set to 'true' or 1, any error condition will result in &lt;br /&gt;
        an empty string being returned rather than an error message.  &lt;br /&gt;
        &lt;br /&gt;
    error_category: If an error occurs, specifies the name of a category to &lt;br /&gt;
        include with the error message.  The default category is  &lt;br /&gt;
        [Category:Errors reported by Module String].&lt;br /&gt;
        &lt;br /&gt;
    no_category: If set to 'true' or 1, no category will be added if an error&lt;br /&gt;
        is generated.&lt;br /&gt;
        &lt;br /&gt;
Unit tests for this module are available at Module:String/tests.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local str = {}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
len&lt;br /&gt;
&lt;br /&gt;
This function returns the length of the target string.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|len|target_string|}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|len|s=target_string}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    s: The string whose length to report&lt;br /&gt;
&lt;br /&gt;
If invoked using named parameters, Mediawiki will automatically remove any leading or&lt;br /&gt;
trailing whitespace from the target string.  &lt;br /&gt;
]]&lt;br /&gt;
function str.len( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'s'} );&lt;br /&gt;
    local s = new_args['s'] or '';&lt;br /&gt;
    return mw.ustring.len( s )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
sub&lt;br /&gt;
&lt;br /&gt;
This function returns a substring of the target string at specified indices.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|sub|target_string|start_index|end_index}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|sub|s=target_string|i=start_index|j=end_index}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    s: The string to return a subset of&lt;br /&gt;
    i: The fist index of the substring to return, defaults to 1.&lt;br /&gt;
    j: The last index of the string to return, defaults to the last character.&lt;br /&gt;
    &lt;br /&gt;
The first character of the string is assigned an index of 1.  If either i or j&lt;br /&gt;
is a negative value, it is interpreted the same as selecting a character by &lt;br /&gt;
counting from the end of the string.  Hence, a value of -1 is the same as &lt;br /&gt;
selecting the last character of the string.&lt;br /&gt;
&lt;br /&gt;
If the requested indices are out of range for the given string, an error is &lt;br /&gt;
reported.&lt;br /&gt;
]]&lt;br /&gt;
function str.sub( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, { 's', 'i', 'j' } );&lt;br /&gt;
    local s = new_args['s'] or '';&lt;br /&gt;
    local i = tonumber( new_args['i'] ) or 1;&lt;br /&gt;
    local j = tonumber( new_args['j'] ) or -1;&lt;br /&gt;
    &lt;br /&gt;
    local len = mw.ustring.len( s );&lt;br /&gt;
&lt;br /&gt;
    -- Convert negatives for range checking&lt;br /&gt;
    if i &amp;lt; 0 then&lt;br /&gt;
        i = len + i + 1;&lt;br /&gt;
    end&lt;br /&gt;
    if j &amp;lt; 0 then&lt;br /&gt;
        j = len + j + 1;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if i &amp;gt; len or j &amp;gt; len or i &amp;lt; 1 or j &amp;lt; 1 then&lt;br /&gt;
        return str._error( 'String subset index out of range' );&lt;br /&gt;
    end&lt;br /&gt;
    if j &amp;lt; i then&lt;br /&gt;
        return str._error( 'String subset indices out of order' );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return mw.ustring.sub( s, i, j )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This function implements that features of {{str sub old}} and is kept in order&lt;br /&gt;
to maintain these older templates.&lt;br /&gt;
]]&lt;br /&gt;
function str.sublength( frame )&lt;br /&gt;
    local i = tonumber( frame.args.i ) or 0&lt;br /&gt;
    local len = tonumber( frame.args.len )&lt;br /&gt;
    return mw.ustring.sub( frame.args.s, i + 1, len and ( i + len ) )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
match&lt;br /&gt;
&lt;br /&gt;
This function returns a substring from the source string that matches a &lt;br /&gt;
specified pattern.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|match|source_string|pattern_string|start_index|match_number|plain_flag|nomatch_output}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|pos|s=source_string|pattern=pattern_string|start=start_index&lt;br /&gt;
    |match=match_number|plain=plain_flag|nomatch=nomatch_output}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    s: The string to search&lt;br /&gt;
    pattern: The pattern or string to find within the string&lt;br /&gt;
    start: The index within the source string to start the search.  The first&lt;br /&gt;
        character of the string has index 1.  Defaults to 1.&lt;br /&gt;
    match: In some cases it may be possible to make multiple matches on a single &lt;br /&gt;
        string.  This specifies which match to return, where the first match is &lt;br /&gt;
        match= 1.  If a negative number is specified then a match is returned &lt;br /&gt;
        counting from the last match.  Hence match = -1 is the same as requesting&lt;br /&gt;
        the last match.  Defaults to 1.&lt;br /&gt;
    plain: A flag indicating that the pattern should be understood as plain&lt;br /&gt;
        text.  Defaults to false.&lt;br /&gt;
    nomatch: If no match is found, output the &amp;quot;nomatch&amp;quot; value rather than an error.&lt;br /&gt;
&lt;br /&gt;
If invoked using named parameters, Mediawiki will automatically remove any leading or&lt;br /&gt;
trailing whitespace from each string.  In some circumstances this is desirable, in &lt;br /&gt;
other cases one may want to preserve the whitespace.&lt;br /&gt;
&lt;br /&gt;
If the match_number or start_index are out of range for the string being queried, then&lt;br /&gt;
this function generates an error.  An error is also generated if no match is found.&lt;br /&gt;
If one adds the parameter ignore_errors=true, then the error will be suppressed and &lt;br /&gt;
an empty string will be returned on any failure.&lt;br /&gt;
&lt;br /&gt;
For information on constructing Lua patterns, a form of [regular expression], see:&lt;br /&gt;
&lt;br /&gt;
* http://www.lua.org/manual/5.1/manual.html#5.4.1&lt;br /&gt;
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Patterns&lt;br /&gt;
* http://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual#Ustring_patterns&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
function str.match( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'s', 'pattern', 'start', 'match', 'plain', 'nomatch'} );&lt;br /&gt;
    local s = new_args['s'] or '';&lt;br /&gt;
    local start = tonumber( new_args['start'] ) or 1;&lt;br /&gt;
    local plain_flag = str._getBoolean( new_args['plain'] or false );&lt;br /&gt;
    local pattern = new_args['pattern'] or '';&lt;br /&gt;
    local match_index = math.floor( tonumber(new_args['match']) or 1 );&lt;br /&gt;
    local nomatch = new_args['nomatch'];&lt;br /&gt;
    &lt;br /&gt;
    if s == '' then&lt;br /&gt;
        return str._error( 'Target string is empty' );&lt;br /&gt;
    end&lt;br /&gt;
    if pattern == '' then&lt;br /&gt;
        return str._error( 'Pattern string is empty' );&lt;br /&gt;
    end&lt;br /&gt;
    if math.abs(start) &amp;lt; 1 or math.abs(start) &amp;gt; mw.ustring.len( s ) then&lt;br /&gt;
        return str._error( 'Requested start is out of range' );&lt;br /&gt;
    end&lt;br /&gt;
    if match_index == 0 then&lt;br /&gt;
        return str._error( 'Match index is out of range' );&lt;br /&gt;
    end&lt;br /&gt;
    if plain_flag then&lt;br /&gt;
        pattern = str._escapePattern( pattern );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local result&lt;br /&gt;
    if match_index == 1 then&lt;br /&gt;
        -- Find first match is simple case&lt;br /&gt;
        result = mw.ustring.match( s, pattern, start )&lt;br /&gt;
    else&lt;br /&gt;
        if start &amp;gt; 1 then&lt;br /&gt;
            s = mw.ustring.sub( s, start );&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        local iterator = mw.ustring.gmatch(s, pattern);&lt;br /&gt;
        if match_index &amp;gt; 0 then&lt;br /&gt;
            -- Forward search&lt;br /&gt;
            for w in iterator do&lt;br /&gt;
                match_index = match_index - 1;&lt;br /&gt;
                if match_index == 0 then&lt;br /&gt;
                    result = w;&lt;br /&gt;
                    break;&lt;br /&gt;
                end&lt;br /&gt;
            end    &lt;br /&gt;
        else&lt;br /&gt;
            -- Reverse search&lt;br /&gt;
            local result_table = {};&lt;br /&gt;
            local count = 1;&lt;br /&gt;
            for w in iterator do&lt;br /&gt;
                result_table[count] = w;&lt;br /&gt;
                count = count + 1;&lt;br /&gt;
            end&lt;br /&gt;
            &lt;br /&gt;
            result = result_table[ count + match_index ];            &lt;br /&gt;
        end&lt;br /&gt;
    end        &lt;br /&gt;
    &lt;br /&gt;
    if result == nil then&lt;br /&gt;
        if nomatch == nil then&lt;br /&gt;
            return str._error( 'Match not found' );&lt;br /&gt;
        else&lt;br /&gt;
            return nomatch;&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        return result;&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
pos&lt;br /&gt;
&lt;br /&gt;
This function returns a single character from the target string at position pos.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|pos|target_string|index_value}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|pos|target=target_string|pos=index_value}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    target: The string to search&lt;br /&gt;
    pos: The index for the character to return&lt;br /&gt;
&lt;br /&gt;
If invoked using named parameters, Mediawiki will automatically remove any leading or&lt;br /&gt;
trailing whitespace from the target string.  In some circumstances this is desirable, in &lt;br /&gt;
other cases one may want to preserve the whitespace.&lt;br /&gt;
&lt;br /&gt;
The first character has an index value of 1.&lt;br /&gt;
&lt;br /&gt;
If one requests a negative value, this function will select a character by counting backwards &lt;br /&gt;
from the end of the string.  In other words pos = -1 is the same as asking for the last character.&lt;br /&gt;
&lt;br /&gt;
A requested value of zero, or a value greater than the length of the string returns an error.&lt;br /&gt;
]]&lt;br /&gt;
function str.pos( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'target', 'pos'} );&lt;br /&gt;
    local target_str = new_args['target'] or '';&lt;br /&gt;
    local pos = tonumber( new_args['pos'] ) or 0;&lt;br /&gt;
&lt;br /&gt;
    if pos == 0 or math.abs(pos) &amp;gt; mw.ustring.len( target_str ) then&lt;br /&gt;
        return str._error( 'String index out of range' );&lt;br /&gt;
    end    &lt;br /&gt;
    &lt;br /&gt;
    return mw.ustring.sub( target_str, pos, pos );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
str_find&lt;br /&gt;
&lt;br /&gt;
This function duplicates the behavior of {{str_find}}, including all of its quirks.&lt;br /&gt;
This is provided in order to support existing templates, but is NOT RECOMMENDED for &lt;br /&gt;
new code and templates.  New code is recommended to use the &amp;quot;find&amp;quot; function instead.&lt;br /&gt;
&lt;br /&gt;
Returns the first index in &amp;quot;source&amp;quot; that is a match to &amp;quot;target&amp;quot;.  Indexing is 1-based,&lt;br /&gt;
and the function returns -1 if the &amp;quot;target&amp;quot; string is not present in &amp;quot;source&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Important Note: If the &amp;quot;target&amp;quot; string is empty / missing, this function returns a&lt;br /&gt;
value of &amp;quot;1&amp;quot;, which is generally unexpected behavior, and must be accounted for&lt;br /&gt;
separatetly.&lt;br /&gt;
]]&lt;br /&gt;
function str.str_find( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'source', 'target'} );&lt;br /&gt;
    local source_str = new_args['source'] or '';&lt;br /&gt;
    local target_str = new_args['target'] or '';&lt;br /&gt;
&lt;br /&gt;
    if target_str == '' then&lt;br /&gt;
        return 1;&lt;br /&gt;
    end    &lt;br /&gt;
    &lt;br /&gt;
    local start = mw.ustring.find( source_str, target_str, 1, true )&lt;br /&gt;
    if start == nil then&lt;br /&gt;
        start = -1&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return start&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
find&lt;br /&gt;
&lt;br /&gt;
This function allows one to search for a target string or pattern within another&lt;br /&gt;
string.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|find|source_str|target_string|start_index|plain_flag}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|find|source=source_str|target=target_str|start=start_index|plain=plain_flag}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    source: The string to search&lt;br /&gt;
    target: The string or pattern to find within source&lt;br /&gt;
    start: The index within the source string to start the search, defaults to 1&lt;br /&gt;
    plain: Boolean flag indicating that target should be understood as plain&lt;br /&gt;
        text and not as a Lua style regular expression, defaults to true&lt;br /&gt;
&lt;br /&gt;
If invoked using named parameters, Mediawiki will automatically remove any leading or&lt;br /&gt;
trailing whitespace from the parameter.  In some circumstances this is desirable, in &lt;br /&gt;
other cases one may want to preserve the whitespace.&lt;br /&gt;
&lt;br /&gt;
This function returns the first index &amp;gt;= &amp;quot;start&amp;quot; where &amp;quot;target&amp;quot; can be found &lt;br /&gt;
within &amp;quot;source&amp;quot;.  Indices are 1-based.  If &amp;quot;target&amp;quot; is not found, then this &lt;br /&gt;
function returns 0.  If either &amp;quot;source&amp;quot; or &amp;quot;target&amp;quot; are missing / empty, this&lt;br /&gt;
function also returns 0.&lt;br /&gt;
&lt;br /&gt;
This function should be safe for UTF-8 strings.&lt;br /&gt;
]]&lt;br /&gt;
function str.find( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'source', 'target', 'start', 'plain' } ); &lt;br /&gt;
    local source_str = new_args['source'] or '';&lt;br /&gt;
    local pattern = new_args['target'] or '';&lt;br /&gt;
    local start_pos = tonumber(new_args['start']) or 1;&lt;br /&gt;
    local plain = new_args['plain'] or true;&lt;br /&gt;
        &lt;br /&gt;
    if source_str == '' or pattern == '' then&lt;br /&gt;
        return 0;&lt;br /&gt;
    end    &lt;br /&gt;
    &lt;br /&gt;
    plain = str._getBoolean( plain );&lt;br /&gt;
&lt;br /&gt;
    local start = mw.ustring.find( source_str, pattern, start_pos, plain )&lt;br /&gt;
    if start == nil then&lt;br /&gt;
        start = 0&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return start&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
replace&lt;br /&gt;
&lt;br /&gt;
This function allows one to replace a target string or pattern within another&lt;br /&gt;
string.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:String|replace|source_str|pattern_string|replace_string|replacement_count|plain_flag}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:String|replace|source=source_string|pattern=pattern_string|replace=replace_string|&lt;br /&gt;
   count=replacement_count|plain=plain_flag}}&lt;br /&gt;
&lt;br /&gt;
Parameters&lt;br /&gt;
    source: The string to search&lt;br /&gt;
    pattern: The string or pattern to find within source&lt;br /&gt;
    replace: The replacement text&lt;br /&gt;
    count: The number of occurences to replace, defaults to all.&lt;br /&gt;
    plain: Boolean flag indicating that pattern should be understood as plain&lt;br /&gt;
        text and not as a Lua style regular expression, defaults to true &lt;br /&gt;
]]&lt;br /&gt;
function str.replace( frame )&lt;br /&gt;
    local new_args = str._getParameters( frame.args, {'source', 'pattern', 'replace', 'count', 'plain' } ); &lt;br /&gt;
    local source_str = new_args['source'] or '';&lt;br /&gt;
    local pattern = new_args['pattern'] or '';&lt;br /&gt;
    local replace = new_args['replace'] or '';&lt;br /&gt;
    local count = tonumber( new_args['count'] );&lt;br /&gt;
    local plain = new_args['plain'] or true;&lt;br /&gt;
        &lt;br /&gt;
    if source_str == '' or pattern == '' then&lt;br /&gt;
        return source_str;&lt;br /&gt;
    end    &lt;br /&gt;
    plain = str._getBoolean( plain );&lt;br /&gt;
&lt;br /&gt;
    if plain then&lt;br /&gt;
        pattern = str._escapePattern( pattern );&lt;br /&gt;
        replace = mw.ustring.gsub( replace, &amp;quot;%%&amp;quot;, &amp;quot;%%%%&amp;quot; ); --Only need to escape replacement sequences.&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local result;&lt;br /&gt;
&lt;br /&gt;
    if count ~= nil then&lt;br /&gt;
        result = mw.ustring.gsub( source_str, pattern, replace, count );&lt;br /&gt;
    else&lt;br /&gt;
        result = mw.ustring.gsub( source_str, pattern, replace );&lt;br /&gt;
    end        &lt;br /&gt;
&lt;br /&gt;
    return result;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[ &lt;br /&gt;
    simple function to pipe string.rep to templates.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function str.rep( frame )&lt;br /&gt;
    local repetitions = tonumber( frame.args[2] )&lt;br /&gt;
    if not repetitions then &lt;br /&gt;
        return str._error( 'function rep expects a number as second parameter, received &amp;quot;' .. ( frame.args[2] or '' ) .. '&amp;quot;' )&lt;br /&gt;
    end&lt;br /&gt;
    return string.rep( frame.args[1] or '', repetitions )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper function that populates the argument list given that user may need to use a mix of&lt;br /&gt;
named and unnamed parameters.  This is relevant because named parameters are not&lt;br /&gt;
identical to unnamed parameters due to string trimming, and when dealing with strings&lt;br /&gt;
we sometimes want to either preserve or remove that whitespace depending on the application.&lt;br /&gt;
]]&lt;br /&gt;
function str._getParameters( frame_args, arg_list )&lt;br /&gt;
    local new_args = {};&lt;br /&gt;
    local index = 1;&lt;br /&gt;
    local value;&lt;br /&gt;
    &lt;br /&gt;
    for i,arg in ipairs( arg_list ) do&lt;br /&gt;
        value = frame_args[arg]&lt;br /&gt;
        if value == nil then&lt;br /&gt;
            value = frame_args[index];&lt;br /&gt;
            index = index + 1;&lt;br /&gt;
        end&lt;br /&gt;
        new_args[arg] = value;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return new_args;&lt;br /&gt;
end        &lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper function to handle error messages.&lt;br /&gt;
]]&lt;br /&gt;
function str._error( error_str )&lt;br /&gt;
    local frame = mw.getCurrentFrame();&lt;br /&gt;
    local error_category = frame.args.error_category or 'Errors reported by Module String';&lt;br /&gt;
    local ignore_errors = frame.args.ignore_errors or false;&lt;br /&gt;
    local no_category = frame.args.no_category or false;&lt;br /&gt;
    &lt;br /&gt;
    if str._getBoolean(ignore_errors) then&lt;br /&gt;
        return '';&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local error_str = '&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;String Module Error: ' .. error_str .. '&amp;lt;/strong&amp;gt;';&lt;br /&gt;
    if error_category ~= '' and not str._getBoolean( no_category ) then&lt;br /&gt;
        error_str = '[[Category:' .. error_category .. ']]' .. error_str;&lt;br /&gt;
    end        &lt;br /&gt;
    &lt;br /&gt;
    return error_str;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper Function to interpret boolean strings&lt;br /&gt;
]]&lt;br /&gt;
function str._getBoolean( boolean_str )&lt;br /&gt;
    local boolean_value;&lt;br /&gt;
    &lt;br /&gt;
    if type( boolean_str ) == 'string' then&lt;br /&gt;
        boolean_str = boolean_str:lower();&lt;br /&gt;
        if boolean_str == 'false' or boolean_str == 'no' or boolean_str == '0' &lt;br /&gt;
                or boolean_str == '' then&lt;br /&gt;
            boolean_value = false;&lt;br /&gt;
        else&lt;br /&gt;
            boolean_value = true;&lt;br /&gt;
        end    &lt;br /&gt;
    elseif type( boolean_str ) == 'boolean' then&lt;br /&gt;
        boolean_value = boolean_str;&lt;br /&gt;
    else&lt;br /&gt;
        error( 'No boolean value found' );&lt;br /&gt;
    end    &lt;br /&gt;
    return boolean_value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper function that escapes all pattern characters so that they will be treated &lt;br /&gt;
as plain text.&lt;br /&gt;
]]&lt;br /&gt;
function str._escapePattern( pattern_str )&lt;br /&gt;
    return mw.ustring.gsub( pattern_str, &amp;quot;([%(%)%.%%%+%-%*%?%[%^%$%]])&amp;quot;, &amp;quot;%%%1&amp;quot; );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return str&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Wikibase&amp;diff=4669</id>
		<title>Module:Wikibase</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Wikibase&amp;diff=4669"/>
				<updated>2019-03-18T12:11:02Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;---------- Module:Wikibase ----------------&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Return the item ID of the item linked to the current page.&lt;br /&gt;
function p.id(frame)&lt;br /&gt;
	if not mw.wikibase then&lt;br /&gt;
		return &amp;quot;no mw.wikibase&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	entity = mw.wikibase.getEntityObject()&lt;br /&gt;
&lt;br /&gt;
	if entity == nil then&lt;br /&gt;
		return &amp;quot;no entity&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return entity.id&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the WD entity URL of a given data item, or of connected page&lt;br /&gt;
-- if no argument is provided to this method.&lt;br /&gt;
function p.wdurl(frame)&lt;br /&gt;
	if frame.args[1] == nil then&lt;br /&gt;
		entity = mw.wikibase.getEntityObject()&lt;br /&gt;
		if not entity then return nil end&lt;br /&gt;
		id = entity.id&lt;br /&gt;
	else&lt;br /&gt;
		id = mw.text.trim(frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
	return mw.wikibase.getEntityUrl( id )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the label of a given data item, or of connected page&lt;br /&gt;
-- if no argument is provided to this method.&lt;br /&gt;
function p.label(frame)&lt;br /&gt;
	if frame.args[1] == nil then&lt;br /&gt;
		entity = mw.wikibase.getEntityObject()&lt;br /&gt;
		if not entity then return nil end&lt;br /&gt;
		id = entity.id&lt;br /&gt;
	else&lt;br /&gt;
		id = mw.text.trim(frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
	return mw.wikibase.label( id )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the description of a given data item, or of connected page&lt;br /&gt;
-- if no argument is provided to this method.&lt;br /&gt;
function p.description(frame)&lt;br /&gt;
	if frame.args[1] == nil then&lt;br /&gt;
		entity = mw.wikibase.getEntityObject()&lt;br /&gt;
		if not entity then return nil end&lt;br /&gt;
		id = entity.id&lt;br /&gt;
	else&lt;br /&gt;
		id = mw.text.trim(frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
	return mw.wikibase.description( id )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the local page about a given data item, or of connected page&lt;br /&gt;
-- if id is not specified.&lt;br /&gt;
function p.page(frame)&lt;br /&gt;
	if frame.args[1] == nil then&lt;br /&gt;
		entity = mw.wikibase.getEntityObject()&lt;br /&gt;
		if not entity then return nil end&lt;br /&gt;
		id = entity.id&lt;br /&gt;
	else&lt;br /&gt;
		id = mw.text.trim(frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
	return mw.wikibase.sitelink( id )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Return the data type of a property&lt;br /&gt;
function p.datatype(frame)&lt;br /&gt;
	if frame.args[1] and string.find(frame.args[1], &amp;quot;Property:P&amp;quot;) then&lt;br /&gt;
		if mw.wikibase.getEntityObject(string.gsub(frame.args[1], &amp;quot;Property:P&amp;quot;, &amp;quot;P&amp;quot;))  then&lt;br /&gt;
			return mw.wikibase.getEntityObject(string.gsub(frame.args[1], &amp;quot;Property:P&amp;quot;, &amp;quot;P&amp;quot;) ).datatype&lt;br /&gt;
		end&lt;br /&gt;
	elseif frame.args[1] and string.find(frame.args[1], &amp;quot;P&amp;quot;) then&lt;br /&gt;
		if mw.wikibase.getEntityObject(frame.args[1])  then&lt;br /&gt;
			return mw.wikibase.getEntityObject(frame.args[1]).datatype&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:WikidataIB&amp;diff=4671</id>
		<title>Module:WikidataIB</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:WikidataIB&amp;diff=4671"/>
				<updated>2019-03-18T12:11:02Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- Module to implement use of a blacklist and whitelist for infobox fields&lt;br /&gt;
-- Can take a named parameter |qid which is the Wikidata ID for the article&lt;br /&gt;
-- if not supplied, it will use the Wikidata ID associated with the current page.&lt;br /&gt;
-- Fields in blacklist are never to be displayed, i.e. module must return nil in all circumstances&lt;br /&gt;
-- Fields in whitelist return local value if it exists or the Wikidata value otherwise&lt;br /&gt;
-- The name of the field that this function is called from is passed in named parameter |name&lt;br /&gt;
-- The name is compulsory when blacklist or whitelist is used,&lt;br /&gt;
-- so the module returns nil if it is not supplied.&lt;br /&gt;
-- blacklist is passed in named parameter |suppressfields (or |spf)&lt;br /&gt;
-- whitelist is passed in named parameter |fetchwikidata (or |fwd)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local cdate -- initialise as nil and only load _complex_date function if needed&lt;br /&gt;
-- [[Module:Complex date]] is loaded lazily and has the following dependencies:&lt;br /&gt;
-- Module:I18n/complex date, Module:ISOdate, Module:DateI18n (alternative for Module:Date),&lt;br /&gt;
-- Module:Formatnum, Module:I18n/date, Module:Yesno, Module:Linguistic, Module:Calendar&lt;br /&gt;
-- The following, taken from https://www.mediawiki.org/wiki/Wikibase/DataModel#Dates_and_times,&lt;br /&gt;
-- is needed to use Module:Complex date which seemingly requires date precision as a string.&lt;br /&gt;
-- It would work better if only the authors of the mediawiki page could spell 'millennium'.&lt;br /&gt;
local dp = {&lt;br /&gt;
	[6] = &amp;quot;millennium&amp;quot;,&lt;br /&gt;
	[7] = &amp;quot;century&amp;quot;,&lt;br /&gt;
	[8] = &amp;quot;decade&amp;quot;,&lt;br /&gt;
	[9] = &amp;quot;year&amp;quot;,&lt;br /&gt;
	[10] = &amp;quot;month&amp;quot;,&lt;br /&gt;
	[11] = &amp;quot;day&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local i18n =&lt;br /&gt;
{&lt;br /&gt;
	[&amp;quot;errors&amp;quot;] =&lt;br /&gt;
	{&lt;br /&gt;
		[&amp;quot;property-not-found&amp;quot;] = &amp;quot;Property not found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;No property supplied&amp;quot;] = &amp;quot;No property supplied&amp;quot;,&lt;br /&gt;
		[&amp;quot;entity-not-found&amp;quot;] = &amp;quot;Wikidata entity not found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;unknown-claim-type&amp;quot;] = &amp;quot;Unknown claim type.&amp;quot;,&lt;br /&gt;
		[&amp;quot;unknown-entity-type&amp;quot;] = &amp;quot;Unknown entity type.&amp;quot;,&lt;br /&gt;
		[&amp;quot;qualifier-not-found&amp;quot;] = &amp;quot;Qualifier not found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;site-not-found&amp;quot;] = &amp;quot;Wikimedia project not found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;labels-not-found&amp;quot;] = &amp;quot;No labels found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;descriptions-not-found&amp;quot;] = &amp;quot;No descriptions found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;aliases-not-found&amp;quot;] = &amp;quot;No aliases found.&amp;quot;,&lt;br /&gt;
		[&amp;quot;unknown-datetime-format&amp;quot;] = &amp;quot;Unknown datetime format.&amp;quot;,&lt;br /&gt;
		[&amp;quot;local-article-not-found&amp;quot;] = &amp;quot;Article is available on Wikidata, but not on Wikipedia&amp;quot;,&lt;br /&gt;
		[&amp;quot;dab-page&amp;quot;] = &amp;quot; (dab)&amp;quot;,&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;quot;months&amp;quot;] =&lt;br /&gt;
	{&lt;br /&gt;
		&amp;quot;January&amp;quot;, &amp;quot;February&amp;quot;, &amp;quot;March&amp;quot;, &amp;quot;April&amp;quot;, &amp;quot;May&amp;quot;, &amp;quot;June&amp;quot;,&lt;br /&gt;
		&amp;quot;July&amp;quot;, &amp;quot;August&amp;quot;, &amp;quot;September&amp;quot;, &amp;quot;October&amp;quot;, &amp;quot;November&amp;quot;, &amp;quot;December&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;quot;century&amp;quot;] = &amp;quot;century&amp;quot;,&lt;br /&gt;
	[&amp;quot;BC&amp;quot;] = &amp;quot;BC&amp;quot;,&lt;br /&gt;
	[&amp;quot;BCE&amp;quot;] = &amp;quot;BCE&amp;quot;,&lt;br /&gt;
	[&amp;quot;ordinal&amp;quot;] =&lt;br /&gt;
	{&lt;br /&gt;
		[1] = &amp;quot;st&amp;quot;,&lt;br /&gt;
		[2] = &amp;quot;nd&amp;quot;,&lt;br /&gt;
		[3] = &amp;quot;rd&amp;quot;,&lt;br /&gt;
		[&amp;quot;default&amp;quot;] = &amp;quot;th&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	[&amp;quot;filespace&amp;quot;] = &amp;quot;File&amp;quot;,&lt;br /&gt;
	[&amp;quot;Unknown&amp;quot;] = &amp;quot;Unknown&amp;quot;,&lt;br /&gt;
	[&amp;quot;NaN&amp;quot;] = &amp;quot;Not a number&amp;quot;,&lt;br /&gt;
	-- set the following to the name of a tracking category,&lt;br /&gt;
	-- e.g. &amp;quot;[[Category:Articles with missing Wikidata information]]&amp;quot;, or &amp;quot;&amp;quot; to disable:&lt;br /&gt;
	[&amp;quot;missinginfocat&amp;quot;] = &amp;quot;[[Category:Articles with missing Wikidata information]]&amp;quot;,&lt;br /&gt;
	[&amp;quot;editonwikidata&amp;quot;] = &amp;quot;Edit this on Wikidata&amp;quot;,&lt;br /&gt;
	[&amp;quot;latestdatequalifier&amp;quot;] = function (date) return &amp;quot;before &amp;quot; .. date end,&lt;br /&gt;
	-- some languages, e.g. Bosnian use a period as a suffix after each number in a date&lt;br /&gt;
	[&amp;quot;datenumbersuffix&amp;quot;] = &amp;quot;&amp;quot;,&lt;br /&gt;
	[&amp;quot;list separator&amp;quot;] = &amp;quot;, &amp;quot;,&lt;br /&gt;
	[&amp;quot;multipliers&amp;quot;] = {&lt;br /&gt;
		[0]  = &amp;quot;&amp;quot;,&lt;br /&gt;
		[3]  = &amp;quot; thousand&amp;quot;,&lt;br /&gt;
		[6]  = &amp;quot; million&amp;quot;,&lt;br /&gt;
		[9]  = &amp;quot; billion&amp;quot;,&lt;br /&gt;
		[12] = &amp;quot; trillion&amp;quot;,&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
-- This allows a internationisation module to override the above table&lt;br /&gt;
if 'en' ~= mw.getContentLanguage():getCode() then&lt;br /&gt;
	require(&amp;quot;Module:i18n&amp;quot;).loadI18n(&amp;quot;Module:WikidataIB/i18n&amp;quot;, i18n)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This piece of html implements a collapsible container. Check the classes exist on your wiki.&lt;br /&gt;
local collapsediv = '&amp;lt;div class=&amp;quot;mw-collapsible mw-collapsed&amp;quot; style=&amp;quot;width:100%; overflow:auto;&amp;quot; data-expandtext=&amp;quot;{{int:show}}&amp;quot; data-collapsetext=&amp;quot;{{int:hide}}&amp;quot;&amp;gt;'&lt;br /&gt;
&lt;br /&gt;
-- Some items should not be linked.&lt;br /&gt;
-- Each wiki can create a list of those in Module:WikidataIB/nolinks&lt;br /&gt;
-- It should return a table called itemsindex, containing true for each item not to be linked&lt;br /&gt;
local donotlink = {}&lt;br /&gt;
local nolinks_exists, nolinks = pcall(mw.loadData, &amp;quot;Module:WikidataIB/nolinks&amp;quot;)&lt;br /&gt;
if nolinks_exists then&lt;br /&gt;
	donotlink = nolinks.itemsindex&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Private functions&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- makeOrdinal needs to be internationalised along with the above:&lt;br /&gt;
-- takes cardinal numer as a numeric and returns the ordinal as a string&lt;br /&gt;
-- we need three exceptions in English for 1st, 2nd, 3rd, 21st, .. 31st, etc.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local makeOrdinal = function(cardinal)&lt;br /&gt;
	local ordsuffix = i18n.ordinal.default&lt;br /&gt;
	if cardinal % 10 == 1 then&lt;br /&gt;
		ordsuffix = i18n.ordinal[1]&lt;br /&gt;
	elseif cardinal % 10 == 2 then&lt;br /&gt;
		ordsuffix = i18n.ordinal[2]&lt;br /&gt;
	elseif cardinal % 10 == 3 then&lt;br /&gt;
		ordsuffix = i18n.ordinal[3]&lt;br /&gt;
	end&lt;br /&gt;
	-- In English, 1, 21, 31, etc. use 'st', but 11, 111, etc. use 'th'&lt;br /&gt;
	-- similarly for 12 and 13, etc.&lt;br /&gt;
	if (cardinal % 100 == 11) or (cardinal % 100 == 12) or (cardinal % 100 == 13) then&lt;br /&gt;
		ordsuffix = i18n.ordinal.default&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(cardinal) .. ordsuffix&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- findLang takes a &amp;quot;langcode&amp;quot; parameter if supplied and valid&lt;br /&gt;
-- otherwise it tries to create it from the user's set language ({{int:lang}})&lt;br /&gt;
-- failing that it uses the wiki's content language.&lt;br /&gt;
-- It returns a language object&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local findLang = function(langcode)&lt;br /&gt;
	local langobj&lt;br /&gt;
	langcode = mw.text.trim(langcode or &amp;quot;&amp;quot;)&lt;br /&gt;
	if mw.language.isKnownLanguageTag(langcode) then&lt;br /&gt;
		langobj = mw.language.new( langcode )&lt;br /&gt;
	else&lt;br /&gt;
		langcode = mw.getCurrentFrame():preprocess( '{{int:lang}}' )&lt;br /&gt;
		if mw.language.isKnownLanguageTag(langcode) then&lt;br /&gt;
			langobj = mw.language.new( langcode )&lt;br /&gt;
		else&lt;br /&gt;
			langobj = mw.language.getContentLanguage()&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return langobj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- roundto takes a number (x)&lt;br /&gt;
-- and returns it rounded to (sf) significant figures&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local roundto = function(x, sf)&lt;br /&gt;
	if x == 0 then return 0 end&lt;br /&gt;
	local s = 1&lt;br /&gt;
	if x &amp;lt; 0 then&lt;br /&gt;
		x = -x&lt;br /&gt;
		s = -1&lt;br /&gt;
	end&lt;br /&gt;
	if sf &amp;lt; 1 then sf = 1 end&lt;br /&gt;
	local p = 10 ^ (math.floor(math.log10(x)) - sf + 1)&lt;br /&gt;
	x = math.floor(x / p + 0.5) * p * s&lt;br /&gt;
	-- if it's integral, cast to an integer:&lt;br /&gt;
	if x == math.floor(x) then x = math.floor(x) end&lt;br /&gt;
	return x&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- decimalToDMS takes a decimal degrees (x) with precision (p)&lt;br /&gt;
-- and returns degrees/minutes/seconds according to the precision&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local decimalToDMS = function(x, p)&lt;br /&gt;
	-- if p is not supplied, use a precision around 0.1 seconds&lt;br /&gt;
	if not tonumber(p) then p = 1e-4 end&lt;br /&gt;
	local d = math.floor(x)&lt;br /&gt;
	local ms = (x - d) * 60&lt;br /&gt;
	if p &amp;gt; 0.5 then -- precision is &amp;gt; 1/2 a degree&lt;br /&gt;
		if ms &amp;gt; 30 then d = d + 1 end&lt;br /&gt;
		ms = 0&lt;br /&gt;
	end&lt;br /&gt;
	local m = math.floor(ms)&lt;br /&gt;
	local s = (ms - m) * 60&lt;br /&gt;
	if p &amp;gt; 0.008 then -- precision is &amp;gt; 1/2 a minute&lt;br /&gt;
		if s &amp;gt; 30 then m = m +1 end&lt;br /&gt;
		s = 0&lt;br /&gt;
	elseif p &amp;gt; 0.00014 then -- precision is &amp;gt; 1/2 a second&lt;br /&gt;
		s = math.floor(s + 0.5)&lt;br /&gt;
	elseif p &amp;gt; 0.000014 then -- precision is &amp;gt; 1/20 second&lt;br /&gt;
		s = math.floor(10 * s + 0.5) / 10&lt;br /&gt;
	elseif p &amp;gt; 0.0000014 then -- precision is &amp;gt; 1/200 second&lt;br /&gt;
		s = math.floor(100 * s + 0.5) / 100&lt;br /&gt;
	else -- cap it at 3 dec places for now&lt;br /&gt;
		s = math.floor(1000 * s + 0.5) / 1000&lt;br /&gt;
	end&lt;br /&gt;
	return d, m, s&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- decimalPrecision takes a decimal (x) with precision (p)&lt;br /&gt;
-- and returns x rounded approximately to the given precision&lt;br /&gt;
-- precision should be between 1 and 1e-6, preferably a power of 10.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local decimalPrecision = function(x, p)&lt;br /&gt;
	local s = 1&lt;br /&gt;
	if x &amp;lt; 0 then&lt;br /&gt;
		x = -x&lt;br /&gt;
		s = -1&lt;br /&gt;
	end&lt;br /&gt;
	-- if p is not supplied, pick an arbitrary precision&lt;br /&gt;
	if not tonumber(p) then p = 1e-4&lt;br /&gt;
	elseif p &amp;gt; 1 then p = 1&lt;br /&gt;
	elseif p &amp;lt; 1e-6 then p = 1e-6&lt;br /&gt;
	else p = 10 ^ math.floor(math.log10(p))&lt;br /&gt;
	end&lt;br /&gt;
	x = math.floor(x / p + 0.5) * p * s&lt;br /&gt;
	-- if it's integral, cast to an integer:&lt;br /&gt;
	if  x == math.floor(x) then x = math.floor(x) end&lt;br /&gt;
	-- if it's less than 1e-4, it will be in exponent form, so return a string with 6dp&lt;br /&gt;
	-- 9e-5 becomes 0.000090&lt;br /&gt;
	if math.abs(x) &amp;lt; 1e-4 then x = string.format(&amp;quot;%f&amp;quot;, x) end&lt;br /&gt;
	return x&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- formatDate takes a datetime of the usual format from mw.wikibase.entity:formatPropertyValues&lt;br /&gt;
-- like &amp;quot;1 August 30 BCE&amp;quot; as parameter 1&lt;br /&gt;
-- and formats it according to the df (date format) and bc parameters&lt;br /&gt;
-- df = [&amp;quot;dmy&amp;quot; / &amp;quot;mdy&amp;quot; / &amp;quot;y&amp;quot;] default will be &amp;quot;dmy&amp;quot;&lt;br /&gt;
-- bc = [&amp;quot;BC&amp;quot; / &amp;quot;BCE&amp;quot;] default will be &amp;quot;BCE&amp;quot;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local format_Date = function(datetime, dateformat, bc)&lt;br /&gt;
	local datetime = datetime or &amp;quot;1 August 30 BCE&amp;quot; -- in case of nil value&lt;br /&gt;
	-- chop off multiple vales and/or any hours, mins, etc.&lt;br /&gt;
	-- keep anything before punctuation - we just want a single date:&lt;br /&gt;
	local dateval = string.match( datetime, &amp;quot;[%w ]+&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	local dateformat = string.lower(dateformat or &amp;quot;dmy&amp;quot;) -- default to dmy&lt;br /&gt;
&lt;br /&gt;
	local bc = string.upper(bc or &amp;quot;&amp;quot;) -- can't use nil for bc&lt;br /&gt;
	-- we only want to accept two possibilities: BC or default to BCE&lt;br /&gt;
	if bc == &amp;quot;BC&amp;quot; then&lt;br /&gt;
		bc = &amp;quot;&amp;amp;nbsp;&amp;quot; .. i18n[&amp;quot;BC&amp;quot;] -- prepend a non-breaking space.&lt;br /&gt;
	else&lt;br /&gt;
		bc = &amp;quot;&amp;amp;nbsp;&amp;quot; .. i18n[&amp;quot;BCE&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local postchrist = true -- start by assuming no BCE&lt;br /&gt;
	local dateparts = {}&lt;br /&gt;
	for word in string.gmatch(dateval, &amp;quot;%w+&amp;quot;) do&lt;br /&gt;
		if word == &amp;quot;BCE&amp;quot; or word == &amp;quot;BC&amp;quot; then -- *** internationalise later ***&lt;br /&gt;
			postchrist = false&lt;br /&gt;
		else&lt;br /&gt;
			-- we'll keep the parts that are not 'BCE' in a table&lt;br /&gt;
			dateparts[#dateparts + 1] = word&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if postchrist then bc = &amp;quot;&amp;quot; end -- set AD dates to no suffix *** internationalise later ***&lt;br /&gt;
&lt;br /&gt;
	local sep = &amp;quot;&amp;amp;nbsp;&amp;quot; -- separator is nbsp&lt;br /&gt;
	local fdate = table.concat(dateparts, sep) -- set formatted date to same order as input&lt;br /&gt;
&lt;br /&gt;
	-- if we have day month year, check dateformat&lt;br /&gt;
	if #dateparts == 3 then&lt;br /&gt;
		if dateformat == &amp;quot;y&amp;quot; then&lt;br /&gt;
			fdate = dateparts[3]&lt;br /&gt;
		elseif dateformat == &amp;quot;mdy&amp;quot; then&lt;br /&gt;
			fdate = dateparts[2] .. sep .. dateparts[1] .. &amp;quot;,&amp;quot; .. sep .. dateparts[3]&lt;br /&gt;
		end&lt;br /&gt;
	elseif #dateparts == 2 and dateformat == &amp;quot;y&amp;quot; then&lt;br /&gt;
		fdate = dateparts[2]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return fdate .. bc&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- dateFormat is the handler for properties that are of type &amp;quot;time&amp;quot;&lt;br /&gt;
-- It takes timestamp, precision (6 to 11 per mediawiki), dateformat (y/dmy/mdy), BC format (BC/BCE),&lt;br /&gt;
-- a plaindate switch (yes/no/adj) to en/disable &amp;quot;sourcing cirumstances&amp;quot;/use adjectival form,&lt;br /&gt;
-- any qualifiers for the property, the language, and any adjective to use like 'before'.&lt;br /&gt;
-- It passes the date through the &amp;quot;complex date&amp;quot; function&lt;br /&gt;
-- and returns a string with the internatonalised date formatted according to preferences.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang(); cdate(); dp[]&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local dateFormat = function(timestamp, dprec, df, bcf, pd, qualifiers, lang, adj, model)&lt;br /&gt;
	-- A year can be stored like this: &amp;quot;+1872-00-00T00:00:00Z&amp;quot;,&lt;br /&gt;
	-- which is processed here as if it were the day before &amp;quot;+1872-01-01T00:00:00Z&amp;quot;,&lt;br /&gt;
	-- and that's the last day of 1871, so the year is wrong.&lt;br /&gt;
	-- So fix the month 0, day 0 timestamp to become 1 January instead:&lt;br /&gt;
	timestamp = timestamp:gsub(&amp;quot;%-00%-00T&amp;quot;, &amp;quot;-01-01T&amp;quot;)&lt;br /&gt;
	-- output formatting according to preferences (y/dmy/mdy)&lt;br /&gt;
	df = (df or &amp;quot;&amp;quot;):lower()&lt;br /&gt;
	-- just in case date precision is missing&lt;br /&gt;
	dprec = dprec or 11&lt;br /&gt;
	-- override more precise dates if required dateformat is year alone:&lt;br /&gt;
	if df == &amp;quot;y&amp;quot; and dprec &amp;gt; 9 then dprec = 9 end&lt;br /&gt;
	-- complex date only deals with precisions from 6 to 11, so clip range&lt;br /&gt;
	dprec = dprec&amp;gt;11 and 11 or dprec&lt;br /&gt;
	dprec = dprec&amp;lt;6 and 6 or dprec&lt;br /&gt;
	-- BC format is &amp;quot;BC&amp;quot; or &amp;quot;BCE&amp;quot;&lt;br /&gt;
	bcf = (bcf or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	-- plaindate only needs the first letter (y/n/a)&lt;br /&gt;
	pd = (pd or &amp;quot;&amp;quot;):sub(1,1):lower()&lt;br /&gt;
	if pd == &amp;quot;&amp;quot; or pd == &amp;quot;n&amp;quot; or pd == &amp;quot;f&amp;quot; or pd == &amp;quot;0&amp;quot; then pd = false end&lt;br /&gt;
	-- in case language isn't passed&lt;br /&gt;
	lang = lang or findLang().code&lt;br /&gt;
	-- set adj as empty if nil&lt;br /&gt;
	adj = adj or &amp;quot;&amp;quot;&lt;br /&gt;
	-- extract the day, month, year from the timestamp&lt;br /&gt;
	local bc = timestamp:sub(1, 1)==&amp;quot;-&amp;quot; and &amp;quot;BC&amp;quot; or &amp;quot;&amp;quot;&lt;br /&gt;
	local year, month, day = timestamp:match(&amp;quot;[+-](%d*)-(%d*)-(%d*)T&amp;quot;)&lt;br /&gt;
	local iso = tonumber(year) -- if year is missing, let it throw an error&lt;br /&gt;
	-- this will adjust the date format to be compatible with cdate&lt;br /&gt;
	-- possible formats are Y, YY, YYY0, YYYY, YYYY-MM, YYYY-MM-DD&lt;br /&gt;
	if dprec == 6 then iso = math.floor( (iso - 1) / 1000 ) + 1 end&lt;br /&gt;
	if dprec == 7 then iso = math.floor( (iso - 1) / 100 ) + 1 end&lt;br /&gt;
	if dprec == 8 then iso = math.floor( iso / 10 ) .. &amp;quot;0&amp;quot; end&lt;br /&gt;
	if dprec == 10 then iso = year .. &amp;quot;-&amp;quot; .. month end&lt;br /&gt;
	if dprec == 11 then iso = year .. &amp;quot;-&amp;quot; .. month .. &amp;quot;-&amp;quot; .. day end&lt;br /&gt;
	-- add &amp;quot;circa&amp;quot; (Q5727902) from &amp;quot;sourcing circumstances&amp;quot; (P1480)&lt;br /&gt;
	local sc = not pd and qualifiers and qualifiers.P1480&lt;br /&gt;
	if sc then&lt;br /&gt;
		for k1, v1 in pairs(sc) do&lt;br /&gt;
			if v1.datavalue and v1.datavalue.value.id == &amp;quot;Q5727902&amp;quot; then&lt;br /&gt;
				adj = &amp;quot;circa&amp;quot;&lt;br /&gt;
				break&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- deal with Julian dates:&lt;br /&gt;
	-- no point in saying that dates before 1582 are Julian - they are by default&lt;br /&gt;
	-- doesn't make sense for dates less precise than year&lt;br /&gt;
	-- we can supress it by setting |plaindate, e.g. for use in constructing categories.&lt;br /&gt;
	local calendarmodel = &amp;quot;&amp;quot;&lt;br /&gt;
	if tonumber(year) &amp;gt; 1582&lt;br /&gt;
		and dprec &amp;gt; 8&lt;br /&gt;
		and not pd&lt;br /&gt;
		and model == &amp;quot;http://www.wikidata.org/entity/Q1985786&amp;quot; then&lt;br /&gt;
		calendarmodel = &amp;quot;julian&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if not cdate then&lt;br /&gt;
		cdate = require(&amp;quot;Module:Complex date&amp;quot;)._complex_date&lt;br /&gt;
	end&lt;br /&gt;
	local fdate = cdate(calendarmodel, adj, tostring(iso), dp[dprec], bc, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, lang, 1)&lt;br /&gt;
	-- this may have QuickStatements info appended to it in a div, so remove that&lt;br /&gt;
	fdate = fdate:gsub(' &amp;lt;div style=&amp;quot;display: none;&amp;quot;&amp;gt;[^&amp;lt;]*&amp;lt;/div&amp;gt;', '')&lt;br /&gt;
	-- it may also be returned wrapped in a microformat, so remove that&lt;br /&gt;
	fdate = fdate:gsub(&amp;quot;&amp;lt;[^&amp;gt;]*&amp;gt;&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	-- if 'circa', use the abbreviated form *** internationalise later ***&lt;br /&gt;
	fdate = fdate:gsub('circa ', '&amp;lt;abbr title=&amp;quot;circa&amp;quot;&amp;gt;c.&amp;lt;/abbr&amp;gt;&amp;amp;nbsp;')&lt;br /&gt;
	-- deal with BC/BCE&lt;br /&gt;
	if bcf == &amp;quot;BCE&amp;quot; then&lt;br /&gt;
		fdate = fdate:gsub('BC', 'BCE')&lt;br /&gt;
	end&lt;br /&gt;
	-- deal with mdy format&lt;br /&gt;
	if df == &amp;quot;mdy&amp;quot; then&lt;br /&gt;
		fdate = fdate:gsub(&amp;quot;(%d+) (%w+) (%d+)&amp;quot;, &amp;quot;%2 %1, %3&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	-- deal with adjectival form *** internationalise later ***&lt;br /&gt;
	if pd == &amp;quot;a&amp;quot; then&lt;br /&gt;
		fdate = fdate:gsub(' century', '-century')&lt;br /&gt;
	end&lt;br /&gt;
	return fdate&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- parseParam takes a (string) parameter, e.g. from the list of frame arguments,&lt;br /&gt;
-- and makes &amp;quot;false&amp;quot;, &amp;quot;no&amp;quot;, and &amp;quot;0&amp;quot; into the (boolean) false&lt;br /&gt;
-- it makes the empty string and nil into the (boolean) value passed as default&lt;br /&gt;
-- allowing the parameter to be true or false by default.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local parseParam = function(param, default)&lt;br /&gt;
	if param and param ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		param = param:lower()&lt;br /&gt;
		if (param == &amp;quot;false&amp;quot;) or (param:sub(1,1) == &amp;quot;n&amp;quot;) or (param == &amp;quot;0&amp;quot;) then&lt;br /&gt;
			return false&lt;br /&gt;
		else&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- _getSitelink takes the qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink&lt;br /&gt;
-- If the parameter is blank, then it uses the local wiki.&lt;br /&gt;
-- If there is a sitelink to an article available, it returns the plain text link to the article&lt;br /&gt;
-- If there is no sitelink, it returns nil.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local _getSitelink = function(qid, wiki)&lt;br /&gt;
	qid = (qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	wiki = wiki or &amp;quot;&amp;quot;&lt;br /&gt;
	local sitelink&lt;br /&gt;
	if wiki == &amp;quot;&amp;quot; then&lt;br /&gt;
		sitelink = mw.wikibase.sitelink(qid)&lt;br /&gt;
	else&lt;br /&gt;
		sitelink = mw.wikibase.sitelink(qid, wiki)&lt;br /&gt;
	end&lt;br /&gt;
	return sitelink&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- _getCommonslink takes an optional qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- It returns one of the following in order of preference:&lt;br /&gt;
-- 	the Commons sitelink of the Wikidata entity - but not if onlycat=true and it's not a category;&lt;br /&gt;
-- 	the Commons sitelink of the topic's main category of the Wikidata entity;&lt;br /&gt;
-- 	the Commons category of the Wikidata entity - unless fallback=false.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _getSitelink(); parseParam()&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local _getCommonslink = function(qid, onlycat, fallback)&lt;br /&gt;
	qid = (qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	onlycat = parseParam(onlycat, false)&lt;br /&gt;
	if fallback == &amp;quot;&amp;quot; then fallback = nil end&lt;br /&gt;
	local sitelink = _getSitelink(qid, &amp;quot;commonswiki&amp;quot;)&lt;br /&gt;
	if onlycat and sitelink and sitelink:sub(1,9) ~= &amp;quot;Category:&amp;quot; then sitelink = nil end&lt;br /&gt;
	if not sitelink then&lt;br /&gt;
		-- check for topic's main category&lt;br /&gt;
		local prop910 = mw.wikibase.getBestStatements(qid, &amp;quot;P910&amp;quot;)[1]&lt;br /&gt;
		if prop910 then&lt;br /&gt;
			local tmcid = prop910.mainsnak.datavalue.value.id&lt;br /&gt;
			sitelink = _getSitelink(tmcid, &amp;quot;commonswiki&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if not sitelink and fallback then&lt;br /&gt;
		-- check for Commons category (string value)&lt;br /&gt;
		local prop373 = mw.wikibase.getBestStatements(qid, &amp;quot;P373&amp;quot;)[1]&lt;br /&gt;
		if prop373 then&lt;br /&gt;
			sitelink = prop373.mainsnak.datavalue.value&lt;br /&gt;
			if sitelink then sitelink = &amp;quot;Category:&amp;quot; .. sitelink end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return sitelink&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- The label in a Wikidata item is subject to vulnerabilities&lt;br /&gt;
-- that an attacker might try to exploit.&lt;br /&gt;
-- It needs to be 'sanitised' by removing any wikitext before use.&lt;br /&gt;
-- If it doesn't exist, return the id for the item&lt;br /&gt;
-- a second (boolean) value is also returned, value is true when the label exists&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local labelOrId = function(id)&lt;br /&gt;
	local label = mw.wikibase.label(id)&lt;br /&gt;
	if label then&lt;br /&gt;
		return mw.text.nowiki(label), true&lt;br /&gt;
	else&lt;br /&gt;
		return id, false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- linkedItem takes an entity-id and returns a string, linked if possible.&lt;br /&gt;
-- This is the handler for &amp;quot;wikibase-item&amp;quot;. Preferences:&lt;br /&gt;
-- 1. Display linked disambiguated sitelink if it exists&lt;br /&gt;
-- 2. Display linked label if it is a redirect&lt;br /&gt;
-- 3. TBA: Display an inter-language link for the label if it exists other than in default language&lt;br /&gt;
-- 4. Display unlinked label if it exists&lt;br /&gt;
-- 5. Display entity-id for now to indicate a label could be provided&lt;br /&gt;
-- dtxt is text to be used instead of label, or nil.&lt;br /&gt;
-- shortname is boolean switch to use P1813 (short name) instead of label if true.&lt;br /&gt;
-- lang is the current language code.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: labelOrId(); donotlink[]&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local linkedItem = function(id, lprefix, lpostfix, prefix, postfix, dtxt, shortname, lang)&lt;br /&gt;
	lprefix = lprefix or &amp;quot;&amp;quot; -- toughen against nil values passed&lt;br /&gt;
	lpostfix = lpostfix or &amp;quot;&amp;quot;&lt;br /&gt;
	prefix = prefix or &amp;quot;&amp;quot;&lt;br /&gt;
	postfix = postfix or &amp;quot;&amp;quot;&lt;br /&gt;
	lang = lang or &amp;quot;en&amp;quot; -- fallback to default if missing&lt;br /&gt;
	local disp&lt;br /&gt;
	local sitelink = mw.wikibase.sitelink(id)&lt;br /&gt;
	local label, islabel&lt;br /&gt;
	if dtxt then&lt;br /&gt;
		label, islabel = dtxt, true&lt;br /&gt;
	elseif shortname then&lt;br /&gt;
		-- see if there is a shortname in our language, and set label to it&lt;br /&gt;
		for k, v in ipairs( mw.wikibase.getBestStatements(id, &amp;quot;P1813&amp;quot;) ) do&lt;br /&gt;
			if v.mainsnak.datavalue.value.language == lang then&lt;br /&gt;
				label, islabel = v.mainsnak.datavalue.value.text, true&lt;br /&gt;
				break&lt;br /&gt;
			end -- test for language match&lt;br /&gt;
		end -- loop through values of short name&lt;br /&gt;
		-- if we have no label set, then there was no shortname available&lt;br /&gt;
		if not islabel then&lt;br /&gt;
			label, islabel = labelOrId(id)&lt;br /&gt;
			shortname = false&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		label, islabel = labelOrId(id)&lt;br /&gt;
	end&lt;br /&gt;
	if mw.site.siteName ~= &amp;quot;Wikimedia Commons&amp;quot; then&lt;br /&gt;
		if sitelink then&lt;br /&gt;
			if not (dtxt or shortname) then&lt;br /&gt;
				-- strip any namespace or dab from the sitelink and use that as label&lt;br /&gt;
				local pos = sitelink:find(&amp;quot;:&amp;quot;) or 0&lt;br /&gt;
				label = sitelink:sub(pos+1):gsub(&amp;quot;%s%(.+%)$&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;,.+$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			if donotlink[label] then&lt;br /&gt;
				disp = prefix .. label .. postfix&lt;br /&gt;
			else&lt;br /&gt;
				disp = &amp;quot;[[&amp;quot; .. lprefix .. sitelink .. lpostfix .. &amp;quot;|&amp;quot; .. prefix .. label .. postfix .. &amp;quot;]]&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		elseif islabel then&lt;br /&gt;
			-- no sitelink, label exists, so check if a redirect with that title exists&lt;br /&gt;
			local artitle = mw.title.new(label, 0)&lt;br /&gt;
			if artitle and artitle.redirectTarget and not donotlink[label] then&lt;br /&gt;
				-- there's a redirect with the same title as the label, so let's link to that&lt;br /&gt;
				disp = &amp;quot;[[&amp;quot;.. lprefix .. label .. lpostfix .. &amp;quot;|&amp;quot; .. prefix .. label .. postfix .. &amp;quot;]]&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				-- no sitelink, label exists, not redirect (or donotlink) so output plain label&lt;br /&gt;
				disp = prefix .. label .. postfix&lt;br /&gt;
			end -- test if article title exists as redirect on current Wiki&lt;br /&gt;
		else&lt;br /&gt;
			-- no sitelink and no label, so return whatever was returned from labelOrId for now&lt;br /&gt;
			-- add tracking category [[Category:Articles with missing Wikidata information]]&lt;br /&gt;
			disp = prefix .. label .. postfix .. i18n.missinginfocat&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local ccat = mw.wikibase.getBestStatements(id, &amp;quot;P373&amp;quot;)[1]&lt;br /&gt;
		if ccat and ccat.mainsnak.datavalue then&lt;br /&gt;
			ccat = ccat.mainsnak.datavalue.value&lt;br /&gt;
			disp = &amp;quot;[[&amp;quot; .. lprefix .. &amp;quot;Category:&amp;quot; .. ccat .. lpostfix .. &amp;quot;|&amp;quot; .. prefix .. label .. postfix .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		elseif sitelink then&lt;br /&gt;
			-- this asumes that if a sitelink exists, then a label also exists&lt;br /&gt;
			disp = &amp;quot;[[&amp;quot; .. lprefix .. sitelink .. lpostfix .. &amp;quot;|&amp;quot; .. prefix .. label .. postfix .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		else&lt;br /&gt;
			-- no sitelink and no Commons cat, so return label from labelOrId for now&lt;br /&gt;
			disp = prefix .. label .. postfix&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return disp&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- sourced takes a table representing a statement that may or may not have references&lt;br /&gt;
-- it counts how many references are sourced to something not containing the word &amp;quot;wikipedia&amp;quot;&lt;br /&gt;
-- it returns a boolean = true if there are any sourced references.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local sourced = function(claim)&lt;br /&gt;
	if claim.references then&lt;br /&gt;
		for kr, vr in pairs(claim.references) do&lt;br /&gt;
			local ref = mw.wikibase.renderSnaks(vr.snaks)&lt;br /&gt;
			if not ref:find(&amp;quot;Wikipedia&amp;quot;) then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- setRanks takes a flag (parameter passed) that requests the values to return&lt;br /&gt;
-- &amp;quot;b[est]&amp;quot; returns preferred if available, otherwise normal&lt;br /&gt;
-- &amp;quot;p[referred]&amp;quot; returns preferred&lt;br /&gt;
-- &amp;quot;n[ormal]&amp;quot; returns normal&lt;br /&gt;
-- &amp;quot;d[eprecated]&amp;quot; returns deprecated&lt;br /&gt;
-- multiple values are allowed, e.g. &amp;quot;preferred normal&amp;quot; (which is the default)&lt;br /&gt;
-- &amp;quot;best&amp;quot; will override the other flags, and set p and n&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local setRanks = function(rank)&lt;br /&gt;
	rank = (rank or &amp;quot;&amp;quot;):lower()&lt;br /&gt;
	-- if nothing passed, return preferred and normal&lt;br /&gt;
	-- if rank == &amp;quot;&amp;quot; then rank = &amp;quot;p n&amp;quot; end&lt;br /&gt;
	local ranks = {}&lt;br /&gt;
	for w in string.gmatch(rank, &amp;quot;%a+&amp;quot;) do&lt;br /&gt;
		w = w:sub(1,1)&lt;br /&gt;
		if w == &amp;quot;b&amp;quot; or w == &amp;quot;p&amp;quot; or w == &amp;quot;n&amp;quot; or w == &amp;quot;d&amp;quot; then&lt;br /&gt;
			ranks[w] = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- check if &amp;quot;best&amp;quot; is requested or no ranks requested; and if so, set preferred and normal&lt;br /&gt;
	if ranks.b or not next(ranks) then&lt;br /&gt;
		ranks.p = true&lt;br /&gt;
		ranks.n = true&lt;br /&gt;
	end&lt;br /&gt;
	return ranks&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- parseInput processes the Q-id , the blacklist and the whitelist&lt;br /&gt;
-- if an input parameter is supplied, it returns that and ends the call.&lt;br /&gt;
-- it returns (1) either the qid or nil indicating whether or not the call should continue&lt;br /&gt;
-- and (2) a table containing all of the statements for the propertyID and relevant Qid&lt;br /&gt;
-- if &amp;quot;best&amp;quot; ranks are requested, it returns those instead of all non-deprecated ranks&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local parseInput = function(frame, input_parm, property_id)&lt;br /&gt;
	-- There may be a local parameter supplied, if it's blank, set it to nil&lt;br /&gt;
	input_parm = mw.text.trim(input_parm or &amp;quot;&amp;quot;)&lt;br /&gt;
	if input_parm == &amp;quot;&amp;quot; then input_parm = nil end&lt;br /&gt;
&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
&lt;br /&gt;
	-- can take a named parameter |qid which is the Wikidata ID for the article.&lt;br /&gt;
	-- if it's not supplied, use the id for the current page&lt;br /&gt;
	local qid = args.qid or &amp;quot;&amp;quot;&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	-- if there's no Wikidata item for the current page return nil&lt;br /&gt;
	if not qid then return false, input_parm end&lt;br /&gt;
&lt;br /&gt;
	-- The blacklist is passed in named parameter |suppressfields&lt;br /&gt;
	local blacklist = args.suppressfields or args.spf&lt;br /&gt;
&lt;br /&gt;
	-- The whitelist is passed in named parameter |fetchwikidata&lt;br /&gt;
	local whitelist = args.fetchwikidata or args.fwd&lt;br /&gt;
	if not whitelist or whitelist == &amp;quot;&amp;quot; then whitelist = &amp;quot;NONE&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	-- The name of the field that this function is called from is passed in named parameter |name&lt;br /&gt;
	local fieldname = args.name or &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	if blacklist then&lt;br /&gt;
		-- The name is compulsory when blacklist is used, so return nil if it is not supplied&lt;br /&gt;
		if not fieldname or fieldname == &amp;quot;&amp;quot; then return false, nil end&lt;br /&gt;
		-- If this field is on the blacklist, then return nil&lt;br /&gt;
		if blacklist:find(fieldname) then return false, nil end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- If we got this far then we're not on the blacklist&lt;br /&gt;
	-- The blacklist overrides any locally supplied parameter as well&lt;br /&gt;
	-- If a non-blank input parameter was supplied return it&lt;br /&gt;
	if input_parm then return false, input_parm end&lt;br /&gt;
&lt;br /&gt;
	-- We can filter out non-valid properties&lt;br /&gt;
	if property_id:sub(1,1):upper() ~=&amp;quot;P&amp;quot; or property_id == &amp;quot;P0&amp;quot; then return false, nil end&lt;br /&gt;
&lt;br /&gt;
	-- Otherwise see if this field is on the whitelist:&lt;br /&gt;
	-- needs a bit more logic because find will return its second value = 0 if fieldname is &amp;quot;&amp;quot;&lt;br /&gt;
	-- but nil if fieldname not found on whitelist&lt;br /&gt;
	local _, found = whitelist:find(fieldname)&lt;br /&gt;
	found = ((found or 0) &amp;gt; 0)&lt;br /&gt;
	if whitelist ~= 'ALL' and (whitelist:upper() == &amp;quot;NONE&amp;quot; or not found) then&lt;br /&gt;
		return false, nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- See what's on Wikidata (the call always returns a table, but it may be empty):&lt;br /&gt;
	local props = {}&lt;br /&gt;
	if args.reqranks.b then&lt;br /&gt;
		props = mw.wikibase.getBestStatements(qid, property_id)&lt;br /&gt;
	else&lt;br /&gt;
		props = mw.wikibase.getAllStatements(qid, property_id)&lt;br /&gt;
	end&lt;br /&gt;
	if props[1] then&lt;br /&gt;
		return qid, props&lt;br /&gt;
	end&lt;br /&gt;
	-- no property on Wikidata&lt;br /&gt;
	return false, nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- createicon assembles the &amp;quot;Edit at Wikidata&amp;quot; pen icon.&lt;br /&gt;
-- It returns a wikitext string.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: i18n[];&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local createicon = function(langcode, entityID, propertyID)&lt;br /&gt;
	local icon = &amp;quot;&amp;amp;nbsp;[[&amp;quot; .. i18n[&amp;quot;filespace&amp;quot;]&lt;br /&gt;
	icon = icon .. &amp;quot;:Blue pencil.svg |frameless |text-top |10px |alt=&amp;quot;&lt;br /&gt;
	icon = icon .. i18n[&amp;quot;editonwikidata&amp;quot;]&lt;br /&gt;
	icon = icon .. &amp;quot;|link=https://www.wikidata.org/wiki/&amp;quot; .. entityID&lt;br /&gt;
	icon = icon .. &amp;quot;?uselang=&amp;quot; .. langcode&lt;br /&gt;
	if propertyID then icon = icon .. &amp;quot;#&amp;quot; .. propertyID end&lt;br /&gt;
	icon = icon .. &amp;quot;|&amp;quot; .. i18n[&amp;quot;editonwikidata&amp;quot;] .. &amp;quot;]]&amp;quot;&lt;br /&gt;
	return icon&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- assembleoutput takes the sequence table containing the property values&lt;br /&gt;
-- and formats it according to switches given. It returns a string or nil.&lt;br /&gt;
-- It needs the entityID and propertyID to create a link in the pen icon.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local assembleoutput = function(out, args, entityID, propertyID)&lt;br /&gt;
&lt;br /&gt;
	-- sorted is a boolean passed to enable sorting of the values returned&lt;br /&gt;
	-- if nothing or an empty string is passed set it false&lt;br /&gt;
	-- if &amp;quot;false&amp;quot; or &amp;quot;no&amp;quot; or &amp;quot;0&amp;quot; is passed set it false&lt;br /&gt;
	local sorted = parseParam(args.sorted, false)&lt;br /&gt;
&lt;br /&gt;
	-- noicon is a boolean passed to suppress the trailing &amp;quot;edit at Wikidata&amp;quot; icon&lt;br /&gt;
	-- for use when the value is processed further by the infobox&lt;br /&gt;
	-- if nothing or an empty string is passed set it false&lt;br /&gt;
	-- if &amp;quot;false&amp;quot; or &amp;quot;no&amp;quot; or &amp;quot;0&amp;quot; is passed set it false&lt;br /&gt;
	local noic = parseParam(args.noicon, false)&lt;br /&gt;
&lt;br /&gt;
	-- list is the name of a template that a list of multiple values is passed through&lt;br /&gt;
	-- examples include &amp;quot;hlist&amp;quot; and &amp;quot;ubl&amp;quot;&lt;br /&gt;
	-- setting it to &amp;quot;prose&amp;quot; produces something like &amp;quot;1, 2, 3, and 4&amp;quot;&lt;br /&gt;
	local list = args.list or &amp;quot;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	-- sep is a string that is used to separate multiple returned values&lt;br /&gt;
	-- if nothing or an empty string is passed set it to the default&lt;br /&gt;
	-- any double-quotes &amp;quot; are stripped out, so that spaces may be passed&lt;br /&gt;
	-- e.g. |sep=&amp;quot; - &amp;quot;&lt;br /&gt;
	local sepdefault = i18n[&amp;quot;list separator&amp;quot;]&lt;br /&gt;
	local separator = args.sep or &amp;quot;&amp;quot;&lt;br /&gt;
	separator = string.gsub(separator, '&amp;quot;', '')&lt;br /&gt;
	if separator == &amp;quot;&amp;quot; then&lt;br /&gt;
		separator = sepdefault&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- collapse is a number that determines the maximum number of returned values&lt;br /&gt;
	-- before the output is collapsed.&lt;br /&gt;
	-- Zero or not a number result in no collapsing (default becomes 0).&lt;br /&gt;
	local collapse = tonumber(args.collapse) or 0&lt;br /&gt;
&lt;br /&gt;
	-- if there's anything to return, then return a list&lt;br /&gt;
	-- comma-separated by default, but may be specified by the sep parameter&lt;br /&gt;
	-- optionally specify a hlist or ubl or a prose list, etc.&lt;br /&gt;
	local strout&lt;br /&gt;
	if #out &amp;gt; 0 then&lt;br /&gt;
		if sorted then table.sort(out) end&lt;br /&gt;
		-- if a pen icon is wanted add it the end of the last value&lt;br /&gt;
		if not noic then&lt;br /&gt;
			out[#out] = out[#out] .. createicon(args.langobj.code, entityID, propertyID)&lt;br /&gt;
		end&lt;br /&gt;
		if list == &amp;quot;&amp;quot; then&lt;br /&gt;
			strout = table.concat(out, separator)&lt;br /&gt;
		elseif list:lower() == &amp;quot;prose&amp;quot; then&lt;br /&gt;
			strout = mw.text.listToText( out )&lt;br /&gt;
		else&lt;br /&gt;
			strout = mw.getCurrentFrame():expandTemplate{title = list, args = out}&lt;br /&gt;
		end&lt;br /&gt;
		if collapse &amp;gt;0 and #out &amp;gt; collapse then&lt;br /&gt;
			strout = collapsediv .. strout .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		strout = nil -- no items had valid reference&lt;br /&gt;
	end&lt;br /&gt;
	return strout&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- rendersnak takes a table (propval) containing the information stored on one property value&lt;br /&gt;
-- and returns the value as a string and its language if monolingual text.&lt;br /&gt;
-- It handles data of type:&lt;br /&gt;
--		wikibase-item&lt;br /&gt;
--		time&lt;br /&gt;
--		string, url, commonsMedia, external-id&lt;br /&gt;
--		quantity&lt;br /&gt;
--		globe-coordinate&lt;br /&gt;
--		monolingualtext&lt;br /&gt;
-- It also requires linked, the link/pre/postfixes, uabbr, and the arguments passed from frame.&lt;br /&gt;
-- The optional filter parameter allows quantities to be be filtered by unit Qid.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam(); labelOrId(); i18n[]; dateFormat();&lt;br /&gt;
-- roundto(); decimalPrecision(); decimalToDMS(); linkedItem();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local rendersnak = function(propval, args, linked, lpre, lpost, pre, post, uabbr, filter)&lt;br /&gt;
	lpre = lpre or &amp;quot;&amp;quot;&lt;br /&gt;
	lpost = lpost or &amp;quot;&amp;quot;&lt;br /&gt;
	pre = pre or &amp;quot;&amp;quot;&lt;br /&gt;
	post = post or &amp;quot;&amp;quot;&lt;br /&gt;
	args.lang = args.lang or findLang().code&lt;br /&gt;
	-- allow values to display a fixed text instead of label&lt;br /&gt;
	local dtxt = args.displaytext or args.dt&lt;br /&gt;
	if dtxt == &amp;quot;&amp;quot; then dtxt = nil end&lt;br /&gt;
	-- switch to use display of short name (P1813) instead of label&lt;br /&gt;
	local shortname = args.shortname or args.sn&lt;br /&gt;
	shortname = parseParam(shortname, false)&lt;br /&gt;
	local snak = propval.mainsnak or propval&lt;br /&gt;
	local dv = snak.datavalue&lt;br /&gt;
	local dtype = propval.datatype or propval.mainsnak.datatype&lt;br /&gt;
	dv = dv and dv.value&lt;br /&gt;
	-- value and monolingual text language code returned&lt;br /&gt;
	local val, mlt&lt;br /&gt;
	if propval.rank and not args.reqranks[propval.rank:sub(1, 1)] then&lt;br /&gt;
		-- val is nil: value has a rank that isn't requested&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	elseif snak.snaktype == &amp;quot;somevalue&amp;quot; then -- value is unknown&lt;br /&gt;
		val = i18n[&amp;quot;Unknown&amp;quot;]&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	elseif snak.snaktype == &amp;quot;novalue&amp;quot; then -- value is none&lt;br /&gt;
		-- val = &amp;quot;No value&amp;quot; -- don't return anything&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	elseif dtype == &amp;quot;wikibase-item&amp;quot; then -- data type is a wikibase item:&lt;br /&gt;
		-- it's wiki-linked value, so output as link if enabled and possible&lt;br /&gt;
		local qnumber = dv.id&lt;br /&gt;
		if linked then&lt;br /&gt;
			val = linkedItem(qnumber, lpre, lpost, pre, post, dtxt, shortname, args.lang)&lt;br /&gt;
		else -- no link wanted so check for display-text, otherwise test for lang code&lt;br /&gt;
			local label, islabel&lt;br /&gt;
			if dtxt then&lt;br /&gt;
				label = dtxt&lt;br /&gt;
			else&lt;br /&gt;
				label, islabel = labelOrId(qnumber)&lt;br /&gt;
				local langlabel = mw.wikibase.getLabelByLang(qnumber, args.lang)&lt;br /&gt;
				if langlabel then&lt;br /&gt;
					label = mw.text.nowiki( langlabel )&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			val = pre .. label .. post&lt;br /&gt;
		end -- test for link required&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	elseif dtype == &amp;quot;time&amp;quot; then -- data type is time:&lt;br /&gt;
		-- time is in timestamp format&lt;br /&gt;
		-- date precision is integer per mediawiki&lt;br /&gt;
		-- output formatting according to preferences (y/dmy/mdy)&lt;br /&gt;
		-- BC format as BC or BCE&lt;br /&gt;
		-- plaindate is passed to disable looking for &amp;quot;sourcing cirumstances&amp;quot;&lt;br /&gt;
		-- or to set the adjectival form&lt;br /&gt;
		-- qualifiers (if any) is a nested table or nil&lt;br /&gt;
		-- lang is given, or user language, or site language&lt;br /&gt;
		val = dateFormat(dv.time, dv.precision, args.df, args.bc, args.pd, propval.qualifiers, args.lang, &amp;quot;&amp;quot;, dv.calendarmodel)&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	-- data types which are strings:&lt;br /&gt;
	elseif dtype == &amp;quot;commonsMedia&amp;quot; or dtype == &amp;quot;external-id&amp;quot; or dtype == &amp;quot;string&amp;quot; or dtype == &amp;quot;url&amp;quot; then&lt;br /&gt;
		-- commonsMedia or external-id or string or url&lt;br /&gt;
		-- all have mainsnak.datavalue.value as string&lt;br /&gt;
		if (lpre == &amp;quot;&amp;quot; or lpre == &amp;quot;:&amp;quot;) and lpost == &amp;quot;&amp;quot; then&lt;br /&gt;
			-- don't link if no linkpre/postfix or linkprefix is just &amp;quot;:&amp;quot;&lt;br /&gt;
			val = pre .. dv .. post&lt;br /&gt;
		else&lt;br /&gt;
			val = &amp;quot;[[&amp;quot; .. lpre .. dv .. lpost .. &amp;quot;|&amp;quot; .. pre .. dv .. post .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		end -- check for link requested (i.e. either linkprefix or linkpostfix exists)&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	-- data types which are quantities:&lt;br /&gt;
	elseif dtype == &amp;quot;quantity&amp;quot; then&lt;br /&gt;
		-- quantities have mainsnak.datavalue.value.amount and mainsnak.datavalue.value.unit&lt;br /&gt;
		-- the unit is of the form http://www.wikidata.org/entity/Q829073&lt;br /&gt;
		--&lt;br /&gt;
		-- implement a switch to turn on/off numerical formatting later&lt;br /&gt;
		local fnum = true&lt;br /&gt;
		--&lt;br /&gt;
		-- a switch to turn on/off conversions - only for en-wiki&lt;br /&gt;
		local conv = parseParam(args.conv or args.convert, false)&lt;br /&gt;
		-- if we have conversions, we won't have formatted numbers or scales&lt;br /&gt;
		if conv then&lt;br /&gt;
			fnum = false&lt;br /&gt;
			args.scale = &amp;quot;0&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
		--&lt;br /&gt;
		-- a switch to turn on/off showing units, default is true&lt;br /&gt;
		local showunits = parseParam(args.su or args.showunits, true)&lt;br /&gt;
		--&lt;br /&gt;
		-- convert amount to a number&lt;br /&gt;
		local amount = tonumber(dv.amount) or i18n[&amp;quot;NaN&amp;quot;]&lt;br /&gt;
		--&lt;br /&gt;
		-- scale factor for millions, billions, etc.&lt;br /&gt;
		local sc = tostring(args.scale or &amp;quot;&amp;quot;):sub(1,1):lower()&lt;br /&gt;
		local scale&lt;br /&gt;
		if sc == &amp;quot;a&amp;quot; then&lt;br /&gt;
			-- automatic scaling&lt;br /&gt;
			if amount &amp;gt; 1e15 then&lt;br /&gt;
				scale = 12&lt;br /&gt;
			elseif amount &amp;gt; 1e12 then&lt;br /&gt;
				scale = 9&lt;br /&gt;
			elseif amount &amp;gt; 1e9 then&lt;br /&gt;
				scale = 6&lt;br /&gt;
			elseif amount &amp;gt; 1e6 then&lt;br /&gt;
				scale = 3&lt;br /&gt;
			else&lt;br /&gt;
				scale = 0&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			scale = tonumber(args.scale) or 0&lt;br /&gt;
			if scale &amp;lt; 0 or scale &amp;gt; 12 then scale = 0 end&lt;br /&gt;
			scale = math.floor(scale/3) * 3&lt;br /&gt;
		end&lt;br /&gt;
		local factor = 10^scale&lt;br /&gt;
		amount = amount / factor&lt;br /&gt;
		-- ranges:&lt;br /&gt;
		local range = &amp;quot;&amp;quot;&lt;br /&gt;
		-- check if upper and/or lower bounds are given and significant&lt;br /&gt;
		local upb = tonumber(dv.upperBound)&lt;br /&gt;
		local lowb = tonumber(dv.lowerBound)&lt;br /&gt;
		if upb and lowb then&lt;br /&gt;
			-- differences rounded to 2 sig fig:&lt;br /&gt;
			local posdif = roundto(upb - amount, 2) / factor&lt;br /&gt;
			local negdif = roundto(amount - lowb, 2) / factor&lt;br /&gt;
			upb, lowb = amount + posdif, amount - negdif&lt;br /&gt;
			-- round scaled numbers to integers or 4 sig fig&lt;br /&gt;
			if (scale &amp;gt; 0 or sc == &amp;quot;a&amp;quot;) then&lt;br /&gt;
				if amount &amp;lt; 1e4 then&lt;br /&gt;
					amount = roundto(amount, 4)&lt;br /&gt;
				else&lt;br /&gt;
					amount = math.floor(amount + 0.5)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if fnum then amount = args.langobj:formatNum( amount ) end&lt;br /&gt;
			if posdif ~= negdif then&lt;br /&gt;
				-- non-symmetrical&lt;br /&gt;
				range = &amp;quot; +&amp;quot; .. posdif .. &amp;quot; -&amp;quot; .. negdif&lt;br /&gt;
			elseif posdif ~= 0 then&lt;br /&gt;
				-- symmetrical and non-zero&lt;br /&gt;
				range = &amp;quot; ±&amp;quot; .. posdif&lt;br /&gt;
			else&lt;br /&gt;
				-- otherwise range is zero, so leave it as &amp;quot;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- round scaled numbers to integers or 4 sig fig&lt;br /&gt;
			if (scale &amp;gt; 0 or sc == &amp;quot;a&amp;quot;) then&lt;br /&gt;
				if amount &amp;lt; 1e4 then&lt;br /&gt;
					amount = roundto(amount, 4)&lt;br /&gt;
				else&lt;br /&gt;
					amount = math.floor(amount + 0.5)&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if fnum then amount = args.langobj:formatNum( amount ) end&lt;br /&gt;
		end&lt;br /&gt;
		-- unit names and symbols:&lt;br /&gt;
		-- extract the qid in the form 'Qnnn' from the value.unit url&lt;br /&gt;
		-- and then fetch the label from that - or symbol if unitabbr is true&lt;br /&gt;
		local unit = &amp;quot;&amp;quot;&lt;br /&gt;
		local usep = &amp;quot;&amp;quot;&lt;br /&gt;
		local usym = &amp;quot;&amp;quot;&lt;br /&gt;
		local unitqid = string.match( dv.unit, &amp;quot;(Q%d+)&amp;quot; )&lt;br /&gt;
		if filter and unitqid ~= filter then return nil end&lt;br /&gt;
		if unitqid and showunits then&lt;br /&gt;
			local uname = mw.wikibase.getLabelByLang(unitqid, args.lang) or &amp;quot;&amp;quot;&lt;br /&gt;
			if uname ~= &amp;quot;&amp;quot; then usep, unit = &amp;quot; &amp;quot;, uname end&lt;br /&gt;
			if uabbr then&lt;br /&gt;
				-- see if there's a unit symbol (P5061)&lt;br /&gt;
				local unitsymbols = mw.wikibase.getAllStatements(unitqid, &amp;quot;P5061&amp;quot;)&lt;br /&gt;
				-- construct fallback table&lt;br /&gt;
				local fbtbl = mw.language.getFallbacksFor( args.lang )&lt;br /&gt;
				table.insert( fbtbl, 1, args.lang )&lt;br /&gt;
				local found = false&lt;br /&gt;
				for idx1, us in ipairs(unitsymbols) do&lt;br /&gt;
					for idx2, fblang in ipairs(fbtbl) do&lt;br /&gt;
						if us.mainsnak.datavalue.value.language == fblang then&lt;br /&gt;
							usym = us.mainsnak.datavalue.value.text&lt;br /&gt;
							found = true&lt;br /&gt;
							break&lt;br /&gt;
						end&lt;br /&gt;
					if found then break end&lt;br /&gt;
					end -- loop through fallback table&lt;br /&gt;
				end -- loop through values of P5061&lt;br /&gt;
				if found then usep, unit = &amp;quot;&amp;amp;nbsp;&amp;quot;, usym end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		-- format display:&lt;br /&gt;
		if conv and usym ~= &amp;quot;&amp;quot; then&lt;br /&gt;
			if range == &amp;quot;&amp;quot; then&lt;br /&gt;
				val = mw.getCurrentFrame():expandTemplate{title = &amp;quot;cvt&amp;quot;, args = {amount, usym}}&lt;br /&gt;
			else&lt;br /&gt;
				val = mw.getCurrentFrame():expandTemplate{title = &amp;quot;cvt&amp;quot;, args = {lowb, &amp;quot;to&amp;quot;, upb, usym}}&lt;br /&gt;
			end&lt;br /&gt;
		elseif unit == &amp;quot;$&amp;quot; or unit == &amp;quot;£&amp;quot; then&lt;br /&gt;
			val = unit .. amount .. range .. i18n.multipliers[scale]&lt;br /&gt;
		else&lt;br /&gt;
			val = amount .. range .. i18n.multipliers[scale] .. usep .. unit&lt;br /&gt;
		end&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	-- datatypes which are global coordinates:&lt;br /&gt;
	elseif dtype == &amp;quot;globe-coordinate&amp;quot; then&lt;br /&gt;
		-- 'display' parameter defaults to &amp;quot;inline, title&amp;quot; *** unused for now ***&lt;br /&gt;
		-- local disp = args.display or &amp;quot;&amp;quot;&lt;br /&gt;
		-- if disp == &amp;quot;&amp;quot; then disp = &amp;quot;inline, title&amp;quot; end&lt;br /&gt;
		--&lt;br /&gt;
		-- format parameter switches from deg/min/sec to decimal degrees&lt;br /&gt;
		-- default is deg/min/sec -- decimal degrees needs |format = dec&lt;br /&gt;
		local form = (args.format or &amp;quot;&amp;quot;):lower():sub(1,3)&lt;br /&gt;
		if form ~= &amp;quot;dec&amp;quot; then form = &amp;quot;dms&amp;quot; end&lt;br /&gt;
		--&lt;br /&gt;
		-- show parameter allows just the latitude or longitude to be shown&lt;br /&gt;
		local show = (args.show or &amp;quot;&amp;quot;):lower()&lt;br /&gt;
		if show ~= &amp;quot;longlat&amp;quot; then show = show:sub(1,3) end&lt;br /&gt;
		--&lt;br /&gt;
		local lat, long, prec = dv.latitude, dv.longitude, dv.precision&lt;br /&gt;
		if show == &amp;quot;lat&amp;quot; then&lt;br /&gt;
			val = decimalPrecision(lat, prec)&lt;br /&gt;
		elseif show == &amp;quot;lon&amp;quot; then&lt;br /&gt;
			val = decimalPrecision(long, prec)&lt;br /&gt;
		elseif show == &amp;quot;longlat&amp;quot; then&lt;br /&gt;
			val = decimalPrecision(long, prec) .. &amp;quot;, &amp;quot; .. decimalPrecision(lat, prec)&lt;br /&gt;
		else&lt;br /&gt;
			local ns = &amp;quot;N&amp;quot;&lt;br /&gt;
			local ew = &amp;quot;E&amp;quot;&lt;br /&gt;
			if lat &amp;lt; 0 then&lt;br /&gt;
				ns = &amp;quot;S&amp;quot;&lt;br /&gt;
				lat = - lat&lt;br /&gt;
			end&lt;br /&gt;
			if long &amp;lt; 0 then&lt;br /&gt;
				ew = &amp;quot;W&amp;quot;&lt;br /&gt;
				long = - long&lt;br /&gt;
			end&lt;br /&gt;
			if form == &amp;quot;dec&amp;quot; then&lt;br /&gt;
				lat = decimalPrecision(lat, prec)&lt;br /&gt;
				long = decimalPrecision(long, prec)&lt;br /&gt;
				val = lat .. &amp;quot;°&amp;quot; .. ns .. &amp;quot; &amp;quot; .. long ..  &amp;quot;°&amp;quot; .. ew&lt;br /&gt;
			else&lt;br /&gt;
				local latdeg, latmin, latsec = decimalToDMS(lat, prec)&lt;br /&gt;
				local longdeg, longmin, longsec = decimalToDMS(long, prec)&lt;br /&gt;
&lt;br /&gt;
				if latsec == 0 and longsec == 0 then&lt;br /&gt;
					if latmin == 0 and longmin == 0 then&lt;br /&gt;
						val = latdeg .. &amp;quot;°&amp;quot; .. ns .. &amp;quot; &amp;quot; .. longdeg ..  &amp;quot;°&amp;quot; .. ew&lt;br /&gt;
					else&lt;br /&gt;
						val = latdeg .. &amp;quot;°&amp;quot; .. latmin .. &amp;quot;′&amp;quot; .. ns .. &amp;quot; &amp;quot;&lt;br /&gt;
						val = val .. longdeg .. &amp;quot;°&amp;quot;.. longmin .. &amp;quot;′&amp;quot; .. ew&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					val = latdeg .. &amp;quot;°&amp;quot; .. latmin .. &amp;quot;′&amp;quot; .. latsec .. &amp;quot;″&amp;quot; .. ns .. &amp;quot; &amp;quot;&lt;br /&gt;
					val = val .. longdeg .. &amp;quot;°&amp;quot; .. longmin .. &amp;quot;′&amp;quot; .. longsec .. &amp;quot;″&amp;quot; .. ew&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	elseif dtype == &amp;quot;monolingualtext&amp;quot; then -- data type is Monolingual text:&lt;br /&gt;
		-- has mainsnak.datavalue.value as a table containing language/text pairs&lt;br /&gt;
		-- collect all the values in 'out' and languages in 'mlt' and process them later&lt;br /&gt;
		val = pre .. dv.text .. post&lt;br /&gt;
		mlt = dv.language&lt;br /&gt;
		------------------------------------&lt;br /&gt;
	else&lt;br /&gt;
		-- some other data type so write a specific handler&lt;br /&gt;
		val = &amp;quot;unknown data type: &amp;quot; .. dtype&lt;br /&gt;
	end -- of datatype/unknown value/sourced check&lt;br /&gt;
	return val, mlt&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- propertyvalueandquals takes a property object, the arguments passed from frame,&lt;br /&gt;
-- and a qualifier propertyID.&lt;br /&gt;
-- It returns a sequence (table) of values representing the values of that property&lt;br /&gt;
-- and qualifiers that match the qualifierID if supplied.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam(); sourced(); labelOrId(); i18n.latestdatequalifier(); format_Date();&lt;br /&gt;
-- makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS(); assembleoutput();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local function propertyvalueandquals(objproperty, args, qualID)&lt;br /&gt;
	-- needs this style of declaration because it's re-entrant&lt;br /&gt;
&lt;br /&gt;
	-- onlysourced is a boolean passed to return only values sourced to other than Wikipedia&lt;br /&gt;
	-- if nothing or an empty string is passed set it true&lt;br /&gt;
	local onlysrc = parseParam(args.onlysourced or args.osd, true)&lt;br /&gt;
&lt;br /&gt;
	-- linked is a a boolean that enables the link to a local page via sitelink&lt;br /&gt;
	-- if nothing or an empty string is passed set it true&lt;br /&gt;
	local linked = parseParam(args.linked, true)&lt;br /&gt;
&lt;br /&gt;
	-- prefix is a string that may be nil, empty (&amp;quot;&amp;quot;), or a string of characters&lt;br /&gt;
	-- this is prefixed to each value&lt;br /&gt;
	-- useful when when multiple values are returned&lt;br /&gt;
	-- any double-quotes &amp;quot; are stripped out, so that spaces may be passed&lt;br /&gt;
	local prefix = (args.prefix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
&lt;br /&gt;
	-- postfix is a string that may be nil, empty (&amp;quot;&amp;quot;), or a string of characters&lt;br /&gt;
	-- this is postfixed to each value&lt;br /&gt;
	-- useful when when multiple values are returned&lt;br /&gt;
	-- any double-quotes &amp;quot; are stripped out, so that spaces may be passed&lt;br /&gt;
	local postfix = (args.postfix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
&lt;br /&gt;
	-- linkprefix is a string that may be nil, empty (&amp;quot;&amp;quot;), or a string of characters&lt;br /&gt;
	-- this creates a link and is then prefixed to each value&lt;br /&gt;
	-- useful when when multiple values are returned and indirect links are needed&lt;br /&gt;
	-- any double-quotes &amp;quot; are stripped out, so that spaces may be passed&lt;br /&gt;
	local lprefix = (args.linkprefix or args.lp or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
&lt;br /&gt;
	-- linkpostfix is a string that may be nil, empty (&amp;quot;&amp;quot;), or a string of characters&lt;br /&gt;
	-- this is postfixed to each value when linking is enabled with lprefix&lt;br /&gt;
	-- useful when when multiple values are returned&lt;br /&gt;
	-- any double-quotes &amp;quot; are stripped out, so that spaces may be passed&lt;br /&gt;
	local lpostfix = (args.linkpostfix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
&lt;br /&gt;
	-- wdlinks is a boolean passed to enable links to Wikidata when no article exists&lt;br /&gt;
	-- if nothing or an empty string is passed set it false&lt;br /&gt;
	local wdl = parseParam(args.wdlinks or args.wdl, false)&lt;br /&gt;
&lt;br /&gt;
	-- unitabbr is a boolean passed to enable unit abbreviations for common units&lt;br /&gt;
	-- if nothing or an empty string is passed set it false&lt;br /&gt;
	local uabbr = parseParam(args.unitabbr or args.uabbr, false)&lt;br /&gt;
&lt;br /&gt;
	-- qualsonly is a boolean passed to return just the qualifiers&lt;br /&gt;
	-- if nothing or an empty string is passed set it false&lt;br /&gt;
	local qualsonly = parseParam(args.qualsonly or args.qo, false)&lt;br /&gt;
&lt;br /&gt;
	-- maxvals is a string that may be nil, empty (&amp;quot;&amp;quot;), or a number&lt;br /&gt;
	-- this determines how many items may be returned when multiple values are available&lt;br /&gt;
	-- setting it = 1 is useful where the returned string is used within another call, e.g. image&lt;br /&gt;
	local maxvals = tonumber(args.maxvals) or 0&lt;br /&gt;
&lt;br /&gt;
	-- pd (plain date) is a string: yes/true/1 | no/false/0 | adj&lt;br /&gt;
	-- to disable/enable &amp;quot;sourcing cirumstances&amp;quot; or use adjectival form for the plain date&lt;br /&gt;
	local pd = args.plaindate or args.pd or &amp;quot;no&amp;quot;&lt;br /&gt;
	args.pd = pd&lt;br /&gt;
&lt;br /&gt;
	local lang = args.lang or findlang().code&lt;br /&gt;
	-- all proper values of a Wikidata property will be the same type as the first&lt;br /&gt;
	-- qualifiers don't have a mainsnak, properties do&lt;br /&gt;
	local datatype = objproperty[1].datatype or objproperty[1].mainsnak.datatype&lt;br /&gt;
	-- out holds the values for this property&lt;br /&gt;
	-- mlt holds the language code if the datatype is monolingual text&lt;br /&gt;
	local out = {}&lt;br /&gt;
	local mlt = {}&lt;br /&gt;
	for k, v in ipairs(objproperty) do&lt;br /&gt;
		local hasvalue = true&lt;br /&gt;
		if (onlysrc and not sourced(v)) then&lt;br /&gt;
			-- no value: it isn't sourced when onlysourced=true&lt;br /&gt;
			hasvalue = false&lt;br /&gt;
		elseif qualsonly and qualID then&lt;br /&gt;
			-- suppress sourced value: only qualifiers are requested&lt;br /&gt;
		else&lt;br /&gt;
			out[#out+1], mlt[#out+1] = rendersnak(v, args, linked, lprefix, lpostfix, prefix, postfix, uabbr)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- See if qualifiers are to be returned:&lt;br /&gt;
		local snak = v.mainsnak or v&lt;br /&gt;
		if hasvalue and v.qualifiers and qualID and snak.snaktype==&amp;quot;value&amp;quot; then&lt;br /&gt;
			local qsep = (args.qsep or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
			local qargs = {&lt;br /&gt;
				[&amp;quot;osd&amp;quot;]         = &amp;quot;false&amp;quot;,&lt;br /&gt;
				[&amp;quot;linked&amp;quot;]      = tostring(linked),&lt;br /&gt;
				[&amp;quot;prefix&amp;quot;]      = args.qprefix,&lt;br /&gt;
				[&amp;quot;postfix&amp;quot;]     = args.qpostfix,&lt;br /&gt;
				[&amp;quot;linkprefix&amp;quot;]  = args.qlinkprefix or args.qlp,&lt;br /&gt;
				[&amp;quot;linkpostfix&amp;quot;] = args.qlinkpostfix,&lt;br /&gt;
				[&amp;quot;wdl&amp;quot;]         = &amp;quot;false&amp;quot;,&lt;br /&gt;
				[&amp;quot;unitabbr&amp;quot;]    = tostring(uabbr),&lt;br /&gt;
				[&amp;quot;maxvals&amp;quot;]     = 0,&lt;br /&gt;
				[&amp;quot;sorted&amp;quot;]      = args.qsorted,&lt;br /&gt;
				[&amp;quot;noicon&amp;quot;]      = &amp;quot;true&amp;quot;,&lt;br /&gt;
				[&amp;quot;list&amp;quot;]        = args.qlist,&lt;br /&gt;
				[&amp;quot;sep&amp;quot;]         = qsep,&lt;br /&gt;
				[&amp;quot;langobj&amp;quot;]     = args.langobj,&lt;br /&gt;
				[&amp;quot;lang&amp;quot;]        = args.langobj.code,&lt;br /&gt;
			}&lt;br /&gt;
			local qlist = {}&lt;br /&gt;
			local t1, t2 = &amp;quot;&amp;quot;, &amp;quot;&amp;quot;&lt;br /&gt;
			-- see if we want all qualifiers&lt;br /&gt;
			if qualID == &amp;quot;ALL&amp;quot; then&lt;br /&gt;
				if v[&amp;quot;qualifiers-order&amp;quot;] then&lt;br /&gt;
					-- the values in the order table are the keys for the qualifiers table:&lt;br /&gt;
					for k1, v1 in ipairs(v[&amp;quot;qualifiers-order&amp;quot;]) do&lt;br /&gt;
						if v1 == &amp;quot;P1326&amp;quot; then&lt;br /&gt;
							local ts = v.qualifiers[v1][1].datavalue.value.time&lt;br /&gt;
							local dp = v.qualifiers[v1][1].datavalue.value.precision&lt;br /&gt;
							qlist[#qlist + 1] = dateFormat(ts, dp, args.df, args.bc, pd, &amp;quot;&amp;quot;, lang, &amp;quot;before&amp;quot;)&lt;br /&gt;
						elseif v1 == &amp;quot;P1319&amp;quot; then&lt;br /&gt;
							local ts = v.qualifiers[v1][1].datavalue.value.time&lt;br /&gt;
							local dp = v.qualifiers[v1][1].datavalue.value.precision&lt;br /&gt;
							qlist[#qlist + 1] = dateFormat(ts, dp, args.df, args.bc, pd, &amp;quot;&amp;quot;, lang, &amp;quot;after&amp;quot;)&lt;br /&gt;
						else&lt;br /&gt;
							local q = assembleoutput(propertyvalueandquals(v.qualifiers[v1], qargs), qargs)&lt;br /&gt;
							-- we already deal with circa via 'sourcing circumstances'&lt;br /&gt;
							-- either linked or unlinked *** internationalise later ***&lt;br /&gt;
							if q ~= &amp;quot;circa&amp;quot; and not q:find(&amp;quot;circa]]&amp;quot;) then&lt;br /&gt;
								qlist[#qlist + 1] = q&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					-- are there cases where qualifiers-order doesn't exist?&lt;br /&gt;
					local ql = propertyvalueandquals(v.qualifiers, qargs)&lt;br /&gt;
					for k1, v1 in ipairs(ql) do&lt;br /&gt;
						-- we already deal with circa via 'sourcing circumstances'&lt;br /&gt;
						-- either linked or unlinked *** internationalise later ***&lt;br /&gt;
						if v1 ~= &amp;quot;circa&amp;quot; and not v1:find(&amp;quot;circa]]&amp;quot;) then&lt;br /&gt;
							qlist[#qlist + 1] = v1&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			-- see if we want date/range&lt;br /&gt;
			elseif qualID == &amp;quot;DATES&amp;quot; then&lt;br /&gt;
				qargs.maxvals = 1&lt;br /&gt;
				for k1, v1 in pairs(v.qualifiers) do&lt;br /&gt;
					if k1 == &amp;quot;P580&amp;quot; then -- P580 is &amp;quot;start time&amp;quot;&lt;br /&gt;
						t1 = propertyvalueandquals(v1, qargs)[1] or &amp;quot;&amp;quot;&lt;br /&gt;
					elseif k1 == &amp;quot;P582&amp;quot; then -- P582 is &amp;quot;end time&amp;quot;&lt;br /&gt;
						t2 = propertyvalueandquals(v1, qargs)[1] or &amp;quot;&amp;quot;&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
			-- otherwise process qualID as a list of qualifiers&lt;br /&gt;
			else&lt;br /&gt;
				for q in mw.text.gsplit(qualID, &amp;quot;%p&amp;quot;) do -- split at punctuation and iterate&lt;br /&gt;
					q = mw.text.trim(q):upper() -- remove whitespace and capitalise&lt;br /&gt;
					if q == &amp;quot;P1326&amp;quot; then&lt;br /&gt;
						-- latest date, so supply 'before' as well. Assume one date value.&lt;br /&gt;
						for k1, v1 in pairs(v.qualifiers) do&lt;br /&gt;
							if k1 == &amp;quot;P1326&amp;quot; then&lt;br /&gt;
								local ts = v1[1].datavalue.value.time&lt;br /&gt;
								local dp = v1[1].datavalue.value.precision&lt;br /&gt;
								qlist[#qlist + 1] = dateFormat(ts, dp, args.df, args.bc, pd, &amp;quot;&amp;quot;, lang, &amp;quot;before&amp;quot;)&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					else&lt;br /&gt;
						for k1, v1 in pairs(v.qualifiers) do&lt;br /&gt;
							if k1 == q then&lt;br /&gt;
								local ql = propertyvalueandquals(v1, qargs)&lt;br /&gt;
								for k2, v2 in ipairs(ql) do&lt;br /&gt;
									qlist[#qlist + 1] = v2&lt;br /&gt;
								end&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end -- of loop through list of qualifiers in qualID&lt;br /&gt;
			end -- of testing for what qualID is&lt;br /&gt;
			local t = t1 .. t2&lt;br /&gt;
			-- *** internationalise date separators later ***&lt;br /&gt;
			local dsep = &amp;quot;&amp;amp;ndash;&amp;quot;&lt;br /&gt;
			if t:find(&amp;quot;%s&amp;quot;) or t:find(&amp;quot;&amp;amp;nbsp;&amp;quot;) then dsep = &amp;quot; &amp;amp;ndash; &amp;quot; end&lt;br /&gt;
			if #qlist &amp;gt; 0 then&lt;br /&gt;
				local qstr = assembleoutput(qlist, qargs)&lt;br /&gt;
				if qualsonly then&lt;br /&gt;
					out[#out+1] = qstr&lt;br /&gt;
				else&lt;br /&gt;
					out[#out] = out[#out] .. &amp;quot; (&amp;quot; .. qstr .. &amp;quot;)&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
			elseif t &amp;gt; &amp;quot;&amp;quot; then&lt;br /&gt;
				if qualsonly then&lt;br /&gt;
					out[#out+1] = t1 .. dsep .. t2&lt;br /&gt;
				else&lt;br /&gt;
					out[#out] = out[#out] .. &amp;quot; (&amp;quot; .. t1 .. dsep .. t2 .. &amp;quot;)&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end -- of test for qualifiers wanted&lt;br /&gt;
&lt;br /&gt;
		if maxvals &amp;gt; 0 and #out &amp;gt;= maxvals then break end&lt;br /&gt;
	end -- of for each value loop&lt;br /&gt;
&lt;br /&gt;
	-- we need to pick one value to return if the datatype was &amp;quot;monolingualtext&amp;quot;&lt;br /&gt;
	-- if there's only one value, use that&lt;br /&gt;
	-- otherwise look through the fallback languages for a match&lt;br /&gt;
	if datatype == &amp;quot;monolingualtext&amp;quot; and #out &amp;gt;1 then&lt;br /&gt;
		local langcode = args.langobj.code&lt;br /&gt;
		langcode = mw.text.split( langcode, '-', true )[1]&lt;br /&gt;
		local fbtbl = mw.language.getFallbacksFor( langcode )&lt;br /&gt;
		table.insert( fbtbl, 1, langcode )&lt;br /&gt;
		local bestval = &amp;quot;&amp;quot;&lt;br /&gt;
		local found = false&lt;br /&gt;
		for idx1, lang1 in ipairs(fbtbl) do&lt;br /&gt;
			for idx2, lang2 in ipairs(mlt) do&lt;br /&gt;
				if (lang1 == lang2) and not found then&lt;br /&gt;
					bestval = out[idx2]&lt;br /&gt;
					found = true&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end -- loop through values of property&lt;br /&gt;
		end -- loop through fallback languages&lt;br /&gt;
		if found then&lt;br /&gt;
			-- replace output table with a table containing the best value&lt;br /&gt;
			out = { bestval }&lt;br /&gt;
		else&lt;br /&gt;
			-- more than one value and none of them on the list of fallback languages&lt;br /&gt;
			-- sod it, just give them the first one&lt;br /&gt;
			out = { out[1] }&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Common code for p.getValueByQual and p.getValueByLang&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam; setRanks; parseInput; sourced; assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local _getvaluebyqual = function(frame, qualID, checkvalue)&lt;br /&gt;
&lt;br /&gt;
	-- The property ID that will have a qualifier is the first unnamed parameter&lt;br /&gt;
	local propertyID = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	if propertyID == &amp;quot;&amp;quot; then return &amp;quot;no property supplied&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	if qualID == &amp;quot;&amp;quot; then return &amp;quot;no qualifier supplied&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	-- onlysourced is a boolean passed to return property values&lt;br /&gt;
	-- only when property values are sourced to something other than Wikipedia&lt;br /&gt;
	-- if nothing or an empty string is passed set it true&lt;br /&gt;
	-- if &amp;quot;false&amp;quot; or &amp;quot;no&amp;quot; or 0 is passed set it false&lt;br /&gt;
	local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)&lt;br /&gt;
&lt;br /&gt;
	-- set the requested ranks flags&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
&lt;br /&gt;
	-- set a language object and code in the frame.args table&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
&lt;br /&gt;
	-- check for locally supplied parameter in second unnamed parameter&lt;br /&gt;
	-- success means no local parameter and the property exists&lt;br /&gt;
	local qid, props = parseInput(frame, args[2], propertyID)&lt;br /&gt;
&lt;br /&gt;
	local linked = parseParam(args.linked, true)&lt;br /&gt;
	local lpre = (args.linkprefix or args.lp or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	local lpost = (args.linkpostfix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	local pre = (args.prefix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	local post = (args.postfix or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	local uabbr = parseParam(args.unitabbr or args.uabbr, false)&lt;br /&gt;
	local filter = (args.unit or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if filter == &amp;quot;&amp;quot; then filter = nil end&lt;br /&gt;
&lt;br /&gt;
	if qid then&lt;br /&gt;
		local out = {}&lt;br /&gt;
		-- Scan through the values of the property&lt;br /&gt;
		-- we want something like property is &amp;quot;pronunciation audio (P443)&amp;quot; in propertyID&lt;br /&gt;
		-- with a qualifier like &amp;quot;language of work or name (P407)&amp;quot; in qualID&lt;br /&gt;
		-- whose value has the required ID, like &amp;quot;British English (Q7979)&amp;quot;, in qval&lt;br /&gt;
		for k1, v1 in ipairs(props) do&lt;br /&gt;
			if v1.mainsnak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
				-- check if it has the right qualifier&lt;br /&gt;
				local v1q = v1.qualifiers&lt;br /&gt;
				if v1q and v1q[qualID] then&lt;br /&gt;
					if onlysrc == false or sourced(v1) then&lt;br /&gt;
						-- if we've got this far, we have a (sourced) claim with qualifiers&lt;br /&gt;
						-- so see if matches the required value&lt;br /&gt;
						-- We'll only deal with wikibase-items for now&lt;br /&gt;
						if v1q[qualID][1].datatype == &amp;quot;wikibase-item&amp;quot; then&lt;br /&gt;
							if checkvalue(v1q[qualID][1].datavalue.value.id) then&lt;br /&gt;
								out[#out + 1] = rendersnak(v1, args, linked, lpre, lpost, pre, post, uabbr, filter)&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end -- of check for sourced&lt;br /&gt;
				end -- of check for matching required value and has qualifiers&lt;br /&gt;
			else&lt;br /&gt;
				return nil&lt;br /&gt;
			end -- of check for string&lt;br /&gt;
		end -- of loop through values of propertyID&lt;br /&gt;
		return assembleoutput(out, frame.args, qid, propertyID)&lt;br /&gt;
	else&lt;br /&gt;
		return props -- either local parameter or nothing&lt;br /&gt;
	end -- of test for success&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- _location takes Q-id and follows P276 (location)&lt;br /&gt;
-- or P131 (located in the administrative territorial entity) or P706 (located on terrain feature)&lt;br /&gt;
-- from the initial item to higher level territories/locations until it reaches the highest.&lt;br /&gt;
-- An optional boolean, 'first', determines whether the first item is returned (default: false).&lt;br /&gt;
-- An optional boolean 'skip' toggles the display to skip to the last item (default: false).&lt;br /&gt;
-- It returns a table containing the locations - linked where possible, except for the highest.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang(); labelOrId(); linkedItem&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local _location = function(qid, first, skip)&lt;br /&gt;
	first = parseParam(first, false)&lt;br /&gt;
	skip = parseParam(skip, false)&lt;br /&gt;
	local locs = {&amp;quot;P276&amp;quot;, &amp;quot;P131&amp;quot;, &amp;quot;P706&amp;quot;}&lt;br /&gt;
	local out = {}&lt;br /&gt;
	local langcode = findLang():getCode()&lt;br /&gt;
	local finished = false&lt;br /&gt;
	local count = 0&lt;br /&gt;
	local prevqid = &amp;quot;&amp;quot;&lt;br /&gt;
	repeat&lt;br /&gt;
		local prop&lt;br /&gt;
		for i1, v1 in ipairs(locs) do&lt;br /&gt;
			local proptbl = mw.wikibase.getBestStatements(qid, v1)&lt;br /&gt;
			if #proptbl &amp;gt; 1 then&lt;br /&gt;
				-- there is more than one parent location&lt;br /&gt;
				for i2, v2 in ipairs(proptbl) do&lt;br /&gt;
					parttbl = v2.qualifiers and v2.qualifiers.P518&lt;br /&gt;
					if parttbl then&lt;br /&gt;
						-- this parent location has qualifier 'applies to part' (P518)&lt;br /&gt;
						for i3, v3 in ipairs(parttbl) do&lt;br /&gt;
							if v3.snaktype == &amp;quot;value&amp;quot; and v3.datavalue.value.id == prevqid then&lt;br /&gt;
								-- it has a value equal to the previous location&lt;br /&gt;
								prop = proptbl[i2]&lt;br /&gt;
								break&lt;br /&gt;
							end -- of test for matching last location&lt;br /&gt;
						end -- of loop through values of 'applies to part'&lt;br /&gt;
					end&lt;br /&gt;
				end -- of loop through parent locations&lt;br /&gt;
				-- fallback to second value if match not found&lt;br /&gt;
				prop = prop or proptbl[2]&lt;br /&gt;
			elseif #proptbl &amp;gt; 0 then&lt;br /&gt;
				prop = proptbl[1]&lt;br /&gt;
			end&lt;br /&gt;
			if prop then break end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- check if it's an instance of (P31) a country (Q6256) and terminate the chain if it is&lt;br /&gt;
		local inst = mw.wikibase.getAllStatements(qid, &amp;quot;P31&amp;quot;)&lt;br /&gt;
		if #inst &amp;gt; 0 then&lt;br /&gt;
			for k, v in ipairs(inst) do&lt;br /&gt;
				local instid = v.mainsnak.datavalue.value.id&lt;br /&gt;
				-- stop if it's a country (or a country within the United Kingdom if skip is true)&lt;br /&gt;
				if instid == &amp;quot;Q6256&amp;quot; or (skip and instid == &amp;quot;Q3336843&amp;quot;) then&lt;br /&gt;
					prop = nil -- this will ensure this is treated as top-level location&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- get the name of this location and update qid to point to the parent location&lt;br /&gt;
		if prop and prop.mainsnak.datavalue then&lt;br /&gt;
			if not skip or count == 0 then&lt;br /&gt;
				out[#out+1] = linkedItem(qid, &amp;quot;:&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;) -- get a linked value if we can&lt;br /&gt;
			end&lt;br /&gt;
			qid, prevqid = prop.mainsnak.datavalue.value.id, qid&lt;br /&gt;
		else&lt;br /&gt;
			-- This is top-level location, so get short name except when this is the first item&lt;br /&gt;
			-- Use full label if there's no short name or this is the first item&lt;br /&gt;
			local prop1813 = mw.wikibase.getAllStatements(qid, &amp;quot;P1813&amp;quot;)&lt;br /&gt;
			-- if there's a short name and this isn't the only item&lt;br /&gt;
			if prop1813[1] and (#out &amp;gt; 0)then&lt;br /&gt;
				local shortname&lt;br /&gt;
				-- short name is monolingual text, so look for match to the local language&lt;br /&gt;
				-- choose the shortest 'short name' in that language&lt;br /&gt;
				for k, v in pairs(prop1813) do&lt;br /&gt;
					if v.mainsnak.datavalue.value.language == langcode then&lt;br /&gt;
						local name = v.mainsnak.datavalue.value.text&lt;br /&gt;
						if (not shortname) or (#name &amp;lt; #shortname) then&lt;br /&gt;
							shortname = name&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
				-- add the shortname if one is found, fallback to the label&lt;br /&gt;
				-- but skip it if it's &amp;quot;USA&amp;quot;&lt;br /&gt;
				if shortname ~= &amp;quot;USA&amp;quot; then&lt;br /&gt;
					out[#out+1] = shortname or labelOrId(qid)&lt;br /&gt;
				else&lt;br /&gt;
					if skip then out[#out+1] = &amp;quot;US&amp;quot; end&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				-- no shortname, so just add the label&lt;br /&gt;
				local loc = labelOrId(qid)&lt;br /&gt;
				-- exceptions go here:&lt;br /&gt;
				if loc == &amp;quot;United States of America&amp;quot; then&lt;br /&gt;
					out[#out+1] = &amp;quot;United States&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					out[#out+1] = loc&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			finished = true&lt;br /&gt;
		end&lt;br /&gt;
		count = count + 1&lt;br /&gt;
	until finished or count &amp;gt;= 10 -- limit to 10 levels to avoid infinite loops&lt;br /&gt;
&lt;br /&gt;
	-- remove the first location if not quired&lt;br /&gt;
	if not first then table.remove(out, 1) end&lt;br /&gt;
&lt;br /&gt;
	-- we might have duplicate text for consecutive locations, so remove them&lt;br /&gt;
	if #out &amp;gt; 2 then&lt;br /&gt;
		local plain = {}&lt;br /&gt;
		for i, v in ipairs(out) do&lt;br /&gt;
			-- strip any links&lt;br /&gt;
			plain[i] = v:gsub(&amp;quot;^%[%[[^|]*|&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;]]$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
		end&lt;br /&gt;
		local idx = 2&lt;br /&gt;
		repeat&lt;br /&gt;
			if plain[idx] == plain[idx-1] then&lt;br /&gt;
				-- duplicate found&lt;br /&gt;
				local removeidx = 0&lt;br /&gt;
				if (plain[idx] ~= out[idx]) and (plain[idx-1] == out[idx-1]) then&lt;br /&gt;
					-- only second one is linked, so drop the first&lt;br /&gt;
					removeidx = idx - 1&lt;br /&gt;
				elseif (plain[idx] == out[idx]) and (plain[idx-1] ~= out[idx-1]) then&lt;br /&gt;
					-- only first one is linked, so drop the second&lt;br /&gt;
					removeidx = idx&lt;br /&gt;
				else&lt;br /&gt;
					-- pick one&lt;br /&gt;
					removeidx = idx - (os.time()%2)&lt;br /&gt;
				end&lt;br /&gt;
				table.remove(out, removeidx)&lt;br /&gt;
				table.remove(plain, removeidx)&lt;br /&gt;
			else&lt;br /&gt;
				idx = idx +1&lt;br /&gt;
			end&lt;br /&gt;
		until idx &amp;gt;= #out&lt;br /&gt;
	end&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- _getsumofparts scans the property 'has part' (P527) for values matching a list.&lt;br /&gt;
-- The list (args.vlist) consists of a string of Qids separated by spaces or any usual punctuation.&lt;br /&gt;
-- If the matched values have a qualifer 'quantity' (P1114), those quantites are summed.&lt;br /&gt;
-- The sum is returned as a number (i.e. 0 if none)&lt;br /&gt;
-- a table of arguments is supplied implementing the usual parameters.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: setRanks; parseParam; parseInput; sourced; assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
local _getsumofparts = function(args)&lt;br /&gt;
	local vallist = (args.vlist or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if vallist == &amp;quot;&amp;quot; then return end&lt;br /&gt;
	args.reqranks = setRanks(args.rank)&lt;br /&gt;
	local f = {}&lt;br /&gt;
	f.args = args&lt;br /&gt;
	local qid, props = parseInput(f, &amp;quot;&amp;quot;, &amp;quot;P527&amp;quot;)&lt;br /&gt;
	if not qid then return 0 end&lt;br /&gt;
	local onlysrc = parseParam(args.onlysourced or args.osd, true)&lt;br /&gt;
	local sum = 0&lt;br /&gt;
	for k1, v1 in ipairs(props) do&lt;br /&gt;
		if (onlysrc == false or sourced(v1))&lt;br /&gt;
			and v1.mainsnak.snaktype == &amp;quot;value&amp;quot;&lt;br /&gt;
			and v1.mainsnak.datavalue.type == &amp;quot;wikibase-entityid&amp;quot;&lt;br /&gt;
			and vallist:match( v1.mainsnak.datavalue.value.id )&lt;br /&gt;
			and v1.qualifiers&lt;br /&gt;
			then&lt;br /&gt;
			local quals = v1.qualifiers[&amp;quot;P1114&amp;quot;]&lt;br /&gt;
			if quals then&lt;br /&gt;
				for k2, v2 in ipairs(quals) do&lt;br /&gt;
					sum = sum + v2.datavalue.value.amount&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return sum&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Public functions&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getValue is used to get the value(s) of a property&lt;br /&gt;
-- The property ID is passed as the first unnamed parameter and is required.&lt;br /&gt;
-- A locally supplied parameter may optionaly be supplied as the second unnamed parameter.&lt;br /&gt;
-- The function will now also return qualifiers if parameter qual is supplied&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: setRanks; parseInput; propertyvalueandquals; assembleoutput; parseParam; sourced;&lt;br /&gt;
-- labelOrId; i18n.latestdatequalifier; format_Date; makeOrdinal; roundto; decimalPrecision; decimalToDMS;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getValue = function(frame)&lt;br /&gt;
	if not frame.args[1] then&lt;br /&gt;
		frame.args = frame:getParent().args&lt;br /&gt;
		if not frame.args[1] then return i18n.errors[&amp;quot;No property supplied&amp;quot;] end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- parameter sets for commonly used groups of parameters&lt;br /&gt;
	local paraset = tonumber(frame.args.ps or frame.args.parameterset or 0)&lt;br /&gt;
	if paraset == 1 then&lt;br /&gt;
		frame.args.rank = &amp;quot;best&amp;quot;&lt;br /&gt;
		frame.args.fetchwikidata = &amp;quot;ALL&amp;quot;&lt;br /&gt;
		frame.args.onlysourced = &amp;quot;no&amp;quot;&lt;br /&gt;
		frame.args.noicon = &amp;quot;true&amp;quot;&lt;br /&gt;
	elseif paraset == 2 then&lt;br /&gt;
		-- second set goes here&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local propertyID = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
&lt;br /&gt;
	local entityid, props = parseInput(frame, frame.args[2], propertyID)&lt;br /&gt;
&lt;br /&gt;
	if not entityid then&lt;br /&gt;
		return props -- either the input parameter or nothing&lt;br /&gt;
	end&lt;br /&gt;
	-- qual is a string containing the property ID of the qualifier(s) to be returned&lt;br /&gt;
	-- if qual == &amp;quot;ALL&amp;quot; then all qualifiers returned&lt;br /&gt;
	-- if qual == &amp;quot;DATES&amp;quot; then qualifiers P580 (start time) and P582 (end time) returned&lt;br /&gt;
	-- if nothing or an empty string is passed set it nil -&amp;gt; no qualifiers returned&lt;br /&gt;
	local qualID = mw.text.trim(frame.args.qual or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qualID == &amp;quot;&amp;quot; then qualID = nil end&lt;br /&gt;
&lt;br /&gt;
	-- set a language object and code in the frame.args table&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
&lt;br /&gt;
	-- table 'out' stores the return value(s):&lt;br /&gt;
	local out = propertyvalueandquals(props, frame.args, qualID)&lt;br /&gt;
&lt;br /&gt;
	-- format the table of values and return it as a string:&lt;br /&gt;
	return assembleoutput(out, frame.args, entityid, propertyID)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getPreferredValue is used to get a value,&lt;br /&gt;
-- (or a comma separated list of them if multiple values exist).&lt;br /&gt;
-- If preferred ranks are set, it will return those values, otherwise values with normal ranks&lt;br /&gt;
-- now redundant to getValue with |rank=best&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: p.getValue; setRanks; parseInput; propertyvalueandquals; assembleoutput;&lt;br /&gt;
-- parseParam; sourced; labelOrId; i18n.latestdatequalifier; format_Date;&lt;br /&gt;
-- makeOrdinal; roundto; decimalPrecision; decimalToDMS;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getPreferredValue = function(frame)&lt;br /&gt;
	frame.args.rank = &amp;quot;best&amp;quot;&lt;br /&gt;
	return p.getValue(frame)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getCoords is used to get coordinates for display in an infobox&lt;br /&gt;
-- whitelist and blacklist are implemented&lt;br /&gt;
-- optional 'display' parameter is allowed, defaults to &amp;quot;inline, title&amp;quot;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: setRanks(); parseInput(); decimalPrecision();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getCoords = function(frame)&lt;br /&gt;
	local propertyID = &amp;quot;P625&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	-- if there is a 'display' parameter supplied, use it&lt;br /&gt;
	-- otherwise default to &amp;quot;inline, title&amp;quot;&lt;br /&gt;
	local disp = frame.args.display or &amp;quot;&amp;quot;&lt;br /&gt;
	if disp == &amp;quot;&amp;quot; then&lt;br /&gt;
		disp = &amp;quot;inline, title&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- there may be a format parameter to switch from deg/min/sec to decimal degrees&lt;br /&gt;
	-- default is deg/min/sec&lt;br /&gt;
	-- decimal degrees needs |format = dec&lt;br /&gt;
	local form = (frame.args.format or &amp;quot;&amp;quot;):lower():sub(1,3)&lt;br /&gt;
	if form ~= &amp;quot;dec&amp;quot; then&lt;br /&gt;
		form = &amp;quot;dms&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- just deal with best values&lt;br /&gt;
	frame.args.reqranks = setRanks(&amp;quot;best&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	local qid, props = parseInput(frame, frame.args[1], propertyID)&lt;br /&gt;
	if not qid then&lt;br /&gt;
		return props -- either local parameter or nothing&lt;br /&gt;
	else&lt;br /&gt;
		local dv = props[1].mainsnak.datavalue.value&lt;br /&gt;
		local lat, long, prec = dv.latitude, dv.longitude, dv.precision&lt;br /&gt;
		lat = decimalPrecision(lat, prec)&lt;br /&gt;
		long = decimalPrecision(long, prec)&lt;br /&gt;
		local lat_long = { lat, long }&lt;br /&gt;
		lat_long[&amp;quot;display&amp;quot;] = disp&lt;br /&gt;
		lat_long[&amp;quot;format&amp;quot;] = form&lt;br /&gt;
		-- invoke template Coord with the values stored in the table&lt;br /&gt;
		return frame:expandTemplate{title = 'coord', args = lat_long}&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getQualifierValue is used to get a formatted value of a qualifier&lt;br /&gt;
--&lt;br /&gt;
-- The call needs:	a property (the unnamed parameter or 1=)&lt;br /&gt;
-- 					a target value for that property (pval=)&lt;br /&gt;
--					a qualifier for that target value (qual=)&lt;br /&gt;
-- The usual whitelisting and blacklisting of the property is implemented&lt;br /&gt;
-- The boolean onlysourced= parameter can be set to return nothing&lt;br /&gt;
-- when the property is unsourced (or only sourced to Wikipedia)&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam(); setRanks(); parseInput(); sourced();&lt;br /&gt;
-- propertyvalueandquals(); assembleoutput();&lt;br /&gt;
-- labelOrId(); i18n.latestdatequalifier(); format_Date();&lt;br /&gt;
-- findLang(); makeOrdinal(); roundto(); decimalPrecision(); decimalToDMS();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getQualifierValue = function(frame)&lt;br /&gt;
&lt;br /&gt;
	-- The property ID that will have a qualifier is the first unnamed parameter&lt;br /&gt;
	local propertyID = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
	-- The value of the property we want to match whose qualifier value is to be returned&lt;br /&gt;
	-- is passed in named parameter |pval=&lt;br /&gt;
	local propvalue = frame.args.pval&lt;br /&gt;
&lt;br /&gt;
	-- The property ID of the qualifier&lt;br /&gt;
	-- whose value is to be returned is passed in named parameter |qual=&lt;br /&gt;
	local qualifierID = frame.args.qual&lt;br /&gt;
&lt;br /&gt;
	-- onlysourced is a boolean passed to return qualifiers&lt;br /&gt;
	-- only when property values are sourced to something other than Wikipedia&lt;br /&gt;
	-- if nothing or an empty string is passed set it true&lt;br /&gt;
	-- if &amp;quot;false&amp;quot; or &amp;quot;no&amp;quot; or 0 is passed set it false&lt;br /&gt;
	local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)&lt;br /&gt;
&lt;br /&gt;
	-- set a language object and language code in the frame.args table&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
&lt;br /&gt;
	-- set the requested ranks flags&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
&lt;br /&gt;
	-- check for locally supplied parameter in second unnamed parameter&lt;br /&gt;
	-- success means no local parameter and the property exists&lt;br /&gt;
	local qid, props = parseInput(frame, frame.args[2], propertyID)&lt;br /&gt;
	if qid then&lt;br /&gt;
		local out = {}&lt;br /&gt;
		-- Scan through the values of the property&lt;br /&gt;
		-- we want something like property is P793, significant event (in propertyID)&lt;br /&gt;
		-- whose value is something like Q385378, construction (in propvalue)&lt;br /&gt;
		-- then we can return the value(s) of a qualifier such as P580, start time (in qualifierID)&lt;br /&gt;
		for k1, v1 in pairs(props) do&lt;br /&gt;
			if v1.mainsnak.snaktype == &amp;quot;value&amp;quot; and v1.mainsnak.datavalue.type == &amp;quot;wikibase-entityid&amp;quot; then&lt;br /&gt;
				-- It's a wiki-linked value, so check if it's the target (in propvalue)&lt;br /&gt;
				-- and if it has qualifiers&lt;br /&gt;
				if v1.mainsnak.datavalue.value.id == propvalue and v1.qualifiers then&lt;br /&gt;
					if onlysrc == false or sourced(v1) then&lt;br /&gt;
						-- if we've got this far, we have a (sourced) claim with qualifiers&lt;br /&gt;
						-- which matches the target, so find the value(s) of the qualifier we want&lt;br /&gt;
						local quals = v1.qualifiers[qualifierID]&lt;br /&gt;
						if quals then&lt;br /&gt;
							-- can't reference qualifer, so set onlysourced = &amp;quot;no&amp;quot; (not boolean)&lt;br /&gt;
							local qargs = frame.args&lt;br /&gt;
							qargs.onlysourced = &amp;quot;no&amp;quot;&lt;br /&gt;
							local vals = propertyvalueandquals(quals, qargs, qid)&lt;br /&gt;
							for k, v in ipairs(vals) do&lt;br /&gt;
								out[#out + 1] = v&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end -- of check for sourced&lt;br /&gt;
				end -- of check for matching required value and has qualifiers&lt;br /&gt;
			end -- of check for wikibase entity&lt;br /&gt;
		end -- of loop through values of propertyID&lt;br /&gt;
		return assembleoutput(out, frame.args, qid, propertyID)&lt;br /&gt;
	else&lt;br /&gt;
		return props -- either local parameter or nothing&lt;br /&gt;
	end -- of test for success&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getSumOfParts scans the property 'has part' (P527) for values matching a list.&lt;br /&gt;
-- The list is passed in parameter vlist.&lt;br /&gt;
-- It consists of a string of Qids separated by spaces or any usual punctuation.&lt;br /&gt;
-- If the matched values have a qualifier 'quantity' (P1114), those quantities are summed.&lt;br /&gt;
-- The sum is returned as a number or nothing if zero.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _getsumofparts;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getSumOfParts = function(frame)&lt;br /&gt;
	local sum = _getsumofparts(frame.args)&lt;br /&gt;
	if sum == 0 then return end&lt;br /&gt;
	return sum&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getValueByQual gets the value of a property which has a qualifier with a given entity value&lt;br /&gt;
-- The call needs:&lt;br /&gt;
--					a property ID (the unnamed parameter or 1=Pxxx)&lt;br /&gt;
--					the ID of a qualifier for that property (qualID=Pyyy)&lt;br /&gt;
--					the Wikibase-entity ID of a value for that qualifier (qvalue=Qzzz)&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced;&lt;br /&gt;
-- assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getValueByQual = function(frame)&lt;br /&gt;
	local qualID = frame.args.qualID&lt;br /&gt;
	-- The Q-id of the value for the qualifier we want to match is in named parameter |qvalue=&lt;br /&gt;
	local qval = frame.args.qvalue or &amp;quot;&amp;quot;&lt;br /&gt;
	if qval == &amp;quot;&amp;quot; then return &amp;quot;no qualifier value supplied&amp;quot; end&lt;br /&gt;
	local function checkQID(id)&lt;br /&gt;
		return id == qval&lt;br /&gt;
	end&lt;br /&gt;
	return _getvaluebyqual(frame, qualID, checkQID)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getValueByLang gets the value of a property which has a qualifier P407&lt;br /&gt;
-- (&amp;quot;language of work or name&amp;quot;) whose value has the given language code&lt;br /&gt;
-- The call needs:&lt;br /&gt;
--					a property ID (the unnamed parameter or 1=Pxxx)&lt;br /&gt;
--					the MediaWiki language code to match the language (lang=xx[-yy])&lt;br /&gt;
--					(if no code is supplied, it uses the default language)&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _getvaluebyqual; parseParam; setRanks; parseInput; sourced; assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getValueByLang = function(frame)&lt;br /&gt;
&lt;br /&gt;
	-- The language code for the qualifier we want to match is in named parameter |lang=&lt;br /&gt;
	local langcode = frame.args.lang or &amp;quot;&amp;quot;&lt;br /&gt;
	if langcode == &amp;quot;&amp;quot; then&lt;br /&gt;
		langcode = frame:callParserFunction{ name = &amp;quot;int&amp;quot;, args = &amp;quot;lang&amp;quot; }&lt;br /&gt;
	end&lt;br /&gt;
	local function checkLanguage(id)&lt;br /&gt;
		-- id should represent a language like &amp;quot;British English (Q7979)&amp;quot;&lt;br /&gt;
		-- it should have string property &amp;quot;Wikimedia language code (P424)&amp;quot;&lt;br /&gt;
		-- qlcode will be a table:&lt;br /&gt;
		local qlcode = mw.wikibase.getBestStatements(id, &amp;quot;P424&amp;quot;)&lt;br /&gt;
		if (#qlcode &amp;gt; 0) and (qlcode[1].mainsnak.datavalue.value == langcode) then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return _getvaluebyqual(frame, &amp;quot;P407&amp;quot;, checkLanguage)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getValueByRefSource gets the value of a property which has a reference &amp;quot;stated in&amp;quot; (P248)&lt;br /&gt;
-- whose value has the given entity code.&lt;br /&gt;
-- The call needs:&lt;br /&gt;
--					a property ID (the unnamed parameter or 1=Pxxx)&lt;br /&gt;
--					the entity ID of a value to match where the reference is stated in (match=Qzzz)&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getValueByRefSource = function(frame)&lt;br /&gt;
	-- The property ID that we want to check is the first unnamed parameter&lt;br /&gt;
	local propertyID = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if propertyID == &amp;quot;&amp;quot; then return &amp;quot;no property supplied&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	-- The Q-id of the value we want to match is in named parameter |qvalue=&lt;br /&gt;
	local qval = (frame.args.match or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qval == &amp;quot;&amp;quot; then qval = &amp;quot;Q21540096&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	local unit = (frame.args.unit or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if unit == &amp;quot;&amp;quot; then unit = &amp;quot;Q4917&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	local onlysrc = parseParam(frame.args.onlysourced or frame.args.osd, true)&lt;br /&gt;
&lt;br /&gt;
	-- set the requested ranks flags&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
&lt;br /&gt;
	-- set a language object and code in the frame.args table&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
&lt;br /&gt;
	local linked = parseParam(frame.args.linked, true)&lt;br /&gt;
&lt;br /&gt;
	local uabbr = parseParam(frame.args.uabbr or frame.args.unitabbr, false)&lt;br /&gt;
&lt;br /&gt;
	-- qid not nil means no local parameter and the property exists&lt;br /&gt;
	local qid, props = parseInput(frame, frame.args[2], propertyID)&lt;br /&gt;
&lt;br /&gt;
	if qid then&lt;br /&gt;
		local out = {}&lt;br /&gt;
		local mlt= {}&lt;br /&gt;
		for k1, v1 in ipairs(props) do&lt;br /&gt;
			if onlysrc == false or sourced(v1) then&lt;br /&gt;
				if v1.references then&lt;br /&gt;
					for k2, v2 in ipairs(v1.references) do&lt;br /&gt;
						if v2.snaks.P248 then&lt;br /&gt;
							for k3, v3 in ipairs(v2.snaks.P248) do&lt;br /&gt;
								if v3.datavalue.value.id == qval then&lt;br /&gt;
									out[#out+1], mlt[#out+1] = rendersnak(v1, frame.args, linked, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, &amp;quot;&amp;quot;, uabbr, unit)&lt;br /&gt;
									if not mlt[#out] then&lt;br /&gt;
										-- we only need one match per property value&lt;br /&gt;
										-- unless datatype was monolingual text&lt;br /&gt;
										break&lt;br /&gt;
									end&lt;br /&gt;
								end -- of test for match&lt;br /&gt;
							end -- of loop through values &amp;quot;stated in&amp;quot;&lt;br /&gt;
						end -- of test that &amp;quot;stated in&amp;quot; exists&lt;br /&gt;
					end -- of loop through references&lt;br /&gt;
				end -- of test that references exist&lt;br /&gt;
			end -- of test for sourced&lt;br /&gt;
		end -- of loop through values of propertyID&lt;br /&gt;
		if #mlt &amp;gt; 0 then&lt;br /&gt;
			local langcode = frame.args.lang&lt;br /&gt;
			langcode = mw.text.split( langcode, '-', true )[1]&lt;br /&gt;
			local fbtbl = mw.language.getFallbacksFor( langcode )&lt;br /&gt;
			table.insert( fbtbl, 1, langcode )&lt;br /&gt;
			local bestval = &amp;quot;&amp;quot;&lt;br /&gt;
			local found = false&lt;br /&gt;
			for idx1, lang1 in ipairs(fbtbl) do&lt;br /&gt;
				for idx2, lang2 in ipairs(mlt) do&lt;br /&gt;
					if (lang1 == lang2) and not found then&lt;br /&gt;
						bestval = out[idx2]&lt;br /&gt;
						found = true&lt;br /&gt;
						break&lt;br /&gt;
					end&lt;br /&gt;
				end -- loop through values of property&lt;br /&gt;
			end -- loop through fallback languages&lt;br /&gt;
			if found then&lt;br /&gt;
				-- replace output table with a table containing the best value&lt;br /&gt;
				out = { bestval }&lt;br /&gt;
			else&lt;br /&gt;
				-- more than one value and none of them on the list of fallback languages&lt;br /&gt;
				-- sod it, just give them the first one&lt;br /&gt;
				out = { out[1] }&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return assembleoutput(out, frame.args, qid, propertyID)&lt;br /&gt;
	else&lt;br /&gt;
		return props -- no property or local parameter supplied&lt;br /&gt;
	end -- of test for success&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getPropOfProp takes two propertyIDs: prop1 and prop2 (as well as the usual parameters)&lt;br /&gt;
-- If the value(s) of prop1 are of type &amp;quot;wikibase-item&amp;quot; then it returns the value(s) of prop2&lt;br /&gt;
-- of each of those wikibase-items.&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getPropOfProp = function(frame)&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local pid1 = args.prop1 or args.pid1 or &amp;quot;&amp;quot;&lt;br /&gt;
	local pid2 = args.prop2 or args.pid2 or &amp;quot;&amp;quot;&lt;br /&gt;
	local localval = mw.text.trim(args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	if pid1 == &amp;quot;&amp;quot; or pid2 == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	local qid1, statements1 = parseInput(frame, localval, pid1)&lt;br /&gt;
	if not qid1 then return localval end&lt;br /&gt;
	local onlysrc = parseParam(args.onlysourced or args.osd, true)&lt;br /&gt;
	local maxvals = tonumber(args.maxvals) or 0&lt;br /&gt;
	local qualID = mw.text.trim(args.qual or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qualID == &amp;quot;&amp;quot; then qualID = nil end&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k, v in ipairs(statements1) do&lt;br /&gt;
		if not onlysrc or sourced(v) then&lt;br /&gt;
			local snak = v.mainsnak&lt;br /&gt;
			if snak.datatype == &amp;quot;wikibase-item&amp;quot; and snak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
				local qid2 = snak.datavalue.value.id&lt;br /&gt;
				local statements2 = {}&lt;br /&gt;
				if args.reqranks.b then&lt;br /&gt;
					statements2 = mw.wikibase.getBestStatements(qid2, pid2)&lt;br /&gt;
				else&lt;br /&gt;
					statements2 = mw.wikibase.getAllStatements(qid2, pid2)&lt;br /&gt;
				end&lt;br /&gt;
				if statements2[1] then&lt;br /&gt;
					local out2 = propertyvalueandquals(statements2, args, qualID)&lt;br /&gt;
					out[#out+1] = assembleoutput(out2, args, qid2, pid2)&lt;br /&gt;
				end&lt;br /&gt;
			end -- of test for valid property1 value&lt;br /&gt;
		end -- of test for sourced&lt;br /&gt;
		if maxvals &amp;gt; 0 and #out &amp;gt;= maxvals then break end&lt;br /&gt;
	end -- of loop through values of property1&lt;br /&gt;
	return assembleoutput(out, args, qid1, pid1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAwardCat takes most of the usual parameters. If the item has values of P166 (award received),&lt;br /&gt;
-- then it examines each of those awards for P2517 (category for recipients of this award).&lt;br /&gt;
-- If it exists, it returns the corresponding category,&lt;br /&gt;
-- with the item's P734 (family name) as sort key, or no sort key if there is no family name.&lt;br /&gt;
-- The sort key may be overridden by the parameter |sortkey (alias |sk).&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAwardCat = function(frame)&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	args.sep = &amp;quot; &amp;quot;&lt;br /&gt;
	local pid1 = args.prop1 or &amp;quot;P166&amp;quot;&lt;br /&gt;
	local pid2 = args.prop2 or &amp;quot;P2517&amp;quot;&lt;br /&gt;
	if pid1 == &amp;quot;&amp;quot; or pid2 == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	-- locally supplied value:&lt;br /&gt;
	local localval = mw.text.trim(args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	local qid1, statements1 = parseInput(frame, localval, pid1)&lt;br /&gt;
	if not qid1 then return localval end&lt;br /&gt;
	-- linkprefix (strip quotes)&lt;br /&gt;
	local lp = (args.linkprefix or args.lp or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	-- sort key (strip quotes, hyphens and periods):&lt;br /&gt;
	local sk = (args.sortkey or args.sk or &amp;quot;&amp;quot;):gsub('[&amp;quot;-.]', '')&lt;br /&gt;
	-- family name:&lt;br /&gt;
	local famname = &amp;quot;&amp;quot;&lt;br /&gt;
	if sk == &amp;quot;&amp;quot; then&lt;br /&gt;
		local p734 = mw.wikibase.getBestStatements(qid1, &amp;quot;P734&amp;quot;)[1]&lt;br /&gt;
		local p734id = p734 and p734.mainsnak.snaktype == &amp;quot;value&amp;quot; and p734.mainsnak.datavalue.value.id or &amp;quot;&amp;quot;&lt;br /&gt;
		famname = mw.wikibase.sitelink(p734id) or &amp;quot;&amp;quot;&lt;br /&gt;
		-- strip namespace and disambigation&lt;br /&gt;
		local pos = famname:find(&amp;quot;:&amp;quot;) or 0&lt;br /&gt;
		famname = famname:sub(pos+1):gsub(&amp;quot;%s%(.+%)$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
		if famname == &amp;quot;&amp;quot; then&lt;br /&gt;
			local lbl = mw.wikibase.label(p734id)&lt;br /&gt;
			famname = lbl and mw.text.nowiki(lbl) or &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local onlysrc = parseParam(args.onlysourced or args.osd, true)&lt;br /&gt;
	local maxvals = tonumber(args.maxvals) or 0&lt;br /&gt;
	local qualID = mw.text.trim(args.qual or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qualID == &amp;quot;&amp;quot; then qualID = nil end&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k, v in ipairs(statements1) do&lt;br /&gt;
		if not onlysrc or sourced(v) then&lt;br /&gt;
			local snak = v.mainsnak&lt;br /&gt;
			if snak.datatype == &amp;quot;wikibase-item&amp;quot; and snak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
				local qid2 = snak.datavalue.value.id&lt;br /&gt;
				local statements2 = {}&lt;br /&gt;
				if args.reqranks.b then&lt;br /&gt;
					statements2 = mw.wikibase.getBestStatements(qid2, pid2)&lt;br /&gt;
				else&lt;br /&gt;
					statements2 = mw.wikibase.getAllStatements(qid2, pid2)&lt;br /&gt;
				end&lt;br /&gt;
				if statements2[1] and statements2[1].mainsnak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
					local qid3 = statements2[1].mainsnak.datavalue.value.id&lt;br /&gt;
					local sitelink = mw.wikibase.sitelink(qid3)&lt;br /&gt;
					-- if there's no local sitelink, create the sitelink from English label&lt;br /&gt;
					if not sitelink then&lt;br /&gt;
						local lbl = mw.wikibase.getLabelByLang(qid3, &amp;quot;en&amp;quot;)&lt;br /&gt;
						if lbl then&lt;br /&gt;
							if lbl:sub(1,9) == &amp;quot;Category:&amp;quot; then&lt;br /&gt;
								sitelink = mw.text.nowiki(lbl)&lt;br /&gt;
							else&lt;br /&gt;
								sitelink = &amp;quot;Category:&amp;quot; .. mw.text.nowiki(lbl)&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					if sitelink then&lt;br /&gt;
						if sk ~= &amp;quot;&amp;quot; then&lt;br /&gt;
							out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. sitelink .. &amp;quot;|&amp;quot; .. sk .. &amp;quot;]]&amp;quot;&lt;br /&gt;
						elseif famname ~= &amp;quot;&amp;quot; then&lt;br /&gt;
							out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. sitelink .. &amp;quot;|&amp;quot; .. famname .. &amp;quot;]]&amp;quot;&lt;br /&gt;
						else&lt;br /&gt;
							out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. sitelink .. &amp;quot;]]&amp;quot;&lt;br /&gt;
						end -- of check for sort keys&lt;br /&gt;
					end -- of test for sitelink&lt;br /&gt;
				end -- of test for category&lt;br /&gt;
			end -- of test for wikibase item has a value&lt;br /&gt;
		end -- of test for sourced&lt;br /&gt;
		if maxvals &amp;gt; 0 and #out &amp;gt;= maxvals then break end&lt;br /&gt;
	end -- of loop through values of property1&lt;br /&gt;
	return assembleoutput(out, args, qid1, pid1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getIntersectCat takes most of the usual parameters.&lt;br /&gt;
-- The usual whitelisting, blacklisting, onlysourced, etc. are implemented&lt;br /&gt;
-- It takes two properties, |prop1 and |prop2 (e.g. occupation and country of citizenship)&lt;br /&gt;
-- Each property's value is a wiki-base entity&lt;br /&gt;
-- For each value of the first parameter (ranks implemented) it fetches the value's main category&lt;br /&gt;
-- and then each value of the second parameter (possibly substituting a simpler description)&lt;br /&gt;
-- then it returns all of the categories representing the intersection of those properties,&lt;br /&gt;
-- (e.g. Category:Actors from Canada). A joining term may be supplied (e.g. |join=from).&lt;br /&gt;
-- The item's P734 (family name) is the sort key, or no sort key if there is no family name.&lt;br /&gt;
-- The sort key may be overridden by the parameter |sortkey (alias |sk).&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam; setRanks; parseInput; sourced; propertyvalueandquals assembleoutput;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getIntersectCat = function(frame)&lt;br /&gt;
	frame.args.reqranks = setRanks(frame.args.rank)&lt;br /&gt;
	frame.args.langobj = findLang(frame.args.lang)&lt;br /&gt;
	frame.args.lang = frame.args.langobj.code&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	args.sep = &amp;quot; &amp;quot;&lt;br /&gt;
	args.linked = &amp;quot;no&amp;quot;&lt;br /&gt;
	local pid1 = args.prop1 or &amp;quot;P106&amp;quot;&lt;br /&gt;
	local pid2 = args.prop2 or &amp;quot;P27&amp;quot;&lt;br /&gt;
	if pid1 == &amp;quot;&amp;quot; or pid2 == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	local qid, statements1 = parseInput(frame, &amp;quot;&amp;quot;, pid1)&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	local qid, statements2 = parseInput(frame, &amp;quot;&amp;quot;, pid2)&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	-- topics like countries may have different names in categories from their label in Wikidata&lt;br /&gt;
	local subs_exists, subs = pcall(mw.loadData, &amp;quot;Module:WikidataIB/subs&amp;quot;)&lt;br /&gt;
	local join = args.join or &amp;quot;&amp;quot;&lt;br /&gt;
	local onlysrc = parseParam(args.onlysourced or args.osd, true)&lt;br /&gt;
	local maxvals = tonumber(args.maxvals) or 0&lt;br /&gt;
	-- linkprefix (strip quotes)&lt;br /&gt;
	local lp = (args.linkprefix or args.lp or &amp;quot;&amp;quot;):gsub('&amp;quot;', '')&lt;br /&gt;
	-- sort key (strip quotes, hyphens and periods):&lt;br /&gt;
	local sk = (args.sortkey or args.sk or &amp;quot;&amp;quot;):gsub('[&amp;quot;-.]', '')&lt;br /&gt;
	-- family name:&lt;br /&gt;
	local famname = &amp;quot;&amp;quot;&lt;br /&gt;
	if sk == &amp;quot;&amp;quot; then&lt;br /&gt;
		local p734 = mw.wikibase.getBestStatements(qid, &amp;quot;P734&amp;quot;)[1]&lt;br /&gt;
		local p734id = p734 and p734.mainsnak.snaktype == &amp;quot;value&amp;quot; and p734.mainsnak.datavalue.value.id or &amp;quot;&amp;quot;&lt;br /&gt;
		famname = mw.wikibase.sitelink(p734id) or &amp;quot;&amp;quot;&lt;br /&gt;
		-- strip namespace and disambigation&lt;br /&gt;
		local pos = famname:find(&amp;quot;:&amp;quot;) or 0&lt;br /&gt;
		famname = famname:sub(pos+1):gsub(&amp;quot;%s%(.+%)$&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
		if famname == &amp;quot;&amp;quot; then&lt;br /&gt;
			local lbl = mw.wikibase.label(p734id)&lt;br /&gt;
			famname = lbl and mw.text.nowiki(lbl) or &amp;quot;&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local cat1 = {}&lt;br /&gt;
	for k, v in ipairs(statements1) do&lt;br /&gt;
		if not onlysrc or sourced(v) then&lt;br /&gt;
			-- get the ID representing the value of the property&lt;br /&gt;
			local pvalID = (v.mainsnak.snaktype == &amp;quot;value&amp;quot;) and v.mainsnak.datavalue.value.id&lt;br /&gt;
			if pvalID then&lt;br /&gt;
				-- get the topic's main category (P910) for that entity&lt;br /&gt;
				local p910 = mw.wikibase.getBestStatements(pvalID, &amp;quot;P910&amp;quot;)[1]&lt;br /&gt;
				if p910 and p910.mainsnak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
					local tmcID = p910.mainsnak.datavalue.value.id&lt;br /&gt;
					-- use sitelink or the English label for the cat&lt;br /&gt;
					local cat = mw.wikibase.sitelink(tmcID)&lt;br /&gt;
					if not cat then&lt;br /&gt;
						local lbl = mw.wikibase.getLabelByLang(tmcID, &amp;quot;en&amp;quot;)&lt;br /&gt;
						if lbl then&lt;br /&gt;
							if lbl:sub(1,9) == &amp;quot;Category:&amp;quot; then&lt;br /&gt;
								cat = mw.text.nowiki(lbl)&lt;br /&gt;
							else&lt;br /&gt;
								cat = &amp;quot;Category:&amp;quot; .. mw.text.nowiki(lbl)&lt;br /&gt;
							end&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
					cat1[#cat1+1] = cat&lt;br /&gt;
				end -- of test for topic's main category exists&lt;br /&gt;
			end -- of test for property has vaild value&lt;br /&gt;
		end -- of test for sourced&lt;br /&gt;
		if maxvals &amp;gt; 0 and #cat1 &amp;gt;= maxvals then break end&lt;br /&gt;
	end&lt;br /&gt;
	local cat2 = {}&lt;br /&gt;
	for k, v in ipairs(statements2) do&lt;br /&gt;
		if not onlysrc or sourced(v) then&lt;br /&gt;
			local cat = rendersnak(v, args)&lt;br /&gt;
			if subs[cat] then cat = subs[cat] end&lt;br /&gt;
			cat2[#cat2+1] = cat&lt;br /&gt;
		end&lt;br /&gt;
		if maxvals &amp;gt; 0 and #cat2 &amp;gt;= maxvals then break end&lt;br /&gt;
	end&lt;br /&gt;
	out = {}&lt;br /&gt;
	for k1, v1 in ipairs(cat1) do&lt;br /&gt;
		for k2, v2 in ipairs(cat2) do&lt;br /&gt;
			if sk ~= &amp;quot;&amp;quot; then&lt;br /&gt;
				out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. v1 .. &amp;quot; &amp;quot; .. join .. &amp;quot; &amp;quot; .. v2 .. &amp;quot;|&amp;quot; .. sk .. &amp;quot;]]&amp;quot;&lt;br /&gt;
			elseif famname ~= &amp;quot;&amp;quot; then&lt;br /&gt;
				out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. v1 .. &amp;quot; &amp;quot; .. join .. &amp;quot; &amp;quot; .. v2 .. &amp;quot;|&amp;quot; .. famname .. &amp;quot;]]&amp;quot;&lt;br /&gt;
			else&lt;br /&gt;
				out[#out+1] = &amp;quot;[[&amp;quot; .. lp .. v1 .. &amp;quot; &amp;quot; .. join .. &amp;quot; &amp;quot; .. v2 .. &amp;quot;]]&amp;quot;&lt;br /&gt;
			end -- of check for sort keys&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	args.noicon = &amp;quot;true&amp;quot;&lt;br /&gt;
	return assembleoutput(out, args, qid, pid1)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getGlobe takes an optional qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- otherwise it uses the linked item for the current page.&lt;br /&gt;
-- If returns the Qid of the globe used in P625 (coordinate location),&lt;br /&gt;
-- or nil if there isn't one.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getGlobe = function(frame)&lt;br /&gt;
	local qid = frame.args.qid or frame.args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	local coords = mw.wikibase.getBestStatements(qid, &amp;quot;P625&amp;quot;)[1]&lt;br /&gt;
	local globeid&lt;br /&gt;
	if coords and coords.mainsnak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
		globeid = coords.mainsnak.datavalue.value.globe:match(&amp;quot;(Q%d+)&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	return globeid&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getCommonsLink takes an optional qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- It returns one of the following in order of preference:&lt;br /&gt;
-- the Commons sitelink of the linked Wikidata item;&lt;br /&gt;
-- the Commons sitelink of the topic's main category of the linked Wikidata item;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _getCommonslink(); _getSitelink(); parseParam()&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getCommonsLink = function(frame)&lt;br /&gt;
	local oc = frame.args.onlycat or frame.args.onlycategories&lt;br /&gt;
	local fb = parseParam(frame.args.fallback or frame.args.fb, true)&lt;br /&gt;
	return _getCommonslink(frame.args.qid, oc, fb)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getSitelink takes the qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- It takes an optional parameter |wiki= to determine which wiki is to be checked for a sitelink&lt;br /&gt;
-- If the parameter is blank, then it uses the local wiki.&lt;br /&gt;
-- If there is a sitelink to an article available, it returns the plain text link to the article&lt;br /&gt;
-- If there is no sitelink, it returns nil.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getSiteLink = function(frame)&lt;br /&gt;
	return _getSitelink(frame.args.qid, frame.args.wiki or mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getLink has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=&lt;br /&gt;
-- If there is a sitelink to an article on the local Wiki, it returns a link to the article&lt;br /&gt;
-- with the Wikidata label as the displayed text.&lt;br /&gt;
-- If there is no sitelink, it returns the label as plain text.&lt;br /&gt;
-- If there is no label in the local language, it displays the qid instead.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getLink = function(frame)&lt;br /&gt;
	local itemID = mw.text.trim(frame.args[1] or frame.args.qid or &amp;quot;&amp;quot;)&lt;br /&gt;
	if itemID == &amp;quot;&amp;quot; then return end&lt;br /&gt;
	local sitelink = mw.wikibase.sitelink(itemID)&lt;br /&gt;
	local label = labelOrId(itemID)&lt;br /&gt;
	if sitelink then&lt;br /&gt;
		return &amp;quot;[[:&amp;quot; .. sitelink .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		return label&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getLabel has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=&lt;br /&gt;
-- It returns the Wikidata label for the local language as plain text.&lt;br /&gt;
-- If there is no label in the local language, it displays the qid instead.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getLabel = function(frame)&lt;br /&gt;
	local itemID = mw.text.trim(frame.args[1] or frame.args.qid or &amp;quot;&amp;quot;)&lt;br /&gt;
	if itemID == &amp;quot;&amp;quot; then return end&lt;br /&gt;
	local label = labelOrId(itemID)&lt;br /&gt;
	return label&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAT has the qid of a Wikidata entity passed as the first unnamed parameter or as |qid=&lt;br /&gt;
-- If there is a sitelink to an article on the local Wiki, it returns the sitelink as plain text.&lt;br /&gt;
-- If there is no sitelink, it returns nothing.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAT = function(frame)&lt;br /&gt;
	local itemID = mw.text.trim(frame.args[1] or frame.args.qid or &amp;quot;&amp;quot;)&lt;br /&gt;
	if itemID == &amp;quot;&amp;quot; then return end&lt;br /&gt;
	return mw.wikibase.sitelink(itemID)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getDescription has the qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- (it defaults to the associated qid of the current article if omitted)&lt;br /&gt;
-- and a local parameter passed as the first unnamed parameter.&lt;br /&gt;
-- Any local parameter passed (other than &amp;quot;Wikidata&amp;quot; or &amp;quot;none&amp;quot;) becomes the return value.&lt;br /&gt;
-- It returns the article description for the Wikidata entity if the local parameter is &amp;quot;Wikidata&amp;quot;.&lt;br /&gt;
-- Nothing is returned if the description doesn't exist or &amp;quot;none&amp;quot; is passed as the local parameter.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getDescription = function(frame)&lt;br /&gt;
	local desc = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	local itemID = mw.text.trim(frame.args.qid or &amp;quot;&amp;quot;)&lt;br /&gt;
	if itemID == &amp;quot;&amp;quot; then itemID = nil end&lt;br /&gt;
	if desc:lower() == 'wikidata' then&lt;br /&gt;
		return mw.wikibase.description(itemID)&lt;br /&gt;
	elseif desc:lower() == 'none' then&lt;br /&gt;
		return nil&lt;br /&gt;
	else&lt;br /&gt;
		return desc&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAliases has the qid of a Wikidata entity passed as |qid=&lt;br /&gt;
-- (it defaults to the associated qid of the current article if omitted)&lt;br /&gt;
-- and a local parameter passed as the first unnamed parameter.&lt;br /&gt;
-- It implements blacklisting and whitelisting with a field name of &amp;quot;alias&amp;quot; by default.&lt;br /&gt;
-- Any local parameter passed becomes the return value.&lt;br /&gt;
-- Otherwise it returns the aliases for the Wikidata entity with the usual list options.&lt;br /&gt;
-- Nothing is returned if the aliases do not exist.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang(); assembleoutput()&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAliases = function(frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
&lt;br /&gt;
	local fieldname = args.name or &amp;quot;&amp;quot;&lt;br /&gt;
	if fieldname == &amp;quot;&amp;quot; then fieldname = &amp;quot;alias&amp;quot; end&lt;br /&gt;
&lt;br /&gt;
	local blacklist = args.suppressfields or args.spf or &amp;quot;&amp;quot;&lt;br /&gt;
	if blacklist:find(fieldname) then return nil end&lt;br /&gt;
&lt;br /&gt;
	local localval = mw.text.trim(args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	if localval ~= &amp;quot;&amp;quot; then return localval end&lt;br /&gt;
&lt;br /&gt;
	local whitelist = args.fetchwikidata or args.fwd or &amp;quot;&amp;quot;&lt;br /&gt;
	if whitelist == &amp;quot;&amp;quot; then whitelist = &amp;quot;NONE&amp;quot; end&lt;br /&gt;
	if not (whitelist == 'ALL' or whitelist:find(fieldname)) then return nil end&lt;br /&gt;
&lt;br /&gt;
	local qid = mw.text.trim(args.qid or &amp;quot;&amp;quot;)&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = nil end&lt;br /&gt;
&lt;br /&gt;
	local entity = mw.wikibase.getEntity(qid)&lt;br /&gt;
	if not entity then return nil end&lt;br /&gt;
	local aliases = entity.aliases&lt;br /&gt;
	if not aliases then return nil end&lt;br /&gt;
	if not qid then qid= mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
&lt;br /&gt;
	args.langobj = findLang(args.lang)&lt;br /&gt;
	local langcode = args.langobj.code&lt;br /&gt;
	args.lang = langcode&lt;br /&gt;
&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k1, v1 in pairs(aliases) do&lt;br /&gt;
		if v1[1].language == langcode then&lt;br /&gt;
			for k1, v2 in ipairs(v1) do&lt;br /&gt;
				out[#out+1] = v2.value&lt;br /&gt;
			end&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return assembleoutput(out, args, qid)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- pageId returns the page id (entity ID, Qnnn) of the current page&lt;br /&gt;
-- returns nothing if the page is not connected to Wikidata&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.pageId = function(frame)&lt;br /&gt;
	return mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- formatDate is a wrapper to export the private function format_Date&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: format_Date();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.formatDate = function(frame)&lt;br /&gt;
	return format_Date(frame.args[1], frame.args.df, frame.args.bc)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- location is a wrapper to export the private function _location&lt;br /&gt;
-- it takes the entity-id as qid or the first unnamed parameter&lt;br /&gt;
-- optional boolean parameter first toggles the display of the first item&lt;br /&gt;
-- optional boolean parameter skip toggles the display to skip to the last item&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: _location();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.location = function(frame)&lt;br /&gt;
	local debug = (frame.args.debug or &amp;quot;&amp;quot;):sub(1, 1):lower()&lt;br /&gt;
	if debug == &amp;quot;&amp;quot; then debug = &amp;quot;n&amp;quot; end&lt;br /&gt;
	local qid = mw.text.trim(frame.args.qid or frame.args[1] or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid=mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then&lt;br /&gt;
		if debug ~= &amp;quot;n&amp;quot; then&lt;br /&gt;
			return i18n.errors[&amp;quot;entity-not-found&amp;quot;]&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local first = mw.text.trim(frame.args.first or &amp;quot;&amp;quot;)&lt;br /&gt;
	local skip = mw.text.trim(frame.args.skip or &amp;quot;&amp;quot;)&lt;br /&gt;
	return table.concat( _location(qid, first, skip), &amp;quot;, &amp;quot; )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- checkBlacklist implements a test to check whether a named field is allowed&lt;br /&gt;
-- returns true if the field is not blacklisted (i.e. allowed)&lt;br /&gt;
-- returns false if the field is blacklisted (i.e. disallowed)&lt;br /&gt;
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Joe |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}&lt;br /&gt;
-- displays &amp;quot;blacklisted&amp;quot;&lt;br /&gt;
-- {{#if:{{#invoke:WikidataIB |checkBlacklist |name=Jim |suppressfields=Dave; Joe; Fred}} | not blacklisted | blacklisted}}&lt;br /&gt;
-- displays &amp;quot;not blacklisted&amp;quot;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.checkBlacklist = function(frame)&lt;br /&gt;
	local blacklist = frame.args.suppressfields or frame.args.spf or &amp;quot;&amp;quot;&lt;br /&gt;
	local fieldname = frame.args.name or &amp;quot;&amp;quot;&lt;br /&gt;
	if blacklist ~= &amp;quot;&amp;quot; and fieldname ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		if blacklist:find(fieldname) then&lt;br /&gt;
			return false&lt;br /&gt;
		else&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- one of the fields is missing: let's call that &amp;quot;not on the list&amp;quot;&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- emptyor returns nil if its first unnamed argument is just punctuation, whitespace or html tags&lt;br /&gt;
-- otherwise it returns the argument unchanged (including leading/trailing space).&lt;br /&gt;
-- If the argument may contain &amp;quot;=&amp;quot;, then it must be called explicitly:&lt;br /&gt;
-- |1=arg&lt;br /&gt;
-- (In that case, leading and trailing spaces are trimmed)&lt;br /&gt;
-- It finds use in infoboxes where it can replace tests like:&lt;br /&gt;
-- {{#if: {{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}} | &amp;lt;span class=&amp;quot;xxx&amp;quot;&amp;gt;{{#invoke:WikidatIB |getvalue |P99 |fwd=ALL}}&amp;lt;/span&amp;gt; | }}&lt;br /&gt;
-- with a form that uses just a single call to Wikidata:&lt;br /&gt;
-- {{#invoke |WikidataIB |emptyor |1= &amp;lt;span class=&amp;quot;xxx&amp;quot;&amp;gt;{{#invoke:WikidataIB |getvalue |P99 |fwd=ALL}}&amp;lt;/span&amp;gt; }}&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.emptyor = function(frame)&lt;br /&gt;
	local s = frame.args[1] or &amp;quot;&amp;quot;&lt;br /&gt;
	if s == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	local sx = s:gsub(&amp;quot;%s&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;&amp;lt;[^&amp;gt;]*&amp;gt;&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;%p&amp;quot;, &amp;quot;&amp;quot;)&lt;br /&gt;
	if sx == &amp;quot;&amp;quot; then&lt;br /&gt;
		return nil&lt;br /&gt;
	else&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- labelorid is a public function to expose the output of labelOrId()&lt;br /&gt;
-- Pass the Q-number as |qid= or as an unnamed parameter.&lt;br /&gt;
-- It returns the Wikidata label for that entity or the qid if no label exists.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: labelOrId&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.labelorid = function(frame)&lt;br /&gt;
	local label = labelOrId( frame.args.qid or frame.args[1] )&lt;br /&gt;
	return label&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getLang returns the MediaWiki language code of the current content.&lt;br /&gt;
-- If optional parameter |style=full, it returns the language name.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getLang = function(frame)&lt;br /&gt;
	local style = (frame.args.style or &amp;quot;&amp;quot;):lower()&lt;br /&gt;
	local langcode = mw.language.getContentLanguage().code&lt;br /&gt;
	if style == &amp;quot;full&amp;quot; then&lt;br /&gt;
		return mw.language.fetchLanguageName( langcode )&lt;br /&gt;
	end&lt;br /&gt;
	return langcode&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- findLanguage exports the local findLang() function&lt;br /&gt;
-- It takes an optional language code and returns, in order of preference:&lt;br /&gt;
-- the code if a known language;&lt;br /&gt;
-- the user's language, if set;&lt;br /&gt;
-- the server's content language.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.findLanguage = function(frame)&lt;br /&gt;
	return findLang(frame.args.lang or frame.args[1]).code&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getQid returns the qid, if supplied&lt;br /&gt;
-- failing that, the Wikidata entity ID of the &amp;quot;category's main topic (P301)&amp;quot;, if it exists&lt;br /&gt;
-- failing that, the Wikidata entity ID asociated with the curent page, if it exists&lt;br /&gt;
-- otherwise, nothing&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getQid = function(frame)&lt;br /&gt;
	local qid = (frame.args.qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	-- check if a qid was passed; if so, return it:&lt;br /&gt;
	if qid ~= &amp;quot;&amp;quot; then return qid end&lt;br /&gt;
	-- check if there's a &amp;quot;category's main topic (P301)&amp;quot;:&lt;br /&gt;
	qid = mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
	if qid then&lt;br /&gt;
		local prop301 = mw.wikibase.getBestStatements(qid, &amp;quot;P301&amp;quot;)&lt;br /&gt;
		if prop301[1] then&lt;br /&gt;
			local mctid = prop301[1].mainsnak.datavalue.value.id&lt;br /&gt;
			if mctid then return mctid end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- otherwise return the page qid (if any)&lt;br /&gt;
	return qid&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- followQid takes two optional parameters: qid and props&lt;br /&gt;
-- If qid is not given, it uses the qid for the connected page&lt;br /&gt;
-- or returns nil if there isn't one.&lt;br /&gt;
-- props is a list of properties, separated by punctuation.&lt;br /&gt;
-- If props is given, the Wikidata item for the qid is examined for each property in turn.&lt;br /&gt;
-- If that property contains a value that is another Wikibase-item, that item's qid is returned,&lt;br /&gt;
-- and the search terminates, unless |all=y when all of the qids are returned, sparated by spaces.&lt;br /&gt;
-- If props is not given, the qid is returned.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: parseParam()&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.followQid = function(frame)&lt;br /&gt;
	local qid = (frame.args.qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	local all = parseParam(frame.args.all, false)&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then&lt;br /&gt;
		qid = mw.wikibase.getEntityIdForCurrentPage()&lt;br /&gt;
	end&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	local out = {}&lt;br /&gt;
	local props = (frame.args.props or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if props ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		for p in mw.text.gsplit(props, &amp;quot;%p&amp;quot;) do -- split at punctuation and iterate&lt;br /&gt;
			p = mw.text.trim(p)&lt;br /&gt;
			for i, v in ipairs( mw.wikibase.getBestStatements(qid, p) ) do&lt;br /&gt;
				local linkedid = v.mainsnak.datavalue and v.mainsnak.datavalue.value.id&lt;br /&gt;
				if linkedid then&lt;br /&gt;
					if all then&lt;br /&gt;
						out[#out+1] = linkedid&lt;br /&gt;
					else&lt;br /&gt;
						return linkedid&lt;br /&gt;
					end -- test for all or just the first one found&lt;br /&gt;
				end -- test for value exists for that property&lt;br /&gt;
			end -- loop through values of property to follow&lt;br /&gt;
		end -- loop through list of properties to follow&lt;br /&gt;
	end&lt;br /&gt;
	if #out &amp;gt; 0 then&lt;br /&gt;
		return table.concat(out, &amp;quot; &amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		return qid&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- siteID returns the root of the globalSiteID&lt;br /&gt;
-- e.g. &amp;quot;en&amp;quot; for &amp;quot;enwiki&amp;quot;, &amp;quot;enwikisource&amp;quot;, etc.&lt;br /&gt;
-- treats &amp;quot;en-gb&amp;quot; as &amp;quot;en&amp;quot;, etc.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.siteID = function(frame)&lt;br /&gt;
	local txtlang = frame:preprocess( &amp;quot;{{int:lang}}&amp;quot; ) or &amp;quot;&amp;quot;&lt;br /&gt;
	-- This deals with specific exceptions: be-tarask -&amp;gt; be-x-old&lt;br /&gt;
	if txtlang == &amp;quot;be-tarask&amp;quot; then&lt;br /&gt;
		return &amp;quot;be_x_old&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local pos = txtlang:find(&amp;quot;-&amp;quot;)&lt;br /&gt;
	local ret = &amp;quot;&amp;quot;&lt;br /&gt;
	if pos then&lt;br /&gt;
		ret = txtlang:sub(1, pos-1)&lt;br /&gt;
	else&lt;br /&gt;
		ret = txtlang&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- projID returns the code used to link to the reader's language's project&lt;br /&gt;
-- e.g &amp;quot;en&amp;quot; for [[:en:WikidataIB]]&lt;br /&gt;
-- treats &amp;quot;en-gb&amp;quot; as &amp;quot;en&amp;quot;, etc.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.projID = function(frame)&lt;br /&gt;
	local txtlang = frame:preprocess( &amp;quot;{{int:lang}}&amp;quot; ) or &amp;quot;&amp;quot;&lt;br /&gt;
	-- This deals with specific exceptions: be-tarask -&amp;gt; be-x-old&lt;br /&gt;
	if txtlang == &amp;quot;be-tarask&amp;quot; then&lt;br /&gt;
		return &amp;quot;be-x-old&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	local pos = txtlang:find(&amp;quot;-&amp;quot;)&lt;br /&gt;
	local ret = &amp;quot;&amp;quot;&lt;br /&gt;
	if pos then&lt;br /&gt;
		ret = txtlang:sub(1, pos-1)&lt;br /&gt;
	else&lt;br /&gt;
		ret = txtlang&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- formatNumber formats a number according to the the supplied language code (&amp;quot;|lang=&amp;quot;)&lt;br /&gt;
-- or the default language if not supplied.&lt;br /&gt;
-- The number is the first unnamed parameter or &amp;quot;|num=&amp;quot;&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang()&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.formatNumber = function(frame)&lt;br /&gt;
	local lang&lt;br /&gt;
	local num = tonumber(frame.args[1] or frame.args.num) or 0&lt;br /&gt;
	lang = findLang(frame.args.lang)&lt;br /&gt;
	return lang:formatNum( num )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- examine dumps the property (the unnamed parameter or pid)&lt;br /&gt;
-- from the item given by the parameter 'qid' (or the other unnamed parameter)&lt;br /&gt;
-- or from the item corresponding to the current page if qid is not supplied.&lt;br /&gt;
-- e.g. {{#invoke:WikidataIB |examine |pid=P26 |qid=Q42}}&lt;br /&gt;
-- or {{#invoke:WikidataIB |examine |P26 |Q42}} or any combination of these&lt;br /&gt;
-- or {{#invoke:WikidataIB |examine |P26}} for the current page.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.examine = function( frame )&lt;br /&gt;
	local args&lt;br /&gt;
	if frame.args[1] or frame.args.pid or frame.args.qid then&lt;br /&gt;
		args = frame.args&lt;br /&gt;
	else&lt;br /&gt;
		args = frame:getParent().args&lt;br /&gt;
	end&lt;br /&gt;
	local par = {}&lt;br /&gt;
	local pid = (args.pid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	local qid = (args.qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	par[1] = mw.text.trim( args[1] or &amp;quot;&amp;quot; ):upper()&lt;br /&gt;
	par[2] = mw.text.trim( args[2] or &amp;quot;&amp;quot; ):upper()&lt;br /&gt;
	table.sort(par)&lt;br /&gt;
	if par[2]:sub(1,1) == &amp;quot;P&amp;quot; then par[1], par[2] = par[2], par[1] end&lt;br /&gt;
	if pid == &amp;quot;&amp;quot; then pid = par[1] end&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = par[2] end&lt;br /&gt;
	if pid:sub(1,1) ~= &amp;quot;P&amp;quot; then return &amp;quot;No property supplied&amp;quot; end&lt;br /&gt;
	if qid:sub(1,1) ~= &amp;quot;Q&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then return &amp;quot;No item for this page&amp;quot; end&lt;br /&gt;
	return &amp;quot;&amp;lt;pre&amp;gt;&amp;quot; .. mw.dumpObject( mw.wikibase.getAllStatements( qid, pid ) ) .. &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- checkvalue looks for 'val' as a wikibase-item value of a property (the unnamed parameter or pid)&lt;br /&gt;
-- from the item given by the parameter 'qid'&lt;br /&gt;
-- or from the Wikidata item associated with the current page if qid is not supplied.&lt;br /&gt;
-- If property is not supplied, then P31 (instance of) is assumed.&lt;br /&gt;
-- It returns val if found or nothing if not found.&lt;br /&gt;
-- e.g. {{#invoke:WikidataIB |checkvalue |val=Q5 |pid=P31 |qid=Q42}}&lt;br /&gt;
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31 |qid=Q42}}&lt;br /&gt;
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |qid=Q42}}&lt;br /&gt;
-- or {{#invoke:WikidataIB |checkvalue |val=Q5 |P31}} for the current page.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.checkvalue = function( frame )&lt;br /&gt;
	local args&lt;br /&gt;
	if frame.args.val then&lt;br /&gt;
		args = frame.args&lt;br /&gt;
	else&lt;br /&gt;
		args = frame:getParent().args&lt;br /&gt;
	end&lt;br /&gt;
	local val = args.val&lt;br /&gt;
	if not val then return nil end&lt;br /&gt;
	local pid = mw.text.trim(args.pid or args[1] or &amp;quot;P31&amp;quot;):upper()&lt;br /&gt;
	local qid = (args.qid or &amp;quot;&amp;quot;):upper()&lt;br /&gt;
	if pid:sub(1,1) ~= &amp;quot;P&amp;quot; then return nil end&lt;br /&gt;
	if qid:sub(1,1) ~= &amp;quot;Q&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
	local stats = mw.wikibase.getAllStatements( qid, pid )&lt;br /&gt;
	if not stats[1] then return nil end&lt;br /&gt;
	if stats[1].mainsnak.datatype == &amp;quot;wikibase-item&amp;quot; then&lt;br /&gt;
		for k, v in pairs( stats ) do&lt;br /&gt;
			if v.mainsnak.snaktype == &amp;quot;value&amp;quot; and v.mainsnak.datavalue.value.id == val then&lt;br /&gt;
				return val&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- url2 takes a parameter url= that is a proper url and formats it for use in an infobox.&lt;br /&gt;
-- If no parameter is supplied, it returns nothing.&lt;br /&gt;
-- This is the equivalent of Template:URL&lt;br /&gt;
-- but it keeps the &amp;quot;edit at Wikidata&amp;quot; pen icon out of the microformat.&lt;br /&gt;
-- Usually it will take its url parameter directly from a Wikidata call:&lt;br /&gt;
-- e.g. {{#invoke:WikidataIB |url2 |url={{wdib |P856 |qid=Q23317 |fwd=ALL |osd=no}}&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.url2 = function(frame)&lt;br /&gt;
	local txt = frame.args.url or &amp;quot;&amp;quot;&lt;br /&gt;
	if txt == &amp;quot;&amp;quot; then return nil end&lt;br /&gt;
	local url, icon = txt:match(&amp;quot;(.+)&amp;amp;nbsp;(.+)&amp;quot;)&lt;br /&gt;
	url = url or txt&lt;br /&gt;
	icon = icon or &amp;quot;&amp;quot;&lt;br /&gt;
	local prot, addr = url:match(&amp;quot;(http[s]*://)(.+)&amp;quot;)&lt;br /&gt;
	prot = prot or url&lt;br /&gt;
	addr = addr or &amp;quot;&amp;quot;&lt;br /&gt;
	local disp, n = addr:gsub(&amp;quot;%.&amp;quot;, &amp;quot;&amp;lt;wbr/&amp;gt;%.&amp;quot;)&lt;br /&gt;
	return '&amp;lt;span class=&amp;quot;url&amp;quot;&amp;gt;[' .. prot .. addr .. &amp;quot; &amp;quot; .. disp .. &amp;quot;]&amp;lt;/span&amp;gt;&amp;amp;nbsp;&amp;quot; .. icon&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getWebsite fetches the Official website (P856) and formats it for use in an infobox.&lt;br /&gt;
-- This is similar to Template:Official website but with a url displayed,&lt;br /&gt;
-- and it adds the &amp;quot;edit at Wikidata&amp;quot; pen icon beyond the microformat if enabled.&lt;br /&gt;
-- A local value will override the Wikidata value. &amp;quot;NONE&amp;quot; returns nothing.&lt;br /&gt;
-- e.g. {{#invoke:WikidataIB |getWebsite |qid= |noicon= |lang= |url= }}&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: findLang(); parseParam();&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getWebsite = function(frame)&lt;br /&gt;
	local url = frame.args.url or &amp;quot;&amp;quot;&lt;br /&gt;
	if url:upper() == &amp;quot;NONE&amp;quot; then return nil end&lt;br /&gt;
&lt;br /&gt;
	local qid = frame.args.qid or &amp;quot;&amp;quot;&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = mw.wikibase.getEntityIdForCurrentPage() end&lt;br /&gt;
	if not qid then return nil end&lt;br /&gt;
&lt;br /&gt;
	local urls = {}&lt;br /&gt;
	local quals = {}&lt;br /&gt;
	if url == &amp;quot;&amp;quot; then&lt;br /&gt;
		local prop856 = mw.wikibase.getBestStatements(qid, &amp;quot;P856&amp;quot;)&lt;br /&gt;
		for k, v in pairs(prop856) do&lt;br /&gt;
			if v.mainsnak.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
				urls[#urls+1] = v.mainsnak.datavalue.value&lt;br /&gt;
				if v.qualifiers and v.qualifiers[&amp;quot;P1065&amp;quot;] then&lt;br /&gt;
					 -- just take the first archive url (P1065)&lt;br /&gt;
					local au = v.qualifiers[&amp;quot;P1065&amp;quot;][1]&lt;br /&gt;
					if au.snaktype == &amp;quot;value&amp;quot; then&lt;br /&gt;
						quals[#urls] = au.datavalue.value&lt;br /&gt;
					end -- test for archive url having a value&lt;br /&gt;
				end -- test for qualifers&lt;br /&gt;
			end -- test for website having a value&lt;br /&gt;
		end -- loop through website(s)&lt;br /&gt;
	else&lt;br /&gt;
		urls[1] = url&lt;br /&gt;
	end&lt;br /&gt;
	if #urls == 0 then return nil end&lt;br /&gt;
&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for i, u in ipairs(urls) do&lt;br /&gt;
		local link = quals[i] or u&lt;br /&gt;
		local prot, addr = u:match(&amp;quot;(http[s]*://)(.+)&amp;quot;)&lt;br /&gt;
		addr = addr or u&lt;br /&gt;
		local disp, n = addr:gsub(&amp;quot;%.&amp;quot;, &amp;quot;&amp;lt;wbr/&amp;gt;%.&amp;quot;)&lt;br /&gt;
		out[#out+1] = '&amp;lt;span class=&amp;quot;url&amp;quot;&amp;gt;[' .. link .. &amp;quot; &amp;quot; .. disp .. &amp;quot;]&amp;lt;/span&amp;gt;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local langcode = findLang(frame.args.lang).code&lt;br /&gt;
	local noicon = parseParam(frame.args.noicon, false)&lt;br /&gt;
	if url == &amp;quot;&amp;quot; and not noicon then&lt;br /&gt;
		out[#out] = out[#out] .. createicon(langcode, qid, &amp;quot;P856&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = &amp;quot;&amp;quot;&lt;br /&gt;
	if #out &amp;gt; 1 then&lt;br /&gt;
		ret = mw.getCurrentFrame():expandTemplate{title = &amp;quot;ubl&amp;quot;, args = out}&lt;br /&gt;
	else&lt;br /&gt;
		ret = out[1]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAllLabels fetches the set of labels and formats it for display as wikitext.&lt;br /&gt;
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAllLabels = function(frame)&lt;br /&gt;
	local args = frame.args or frame:getParent().args or {}&lt;br /&gt;
&lt;br /&gt;
	local qid = args.qid&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = nil end&lt;br /&gt;
&lt;br /&gt;
	local entity = mw.wikibase.getEntity(qid)&lt;br /&gt;
	if not entity then return i18n[&amp;quot;entity-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local labels = entity.labels&lt;br /&gt;
	if not labels then return i18n[&amp;quot;labels-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k, v in pairs(labels) do&lt;br /&gt;
		out[#out+1] = v.value .. &amp;quot; (&amp;quot; .. v.language .. &amp;quot;)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(out, &amp;quot;; &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAllDescriptions fetches the set of descriptions and formats it for display as wikitext.&lt;br /&gt;
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAllDescriptions = function(frame)&lt;br /&gt;
	local args = frame.args or frame:getParent().args or {}&lt;br /&gt;
&lt;br /&gt;
	local qid = args.qid&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = nil end&lt;br /&gt;
&lt;br /&gt;
	local entity = mw.wikibase.getEntity(qid)&lt;br /&gt;
	if not entity then return i18n[&amp;quot;entity-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local descriptions = entity.descriptions&lt;br /&gt;
	if not descriptions then return i18n[&amp;quot;descriptions-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k, v in pairs(descriptions) do&lt;br /&gt;
		out[#out+1] = v.value .. &amp;quot; (&amp;quot; .. v.language .. &amp;quot;)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(out, &amp;quot;; &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getAllAliases fetches the set of aliases and formats it for display as wikitext.&lt;br /&gt;
-- It takes a parameter 'qid' for arbitrary access, otherwise it uses the current page.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.getAllAliases = function(frame)&lt;br /&gt;
	local args = frame.args or frame:getParent().args or {}&lt;br /&gt;
&lt;br /&gt;
	local qid = args.qid&lt;br /&gt;
	if qid == &amp;quot;&amp;quot; then qid = nil end&lt;br /&gt;
&lt;br /&gt;
	local entity = mw.wikibase.getEntity(qid)&lt;br /&gt;
	if not entity then return i18n[&amp;quot;entity-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local aliases = entity.aliases&lt;br /&gt;
	if not aliases then return i18n[&amp;quot;aliases-not-found&amp;quot;] end&lt;br /&gt;
&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k1, v1 in pairs(aliases) do&lt;br /&gt;
		local lang = v1[1].language&lt;br /&gt;
		local val = {}&lt;br /&gt;
		for k1, v2 in ipairs(v1) do&lt;br /&gt;
			val[#val+1] = v2.value&lt;br /&gt;
		end&lt;br /&gt;
		out[#out+1] = table.concat(val, &amp;quot;, &amp;quot;) .. &amp;quot; (&amp;quot; .. lang .. &amp;quot;)&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(out, &amp;quot;; &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- showNoLinks displays the article titles that should not be linked.&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- Dependencies: none&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
p.showNoLinks = function(frame)&lt;br /&gt;
	local out = {}&lt;br /&gt;
	for k, v in pairs(donotlink) do&lt;br /&gt;
		out[#out+1] = k&lt;br /&gt;
	end&lt;br /&gt;
	table.sort( out )&lt;br /&gt;
	return table.concat(out, &amp;quot;; &amp;quot;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- checkValidity checks whether the first unknown parameter represents a valid entity-id,&lt;br /&gt;
-- that is, something like Q1235 or P123.&lt;br /&gt;
-- It returns the strings &amp;quot;true&amp;quot; or &amp;quot;false&amp;quot;.&lt;br /&gt;
-- Change false to nil to return &amp;quot;true&amp;quot; or &amp;quot;&amp;quot; (easier to test with #if:).&lt;br /&gt;
function p.checkValidity(frame)&lt;br /&gt;
	local id = mw.text.trim(frame.args[1] or &amp;quot;&amp;quot;)&lt;br /&gt;
	if mw.wikibase.isValidEntityId(id) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- List of exported functions&lt;br /&gt;
-------------------------------------------------------------------------------&lt;br /&gt;
-- getValue&lt;br /&gt;
-- getPreferredValue&lt;br /&gt;
-- getCoords&lt;br /&gt;
-- getQualifierValue&lt;br /&gt;
-- getValueByQual&lt;br /&gt;
-- getValueByLang&lt;br /&gt;
-- getLink&lt;br /&gt;
-- getLabel&lt;br /&gt;
-- getAT&lt;br /&gt;
-- getDescription&lt;br /&gt;
-- getAliases&lt;br /&gt;
-- pageId&lt;br /&gt;
-- formatDate&lt;br /&gt;
-- location&lt;br /&gt;
-- checkBlacklist&lt;br /&gt;
-- emptyor&lt;br /&gt;
-- labelorid&lt;br /&gt;
-- getLang&lt;br /&gt;
-- findLanguage&lt;br /&gt;
-- getQID&lt;br /&gt;
-- followQid&lt;br /&gt;
-- siteID&lt;br /&gt;
-- projID&lt;br /&gt;
-- formatNumber&lt;br /&gt;
-- examine&lt;br /&gt;
-- checkvalue&lt;br /&gt;
-- url2&lt;br /&gt;
-- getWebsite&lt;br /&gt;
-- getAllLabels&lt;br /&gt;
-- getAllDescriptions&lt;br /&gt;
-- getAllAliases&lt;br /&gt;
-------------------------------------------------------------------------------&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:WikidataIB/nolinks&amp;diff=4673</id>
		<title>Module:WikidataIB/nolinks</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:WikidataIB/nolinks&amp;diff=4673"/>
				<updated>2019-03-18T12:11:02Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p ={}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
The values here are the English sitelinks for items that should not be linked.&lt;br /&gt;
These 36 are not definitive and may be altered to suit.&lt;br /&gt;
--]]&lt;br /&gt;
p.items = {&lt;br /&gt;
	&amp;quot;Australia&amp;quot;,&lt;br /&gt;
	&amp;quot;Austria&amp;quot;,&lt;br /&gt;
	&amp;quot;Belgium&amp;quot;,&lt;br /&gt;
	&amp;quot;Canada&amp;quot;,&lt;br /&gt;
	&amp;quot;China&amp;quot;,&lt;br /&gt;
	&amp;quot;Denmark&amp;quot;,&lt;br /&gt;
	&amp;quot;England&amp;quot;,&lt;br /&gt;
	&amp;quot;France&amp;quot;,&lt;br /&gt;
	&amp;quot;Germany&amp;quot;,&lt;br /&gt;
	&amp;quot;Greece&amp;quot;,&lt;br /&gt;
	&amp;quot;Hungary&amp;quot;,&lt;br /&gt;
	&amp;quot;Iceland&amp;quot;,&lt;br /&gt;
	&amp;quot;India&amp;quot;,&lt;br /&gt;
	&amp;quot;Republic of Ireland&amp;quot;,&lt;br /&gt;
	&amp;quot;Israel&amp;quot;,&lt;br /&gt;
	&amp;quot;Italy&amp;quot;,&lt;br /&gt;
	&amp;quot;Jamaica&amp;quot;,&lt;br /&gt;
	&amp;quot;Japan&amp;quot;,&lt;br /&gt;
	&amp;quot;Luxembourg&amp;quot;,&lt;br /&gt;
	&amp;quot;Mexico&amp;quot;,&lt;br /&gt;
	&amp;quot;Netherlands&amp;quot;,&lt;br /&gt;
	&amp;quot;New Zealand&amp;quot;,&lt;br /&gt;
	&amp;quot;Northern Ireland&amp;quot;,&lt;br /&gt;
	&amp;quot;Norway&amp;quot;,&lt;br /&gt;
	&amp;quot;Poland&amp;quot;,&lt;br /&gt;
	&amp;quot;Portugal&amp;quot;,&lt;br /&gt;
	&amp;quot;Russia&amp;quot;,&lt;br /&gt;
	&amp;quot;Scotland&amp;quot;,&lt;br /&gt;
	&amp;quot;South Africa&amp;quot;,&lt;br /&gt;
	&amp;quot;Spain&amp;quot;,&lt;br /&gt;
	&amp;quot;Sweden&amp;quot;,&lt;br /&gt;
	&amp;quot;Switzerland&amp;quot;,&lt;br /&gt;
	&amp;quot;Turkey&amp;quot;,&lt;br /&gt;
	&amp;quot;United Kingdom&amp;quot;,&lt;br /&gt;
	&amp;quot;UK&amp;quot;,&lt;br /&gt;
	&amp;quot;United States&amp;quot;,&lt;br /&gt;
	&amp;quot;USA&amp;quot;,&lt;br /&gt;
	&amp;quot;Wales&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This provides a convenient way to create a test whether an item is on the list.&lt;br /&gt;
--]]&lt;br /&gt;
p.itemsindex = {}&lt;br /&gt;
for i, v in ipairs(p.items) do&lt;br /&gt;
	p.itemsindex[v] = true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Str_endswith&amp;diff=4665</id>
		<title>Module:Str endswith</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Str_endswith&amp;diff=4665"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{str endswith}}.&lt;br /&gt;
&lt;br /&gt;
local TRUE_STRING = 'yes'&lt;br /&gt;
local FALSE_STRING = ''&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function trim(s)&lt;br /&gt;
	return s:match('^%s*(.-)%s*$')&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = frame:getParent().args&lt;br /&gt;
	local s = args[1]&lt;br /&gt;
	local pattern = args[2]&lt;br /&gt;
	if not s or not pattern then&lt;br /&gt;
		-- TRUE_STRING is not the natural choice here, but is needed for&lt;br /&gt;
		-- backwards compatibility.&lt;br /&gt;
		return TRUE_STRING&lt;br /&gt;
	end&lt;br /&gt;
	s = trim(s)&lt;br /&gt;
	pattern = trim(pattern)&lt;br /&gt;
	if pattern == '' then&lt;br /&gt;
		-- All strings end with the empty string.&lt;br /&gt;
		return TRUE_STRING&lt;br /&gt;
	end&lt;br /&gt;
	if mw.ustring.sub(s, 0 - mw.ustring.len(pattern), -1) == pattern then&lt;br /&gt;
		return TRUE_STRING&lt;br /&gt;
	else&lt;br /&gt;
		return FALSE_STRING&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Str_endswith&amp;diff=4653</id>
		<title>Template:Str endswith</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Str_endswith&amp;diff=4653"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:Str endswith|main}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Strong&amp;diff=4655</id>
		<title>Template:Strong</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Strong&amp;diff=4655"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;strong {{#if:{{{role|}}}|role=&amp;quot;{{{role}}}&amp;quot;}} {{#if:{{{class|}}}|class=&amp;quot;{{{class}}}&amp;quot;}} {{#if:{{{id|}}}|id=&amp;quot;{{{id}}}&amp;quot;}} {{#if:{{{style|}}}|style=&amp;quot;{{{style}}}&amp;quot;}} {{#if:{{{title|}}}|title=&amp;quot;{{{title}}}&amp;quot;}}&amp;gt;{{{1}}}&amp;lt;/strong&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add cats and interwikis to the /doc subpage, not here! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Tnull&amp;diff=4657</id>
		<title>Template:Tnull</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Tnull&amp;diff=4657"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;&amp;amp;#123;&amp;amp;#123;{{#if:{{{1|}}}|{{{1}}}| tnull&amp;amp;#124;...}}{{#if:{{{2|}}}|&amp;amp;#124;{{{2}}}|}}{{#if:{{{3|}}}|&amp;amp;#124;{{{3}}}|}}{{#if:{{{4|}}}|&amp;amp;#124;{{{4}}}|}}{{#if:{{{5|}}}|&amp;amp;#124;{{{5}}}|}}{{#if:{{{6|}}}|&amp;amp;#124;{{{6}}}|}}{{#if:{{{7|}}}|&amp;amp;#124;{{{7}}}|}}{{#if:{{{8|}}}|&amp;amp;#124;{{{8}}}|}}{{#if:{{{9|}}}|&amp;amp;#124;{{{9}}}|}}{{#if:{{{10|}}}|&amp;amp;#124;{{{10}}}|}}{{#if:{{{11|}}}|&amp;amp;#124;{{{11}}}|}}&amp;amp;#125;&amp;amp;#125;&amp;lt;/code&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Warning&amp;diff=4659</id>
		<title>Template:Warning</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Warning&amp;diff=4659"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Mbox&lt;br /&gt;
| name       = Warning&lt;br /&gt;
| demospace  = {{{demospace|}}}&lt;br /&gt;
| style      = {{#if:{{{style|}}} |{{#if:{{{small|}}}||width:80%;}} {{{style}}} }}&lt;br /&gt;
| subst      = &amp;lt;includeonly&amp;gt;{{subst:substcheck}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
| type       = content&lt;br /&gt;
| image      = {{#if:{{{image|}}}| [[File:{{{image}}}|40px|Warning]] }}&lt;br /&gt;
| small      = {{{small|}}}&lt;br /&gt;
| smallimage = {{#if:{{{image|}}}| [[File:{{{image}}}|30px|Warning]]}}&lt;br /&gt;
| imageright = {{#if:{{{imageright|}}} |{{{imageright}}} |{{#if:{{{shortcut|{{{shortcut1|}}}}}} |{{Ombox/shortcut|{{{shortcut|{{{shortcut1|}}}}}}|{{{shortcut2|}}}|{{{shortcut3|}}}|{{{shortcut4|}}}|{{{shortcut5|}}}}}}} }}&lt;br /&gt;
| textstyle  = {{{textstyle|text-align: {{#if:{{{center|}}}|center|{{{align|left}}}}};}}}&lt;br /&gt;
| text       = {{#if:{{{header|{{{heading|{{{title|}}}}}}}}} |&amp;lt;div style=&amp;quot;{{{headstyle|text-align: {{#if:{{{center|}}}|center|left}};}}}&amp;quot;&amp;gt;'''{{{header|{{{heading|{{{title|}}}}}}}}}'''&amp;lt;/div&amp;gt;}}&amp;lt;!--&lt;br /&gt;
            --&amp;gt;{{{text|{{{content|{{{reason|{{{1}}}}}}}}}}}}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage; interwikis go to Wikidata. --&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Wikidata_entity_link&amp;diff=4661</id>
		<title>Template:Wikidata entity link</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Wikidata_entity_link&amp;diff=4661"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#if: {{{1|}}}&lt;br /&gt;
| {{#switch: {{uc:{{padleft:|1|{{#if:1|{{{1}}}}}}}}}&lt;br /&gt;
  | P = [[d:Property:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} &amp;lt;small&amp;gt;({{#if:1|{{{1}}}}})&amp;lt;/small&amp;gt;]]&lt;br /&gt;
  | Q = [[d:{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|{{{1}}}}} &amp;lt;small&amp;gt;({{#if:1|{{{1}}}}})&amp;lt;/small&amp;gt;]]&lt;br /&gt;
  | #default = [[d:Q{{#if:1|{{{1}}}}}|{{#invoke:Wikibase|label|Q{{#if:1|{{{1}}}}}}} &amp;lt;small&amp;gt;(Q{{#if:1|{{{1|}}}}})&amp;lt;/small&amp;gt;]]&lt;br /&gt;
  }}&lt;br /&gt;
| {{#ifeq: {{#invoke:Wikibase|id}} | no entity&lt;br /&gt;
  | &amp;lt;small&amp;gt;(no entity)&amp;lt;/small&amp;gt;&lt;br /&gt;
  | [[d:{{#invoke:Wikibase|id}}|{{#invoke:Wikibase|label}} &amp;lt;small&amp;gt;({{#invoke:Wikibase|id}})&amp;lt;/small&amp;gt;]]&lt;br /&gt;
  }}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Math&amp;diff=4663</id>
		<title>Module:Math</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Math&amp;diff=4663"/>
				<updated>2019-03-18T12:11:01Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[&lt;br /&gt;
&lt;br /&gt;
This module provides a number of basic mathematical operations.&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local yesno, getArgs -- lazily initialized&lt;br /&gt;
&lt;br /&gt;
local p = {} -- Holds functions to be returned from #invoke, and functions to make available to other Lua modules.&lt;br /&gt;
local wrap = {} -- Holds wrapper functions that process arguments from #invoke. These act as intemediary between functions meant for #invoke and functions meant for Lua.&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper functions used to avoid redundant code.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local function err(msg)&lt;br /&gt;
	-- Generates wikitext error messages.&lt;br /&gt;
	return mw.ustring.format('&amp;lt;strong class=&amp;quot;error&amp;quot;&amp;gt;Formatting error: %s&amp;lt;/strong&amp;gt;', msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function unpackNumberArgs(args)&lt;br /&gt;
	-- Returns an unpacked list of arguments specified with numerical keys.&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == 'number' then&lt;br /&gt;
			table.insert(ret, v)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return unpack(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeArgArray(...)&lt;br /&gt;
	-- Makes an array of arguments from a list of arguments that might include nils.&lt;br /&gt;
	local args = {...} -- Table of arguments. It might contain nils or non-number values, so we can't use ipairs.&lt;br /&gt;
	local nums = {} -- Stores the numbers of valid numerical arguments.&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		v = p._cleanNumber(v)&lt;br /&gt;
		if v then&lt;br /&gt;
			nums[#nums + 1] = k&lt;br /&gt;
			args[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(nums)&lt;br /&gt;
	for i, num in ipairs(nums) do&lt;br /&gt;
		ret[#ret + 1] = args[num]&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function fold(func, ...)&lt;br /&gt;
	-- Use a function on all supplied arguments, and return the result. The function must accept two numbers as parameters,&lt;br /&gt;
	-- and must return a number as an output. This number is then supplied as input to the next function call.&lt;br /&gt;
	local vals = makeArgArray(...)	&lt;br /&gt;
	local count = #vals -- The number of valid arguments&lt;br /&gt;
	if count == 0 then return&lt;br /&gt;
		-- Exit if we have no valid args, otherwise removing the first arg would cause an error.&lt;br /&gt;
		nil, 0&lt;br /&gt;
	end &lt;br /&gt;
	local ret = table.remove(vals, 1)&lt;br /&gt;
	for _, val in ipairs(vals) do&lt;br /&gt;
		ret = func(ret, val)&lt;br /&gt;
	end&lt;br /&gt;
	return ret, count&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Fold arguments by selectively choosing values (func should return when to choose the current &amp;quot;dominant&amp;quot; value).&lt;br /&gt;
]]&lt;br /&gt;
local function binary_fold(func, ...)&lt;br /&gt;
	local value = fold((function(a, b) if func(a, b) then return a else return b end end), ...)&lt;br /&gt;
	return value&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
random&lt;br /&gt;
&lt;br /&gt;
Generate a random number&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke: Math | random }}&lt;br /&gt;
{{#invoke: Math | random | maximum value }}&lt;br /&gt;
{{#invoke: Math | random | minimum value | maximum value }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.random(args)&lt;br /&gt;
	local first = p._cleanNumber(args[1])&lt;br /&gt;
	local second = p._cleanNumber(args[2])&lt;br /&gt;
	return p._random(first, second)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._random(first, second)&lt;br /&gt;
	math.randomseed(mw.site.stats.edits + mw.site.stats.pages + os.time() + math.floor(os.clock() * 1000000000))&lt;br /&gt;
	-- math.random will throw an error if given an explicit nil parameter, so we need to use if statements to check the params.&lt;br /&gt;
	if first and second then&lt;br /&gt;
		if first &amp;lt;= second then -- math.random doesn't allow the first number to be greater than the second.&lt;br /&gt;
			return math.random(first, second)&lt;br /&gt;
		end&lt;br /&gt;
	elseif first then&lt;br /&gt;
		return math.random(first)&lt;br /&gt;
	else&lt;br /&gt;
		return math.random()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
order&lt;br /&gt;
&lt;br /&gt;
Determine order of magnitude of a number&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke: Math | order | value }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.order(args)&lt;br /&gt;
	local input_string = (args[1] or args.x or '0');&lt;br /&gt;
	local input_number = p._cleanNumber(input_string);&lt;br /&gt;
	if input_number == nil then&lt;br /&gt;
		return err('order of magnitude input appears non-numeric')&lt;br /&gt;
	else&lt;br /&gt;
		return p._order(input_number)&lt;br /&gt;
	end    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._order(x)&lt;br /&gt;
	if x == 0 then return 0 end&lt;br /&gt;
	return math.floor(math.log10(math.abs(x)))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
precision&lt;br /&gt;
&lt;br /&gt;
Detemines the precision of a number using the string representation&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{ #invoke: Math | precision | value }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.precision(args)&lt;br /&gt;
	local input_string = (args[1] or args.x or '0');&lt;br /&gt;
	local trap_fraction = args.check_fraction;&lt;br /&gt;
	local input_number;&lt;br /&gt;
&lt;br /&gt;
	if not yesno then&lt;br /&gt;
		yesno = require('Module:Yesno')&lt;br /&gt;
	end&lt;br /&gt;
	if yesno(trap_fraction, true) then -- Returns true for all input except nil, false, &amp;quot;no&amp;quot;, &amp;quot;n&amp;quot;, &amp;quot;0&amp;quot; and a few others. See [[Module:Yesno]].&lt;br /&gt;
		local pos = string.find(input_string, '/', 1, true);&lt;br /&gt;
		if pos ~= nil then&lt;br /&gt;
			if string.find(input_string, '/', pos + 1, true) == nil then&lt;br /&gt;
				local denominator = string.sub(input_string, pos+1, -1);&lt;br /&gt;
				local denom_value = tonumber(denominator);&lt;br /&gt;
				if denom_value ~= nil then&lt;br /&gt;
					return math.log10(denom_value);&lt;br /&gt;
				end&lt;br /&gt;
			end                        &lt;br /&gt;
		end&lt;br /&gt;
	end    &lt;br /&gt;
&lt;br /&gt;
	input_number, input_string = p._cleanNumber(input_string);&lt;br /&gt;
	if input_string == nil then&lt;br /&gt;
		return err('precision input appears non-numeric')&lt;br /&gt;
	else&lt;br /&gt;
		return p._precision(input_string)&lt;br /&gt;
	end    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._precision(x)&lt;br /&gt;
	if type(x) == 'number' then&lt;br /&gt;
		x = tostring(x)&lt;br /&gt;
	end&lt;br /&gt;
	x = string.upper(x)&lt;br /&gt;
&lt;br /&gt;
	local decimal = x:find('%.')&lt;br /&gt;
	local exponent_pos = x:find('E')&lt;br /&gt;
	local result = 0;&lt;br /&gt;
&lt;br /&gt;
	if exponent_pos ~= nil then&lt;br /&gt;
		local exponent = string.sub(x, exponent_pos + 1)&lt;br /&gt;
		x = string.sub(x, 1, exponent_pos - 1)&lt;br /&gt;
		result = result - tonumber(exponent)&lt;br /&gt;
	end    &lt;br /&gt;
&lt;br /&gt;
	if decimal ~= nil then&lt;br /&gt;
		result = result + string.len(x) - decimal&lt;br /&gt;
		return result&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local pos = string.len(x);&lt;br /&gt;
	while x:byte(pos) == string.byte('0') do&lt;br /&gt;
		pos = pos - 1&lt;br /&gt;
		result = result - 1&lt;br /&gt;
		if pos &amp;lt;= 0 then&lt;br /&gt;
			return 0&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
max&lt;br /&gt;
&lt;br /&gt;
Finds the maximum argument&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math| max | value1 | value2 | ... }}&lt;br /&gt;
&lt;br /&gt;
Note, any values that do not evaluate to numbers are ignored.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.max(args)&lt;br /&gt;
	return p._max(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._max(...)&lt;br /&gt;
	local max_value = binary_fold((function(a, b) return a &amp;gt; b end), ...)&lt;br /&gt;
	if max_value then&lt;br /&gt;
		return max_value&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
median&lt;br /&gt;
&lt;br /&gt;
Find the median of set of numbers&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math | median | number1 | number2 | ...}}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:Math | median }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.median(args)&lt;br /&gt;
	return p._median(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._median(...)&lt;br /&gt;
	local vals = makeArgArray(...)	&lt;br /&gt;
	local count = #vals&lt;br /&gt;
	table.sort(vals)&lt;br /&gt;
	&lt;br /&gt;
	if count == 0 then&lt;br /&gt;
		return 0&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if p._mod(count, 2) == 0 then&lt;br /&gt;
		return (vals[count/2] + vals[count/2+1])/2&lt;br /&gt;
	else&lt;br /&gt;
		return vals[math.ceil(count/2)]&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
min &lt;br /&gt;
&lt;br /&gt;
Finds the minimum argument&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math| min | value1 | value2 | ... }}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:Math| min }}&lt;br /&gt;
&lt;br /&gt;
When used with no arguments, it takes its input from the parent&lt;br /&gt;
frame.  Note, any values that do not evaluate to numbers are ignored.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.min(args)&lt;br /&gt;
	return p._min(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._min(...)&lt;br /&gt;
	local min_value = binary_fold((function(a, b) return a &amp;lt; b end), ...)&lt;br /&gt;
	if min_value then&lt;br /&gt;
		return min_value&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
sum &lt;br /&gt;
&lt;br /&gt;
Finds the sum&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math| sum | value1 | value2 | ... }}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:Math| sum }}&lt;br /&gt;
&lt;br /&gt;
Note, any values that do not evaluate to numbers are ignored.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.sum(args)&lt;br /&gt;
	return p._sum(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._sum(...)&lt;br /&gt;
	local sums, count = fold((function(a, b) return a + b end), ...)&lt;br /&gt;
	if not sums then&lt;br /&gt;
		return 0&lt;br /&gt;
	else&lt;br /&gt;
		return sums&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
average &lt;br /&gt;
&lt;br /&gt;
Finds the average&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math| average | value1 | value2 | ... }}&lt;br /&gt;
OR&lt;br /&gt;
{{#invoke:Math| average }}&lt;br /&gt;
&lt;br /&gt;
Note, any values that do not evaluate to numbers are ignored.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.average(args)&lt;br /&gt;
	return p._average(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._average(...)&lt;br /&gt;
	local sum, count = fold((function(a, b) return a + b end), ...)&lt;br /&gt;
	if not sum then&lt;br /&gt;
		return 0&lt;br /&gt;
	else&lt;br /&gt;
		return sum / count&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
round&lt;br /&gt;
&lt;br /&gt;
Rounds a number to specified precision&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math | round | value | precision }}&lt;br /&gt;
&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
function wrap.round(args)&lt;br /&gt;
	local value = p._cleanNumber(args[1] or args.value or 0)&lt;br /&gt;
	local precision = p._cleanNumber(args[2] or args.precision or 0)&lt;br /&gt;
	if value == nil or precision == nil then&lt;br /&gt;
		return err('round input appears non-numeric')&lt;br /&gt;
	else&lt;br /&gt;
		return p._round(value, precision)&lt;br /&gt;
	end    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._round(value, precision)&lt;br /&gt;
	local rescale = math.pow(10, precision or 0);&lt;br /&gt;
	return math.floor(value * rescale + 0.5) / rescale;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
log10&lt;br /&gt;
&lt;br /&gt;
returns the log (base 10) of a number&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math | log10 | x }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.log10(args)&lt;br /&gt;
	return math.log10(args[1])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
mod&lt;br /&gt;
&lt;br /&gt;
Implements the modulo operator&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math | mod | x | y }}&lt;br /&gt;
&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
function wrap.mod(args)&lt;br /&gt;
	local x = p._cleanNumber(args[1])&lt;br /&gt;
	local y = p._cleanNumber(args[2])&lt;br /&gt;
	if not x then&lt;br /&gt;
		return err('first argument to mod appears non-numeric')&lt;br /&gt;
	elseif not y then&lt;br /&gt;
		return err('second argument to mod appears non-numeric')&lt;br /&gt;
	else&lt;br /&gt;
		return p._mod(x, y)&lt;br /&gt;
	end    &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._mod(x, y)&lt;br /&gt;
	local ret = x % y&lt;br /&gt;
	if not (0 &amp;lt;= ret and ret &amp;lt; y) then&lt;br /&gt;
		ret = 0&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
gcd&lt;br /&gt;
&lt;br /&gt;
Calculates the greatest common divisor of multiple numbers&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke:Math | gcd | value 1 | value 2 | value 3 | ... }}&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
function wrap.gcd(args)&lt;br /&gt;
	return p._gcd(unpackNumberArgs(args))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._gcd(...)&lt;br /&gt;
	local function findGcd(a, b)&lt;br /&gt;
		local r = b&lt;br /&gt;
		local oldr = a&lt;br /&gt;
		while r ~= 0 do&lt;br /&gt;
			local quotient = math.floor(oldr / r)&lt;br /&gt;
			oldr, r = r, oldr - quotient * r&lt;br /&gt;
		end&lt;br /&gt;
		if oldr &amp;lt; 0 then&lt;br /&gt;
			oldr = oldr * -1&lt;br /&gt;
		end&lt;br /&gt;
		return oldr&lt;br /&gt;
	end&lt;br /&gt;
	local result, count = fold(findGcd, ...)&lt;br /&gt;
	return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
precision_format&lt;br /&gt;
&lt;br /&gt;
Rounds a number to the specified precision and formats according to rules &lt;br /&gt;
originally used for {{template:Rnd}}.  Output is a string.&lt;br /&gt;
&lt;br /&gt;
Usage:&lt;br /&gt;
{{#invoke: Math | precision_format | number | precision }}&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function wrap.precision_format(args)&lt;br /&gt;
	local value_string = args[1] or 0&lt;br /&gt;
	local precision = args[2] or 0&lt;br /&gt;
	return p._precision_format(value_string, precision)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._precision_format(value_string, precision)&lt;br /&gt;
	-- For access to Mediawiki built-in formatter.&lt;br /&gt;
	local lang = mw.getContentLanguage();&lt;br /&gt;
&lt;br /&gt;
	local value&lt;br /&gt;
	value, value_string = p._cleanNumber(value_string)&lt;br /&gt;
	precision = p._cleanNumber(precision)&lt;br /&gt;
&lt;br /&gt;
	-- Check for non-numeric input&lt;br /&gt;
	if value == nil or precision == nil then&lt;br /&gt;
		return err('invalid input when rounding')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local current_precision = p._precision(value)&lt;br /&gt;
	local order = p._order(value)&lt;br /&gt;
&lt;br /&gt;
	-- Due to round-off effects it is neccesary to limit the returned precision under&lt;br /&gt;
	-- some circumstances because the terminal digits will be inaccurately reported.&lt;br /&gt;
	if order + precision &amp;gt;= 14 then&lt;br /&gt;
		orig_precision = p._precision(value_string)&lt;br /&gt;
		if order + orig_precision &amp;gt;= 14 then&lt;br /&gt;
			precision = 13 - order;        &lt;br /&gt;
		end        &lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- If rounding off, truncate extra digits&lt;br /&gt;
	if precision &amp;lt; current_precision then&lt;br /&gt;
		value = p._round(value, precision)&lt;br /&gt;
		current_precision = p._precision(value)&lt;br /&gt;
	end    &lt;br /&gt;
&lt;br /&gt;
	local formatted_num = lang:formatNum(math.abs(value))&lt;br /&gt;
	local sign&lt;br /&gt;
&lt;br /&gt;
	-- Use proper unary minus sign rather than ASCII default&lt;br /&gt;
	if value &amp;lt; 0 then&lt;br /&gt;
		sign = '−'&lt;br /&gt;
	else&lt;br /&gt;
		sign = ''&lt;br /&gt;
	end    &lt;br /&gt;
&lt;br /&gt;
	-- Handle cases requiring scientific notation&lt;br /&gt;
	if string.find(formatted_num, 'E', 1, true) ~= nil or math.abs(order) &amp;gt;= 9 then&lt;br /&gt;
		value = value * math.pow(10, -order)&lt;br /&gt;
		current_precision = current_precision + order&lt;br /&gt;
		precision = precision + order&lt;br /&gt;
		formatted_num = lang:formatNum(math.abs(value))&lt;br /&gt;
	else&lt;br /&gt;
		order = 0;        &lt;br /&gt;
	end&lt;br /&gt;
	formatted_num = sign .. formatted_num&lt;br /&gt;
&lt;br /&gt;
	-- Pad with zeros, if needed    &lt;br /&gt;
	if current_precision &amp;lt; precision then&lt;br /&gt;
		local padding&lt;br /&gt;
		if current_precision &amp;lt;= 0 then&lt;br /&gt;
			if precision &amp;gt; 0 then&lt;br /&gt;
				local zero_sep = lang:formatNum(1.1)&lt;br /&gt;
				formatted_num = formatted_num .. zero_sep:sub(2,2)&lt;br /&gt;
&lt;br /&gt;
				padding = precision&lt;br /&gt;
				if padding &amp;gt; 20 then&lt;br /&gt;
					padding = 20&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				formatted_num = formatted_num .. string.rep('0', padding)&lt;br /&gt;
			end            &lt;br /&gt;
		else                   &lt;br /&gt;
			padding = precision - current_precision&lt;br /&gt;
			if padding &amp;gt; 20 then&lt;br /&gt;
				padding = 20&lt;br /&gt;
			end&lt;br /&gt;
			formatted_num = formatted_num .. string.rep('0', padding)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add exponential notation, if necessary.&lt;br /&gt;
	if order ~= 0 then&lt;br /&gt;
		-- Use proper unary minus sign rather than ASCII default&lt;br /&gt;
		if order &amp;lt; 0 then&lt;br /&gt;
			order = '−' .. lang:formatNum(math.abs(order))&lt;br /&gt;
		else&lt;br /&gt;
			order = lang:formatNum(order)&lt;br /&gt;
		end    &lt;br /&gt;
&lt;br /&gt;
		formatted_num = formatted_num .. '&amp;lt;span style=&amp;quot;margin:0 .15em 0 .25em&amp;quot;&amp;gt;×&amp;lt;/span&amp;gt;10&amp;lt;sup&amp;gt;' .. order .. '&amp;lt;/sup&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return formatted_num&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Helper function that interprets the input numerically.  If the &lt;br /&gt;
input does not appear to be a number, attempts evaluating it as&lt;br /&gt;
a parser functions expression.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function p._cleanNumber(number_string)&lt;br /&gt;
	if type(number_string) == 'number' then&lt;br /&gt;
		-- We were passed a number, so we don't need to do any processing.&lt;br /&gt;
		return number_string, tostring(number_string)&lt;br /&gt;
	elseif type(number_string) ~= 'string' or not number_string:find('%S') then&lt;br /&gt;
		-- We were passed a non-string or a blank string, so exit.&lt;br /&gt;
		return nil, nil;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Attempt basic conversion&lt;br /&gt;
	local number = tonumber(number_string)&lt;br /&gt;
&lt;br /&gt;
	-- If failed, attempt to evaluate input as an expression&lt;br /&gt;
	if number == nil then&lt;br /&gt;
		local success, result = pcall(mw.ext.ParserFunctions.expr, number_string)&lt;br /&gt;
		if success then&lt;br /&gt;
			number = tonumber(result)&lt;br /&gt;
			number_string = tostring(number)&lt;br /&gt;
		else&lt;br /&gt;
			number = nil&lt;br /&gt;
			number_string = nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		number_string = number_string:match(&amp;quot;^%s*(.-)%s*$&amp;quot;) -- String is valid but may contain padding, clean it.&lt;br /&gt;
		number_string = number_string:match(&amp;quot;^%+(.*)$&amp;quot;) or number_string -- Trim any leading + signs.&lt;br /&gt;
		if number_string:find('^%-?0[xX]') then&lt;br /&gt;
			-- Number is using 0xnnn notation to indicate base 16; use the number that Lua detected instead.&lt;br /&gt;
			number_string = tostring(number)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return number, number_string&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Wrapper function that does basic argument processing. This ensures that all functions from #invoke can use either the current&lt;br /&gt;
frame or the parent frame, and it also trims whitespace for all arguments and removes blank arguments.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
local mt = { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		if not getArgs then&lt;br /&gt;
			getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
		end&lt;br /&gt;
		return wrap[k](getArgs(frame))  -- Argument processing is left to Module:Arguments. Whitespace is trimmed and blank arguments are removed.&lt;br /&gt;
	end&lt;br /&gt;
end }&lt;br /&gt;
&lt;br /&gt;
return setmetatable(p, mt)&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Short_description/doc&amp;diff=4643</id>
		<title>Template:Short description/doc</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Short_description/doc&amp;diff=4643"/>
				<updated>2019-03-18T12:11:00Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
{{high risk| ≈ 1025000 }}&lt;br /&gt;
&amp;lt;!--{{Tsh|Short desc|SHD|Brief description|Short-description|Shortdescription}}--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{warning|Please do not use redirects for this template, they cause problems with the short description editing gadget and other maintenance tools. If you use the editing gadget there is no need for redirects. If you need to manually add, use the correct spelling, it is not difficult to remember.}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
This template is intended to hold a short description of a Wikipedia article, which can be edited from within Wikipedia. Eventually all articles should have a short description, either directly by using this template, in which case the short description will be unique to the article, or transcluded in another template, such as a disambiguation template, where a generic short description is adequate for a large class of pages, or in a more complex form such as transcluded in a template like an infobox, where the short description is assembled from data in the infobox. &lt;br /&gt;
&lt;br /&gt;
Automatically generated descriptions within templates should give as a second parameter &amp;quot;noreplace&amp;quot; so they are overridden by any short descriptions manually added to the transcluding article.&lt;br /&gt;
&lt;br /&gt;
Short descriptions are not required in other namespaces, but in some cases may be useful.&lt;br /&gt;
&lt;br /&gt;
Please refer to [[Wikipedia:Short description]] and [[Wikipedia:WikiProject Short descriptions]] for more detailed information.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Probably should be linked to MOS, and this type of information provided there. --&amp;gt;&lt;br /&gt;
The short descriptions should enable a user to recognise the associated article they want from a list of search results. It is not necessarily the same function as the Wikidata description for an item and they do not have to be the same, but some overlap is expected in many cases.&lt;br /&gt;
&lt;br /&gt;
The short description function is to disambiguate not only from current ambiguities, but also from reasonably probable future ambiguities. &lt;br /&gt;
&lt;br /&gt;
{{strong|The short description should concisely state what the article is about}}, not be a list of what it is not about, nor a list of what the reader might be looking for. Keep it short and simple. Avoid specialist terminology. As much detail as is necessary should be provided, no more—avoid listing examples. It will be displayed on mobile view along with other possible hits, and must be intelligible to the lay reader. Content of the short description should be considered part of the article content and should be managed in the same way as any other content. &lt;br /&gt;
&lt;br /&gt;
If the article title alone is sufficient to ensure reliable identification of the desired article, a null value of {{tnull|Short description|none}} may be used. &lt;br /&gt;
&lt;br /&gt;
Perhaps a bot might be used to import the initial short description from Wikidata – or not as preferred. Some Wikidata descriptions may be  unsuitable, and if imported, must be checked for relevance, accuracy and fitness for purpose. Responsibility for such imports lies with the importer.&lt;br /&gt;
&lt;br /&gt;
The idea is that a class can be set to display differently on desktop Wikipedia from how it displays on mobile view. The intention is to bring the short description within the ''immediate'' editing ability of most editors.&lt;br /&gt;
&lt;br /&gt;
Articles using this template can be found in [[:Category:Articles with short description]], which the template automatically sets.&lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
At [[Oxygen therapy]], add the following at the top of the article:&lt;br /&gt;
* {{tnull|Short description|Use of high concentrations of oxygen as medical treatment}}&lt;br /&gt;
or&lt;br /&gt;
* {{tnull|Short description|1{{=}}Use of high concentrations of oxygen as medical treatment}}&lt;br /&gt;
Use the second form if the text of the short description contains an equals sign (=).&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
For testing purposes, the display of this template can be enabled by adding a line to your [[Special:MyPage/common.css]]:&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;CSS&amp;quot; inline&amp;gt;.shortdescription { display:block !important; }&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This can be easily removed or disabled when finished testing.&lt;br /&gt;
&lt;br /&gt;
If you wish to {{em|always}} see short descriptions, you may want a more utilitarian layout, such as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;CSS&amp;quot;&amp;gt;&lt;br /&gt;
.shortdescription {&lt;br /&gt;
  display:block !important;&lt;br /&gt;
  white-space: pre-wrap;&lt;br /&gt;
}&lt;br /&gt;
.shortdescription::before { &lt;br /&gt;
  content: &amp;quot;\A[Short description:\0020&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
.shortdescription::after { &lt;br /&gt;
  content: &amp;quot;]\A&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
There is a test version of this template available as [[Template:Short description/test]] which displays its text by default.&lt;br /&gt;
* {{tnull|Short description/test}} displays the short description if supplied&lt;br /&gt;
* {{tnull|Short description/test}} displays nothing if &amp;lt;code&amp;gt;none&amp;lt;/code&amp;gt; is supplied&lt;br /&gt;
* {{tnull|Short description/test}} displays the description from Wikidata if &amp;lt;code&amp;gt;wikidata&amp;lt;/code&amp;gt; is supplied.&lt;br /&gt;
&lt;br /&gt;
Taking {{Q|Q1096878}} as an example:&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{short description/test|Underwater diving where breathing is from equipment independent of the surface}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{short description/test|Underwater diving where breathing is from equipment independent of the surface }}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{short description/test|none }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{short description/test|none}}&lt;br /&gt;
* &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{short description/test|wikidata }}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; → {{short description/test|wikidata|qid=Q1096878}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
&amp;lt;!-- Category:Articles with short description (maintenance category)? --&amp;gt;&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;1&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: &amp;quot;Description&amp;quot;,&lt;br /&gt;
			&amp;quot;description&amp;quot;: &amp;quot;The short description of the article&amp;quot;,&lt;br /&gt;
			&amp;quot;example&amp;quot;: &amp;quot;Online free encyclopedia anyone can edit&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;pagetype&amp;quot;: {&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;description&amp;quot;: &amp;quot;Creates a short description for a Wikipedia article, which is used in the Visual Editor to provide context on wikilinks.&amp;quot;,&lt;br /&gt;
	&amp;quot;format&amp;quot;: &amp;quot;{{_|_ = _}}\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Short_description/test&amp;diff=4645</id>
		<title>Template:Short description/test</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Short_description/test&amp;diff=4645"/>
				<updated>2019-03-18T12:11:00Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span class=&amp;quot;shortdescription nomobile noexcerpt noprint&amp;quot;&amp;gt;{{#invoke:WikidataIB|getDescription|{{{1|}}}|qid={{{qid|}}}}}&amp;lt;/span&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Sigfig&amp;diff=4647</id>
		<title>Template:Sigfig</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Sigfig&amp;diff=4647"/>
				<updated>2019-03-18T12:11:00Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Template:Significant figures]]&lt;br /&gt;
&lt;br /&gt;
{{Redirect category shell|&lt;br /&gt;
{{R from move}}&lt;br /&gt;
{{R from template shortcut}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Significant_figures&amp;diff=4649</id>
		<title>Template:Significant figures</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Significant_figures&amp;diff=4649"/>
				<updated>2019-03-18T12:11:00Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#ifeq:{{{1&amp;lt;noinclude&amp;gt;|0&amp;lt;/noinclude&amp;gt;}}}|0&lt;br /&gt;
 |0&lt;br /&gt;
 |{{significant figures/{{#if:{{{2|}}}&lt;br /&gt;
   |rnd&lt;br /&gt;
   |sum&lt;br /&gt;
  }}&lt;br /&gt;
  |1={{formatnum:{{{1}}}|R}}&lt;br /&gt;
  |2={{{2}}}&lt;br /&gt;
  |3={{Order of magnitude|{{formatnum:{{{1}}}|R}}}}&lt;br /&gt;
 }}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Significant_figures/rnd&amp;diff=4651</id>
		<title>Template:Significant figures/rnd</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Significant_figures/rnd&amp;diff=4651"/>
				<updated>2019-03-18T12:11:00Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{rnd|{{{1}}}|{{{2}}}-{{{3}}}-1}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{doc|content=&lt;br /&gt;
A rounding subtemplate, it calls {{tl|rnd}}.&lt;br /&gt;
&lt;br /&gt;
Examples:&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||7|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||6|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||5|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||4|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||3|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||2|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||1|||2}}&lt;br /&gt;
*{{xpd5op3p3p3c|d=||||||sigfig/rnd|123.456|||0|||2}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Subtemplates of template sigfig|rnd]]&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Order_of_magnitude&amp;diff=4635</id>
		<title>Template:Order of magnitude</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Order_of_magnitude&amp;diff=4635"/>
				<updated>2019-03-18T12:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#ifexpr:{{{1|0}}}=0&lt;br /&gt;
   |{{{{{|safesubst:}}}#ifexpr:abs{{{1|0}}}1=1&lt;br /&gt;
      |0&lt;br /&gt;
      |{{{{{|safesubst:}}}#expr:floor((ln(abs{{{1}}}1)/ln10)+1)}}&lt;br /&gt;
    }}&lt;br /&gt;
   |{{#expr:floor((ln(abs({{{1|0}}}) )/ln 10)+1E((abs{{{1|0}}}&amp;gt;1E100 or abs{{{1|0}}}&amp;lt;1E-100)-14))}}&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Q&amp;diff=4637</id>
		<title>Template:Q</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Q&amp;diff=4637"/>
				<updated>2019-03-18T12:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Template:Wikidata entity link]]&lt;br /&gt;
{{R from move}}&lt;br /&gt;
[[Category:Wikidata templates]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Rnd&amp;diff=4639</id>
		<title>Template:Rnd</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Rnd&amp;diff=4639"/>
				<updated>2019-03-18T12:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Being deleted|2018 December 14|Template:Rnd|merge=Template:Round}}&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#iferror:{{#expr:{{{2|0}}}}} |&lt;br /&gt;
  [[Category:Pages with bad rounding precision]]{{hid|Bad rounding here}}&amp;lt;!--&lt;br /&gt;
  --&amp;gt;{{#invoke:Math|precision_format| {{{1}}} | 1-{{order of magnitude|{{{1}}}}} }}|&lt;br /&gt;
  {{#invoke:Math|precision_format| {{{1}}} | {{{2|0}}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Sandbox_other&amp;diff=4641</id>
		<title>Template:Sandbox other</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Sandbox_other&amp;diff=4641"/>
				<updated>2019-03-18T12:10:59Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Tfm/dated|page=Sandbox other|otherpage=When in sandbox|link=Wikipedia:Templates for discussion/Log/2019 March 4#Template:Sandbox other|bigbox={{#invoke:Noinclude|noinclude|text=yes}}}}&amp;lt;/noinclude&amp;gt;{{#if:{{#ifeq:{{SUBPAGENAME}}|sandbox|1}}{{#invoke:String|match|{{PAGENAME}}|/sandbox/styles.css$|plain=false|nomatch=}}|{{{1|}}}|{{{2|}}}}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:High-use&amp;diff=4625</id>
		<title>Template:High-use</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:High-use&amp;diff=4625"/>
				<updated>2019-03-18T12:10:58Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Ombox&lt;br /&gt;
| type  = {{#ifeq:{{high-use/risk|{{{1|}}}}}|risk|content|style}}&lt;br /&gt;
| image = {{#ifeq:{{high-use/risk|{{{1|}}}}}|risk|[[File:Ambox warning orange.svg|40px|alt=Warning|link=]]|[[File:Ambox warning yellow.svg|40px|alt=Warning|link=]]}}&lt;br /&gt;
| text  = &lt;br /&gt;
'''This {{#switch:{{NAMESPACE}}|Module=Lua module|#default=template}} is used on [https://tools.wmflabs.org/templatecount/index.php?lang=en&amp;amp;namespace={{NAMESPACENUMBER:{{FULLPAGENAME}}}}&amp;amp;name={{urlencode:{{&lt;br /&gt;
#switch: {{SUBPAGENAME}}&lt;br /&gt;
| doc | sandbox = {{BASEPAGENAME}}&lt;br /&gt;
| #default      = {{PAGENAME}}&lt;br /&gt;
}}}} {{High-use/num|1={{#ifeq:{{{1|}}}|risk|risk|{{formatnum:{{#invoke:String|match|{{{1|}}}|[%d,]+|plain=false}}|R}}}}|2 = {{str endswith|{{{1|}}}|+}}|all-pages={{{all-pages|}}}}} pages]'''{{#ifeq:{{high-use/risk|{{{1|}}}}}|risk|.{{#if:{{{info|}}}|&amp;lt;br /&amp;gt;{{{info}}}}}&amp;lt;br /&amp;gt; To avoid large-scale disruption and unnecessary server load, any changes to it should first be tested |, so changes to it will be widely noticed. Please test any changes}} in the {{#switch:{{NAMESPACE}}|Module=module's|#default=template's}} [[{{#switch: {{SUBPAGENAME}}&lt;br /&gt;
    | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}&lt;br /&gt;
    | #default =      {{SUBJECTPAGENAME}}&lt;br /&gt;
   }}/sandbox|/sandbox]] or [[{{#switch: {{SUBPAGENAME}}&lt;br /&gt;
    | doc | sandbox = {{SUBJECTSPACE}}:{{BASEPAGENAME}}&lt;br /&gt;
    | #default =      {{SUBJECTPAGENAME}}&lt;br /&gt;
   }}/testcases|/testcases]] subpages{{#switch:{{NAMESPACE}}|Module=.|#default=, or in your own [[Wikipedia:Subpages#How to create user subpages|user subpage]].}} {{#ifeq:{{high-use/risk|{{{1|}}}}}|risk|The tested changes can then be added to this page in a single edit.&amp;amp;#x20;}}Please consider discussing changes {{#if:{{{2|}}}|at [[{{{2}}}]]|on the [[{{#switch: {{SUBPAGENAME}}&lt;br /&gt;
    | doc | sandbox = {{TALKSPACE}}:{{BASEPAGENAME}}&lt;br /&gt;
    | #default =      {{TALKPAGENAME}}&lt;br /&gt;
   }}|talk page]]}} before implementing them.&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage; interwiki links go to Wikidata, thank you! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:High-use/num&amp;diff=4627</id>
		<title>Template:High-use/num</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:High-use/num&amp;diff=4627"/>
				<updated>2019-03-18T12:10:58Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#iferror:{{#expr:0+{{{1}}}*1}}|{{#ifeq:{{{1|}}}|risk|a very large number of|many}}|{{#ifeq:{{{2|}}}|yes||approximately&amp;amp;#x20;}}{{sigfig|{{{1}}}|2}}{{#ifeq:{{{2|}}}|yes|+}}{{#if:{{{all-pages|}}}|&amp;amp;#x20;pages, which is ≈{{#expr:({{{1|}}}*100/{{NUMBEROFPAGES:R}}) round 0}}% of all}}}}&amp;lt;noinclude&amp;gt;{{Documentation|content=&lt;br /&gt;
; Examples&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/num|risk}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/num|2450}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/num|2549|yes}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/num|2450|all-pages=yes}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/num|2549|yes|all-pages=yes}}&lt;br /&gt;
}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:High-use/risk&amp;diff=4629</id>
		<title>Template:High-use/risk</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:High-use/risk&amp;diff=4629"/>
				<updated>2019-03-18T12:10:58Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;{{pp-template|small=yes}}&amp;lt;/noinclude&amp;gt;{{#ifeq:{{{1|}}}|risk|risk|{{#ifexpr:{{formatnum:{{#invoke:String|match|{{{1|0}}}|[%d,]+|plain=false}}|R}}&amp;gt;=100000|risk}}}}&amp;lt;noinclude&amp;gt;{{Documentation|content=&lt;br /&gt;
; Examples&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/risk|risk}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/risk|100000}}&lt;br /&gt;
: {{#invoke:DemoTemplate|High-use/risk|99999}}&lt;br /&gt;
}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:High_risk&amp;diff=4631</id>
		<title>Template:High risk</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:High_risk&amp;diff=4631"/>
				<updated>2019-03-18T12:10:58Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Template:High-use]]&lt;br /&gt;
&lt;br /&gt;
{{Redirect category shell|&lt;br /&gt;
{{R from modification}}&lt;br /&gt;
{{R from template shortcut}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Mbox&amp;diff=4633</id>
		<title>Template:Mbox</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Mbox&amp;diff=4633"/>
				<updated>2019-03-18T12:10:58Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:Message box|mbox}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:No_globals&amp;diff=4613</id>
		<title>Module:No globals</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:No_globals&amp;diff=4613"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local mt = getmetatable(_G) or {}&lt;br /&gt;
function mt.__index (t, k)&lt;br /&gt;
	if k ~= 'arg' then&lt;br /&gt;
		error('Tried to read nil global ' .. tostring(k), 2)&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
function mt.__newindex(t, k, v)&lt;br /&gt;
	if k ~= 'arg' then&lt;br /&gt;
		error('Tried to write global ' .. tostring(k), 2)&lt;br /&gt;
	end&lt;br /&gt;
	rawset(t, k, v)&lt;br /&gt;
end&lt;br /&gt;
setmetatable(_G, mt)&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Protection_banner&amp;diff=4615</id>
		<title>Module:Protection banner</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Protection_banner&amp;diff=4615"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{pp-meta}} and its daughter templates such as&lt;br /&gt;
-- {{pp-dispute}}, {{pp-vandalism}} and {{pp-sock}}.&lt;br /&gt;
&lt;br /&gt;
-- Initialise necessary modules.&lt;br /&gt;
require('Module:No globals')&lt;br /&gt;
local makeFileLink = require('Module:File link')._main&lt;br /&gt;
local effectiveProtectionLevel = require('Module:Effective protection level')._main&lt;br /&gt;
local effectiveProtectionExpiry = require('Module:Effective protection expiry')._main&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
-- Lazily initialise modules and objects we don't always need.&lt;br /&gt;
local getArgs, makeMessageBox, lang&lt;br /&gt;
&lt;br /&gt;
-- Set constants.&lt;br /&gt;
local CONFIG_MODULE = 'Module:Protection banner/config'&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	if cat then&lt;br /&gt;
		return string.format(&lt;br /&gt;
			'[[%s:%s|%s]]',&lt;br /&gt;
			mw.site.namespaces[14].name,&lt;br /&gt;
			cat,&lt;br /&gt;
			sort&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Validation function for the expiry and the protection date&lt;br /&gt;
local function validateDate(dateString, dateType)&lt;br /&gt;
	if not lang then&lt;br /&gt;
		lang = mw.language.getContentLanguage()&lt;br /&gt;
	end&lt;br /&gt;
	local success, result = pcall(lang.formatDate, lang, 'U', dateString)&lt;br /&gt;
	if success then&lt;br /&gt;
		result = tonumber(result)&lt;br /&gt;
		if result then&lt;br /&gt;
			return result&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	error(string.format(&lt;br /&gt;
		'invalid %s: %s',&lt;br /&gt;
		dateType,&lt;br /&gt;
		tostring(dateString)&lt;br /&gt;
	), 4)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function makeFullUrl(page, query, display)&lt;br /&gt;
	return string.format(&lt;br /&gt;
		'[%s %s]',&lt;br /&gt;
		tostring(mw.uri.fullUrl(page, query)),&lt;br /&gt;
		display&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Given a directed graph formatted as node -&amp;gt; table of direct successors,&lt;br /&gt;
-- get a table of all nodes reachable from a given node (though always&lt;br /&gt;
-- including the given node).&lt;br /&gt;
local function getReachableNodes(graph, start)&lt;br /&gt;
	local toWalk, retval = {[start] = true}, {}&lt;br /&gt;
	while true do&lt;br /&gt;
		-- Can't use pairs() since we're adding and removing things as we're iterating&lt;br /&gt;
		local k = next(toWalk) -- This always gets the &amp;quot;first&amp;quot; key&lt;br /&gt;
		if k == nil then&lt;br /&gt;
			return retval&lt;br /&gt;
		end&lt;br /&gt;
		toWalk[k] = nil&lt;br /&gt;
		retval[k] = true&lt;br /&gt;
		for _,v in ipairs(graph[k]) do&lt;br /&gt;
			if not retval[v] then&lt;br /&gt;
				toWalk[v] = true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Protection = {}&lt;br /&gt;
Protection.__index = Protection&lt;br /&gt;
&lt;br /&gt;
Protection.supportedActions = {&lt;br /&gt;
	edit = true,&lt;br /&gt;
	move = true,&lt;br /&gt;
	autoreview = true,&lt;br /&gt;
	upload = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Protection.bannerConfigFields = {&lt;br /&gt;
	'text',&lt;br /&gt;
	'explanation',&lt;br /&gt;
	'tooltip',&lt;br /&gt;
	'alt',&lt;br /&gt;
	'link',&lt;br /&gt;
	'image'&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function Protection.new(args, cfg, title)&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	obj._cfg = cfg&lt;br /&gt;
	obj.title = title or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Set action&lt;br /&gt;
	if not args.action then&lt;br /&gt;
		obj.action = 'edit'&lt;br /&gt;
	elseif Protection.supportedActions[args.action] then&lt;br /&gt;
		obj.action = args.action&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			'invalid action: %s',&lt;br /&gt;
			tostring(args.action)&lt;br /&gt;
		), 3)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set level&lt;br /&gt;
	obj.level = args.demolevel or effectiveProtectionLevel(obj.action, obj.title)&lt;br /&gt;
	if not obj.level or (obj.action == 'move' and obj.level == 'autoconfirmed') then&lt;br /&gt;
		-- Users need to be autoconfirmed to move pages anyway, so treat&lt;br /&gt;
		-- semi-move-protected pages as unprotected.&lt;br /&gt;
		obj.level = '*'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set expiry&lt;br /&gt;
	local effectiveExpiry = effectiveProtectionExpiry(obj.action, obj.title)&lt;br /&gt;
	if effectiveExpiry == 'infinity' then&lt;br /&gt;
		obj.expiry = 'indef'&lt;br /&gt;
	elseif effectiveExpiry ~= 'unknown' then&lt;br /&gt;
		obj.expiry = validateDate(effectiveExpiry, 'expiry date')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set reason&lt;br /&gt;
	if args[1] then&lt;br /&gt;
		obj.reason = mw.ustring.lower(args[1])&lt;br /&gt;
		if obj.reason:find('|') then&lt;br /&gt;
			error('reasons cannot contain the pipe character (&amp;quot;|&amp;quot;)', 3)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set protection date&lt;br /&gt;
	if args.date then&lt;br /&gt;
		obj.protectionDate = validateDate(args.date, 'protection date')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Set banner config&lt;br /&gt;
	do&lt;br /&gt;
		obj.bannerConfig = {}&lt;br /&gt;
		local configTables = {}&lt;br /&gt;
		if cfg.banners[obj.action] then&lt;br /&gt;
			configTables[#configTables + 1] = cfg.banners[obj.action][obj.reason]&lt;br /&gt;
		end&lt;br /&gt;
		if cfg.defaultBanners[obj.action] then&lt;br /&gt;
			configTables[#configTables + 1] = cfg.defaultBanners[obj.action][obj.level]&lt;br /&gt;
			configTables[#configTables + 1] = cfg.defaultBanners[obj.action].default&lt;br /&gt;
		end&lt;br /&gt;
		configTables[#configTables + 1] = cfg.masterBanner&lt;br /&gt;
		for i, field in ipairs(Protection.bannerConfigFields) do&lt;br /&gt;
			for j, t in ipairs(configTables) do&lt;br /&gt;
				if t[field] then&lt;br /&gt;
					obj.bannerConfig[field] = t[field]&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return setmetatable(obj, Protection)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isProtected()&lt;br /&gt;
	return self.level ~= '*'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isTemporary()&lt;br /&gt;
	return type(self.expiry) == 'number'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:makeProtectionCategory()&lt;br /&gt;
	local cfg = self._cfg&lt;br /&gt;
	local title = self.title&lt;br /&gt;
	&lt;br /&gt;
	-- Exit if the page is not protected.&lt;br /&gt;
	if not self:isProtected() then&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Get the expiry key fragment.&lt;br /&gt;
	local expiryFragment&lt;br /&gt;
	if self.expiry == 'indef' then&lt;br /&gt;
		expiryFragment = self.expiry&lt;br /&gt;
	elseif type(self.expiry) == 'number' then&lt;br /&gt;
		expiryFragment = 'temp'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get the namespace key fragment.&lt;br /&gt;
	local namespaceFragment = cfg.categoryNamespaceKeys[title.namespace]&lt;br /&gt;
	if not namespaceFragment and title.namespace % 2 == 1 then&lt;br /&gt;
			namespaceFragment = 'talk'&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	-- Define the order that key fragments are tested in. This is done with an&lt;br /&gt;
	-- array of tables containing the value to be tested, along with its&lt;br /&gt;
	-- position in the cfg.protectionCategories table.&lt;br /&gt;
	local order = {&lt;br /&gt;
		{val = expiryFragment,    keypos = 1},&lt;br /&gt;
		{val = namespaceFragment, keypos = 2},&lt;br /&gt;
		{val = self.reason,       keypos = 3},&lt;br /&gt;
		{val = self.level,        keypos = 4},&lt;br /&gt;
		{val = self.action,       keypos = 5}&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- The old protection templates used an ad-hoc protection category system,&lt;br /&gt;
	-- with some templates prioritising namespaces in their categories, and&lt;br /&gt;
	-- others prioritising the protection reason. To emulate this in this module&lt;br /&gt;
	-- we use the config table cfg.reasonsWithNamespacePriority to set the&lt;br /&gt;
	-- reasons for which namespaces have priority over protection reason.&lt;br /&gt;
	-- If we are dealing with one of those reasons, move the namespace table to&lt;br /&gt;
	-- the end of the order table, i.e. give it highest priority. If not, the&lt;br /&gt;
	-- reason should have highest priority, so move that to the end of the table&lt;br /&gt;
	-- instead.&lt;br /&gt;
	--]]&lt;br /&gt;
	table.insert(order, table.remove(order, self.reason and cfg.reasonsWithNamespacePriority[self.reason] and 2 or 3))&lt;br /&gt;
 &lt;br /&gt;
	--[[&lt;br /&gt;
	-- Define the attempt order. Inactive subtables (subtables with nil &amp;quot;value&amp;quot;&lt;br /&gt;
	-- fields) are moved to the end, where they will later be given the key&lt;br /&gt;
	-- &amp;quot;all&amp;quot;. This is to cut down on the number of table lookups in&lt;br /&gt;
	-- cfg.protectionCategories, which grows exponentially with the number of&lt;br /&gt;
	-- non-nil keys. We keep track of the number of active subtables with the&lt;br /&gt;
	-- noActive parameter.&lt;br /&gt;
	--]]&lt;br /&gt;
	local noActive, attemptOrder&lt;br /&gt;
	do&lt;br /&gt;
		local active, inactive = {}, {}&lt;br /&gt;
		for i, t in ipairs(order) do&lt;br /&gt;
			if t.val then&lt;br /&gt;
				active[#active + 1] = t&lt;br /&gt;
			else&lt;br /&gt;
				inactive[#inactive + 1] = t&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		noActive = #active&lt;br /&gt;
		attemptOrder = active&lt;br /&gt;
		for i, t in ipairs(inactive) do&lt;br /&gt;
			attemptOrder[#attemptOrder + 1] = t&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
 &lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check increasingly generic key combinations until we find a match. If a&lt;br /&gt;
	-- specific category exists for the combination of key fragments we are&lt;br /&gt;
	-- given, that match will be found first. If not, we keep trying different&lt;br /&gt;
	-- key fragment combinations until we match using the key&lt;br /&gt;
	-- &amp;quot;all-all-all-all-all&amp;quot;.&lt;br /&gt;
	--&lt;br /&gt;
	-- To generate the keys, we index the key subtables using a binary matrix&lt;br /&gt;
	-- with indexes i and j. j is only calculated up to the number of active&lt;br /&gt;
	-- subtables. For example, if there were three active subtables, the matrix&lt;br /&gt;
	-- would look like this, with 0 corresponding to the key fragment &amp;quot;all&amp;quot;, and&lt;br /&gt;
	-- 1 corresponding to other key fragments.&lt;br /&gt;
	-- &lt;br /&gt;
	--   j 1  2  3&lt;br /&gt;
	-- i  &lt;br /&gt;
	-- 1   1  1  1&lt;br /&gt;
	-- 2   0  1  1&lt;br /&gt;
	-- 3   1  0  1&lt;br /&gt;
	-- 4   0  0  1&lt;br /&gt;
	-- 5   1  1  0&lt;br /&gt;
	-- 6   0  1  0&lt;br /&gt;
	-- 7   1  0  0&lt;br /&gt;
	-- 8   0  0  0&lt;br /&gt;
	-- &lt;br /&gt;
	-- Values of j higher than the number of active subtables are set&lt;br /&gt;
	-- to the string &amp;quot;all&amp;quot;.&lt;br /&gt;
	--&lt;br /&gt;
	-- A key for cfg.protectionCategories is constructed for each value of i.&lt;br /&gt;
	-- The position of the value in the key is determined by the keypos field in&lt;br /&gt;
	-- each subtable.&lt;br /&gt;
	--]]&lt;br /&gt;
	local cats = cfg.protectionCategories&lt;br /&gt;
	for i = 1, 2^noActive do&lt;br /&gt;
		local key = {}&lt;br /&gt;
		for j, t in ipairs(attemptOrder) do&lt;br /&gt;
			if j &amp;gt; noActive then&lt;br /&gt;
				key[t.keypos] = 'all'&lt;br /&gt;
			else&lt;br /&gt;
				local quotient = i / 2 ^ (j - 1)&lt;br /&gt;
				quotient = math.ceil(quotient)&lt;br /&gt;
				if quotient % 2 == 1 then&lt;br /&gt;
					key[t.keypos] = t.val&lt;br /&gt;
				else&lt;br /&gt;
					key[t.keypos] = 'all'&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		key = table.concat(key, '|')&lt;br /&gt;
		local attempt = cats[key]&lt;br /&gt;
		if attempt then&lt;br /&gt;
			return makeCategoryLink(attempt, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isIncorrect()&lt;br /&gt;
	local expiry = self.expiry&lt;br /&gt;
	return not self:isProtected()&lt;br /&gt;
		or type(expiry) == 'number' and expiry &amp;lt; os.time()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:isTemplateProtectedNonTemplate()&lt;br /&gt;
	local action, namespace = self.action, self.title.namespace&lt;br /&gt;
	return self.level == 'templateeditor'&lt;br /&gt;
		and (&lt;br /&gt;
			(action ~= 'edit' and action ~= 'move')&lt;br /&gt;
			or (namespace ~= 10 and namespace ~= 828)&lt;br /&gt;
		)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Protection:makeCategoryLinks()&lt;br /&gt;
	local msg = self._cfg.msg&lt;br /&gt;
	local ret = { self:makeProtectionCategory() }&lt;br /&gt;
	if self:isIncorrect() then&lt;br /&gt;
		ret[#ret + 1] = makeCategoryLink(&lt;br /&gt;
			msg['tracking-category-incorrect'],&lt;br /&gt;
			self.title.text&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	if self:isTemplateProtectedNonTemplate() then&lt;br /&gt;
		ret[#ret + 1] = makeCategoryLink(&lt;br /&gt;
			msg['tracking-category-template'],&lt;br /&gt;
			self.title.text&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
	return table.concat(ret)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Blurb class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Blurb = {}&lt;br /&gt;
Blurb.__index = Blurb&lt;br /&gt;
&lt;br /&gt;
Blurb.bannerTextFields = {&lt;br /&gt;
	text = true,&lt;br /&gt;
	explanation = true,&lt;br /&gt;
	tooltip = true,&lt;br /&gt;
	alt = true,&lt;br /&gt;
	link = true&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function Blurb.new(protectionObj, args, cfg)&lt;br /&gt;
	return setmetatable({&lt;br /&gt;
		_cfg = cfg,&lt;br /&gt;
		_protectionObj = protectionObj,&lt;br /&gt;
		_args = args&lt;br /&gt;
	}, Blurb)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Private methods --&lt;br /&gt;
&lt;br /&gt;
function Blurb:_formatDate(num)&lt;br /&gt;
	-- Formats a Unix timestamp into dd Month, YYYY format.&lt;br /&gt;
	lang = lang or mw.language.getContentLanguage()&lt;br /&gt;
	local success, date = pcall(&lt;br /&gt;
		lang.formatDate,&lt;br /&gt;
		lang,&lt;br /&gt;
		self._cfg.msg['expiry-date-format'] or 'j F Y',&lt;br /&gt;
		'@' .. tostring(num)&lt;br /&gt;
	)&lt;br /&gt;
	if success then&lt;br /&gt;
		return date&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_getExpandedMessage(msgKey)&lt;br /&gt;
	return self:_substituteParameters(self._cfg.msg[msgKey])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_substituteParameters(msg)&lt;br /&gt;
	if not self._params then&lt;br /&gt;
		local parameterFuncs = {}&lt;br /&gt;
&lt;br /&gt;
		parameterFuncs.CURRENTVERSION     = self._makeCurrentVersionParameter&lt;br /&gt;
		parameterFuncs.EDITREQUEST        = self._makeEditRequestParameter&lt;br /&gt;
		parameterFuncs.EXPIRY             = self._makeExpiryParameter&lt;br /&gt;
		parameterFuncs.EXPLANATIONBLURB   = self._makeExplanationBlurbParameter&lt;br /&gt;
		parameterFuncs.IMAGELINK          = self._makeImageLinkParameter&lt;br /&gt;
		parameterFuncs.INTROBLURB         = self._makeIntroBlurbParameter&lt;br /&gt;
		parameterFuncs.INTROFRAGMENT      = self._makeIntroFragmentParameter&lt;br /&gt;
		parameterFuncs.PAGETYPE           = self._makePagetypeParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONBLURB    = self._makeProtectionBlurbParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONDATE     = self._makeProtectionDateParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONLEVEL    = self._makeProtectionLevelParameter&lt;br /&gt;
		parameterFuncs.PROTECTIONLOG      = self._makeProtectionLogParameter&lt;br /&gt;
		parameterFuncs.TALKPAGE           = self._makeTalkPageParameter&lt;br /&gt;
		parameterFuncs.TOOLTIPBLURB       = self._makeTooltipBlurbParameter&lt;br /&gt;
		parameterFuncs.TOOLTIPFRAGMENT    = self._makeTooltipFragmentParameter&lt;br /&gt;
		parameterFuncs.VANDAL             = self._makeVandalTemplateParameter&lt;br /&gt;
		&lt;br /&gt;
		self._params = setmetatable({}, {&lt;br /&gt;
			__index = function (t, k)&lt;br /&gt;
				local param&lt;br /&gt;
				if parameterFuncs[k] then&lt;br /&gt;
					param = parameterFuncs[k](self)&lt;br /&gt;
				end&lt;br /&gt;
				param = param or ''&lt;br /&gt;
				t[k] = param&lt;br /&gt;
				return param&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	msg = msg:gsub('${(%u+)}', self._params)&lt;br /&gt;
	return msg&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeCurrentVersionParameter()&lt;br /&gt;
	-- A link to the page history or the move log, depending on the kind of&lt;br /&gt;
	-- protection.&lt;br /&gt;
	local pagename = self._protectionObj.title.prefixedText&lt;br /&gt;
	if self._protectionObj.action == 'move' then&lt;br /&gt;
		-- We need the move log link.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			'Special:Log',&lt;br /&gt;
			{type = 'move', page = pagename},&lt;br /&gt;
			self:_getExpandedMessage('current-version-move-display')&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		-- We need the history link.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			pagename,&lt;br /&gt;
			{action = 'history'},&lt;br /&gt;
			self:_getExpandedMessage('current-version-edit-display')&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeEditRequestParameter()&lt;br /&gt;
	local mEditRequest = require('Module:Submit an edit request')&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	&lt;br /&gt;
	-- Get the edit request type.&lt;br /&gt;
	local requestType&lt;br /&gt;
	if action == 'edit' then&lt;br /&gt;
		if level == 'autoconfirmed' then&lt;br /&gt;
			requestType = 'semi'&lt;br /&gt;
		elseif level == 'extendedconfirmed' then&lt;br /&gt;
			requestType = 'extended'&lt;br /&gt;
		elseif level == 'templateeditor' then&lt;br /&gt;
			requestType = 'template'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	requestType = requestType or 'full'&lt;br /&gt;
	&lt;br /&gt;
	-- Get the display value.&lt;br /&gt;
	local display = self:_getExpandedMessage('edit-request-display')&lt;br /&gt;
&lt;br /&gt;
	return mEditRequest._link{type = requestType, display = display}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeExpiryParameter()&lt;br /&gt;
	local expiry = self._protectionObj.expiry&lt;br /&gt;
	if type(expiry) == 'number' then&lt;br /&gt;
		return self:_formatDate(expiry)&lt;br /&gt;
	else&lt;br /&gt;
		return expiry&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeExplanationBlurbParameter()&lt;br /&gt;
	-- Cover special cases first.&lt;br /&gt;
	if self._protectionObj.title.namespace == 8 then&lt;br /&gt;
		-- MediaWiki namespace&lt;br /&gt;
		return self:_getExpandedMessage('explanation-blurb-nounprotect')&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Get explanation blurb table keys&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local talkKey = self._protectionObj.title.isTalkPage and 'talk' or 'subject'&lt;br /&gt;
&lt;br /&gt;
	-- Find the message in the explanation blurb table and substitute any&lt;br /&gt;
	-- parameters.&lt;br /&gt;
	local explanations = self._cfg.explanationBlurbs&lt;br /&gt;
	local msg&lt;br /&gt;
	if explanations[action][level] and explanations[action][level][talkKey] then&lt;br /&gt;
		msg = explanations[action][level][talkKey]&lt;br /&gt;
	elseif explanations[action][level] and explanations[action][level].default then&lt;br /&gt;
		msg = explanations[action][level].default&lt;br /&gt;
	elseif explanations[action].default and explanations[action].default[talkKey] then&lt;br /&gt;
		msg = explanations[action].default[talkKey]&lt;br /&gt;
	elseif explanations[action].default and explanations[action].default.default then&lt;br /&gt;
		msg = explanations[action].default.default&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			'could not find explanation blurb for action &amp;quot;%s&amp;quot;, level &amp;quot;%s&amp;quot; and talk key &amp;quot;%s&amp;quot;',&lt;br /&gt;
			action,&lt;br /&gt;
			level,&lt;br /&gt;
			talkKey&lt;br /&gt;
		), 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeImageLinkParameter()&lt;br /&gt;
	local imageLinks = self._cfg.imageLinks&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if imageLinks[action][level] then&lt;br /&gt;
		msg = imageLinks[action][level]&lt;br /&gt;
	elseif imageLinks[action].default then&lt;br /&gt;
		msg = imageLinks[action].default&lt;br /&gt;
	else&lt;br /&gt;
		msg = imageLinks.edit.default&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeIntroBlurbParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage('intro-blurb-expiry')&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage('intro-blurb-noexpiry')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeIntroFragmentParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage('intro-fragment-expiry')&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage('intro-fragment-noexpiry')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makePagetypeParameter()&lt;br /&gt;
	local pagetypes = self._cfg.pagetypes&lt;br /&gt;
	return pagetypes[self._protectionObj.title.namespace]&lt;br /&gt;
		or pagetypes.default&lt;br /&gt;
		or error('no default pagetype defined', 8)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionBlurbParameter()&lt;br /&gt;
	local protectionBlurbs = self._cfg.protectionBlurbs&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if protectionBlurbs[action][level] then&lt;br /&gt;
		msg = protectionBlurbs[action][level]&lt;br /&gt;
	elseif protectionBlurbs[action].default then&lt;br /&gt;
		msg = protectionBlurbs[action].default&lt;br /&gt;
	elseif protectionBlurbs.edit.default then&lt;br /&gt;
		msg = protectionBlurbs.edit.default&lt;br /&gt;
	else&lt;br /&gt;
		error('no protection blurb defined for protectionBlurbs.edit.default', 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionDateParameter()&lt;br /&gt;
	local protectionDate = self._protectionObj.protectionDate&lt;br /&gt;
	if type(protectionDate) == 'number' then&lt;br /&gt;
		return self:_formatDate(protectionDate)&lt;br /&gt;
	else&lt;br /&gt;
		return protectionDate&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionLevelParameter()&lt;br /&gt;
	local protectionLevels = self._cfg.protectionLevels&lt;br /&gt;
	local action = self._protectionObj.action&lt;br /&gt;
	local level = self._protectionObj.level&lt;br /&gt;
	local msg&lt;br /&gt;
	if protectionLevels[action][level] then&lt;br /&gt;
		msg = protectionLevels[action][level]&lt;br /&gt;
	elseif protectionLevels[action].default then&lt;br /&gt;
		msg = protectionLevels[action].default&lt;br /&gt;
	elseif protectionLevels.edit.default then&lt;br /&gt;
		msg = protectionLevels.edit.default&lt;br /&gt;
	else&lt;br /&gt;
		error('no protection level defined for protectionLevels.edit.default', 8)&lt;br /&gt;
	end&lt;br /&gt;
	return self:_substituteParameters(msg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeProtectionLogParameter()&lt;br /&gt;
	local pagename = self._protectionObj.title.prefixedText&lt;br /&gt;
	if self._protectionObj.action == 'autoreview' then&lt;br /&gt;
		-- We need the pending changes log.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			'Special:Log',&lt;br /&gt;
			{type = 'stable', page = pagename},&lt;br /&gt;
			self:_getExpandedMessage('pc-log-display')&lt;br /&gt;
		)&lt;br /&gt;
	else&lt;br /&gt;
		-- We need the protection log.&lt;br /&gt;
		return makeFullUrl(&lt;br /&gt;
			'Special:Log',&lt;br /&gt;
			{type = 'protect', page = pagename},&lt;br /&gt;
			self:_getExpandedMessage('protection-log-display')&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTalkPageParameter()&lt;br /&gt;
	return string.format(&lt;br /&gt;
		'[[%s:%s#%s|%s]]',&lt;br /&gt;
		mw.site.namespaces[self._protectionObj.title.namespace].talk.name,&lt;br /&gt;
		self._protectionObj.title.text,&lt;br /&gt;
		self._args.section or 'top',&lt;br /&gt;
		self:_getExpandedMessage('talk-page-link-display')&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTooltipBlurbParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage('tooltip-blurb-expiry')&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage('tooltip-blurb-noexpiry')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeTooltipFragmentParameter()&lt;br /&gt;
	if self._protectionObj:isTemporary() then&lt;br /&gt;
		return self:_getExpandedMessage('tooltip-fragment-expiry')&lt;br /&gt;
	else&lt;br /&gt;
		return self:_getExpandedMessage('tooltip-fragment-noexpiry')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Blurb:_makeVandalTemplateParameter()&lt;br /&gt;
	return require('Module:Vandal-m')._main{&lt;br /&gt;
		self._args.user or self._protectionObj.title.baseText&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Public methods --&lt;br /&gt;
&lt;br /&gt;
function Blurb:makeBannerText(key)&lt;br /&gt;
	-- Validate input.&lt;br /&gt;
	if not key or not Blurb.bannerTextFields[key] then&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			'&amp;quot;%s&amp;quot; is not a valid banner config field',&lt;br /&gt;
			tostring(key)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Generate the text.&lt;br /&gt;
	local msg = self._protectionObj.bannerConfig[key]&lt;br /&gt;
	if type(msg) == 'string' then&lt;br /&gt;
		return self:_substituteParameters(msg)&lt;br /&gt;
	elseif type(msg) == 'function' then&lt;br /&gt;
		msg = msg(self._protectionObj, self._args)&lt;br /&gt;
		if type(msg) ~= 'string' then&lt;br /&gt;
			error(string.format(&lt;br /&gt;
				'bad output from banner config function with key &amp;quot;%s&amp;quot;'&lt;br /&gt;
					.. ' (expected string, got %s)',&lt;br /&gt;
				tostring(key),&lt;br /&gt;
				type(msg)&lt;br /&gt;
			), 4)&lt;br /&gt;
		end&lt;br /&gt;
		return self:_substituteParameters(msg)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- BannerTemplate class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local BannerTemplate = {}&lt;br /&gt;
BannerTemplate.__index = BannerTemplate&lt;br /&gt;
&lt;br /&gt;
function BannerTemplate.new(protectionObj, cfg)&lt;br /&gt;
	local obj = {}&lt;br /&gt;
	obj._cfg = cfg&lt;br /&gt;
&lt;br /&gt;
	-- Set the image filename.&lt;br /&gt;
	local imageFilename = protectionObj.bannerConfig.image&lt;br /&gt;
	if imageFilename then&lt;br /&gt;
		obj._imageFilename = imageFilename&lt;br /&gt;
	else&lt;br /&gt;
		-- If an image filename isn't specified explicitly in the banner config,&lt;br /&gt;
		-- generate it from the protection status and the namespace.&lt;br /&gt;
		local action = protectionObj.action&lt;br /&gt;
		local level = protectionObj.level&lt;br /&gt;
		local namespace = protectionObj.title.namespace&lt;br /&gt;
		local reason = protectionObj.reason&lt;br /&gt;
		&lt;br /&gt;
		-- Deal with special cases first.&lt;br /&gt;
		if (&lt;br /&gt;
			namespace == 10&lt;br /&gt;
			or namespace == 828&lt;br /&gt;
			or reason and obj._cfg.indefImageReasons[reason]&lt;br /&gt;
			)&lt;br /&gt;
			and action == 'edit'&lt;br /&gt;
			and level == 'sysop'&lt;br /&gt;
			and not protectionObj:isTemporary()&lt;br /&gt;
		then&lt;br /&gt;
			-- Fully protected modules and templates get the special red &amp;quot;indef&amp;quot;&lt;br /&gt;
			-- padlock.&lt;br /&gt;
			obj._imageFilename = obj._cfg.msg['image-filename-indef']&lt;br /&gt;
		else&lt;br /&gt;
			-- Deal with regular protection types.&lt;br /&gt;
			local images = obj._cfg.images&lt;br /&gt;
			if images[action] then&lt;br /&gt;
				if images[action][level] then&lt;br /&gt;
					obj._imageFilename = images[action][level]&lt;br /&gt;
				elseif images[action].default then&lt;br /&gt;
					obj._imageFilename = images[action].default&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return setmetatable(obj, BannerTemplate)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function BannerTemplate:renderImage()&lt;br /&gt;
	local filename = self._imageFilename&lt;br /&gt;
		or self._cfg.msg['image-filename-default']&lt;br /&gt;
		or 'Transparent.gif'&lt;br /&gt;
	return makeFileLink{&lt;br /&gt;
		file = filename,&lt;br /&gt;
		size = (self.imageWidth or 20) .. 'px',&lt;br /&gt;
		alt = self._imageAlt,&lt;br /&gt;
		link = self._imageLink,&lt;br /&gt;
		caption = self.imageCaption&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Banner class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Banner = setmetatable({}, BannerTemplate)&lt;br /&gt;
Banner.__index = Banner&lt;br /&gt;
&lt;br /&gt;
function Banner.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
	local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.&lt;br /&gt;
	obj.imageWidth = 40&lt;br /&gt;
	obj.imageCaption = blurbObj:makeBannerText('alt') -- Large banners use the alt text for the tooltip.&lt;br /&gt;
	obj._reasonText = blurbObj:makeBannerText('text')&lt;br /&gt;
	obj._explanationText = blurbObj:makeBannerText('explanation')&lt;br /&gt;
	obj._page = protectionObj.title.prefixedText -- Only makes a difference in testing.&lt;br /&gt;
	return setmetatable(obj, Banner)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Banner:__tostring()&lt;br /&gt;
	-- Renders the banner.&lt;br /&gt;
	makeMessageBox = makeMessageBox or require('Module:Message box').main&lt;br /&gt;
	local reasonText = self._reasonText or error('no reason text set', 2)&lt;br /&gt;
	local explanationText = self._explanationText&lt;br /&gt;
	local mbargs = {&lt;br /&gt;
		page = self._page,&lt;br /&gt;
		type = 'protection',&lt;br /&gt;
		image = self:renderImage(),&lt;br /&gt;
		text = string.format(&lt;br /&gt;
			&amp;quot;'''%s'''%s&amp;quot;,&lt;br /&gt;
			reasonText,&lt;br /&gt;
			explanationText and '&amp;lt;br /&amp;gt;' .. explanationText or ''&lt;br /&gt;
		)&lt;br /&gt;
	}&lt;br /&gt;
	return makeMessageBox('mbox', mbargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Padlock class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local Padlock = setmetatable({}, BannerTemplate)&lt;br /&gt;
Padlock.__index = Padlock&lt;br /&gt;
&lt;br /&gt;
function Padlock.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
	local obj = BannerTemplate.new(protectionObj, cfg) -- This doesn't need the blurb.&lt;br /&gt;
	obj.imageWidth = 20&lt;br /&gt;
	obj.imageCaption = blurbObj:makeBannerText('tooltip')&lt;br /&gt;
	obj._imageAlt = blurbObj:makeBannerText('alt')&lt;br /&gt;
	obj._imageLink = blurbObj:makeBannerText('link')&lt;br /&gt;
	obj._indicatorName = cfg.padlockIndicatorNames[protectionObj.action]&lt;br /&gt;
		or cfg.padlockIndicatorNames.default&lt;br /&gt;
		or 'pp-default'&lt;br /&gt;
	return setmetatable(obj, Padlock)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function Padlock:__tostring()&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	-- The nowiki tag helps prevent whitespace at the top of articles.&lt;br /&gt;
	return frame:extensionTag{name = 'nowiki'} .. frame:extensionTag{&lt;br /&gt;
		name = 'indicator',&lt;br /&gt;
		args = {name = self._indicatorName},&lt;br /&gt;
		content = self:renderImage()&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._exportClasses()&lt;br /&gt;
	-- This is used for testing purposes.&lt;br /&gt;
	return {&lt;br /&gt;
		Protection = Protection,&lt;br /&gt;
		Blurb = Blurb,&lt;br /&gt;
		BannerTemplate = BannerTemplate,&lt;br /&gt;
		Banner = Banner,&lt;br /&gt;
		Padlock = Padlock,&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, cfg, title)&lt;br /&gt;
	args = args or {}&lt;br /&gt;
	cfg = cfg or require(CONFIG_MODULE)&lt;br /&gt;
&lt;br /&gt;
	local protectionObj = Protection.new(args, cfg, title)&lt;br /&gt;
&lt;br /&gt;
	local ret = {}&lt;br /&gt;
&lt;br /&gt;
	-- If a page's edit protection is equally or more restrictive than its&lt;br /&gt;
	-- protection from some other action, then don't bother displaying anything&lt;br /&gt;
	-- for the other action (except categories).&lt;br /&gt;
	if protectionObj.action == 'edit' or&lt;br /&gt;
		args.demolevel or&lt;br /&gt;
		not getReachableNodes(&lt;br /&gt;
			cfg.hierarchy,&lt;br /&gt;
			protectionObj.level&lt;br /&gt;
		)[effectiveProtectionLevel('edit', protectionObj.title)]&lt;br /&gt;
	then&lt;br /&gt;
		-- Initialise the blurb object&lt;br /&gt;
		local blurbObj = Blurb.new(protectionObj, args, cfg)&lt;br /&gt;
	&lt;br /&gt;
		-- Render the banner&lt;br /&gt;
		if protectionObj:isProtected() then&lt;br /&gt;
			ret[#ret + 1] = tostring(&lt;br /&gt;
				(yesno(args.small) and Padlock or Banner)&lt;br /&gt;
				.new(protectionObj, blurbObj, cfg)&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Render the categories&lt;br /&gt;
	if yesno(args.category) ~= false then&lt;br /&gt;
		ret[#ret + 1] = protectionObj:makeCategoryLinks()&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(ret)	&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame, cfg)&lt;br /&gt;
	cfg = cfg or require(CONFIG_MODULE)&lt;br /&gt;
&lt;br /&gt;
	-- Find default args, if any.&lt;br /&gt;
	local parent = frame.getParent and frame:getParent()&lt;br /&gt;
	local defaultArgs = parent and cfg.wrappers[parent:getTitle():gsub('/sandbox$', '')]&lt;br /&gt;
&lt;br /&gt;
	-- Find user args, and use the parent frame if we are being called from a&lt;br /&gt;
	-- wrapper template.&lt;br /&gt;
	getArgs = getArgs or require('Module:Arguments').getArgs&lt;br /&gt;
	local userArgs = getArgs(frame, {&lt;br /&gt;
		parentOnly = defaultArgs,&lt;br /&gt;
		frameOnly = not defaultArgs&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	-- Build the args table. User-specified args overwrite default args.&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(defaultArgs or {}) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	for k, v in pairs(userArgs) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args, cfg)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Protection_banner/config&amp;diff=4617</id>
		<title>Module:Protection banner/config</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Protection_banner/config&amp;diff=4617"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides configuration data for [[Module:Protection banner]].&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                                BANNER DATA&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- Banner data consists of six fields:&lt;br /&gt;
-- * text - the main protection text that appears at the top of protection&lt;br /&gt;
--   banners.&lt;br /&gt;
-- * explanation - the text that appears below the main protection text, used&lt;br /&gt;
--   to explain the details of the protection.&lt;br /&gt;
-- * tooltip - the tooltip text you see when you move the mouse over a small&lt;br /&gt;
--   padlock icon.&lt;br /&gt;
-- * link - the page that the small padlock icon links to.&lt;br /&gt;
-- * alt - the alt text for the small padlock icon. This is also used as tooltip&lt;br /&gt;
--   text for the large protection banners.&lt;br /&gt;
-- * image - the padlock image used in both protection banners and small padlock&lt;br /&gt;
--   icons.&lt;br /&gt;
--&lt;br /&gt;
-- The module checks in three separate tables to find a value for each field.&lt;br /&gt;
-- First it checks the banners table, which has values specific to the reason&lt;br /&gt;
-- for the page being protected. Then the module checks the defaultBanners&lt;br /&gt;
-- table, which has values specific to each protection level. Finally, the&lt;br /&gt;
-- module checks the masterBanner table, which holds data for protection&lt;br /&gt;
-- templates to use if no data has been found in the previous two tables.&lt;br /&gt;
--&lt;br /&gt;
-- The values in the banner data can take parameters. These are specified&lt;br /&gt;
-- using ${TEXTLIKETHIS} (a dollar sign preceding a parameter name&lt;br /&gt;
-- enclosed in curly braces).&lt;br /&gt;
--&lt;br /&gt;
--                          Available parameters:&lt;br /&gt;
--&lt;br /&gt;
-- ${CURRENTVERSION} - a link to the page history or the move log, with the&lt;br /&gt;
-- display message &amp;quot;current-version-edit-display&amp;quot; or&lt;br /&gt;
-- &amp;quot;current-version-move-display&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${EDITREQUEST} - a link to create an edit request for the current page.&lt;br /&gt;
--&lt;br /&gt;
-- ${EXPLANATIONBLURB} - an explanation blurb, e.g. &amp;quot;Please discuss any changes&lt;br /&gt;
-- on the talk page; you may submit a request to ask an administrator to make&lt;br /&gt;
-- an edit if it is minor or supported by consensus.&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${IMAGELINK} - a link to set the image to, depending on the protection&lt;br /&gt;
-- action and protection level.&lt;br /&gt;
--&lt;br /&gt;
-- ${INTROBLURB} - the PROTECTIONBLURB parameter, plus the expiry if an expiry&lt;br /&gt;
-- is set. E.g. &amp;quot;Editing of this page by new or unregistered users is currently &lt;br /&gt;
-- disabled until dd Month YYYY.&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${INTROFRAGMENT} - the same as ${INTROBLURB}, but without final punctuation&lt;br /&gt;
-- so that it can be used in run-on sentences.&lt;br /&gt;
--&lt;br /&gt;
-- ${PAGETYPE} - the type of the page, e.g. &amp;quot;article&amp;quot; or &amp;quot;template&amp;quot;.&lt;br /&gt;
-- Defined in the cfg.pagetypes table.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONBLURB} - a blurb explaining the protection level of the page, e.g.&lt;br /&gt;
-- &amp;quot;Editing of this page by new or unregistered users is currently disabled&amp;quot;&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONDATE} - the protection date, if it has been supplied to the&lt;br /&gt;
-- template.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONLEVEL} - the protection level, e.g. &amp;quot;fully protected&amp;quot; or&lt;br /&gt;
-- &amp;quot;semi-protected&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${PROTECTIONLOG} - a link to the protection log or the pending changes log,&lt;br /&gt;
-- depending on the protection action.&lt;br /&gt;
--&lt;br /&gt;
-- ${TALKPAGE} - a link to the talk page. If a section is specified, links&lt;br /&gt;
-- straight to that talk page section.&lt;br /&gt;
--&lt;br /&gt;
-- ${TOOLTIPBLURB} - uses the PAGETYPE, PROTECTIONTYPE and EXPIRY parameters to&lt;br /&gt;
-- create a blurb like &amp;quot;This template is semi-protected&amp;quot;, or &amp;quot;This article is&lt;br /&gt;
-- move-protected until DD Month YYYY&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- ${VANDAL} - links for the specified username (or the root page name)&lt;br /&gt;
-- using Module:Vandal-m.&lt;br /&gt;
--&lt;br /&gt;
--                                 Functions&lt;br /&gt;
--&lt;br /&gt;
-- For advanced users, it is possible to use Lua functions instead of strings&lt;br /&gt;
-- in the banner config tables. Using functions gives flexibility that is not&lt;br /&gt;
-- possible just by using parameters. Functions take two arguments, the&lt;br /&gt;
-- protection object and the template arguments, and they must output a string.&lt;br /&gt;
--&lt;br /&gt;
-- For example:&lt;br /&gt;
--&lt;br /&gt;
-- text = function (protectionObj, args)&lt;br /&gt;
--     if protectionObj.level == 'autoconfirmed' then&lt;br /&gt;
--         return 'foo'&lt;br /&gt;
--     else&lt;br /&gt;
--         return 'bar'&lt;br /&gt;
--     end&lt;br /&gt;
-- end&lt;br /&gt;
--&lt;br /&gt;
-- Some protection object properties and methods that may be useful:&lt;br /&gt;
-- protectionObj.action - the protection action&lt;br /&gt;
-- protectionObj.level - the protection level&lt;br /&gt;
-- protectionObj.reason - the protection reason&lt;br /&gt;
-- protectionObj.expiry - the expiry. Nil if unset, the string &amp;quot;indef&amp;quot; if set&lt;br /&gt;
--     to indefinite, and the protection time in unix time if temporary.&lt;br /&gt;
-- protectionObj.protectionDate - the protection date in unix time, or nil if&lt;br /&gt;
--     unspecified.&lt;br /&gt;
-- protectionObj.bannerConfig - the banner config found by the module. Beware&lt;br /&gt;
--     of editing the config field used by the function, as it could create an&lt;br /&gt;
--     infinite loop.&lt;br /&gt;
-- protectionObj:isProtected - returns a boolean showing whether the page is&lt;br /&gt;
--     protected.&lt;br /&gt;
-- protectionObj:isTemporary - returns a boolean showing whether the expiry is&lt;br /&gt;
--     temporary.&lt;br /&gt;
-- protectionObj:isIncorrect - returns a boolean showing whether the protection&lt;br /&gt;
--     template is incorrect.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- The master banner data, used if no values have been found in banners or&lt;br /&gt;
-- defaultBanners.&lt;br /&gt;
masterBanner = {&lt;br /&gt;
	text = '${INTROBLURB}',&lt;br /&gt;
	explanation = '${EXPLANATIONBLURB}',&lt;br /&gt;
	tooltip = '${TOOLTIPBLURB}',&lt;br /&gt;
	link = '${IMAGELINK}',&lt;br /&gt;
	alt = 'Page ${PROTECTIONLEVEL}'&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The default banner data. This holds banner data for different protection&lt;br /&gt;
-- levels.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
defaultBanners = {&lt;br /&gt;
	edit = {},&lt;br /&gt;
	move = {},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = {&lt;br /&gt;
			alt = 'Page protected with pending changes',&lt;br /&gt;
			tooltip = 'All edits by unregistered and new users are subject to review prior to becoming visible to unregistered users',&lt;br /&gt;
			image = 'Pending-protection-shackle.svg'&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	upload = {}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The banner data. This holds banner data for different protection reasons.&lt;br /&gt;
-- In fact, the reasons specified in this table control which reasons are&lt;br /&gt;
-- valid inputs to the first positional parameter.&lt;br /&gt;
--&lt;br /&gt;
-- There is also a non-standard &amp;quot;description&amp;quot; field that can be used for items&lt;br /&gt;
-- in this table. This is a description of the protection reason for use in the&lt;br /&gt;
-- module documentation.&lt;br /&gt;
--&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
banners = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		blp = {&lt;br /&gt;
			description = 'For pages protected to promote compliance with the'&lt;br /&gt;
				.. ' [[Wikipedia:Biographies of living persons'&lt;br /&gt;
				.. '|biographies of living persons]] policy',&lt;br /&gt;
			text = '${INTROFRAGMENT} to promote compliance with'&lt;br /&gt;
				.. ' [[Wikipedia:Biographies of living persons'&lt;br /&gt;
				.. &amp;quot;|Wikipedia's&amp;amp;nbsp;policy on&amp;amp;nbsp;the&amp;amp;nbsp;biographies&amp;quot;&lt;br /&gt;
				.. ' of&amp;amp;nbsp;living&amp;amp;nbsp;people]].',&lt;br /&gt;
			tooltip = '${TOOLTIPFRAGMENT} to promote compliance with the policy on'&lt;br /&gt;
				.. ' biographies of living people',&lt;br /&gt;
		},&lt;br /&gt;
		dmca = {&lt;br /&gt;
			description = 'For pages protected by the Wikimedia Foundation'&lt;br /&gt;
				.. ' due to [[Digital Millennium Copyright Act]] takedown requests',&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = 'Pursuant to a rights owner notice under the Digital'&lt;br /&gt;
					.. ' Millennium Copyright Act (DMCA) regarding some content'&lt;br /&gt;
					.. ' in this article, the Wikimedia Foundation acted under'&lt;br /&gt;
					.. ' applicable law and took down and restricted the content'&lt;br /&gt;
					.. ' in question.'&lt;br /&gt;
				if args.notice then&lt;br /&gt;
					ret = ret .. ' A copy of the received notice can be found here: '&lt;br /&gt;
						.. args.notice .. '.'&lt;br /&gt;
				end&lt;br /&gt;
				ret = ret .. ' For more information, including websites discussing'&lt;br /&gt;
					.. ' how to file a counter-notice, please see'&lt;br /&gt;
					.. &amp;quot; [[Wikipedia:Office actions]] and the article's ${TALKPAGE}.&amp;quot;&lt;br /&gt;
					.. &amp;quot;'''Do not remove this template from the article until the&amp;quot;&lt;br /&gt;
					.. &amp;quot; restrictions are withdrawn'''.&amp;quot;&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			image = 'Office-protection-shackle.svg',&lt;br /&gt;
		},&lt;br /&gt;
		dispute = {&lt;br /&gt;
			description = 'For pages protected due to editing disputes',&lt;br /&gt;
			text = function (protectionObj, args)&lt;br /&gt;
				-- Find the value of &amp;quot;disputes&amp;quot;.&lt;br /&gt;
				local display = 'disputes'&lt;br /&gt;
				local disputes&lt;br /&gt;
				if args.section then&lt;br /&gt;
					disputes = string.format(&lt;br /&gt;
						'[[%s:%s#%s|%s]]',&lt;br /&gt;
						mw.site.namespaces[protectionObj.title.namespace].talk.name,&lt;br /&gt;
						protectionObj.title.text,&lt;br /&gt;
						args.section,&lt;br /&gt;
						display&lt;br /&gt;
					)&lt;br /&gt;
				else&lt;br /&gt;
					disputes = display&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				-- Make the blurb, depending on the expiry.&lt;br /&gt;
				local msg&lt;br /&gt;
				if type(protectionObj.expiry) == 'number' then&lt;br /&gt;
					msg = '${INTROFRAGMENT} or until editing %s have been resolved.'&lt;br /&gt;
				else&lt;br /&gt;
					msg = '${INTROFRAGMENT} until editing %s have been resolved.'&lt;br /&gt;
				end&lt;br /&gt;
				return string.format(msg, disputes)&lt;br /&gt;
			end,&lt;br /&gt;
			explanation = &amp;quot;This protection is '''not''' an endorsement of the&amp;quot;&lt;br /&gt;
				.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',&lt;br /&gt;
			tooltip = '${TOOLTIPFRAGMENT} due to editing disputes',&lt;br /&gt;
		},&lt;br /&gt;
		ecp = {&lt;br /&gt;
			description = 'For articles in topic areas authorized by'&lt;br /&gt;
				.. ' [[Wikipedia:Arbitration Committee|ArbCom]] or'&lt;br /&gt;
				.. ' meets the criteria for community use',&lt;br /&gt;
			tooltip = 'This ${PAGETYPE} is extended-confirmed protected',&lt;br /&gt;
			alt = 'Extended-protected ${PAGETYPE}',&lt;br /&gt;
		},&lt;br /&gt;
		mainpage = {&lt;br /&gt;
			description = 'For pages protected for being displayed on the [[Main Page]]',&lt;br /&gt;
			text = 'This file is currently'&lt;br /&gt;
				.. ' [[Wikipedia:This page is protected|protected]] from'&lt;br /&gt;
				.. ' editing because it is currently or will soon be displayed'&lt;br /&gt;
				.. ' on the [[Main Page]].',&lt;br /&gt;
			explanation = 'Images on the Main Page are protected due to their high'&lt;br /&gt;
				.. ' visibility. Please discuss any necessary changes on the ${TALKPAGE}.'&lt;br /&gt;
				.. '&amp;lt;br /&amp;gt;&amp;lt;span style=&amp;quot;font-size:90%;&amp;quot;&amp;gt;'&lt;br /&gt;
				.. &amp;quot;'''Administrators:''' Once this image is definitely off the Main Page,&amp;quot;&lt;br /&gt;
				.. ' please unprotect this file, or reduce to semi-protection,'&lt;br /&gt;
				.. ' as appropriate.&amp;lt;/span&amp;gt;',&lt;br /&gt;
		},&lt;br /&gt;
		office = {&lt;br /&gt;
			description = 'For pages protected by the Wikimedia Foundation',&lt;br /&gt;
			text = function (protectionObj, args)&lt;br /&gt;
				local ret = 'This ${PAGETYPE} is currently under the'&lt;br /&gt;
					.. ' scrutiny of the'&lt;br /&gt;
					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'&lt;br /&gt;
					.. ' and is protected.'&lt;br /&gt;
				if protectionObj.protectionDate then&lt;br /&gt;
					ret = ret .. ' It has been protected since ${PROTECTIONDATE}.'&lt;br /&gt;
				end&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			explanation = &amp;quot;If you can edit this page, please discuss all changes and&amp;quot;&lt;br /&gt;
				.. &amp;quot; additions on the ${TALKPAGE} first. '''Do not remove protection from this&amp;quot;&lt;br /&gt;
				.. &amp;quot; page unless you are authorized by the Wikimedia Foundation to do&amp;quot;&lt;br /&gt;
				.. &amp;quot; so.'''&amp;quot;,&lt;br /&gt;
			image = 'Office-protection-shackle.svg',&lt;br /&gt;
		},&lt;br /&gt;
		reset = {&lt;br /&gt;
			description = 'For pages protected by the Wikimedia Foundation and'&lt;br /&gt;
				.. ' &amp;quot;reset&amp;quot; to a bare-bones version',&lt;br /&gt;
 			text = 'This ${PAGETYPE} is currently under the'&lt;br /&gt;
					.. ' scrutiny of the'&lt;br /&gt;
					.. ' [[Wikipedia:Office actions|Wikimedia Foundation Office]]'&lt;br /&gt;
					.. ' and is protected.',&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = ''&lt;br /&gt;
				if protectionObj.protectionDate then&lt;br /&gt;
					ret = ret .. 'On ${PROTECTIONDATE} this ${PAGETYPE} was'&lt;br /&gt;
				else&lt;br /&gt;
					ret = ret .. 'This ${PAGETYPE} has been'&lt;br /&gt;
				end&lt;br /&gt;
				ret = ret .. ' reduced to a'&lt;br /&gt;
				.. ' simplified, &amp;quot;bare bones&amp;quot; version so that it may be completely'&lt;br /&gt;
				.. ' rewritten to ensure it meets the policies of'&lt;br /&gt;
				.. ' [[WP:NPOV|Neutral Point of View]] and [[WP:V|Verifiability]].'&lt;br /&gt;
				.. ' Standard Wikipedia policies will apply to its rewriting—which'&lt;br /&gt;
				.. ' will eventually be open to all editors—and will be strictly'&lt;br /&gt;
				.. ' enforced. The ${PAGETYPE} has been ${PROTECTIONLEVEL} while'&lt;br /&gt;
				.. ' it is being rebuilt.\n\n'&lt;br /&gt;
				.. 'Any insertion of material directly from'&lt;br /&gt;
				.. ' pre-protection revisions of the ${PAGETYPE} will be removed, as'&lt;br /&gt;
				.. ' will any material added to the ${PAGETYPE} that is not properly'&lt;br /&gt;
				.. ' sourced. The associated talk page(s) were also cleared on the'&lt;br /&gt;
				.. &amp;quot; same date.\n\n&amp;quot;&lt;br /&gt;
				.. &amp;quot;If you can edit this page, please discuss all changes and&amp;quot;&lt;br /&gt;
				.. &amp;quot; additions on the ${TALKPAGE} first. '''Do not override&amp;quot;&lt;br /&gt;
				.. &amp;quot; this action, and do not remove protection from this page,&amp;quot;&lt;br /&gt;
				.. &amp;quot; unless you are authorized by the Wikimedia Foundation&amp;quot;&lt;br /&gt;
				.. &amp;quot; to do so. No editor may remove this notice.'''&amp;quot;&lt;br /&gt;
&lt;br /&gt;
				return ret&lt;br /&gt;
			end,&lt;br /&gt;
			image = 'Office-protection-shackle.svg',&lt;br /&gt;
		},&lt;br /&gt;
		sock = {&lt;br /&gt;
			description = 'For pages protected due to'&lt;br /&gt;
				.. ' [[Wikipedia:Sock puppetry|sock puppetry]]',&lt;br /&gt;
			text = '${INTROFRAGMENT} to prevent [[Wikipedia:Sock puppetry|sock puppets]] of'&lt;br /&gt;
				.. ' [[Wikipedia:Blocking policy|blocked]] or'&lt;br /&gt;
				.. ' [[Wikipedia:Banning policy|banned users]]'&lt;br /&gt;
				.. ' from editing it.',&lt;br /&gt;
			tooltip = '${TOOLTIPFRAGMENT} to prevent sock puppets of blocked or banned users from'&lt;br /&gt;
				.. ' editing it',&lt;br /&gt;
		},&lt;br /&gt;
		template = {&lt;br /&gt;
			description = 'For [[Wikipedia:High-risk templates|high-risk]]'&lt;br /&gt;
				.. ' templates and Lua modules',&lt;br /&gt;
			text = 'This is a permanently [[Help:Protection|protected]] ${PAGETYPE},'&lt;br /&gt;
				.. ' as it is [[Wikipedia:High-risk templates|high-risk]].',&lt;br /&gt;
			explanation = 'Please discuss any changes on the ${TALKPAGE}; you may'&lt;br /&gt;
				.. ' ${EDITREQUEST} to ask an'&lt;br /&gt;
				.. ' [[Wikipedia:Administrators|administrator]] or'&lt;br /&gt;
				.. ' [[Wikipedia:Template editor|template editor]] to make an edit if'&lt;br /&gt;
				.. ' it is [[Help:Minor edit#When to mark an edit as a minor edit'&lt;br /&gt;
				.. '|uncontroversial]] or supported by'&lt;br /&gt;
				.. ' [[Wikipedia:Consensus|consensus]]. You can also'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'&lt;br /&gt;
				.. ' unprotected.',&lt;br /&gt;
			tooltip = 'This high-risk ${PAGETYPE} is permanently ${PROTECTIONLEVEL}'&lt;br /&gt;
				.. ' to prevent vandalism',&lt;br /&gt;
			alt = 'Permanently protected ${PAGETYPE}',&lt;br /&gt;
		},&lt;br /&gt;
		usertalk = {&lt;br /&gt;
			description = 'For pages protected against disruptive edits by a'&lt;br /&gt;
				.. ' particular user',&lt;br /&gt;
			text = '${INTROFRAGMENT} to prevent ${VANDAL} from using it to make disruptive edits,'&lt;br /&gt;
				.. ' such as abusing the'&lt;br /&gt;
				.. ' &amp;amp;#123;&amp;amp;#123;[[Template:unblock|unblock]]&amp;amp;#125;&amp;amp;#125; template.',&lt;br /&gt;
			explanation = 'If you cannot edit this user talk page and you need to'&lt;br /&gt;
				.. ' make a change or leave a message, you can'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection'&lt;br /&gt;
				.. '#Current requests for edits to a protected page'&lt;br /&gt;
				.. '|request an edit]],'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection'&lt;br /&gt;
				.. '#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|request unprotection]],'&lt;br /&gt;
				.. ' [[Special:Userlogin|log in]],'&lt;br /&gt;
				.. ' or [[Special:UserLogin/signup|create an account]].',&lt;br /&gt;
		},&lt;br /&gt;
		vandalism = {&lt;br /&gt;
			description = 'For pages protected against'&lt;br /&gt;
				.. ' [[Wikipedia:Vandalism|vandalism]]',&lt;br /&gt;
			text = '${INTROFRAGMENT} due to [[Wikipedia:Vandalism|vandalism]].',&lt;br /&gt;
			explanation = function (protectionObj, args)&lt;br /&gt;
				local ret = ''&lt;br /&gt;
				if protectionObj.level == 'sysop' then&lt;br /&gt;
					ret = ret .. &amp;quot;This protection is '''not''' an endorsement of the&amp;quot;&lt;br /&gt;
						.. ' ${CURRENTVERSION}. '&lt;br /&gt;
				end&lt;br /&gt;
				return ret .. '${EXPLANATIONBLURB}'&lt;br /&gt;
			end,&lt;br /&gt;
			tooltip = '${TOOLTIPFRAGMENT} due to vandalism',&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		dispute = {&lt;br /&gt;
			description = 'For pages protected against page moves due to'&lt;br /&gt;
				.. ' disputes over the page title',&lt;br /&gt;
			explanation = &amp;quot;This protection is '''not''' an endorsement of the&amp;quot;&lt;br /&gt;
				.. ' ${CURRENTVERSION}. ${EXPLANATIONBLURB}',&lt;br /&gt;
			image = 'Move-protection-shackle.svg'&lt;br /&gt;
		},&lt;br /&gt;
		vandalism = {&lt;br /&gt;
			description = 'For pages protected against'&lt;br /&gt;
				.. ' [[Wikipedia:Vandalism#Page-move vandalism'&lt;br /&gt;
				.. ' |page-move vandalism]]'&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {},&lt;br /&gt;
	upload = {}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                            GENERAL DATA TABLES&lt;br /&gt;
--&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection blurbs&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the protection blurbs available with the&lt;br /&gt;
-- ${PROTECTIONBLURB} parameter. It is sorted by protection action and&lt;br /&gt;
-- protection level, and is checked by the module in the following order:&lt;br /&gt;
-- 1. page's protection action, page's protection level&lt;br /&gt;
-- 2. page's protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
protectionBlurbs = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = 'This ${PAGETYPE} is currently [[Help:Protection|'&lt;br /&gt;
			.. 'protected]] from editing',&lt;br /&gt;
		autoconfirmed = 'Editing of this ${PAGETYPE} by [[Wikipedia:User access'&lt;br /&gt;
			.. ' levels#New users|new]] or [[Wikipedia:User access levels#Unregistered'&lt;br /&gt;
			.. ' users|unregistered]] users is currently [[Help:Protection|disabled]]',&lt;br /&gt;
		extendedconfirmed = 'This ${PAGETYPE} is currently under extended confirmed protection',&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = 'This ${PAGETYPE} is currently [[Help:Protection|protected]]'&lt;br /&gt;
			.. ' from [[Help:Moving a page|page moves]]'&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = 'All edits made to this ${PAGETYPE} by'&lt;br /&gt;
			.. ' [[Wikipedia:User access levels#New users|new]] or'&lt;br /&gt;
			.. ' [[Wikipedia:User access levels#Unregistered users|unregistered]]'&lt;br /&gt;
			.. ' users are currently'&lt;br /&gt;
			.. ' [[Wikipedia:Pending changes|subject to review]]'&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = 'Uploading new versions of this ${PAGETYPE} is currently disabled'&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Explanation blurbs&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the explanation blurbs available with the&lt;br /&gt;
-- ${EXPLANATIONBLURB} parameter. It is sorted by protection action,&lt;br /&gt;
-- protection level, and whether the page is a talk page or not. If the page is&lt;br /&gt;
-- a talk page it will have a talk key of &amp;quot;talk&amp;quot;; otherwise it will have a talk&lt;br /&gt;
-- key of &amp;quot;subject&amp;quot;. The table is checked in the following order:&lt;br /&gt;
-- 1. page's protection action, page's protection level, page's talk key&lt;br /&gt;
-- 2. page's protection action, page's protection level, default talk key&lt;br /&gt;
-- 3. page's protection action, default protection level, page's talk key&lt;br /&gt;
-- 4. page's protection action, default protection level, default talk key&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
explanationBlurbs = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		autoconfirmed = {&lt;br /&gt;
			subject = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'&lt;br /&gt;
				.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'&lt;br /&gt;
				.. ' ${EDITREQUEST}, discuss changes on the ${TALKPAGE},'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection'&lt;br /&gt;
				.. '#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|request unprotection]], [[Special:Userlogin|log in]], or'&lt;br /&gt;
				.. ' [[Special:UserLogin/signup|create an account]].',&lt;br /&gt;
			default = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details. If you'&lt;br /&gt;
				.. ' cannot edit this ${PAGETYPE} and you wish to make a change, you can'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection'&lt;br /&gt;
				.. '#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|request unprotection]], [[Special:Userlogin|log in]], or'&lt;br /&gt;
				.. ' [[Special:UserLogin/signup|create an account]].',&lt;br /&gt;
		},&lt;br /&gt;
		extendedconfirmed = {&lt;br /&gt;
			default = 'Extended confirmed protection prevents edits from all unregistered editors'&lt;br /&gt;
				.. ' and registered users with fewer than 30 days tenure and 500 edits.'&lt;br /&gt;
				.. ' The [[Wikipedia:Protection policy#extended|policy on community use]]'&lt;br /&gt;
				.. ' specifies that extended confirmed protection can be applied to combat'&lt;br /&gt;
				.. ' disruption, if semi-protection has proven to be ineffective.'&lt;br /&gt;
				.. ' Extended confirmed protection may also be applied to enforce'&lt;br /&gt;
				.. ' [[Wikipedia:Arbitration Committee|arbitration sanctions]].'&lt;br /&gt;
				.. ' Please discuss any changes on the ${TALKPAGE}; you may'&lt;br /&gt;
				.. ' ${EDITREQUEST} to ask for uncontroversial changes supported by'&lt;br /&gt;
				.. ' [[Wikipedia:Consensus|consensus]].'&lt;br /&gt;
		},&lt;br /&gt;
		default = {&lt;br /&gt;
			subject = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' Please discuss any changes on the ${TALKPAGE}; you'&lt;br /&gt;
				.. ' may ${EDITREQUEST} to ask an'&lt;br /&gt;
				.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'&lt;br /&gt;
				.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'&lt;br /&gt;
				.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'&lt;br /&gt;
				.. '|consensus]]. You may also [[Wikipedia:Requests for'&lt;br /&gt;
				.. ' page protection#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|request]] that this page be unprotected.',&lt;br /&gt;
			default = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' You may [[Wikipedia:Requests for page'&lt;br /&gt;
				.. ' protection#Current requests for edits to a protected page|request an'&lt;br /&gt;
				.. ' edit]] to this page, or [[Wikipedia:Requests for'&lt;br /&gt;
				.. ' page protection#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|ask]] for it to be unprotected.'&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = {&lt;br /&gt;
			subject = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' The page may still be edited but cannot be moved'&lt;br /&gt;
				.. ' until unprotected. Please discuss any suggested moves on the'&lt;br /&gt;
				.. ' ${TALKPAGE} or at [[Wikipedia:Requested moves]]. You can also'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'&lt;br /&gt;
				.. ' unprotected.',&lt;br /&gt;
			default = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' The page may still be edited but cannot be moved'&lt;br /&gt;
				.. ' until unprotected. Please discuss any suggested moves at'&lt;br /&gt;
				.. ' [[Wikipedia:Requested moves]]. You can also'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection|request]] that the page be'&lt;br /&gt;
				.. ' unprotected.'&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = {&lt;br /&gt;
			default = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' Edits to this ${PAGETYPE} by new and unregistered users'&lt;br /&gt;
				.. ' will not be visible to readers until they are accepted by'&lt;br /&gt;
				.. ' a reviewer. To avoid the need for your edits to be'&lt;br /&gt;
				.. ' reviewed, you may'&lt;br /&gt;
				.. ' [[Wikipedia:Requests for page protection'&lt;br /&gt;
				.. '#Current requests for reduction in protection level'&lt;br /&gt;
				.. '|request unprotection]], [[Special:Userlogin|log in]], or'&lt;br /&gt;
				.. ' [[Special:UserLogin/signup|create an account]].'&lt;br /&gt;
		},&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = {&lt;br /&gt;
			default = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
				.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
				.. ' The page may still be edited but new versions of the file'&lt;br /&gt;
				.. ' cannot be uploaded until it is unprotected. You can'&lt;br /&gt;
				.. ' request that a new version be uploaded by using a'&lt;br /&gt;
				.. ' [[Wikipedia:Edit requests|protected edit request]], or you'&lt;br /&gt;
				.. ' can  [[Wikipedia:Requests for page protection|request]]'&lt;br /&gt;
				.. ' that the file be unprotected.'&lt;br /&gt;
		}&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection levels&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the data for the ${PROTECTIONLEVEL} parameter, which&lt;br /&gt;
-- produces a short label for different protection levels. It is sorted by&lt;br /&gt;
-- protection action and protection level, and is checked in the following&lt;br /&gt;
-- order:&lt;br /&gt;
-- 1. page's protection action, page's protection level&lt;br /&gt;
-- 2. page's protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
protectionLevels = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = 'protected',&lt;br /&gt;
		templateeditor = 'template-protected',&lt;br /&gt;
		extendedconfirmed = 'extended-protected',&lt;br /&gt;
		autoconfirmed = 'semi-protected',&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = 'move-protected'&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = 'upload-protected'&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Images&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table lists different padlock images for each protection action and&lt;br /&gt;
-- protection level. It is used if an image is not specified in any of the&lt;br /&gt;
-- banner data tables, and if the page does not satisfy the conditions for using&lt;br /&gt;
-- the ['image-filename-indef'] image. It is checked in the following order:&lt;br /&gt;
-- 1. page's protection action, page's protection level&lt;br /&gt;
-- 2. page's protection action, default protection level&lt;br /&gt;
images = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = 'Full-protection-shackle.svg',&lt;br /&gt;
		templateeditor = 'Template-protection-shackle.svg',&lt;br /&gt;
		extendedconfirmed = 'Extended-protection-shackle.svg',&lt;br /&gt;
		autoconfirmed = 'Semi-protection-shackle.svg'&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = 'Move-protection-shackle.svg',&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = 'Pending-protection-shackle.svg'&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = 'Upload-protection-shackle.svg'&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- Pages with a reason specified in this table will show the special &amp;quot;indef&amp;quot;&lt;br /&gt;
-- padlock, defined in the 'image-filename-indef' message, if no expiry is set.&lt;br /&gt;
indefImageReasons = {&lt;br /&gt;
	template = true&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Image links&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the data for the ${IMAGELINK} parameter, which gets&lt;br /&gt;
-- the image link for small padlock icons based on the page's protection action&lt;br /&gt;
-- and protection level. It is checked in the following order:&lt;br /&gt;
-- 1. page's protection action, page's protection level&lt;br /&gt;
-- 2. page's protection action, default protection level&lt;br /&gt;
-- 3. &amp;quot;edit&amp;quot; protection action, default protection level&lt;br /&gt;
--&lt;br /&gt;
-- It is possible to use banner parameters inside this table.&lt;br /&gt;
-- *required* - this table needs edit, move, autoreview and upload subtables.&lt;br /&gt;
imageLinks = {&lt;br /&gt;
	edit = {&lt;br /&gt;
		default = 'Wikipedia:Protection policy#full',&lt;br /&gt;
		templateeditor = 'Wikipedia:Protection policy#template',&lt;br /&gt;
		extendedconfirmed = 'Wikipedia:Protection policy#extended',&lt;br /&gt;
		autoconfirmed = 'Wikipedia:Protection policy#semi'&lt;br /&gt;
	},&lt;br /&gt;
	move = {&lt;br /&gt;
		default = 'Wikipedia:Protection policy#move'&lt;br /&gt;
	},&lt;br /&gt;
	autoreview = {&lt;br /&gt;
		default = 'Wikipedia:Protection policy#pending'&lt;br /&gt;
	},&lt;br /&gt;
	upload = {&lt;br /&gt;
		default = 'Wikipedia:Protection policy#upload'&lt;br /&gt;
	}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Padlock indicator names&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table provides the &amp;quot;name&amp;quot; attribute for the &amp;lt;indicator&amp;gt; extension tag&lt;br /&gt;
-- with which small padlock icons are generated. All indicator tags on a page&lt;br /&gt;
-- are displayed in alphabetical order based on this attribute, and with&lt;br /&gt;
-- indicator tags with duplicate names, the last tag on the page wins.&lt;br /&gt;
-- The attribute is chosen based on the protection action; table keys must be a&lt;br /&gt;
-- protection action name or the string &amp;quot;default&amp;quot;.&lt;br /&gt;
padlockIndicatorNames = {&lt;br /&gt;
	autoreview = 'pp-autoreview',&lt;br /&gt;
	default = 'pp-default'&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection categories&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- The protection categories are stored in the protectionCategories table.&lt;br /&gt;
-- Keys to this table are made up of the following strings:&lt;br /&gt;
--&lt;br /&gt;
-- 1. the expiry date&lt;br /&gt;
-- 2. the namespace&lt;br /&gt;
-- 3. the protection reason (e.g. &amp;quot;dispute&amp;quot; or &amp;quot;vandalism&amp;quot;)&lt;br /&gt;
-- 4. the protection level (e.g. &amp;quot;sysop&amp;quot; or &amp;quot;autoconfirmed&amp;quot;)&lt;br /&gt;
-- 5. the action (e.g. &amp;quot;edit&amp;quot; or &amp;quot;move&amp;quot;)&lt;br /&gt;
-- &lt;br /&gt;
-- When the module looks up a category in the table, first it will will check to&lt;br /&gt;
-- see a key exists that corresponds to all five parameters. For example, a&lt;br /&gt;
-- user page semi-protected from vandalism for two weeks would have the key&lt;br /&gt;
-- &amp;quot;temp-user-vandalism-autoconfirmed-edit&amp;quot;. If no match is found, the module&lt;br /&gt;
-- changes the first part of the key to &amp;quot;all&amp;quot; and checks the table again. It&lt;br /&gt;
-- keeps checking increasingly generic key combinations until it finds the&lt;br /&gt;
-- field, or until it reaches the key &amp;quot;all-all-all-all-all&amp;quot;.&lt;br /&gt;
--&lt;br /&gt;
-- The module uses a binary matrix to determine the order in which to search.&lt;br /&gt;
-- This is best demonstrated by a table. In this table, the &amp;quot;0&amp;quot; values&lt;br /&gt;
-- represent &amp;quot;all&amp;quot;, and the &amp;quot;1&amp;quot; values represent the original data (e.g.&lt;br /&gt;
-- &amp;quot;indef&amp;quot; or &amp;quot;file&amp;quot; or &amp;quot;vandalism&amp;quot;).&lt;br /&gt;
--&lt;br /&gt;
--        expiry    namespace reason   level     action&lt;br /&gt;
-- order&lt;br /&gt;
-- 1      1         1         1        1         1&lt;br /&gt;
-- 2      0         1         1        1         1&lt;br /&gt;
-- 3      1         0         1        1         1&lt;br /&gt;
-- 4      0         0         1        1         1&lt;br /&gt;
-- 5      1         1         0        1         1&lt;br /&gt;
-- 6      0         1         0        1         1&lt;br /&gt;
-- 7      1         0         0        1         1&lt;br /&gt;
-- 8      0         0         0        1         1&lt;br /&gt;
-- 9      1         1         1        0         1&lt;br /&gt;
-- 10     0         1         1        0         1&lt;br /&gt;
-- 11     1         0         1        0         1&lt;br /&gt;
-- 12     0         0         1        0         1&lt;br /&gt;
-- 13     1         1         0        0         1&lt;br /&gt;
-- 14     0         1         0        0         1&lt;br /&gt;
-- 15     1         0         0        0         1&lt;br /&gt;
-- 16     0         0         0        0         1&lt;br /&gt;
-- 17     1         1         1        1         0&lt;br /&gt;
-- 18     0         1         1        1         0&lt;br /&gt;
-- 19     1         0         1        1         0&lt;br /&gt;
-- 20     0         0         1        1         0&lt;br /&gt;
-- 21     1         1         0        1         0&lt;br /&gt;
-- 22     0         1         0        1         0&lt;br /&gt;
-- 23     1         0         0        1         0&lt;br /&gt;
-- 24     0         0         0        1         0&lt;br /&gt;
-- 25     1         1         1        0         0&lt;br /&gt;
-- 26     0         1         1        0         0&lt;br /&gt;
-- 27     1         0         1        0         0&lt;br /&gt;
-- 28     0         0         1        0         0&lt;br /&gt;
-- 29     1         1         0        0         0&lt;br /&gt;
-- 30     0         1         0        0         0&lt;br /&gt;
-- 31     1         0         0        0         0&lt;br /&gt;
-- 32     0         0         0        0         0&lt;br /&gt;
--&lt;br /&gt;
-- In this scheme the action has the highest priority, as it is the last&lt;br /&gt;
-- to change, and the expiry has the least priority, as it changes the most.&lt;br /&gt;
-- The priorities of the expiry, the protection level and the action are&lt;br /&gt;
-- fixed, but the priorities of the reason and the namespace can be swapped&lt;br /&gt;
-- through the use of the cfg.bannerDataNamespaceHasPriority table.&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- If the reason specified to the template is listed in this table,&lt;br /&gt;
-- namespace data will take priority over reason data in the protectionCategories&lt;br /&gt;
-- table.&lt;br /&gt;
reasonsWithNamespacePriority = {&lt;br /&gt;
	vandalism = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
-- The string to use as a namespace key for the protectionCategories table for each&lt;br /&gt;
-- namespace number.&lt;br /&gt;
categoryNamespaceKeys = {&lt;br /&gt;
	[  2] = 'user',&lt;br /&gt;
	[  3] = 'user',&lt;br /&gt;
	[  4] = 'project',&lt;br /&gt;
	[  6] = 'file',&lt;br /&gt;
	[  8] = 'mediawiki',&lt;br /&gt;
	[ 10] = 'template',&lt;br /&gt;
	[ 12] = 'project',&lt;br /&gt;
	[ 14] = 'category',&lt;br /&gt;
	[100] = 'portal',&lt;br /&gt;
	[828] = 'module',&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
protectionCategories = {&lt;br /&gt;
	['all|all|all|all|all']                  = 'Wikipedia fully protected pages',&lt;br /&gt;
	['all|all|office|all|all']               = 'Wikipedia Office-protected pages',&lt;br /&gt;
	['all|all|reset|all|all']                = 'Wikipedia Office-protected pages',&lt;br /&gt;
	['all|all|dmca|all|all']                 = 'Wikipedia Office-protected pages',&lt;br /&gt;
	['all|all|mainpage|all|all']             = 'Wikipedia fully-protected main page files',&lt;br /&gt;
	['all|all|all|extendedconfirmed|all']    = 'Wikipedia pages under 30-500 editing restriction',&lt;br /&gt;
	['all|all|ecp|extendedconfirmed|all']    = 'Wikipedia pages under 30-500 editing restriction',&lt;br /&gt;
	['all|template|all|all|edit']            = 'Wikipedia fully protected templates',&lt;br /&gt;
	['all|all|all|autoconfirmed|edit']       = 'Wikipedia semi-protected pages',&lt;br /&gt;
	['indef|all|all|autoconfirmed|edit']     = 'Wikipedia indefinitely semi-protected pages',&lt;br /&gt;
	['all|all|blp|autoconfirmed|edit']       = 'Wikipedia indefinitely semi-protected biographies of living people',&lt;br /&gt;
	['temp|all|blp|autoconfirmed|edit']      = 'Wikipedia temporarily semi-protected biographies of living people',&lt;br /&gt;
	['all|all|dispute|autoconfirmed|edit']   = 'Wikipedia pages semi-protected due to dispute',&lt;br /&gt;
	['all|all|sock|autoconfirmed|edit']      = 'Wikipedia pages semi-protected from banned users',&lt;br /&gt;
	['all|all|vandalism|autoconfirmed|edit'] = 'Wikipedia pages semi-protected against vandalism',&lt;br /&gt;
	['all|category|all|autoconfirmed|edit']  = 'Wikipedia semi-protected categories',&lt;br /&gt;
	['all|file|all|autoconfirmed|edit']      = 'Wikipedia semi-protected files',&lt;br /&gt;
	['all|portal|all|autoconfirmed|edit']    = 'Wikipedia semi-protected portals',&lt;br /&gt;
	['all|project|all|autoconfirmed|edit']   = 'Wikipedia semi-protected project pages',&lt;br /&gt;
	['all|talk|all|autoconfirmed|edit']      = 'Wikipedia semi-protected talk pages',&lt;br /&gt;
	['all|template|all|autoconfirmed|edit']  = 'Wikipedia semi-protected templates',&lt;br /&gt;
	['all|user|all|autoconfirmed|edit']      = 'Wikipedia semi-protected user and user talk pages',&lt;br /&gt;
	['all|template|all|templateeditor|edit'] = 'Wikipedia template-protected templates',&lt;br /&gt;
	['all|all|blp|sysop|edit']               = 'Wikipedia indefinitely protected biographies of living people',&lt;br /&gt;
	['temp|all|blp|sysop|edit']              = 'Wikipedia temporarily protected biographies of living people',&lt;br /&gt;
	['all|all|dispute|sysop|edit']           = 'Wikipedia pages protected due to dispute',&lt;br /&gt;
	['all|all|sock|sysop|edit']              = 'Wikipedia pages protected from banned users',&lt;br /&gt;
	['all|all|vandalism|sysop|edit']         = 'Wikipedia pages protected against vandalism',&lt;br /&gt;
	['all|category|all|sysop|edit']          = 'Wikipedia protected categories',&lt;br /&gt;
	['all|file|all|sysop|edit']              = 'Wikipedia fully-protected files',&lt;br /&gt;
	['all|project|all|sysop|edit']           = 'Wikipedia fully-protected project pages',&lt;br /&gt;
	['all|talk|all|sysop|edit']              = 'Wikipedia fully-protected talk pages',&lt;br /&gt;
	['all|template|all|sysop|edit']          = 'Wikipedia fully protected templates',&lt;br /&gt;
	['all|user|all|sysop|edit']              = 'Wikipedia protected user and user talk pages',&lt;br /&gt;
	['all|module|all|all|edit']              = 'Wikipedia fully-protected modules',&lt;br /&gt;
	['all|module|all|templateeditor|edit']   = 'Wikipedia template-protected modules',&lt;br /&gt;
	['all|module|all|autoconfirmed|edit']    = 'Wikipedia semi-protected modules',&lt;br /&gt;
	['all|all|all|sysop|move']               = 'Wikipedia move-protected pages',&lt;br /&gt;
	['indef|all|all|sysop|move']             = 'Wikipedia indefinitely move-protected pages',&lt;br /&gt;
	['all|all|dispute|sysop|move']           = 'Wikipedia pages move-protected due to dispute',&lt;br /&gt;
	['all|all|vandalism|sysop|move']         = 'Wikipedia pages move-protected due to vandalism',&lt;br /&gt;
	['all|portal|all|sysop|move']            = 'Wikipedia move-protected portals',&lt;br /&gt;
	['all|portal|all|sysop|move']            = 'Wikipedia move-protected portals',&lt;br /&gt;
	['all|project|all|sysop|move']           = 'Wikipedia move-protected project pages',&lt;br /&gt;
	['all|talk|all|sysop|move']              = 'Wikipedia move-protected talk pages',&lt;br /&gt;
	['all|template|all|sysop|move']          = 'Wikipedia move-protected templates',&lt;br /&gt;
	['all|user|all|sysop|move']              = 'Wikipedia move-protected user and user talk pages',&lt;br /&gt;
	['all|all|all|autoconfirmed|autoreview'] = 'Wikipedia pending changes protected pages',&lt;br /&gt;
	['all|file|all|all|upload']              = 'Wikipedia upload-protected files',&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Expiry category config&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table configures the expiry category behaviour for each protection&lt;br /&gt;
-- action.&lt;br /&gt;
-- * If set to true, setting that action will always categorise the page if&lt;br /&gt;
--   an expiry parameter is not set.&lt;br /&gt;
-- * If set to false, setting that action will never categorise the page.&lt;br /&gt;
-- * If set to nil, the module will categorise the page if:&lt;br /&gt;
--   1) an expiry parameter is not set, and&lt;br /&gt;
--   2) a reason is provided, and&lt;br /&gt;
--   3) the specified reason is not blacklisted in the reasonsWithoutExpiryCheck&lt;br /&gt;
--      table.&lt;br /&gt;
&lt;br /&gt;
expiryCheckActions = {&lt;br /&gt;
	edit = nil,&lt;br /&gt;
	move = false,&lt;br /&gt;
	autoreview = true,&lt;br /&gt;
	upload = false&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
reasonsWithoutExpiryCheck = {&lt;br /&gt;
	blp = true,&lt;br /&gt;
	template = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Pagetypes&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table produces the page types available with the ${PAGETYPE} parameter.&lt;br /&gt;
-- Keys are namespace numbers, or the string &amp;quot;default&amp;quot; for the default value.&lt;br /&gt;
pagetypes = {&lt;br /&gt;
	[0] = 'article',&lt;br /&gt;
	[6] = 'file',&lt;br /&gt;
	[10] = 'template',&lt;br /&gt;
	[14] = 'category',&lt;br /&gt;
	[828] = 'module',&lt;br /&gt;
	default = 'page'&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Strings marking indefinite protection&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table contains values passed to the expiry parameter that mean the page&lt;br /&gt;
-- is protected indefinitely.&lt;br /&gt;
indefStrings = {&lt;br /&gt;
	['indef'] = true,&lt;br /&gt;
	['indefinite'] = true,&lt;br /&gt;
	['indefinitely'] = true,&lt;br /&gt;
	['infinite'] = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Group hierarchy&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table maps each group to all groups that have a superset of the original&lt;br /&gt;
-- group's page editing permissions.&lt;br /&gt;
hierarchy = {&lt;br /&gt;
	sysop = {},&lt;br /&gt;
	reviewer = {'sysop'},&lt;br /&gt;
	filemover = {'sysop'},&lt;br /&gt;
	templateeditor = {'sysop'},&lt;br /&gt;
	extendedconfirmed = {'sysop'},&lt;br /&gt;
	autoconfirmed = {'reviewer', 'filemover', 'templateeditor', 'extendedconfirmed'},&lt;br /&gt;
	user = {'autoconfirmed'},&lt;br /&gt;
	['*'] = {'user'}&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Wrapper templates and their default arguments&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This table contains wrapper templates used with the module, and their&lt;br /&gt;
-- default arguments. Templates specified in this table should contain the&lt;br /&gt;
-- following invocation, and no other template content:&lt;br /&gt;
--&lt;br /&gt;
-- {{#invoke:Protection banner|main}}&lt;br /&gt;
--&lt;br /&gt;
-- If other content is desired, it can be added between&lt;br /&gt;
-- &amp;lt;noinclude&amp;gt;...&amp;lt;/noinclude&amp;gt; tags.&lt;br /&gt;
--&lt;br /&gt;
-- When a user calls one of these wrapper templates, they will use the&lt;br /&gt;
-- default arguments automatically. However, users can override any of the&lt;br /&gt;
-- arguments.&lt;br /&gt;
wrappers = {&lt;br /&gt;
	['Template:Pp']                         = {},&lt;br /&gt;
	['Template:Pp-30-500']                  = {'ecp'},&lt;br /&gt;
	['Template:Pp-blp']                     = {'blp'},&lt;br /&gt;
	-- we don't need Template:Pp-create&lt;br /&gt;
	['Template:Pp-dispute']                 = {'dispute'},&lt;br /&gt;
	['Template:Pp-main-page']               = {'mainpage'},&lt;br /&gt;
	['Template:Pp-move']                    = {action = 'move'},&lt;br /&gt;
	['Template:Pp-move-dispute']            = {'dispute', action = 'move'},&lt;br /&gt;
	-- we don't need Template:Pp-move-indef&lt;br /&gt;
	['Template:Pp-move-vandalism']          = {'vandalism', action = 'move'},&lt;br /&gt;
	['Template:Pp-office']                  = {'office'},&lt;br /&gt;
	['Template:Pp-office-dmca']             = {'dmca'},&lt;br /&gt;
	['Template:Pp-pc']                      = {action = 'autoreview', small = true},&lt;br /&gt;
	['Template:Pp-pc1']                     = {action = 'autoreview', small = true},&lt;br /&gt;
	['Template:Pp-reset']                   = {'reset'},&lt;br /&gt;
	['Template:Pp-semi-indef']              = {small = true},&lt;br /&gt;
	['Template:Pp-sock']                    = {'sock'},&lt;br /&gt;
	['Template:Pp-template']                = {'template', small = true},&lt;br /&gt;
	['Template:Pp-upload']                  = {action = 'upload'},&lt;br /&gt;
	['Template:Pp-usertalk']                = {'usertalk'},&lt;br /&gt;
	['Template:Pp-vandalism']               = {'vandalism'},&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- &lt;br /&gt;
--                                 MESSAGES&lt;br /&gt;
-- &lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
msg = {&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Intro blurb and intro fragment&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages specify what is produced by the ${INTROBLURB} and&lt;br /&gt;
-- ${INTROFRAGMENT} parameters. If the protection is temporary they use the&lt;br /&gt;
-- intro-blurb-expiry or intro-fragment-expiry, and if not they use&lt;br /&gt;
-- intro-blurb-noexpiry or intro-fragment-noexpiry.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
['intro-blurb-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY}.',&lt;br /&gt;
['intro-blurb-noexpiry'] = '${PROTECTIONBLURB}.',&lt;br /&gt;
['intro-fragment-expiry'] = '${PROTECTIONBLURB} until ${EXPIRY},',&lt;br /&gt;
['intro-fragment-noexpiry'] = '${PROTECTIONBLURB}',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Tooltip blurb&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages specify what is produced by the ${TOOLTIPBLURB} parameter.&lt;br /&gt;
-- If the protection is temporary the tooltip-blurb-expiry message is used, and&lt;br /&gt;
-- if not the tooltip-blurb-noexpiry message is used.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
['tooltip-blurb-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY}.',&lt;br /&gt;
['tooltip-blurb-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}.',&lt;br /&gt;
['tooltip-fragment-expiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL} until ${EXPIRY},',&lt;br /&gt;
['tooltip-fragment-noexpiry'] = 'This ${PAGETYPE} is ${PROTECTIONLEVEL}',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Special explanation blurb&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- An explanation blurb for pages that cannot be unprotected, e.g. for pages&lt;br /&gt;
-- in the MediaWiki namespace.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
['explanation-blurb-nounprotect'] = 'See the [[Wikipedia:Protection policy|'&lt;br /&gt;
	.. 'protection policy]] and ${PROTECTIONLOG} for more details.'&lt;br /&gt;
	.. ' Please discuss any changes on the ${TALKPAGE}; you'&lt;br /&gt;
	.. ' may ${EDITREQUEST} to ask an'&lt;br /&gt;
	.. ' [[Wikipedia:Administrators|administrator]] to make an edit if it'&lt;br /&gt;
	.. ' is [[Help:Minor edit#When to mark an edit as a minor edit'&lt;br /&gt;
	.. '|uncontroversial]] or supported by [[Wikipedia:Consensus'&lt;br /&gt;
	.. '|consensus]].',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Protection log display values&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine the display values for the protection log link&lt;br /&gt;
-- or the pending changes log link produced by the ${PROTECTIONLOG} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
['protection-log-display'] = 'protection log',&lt;br /&gt;
['pc-log-display'] = 'pending changes log',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Current version display values&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine the display values for the page history link&lt;br /&gt;
-- or the move log link produced by the ${CURRENTVERSION} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in these messages.&lt;br /&gt;
['current-version-move-display'] = 'current title',&lt;br /&gt;
['current-version-edit-display'] = 'current version',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Talk page&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This message determines the display value of the talk page link produced&lt;br /&gt;
-- with the ${TALKPAGE} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
['talk-page-link-display'] = 'talk page',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Edit requests&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This message determines the display value of the edit request link produced&lt;br /&gt;
-- with the ${EDITREQUEST} parameter.&lt;br /&gt;
-- It is possible to use banner parameters in this message.&lt;br /&gt;
['edit-request-display'] = 'submit an edit request',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Expiry date format&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- This is the format for the blurb expiry date. It should be valid input for&lt;br /&gt;
-- the first parameter of the #time parser function.&lt;br /&gt;
['expiry-date-format'] = 'F j, Y &amp;quot;at&amp;quot; H:i e',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These messages determine which tracking categories the module outputs.&lt;br /&gt;
['tracking-category-incorrect'] = 'Wikipedia pages with incorrect protection templates',&lt;br /&gt;
['tracking-category-template'] = 'Wikipedia template-protected pages other than templates and modules',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Images&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- These are images that are not defined by their protection action and protection level.&lt;br /&gt;
['image-filename-indef'] = 'Full-protection-shackle.svg',&lt;br /&gt;
['image-filename-default'] = 'Transparent.gif',&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- End messages&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Yesno&amp;diff=4619</id>
		<title>Module:Yesno</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Yesno&amp;diff=4619"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- Function allowing for consistent treatment of boolean-like wikitext input.&lt;br /&gt;
-- It works similarly to the template {{yesno}}.&lt;br /&gt;
&lt;br /&gt;
return function (val, default)&lt;br /&gt;
	-- If your wiki uses non-ascii characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you&lt;br /&gt;
	-- should replace &amp;quot;val:lower()&amp;quot; with &amp;quot;mw.ustring.lower(val)&amp;quot; in the&lt;br /&gt;
	-- following line.&lt;br /&gt;
	val = type(val) == 'string' and val:lower() or val&lt;br /&gt;
	if val == nil then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif val == true &lt;br /&gt;
		or val == 'yes'&lt;br /&gt;
		or val == 'y'&lt;br /&gt;
		or val == 'true'&lt;br /&gt;
		or val == 't'&lt;br /&gt;
		or val == 'on'&lt;br /&gt;
		or tonumber(val) == 1&lt;br /&gt;
	then&lt;br /&gt;
		return true&lt;br /&gt;
	elseif val == false&lt;br /&gt;
		or val == 'no'&lt;br /&gt;
		or val == 'n'&lt;br /&gt;
		or val == 'false'&lt;br /&gt;
		or val == 'f'&lt;br /&gt;
		or val == 'off'&lt;br /&gt;
		or tonumber(val) == 0&lt;br /&gt;
	then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:%3D&amp;diff=4621</id>
		<title>Template:=</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:%3D&amp;diff=4621"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Em&amp;diff=4623</id>
		<title>Template:Em</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Em&amp;diff=4623"/>
				<updated>2019-03-18T12:10:57Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;em {{#if:{{{role|}}}|role=&amp;quot;{{{role}}}&amp;quot;}} {{#if:{{{class|}}}|class=&amp;quot;{{{class}}}&amp;quot;}} {{#if:{{{id|}}}|id=&amp;quot;{{{id}}}&amp;quot;}} {{#if:{{{style|}}}|style=&amp;quot;{{{style}}}&amp;quot;}} {{#if:{{{title|}}}|title=&amp;quot;{{{title}}}&amp;quot;}}&amp;gt;{{{1}}}&amp;lt;/em&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage, not here! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Expand_list/metadoc&amp;diff=4595</id>
		<title>Template:Expand list/metadoc</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Expand_list/metadoc&amp;diff=4595"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Templates ===&lt;br /&gt;
The following templates are used for organising lists. Please use the most relevant template, and do not add more than one unless the subject falls significantly under two template topics.&lt;br /&gt;
&lt;br /&gt;
* {{Tlx|Expand list}}, the generic template used to indicate an incomplete list&lt;br /&gt;
** {{Tlx|Inc-film}}, for incomplete film-related lists&lt;br /&gt;
** {{Tlx|Inc-lit}}, for incomplete literature-related lists&lt;br /&gt;
** {{Tlx|Inc-musong}}, for incomplete music-related lists&lt;br /&gt;
** {{Tlx|Inc-personnel}}, for an incomplete list of personnel in a musical group&lt;br /&gt;
** {{Tlx|Inc-sport}}, for incomplete sports-related lists&lt;br /&gt;
*** {{Tlx|Inc-results}}, for incomplete lists of sports results or fixtures&lt;br /&gt;
** {{Tlx|Inc-transport}}, for incomplete transportation-related lists&lt;br /&gt;
** {{Tlx|Inc-tv}}, for incomplete television-related lists&lt;br /&gt;
** {{Tlx|Inc-vg}}, for incomplete video-game-related lists&lt;br /&gt;
** {{tlx|Inc-alumni}}, for incomplete college/university alumni and related lists&lt;br /&gt;
* {{Tlx|Inc-up}}, for a list that is frequently updated&lt;br /&gt;
* {{Tlx|Dynamic list}}, for lists that may never be able to satisfy certain standards for completion&lt;br /&gt;
* {{Tlx|Dynamic a-list}}, for articles that contain lists that may never be able to satisfy certain standards for completion&lt;br /&gt;
* {{Tlx|Complete list}}, for lists that are complete as of a specified date&lt;br /&gt;
&lt;br /&gt;
Other templates may be available under [[:Category:Hatnote templates for lists]]. Please update this documentation page if a new, relevant template has been created.&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
*{{tl|List-stub}}&lt;br /&gt;
*{{tl|Expand section}}&lt;br /&gt;
*[[Wikipedia:Categories, lists, and navigation templates]]&lt;br /&gt;
*[[Wikipedia:Featured list criteria]]&lt;br /&gt;
*[[Wikipedia:Incomplete lists]]&lt;br /&gt;
*[[Wikipedia:Template messages/Cleanup#Lists]]&lt;br /&gt;
*[[Wikipedia:Template messages/Lists]]&lt;br /&gt;
*[[Wikipedia:WikiProject Lists]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Tl&amp;diff=4597</id>
		<title>Template:Tl</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Tl&amp;diff=4597"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;amp;#123;&amp;amp;#123;[[Template:{{{1}}}|{{{1}}}]]&amp;amp;#125;&amp;amp;#125;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage and interwikis go on Wikidata. --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Tlx&amp;diff=4599</id>
		<title>Template:Tlx</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Tlx&amp;diff=4599"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
    --&amp;gt;&amp;lt;code&amp;gt;&amp;lt;!--&lt;br /&gt;
        --&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;{{#if:{{{subst|}}} |[[Help:Substitution|subst]]:}}&amp;lt;!--&lt;br /&gt;
                     --&amp;gt;[[{{{LANG|}}}{{{SISTER|}}}{{ns:Template}}:{{{1|}}}|{{{1|}}}]]&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{2|}}}  |&amp;amp;#124;{{{2}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{3|}}}  |&amp;amp;#124;{{{3}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{4|}}}  |&amp;amp;#124;{{{4}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{5|}}}  |&amp;amp;#124;{{{5}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{6|}}}  |&amp;amp;#124;{{{6}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{7|}}}  |&amp;amp;#124;{{{7}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{8|}}}  |&amp;amp;#124;{{{8}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{9|}}}  |&amp;amp;#124;{{{9}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{10|}}} |&amp;amp;#124;{{{10}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{11|}}} |&amp;amp;#124;{{{11}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{12|}}} |&amp;amp;#124;{{{12}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{13|}}} |&amp;amp;#124;{{{13}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{14|}}} |&amp;amp;#124;{{{14}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{15|}}} |&amp;amp;#124;{{{15}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{16|}}} |&amp;amp;#124;{{{16}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{17|}}} |&amp;amp;#124;{{{17}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{18|}}} |&amp;amp;#124;{{{18}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{19|}}} |&amp;amp;#124;{{{19}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{20|}}} |&amp;amp;#124;{{{20}}}}}&amp;lt;!--&lt;br /&gt;
                          --&amp;gt;{{#if:{{{21|}}} |&amp;amp;#124;''...''}}&amp;lt;!--&lt;br /&gt;
        --&amp;gt;&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt;&amp;lt;!--&lt;br /&gt;
    --&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Documentation&amp;diff=4601</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Documentation&amp;diff=4601"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
local messageBox = require('Module:Message box')&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData('Module:Documentation/config')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is 'string'.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value 'Foo $2 bar $1.',&lt;br /&gt;
	-- message('foo-message', {'baz', 'qux'}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or 'string'&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = ugsub(msg, '$([1-9][0-9]*)', getMessageVal)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.message = message&lt;br /&gt;
&lt;br /&gt;
local function makeWikilink(page, display)&lt;br /&gt;
	if display then&lt;br /&gt;
		return mw.ustring.format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. ':' .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format('[%s %s]', url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select('#', ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	return '&amp;lt;small style=&amp;quot;font-style: normal;&amp;quot;&amp;gt;(' .. table.concat(ret, ' &amp;amp;#124; ') .. ')&amp;lt;/small&amp;gt;'&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == 'string' then&lt;br /&gt;
					value = value:match('^%s*(.-)%s*$') -- Remove whitespace.&lt;br /&gt;
					if key == 'heading' or value ~= '' then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Main function&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc('_main')&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'main-div-id' --&amp;gt; 'template-documentation'&lt;br /&gt;
	-- 'main-div-classes' --&amp;gt; 'template-documentation iezoomfix'&lt;br /&gt;
	--]]&lt;br /&gt;
	local env = p.getEnvironment(args)&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
	root&lt;br /&gt;
		:wikitext(p.protectionTemplate(env))&lt;br /&gt;
		:wikitext(p.sandboxNotice(args, env))&lt;br /&gt;
		 -- This div tag is from {{documentation/start box}}, but moving it here&lt;br /&gt;
		 -- so that we don't have to worry about unclosed tags.&lt;br /&gt;
		:tag('div')&lt;br /&gt;
			:attr('id', message('main-div-id'))&lt;br /&gt;
			:addClass(message('main-div-classes'))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:wikitext(p._startBox(args, env))&lt;br /&gt;
			:wikitext(p._content(args, env))&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				:css('clear', 'both') -- So right or left floating items don't stick out of the doc box.&lt;br /&gt;
				:newline()&lt;br /&gt;
				:done()&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p._endBox(args, env))&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Environment settings&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.getEnvironment(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Returns a table with information about the environment, including title objects and other namespace- or&lt;br /&gt;
	-- path-related data.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--&lt;br /&gt;
	-- Title objects include:&lt;br /&gt;
	-- env.title - the page we are making documentation for (usually the current title)&lt;br /&gt;
	-- env.templateTitle - the template (or module, file, etc.)&lt;br /&gt;
	-- env.docTitle - the /doc subpage.&lt;br /&gt;
	-- env.sandboxTitle - the /sandbox subpage.&lt;br /&gt;
	-- env.testcasesTitle - the /testcases subpage.&lt;br /&gt;
	-- env.printTitle - the print version of the template, located at the /Print subpage.&lt;br /&gt;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title's subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don't call any of the functions&lt;br /&gt;
	-- more than once. (Nils won't be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. '/' .. message('doc-subpage')&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'print-subpage' --&amp;gt; 'Print'&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message('print-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the same as the&lt;br /&gt;
		-- subject namespace. However, pages in the Article, File, MediaWiki or Category&lt;br /&gt;
		-- namespaces must have their /doc, /sandbox and /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. ':' .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				'Special:ComparePages',&lt;br /&gt;
				{page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-notice-image' --&amp;gt; '[[Image:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
	-- 'sandbox-notice-blurb' --&amp;gt; 'This is the $1 for $2.'&lt;br /&gt;
	-- 'sandbox-notice-diff-blurb' --&amp;gt; 'This is the $1 for $2 ($3).'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-template' --&amp;gt; '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-module' --&amp;gt; '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-other' --&amp;gt; 'sandbox page'&lt;br /&gt;
	-- 'sandbox-notice-compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'sandbox-notice-testcases-blurb' --&amp;gt; 'See also the companion subpage for $1.'&lt;br /&gt;
	-- 'sandbox-notice-testcases-link-display' --&amp;gt; 'test cases'&lt;br /&gt;
	-- 'sandbox-category' --&amp;gt; 'Template sandboxes'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message('sandbox-notice-image')&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = ''&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-template')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-module')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-other')&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if compareUrl then&lt;br /&gt;
		local compareDisplay = message('sandbox-notice-compare-link-display')&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-blurb', {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	text = text .. makeCategoryLink(message('sandbox-category'))&lt;br /&gt;
	omargs.text = text&lt;br /&gt;
	local ret = '&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;'&lt;br /&gt;
	ret = ret .. messageBox.main('ombox', omargs)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'protection-template' --&amp;gt; 'pp-template'&lt;br /&gt;
	-- 'protection-template-args' --&amp;gt; {docusage = 'yes'}&lt;br /&gt;
	local protectionLevels, mProtectionBanner&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editProt = protectionLevels.edit and protectionLevels.edit[1]&lt;br /&gt;
	local moveProt = protectionLevels.move and protectionLevels.move[1]&lt;br /&gt;
	if editProt then&lt;br /&gt;
		-- The page is edit-protected.&lt;br /&gt;
		mProtectionBanner = require('Module:Protection banner')&lt;br /&gt;
		local reason = message('protection-reason-edit')&lt;br /&gt;
		return mProtectionBanner._main{reason, small = true}&lt;br /&gt;
	elseif moveProt and moveProt ~= 'autoconfirmed' then&lt;br /&gt;
		-- The page is move-protected but not edit-protected. Exclude move&lt;br /&gt;
		-- protection with the level &amp;quot;autoconfirmed&amp;quot;, as this is equivalent to&lt;br /&gt;
		-- no move protection at all.&lt;br /&gt;
		mProtectionBanner = require('Module:Protection banner')&lt;br /&gt;
		return mProtectionBanner._main{action = 'move', small = true}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc('_startBox')&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'view-link-display' --&amp;gt; 'view'&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'purge-link-display' --&amp;gt; 'purge'&lt;br /&gt;
	-- 'file-docpage-preload' --&amp;gt; 'Template:Documentation/preload-filespace'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'docpage-preload' --&amp;gt; 'Template:Documentation/preload'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message('view-link-display')&lt;br /&gt;
	data.editLinkDisplay = message('edit-link-display')&lt;br /&gt;
	data.historyLinkDisplay = message('history-link-display')&lt;br /&gt;
	data.purgeLinkDisplay = message('purge-link-display')&lt;br /&gt;
	-- Create link if /doc doesn't exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message('file-docpage-preload')&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message('module-preload')&lt;br /&gt;
		else&lt;br /&gt;
			preload = message('docpage-preload')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message('create-link-display')&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub('%[', '&amp;amp;#91;') -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub('%]', '&amp;amp;#93;')&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = 'edit'}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = 'history'}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = 'purge'}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = '[%s] [%s] [%s] [%s]'&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = '[%s]'&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'documentation-icon-wikitext' --&amp;gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
	-- 'template-namespace-heading' --&amp;gt; 'Template documentation'&lt;br /&gt;
	-- 'module-namespace-heading' --&amp;gt; 'Module documentation'&lt;br /&gt;
	-- 'file-namespace-heading' --&amp;gt; 'Summary'&lt;br /&gt;
	-- 'other-namespaces-heading' --&amp;gt; 'Documentation'&lt;br /&gt;
	-- 'start-box-linkclasses' --&amp;gt; 'mw-editsection-like plainlinks'&lt;br /&gt;
	-- 'start-box-link-id' --&amp;gt; 'doc_editlinks'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == '' then&lt;br /&gt;
		-- Don't display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message('file-namespace-heading')&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message('other-namespaces-heading')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args['heading-style']&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	elseif subjectSpace == 10 then&lt;br /&gt;
		-- We are in the template or template talk namespaces.&lt;br /&gt;
		data.headingFontWeight = 'bold'&lt;br /&gt;
		data.headingFontSize = '125%'&lt;br /&gt;
	else&lt;br /&gt;
		data.headingFontSize = '150%'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		data.linksClass = message('start-box-linkclasses')&lt;br /&gt;
		data.linksId = message('start-box-link-id')&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create('div')&lt;br /&gt;
	sbox&lt;br /&gt;
		:css('padding-bottom', '3px')&lt;br /&gt;
		:css('border-bottom', '1px solid #aaa')&lt;br /&gt;
		:css('margin-bottom', '1ex')&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag('span')&lt;br /&gt;
			:cssText(data.headingStyleText)&lt;br /&gt;
			:css('font-weight', data.headingFontWeight)&lt;br /&gt;
			:css('font-size', data.headingFontSize)&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox:tag('span')&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr('id', data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc('_content')&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	return '\n' .. (content or '') .. '\n' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc('_contentTitle')&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc('_endBox')&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'fmbox-id' --&amp;gt; 'documentation-meta-data'&lt;br /&gt;
	-- 'fmbox-style' --&amp;gt; 'background-color: #ecfcf4'&lt;br /&gt;
	-- 'fmbox-textstyle' --&amp;gt; 'font-style: italic'&lt;br /&gt;
	-- &lt;br /&gt;
	-- The HTML is generated by the {{fmbox}} template, courtesy of [[Module:Message box]].&lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args['link box']&lt;br /&gt;
	if linkBox == 'off'&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the arguments for {{fmbox}}.&lt;br /&gt;
	local fmargs = {}&lt;br /&gt;
	fmargs.id = message('fmbox-id') -- Sets 'documentation-meta-data'&lt;br /&gt;
	fmargs.image = 'none'&lt;br /&gt;
	fmargs.style = message('fmbox-style') -- Sets 'background-color: #ecfcf4'&lt;br /&gt;
	fmargs.textstyle = message('fmbox-textstyle') -- 'font-style: italic;'&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the fmbox text field.&lt;br /&gt;
	local text = ''&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or '') -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template's sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or '')&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don't show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or '')&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. '&amp;lt;br /&amp;gt;' .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	fmargs.text = text&lt;br /&gt;
&lt;br /&gt;
	return messageBox.main('fmbox', fmargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'transcluded-from-blurb' --&amp;gt; &lt;br /&gt;
	-- 'The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Wikipedia:Transclusion|transcluded]] from $1.'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'create-module-doc-blurb' --&amp;gt;&lt;br /&gt;
	-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editUrl = docTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local editDisplay = message('edit-link-display')&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = 'history'}&lt;br /&gt;
		local historyDisplay = message('history-link-display')&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message('transcluded-from-blurb', {docLink})&lt;br /&gt;
			.. ' '&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = 'edit', preload = message('module-preload')}&lt;br /&gt;
		local createDisplay = message('create-link-display')&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message('create-module-doc-blurb', {createLink})&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'sandbox-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'module-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'sandbox-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'mirror-edit-summary' --&amp;gt; 'Create sandbox version of $1'&lt;br /&gt;
	-- 'mirror-link-display' --&amp;gt; 'mirror'&lt;br /&gt;
	-- 'mirror-link-preload' --&amp;gt; 'Template:Documentation/mirror'&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display'--&amp;gt; 'edit'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'module-testcases-preload' --&amp;gt; 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
	-- 'template-testcases-preload' --&amp;gt; 'Template:Documentation/preload-testcases'&lt;br /&gt;
	-- 'experiment-blurb-module' --&amp;gt; 'Editors can experiment in this module's $1 and $2 pages.'&lt;br /&gt;
	-- 'experiment-blurb-template' --&amp;gt; 'Editors can experiment in this template's $1 and $2 pages.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message('sandbox-link-display')&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local sandboxEditDisplay = message('sandbox-edit-link-display')&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message('compare-link-display')&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message('module-sandbox-preload')&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message('template-sandbox-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = 'edit', preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message('sandbox-create-link-display')&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message('mirror-link-preload')&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message('mirror-link-display')&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message('testcases-link-display')&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = 'edit'}&lt;br /&gt;
		local testcasesEditDisplay = message('testcases-edit-link-display')&lt;br /&gt;
		local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)&lt;br /&gt;
		-- for Modules, add testcases run link if exists&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot;  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then&lt;br /&gt;
			local testcasesRunLinkDisplay = message('testcases-run-link-display')&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message('module-testcases-preload')&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message('template-testcases-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = 'edit', preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message('testcases-create-link-display')&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = 'experiment-blurb-module'&lt;br /&gt;
	else&lt;br /&gt;
		messageName = 'experiment-blurb-template'&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'doc-link-display' --&amp;gt; '/doc'&lt;br /&gt;
	-- 'add-categories-blurb' --&amp;gt; 'Please add categories to the $1 subpage.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))&lt;br /&gt;
	return message('add-categories-blurb', {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'template-pagetype' --&amp;gt; 'template'&lt;br /&gt;
	-- 'module-pagetype' --&amp;gt; 'module'&lt;br /&gt;
	-- 'default-pagetype' --&amp;gt; 'page'&lt;br /&gt;
	-- 'subpages-link-display' --&amp;gt; 'Subpages of this $1'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('template-pagetype')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('module-pagetype')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('default-pagetype')&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',&lt;br /&gt;
		message('subpages-link-display', {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message('subpages-blurb', {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'print-link-display' --&amp;gt; '/Print'&lt;br /&gt;
	-- 'print-blurb' --&amp;gt; 'A [[Help:Books/for experts#Improving the book layout|print version]]'&lt;br /&gt;
	--		.. ' of this template exists at $1.'&lt;br /&gt;
	--		.. ' If you make a change to this template, please update the print version as well.'&lt;br /&gt;
	-- 'display-print-category' --&amp;gt; true&lt;br /&gt;
	-- 'print-category' --&amp;gt; 'Templates with print versions'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))&lt;br /&gt;
		ret = message('print-blurb', {printLink})&lt;br /&gt;
		local displayPrintCategory = message('display-print-category', nil, 'boolean')&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message('print-category'))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'display-strange-usage-category' --&amp;gt; true&lt;br /&gt;
	-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
	-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'strange-usage-category' --&amp;gt; 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = ''&lt;br /&gt;
	if message('display-strange-usage-category', nil, 'boolean')&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message('doc-subpage')&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message('testcases-subpage')&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message('strange-usage-category'))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Documentation/config&amp;diff=4603</id>
		<title>Module:Documentation/config</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Documentation/config&amp;diff=4603"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;----------------------------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                               Configuration for Module:Documentation&lt;br /&gt;
--&lt;br /&gt;
-- Here you can set the values of the parameters and messages used in Module:Documentation to&lt;br /&gt;
-- localise it to your wiki and your language. Unless specified otherwise, values given here&lt;br /&gt;
-- should be string values.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Do not edit this line.&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Protection template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['protection-reason-edit']&lt;br /&gt;
-- The protection reason for edit-protected templates to pass to&lt;br /&gt;
-- [[Module:Protection banner]].&lt;br /&gt;
cfg['protection-reason-edit'] = 'template'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox notice configuration&lt;br /&gt;
--&lt;br /&gt;
-- On sandbox pages the module can display a template notifying users that the current page is a&lt;br /&gt;
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a&lt;br /&gt;
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the&lt;br /&gt;
-- messages that the notices contains.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-notice-image']&lt;br /&gt;
-- The image displayed in the sandbox notice.&lt;br /&gt;
cfg['sandbox-notice-image'] = '[[Image:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-template']&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-module']&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-other']&lt;br /&gt;
-- The page type of the sandbox page. The message that is displayed depends on the current subject&lt;br /&gt;
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or&lt;br /&gt;
-- cfg['sandbox-notice-diff-blurb'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-diff-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-diff-display']&lt;br /&gt;
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence&lt;br /&gt;
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page&lt;br /&gt;
-- type, which is either cfg['sandbox-notice-pagetype-template'],&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what&lt;br /&gt;
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between&lt;br /&gt;
-- the sandbox and the main template. The display value of the diff link is set by &lt;br /&gt;
-- cfg['sandbox-notice-compare-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'&lt;br /&gt;
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'&lt;br /&gt;
cfg['sandbox-notice-compare-link-display'] = 'diff'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-testcases-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-link-display']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-link-display']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test&lt;br /&gt;
-- cases page, and $2 is a link to the page to run it.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test&lt;br /&gt;
-- cases.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'&lt;br /&gt;
cfg['sandbox-notice-testcases-link-display'] = 'test cases'&lt;br /&gt;
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'&lt;br /&gt;
cfg['sandbox-notice-testcases-run-link-display'] = 'run'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-category']&lt;br /&gt;
-- A category to add to all template sandboxes.&lt;br /&gt;
cfg['sandbox-category'] = 'Template sandboxes'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Start box configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['documentation-icon-wikitext']&lt;br /&gt;
-- The wikitext for the icon shown at the top of the template.&lt;br /&gt;
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-namespace-heading']&lt;br /&gt;
-- The heading shown in the template namespace.&lt;br /&gt;
cfg['template-namespace-heading'] = 'Template documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-namespace-heading']&lt;br /&gt;
-- The heading shown in the module namespace.&lt;br /&gt;
cfg['module-namespace-heading'] = 'Module documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['file-namespace-heading']&lt;br /&gt;
-- The heading shown in the file namespace.&lt;br /&gt;
cfg['file-namespace-heading'] = 'Summary'&lt;br /&gt;
&lt;br /&gt;
-- cfg['other-namespaces-heading']&lt;br /&gt;
-- The heading shown in other namespaces.&lt;br /&gt;
cfg['other-namespaces-heading'] = 'Documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['view-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;view&amp;quot; links.&lt;br /&gt;
cfg['view-link-display'] = 'view'&lt;br /&gt;
&lt;br /&gt;
-- cfg['edit-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['history-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;history&amp;quot; links.&lt;br /&gt;
cfg['history-link-display'] = 'history'&lt;br /&gt;
&lt;br /&gt;
-- cfg['purge-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;purge&amp;quot; links.&lt;br /&gt;
cfg['purge-link-display'] = 'purge'&lt;br /&gt;
&lt;br /&gt;
-- cfg['create-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Link box (end box) configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['transcluded-from-blurb']&lt;br /&gt;
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.&lt;br /&gt;
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Wikipedia:Transclusion|transcluded]] from $1.'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['create-module-doc-blurb']&lt;br /&gt;
-- Notice displayed in the module namespace when the documentation subpage does not exist.&lt;br /&gt;
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the&lt;br /&gt;
-- display cfg['create-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Experiment blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['experiment-blurb-template']&lt;br /&gt;
-- cfg['experiment-blurb-module']&lt;br /&gt;
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.&lt;br /&gt;
-- It is only shown in the template and module namespaces. With the default English settings, it&lt;br /&gt;
-- might look like this:&lt;br /&gt;
--&lt;br /&gt;
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&lt;br /&gt;
--&lt;br /&gt;
-- In this example, &amp;quot;sandbox&amp;quot;, &amp;quot;edit&amp;quot;, &amp;quot;diff&amp;quot;, &amp;quot;testcases&amp;quot;, and &amp;quot;edit&amp;quot; would all be links.&lt;br /&gt;
--&lt;br /&gt;
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending&lt;br /&gt;
-- on what namespace we are in.&lt;br /&gt;
-- &lt;br /&gt;
-- Parameters:&lt;br /&gt;
--&lt;br /&gt;
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])&lt;br /&gt;
-- &lt;br /&gt;
-- If the sandbox doesn't exist, it is in the format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])&lt;br /&gt;
-- &lt;br /&gt;
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']&lt;br /&gt;
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']&lt;br /&gt;
-- loads a default edit summary of cfg['mirror-edit-summary'].&lt;br /&gt;
--&lt;br /&gt;
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn't exist, it is in the format:&lt;br /&gt;
-- &lt;br /&gt;
--     cfg['testcases-link-display'] (cfg['testcases-create-link-display'])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the&lt;br /&gt;
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current&lt;br /&gt;
-- namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['experiment-blurb-template'] = &amp;quot;Editors can experiment in this template's $1 and $2 pages.&amp;quot;&lt;br /&gt;
cfg['experiment-blurb-module'] = &amp;quot;Editors can experiment in this module's $1 and $2 pages.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-subpage']&lt;br /&gt;
-- The name of the template subpage typically used for sandboxes.&lt;br /&gt;
cfg['sandbox-subpage'] = 'sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-sandbox-preload']&lt;br /&gt;
-- Preload file for template sandbox pages.&lt;br /&gt;
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-sandbox-preload']&lt;br /&gt;
-- Preload file for Lua module sandbox pages.&lt;br /&gt;
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;sandbox&amp;quot; links.&lt;br /&gt;
cfg['sandbox-link-display'] = 'sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-edit-link-display']&lt;br /&gt;
-- The text to display for sandbox &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['sandbox-edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-create-link-display']&lt;br /&gt;
-- The text to display for sandbox &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['sandbox-create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
-- cfg['compare-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;compare&amp;quot; links.&lt;br /&gt;
cfg['compare-link-display'] = 'diff'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-edit-summary']&lt;br /&gt;
-- The default edit summary to use when a user clicks the &amp;quot;mirror&amp;quot; link. $1 is a wikilink to the&lt;br /&gt;
-- template page.&lt;br /&gt;
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;mirror&amp;quot; links.&lt;br /&gt;
cfg['mirror-link-display'] = 'mirror'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-link-preload']&lt;br /&gt;
-- The page to preload when a user clicks the &amp;quot;mirror&amp;quot; link.&lt;br /&gt;
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Test cases link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-subpage']&lt;br /&gt;
-- The name of the template subpage typically used for test cases.&lt;br /&gt;
cfg['testcases-subpage'] = 'testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-testcases-preload']&lt;br /&gt;
-- Preload file for template test cases pages.&lt;br /&gt;
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-testcases-preload']&lt;br /&gt;
-- Preload file for Lua module test cases pages.&lt;br /&gt;
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;testcases&amp;quot; links.&lt;br /&gt;
cfg['testcases-link-display'] = 'testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-edit-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['testcases-edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-run-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;run&amp;quot; links.&lt;br /&gt;
cfg['testcases-run-link-display'] = 'run'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-create-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['testcases-create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Add categories blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['add-categories-blurb']&lt;br /&gt;
-- Text to direct users to add categories to the /doc subpage. Not used if the &amp;quot;content&amp;quot; or&lt;br /&gt;
-- &amp;quot;docname fed&amp;quot; arguments are set, as then it is not clear where to add the categories. $1 is a&lt;br /&gt;
-- link to the /doc subpage with a display value of cfg['doc-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['add-categories-blurb'] = 'Please add categories to the $1 subpage.'&lt;br /&gt;
&lt;br /&gt;
-- cfg['doc-link-display']&lt;br /&gt;
-- The text to display when linking to the /doc subpage.&lt;br /&gt;
cfg['doc-link-display'] = '/doc'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Subpages link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['subpages-blurb']&lt;br /&gt;
-- The &amp;quot;Subpages of this template&amp;quot; blurb. $1 is a link to the main template's subpages with a&lt;br /&gt;
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply&lt;br /&gt;
-- the link followed by a period, and the link display provides the actual text.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['subpages-blurb'] = '$1.'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['subpages-link-display']&lt;br /&gt;
-- The text to display for the &amp;quot;subpages of this page&amp;quot; link. $1 is cfg['template-pagetype'],&lt;br /&gt;
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in&lt;br /&gt;
-- the template namespace, the module namespace, or another namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['subpages-link-display'] = 'Subpages of this $1'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-pagetype']&lt;br /&gt;
-- The pagetype to display for template pages.&lt;br /&gt;
cfg['template-pagetype'] = 'template'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-pagetype']&lt;br /&gt;
-- The pagetype to display for Lua module pages.&lt;br /&gt;
cfg['module-pagetype'] = 'module'&lt;br /&gt;
&lt;br /&gt;
-- cfg['default-pagetype']&lt;br /&gt;
-- The pagetype to display for pages other than templates or Lua modules.&lt;br /&gt;
cfg['default-pagetype'] = 'page'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Doc link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['doc-subpage']&lt;br /&gt;
-- The name of the subpage typically used for documentation pages.&lt;br /&gt;
cfg['doc-subpage'] = 'doc'&lt;br /&gt;
&lt;br /&gt;
-- cfg['file-docpage-preload']&lt;br /&gt;
-- Preload file for documentation page in the file namespace.&lt;br /&gt;
cfg['file-docpage-preload'] = 'Template:Documentation/preload-filespace'&lt;br /&gt;
&lt;br /&gt;
-- cfg['docpage-preload']&lt;br /&gt;
-- Preload file for template documentation pages in all namespaces.&lt;br /&gt;
cfg['docpage-preload'] = 'Template:Documentation/preload'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-preload']&lt;br /&gt;
-- Preload file for Lua module documentation pages.&lt;br /&gt;
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Print version configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['print-subpage']&lt;br /&gt;
-- The name of the template subpage used for print versions.&lt;br /&gt;
cfg['print-subpage'] = 'Print'&lt;br /&gt;
&lt;br /&gt;
-- cfg['print-link-display']&lt;br /&gt;
-- The text to display when linking to the /Print subpage.&lt;br /&gt;
cfg['print-link-display'] = '/Print'&lt;br /&gt;
&lt;br /&gt;
-- cfg['print-blurb']&lt;br /&gt;
-- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg['print-link-display'].&lt;br /&gt;
cfg['print-blurb'] = 'A [[Help:Books/for experts#Improving the book layout|print version]] of this template exists at $1.'&lt;br /&gt;
	.. ' If you make a change to this template, please update the print version as well.'&lt;br /&gt;
&lt;br /&gt;
-- cfg['display-print-category']&lt;br /&gt;
-- Set to true to enable output of cfg['print-category'] if a /Print subpage exists.&lt;br /&gt;
-- This should be a boolean value (either true or false).&lt;br /&gt;
cfg['display-print-category'] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg['print-category']&lt;br /&gt;
-- Category to output if cfg['display-print-category'] is set to true, and a /Print subpage exists.&lt;br /&gt;
cfg['print-category'] = 'Templates with print versions'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- HTML and CSS configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['main-div-id']&lt;br /&gt;
-- The &amp;quot;id&amp;quot; attribute of the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg['main-div-id'] = 'template-documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['main-div-classes']&lt;br /&gt;
-- The CSS classes added to the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg['main-div-classes'] = 'template-documentation iezoomfix'&lt;br /&gt;
&lt;br /&gt;
-- cfg['start-box-linkclasses']&lt;br /&gt;
-- The CSS classes used for the [view][edit][history] or [create] links in the start box.&lt;br /&gt;
cfg['start-box-linkclasses'] = 'mw-editsection-like plainlinks'&lt;br /&gt;
&lt;br /&gt;
-- cfg['start-box-link-id']&lt;br /&gt;
-- The HTML &amp;quot;id&amp;quot; attribute for the links in the start box.&lt;br /&gt;
cfg['start-box-link-id'] = 'doc_editlinks'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- {{fmbox}} template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['fmbox-id']&lt;br /&gt;
-- The id sent to the &amp;quot;id&amp;quot; parameter of the {{fmbox}} template.&lt;br /&gt;
cfg['fmbox-id'] = 'documentation-meta-data'&lt;br /&gt;
&lt;br /&gt;
-- cfg['fmbox-style']&lt;br /&gt;
-- The value sent to the style parameter of {{fmbox}}.&lt;br /&gt;
cfg['fmbox-style'] = 'background-color: #ecfcf4'&lt;br /&gt;
&lt;br /&gt;
-- cfg['fmbox-textstyle']&lt;br /&gt;
-- The value sent to the &amp;quot;textstyle parameter of {{fmbox}}.&lt;br /&gt;
cfg['fmbox-textstyle'] = 'font-style: italic'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking category configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['display-strange-usage-category']&lt;br /&gt;
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage&lt;br /&gt;
-- or a /testcases subpage. This should be a boolean value (either true or false).&lt;br /&gt;
cfg['display-strange-usage-category'] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg['strange-usage-category']&lt;br /&gt;
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a&lt;br /&gt;
-- /doc subpage or a /testcases subpage.&lt;br /&gt;
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--&lt;br /&gt;
-- Don't edit anything below this line.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
return cfg&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Effective_protection_expiry&amp;diff=4605</id>
		<title>Module:Effective protection expiry</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Effective_protection_expiry&amp;diff=4605"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == 'table' and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action == 'autoreview' then&lt;br /&gt;
		local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)&lt;br /&gt;
		return stabilitySettings and stabilitySettings.expiry or 'unknown'&lt;br /&gt;
	elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then&lt;br /&gt;
		error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )&lt;br /&gt;
	end&lt;br /&gt;
	local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)&lt;br /&gt;
	if rawExpiry == 'infinity' then&lt;br /&gt;
		return 'infinity'&lt;br /&gt;
	elseif rawExpiry == '' then&lt;br /&gt;
		return 'unknown'&lt;br /&gt;
	else&lt;br /&gt;
		local year, month, day, hour, minute, second = rawExpiry:match(&lt;br /&gt;
			'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'&lt;br /&gt;
		)&lt;br /&gt;
		if year then&lt;br /&gt;
			return string.format(&lt;br /&gt;
				'%s-%s-%sT%s:%s:%s',&lt;br /&gt;
				year, month, day, hour, minute, second&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			error('internal error in Module:Effective protection expiry; malformed expiry timestamp')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Effective_protection_level&amp;diff=4607</id>
		<title>Module:Effective protection level</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Effective_protection_level&amp;diff=4607"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the permission required to perform a given action on a given title.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == 'table' and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action == 'autoreview' then&lt;br /&gt;
		local level = mw.ext.FlaggedRevs.getStabilitySettings(title)&lt;br /&gt;
		level = level and level.autoreview&lt;br /&gt;
		if level == 'review' then&lt;br /&gt;
			return 'reviewer'&lt;br /&gt;
		elseif level ~= '' then&lt;br /&gt;
			return level&lt;br /&gt;
		else&lt;br /&gt;
			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&lt;br /&gt;
		end&lt;br /&gt;
	elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then&lt;br /&gt;
		error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )&lt;br /&gt;
	end&lt;br /&gt;
	if title.namespace == 8 then -- MediaWiki namespace&lt;br /&gt;
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		else -- any non-JS/CSS MediaWiki page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	elseif title.namespace == 2 and title.isSubpage then&lt;br /&gt;
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		elseif title.contentModel == 'json' then -- user JSON page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local level = title.protectionLevels[action] and title.protectionLevels[action][1]&lt;br /&gt;
	if level == 'sysop' or level == 'editprotected' then&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif level == 'templateeditor' then&lt;br /&gt;
		return 'templateeditor'&lt;br /&gt;
	elseif action == 'move' then&lt;br /&gt;
		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.&lt;br /&gt;
		if blacklistentry and not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'templateeditor'&lt;br /&gt;
		elseif title.namespace == 6 then&lt;br /&gt;
			return 'filemover'&lt;br /&gt;
		elseif level == 'extendedconfirmed' then&lt;br /&gt;
			return 'extendedconfirmed'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)&lt;br /&gt;
	if blacklistentry then&lt;br /&gt;
		if not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'templateeditor'&lt;br /&gt;
		elseif level == 'extendedconfirmed' then&lt;br /&gt;
			return 'extendedconfirmed'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	elseif level then&lt;br /&gt;
		return level&lt;br /&gt;
	elseif action == 'upload' then&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	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&lt;br /&gt;
		return 'user'&lt;br /&gt;
	else&lt;br /&gt;
		return '*'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Message_box&amp;diff=4609</id>
		<title>Module:Message box</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Message_box&amp;diff=4609"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This is a meta-module for producing message box templates, including&lt;br /&gt;
-- {{mbox}}, {{ambox}}, {{imbox}}, {{tmbox}}, {{ombox}}, {{cmbox}} and {{fmbox}}.&lt;br /&gt;
&lt;br /&gt;
-- Load necessary modules.&lt;br /&gt;
require('Module:No globals')&lt;br /&gt;
local getArgs&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
-- Get a language object for formatDate and ucfirst.&lt;br /&gt;
local lang = mw.language.getContentLanguage()&lt;br /&gt;
&lt;br /&gt;
-- Define constants&lt;br /&gt;
local CONFIG_MODULE = 'Module:Message box/configuration'&lt;br /&gt;
local DEMOSPACES = {talk = 'tmbox', image = 'imbox', file = 'imbox', category = 'cmbox', article = 'ambox', main = 'ambox'}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function getTitleObject(...)&lt;br /&gt;
	-- Get the title object, passing the function through pcall&lt;br /&gt;
	-- in case we are over the expensive function count limit.&lt;br /&gt;
	local success, title = pcall(mw.title.new, ...)&lt;br /&gt;
	if success then&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function union(t1, t2)&lt;br /&gt;
	-- Returns the union of two arrays.&lt;br /&gt;
	local vals = {}&lt;br /&gt;
	for i, v in ipairs(t1) do&lt;br /&gt;
		vals[v] = true&lt;br /&gt;
	end&lt;br /&gt;
	for i, v in ipairs(t2) do&lt;br /&gt;
		vals[v] = true&lt;br /&gt;
	end&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k in pairs(vals) do&lt;br /&gt;
		table.insert(ret, k)&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(ret)&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getArgNums(args, prefix)&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		local num = mw.ustring.match(tostring(k), '^' .. prefix .. '([1-9]%d*)$')&lt;br /&gt;
		if num then&lt;br /&gt;
			table.insert(nums, tonumber(num))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(nums)&lt;br /&gt;
	return nums&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Box class definition&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local MessageBox = {}&lt;br /&gt;
MessageBox.__index = MessageBox&lt;br /&gt;
&lt;br /&gt;
function MessageBox.new(boxType, args, cfg)&lt;br /&gt;
	args = args or {}&lt;br /&gt;
	local obj = {}&lt;br /&gt;
&lt;br /&gt;
	-- Set the title object and the namespace.&lt;br /&gt;
	obj.title = getTitleObject(args.page) or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Set the config for our box type.&lt;br /&gt;
	obj.cfg = cfg[boxType]&lt;br /&gt;
	if not obj.cfg then&lt;br /&gt;
		local ns = obj.title.namespace&lt;br /&gt;
		-- boxType is &amp;quot;mbox&amp;quot; or invalid input&lt;br /&gt;
		if args.demospace and args.demospace ~= '' then&lt;br /&gt;
			-- implement demospace parameter of mbox&lt;br /&gt;
			local demospace = string.lower(args.demospace)&lt;br /&gt;
			if DEMOSPACES[demospace] then&lt;br /&gt;
				-- use template from DEMOSPACES&lt;br /&gt;
				obj.cfg = cfg[DEMOSPACES[demospace]]&lt;br /&gt;
			elseif string.find( demospace, 'talk' ) then&lt;br /&gt;
				-- demo as a talk page&lt;br /&gt;
				obj.cfg = cfg.tmbox&lt;br /&gt;
			else&lt;br /&gt;
				-- default to ombox&lt;br /&gt;
				obj.cfg = cfg.ombox&lt;br /&gt;
			end&lt;br /&gt;
		elseif ns == 0 then&lt;br /&gt;
			obj.cfg = cfg.ambox -- main namespace&lt;br /&gt;
		elseif ns == 6 then&lt;br /&gt;
			obj.cfg = cfg.imbox -- file namespace&lt;br /&gt;
		elseif ns == 14 then&lt;br /&gt;
			obj.cfg = cfg.cmbox -- category namespace&lt;br /&gt;
		else&lt;br /&gt;
			local nsTable = mw.site.namespaces[ns]&lt;br /&gt;
			if nsTable and nsTable.isTalk then&lt;br /&gt;
				obj.cfg = cfg.tmbox -- any talk namespace&lt;br /&gt;
			else&lt;br /&gt;
				obj.cfg = cfg.ombox -- other namespaces or invalid input&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the arguments, and remove all blank arguments except for the ones&lt;br /&gt;
	-- listed in cfg.allowBlankParams.&lt;br /&gt;
	do&lt;br /&gt;
		local newArgs = {}&lt;br /&gt;
		for k, v in pairs(args) do&lt;br /&gt;
			if v ~= '' then&lt;br /&gt;
				newArgs[k] = v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		for i, param in ipairs(obj.cfg.allowBlankParams or {}) do&lt;br /&gt;
			newArgs[param] = args[param]&lt;br /&gt;
		end&lt;br /&gt;
		obj.args = newArgs&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Define internal data structure.&lt;br /&gt;
	obj.categories = {}&lt;br /&gt;
	obj.classes = {}&lt;br /&gt;
	-- For lazy loading of [[Module:Category handler]].&lt;br /&gt;
	obj.hasCategories = false&lt;br /&gt;
&lt;br /&gt;
	return setmetatable(obj, MessageBox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:addCat(ns, cat, sort)&lt;br /&gt;
	if not cat then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if sort then&lt;br /&gt;
		cat = string.format('[[Category:%s|%s]]', cat, sort)&lt;br /&gt;
	else&lt;br /&gt;
		cat = string.format('[[Category:%s]]', cat)&lt;br /&gt;
	end&lt;br /&gt;
	self.hasCategories = true&lt;br /&gt;
	self.categories[ns] = self.categories[ns] or {}&lt;br /&gt;
	table.insert(self.categories[ns], cat)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:addClass(class)&lt;br /&gt;
	if not class then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	table.insert(self.classes, class)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:setParameters()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local cfg = self.cfg&lt;br /&gt;
&lt;br /&gt;
	-- Get type data.&lt;br /&gt;
	self.type = args.type&lt;br /&gt;
	local typeData = cfg.types[self.type]&lt;br /&gt;
	self.invalidTypeError = cfg.showInvalidTypeError&lt;br /&gt;
		and self.type&lt;br /&gt;
		and not typeData&lt;br /&gt;
	typeData = typeData or cfg.types[cfg.default]&lt;br /&gt;
	self.typeClass = typeData.class&lt;br /&gt;
	self.typeImage = typeData.image&lt;br /&gt;
&lt;br /&gt;
	-- Find if the box has been wrongly substituted.&lt;br /&gt;
	self.isSubstituted = cfg.substCheck and args.subst == 'SUBST'&lt;br /&gt;
&lt;br /&gt;
	-- Find whether we are using a small message box.&lt;br /&gt;
	self.isSmall = cfg.allowSmall and (&lt;br /&gt;
		cfg.smallParam and args.small == cfg.smallParam&lt;br /&gt;
		or not cfg.smallParam and yesno(args.small)&lt;br /&gt;
	)&lt;br /&gt;
&lt;br /&gt;
	-- Add attributes, classes and styles.&lt;br /&gt;
	self.id = args.id&lt;br /&gt;
	self.name = args.name&lt;br /&gt;
	if self.name then&lt;br /&gt;
		self:addClass('box-' .. string.gsub(self.name,' ','_'))&lt;br /&gt;
	end&lt;br /&gt;
	if yesno(args.plainlinks) ~= false then&lt;br /&gt;
		self:addClass('plainlinks')&lt;br /&gt;
	end&lt;br /&gt;
	for _, class in ipairs(cfg.classes or {}) do&lt;br /&gt;
		self:addClass(class)&lt;br /&gt;
	end&lt;br /&gt;
	if self.isSmall then&lt;br /&gt;
		self:addClass(cfg.smallClass or 'mbox-small')&lt;br /&gt;
	end&lt;br /&gt;
	self:addClass(self.typeClass)&lt;br /&gt;
	self:addClass(args.class)&lt;br /&gt;
	self.style = args.style&lt;br /&gt;
	self.attrs = args.attrs&lt;br /&gt;
&lt;br /&gt;
	-- Set text style.&lt;br /&gt;
	self.textstyle = args.textstyle&lt;br /&gt;
&lt;br /&gt;
	-- Find if we are on the template page or not. This functionality is only&lt;br /&gt;
	-- used if useCollapsibleTextFields is set, or if both cfg.templateCategory&lt;br /&gt;
	-- and cfg.templateCategoryRequireName are set.&lt;br /&gt;
	self.useCollapsibleTextFields = cfg.useCollapsibleTextFields&lt;br /&gt;
	if self.useCollapsibleTextFields&lt;br /&gt;
		or cfg.templateCategory&lt;br /&gt;
		and cfg.templateCategoryRequireName&lt;br /&gt;
	then&lt;br /&gt;
		if self.name then&lt;br /&gt;
			local templateName = mw.ustring.match(&lt;br /&gt;
				self.name,&lt;br /&gt;
				'^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$'&lt;br /&gt;
			) or self.name&lt;br /&gt;
			templateName = 'Template:' .. templateName&lt;br /&gt;
			self.templateTitle = getTitleObject(templateName)&lt;br /&gt;
		end&lt;br /&gt;
		self.isTemplatePage = self.templateTitle&lt;br /&gt;
			and mw.title.equals(self.title, self.templateTitle)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Process data for collapsible text fields. At the moment these are only&lt;br /&gt;
	-- used in {{ambox}}.&lt;br /&gt;
	if self.useCollapsibleTextFields then&lt;br /&gt;
		-- Get the self.issue value.&lt;br /&gt;
		if self.isSmall and args.smalltext then&lt;br /&gt;
			self.issue = args.smalltext&lt;br /&gt;
		else&lt;br /&gt;
			local sect&lt;br /&gt;
			if args.sect == '' then&lt;br /&gt;
				sect = 'This ' .. (cfg.sectionDefault or 'page')&lt;br /&gt;
			elseif type(args.sect) == 'string' then&lt;br /&gt;
				sect = 'This ' .. args.sect&lt;br /&gt;
			end&lt;br /&gt;
			local issue = args.issue&lt;br /&gt;
			issue = type(issue) == 'string' and issue ~= '' and issue or nil&lt;br /&gt;
			local text = args.text&lt;br /&gt;
			text = type(text) == 'string' and text or nil&lt;br /&gt;
			local issues = {}&lt;br /&gt;
			table.insert(issues, sect)&lt;br /&gt;
			table.insert(issues, issue)&lt;br /&gt;
			table.insert(issues, text)&lt;br /&gt;
			self.issue = table.concat(issues, ' ')&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Get the self.talk value.&lt;br /&gt;
		local talk = args.talk&lt;br /&gt;
		-- Show talk links on the template page or template subpages if the talk&lt;br /&gt;
		-- parameter is blank.&lt;br /&gt;
		if talk == ''&lt;br /&gt;
			and self.templateTitle&lt;br /&gt;
			and (&lt;br /&gt;
				mw.title.equals(self.templateTitle, self.title)&lt;br /&gt;
				or self.title:isSubpageOf(self.templateTitle)&lt;br /&gt;
			)&lt;br /&gt;
		then&lt;br /&gt;
			talk = '#'&lt;br /&gt;
		elseif talk == '' then&lt;br /&gt;
			talk = nil&lt;br /&gt;
		end&lt;br /&gt;
		if talk then&lt;br /&gt;
			-- If the talk value is a talk page, make a link to that page. Else&lt;br /&gt;
			-- assume that it's a section heading, and make a link to the talk&lt;br /&gt;
			-- page of the current page with that section heading.&lt;br /&gt;
			local talkTitle = getTitleObject(talk)&lt;br /&gt;
			local talkArgIsTalkPage = true&lt;br /&gt;
			if not talkTitle or not talkTitle.isTalkPage then&lt;br /&gt;
				talkArgIsTalkPage = false&lt;br /&gt;
				talkTitle = getTitleObject(&lt;br /&gt;
					self.title.text,&lt;br /&gt;
					mw.site.namespaces[self.title.namespace].talk.id&lt;br /&gt;
				)&lt;br /&gt;
			end&lt;br /&gt;
			if talkTitle and talkTitle.exists then&lt;br /&gt;
				local talkText = 'Relevant discussion may be found on'&lt;br /&gt;
				if talkArgIsTalkPage then&lt;br /&gt;
					talkText = string.format(&lt;br /&gt;
						'%s [[%s|%s]].',&lt;br /&gt;
						talkText,&lt;br /&gt;
						talk,&lt;br /&gt;
						talkTitle.prefixedText&lt;br /&gt;
					)&lt;br /&gt;
				else&lt;br /&gt;
					talkText = string.format(&lt;br /&gt;
						'%s the [[%s#%s|talk page]].',&lt;br /&gt;
						talkText,&lt;br /&gt;
						talkTitle.prefixedText,&lt;br /&gt;
						talk&lt;br /&gt;
					)&lt;br /&gt;
				end&lt;br /&gt;
				self.talk = talkText&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Get other values.&lt;br /&gt;
		self.fix = args.fix ~= '' and args.fix or nil&lt;br /&gt;
		local date&lt;br /&gt;
		if args.date and args.date ~= '' then&lt;br /&gt;
			date = args.date&lt;br /&gt;
		elseif args.date == '' and self.isTemplatePage then&lt;br /&gt;
			date = lang:formatDate('F Y')&lt;br /&gt;
		end&lt;br /&gt;
		if date then&lt;br /&gt;
			self.date = string.format(&amp;quot; &amp;lt;small class='date-container'&amp;gt;''(&amp;lt;span class='date'&amp;gt;%s&amp;lt;/span&amp;gt;)''&amp;lt;/small&amp;gt;&amp;quot;, date)&lt;br /&gt;
		end&lt;br /&gt;
		self.info = args.info&lt;br /&gt;
		if yesno(args.removalnotice) then&lt;br /&gt;
			self.removalNotice = cfg.removalNotice&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the non-collapsible text field. At the moment this is used by all box&lt;br /&gt;
	-- types other than ambox, and also by ambox when small=yes.&lt;br /&gt;
	if self.isSmall then&lt;br /&gt;
		self.text = args.smalltext or args.text&lt;br /&gt;
	else&lt;br /&gt;
		self.text = args.text&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the below row.&lt;br /&gt;
	self.below = cfg.below and args.below&lt;br /&gt;
&lt;br /&gt;
	-- General image settings.&lt;br /&gt;
	self.imageCellDiv = not self.isSmall and cfg.imageCellDiv&lt;br /&gt;
	self.imageEmptyCell = cfg.imageEmptyCell&lt;br /&gt;
	if cfg.imageEmptyCellStyle then&lt;br /&gt;
		self.imageEmptyCellStyle = 'border:none;padding:0px;width:1px'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Left image settings.&lt;br /&gt;
	local imageLeft = self.isSmall and args.smallimage or args.image&lt;br /&gt;
	if cfg.imageCheckBlank and imageLeft ~= 'blank' and imageLeft ~= 'none'&lt;br /&gt;
		or not cfg.imageCheckBlank and imageLeft ~= 'none'&lt;br /&gt;
	then&lt;br /&gt;
		self.imageLeft = imageLeft&lt;br /&gt;
		if not imageLeft then&lt;br /&gt;
			local imageSize = self.isSmall&lt;br /&gt;
				and (cfg.imageSmallSize or '30x30px')&lt;br /&gt;
				or '40x40px'&lt;br /&gt;
			self.imageLeft = string.format('[[File:%s|%s|link=|alt=]]', self.typeImage&lt;br /&gt;
				or 'Imbox notice.png', imageSize)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Right image settings.&lt;br /&gt;
	local imageRight = self.isSmall and args.smallimageright or args.imageright&lt;br /&gt;
	if not (cfg.imageRightNone and imageRight == 'none') then&lt;br /&gt;
		self.imageRight = imageRight&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:setMainspaceCategories()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local cfg = self.cfg&lt;br /&gt;
&lt;br /&gt;
	if not cfg.allowMainspaceCategories then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for _, prefix in ipairs{'cat', 'category', 'all'} do&lt;br /&gt;
		args[prefix .. '1'] = args[prefix]&lt;br /&gt;
		nums = union(nums, getArgNums(args, prefix))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- The following is roughly equivalent to the old {{Ambox/category}}.&lt;br /&gt;
	local date = args.date&lt;br /&gt;
	date = type(date) == 'string' and date&lt;br /&gt;
	local preposition = 'from'&lt;br /&gt;
	for _, num in ipairs(nums) do&lt;br /&gt;
		local mainCat = args['cat' .. tostring(num)]&lt;br /&gt;
			or args['category' .. tostring(num)]&lt;br /&gt;
		local allCat = args['all' .. tostring(num)]&lt;br /&gt;
		mainCat = type(mainCat) == 'string' and mainCat&lt;br /&gt;
		allCat = type(allCat) == 'string' and allCat&lt;br /&gt;
		if mainCat and date and date ~= '' then&lt;br /&gt;
			local catTitle = string.format('%s %s %s', mainCat, preposition, date)&lt;br /&gt;
			self:addCat(0, catTitle)&lt;br /&gt;
			catTitle = getTitleObject('Category:' .. catTitle)&lt;br /&gt;
			if not catTitle or not catTitle.exists then&lt;br /&gt;
				self:addCat(0, 'Articles with invalid date parameter in template')&lt;br /&gt;
			end&lt;br /&gt;
		elseif mainCat and (not date or date == '') then&lt;br /&gt;
			self:addCat(0, mainCat)&lt;br /&gt;
		end&lt;br /&gt;
		if allCat then&lt;br /&gt;
			self:addCat(0, allCat)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:setTemplateCategories()&lt;br /&gt;
	local args = self.args&lt;br /&gt;
	local cfg = self.cfg&lt;br /&gt;
&lt;br /&gt;
	-- Add template categories.&lt;br /&gt;
	if cfg.templateCategory then&lt;br /&gt;
		if cfg.templateCategoryRequireName then&lt;br /&gt;
			if self.isTemplatePage then&lt;br /&gt;
				self:addCat(10, cfg.templateCategory)&lt;br /&gt;
			end&lt;br /&gt;
		elseif not self.title.isSubpage then&lt;br /&gt;
			self:addCat(10, cfg.templateCategory)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add template error categories.&lt;br /&gt;
	if cfg.templateErrorCategory then&lt;br /&gt;
		local templateErrorCategory = cfg.templateErrorCategory&lt;br /&gt;
		local templateCat, templateSort&lt;br /&gt;
		if not self.name and not self.title.isSubpage then&lt;br /&gt;
			templateCat = templateErrorCategory&lt;br /&gt;
		elseif self.isTemplatePage then&lt;br /&gt;
			local paramsToCheck = cfg.templateErrorParamsToCheck or {}&lt;br /&gt;
			local count = 0&lt;br /&gt;
			for i, param in ipairs(paramsToCheck) do&lt;br /&gt;
				if not args[param] then&lt;br /&gt;
					count = count + 1&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if count &amp;gt; 0 then&lt;br /&gt;
				templateCat = templateErrorCategory&lt;br /&gt;
				templateSort = tostring(count)&lt;br /&gt;
			end&lt;br /&gt;
			if self.categoryNums and #self.categoryNums &amp;gt; 0 then&lt;br /&gt;
				templateCat = templateErrorCategory&lt;br /&gt;
				templateSort = 'C'&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		self:addCat(10, templateCat, templateSort)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:setAllNamespaceCategories()&lt;br /&gt;
	-- Set categories for all namespaces.&lt;br /&gt;
	if self.invalidTypeError then&lt;br /&gt;
		local allSort = (self.title.namespace == 0 and 'Main:' or '') .. self.title.prefixedText&lt;br /&gt;
		self:addCat('all', 'Wikipedia message box parameter needs fixing', allSort)&lt;br /&gt;
	end&lt;br /&gt;
	if self.isSubstituted then&lt;br /&gt;
		self:addCat('all', 'Pages with incorrectly substituted templates')&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:setCategories()&lt;br /&gt;
	if self.title.namespace == 0 then&lt;br /&gt;
		self:setMainspaceCategories()&lt;br /&gt;
	elseif self.title.namespace == 10 then&lt;br /&gt;
		self:setTemplateCategories()&lt;br /&gt;
	end&lt;br /&gt;
	self:setAllNamespaceCategories()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:renderCategories()&lt;br /&gt;
	if not self.hasCategories then&lt;br /&gt;
		-- No categories added, no need to pass them to Category handler so,&lt;br /&gt;
		-- if it was invoked, it would return the empty string.&lt;br /&gt;
		-- So we shortcut and return the empty string.&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	-- Convert category tables to strings and pass them through&lt;br /&gt;
	-- [[Module:Category handler]].&lt;br /&gt;
	return require('Module:Category handler')._main{&lt;br /&gt;
		main = table.concat(self.categories[0] or {}),&lt;br /&gt;
		template = table.concat(self.categories[10] or {}),&lt;br /&gt;
		all = table.concat(self.categories.all or {}),&lt;br /&gt;
		nocat = self.args.nocat,&lt;br /&gt;
		page = self.args.page&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:export()&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
&lt;br /&gt;
	-- Add the subst check error.&lt;br /&gt;
	if self.isSubstituted and self.name then&lt;br /&gt;
		root:tag('b')&lt;br /&gt;
			:addClass('error')&lt;br /&gt;
			:wikitext(string.format(&lt;br /&gt;
				'Template &amp;lt;code&amp;gt;%s[[Template:%s|%s]]%s&amp;lt;/code&amp;gt; has been incorrectly substituted.',&lt;br /&gt;
				mw.text.nowiki('{{'), self.name, self.name, mw.text.nowiki('}}')&lt;br /&gt;
			))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create the box table.&lt;br /&gt;
	local boxTable = root:tag('table')&lt;br /&gt;
	boxTable:attr('id', self.id or nil)&lt;br /&gt;
	for i, class in ipairs(self.classes or {}) do&lt;br /&gt;
		boxTable:addClass(class or nil)&lt;br /&gt;
	end&lt;br /&gt;
	boxTable&lt;br /&gt;
		:cssText(self.style or nil)&lt;br /&gt;
		:attr('role', 'presentation')&lt;br /&gt;
&lt;br /&gt;
	if self.attrs then&lt;br /&gt;
		boxTable:attr(self.attrs)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the left-hand image.&lt;br /&gt;
	local row = boxTable:tag('tr')&lt;br /&gt;
	if self.imageLeft then&lt;br /&gt;
		local imageLeftCell = row:tag('td'):addClass('mbox-image')&lt;br /&gt;
		if self.imageCellDiv then&lt;br /&gt;
			-- If we are using a div, redefine imageLeftCell so that the image&lt;br /&gt;
			-- is inside it. Divs use style=&amp;quot;width: 52px;&amp;quot;, which limits the&lt;br /&gt;
			-- image width to 52px. If any images in a div are wider than that,&lt;br /&gt;
			-- they may overlap with the text or cause other display problems.&lt;br /&gt;
			imageLeftCell = imageLeftCell:tag('div'):css('width', '52px')&lt;br /&gt;
		end&lt;br /&gt;
		imageLeftCell:wikitext(self.imageLeft or nil)&lt;br /&gt;
	elseif self.imageEmptyCell then&lt;br /&gt;
		-- Some message boxes define an empty cell if no image is specified, and&lt;br /&gt;
		-- some don't. The old template code in templates where empty cells are&lt;br /&gt;
		-- specified gives the following hint: &amp;quot;No image. Cell with some width&lt;br /&gt;
		-- or padding necessary for text cell to have 100% width.&amp;quot;&lt;br /&gt;
		row:tag('td')&lt;br /&gt;
			:addClass('mbox-empty-cell')&lt;br /&gt;
			:cssText(self.imageEmptyCellStyle or nil)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the text.&lt;br /&gt;
	local textCell = row:tag('td'):addClass('mbox-text')&lt;br /&gt;
	if self.useCollapsibleTextFields then&lt;br /&gt;
		-- The message box uses advanced text parameters that allow things to be&lt;br /&gt;
		-- collapsible. At the moment, only ambox uses this.&lt;br /&gt;
		textCell:cssText(self.textstyle or nil)&lt;br /&gt;
		local textCellDiv = textCell:tag('div')&lt;br /&gt;
		textCellDiv&lt;br /&gt;
			:addClass('mbox-text-span')&lt;br /&gt;
			:wikitext(self.issue or nil)&lt;br /&gt;
		if (self.talk or self.fix) and not self.isSmall then&lt;br /&gt;
			textCellDiv:tag('span')&lt;br /&gt;
				:addClass('hide-when-compact')&lt;br /&gt;
				:wikitext(self.talk and (' ' .. self.talk) or nil)&lt;br /&gt;
				:wikitext(self.fix and (' ' .. self.fix) or nil)&lt;br /&gt;
		end&lt;br /&gt;
		textCellDiv:wikitext(self.date and (' ' .. self.date) or nil)&lt;br /&gt;
		if self.info and not self.isSmall then&lt;br /&gt;
			textCellDiv&lt;br /&gt;
				:tag('span')&lt;br /&gt;
				:addClass('hide-when-compact')&lt;br /&gt;
				:wikitext(self.info and (' ' .. self.info) or nil)&lt;br /&gt;
		end&lt;br /&gt;
		if self.removalNotice then&lt;br /&gt;
			textCellDiv:tag('small')&lt;br /&gt;
				:addClass('hide-when-compact')&lt;br /&gt;
				:tag('i')&lt;br /&gt;
					:wikitext(string.format(&amp;quot; (%s)&amp;quot;, self.removalNotice))&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		-- Default text formatting - anything goes.&lt;br /&gt;
		textCell&lt;br /&gt;
			:cssText(self.textstyle or nil)&lt;br /&gt;
			:wikitext(self.text or nil)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the right-hand image.&lt;br /&gt;
	if self.imageRight then&lt;br /&gt;
		local imageRightCell = row:tag('td'):addClass('mbox-imageright')&lt;br /&gt;
		if self.imageCellDiv then&lt;br /&gt;
			-- If we are using a div, redefine imageRightCell so that the image&lt;br /&gt;
			-- is inside it.&lt;br /&gt;
			imageRightCell = imageRightCell:tag('div'):css('width', '52px')&lt;br /&gt;
		end&lt;br /&gt;
		imageRightCell&lt;br /&gt;
			:wikitext(self.imageRight or nil)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add the below row.&lt;br /&gt;
	if self.below then&lt;br /&gt;
		boxTable:tag('tr')&lt;br /&gt;
			:tag('td')&lt;br /&gt;
				:attr('colspan', self.imageRight and '3' or '2')&lt;br /&gt;
				:addClass('mbox-text')&lt;br /&gt;
				:cssText(self.textstyle or nil)&lt;br /&gt;
				:wikitext(self.below or nil)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add error message for invalid type parameters.&lt;br /&gt;
	if self.invalidTypeError then&lt;br /&gt;
		root:tag('div')&lt;br /&gt;
			:css('text-align', 'center')&lt;br /&gt;
			:wikitext(string.format(&lt;br /&gt;
				'This message box is using an invalid &amp;quot;type=%s&amp;quot; parameter and needs fixing.',&lt;br /&gt;
				self.type or ''&lt;br /&gt;
			))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add categories.&lt;br /&gt;
	root:wikitext(self:renderCategories() or nil)&lt;br /&gt;
&lt;br /&gt;
	return tostring(root)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p, mt = {}, {}&lt;br /&gt;
&lt;br /&gt;
function p._exportClasses()&lt;br /&gt;
	-- For testing.&lt;br /&gt;
	return {&lt;br /&gt;
		MessageBox = MessageBox&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(boxType, args, cfgTables)&lt;br /&gt;
	local box = MessageBox.new(boxType, args, cfgTables or mw.loadData(CONFIG_MODULE))&lt;br /&gt;
	box:setParameters()&lt;br /&gt;
	box:setCategories()&lt;br /&gt;
	return box:export()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function mt.__index(t, k)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		if not getArgs then&lt;br /&gt;
			getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
		end&lt;br /&gt;
		return t.main(k, getArgs(frame, {trim = false, removeBlanks = false}))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return setmetatable(p, mt)&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Module:Message_box/configuration&amp;diff=4611</id>
		<title>Module:Message box/configuration</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Module:Message_box/configuration&amp;diff=4611"/>
				<updated>2019-03-18T12:10:56Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                          Message box configuration                         --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module contains configuration data for [[Module:Message box]].        --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	ambox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'ambox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'ambox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'ambox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'ambox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'ambox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'ambox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'ambox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default                     = 'notice',&lt;br /&gt;
		allowBlankParams            = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},&lt;br /&gt;
		allowSmall                  = true,&lt;br /&gt;
		smallParam                  = 'left',&lt;br /&gt;
		smallClass                  = 'mbox-small-left',&lt;br /&gt;
		substCheck                  = true,&lt;br /&gt;
		classes                     = {'metadata', 'ambox'},&lt;br /&gt;
		imageEmptyCell              = true,&lt;br /&gt;
		imageCheckBlank             = true,&lt;br /&gt;
		imageSmallSize              = '20x20px',&lt;br /&gt;
		imageCellDiv                = true,&lt;br /&gt;
		useCollapsibleTextFields    = true,&lt;br /&gt;
		imageRightNone              = true,&lt;br /&gt;
		sectionDefault              = 'article',&lt;br /&gt;
		allowMainspaceCategories    = true,&lt;br /&gt;
		templateCategory            = 'Article message templates',&lt;br /&gt;
	        templateCategoryRequireName = true,&lt;br /&gt;
		templateErrorCategory       = 'Article message templates with missing parameters',&lt;br /&gt;
		templateErrorParamsToCheck  = {'issue', 'fix', 'subst'},&lt;br /&gt;
		removalNotice               = '[[Help:Maintenance template removal|Learn how and when to remove this template message]]'&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	cmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'cmbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'cmbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'cmbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'cmbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'cmbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'cmbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'cmbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'cmbox'},&lt;br /&gt;
		imageEmptyCell       = true&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	fmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			warning = {&lt;br /&gt;
				class = 'fmbox-warning',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			editnotice = {&lt;br /&gt;
				class = 'fmbox-editnotice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			},&lt;br /&gt;
			system = {&lt;br /&gt;
				class = 'fmbox-system',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'system',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'fmbox'},&lt;br /&gt;
		imageEmptyCell       = false,&lt;br /&gt;
		imageRightNone       = false&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	imbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'imbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'imbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'imbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'imbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'imbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'imbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			license = {&lt;br /&gt;
				class = 'imbox-license licensetpl',&lt;br /&gt;
				image = 'Imbox license.png' -- @todo We need an SVG version of this&lt;br /&gt;
			},&lt;br /&gt;
			featured = {&lt;br /&gt;
				class = 'imbox-featured',&lt;br /&gt;
				image = 'Cscr-featured.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'imbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'imbox'},&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		below                = true,&lt;br /&gt;
		templateCategory     = 'File message boxes'&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	ombox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'ombox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'ombox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'ombox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'ombox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'ombox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'ombox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'ombox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'ombox'},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		imageRightNone       = true&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	tmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'tmbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'tmbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'tmbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'tmbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'tmbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'tmbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'tmbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'tmbox'},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageRightNone       = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		imageEmptyCellStyle  = true,&lt;br /&gt;
		templateCategory     = 'Talk message boxes'&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Dynamic_list&amp;diff=4587</id>
		<title>Template:Dynamic list</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Dynamic_list&amp;diff=4587"/>
				<updated>2019-03-18T12:10:55Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{hatnote|extraclasses=plainlinks|1=This is a [[Wikipedia:WikiProject Lists#Incomplete lists|dynamic list]] and may never be able to satisfy particular standards for completeness. You can help by [{{fullurl:{{FULLPAGENAME}}|action=edit}} expanding it] with [[Wikipedia:Reliable sources|reliably sourced]] entries.}}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
--&amp;gt;{{#ifeq:{{NAMESPACE}}||[[Category:Dynamic lists]]}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Short_description&amp;diff=4589</id>
		<title>Template:Short description</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Short_description&amp;diff=4589"/>
				<updated>2019-03-18T12:10:55Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#ifeq:{{{1|}}}|none||&amp;lt;div class=&amp;quot;shortdescription nomobile noexcerpt noprint searchaux&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;{{{1|}}}{{SHORTDESC:{{{1|}}}|{{{2|}}}}}&amp;lt;/div&amp;gt;}}&amp;lt;includeonly&amp;gt;[[Category:{{{pagetype|{{pagetype|defaultns = extended}}}}}s with short description]]&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- to implement this, set the class to display:none and remove the inline style here --&amp;gt;&lt;br /&gt;
{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Documentation&amp;diff=4591</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Documentation&amp;diff=4591"/>
				<updated>2019-03-18T12:10:55Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Template:Dynamic_list/doc&amp;diff=4593</id>
		<title>Template:Dynamic list/doc</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Template:Dynamic_list/doc&amp;diff=4593"/>
				<updated>2019-03-18T12:10:55Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Usage ===&lt;br /&gt;
Place this notification template immediately before the applicable &lt;br /&gt;
[[Wikipedia:WikiProject Lists#Incomplete lists|incomplete list]] (i.e. in a section, not at the top of the article). This template will automatically add the article to [[:Category:Dynamic lists]].&lt;br /&gt;
{{Expand list/metadoc}}&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&lt;br /&gt;
&amp;lt;!--Categories--&amp;gt;&lt;br /&gt;
[[Category:Hatnote templates for lists]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--Other languages--&amp;gt;&lt;br /&gt;
[[ko:틀:동적 목록]]&lt;br /&gt;
[[ro:Format:Listă dinamică]]&lt;br /&gt;
[[tr:Şablon:Dynamic list]]&lt;br /&gt;
[[zh:Template:Dynamic list]]&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Nebuchadnezzar_II&amp;diff=4526</id>
		<title>Nebuchadnezzar II</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Nebuchadnezzar_II&amp;diff=4526"/>
				<updated>2018-03-18T16:36:39Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Redirect|Nebuchadnezzar}}&lt;br /&gt;
{{Infobox monarch&lt;br /&gt;
| name = Nabû-kudurri-usur&lt;br /&gt;
| title = [[List of kings of Babylon|King of Babylon]]&lt;br /&gt;
| image = Nebukadnessar II.jpg&lt;br /&gt;
| caption = An engraving with an inscription of Nebuchadnezzar II. Anton Nyström, 1901.&amp;lt;ref&amp;gt;Anton Nyström, ''Allmän kulturhistoria eller det mänskliga lifvet i dess utveckling'', bd 2 (1901)&amp;lt;/ref&amp;gt;&lt;br /&gt;
| reign = c. 605 – c. 562 BC&lt;br /&gt;
| coronation =&lt;br /&gt;
| predecessor = [[Nabopolassar]]&lt;br /&gt;
| successor = [[Amel-Marduk]]&lt;br /&gt;
| spouse = Amyitis&lt;br /&gt;
| royal house = Chaldean&lt;br /&gt;
| father = [[Nabopolassar]]&lt;br /&gt;
| mother =&lt;br /&gt;
| birth_date = c. 634 BC&lt;br /&gt;
| birth_place =&lt;br /&gt;
| death_date = c. 562 BC (aged 71–72)&lt;br /&gt;
| death_place =&lt;br /&gt;
| buried =&lt;br /&gt;
}}&lt;br /&gt;
{{Lead too short|date=November 2017}}&lt;br /&gt;
&lt;br /&gt;
'''Nebuchadnezzar II''' (from [[Akkadian]] {{cuneiform|akk|𒀭𒀝𒆪𒁺𒌨𒊑𒋀}} ''&amp;lt;sup&amp;gt;[[DINGIR|d]]&amp;lt;/sup&amp;gt;Nabû-kudurri-uṣur'', {{hebrew Name|נְבוּכַדְנֶאצַּר|Nəvūkádne’ṣar|Neḇukáḏné’ṣār}}), meaning &amp;quot;O god [[Nabu]], preserve/defend my firstborn son&amp;quot;) was king of [[Neo-Babylonian Empire|Babylon]] c.&amp;amp;nbsp;605&amp;amp;nbsp;BC – c. 562&amp;amp;nbsp;BC, the longest and most powerful reign of any monarch in the Neo-Babylonian empire.{{sfn|Freedman|2000|p=953}}&amp;lt;ref&amp;gt;{{cite web|url=https://www.ancient.eu/Nebuchadnezzar_II/ |title=Nebuchadnezzar II |publisher=ancient.eu |accessdate=December 22, 2017}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Career ==&lt;br /&gt;
[[File:Pergamon Museum Berlin 2007085.jpg|thumb|left|Building Inscription of King Nebuchadnezar II at the [[Ishtar Gate]]. An abridged excerpt says: ''&amp;quot;I&amp;amp;nbsp;(Nebuchadnezzar) laid the foundation of the gates down to the ground water level and had them built out of pure blue stone. Upon the walls in the inner room of the gate are bulls and dragons and thus I magnificently adorned them with luxurious splendor for all mankind to behold in awe.&amp;quot;'']]&lt;br /&gt;
[[File:Detail of a terracotta cylinder of Nebuchadnezzar II, recording the building and reconstruction works at Babylon. 604-562 BCE. From Babylon, Iraq, housed in the British Museum.jpg|thumb|Detail of a terracotta cylinder of Nebuchadnezzar II, recording the building and reconstruction works at Babylon. 604–562 BC. From Babylon, Iraq, housed in the British Museum]]&lt;br /&gt;
Nebuchadnezzar was the eldest son and successor of [[Nabopolassar]], an [[Neo-Assyrian Empire|Assyrian]] official who rebelled and established himself as king of Babylon in 620&amp;amp;nbsp;BC; the dynasty he established ruled until 539&amp;amp;nbsp;BC, when the [[Neo-Babylonian Empire]] was conquered by [[Cyrus the Great]].{{sfn|Bertman|2005|p=95}}{{sfn|Oates|1997|p=162}} Nebuchadnezzar is first mentioned in 607&amp;amp;nbsp;BC, during the destruction of Babylon's arch-enemy Assyria, at which point he was already crown prince.{{sfn|Wiseman|1991a|p=182}} In 605&amp;amp;nbsp;BC he and his ally [[Cyaxares]], ruler of the [[Medes]] and [[Persians]], led an army against the Assyrians and Egyptians, who were then occupying Syria, and in the ensuing [[Battle of Carchemish]], [[Necho&amp;amp;nbsp;II]] was defeated and Syria and [[Phoenicia]] were brought under the control of Babylon.{{sfn|Wiseman|1991a|p=182–183}}&lt;br /&gt;
&lt;br /&gt;
[[Nabopolassar]] died in August {{citation needed|date=March 2018}} 605&amp;amp;nbsp;BC, and Nebuchadnezzar returned to Babylon to ascend the throne.{{sfn|Wiseman|1991a|p=183}} For the next few years his attention was devoted to subduing his eastern and northern borders, and in 595/4&amp;amp;nbsp;BC there was a serious but brief rebellion in Babylon itself.{{sfn|Wiseman|1991a|p=233}} In 594/3&amp;amp;nbsp;BC the army was sent again to the west, possibly in reaction to the elevation of [[Psammetichus II]] to the throne of Egypt.{{sfn|Wiseman|1991a|p=233}} King [[Zedekiah]] of Judah attempted to organize opposition among the small states in the region, but his capital, [[Jerusalem]], was taken in 587&amp;amp;nbsp;BC (the events are described in the Bible's [[Books of Kings]] and [[Book of Jeremiah]]).{{sfn|Wiseman|1991a|p=233–234}} In the following years Nebuchadnezzar incorporated [[Phoenicia]] and the former Assyrian provinces of [[Cilicia]] (southwestern Anatolia) into his empire and may have campaigned in Egypt.{{sfn|Wiseman|1991a|p=235–236}} In his last years Nebuchadnezzar seems to have begun behaving irrationally, &amp;quot;pay[ing] no heed to son or daughter,&amp;quot; and was deeply suspicious of his sons.{{sfn|Foster|2009|p=131}} The kings who came after him ruled only briefly and [[Nabonidus]], apparently not of the royal family, was overthrown by the Persian conqueror [[Cyrus the Great]] less than twenty-five years after Nebuchadnezzar's death.&lt;br /&gt;
&lt;br /&gt;
The ruins of Nebuchadnezzar's Babylon are spread over two thousand acres, forming the largest archaeological site in the [[Middle East]].{{sfn|Arnold|2005|p=96}} He enlarged the royal palace (including in it a public museum, possibly the world's first), built and repaired temples, built a bridge over the [[Euphrates]], and constructed a grand processional boulevard (the Processional Way) and gateway (the [[Ishtar Gate]]) lavishly decorated with glazed brick.{{sfn|Bertman|2005|p=96}} Each Spring [[equinox]] (the start of the New Year) the god [[Marduk]] would leave his city temple&amp;lt;!--clarify – unlikely that a fictitious deity went for a walk--&amp;gt; for a temple outside the walls, returning through the Ishtar Gate and down the Processional Way, paved with colored stone and lined with molded lions, amidst rejoicing crowds.{{sfn|Foster|2009|p=131}}&lt;br /&gt;
&lt;br /&gt;
== Portrayal in the Bible ==&lt;br /&gt;
[[File:Daniel Interpreting Nebuchadnezzar's Dream.jpg|thumb|240px|Daniel Interpreting Nebuchadnezzar's Dream]]&lt;br /&gt;
&lt;br /&gt;
Nebuchadnezzar is an important character in the [[Book of Daniel]], a collection of legendary tales and visions dating from the 2nd century BC.{{sfn|Collins|2002|p=2}} The consensus among scholars is that [[Daniel (biblical figure)|Daniel]] never existed and was apparently chosen for the hero of the book because of his traditional reputation as a wise seer.{{sfn|Collins|1999|p=219}}{{sfn|Redditt|2008|p=180}} [[Daniel 1]] introduces Nebuchadnezzar as the king who takes Daniel and other Hebrew youths into captivity in Babylon, there to be trained in the magical arts. Through the help of God, Daniel excels in his studies, and the second year of Nebuchadnezzar's reign he interprets the king's dream of a huge image as God's prediction of the rise and fall of world powers, starting with Nebuchadnezzar's kingdom ([[Daniel 2]]). Nebuchadnezzar twice admits the power of the God of the Hebrews: first after [[Yahweh]] saves [[Shadrach, Meshach, and Abednego|three of Daniel's companions]] from a fiery furnace ([[Daniel 3]]) and secondly after Nebuchadnezzar himself suffers a humiliating period of madness, as Daniel predicted ([[Daniel 4]]).&lt;br /&gt;
&lt;br /&gt;
The [[Book of Jeremiah]] contains a prophecy about Nebuchadnezzar as the &amp;quot;destroyer of nations&amp;quot; (Jer. 4:7) and gives an account of the [[siege of Jerusalem (587 BC)|siege of Jerusalem]] (587 BC) and the looting and destruction of the [[Solomon's Temple|First Temple]] (Jer. 39:1–10; 52:1–30).&lt;br /&gt;
&lt;br /&gt;
== Portrayal in medieval Muslim sources ==&lt;br /&gt;
According to [[Ali ibn Sahl Rabban al-Tabari]], Nebuchadnezzar, whose Persian name was Bukhtrashah, was of Persian descent, from the progeny of Jūdharz, however modern scholars are unanimous that he was either a native Mesopotamian ([[Assyria]]n-[[Babylonia]]n) or a [[Chaldea]]n. Some medieval writers erroneously believed he lived as long as 300 years.&amp;lt;ref name=&amp;quot;Ṭabarī 1987 43–70&amp;quot;&amp;gt;{{cite book|last=Ṭabarī|first=Muḥammad Ibn-Ǧarīr Aṭ-|title=The History of Al-Tabarī|year=1987|publisher=State Univ. of New York Pr.|pages=43–70}}&amp;lt;/ref&amp;gt; While much of what is written about Nebuchadnezzar depicts a ruthless warrior, some texts describe a ruler who was concerned with both spiritual and moral issues in life and was seeking divine guidance.&amp;lt;ref&amp;gt;{{cite book|last=Wiseman|first=D.J.|title=Nebuchadrezzar and Babylon|year=1985|publisher=Oxford}}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Nebuchadnezzar was seen as a strong, conquering force in Islamic texts and historical compilations, like [[Al-Tabari]]. The [[Babylon]]ian leader used force and destruction to grow an empire. He conquered kingdom after kingdom, including [[Phoenicia]], [[Philistia]], [[Kingdom of Judah|Judah]], [[Ammon]], [[Moab]], and more.&amp;lt;ref&amp;gt;{{cite book|last=Tabouis |first=G.R. |title=Nebuchadnezzar|year=1931|publisher=Whittlesey House|page=3}}&amp;lt;/ref&amp;gt; The most notable events that Tabari’s collection focuses on is the [[Siege of Jerusalem (587 BC)|destruction of Jerusalem]].&amp;lt;ref name=&amp;quot;Ṭabarī 1987 43–70&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:René-Antoine Houasse - Nabuchodonosor et Semiramis fait élever les jardins de Babylone (Versailles).jpg|thumb|center|upright=4.0|[[René-Antoine Houasse]]'s 1676 painting ''Nebuchadnezzar Ordering to your subjects the construction of the Hanging Gardens of Babylon to Please his Consort Amyitis'']]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Babylonia]]&lt;br /&gt;
* [[Book of Daniel]]&lt;br /&gt;
* [[Kings of Babylonia]]&lt;br /&gt;
* [[Nabucco]]&lt;br /&gt;
* [[Neo-Babylonian Empire]]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
{{reflist|30em}}&lt;br /&gt;
&lt;br /&gt;
== Bibliography ==&lt;br /&gt;
{{Refbegin|30em}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Arnold&lt;br /&gt;
| first = Bill T.&lt;br /&gt;
| title = Who Were the Babylonians?&lt;br /&gt;
| year = 2005&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/?id=nAemO6HmOgYC&amp;amp;pg=PA93&amp;amp;dq=%22Nebuchadnezzar+was+free+to+concentrate%22#v=onepage&amp;amp;q=%22Nebuchadnezzar%20was%20free%20to%20concentrate%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9004130713&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Bertman&lt;br /&gt;
| first = Stephen&lt;br /&gt;
| title = Handbook to Life in Ancient Mesopotamia&lt;br /&gt;
| year = 2005&lt;br /&gt;
| publisher = Oxford University Press&lt;br /&gt;
| url = https://books.google.com/?id=1C4NKp4zgIQC&amp;amp;pg=PA96&amp;amp;dq=%22Nebuchadnezzar+focused+on+large+public+works%22#v=onepage&amp;amp;q=%22Nebuchadnezzar%20focused%20on%20large%20public%20works%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-518364-1&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Cline&lt;br /&gt;
| first1 = Eric H.&lt;br /&gt;
| last2 = Graham&lt;br /&gt;
| first2 = Mark W.&lt;br /&gt;
| title = Ancient Empires: From Mesopotamia to the Rise of Islam&lt;br /&gt;
| year = 2011&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/?id=1eRb5h7ATbsC&amp;amp;pg=PA81&amp;amp;dq=%22Nabopolassar%22%22began+the+neo+babylonian+rise%22#v=onepage&amp;amp;q=%22Nabopolassar%22%22began%20the%20neo%20babylonian%20rise%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-521-88911-7&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Dalley&lt;br /&gt;
| first = Stephanie&lt;br /&gt;
| authorlink = Stephanie Dalley&lt;br /&gt;
| title = The Legacy of Mesopotamia&lt;br /&gt;
| year = 1998&lt;br /&gt;
| publisher = Oxford University Press&lt;br /&gt;
| url = https://books.google.com/?id=UhVfijsPxOMC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-814946-0&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Foster&lt;br /&gt;
| first1 = Benjamin Read&lt;br /&gt;
| last2 = Foster&lt;br /&gt;
| first2 = Karen Polinger&lt;br /&gt;
| title = Civilizations of Ancient Iraq&lt;br /&gt;
| year = 2009&lt;br /&gt;
| publisher = Princeton University Press&lt;br /&gt;
| url = https://books.google.com/?id=0FGEMW1NQmwC&amp;amp;printsec=frontcover&amp;amp;dq=Foster#v=onepage&amp;amp;q=Foster&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 0-691-13722-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Freedman&lt;br /&gt;
| first = David Noel&lt;br /&gt;
| chapter = Nebuchadnezzar&lt;br /&gt;
| editor1-last = Freedman&lt;br /&gt;
| editor1-first = David Noel&lt;br /&gt;
| editor2-last = Myers&lt;br /&gt;
| editor2-first = Allen C.&lt;br /&gt;
| title = Eerdmans Dictionary of the Bible&lt;br /&gt;
| year = 2000&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/?id=qRtUqxkB7wkC&amp;amp;pg=PA953&amp;amp;dq=%22King+of+Babylon+for+43+years%22#v=onepage&amp;amp;q=%22King%20of%20Babylon%20for%2043%20years%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9789053565032&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Lee&lt;br /&gt;
| first = Wayne E.&lt;br /&gt;
| title = Warfare and Culture in World History&lt;br /&gt;
| year = 2011&lt;br /&gt;
| publisher = NYU Press&lt;br /&gt;
| url = https://books.google.com/?id=AU4TCgAAQBAJ&amp;amp;pg=PA18&amp;amp;dq=%22success+on+Assyria%27s+western+flank%22#v=onepage&amp;amp;q=%22success%20on%20Assyria%27s%20western%20flank%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8147-5278-4&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Oates&lt;br /&gt;
| first = J&lt;br /&gt;
| chapter = The Fall of Assyria (635–609 BC)&lt;br /&gt;
| editor1-last = Boardman&lt;br /&gt;
| editor1-first = John&lt;br /&gt;
| editor2-last = Edwards&lt;br /&gt;
| editor2-first = I. E. S.&lt;br /&gt;
| title = The Cambridge Ancient History, Volume III Part II&lt;br /&gt;
| year = 1991&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/?id=OGBGauNBK8kC&amp;amp;pg=PA162&amp;amp;dq=%22Nabopolassar+was+successful+in+establishing+himself+as+the+first%22#v=onepage&amp;amp;q=%22Nabopolassar%20was%20successful%20in%20establishing%20himself%20as%20the%20first%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-521-22717-9&lt;br /&gt;
}}&lt;br /&gt;
*{{Cite book&lt;br /&gt;
| last = Sweeney&lt;br /&gt;
| first = Marvin A.&lt;br /&gt;
| title = Isaiah 1–39: With an Introduction to Prophetic Literature&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| year = 1996&lt;br /&gt;
| url = https://books.google.com/?id=BdSzj9-SZv0C&amp;amp;pg=PR3#v=onepage&amp;amp;q&amp;amp;f=false&lt;br /&gt;
| isbn = 978-0-8028-4100-1&lt;br /&gt;
| ref = harv&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Wiseman&lt;br /&gt;
| first = D.J.&lt;br /&gt;
| chapter = Babylonia 605–539 BC&lt;br /&gt;
| editor1-last = Boardman&lt;br /&gt;
| editor1-first = John&lt;br /&gt;
| editor2-last = Edwards&lt;br /&gt;
| editor2-first = I. E. S.&lt;br /&gt;
| title = The Cambridge Ancient History, Volume III Part II&lt;br /&gt;
| year = 1991a&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/?id=OGBGauNBK8kC&amp;amp;pg=PA229&amp;amp;dq=%22The+southern+tribes+had+dominated%22#v=onepage&amp;amp;q=%22The%20southern%20tribes%20had%20dominated%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-521-22717-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Wiseman&lt;br /&gt;
| first = D.J.&lt;br /&gt;
| title = Nebuchadrezzar and Babylon: The Schweich Lectures of The British Academy 1983&lt;br /&gt;
| year = 1991b&lt;br /&gt;
| publisher = OUP/British Academy&lt;br /&gt;
| url = https://books.google.com/?id=1KGMl3B78cgC&amp;amp;pg=PA5&amp;amp;dq=%22While+the+dynasty+inaugurated+in+Babylon%22#v=onepage&amp;amp;q=%22While%20the%20dynasty%20inaugurated%20in%20Babylon%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-726100-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Bandstra&lt;br /&gt;
| first = Barry L.&lt;br /&gt;
| title = Reading the Old Testament: An Introduction to the Hebrew Bible&lt;br /&gt;
| year = 2008&lt;br /&gt;
| publisher = Wadsworth Publishing Company&lt;br /&gt;
| url = https://books.google.com/?id=vRY9mTUZKJcC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 0-495-39105-0&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Bar&lt;br /&gt;
| first = Shaul&lt;br /&gt;
| title = A letter that has not been read: dreams in the Hebrew Bible&lt;br /&gt;
| year = 2001&lt;br /&gt;
| publisher = Hebrew Union College Press&lt;br /&gt;
| location = Cincinnati&lt;br /&gt;
| isbn = 978-0-87820-424-3&lt;br /&gt;
| url = https://books.google.com/?id=zs3gup4iFu4C&lt;br /&gt;
| ref = harv&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Boyer&lt;br /&gt;
| first = Paul S.&lt;br /&gt;
| title = When Time Shall Be No More: Prophecy Belief in Modern American Culture&lt;br /&gt;
| url = https://books.google.com/?id=FyTeW7vQ8K4C&lt;br /&gt;
| year = 1992&lt;br /&gt;
| publisher = Harvard University Press&lt;br /&gt;
| isbn = 0-674-95129-8&lt;br /&gt;
| ref = harv&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last = Brettler&lt;br /&gt;
| first = Mark Zvi&lt;br /&gt;
| title = How To Read the Bible&lt;br /&gt;
| year = 2005&lt;br /&gt;
| publisher = Jewish Publication Society&lt;br /&gt;
| url = https://books.google.com/?id=39nQafdJ_ssC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8276-1001-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Carroll&lt;br /&gt;
| first = John T.&lt;br /&gt;
| chapter = Eschatology&lt;br /&gt;
| editor1-last = Freedman&lt;br /&gt;
| editor1-first = David Noel&lt;br /&gt;
| editor2-last = Myers&lt;br /&gt;
| editor2-first = Allen C.&lt;br /&gt;
| title = Eerdmans Dictionary of the Bible&lt;br /&gt;
| year = 2000&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=qRtUqxkB7wkC&amp;amp;pg=PA422&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9789053565032&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Cohn&lt;br /&gt;
| first = Shaye J.D.&lt;br /&gt;
| title = From the Maccabees to the Mishnah&lt;br /&gt;
| year = 2006&lt;br /&gt;
| publisher = Westminster John Knox Press&lt;br /&gt;
| url = https://books.google.com/books?id=H5hLLIrh6n8C&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-664-22743-2&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| chapter = Daniel&lt;br /&gt;
| editor1-last = Van Der Toorn&lt;br /&gt;
| editor1-first = Karel&lt;br /&gt;
| editor2-last = Becking&lt;br /&gt;
| editor2-first = Bob&lt;br /&gt;
| editor3-last = van der Horst&lt;br /&gt;
| editor3-first = Pieter Willem&lt;br /&gt;
| title = Dictionary of Deities and Demons in the Bible&lt;br /&gt;
| publisher = [[William B. Eerdmans Publishing Company|Eerdmans]]&lt;br /&gt;
| year = 1999&lt;br /&gt;
| url = https://books.google.com/?id=yCkRz5pfxz0C&amp;amp;pg=PA219&amp;amp;dq=%22consensus%22%22Daniel+never+existed%22#v=onepage&amp;amp;q=%22consensus%22%22Daniel%20never%20existed%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-2491-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| title = Daniel: With an Introduction to Apocalyptic Literature&lt;br /&gt;
| year = 1984&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=9r_Zs7T1nCMC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-0020-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| title = Daniel&lt;br /&gt;
| year = 1993&lt;br /&gt;
| publisher = Fortress&lt;br /&gt;
| url = https://books.google.com/books/about/Daniel.html?id=H9XYAAAAMAAJ&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8006-6040-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| title = The Apocalyptic Imagination: An Introduction to Jewish Apocalyptic Literature&lt;br /&gt;
| year = 1998&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=PxjNsMrzI-kC&amp;amp;pg=PA103&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-4371-5&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| title = Seers, Sibyls, and Sages in Hellenistic-Roman Judaism&lt;br /&gt;
| year = 2001&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=M8s3cp97b-AC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-391-04110-3&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| chapter = Current Issues in the Study of Daniel&lt;br /&gt;
| editor1-last = Collins&lt;br /&gt;
| editor1-first = John J.&lt;br /&gt;
| editor2-last = Flint&lt;br /&gt;
| editor2-first = Peter W.&lt;br /&gt;
| editor3-last = VanEpps&lt;br /&gt;
| editor3-first = Cameron&lt;br /&gt;
| title = The Book of Daniel: Composition and Reception&lt;br /&gt;
| year = 2002&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=oAVPfTe_wkYC&amp;amp;pg=PA2&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9004116753&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| chapter = From Prophecy to Apocalypticism: The Expectation of the End&lt;br /&gt;
| editor1-last = McGinn&lt;br /&gt;
| editor1-first = Bernard&lt;br /&gt;
| editor2-last = Collins&lt;br /&gt;
| editor2-first = John J.&lt;br /&gt;
| editor3-last = Stein&lt;br /&gt;
| editor3-first = Stephen J.&lt;br /&gt;
| title = The Continuum History of Apocalypticism&lt;br /&gt;
| year = 2003&lt;br /&gt;
| publisher = Continuum&lt;br /&gt;
| url = https://books.google.com/books?id=7UlbWioOV7sC&amp;amp;pg=PA64&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8264-1520-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Collins&lt;br /&gt;
| first = John J.&lt;br /&gt;
| authorlink = John J. Collins&lt;br /&gt;
| chapter = Daniel&lt;br /&gt;
| editor1-last = Lieb&lt;br /&gt;
| editor1-first = Michael&lt;br /&gt;
| editor2-last = Mason&lt;br /&gt;
| editor2-first = Emma&lt;br /&gt;
| editor3-last = Roberts&lt;br /&gt;
| editor3-first = Jonathan&lt;br /&gt;
| title = The Oxford Handbook of the Reception History of the Bible&lt;br /&gt;
| year = 2013&lt;br /&gt;
| publisher = Oxford UNiversity Press&lt;br /&gt;
| url = https://books.google.com/books?id=jgPn26iYzagC&amp;amp;pg=PP140&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-164918-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Crawford&lt;br /&gt;
| first = Sidnie White&lt;br /&gt;
| chapter = Apocalyptic&lt;br /&gt;
| editor1-last = Freedman&lt;br /&gt;
| editor1-first = David Noel&lt;br /&gt;
| editor2-last = Myers&lt;br /&gt;
| editor2-first = Allen C.&lt;br /&gt;
| title = Eerdmans Dictionary of the Bible&lt;br /&gt;
| year = 2000&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=qRtUqxkB7wkC&amp;amp;pg=PA73&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9789053565032&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Cross&lt;br /&gt;
| first1 = Frank Leslie&lt;br /&gt;
| last2 = Livingstone&lt;br /&gt;
| first2 = Elizabeth A.&lt;br /&gt;
| title = The Oxford Dictionary of the Christian Church&lt;br /&gt;
| year = 2005&lt;br /&gt;
| publisher = Oxford University Press&lt;br /&gt;
| url = https://books.google.com/books?id=fUqcAQAAQBAJ&amp;amp;pg=PA452&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-280290-3&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Davies&lt;br /&gt;
| first = Philip&lt;br /&gt;
| chapter = Apocalyptic&lt;br /&gt;
| editor1-last = Rogerson&lt;br /&gt;
| editor1-first = J. W.&lt;br /&gt;
| editor2-last = Lieu&lt;br /&gt;
| editor2-first = Judith M.&lt;br /&gt;
| title = The Oxford Handbook of Biblical Studies&lt;br /&gt;
| year = 2006&lt;br /&gt;
| publisher = Oxford Handbooks Online&lt;br /&gt;
| url = https://books.google.com/books?id=eKZYMifS1fAC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-925425-5&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = DeChant&lt;br /&gt;
| first = Dell&lt;br /&gt;
| chapter = Apocalyptic Communities&lt;br /&gt;
| editor1-last = Neusner&lt;br /&gt;
| editor1-first = Jacob&lt;br /&gt;
| title = World Religions in America: An Introduction&lt;br /&gt;
| year = 2009&lt;br /&gt;
| publisher = Westminster John Knox Press&lt;br /&gt;
| url = https://books.google.com/books?id=34vGv_HDGG8C&amp;amp;pg=PA237&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-1-61164-047-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Doukhan&lt;br /&gt;
| first = Jacques&lt;br /&gt;
| title = Secrets of Daniel: Wisdom and Dreams of a Jewish Prince in Exile&lt;br /&gt;
| publisher = Review and Herald Pub Assoc&lt;br /&gt;
| url = https://books.google.com/?id=hXSW1QBB2KIC&lt;br /&gt;
| year = 2000&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8280-1424-3&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Dunn&lt;br /&gt;
| first = James D.G.&lt;br /&gt;
| chapter = The Danilic Son of Man in the New Testament&lt;br /&gt;
| editor1-last = Collins&lt;br /&gt;
| editor1-first = John J.&lt;br /&gt;
| editor2-last = Flint&lt;br /&gt;
| editor2-first = Peter W.&lt;br /&gt;
| editor3-last = VanEpps&lt;br /&gt;
| editor3-first = Cameron&lt;br /&gt;
| title = The Book of Daniel: Composition and Reception&lt;br /&gt;
| year = 2002&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=kvtbNQtMqEUC&amp;amp;pg=PA545&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 0-391-04128-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Godden&lt;br /&gt;
| first = Malcolm&lt;br /&gt;
| chapter = Biblical Literature&amp;quot; The Old Testament&lt;br /&gt;
| editor1-last = Godden and&lt;br /&gt;
| editor1-first = Malcolm&lt;br /&gt;
| editor2-last = Lapidge&lt;br /&gt;
| editor2-first = Michael&lt;br /&gt;
| title = The Cambridge Companion to Old English Literature&lt;br /&gt;
| year = 2013&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/?id=7QH3AQAAQBAJ&amp;amp;printsec=frontcover&amp;amp;dq=The+Cambridge+Companion+to+Old+English+Literature#v=onepage&amp;amp;q=%22highest%20reach%20of%20man%22&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-1-107-46921-1&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Grabbe&lt;br /&gt;
| first = Lester L.&lt;br /&gt;
| title = Judaic Religion in the Second Temple Period: Belief and Practice from the Exile to Yavneh&lt;br /&gt;
| year = 2002a&lt;br /&gt;
| publisher = Routledge&lt;br /&gt;
| url = https://books.google.com/books?id=ES2oy3IHBx0C&amp;amp;pg=PA282&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-203-46101-3&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Grabbe&lt;br /&gt;
| first = Lester L.&lt;br /&gt;
| chapter = A Dan(iel) For All Seasons&lt;br /&gt;
| editor1-last = Collins&lt;br /&gt;
| editor1-first = John J.&lt;br /&gt;
| editor2-last = Flint&lt;br /&gt;
| editor2-first = Peter W.&lt;br /&gt;
| editor3-last = VanEpps&lt;br /&gt;
| editor3-first = Cameron&lt;br /&gt;
| title = The Book of Daniel: Composition and Reception&lt;br /&gt;
| year = 2002b&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=oAVPfTe_wkYC&amp;amp;pg=PA2&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9004116753&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Grabbe&lt;br /&gt;
| first = Lester L.&lt;br /&gt;
| title = An Introduction to Second Temple Judaism: History and Religion of the Jews in the Time of Nehemiah, the Maccabees, Hillel, and Jesus&lt;br /&gt;
| year = 2010&lt;br /&gt;
| publisher = Continuum&lt;br /&gt;
| url = https://books.google.com/?id=i89-9fdNUcAC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-567-55248-8&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Hammer&lt;br /&gt;
| first = Raymond&lt;br /&gt;
| title = The Book of Daniel&lt;br /&gt;
| year = 1976&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/books?id=w0VmxeM472EC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-521-09765-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Harrington&lt;br /&gt;
| first = Daniel J.&lt;br /&gt;
| title = Invitation to the Apocrypha&lt;br /&gt;
| year = 1999&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/?id=L6zJG-9BZMQC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-4633-4&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Hill&lt;br /&gt;
| first = Andrew E.&lt;br /&gt;
| chapter = Daniel&lt;br /&gt;
| editor1-last = Garland&lt;br /&gt;
| editor1-first = David E.&lt;br /&gt;
| editor2-last = Longman&lt;br /&gt;
| editor2-first = Tremper&lt;br /&gt;
| title = Daniel—Malachi&lt;br /&gt;
| year = 2009&lt;br /&gt;
| publisher = Zondervan&lt;br /&gt;
| url = https://books.google.com/books?id=_VWQlEQGW-oC&amp;amp;pg=PT247&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-310-59054-5&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Hill&lt;br /&gt;
| first = Charles E.&lt;br /&gt;
| chapter = Antichrist&lt;br /&gt;
| editor1-last = Freedman&lt;br /&gt;
| editor1-first = David Noel&lt;br /&gt;
| editor2-last = Myers&lt;br /&gt;
| editor2-first = Allen C.&lt;br /&gt;
| title = Eerdmans Dictionary of the Bible&lt;br /&gt;
| year = 2000&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=qRtUqxkB7wkC&amp;amp;pg=PA67&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9789053565032&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Horsley&lt;br /&gt;
| first = Richard A.&lt;br /&gt;
| title = Scribes, Visionaries, and the Politics of Second Temple Judea&lt;br /&gt;
| year = 2007&lt;br /&gt;
| publisher = Presbyterian Publishing Corp&lt;br /&gt;
| url = https://books.google.com/books?id=ukojCH-hlVYC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-664-22991-7&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Knibb&lt;br /&gt;
| first = Michael&lt;br /&gt;
| chapter = The Book of Daniel in its Context&lt;br /&gt;
| editor1-last = Collins&lt;br /&gt;
| editor1-first = John J.&lt;br /&gt;
| editor2-last = Flint&lt;br /&gt;
| editor2-first = Peter W.&lt;br /&gt;
| editor3-last = VanEpps&lt;br /&gt;
| editor3-first = Cameron&lt;br /&gt;
| title = The Book of Daniel: Composition and Reception&lt;br /&gt;
| year = 2002&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=oAVPfTe_wkYC&amp;amp;pg=PA2&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 9004116753&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last = Levine&lt;br /&gt;
| first = Amy-Jill&lt;br /&gt;
| chapter = Daniel&lt;br /&gt;
| editor1-last = Coogan&lt;br /&gt;
| editor1-first = Michael D.&lt;br /&gt;
| editor2-last = Brettler&lt;br /&gt;
| editor2-first = Marc Z.&lt;br /&gt;
| editor3-last = Newsom&lt;br /&gt;
| editor3-first = Carol A.&lt;br /&gt;
| title = The new Oxford annotated Bible with the Apocryphal/Deuterocanonical books : New Revised Standard Version&lt;br /&gt;
| year = 2010&lt;br /&gt;
| publisher = [[Oxford University Press]]&lt;br /&gt;
| url = https://books.google.com/books?id=jTYdAgAAQBAJ&amp;amp;pg=PA1235&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-937050-4&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Lucas&lt;br /&gt;
| first = Ernest C.&lt;br /&gt;
| chapter = Daniel, Book of&lt;br /&gt;
| editor1-last = Vanhoozer&lt;br /&gt;
| editor1-first = Kevin J.&lt;br /&gt;
| editor2-last = Bartholomew&lt;br /&gt;
| editor2-first = Craig G.&lt;br /&gt;
| editor3-last = Treier&lt;br /&gt;
| editor3-first = Daniel J.&lt;br /&gt;
| title = Dictionary for Theological Interpretation of the Bible&lt;br /&gt;
| year = 2005&lt;br /&gt;
| publisher = Baker Academic&lt;br /&gt;
| url = https://books.google.com/books?id=I8UWJohMGUIC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8010-2694-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Matthews&lt;br /&gt;
| first1 = Victor H.&lt;br /&gt;
| last2 = Moyer&lt;br /&gt;
| first2 = James C.&lt;br /&gt;
| title = The Old Testament: Text and Context&lt;br /&gt;
| year = 2012&lt;br /&gt;
| publisher = Baker Books&lt;br /&gt;
| url = https://books.google.com/books?id=rU_dAldCk6gC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8010-4835-7&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last1 = McDonald&lt;br /&gt;
| first1 = Lee Martin&lt;br /&gt;
| title = Formation of the Bible: the Story of the Church's Canon&lt;br /&gt;
| date = 2012&lt;br /&gt;
| publisher = Hendrickson Publishers&lt;br /&gt;
| location = Peabody, MA&lt;br /&gt;
| isbn = 978-1-59856-838-7&lt;br /&gt;
| page = 57&lt;br /&gt;
| url = https://books.google.com/books?id=4SuRX3APsukC&amp;amp;lpg=PP1&lt;br /&gt;
| ref = harv&lt;br /&gt;
| accessdate = 22 July 2014&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Miller&lt;br /&gt;
| first1 = Steven R.&lt;br /&gt;
| title = Daniel&lt;br /&gt;
| year = 1994&lt;br /&gt;
| publisher = B&amp;amp;H Publishing Group&lt;br /&gt;
| url = https://books.google.com/?id=r3D6niEj9_sC&amp;amp;printsec=frontcover&amp;amp;dq=steven+r.+miller+daniel#v=onepage&amp;amp;q&amp;amp;f=false&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8054-0118-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Niskanen&lt;br /&gt;
| first1 = Paul&lt;br /&gt;
| title = The Human and the Divine in History: Herodotus and the Book of Daniel&lt;br /&gt;
| year = 2004&lt;br /&gt;
| publisher = Continuum&lt;br /&gt;
| url = https://books.google.com/books?id=G0YFSrClQOkC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-567-08213-8&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Provan&lt;br /&gt;
| first = Iain&lt;br /&gt;
| chapter = Daniel&lt;br /&gt;
| editor1-last = Dunn&lt;br /&gt;
| editor1-first = James D. G.&lt;br /&gt;
| editor2-last = Rogerson&lt;br /&gt;
| editor2-first = John William&lt;br /&gt;
| title = Eerdmans Commentary on the Bible&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| year = 2003&lt;br /&gt;
| url = https://books.google.com/books?id=2Vo-11umIZQC&amp;amp;pg=PA665&lt;br /&gt;
| isbn = 978-0-8028-3711-0&lt;br /&gt;
| ref = harv&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Redditt&lt;br /&gt;
| first = Paul L.&lt;br /&gt;
| title = Introduction to the Prophets&lt;br /&gt;
| year = 2009&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=bKM_VJt9e3kC&amp;amp;pg=PA188&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-2896-5&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Reid&lt;br /&gt;
| first = Stephen Breck&lt;br /&gt;
| chapter = Daniel, Book of&lt;br /&gt;
| editor1-last = Freedman&lt;br /&gt;
| editor1-first = David Noel&lt;br /&gt;
| editor2-last = Myers&lt;br /&gt;
| editor2-first = Allen C.&lt;br /&gt;
| title = Eerdmans Dictionary of the Bible&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| year = 2000&lt;br /&gt;
| url = https://books.google.com/books?id=qRtUqxkB7wkC&lt;br /&gt;
| isbn = 9789053565032&lt;br /&gt;
| ref = harv&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Rowland&lt;br /&gt;
| first = Christopher&lt;br /&gt;
| chapter = Apocalyptic Literature&lt;br /&gt;
| editor1-last = Hass&lt;br /&gt;
| editor1-first = Andrew&lt;br /&gt;
| editor2-last = Jasper&lt;br /&gt;
| editor2-first = David&lt;br /&gt;
| editor3-last = Jay&lt;br /&gt;
| editor3-first = Elisabeth&lt;br /&gt;
| title = The Oxford Handbook of English Literature and Theology&lt;br /&gt;
| year = 2007&lt;br /&gt;
| publisher = Oxford University Press&lt;br /&gt;
| url = https://books.google.com/books?id=bKG12u11z2AC&amp;amp;pg=PA344&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-927197-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = Ryken,&lt;br /&gt;
| first1 = Leland&lt;br /&gt;
| last2 = Wilhoit&lt;br /&gt;
| first2 = Jim&lt;br /&gt;
| last3 = Longman&lt;br /&gt;
| first3 = Tremper&lt;br /&gt;
| title = Dictionary of Biblical Imagery&lt;br /&gt;
| year = 1998&lt;br /&gt;
| publisher = InterVarsity Press&lt;br /&gt;
| url = https://books.google.com/books?id=qjEYEjVVEosC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8308-6733-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Sacchi&lt;br /&gt;
| first = Paolo&lt;br /&gt;
| title = The History of the Second Temple Period&lt;br /&gt;
| year = 2004&lt;br /&gt;
| publisher = Continuum&lt;br /&gt;
| url = https://books.google.com/books?id=yGNyKdnpMa0C&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-567-04450-1&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last = Schwartz&lt;br /&gt;
| first = Daniel R.&lt;br /&gt;
| title = Studies in the Jewish Background of Christianity&lt;br /&gt;
| year = 1992&lt;br /&gt;
| publisher = Mohr Siebeck&lt;br /&gt;
| url = https://books.google.com/books?id=rd5OB4PtlCUC&amp;amp;pg=PA110&lt;br /&gt;
| isbn = 978-3-16-145798-2&lt;br /&gt;
}}&lt;br /&gt;
* {{cite book&lt;br /&gt;
| last = Seow&lt;br /&gt;
| first = C.L.&lt;br /&gt;
| author-link = Choon-Leong Seow&lt;br /&gt;
| title = Daniel&lt;br /&gt;
| year = 2003&lt;br /&gt;
| publisher = Westminster John Knox Press&lt;br /&gt;
| url = https://books.google.com/books?id=nuLapFR3AX4C&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-664-25675-3&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Schiffman&lt;br /&gt;
| first = Lawrence H.&lt;br /&gt;
| title = From Text to Tradition: A History of Second Temple and Rabbinic Judaism&lt;br /&gt;
| year = 1991&lt;br /&gt;
| publisher = KTAV Publishing House&lt;br /&gt;
| url = https://books.google.com/books?id=3kWYHyBb4C8C&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-88125-372-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Spencer&lt;br /&gt;
| first = Richard A.&lt;br /&gt;
| chapter = Additions to Daniel&lt;br /&gt;
| editor1-last = Mills&lt;br /&gt;
| editor1-first = Watson E.&lt;br /&gt;
| editor2-last = Wilson&lt;br /&gt;
| editor2-first = Richard F.&lt;br /&gt;
| title = The Deuterocanonicals/Apocrypha&lt;br /&gt;
| year = 2002&lt;br /&gt;
| publisher = Mercer University Press&lt;br /&gt;
| url = https://books.google.com/books?id=doqYxT-1RzEC&amp;amp;pg=PA89&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-86554-510-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Towner&lt;br /&gt;
| first = W. Sibley&lt;br /&gt;
| title = Daniel&lt;br /&gt;
| year = 1984&lt;br /&gt;
| publisher = Westminster John Knox Press&lt;br /&gt;
| url = https://books.google.com/books?id=F8EEY610xeAC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-664-23756-1&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = VanderKam&lt;br /&gt;
| first = James C.&lt;br /&gt;
| title = The Dead Sea Scrolls Today&lt;br /&gt;
| year = 2010&lt;br /&gt;
| publisher = Eerdmans&lt;br /&gt;
| url = https://books.google.com/books?id=i2i5haDHAygC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-8028-6435-2&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last1 = VanderKam&lt;br /&gt;
| first1 = James C.&lt;br /&gt;
| last2 = Flint&lt;br /&gt;
| first2 = Peter&lt;br /&gt;
| title = The meaning of the Dead Sea scrolls: their significance for understanding the Bible, Judaism, Jesus, and Christianity&lt;br /&gt;
| year = 2013&lt;br /&gt;
| publisher = HarperCollins&lt;br /&gt;
| url = https://books.google.com/books?id=kT0PAAAAQBAJ&amp;amp;pg=PT146&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-06-224330-0&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Waters&lt;br /&gt;
| first = Matt&lt;br /&gt;
| title = Ancient Persia: A Concise History of the Achaemenid Empire, 550–330 BC&lt;br /&gt;
| year = 2014&lt;br /&gt;
| publisher = Cambridge University Press&lt;br /&gt;
| url = https://books.google.com/books?id=__xGAgAAQBAJ&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-1-107-65272-9&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Weber&lt;br /&gt;
| first = Timothy P.&lt;br /&gt;
| chapter = Millennialism&lt;br /&gt;
| editor1-last = Walls&lt;br /&gt;
| editor1-first = Jerry L.&lt;br /&gt;
| title = The Oxford Handbook of Eschatology&lt;br /&gt;
| year = 2007&lt;br /&gt;
| publisher = Oxford University Press&lt;br /&gt;
| url = https://books.google.com/books?id=N1XYXMTe1jYC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 978-0-19-974248-6&lt;br /&gt;
}}&lt;br /&gt;
* {{Cite book&lt;br /&gt;
| last = Wesselius&lt;br /&gt;
| first = Jan-Wim&lt;br /&gt;
| chapter = The Writing of Daniel&lt;br /&gt;
| editor1-last = Collins&lt;br /&gt;
| editor1-first = John J.&lt;br /&gt;
| editor2-last = Flint&lt;br /&gt;
| editor2-first = Peter W.&lt;br /&gt;
| editor3-last = VanEpps&lt;br /&gt;
| editor3-first = Cameron&lt;br /&gt;
| title = The Book of Daniel: Composition and Reception&lt;br /&gt;
| year = 2002&lt;br /&gt;
| publisher = BRILL&lt;br /&gt;
| url = https://books.google.com/books?id=kvtbNQtMqEUC&lt;br /&gt;
| ref = harv&lt;br /&gt;
| isbn = 0-391-04128-2&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{refend}}&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
{{Commons category|Nebuchadnezzar II}}&lt;br /&gt;
{{AmCyc Poster|Nebuchadnezzar}}&lt;br /&gt;
* [http://www.gutenberg.org/etext/10887 Inscription of Nabuchadnezzar. ''Babylonian and Assyrian Literature''] – old translation&lt;br /&gt;
* [http://www.kchanson.com/ANCDOCS/meso/meso.html Nabuchadnezzar Ishtar gate Inscription]&lt;br /&gt;
* [http://www.jewishencyclopedia.com/view.jsp?artid=154&amp;amp;letter=N&amp;amp;search=Nebuchadnezzar Jewish Encyclopedia on Nebuchadnezzar]&lt;br /&gt;
* [http://www.ancientopedia.com/Nebuchadnezzar_II/ Nebuchadnezzar II] on Ancient History Encyclopedia&lt;br /&gt;
&lt;br /&gt;
{{s-start}}&lt;br /&gt;
{{s-bef|before=[[Nabopolassar]]}}&lt;br /&gt;
{{s-ttl|title=[[Kings of Babylon|King of Babylon]]|years=605 BC – 562 BC}}&lt;br /&gt;
{{s-aft|after=[[Amel-Marduk]]}}&lt;br /&gt;
{{s-end}}&lt;br /&gt;
&lt;br /&gt;
{{Characters and names in the Quran}}&lt;br /&gt;
{{Book of Daniel}}&lt;br /&gt;
{{Authority control}}&lt;br /&gt;
&lt;br /&gt;
[[Category:630s BC births]]&lt;br /&gt;
[[Category:560s BC deaths]]&lt;br /&gt;
[[Category:6th-century BC biblical rulers]]&lt;br /&gt;
[[Category:7th-century BC biblical rulers]]&lt;br /&gt;
[[Category:Babylonian kings]]&lt;br /&gt;
[[Category:Book of Daniel]]&lt;br /&gt;
[[Category:Babylonian captivity]]&lt;br /&gt;
[[Category:Nebuchadnezzar II| ]]&lt;br /&gt;
[[Category:Monarchs of the Hebrew Bible]]&lt;br /&gt;
[[Category:Chaldean kings]]&lt;br /&gt;
[[Category:Angelic visionaries]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	<entry>
		<id>https://chaldeanwiki.com/index.php?title=Marduk-zakir-shumi_I&amp;diff=4524</id>
		<title>Marduk-zakir-shumi I</title>
		<link rel="alternate" type="text/html" href="https://chaldeanwiki.com/index.php?title=Marduk-zakir-shumi_I&amp;diff=4524"/>
				<updated>2018-03-18T16:36:32Z</updated>
		
		<summary type="html">&lt;p&gt;Test123: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox monarch&lt;br /&gt;
| name = Marduk-zâkir-šumi I&lt;br /&gt;
| title = [[List of kings of Babylon|King of Babylon]]&lt;br /&gt;
| image = AO 6684 deed of gift of Marduk-zākir-šumi.jpg&lt;br /&gt;
| caption = Kudurru recording the bequest of land by Marduk-zâkir-šumi to Ibni-Ištar on behalf of the Eanna temple in Uruk &amp;lt;ref group=i name=eanna&amp;gt;Kudurru AO 6684, published as RA 16 (1919) 125–126.&amp;lt;/ref&amp;gt;&lt;br /&gt;
| reign = c. 855 – 819 BC&lt;br /&gt;
| coronation =&lt;br /&gt;
| predecessor = [[Nabu-apla-iddina|Nabû-apla-iddina]]&lt;br /&gt;
| successor = [[Marduk-balassu-iqbi|Marduk-balāssu-iqbi]]&lt;br /&gt;
| spouse  =&lt;br /&gt;
| royal house = Dynasty of ''E''&lt;br /&gt;
| father =&lt;br /&gt;
| mother =&lt;br /&gt;
| birth_date =&lt;br /&gt;
| birth_place =&lt;br /&gt;
| death_date =&lt;br /&gt;
| death_place =&lt;br /&gt;
| buried =}}&lt;br /&gt;
&lt;br /&gt;
'''Marduk-zâkir-šumi''', inscribed &amp;lt;sup&amp;gt;md&amp;lt;/sup&amp;gt;&amp;lt;small&amp;gt;PA&amp;lt;/small&amp;gt;''-za-kir-''&amp;lt;small&amp;gt;MU&amp;lt;/small&amp;gt; in a reconstruction of two kinglists,&amp;lt;ref group=i&amp;gt;''Synchronistic Kinglist'' KAV 10 (VAT 11261) ii 9.&amp;lt;/ref&amp;gt;&amp;lt;ref group=i&amp;gt;''Synchronistic Kinglist'' KAV 182 (Ass. 13956dh) iii 12.&amp;lt;/ref&amp;gt; “Marduk pronounced the name,”&amp;lt;ref&amp;gt;šumu 1c CAD Š III p. 289.&amp;lt;/ref&amp;gt; was a king of [[Babylon]] 855-819 BC during the mixed dynastic period referred to in antiquity as the dynasty of ''E''. He was a contemporary of [[Assyria]]n kings, [[Shalmaneser III|Salmānu-ašarēdu III]]) (commonly known, Shalmaneser III)&amp;lt;ref group=i&amp;gt;''Synchronistic Kinglist'', KAV 216 (Ass. 14616c), iii 20.&amp;lt;/ref&amp;gt; (859–824 BC) and [[Shamshi-Adad V|Šamši-Adad V]] (824–811 BC) with whom he was allied.&amp;lt;ref group=i&amp;gt;''[[Eclectic Chronicle]]'' (ABC 24) BM 27859 reverse (r 5-7).&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Biography==&lt;br /&gt;
[[Image:Marduk-zâkir-šumi kudurru.jpg|thumb|right| Kudurru of land sale near Dilbat dated to Marduk-zâkir-šumi’s 11th year.&amp;lt;ref group=i name=dilbat&amp;gt;Kudurru VA 208, published as VS I 35.&amp;lt;/ref&amp;gt;]]&lt;br /&gt;
There are few contemporary inscriptions bearing witness to his reign. A kudurru&amp;lt;ref group=i name=eanna/&amp;gt; granting Ibni-Ištar, a ''kalû-''priest of the temple of Eanna in [[Uruk]], land by Marduk-zâkir-šumi, is dated to his second year.&amp;lt;ref&amp;gt;{{ cite journal | title = Un acte de donation de Marduk-zākir-šumi | author = F. Thureau-Dangin | journal = Revue d'AssyrioIogie et d'Archeologie Orientale | volume = 16 | year = 1919 | pages = 117–141 }}&amp;lt;/ref&amp;gt; Nazi-Enlil was governor or ''[[šandabakku]]'' (inscribed &amp;lt;sup&amp;gt;LÚ&amp;lt;/sup&amp;gt;&amp;lt;small&amp;gt;GÚ.EN.NA&amp;lt;/small&amp;gt;) of [[Nippur]], the first appearance of this office since [[Kassites|Kassite]] times, as he appears as a witness along with the crown prince, [[Marduk-balassu-iqbi|Marduk-balāssu-iqbi]]. A second kudurru records a private land sale near [[Dilbat]].&amp;lt;ref group=i name=dilbat/&amp;gt; His son, Enlil-apla-uṣur, was to succeed him in Marduk-balāssu-iqbi’s reign.&amp;lt;ref group=i&amp;gt;4 N-T 3:11'.&amp;lt;/ref&amp;gt; A lapis lazuli seal of this king depicting [[Marduk]]'s statue resting on his pet dragon, [[Mušḫuššu]], was an offering intended to be hung around an idol's neck.&amp;lt;ref  name=pkb&amp;gt;{{ cite book | title = A political history of post-Kassite Babylonia, 1158-722 B.C. | author = J. A. Brinkman | publisher = Analecta Orientalia | year = 1968 | pages = 192–205 }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Marduk-bēl-ušati’s revolt===&lt;br /&gt;
&lt;br /&gt;
His younger brother, Marduk-bēl-ušati (inscribed &amp;lt;sup&amp;gt;md&amp;lt;/sup&amp;gt;&amp;lt;small&amp;gt;AMAR.UTU-EN&amp;lt;/small&amp;gt;''-ú-sat''), rebelled and established a brief regime in the Diyāla region, seizing Daban.&amp;lt;ref group=i&amp;gt;''Synchronistic Chronicle'' (ABC 21), K4401a + Rm 854, iii 27-35.&amp;lt;/ref&amp;gt; Assyrian sources describe him as ''šar ḫammā’i'', &amp;quot;usurper.&amp;quot; During years 851 and 850 BC, the Assyrian king Salmānu-ašarēdu III came to Marduk-zâkir-šumi‘s aid (''ana nīrārūtišu'') and campaigned in concert&amp;lt;ref group=nb&amp;gt;The Assyrian account recalls: ''issu Marduk-zâkir-šumi ikšuda gārêšu'', ”after Marduk-zâkir-šumi had conquered his enemies.”&amp;lt;/ref&amp;gt; to force him to flee to the Jasubu mountainous region northeast, area of lower Diyāla. During the first of the campaigns, Marduk-bēl-ušati made a stand at Ganannate but was defeated outside the city walls. He was able to take refuge within the city which remained unconquered. The second campaign resulted in the city’s fall and he beat a hasty retreat with some of his officers, escaping &amp;quot;like a fox through a hole&amp;quot; to the city of Arman (Ḫalman) which itself was taken after a siege.&amp;lt;ref&amp;gt;{{ cite book | title = Reallexikon der Assyriologie und Vorderasiatischen Archäologie: Libanukasabas – Medizin | chapter = Marduk-bēl-ušati | author = J. A. Brinkman | editor = Dietz Otto Edzard | publisher = Walter De Gruyter | year = 1999 | page = 376 }}&amp;lt;/ref&amp;gt; Salmānu-ašarēdu left an account of these events on his ''[[Black Obelisk]]'':&lt;br /&gt;
&lt;br /&gt;
{{ quote|In the eighth year of my reign, Marduk-bêl-usâte, the younger brother, revolted against Marduk-zâkir-šumi, king of [[Karduniaš]], and they divided the land in its entirety. In order to avenge Marduk-zâkir-šumi, I marched out and captured Mê-Turnat. In the ninth year of my reign, I marched against Akkad a second time. I besieged Ganannate. As for Marduk-bêl-usâte, the terrifying splendor of Assur and Marduk overcame him and he went up into the mountains to save his life. I pursued him. I cut down with the sword Marduk-bêl-usâte and the rebel army officers who were with him.|Salmānu-ašarēdu|Black Obelisk&amp;lt;ref group=i&amp;gt;''[[Black Obelisk of Shalmaneser III|Black Obelisk]]'', BM WAA 118885, crafted c. 827 BC, lines 73–84&amp;lt;/ref&amp;gt; }}&lt;br /&gt;
&lt;br /&gt;
During his campaign, Salmānu-ašarēdu captured the city of Baqani, extracting tribute from Adini of Bit-Dakkuri,&amp;lt;ref group=i&amp;gt;Door fitting from the [[Balawat]] Gates, BM 124660.&amp;lt;/ref&amp;gt; also from Mušallim-Marduk of the Amukani and the leader of the Yakin tribes, the earliest attestation of these Chaldean groups and made a pilgrimage to Babylon where he recounted &amp;quot;I ascended to Esagila, the palace of the gods, the abode of the king of all …&amp;quot;&amp;lt;ref group=nb&amp;gt;''e-li-ma ana é-sag-ila'' É.GAL DINGIR.MEŠ ''šu-bat'' MAN ''gim-ri'' …&amp;lt;/ref&amp;gt;&amp;lt;ref name=rima&amp;gt;{{ cite book | title = Assyrian Rulers of the Early First Millennium BC II (858-745 B.C.) (RIMA 3) | author = A. K. Grayson | publisher = Toronto University Press | year = 1996 | pages = 31, 26–28 }} iv 6.&amp;lt;/ref&amp;gt; He practiced his religious devotions at other cultic shrines as his ''Black Obelisk'' recalls “I went to the great urban centers. I made sacrifices in Babylon, [[Borsippa]] and [[Kutha]].”&amp;lt;ref group=nb&amp;gt;''a-na ma-ḫa-zi rabûti''&amp;lt;sup&amp;gt;meš&amp;lt;/sup&amp;gt; ''a-lik niqê''(udu.siskur)&amp;lt;sup&amp;gt;meš&amp;lt;/sup&amp;gt; ''ina Bābili''&amp;lt;sup&amp;gt;ki&amp;lt;/sup&amp;gt; ''Barsip''&amp;lt;sup&amp;gt;ki&amp;lt;/sup&amp;gt; ''Ku-te-e''&amp;lt;sup&amp;gt;ki&amp;lt;/sup&amp;gt; ''ēpuš''.&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;{{ cite book | title = Assyrian and Babylonian chronicles | author = A. K. Grayson | publisher = J. J. Augustin | year = 1975 | page = 245 }}&amp;lt;/ref&amp;gt; A relief from the front of his throne base&amp;lt;ref group=i&amp;gt;ND 1 1000 = IM 65574, throne base from Fort Shalmaneser ([[Nimrud]]).&amp;lt;/ref&amp;gt; depicts him gripping Marduk-zâkir-šumi’s hand in a public display of Assyro-Babylonian friendship.&amp;lt;ref name=rima/&amp;gt; The kings are flanked by beardless youths identified as the crown princes and presumed to be Šamši-Adad V and Marduk-balāssu-iqbi, who would eventually come to conflict.&lt;br /&gt;
&lt;br /&gt;
===Babylonian intervention in the Assyrian succession===&lt;br /&gt;
&lt;br /&gt;
The opportunity came for Marduk-zâkir-šumi to return the favor when, in his 32nd year of rule, c. 826 BC, Salmānu-ašarēdu's own son, [[Assur-danin-pal|Aššur-danin-apli]] (&amp;quot;Aššur has strengthened the son&amp;quot;) rebelled against his father. Šamši-Adad V recalled:&lt;br /&gt;
&lt;br /&gt;
{{ quote|Where {{Not a typo[my brother]}} Aššur-danin-apli, in the time of Salmānu-ašarēdu, his father, acted wickedly, bringing about sedition, rebellion, and wicked plotting, caused the land to rise in revolt, prepared for war, brought the people of Assyria, north and south, to his side, and made bold speeches, brought the cities into the rebellion and set his face to begin strife and battle…27 cities, along with their fortifications…revolted against Salmānu-ašarēdu, king of the four regions of the world, my father, and …had gone to the side of Aššur-danin-apli.&amp;lt;ref&amp;gt;{{ cite book | title = The History of the Ancient World: From the Earliest Accounts to the Fall of Rome | author = S. Wise Bauer | publisher = W. W. Norton &amp;amp; Company | year = 2007 | pages = 347–348 }}&amp;lt;/ref&amp;gt; |Šamši-Adad V|Annals }}&lt;br /&gt;
&lt;br /&gt;
The ''Synchronistic History'' remains curiously silent on these events, but a treaty&amp;lt;ref group=i&amp;gt;Stone tablet of treaty, Rm.II 427 (Weidner, AfO 8 (1932-33) 27-29; SAA II 001).&amp;lt;/ref&amp;gt; between Šamši-Adad and Marduk-zâkir-šumi seems to place the Assyrian in an inferior position, indicative of his reliance on and debt to the Babylonian king. It concludes with a series of curses apparently copied from the [[Code of Hammurabi]]&amp;lt;ref&amp;gt;{{ cite journal | title = Marduk-zākir-šumi I und der Kodex Ḫammurabi | author = R. Borger | journal = OR NS | volume = 34 | year = 1965 | pages = 168–169 }}&amp;lt;/ref&amp;gt; and notably omitting the god [[Ashur (god)|Aššur]]:&lt;br /&gt;
&lt;br /&gt;
{{ quote|(May Marduk) destroy his country, smite his people {{Not a typo|[through hunge]r and famine. May [[Anu]], fath]er}} of the gods, break his scepter. (May [[Enlil|Illil]]) determine as his {{Not a typo|[fate]}} a reign of exhaustion, scarce days, years of {{Not a typo|fa[mine]}}. {{Not a typo|[Ma]y}} [[Enki|Ea]] ... dam {{Not a typo|[his]}} rivers {{Not a typo|[at the source]}}. (May [[Shamash|Šamaš]]) overturn his kingship. &amp;quot;(May Šamaš) not {{Not a typo|j[udge]}} his lawsuit ({{Not a typo|[May [[Sin (mythology)|Sîn]]]}}) {{Not a typo|[bring to an end (days, months and) years of]}} his {{Not a typo|[rei]gn}} in sighing and {{Not a typo|[moaning]}}. {{Not a typo|[May [[Adad]] deprive him of rai]n}} from heaven and of seasonal flooding from the underground water. (May Adad) {{Not a typo|[turn]}} his {{Not a typo|[country]}} into {{Not a typo|[ruin mounds left by a flood]}}.&amp;lt;ref&amp;gt;{{ cite journal | title = Notes on the Pazarcik Stela | author = Carlo Zaccagnini | journal = SAAB | volume = VII | issue = 1 | pages = 59–60 }}&amp;lt;/ref&amp;gt;|Šamši-Adad/Marduk-zâkir-šumi treaty|lines 18–35 edited }}&lt;br /&gt;
&lt;br /&gt;
It may well have been concluded while Salmānu-ašarēdu was still alive and been accompanied by the diplomatic marriage of Marduk-zâkir-šumi's daughter, [[Shammuramat]], the inspiration for the legend of [[Semiramis]], to Šamši-Adad. The consequences were, however, that Šamši-Adad resented his subordinate position and came to wreak a terrible revenge during the reign of Marduk-zâkir-šumi's son and heir, Marduk-balāssu-iqbi.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Marduk-zakir-šumi I kudurru]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://www.baghdadmuseum.org/posters/i1592134_Kuddurru_of_the_Babylonian_King_MardukZakirShumi_Iran_Late_Assyrian_Period_circa_850_BC.html Kuddurru of the Babylonian King Marduk-Zakir-Shumi, Iran, Late Assyrian Period, circa 850 BC] baghdadmuseum.org. 2006. Retrieved on 2009-09-07.&lt;br /&gt;
&lt;br /&gt;
==Inscriptions==&lt;br /&gt;
&lt;br /&gt;
ABC ''Assyrian and Babylonian Chronicles'' (Grayson, 1975); AfO ''Archiv für Orientforschungen''; AO ''siglum of objects in the collection of the [[Musée du Louvre]]''; BM ''Department of Western Asiatic Antiquities, [[British Museum]]''; IM ''[[National Museum of Iraq]] (Baghdad)''; K. ''Kouyunjik collection, British Museum''; Rm ''Rassam collection, British Museum''; KAV ''Keilschrifttexte aus Assur verschiedenen'' (Schroeder, 1920); ND ''prefix of field numbers, excavations at Nimrud 1949–63''; RA ''Revue d'Assyriologie''; SAA ''State Archives of Assyria''; VA ''Vorderasiatische Abetilung, [[Vorderasiatisches Museum Berlin]]''; VAT ''Vorderasiatische Abetilung, Tontafel, siglum of tablets in Vorderasiatisches wing of the [[Pergamon Museum]], Berlin''; VS ''Vorderasiatische Schriftdenkmäler'' (Ungnad, 1907).&lt;br /&gt;
&amp;lt;references group=&amp;quot;i&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Notes==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references group=&amp;quot;nb&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
{{Reflist}}&lt;br /&gt;
&lt;br /&gt;
{{Babylonian kings}}&lt;br /&gt;
&lt;br /&gt;
{{DEFAULTSORT:Marduk-zakir-shumi I}}&lt;br /&gt;
[[Category:9th-century BC rulers]]&lt;br /&gt;
[[Category:Babylonian kings]]&lt;/div&gt;</summary>
		<author><name>Test123</name></author>	</entry>

	</feed>