<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openmower.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Clemens+Elflein</id>
	<title>Open Mower Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openmower.de/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Clemens+Elflein"/>
	<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Special:Contributions/Clemens_Elflein"/>
	<updated>2026-04-30T13:29:20Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.1</generator>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note/doc&amp;diff=491</id>
		<title>Template:Note/doc</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note/doc&amp;diff=491"/>
		<updated>2025-05-15T16:37:21Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- Add categories where indicated at the bottom of this page and interwikis at Wikidata --&amp;gt;&lt;br /&gt;
{{TemplateData header|editlinks=1|docpage=Note/doc}}&lt;br /&gt;
&amp;lt;templatedata&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;format&amp;quot;: &amp;quot;block&amp;quot;,&lt;br /&gt;
	&amp;quot;description&amp;quot;: {&lt;br /&gt;
		&amp;quot;en&amp;quot;: &amp;quot;Show a note in a box (e.g. a top-of-the-page warning).&amp;quot;,&lt;br /&gt;
		&amp;quot;es&amp;quot;: &amp;quot;Muestra una nota en un recuadro (p. ej. un aviso en la parte superior de la página).&amp;quot;,&lt;br /&gt;
		&amp;quot;cs&amp;quot;: &amp;quot;Zobrazí poznámku v poli (např. upozornění v horní části stránky)&amp;quot;,&lt;br /&gt;
		&amp;quot;tr&amp;quot;: &amp;quot;Bir kutuda bir not gösterin (ör. sayfanın üstü uyarısı).&amp;quot;,&lt;br /&gt;
		&amp;quot;fr&amp;quot;: &amp;quot;Affiche une note dans une boîte (exemple : un avertissement en haut de la page).&amp;quot;,&lt;br /&gt;
		&amp;quot;pt-br&amp;quot;: &amp;quot;Exibe uma nota em uma caixa (como um aviso no topo de uma página).&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;params&amp;quot;: {&lt;br /&gt;
		&amp;quot;inline&amp;quot;: {&lt;br /&gt;
			&amp;quot;label&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Inline formatting&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Formato en una sola línea&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;format une ligne&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Inline formátování&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Satır içi biçimlendirme&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Formatação em linha&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;description&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Show the template without line breaks before and after it.&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Muestra la plantilla sin saltos de línea antes y después de ésta.&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;affiche le modèle sans les sauts de ligne, ni avant, ni après.&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Zobrazí šablonu bez zalomení řádků před a za ní.&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Şablonu, öncesinde ve sonrasında satır kesmeleri olmadan gösterin.&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Exibe a predefinição sem quebras de linha antes ou após.&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;default&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;0&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;0&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;autovalue&amp;quot;: &amp;quot;1&amp;quot;,&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;boolean&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;type&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;2&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Type&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Tipo&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;type de boîte&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Typ&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Tür&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Tipo&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;description&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;One of “info”, “reminder”, “warn”, or “error”. This setting affects the color and icon.&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Uno de los siguientes: “info”, “reminder”, “warn”, o “error”. Este ajuste afecta al color y al icono.&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;une des valeurs suggérées. Modifie la couleur de la boîte et l&#039;icône associée.&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Jedna z možností “info”, “reminder”, “warn”, or “error” (informace, připomenutí, upozornění nebo chyba). Toto nastavení má vliv na barvu a ikonu.&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;“info”, “reminder”, “warn” veya “error” değerlerden biri. Bu ayar, rengi ve simgeyi etkiler.&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Disponíveis: “info” (informação), “reminder” (lembrete), “warn” (aviso) e “error” (erro). Essa configuração afeta a cor e o ícone.&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;suggestedvalues&amp;quot;: [&lt;br /&gt;
				&amp;quot;info&amp;quot;,&lt;br /&gt;
				&amp;quot;reminder&amp;quot;,&lt;br /&gt;
				&amp;quot;warn&amp;quot;,&lt;br /&gt;
				&amp;quot;error&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;default&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;info&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;info&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;string&amp;quot;&lt;br /&gt;
		},&lt;br /&gt;
		&amp;quot;text&amp;quot;: {&lt;br /&gt;
			&amp;quot;aliases&amp;quot;: [&lt;br /&gt;
				&amp;quot;1&amp;quot;,&lt;br /&gt;
				&amp;quot;content&amp;quot;&lt;br /&gt;
			],&lt;br /&gt;
			&amp;quot;label&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Text&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Texto&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;texte affiché&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Text&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Metin&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Texto&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;description&amp;quot;: {&lt;br /&gt;
				&amp;quot;en&amp;quot;: &amp;quot;Informative note.&amp;quot;,&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Nota informativa.&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;note d&#039;information&amp;quot;,&lt;br /&gt;
				&amp;quot;cs&amp;quot;: &amp;quot;Informativní poznámka.&amp;quot;,&lt;br /&gt;
				&amp;quot;tr&amp;quot;: &amp;quot;Bilgilendirecek not.&amp;quot;,&lt;br /&gt;
				&amp;quot;pt-br&amp;quot;: &amp;quot;Nota informativa.&amp;quot;&lt;br /&gt;
			},&lt;br /&gt;
			&amp;quot;type&amp;quot;: &amp;quot;content&amp;quot;,&lt;br /&gt;
			&amp;quot;required&amp;quot;: true,&lt;br /&gt;
			&amp;quot;example&amp;quot;: {&lt;br /&gt;
				&amp;quot;es&amp;quot;: &amp;quot;Texto de la nota.&amp;quot;,&lt;br /&gt;
				&amp;quot;fr&amp;quot;: &amp;quot;Texte de la note.&amp;quot;&lt;br /&gt;
			}&lt;br /&gt;
		}&lt;br /&gt;
	},&lt;br /&gt;
	&amp;quot;paramOrder&amp;quot;: [&lt;br /&gt;
		&amp;quot;inline&amp;quot;,&lt;br /&gt;
		&amp;quot;type&amp;quot;,&lt;br /&gt;
		&amp;quot;text&amp;quot;&lt;br /&gt;
	]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/templatedata&amp;gt;&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:Notice templates{{#translation:}}]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Effective_protection_level&amp;diff=489</id>
		<title>Module:Effective protection level</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Effective_protection_level&amp;diff=489"/>
		<updated>2025-05-15T16:37:21Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 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) == &#039;table&#039; 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 ~= &#039;edit&#039; and action ~= &#039;move&#039; and action ~= &#039;create&#039; and action ~= &#039;upload&#039; then&lt;br /&gt;
		error( &#039;First parameter must be one of edit, move, create, upload&#039;, 2 )&lt;br /&gt;
	end&lt;br /&gt;
	if title.namespace == 8 then -- MediaWiki namespace&lt;br /&gt;
		if title.contentModel == &#039;javascript&#039; or title.contentModel == &#039;css&#039; then -- site JS or CSS page&lt;br /&gt;
			return &#039;interfaceadmin&#039;&lt;br /&gt;
		else -- any non-JS/CSS MediaWiki page&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		end&lt;br /&gt;
	elseif title.namespace == 2 and title.isSubpage then&lt;br /&gt;
		if title.contentModel == &#039;javascript&#039; or title.contentModel == &#039;css&#039; then -- user JS or CSS page&lt;br /&gt;
			return &#039;interfaceadmin&#039;&lt;br /&gt;
		elseif title.contentModel == &#039;json&#039; then -- user JSON page&lt;br /&gt;
			return &#039;sysop&#039;&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 == &#039;sysop&#039; or level == &#039;editprotected&#039; then&lt;br /&gt;
		return &#039;sysop&#039;&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 &#039;sysop&#039;&lt;br /&gt;
	elseif action == &#039;move&#039; then&lt;br /&gt;
		local blacklistentry = mw.ext.TitleBlacklist.test(&#039;edit&#039;, 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 &#039;sysop&#039;&lt;br /&gt;
		elseif title.namespace == 6 then&lt;br /&gt;
			return &#039;sysop&#039;&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;autoconfirmed&#039;&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 &#039;sysop&#039;&lt;br /&gt;
		else&lt;br /&gt;
			return &#039;autoconfirmed&#039;&lt;br /&gt;
		end&lt;br /&gt;
	elseif level == &#039;editsemiprotected&#039; then -- create-semiprotected pages return this for some reason&lt;br /&gt;
		return &#039;autoconfirmed&#039;&lt;br /&gt;
	elseif level then&lt;br /&gt;
		return level&lt;br /&gt;
	elseif action == &#039;upload&#039; then&lt;br /&gt;
		return &#039;uploader&#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &#039;*&#039;&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Module_other&amp;diff=487</id>
		<title>Template:Module other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Module_other&amp;diff=487"/>
		<updated>2025-05-15T16:37:21Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#switch:&lt;br /&gt;
  &amp;lt;!--If no or empty &amp;quot;demospace&amp;quot; parameter then detect namespace--&amp;gt;&lt;br /&gt;
  {{#if:{{{demospace|}}}&lt;br /&gt;
  | {{lc: {{{demospace}}} }}    &amp;lt;!--Use lower case &amp;quot;demospace&amp;quot;--&amp;gt;&lt;br /&gt;
  | {{#ifeq:{{NAMESPACE}}|{{ns:Module}}&lt;br /&gt;
    | module&lt;br /&gt;
    | other&lt;br /&gt;
    }}&lt;br /&gt;
  }}&lt;br /&gt;
| module = {{{1|}}}&lt;br /&gt;
| other&lt;br /&gt;
| #default = {{{2|}}}&lt;br /&gt;
}}&amp;lt;!--End switch--&amp;gt;&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Pp-template&amp;diff=485</id>
		<title>Template:Pp-template</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Pp-template&amp;diff=485"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#switch:{{#invoke:Effective protection level|edit|{{FULLPAGENAME}}}}&lt;br /&gt;
|*=[[Category:Pages with incorrect protection templates]]&lt;br /&gt;
|autoconfirmed={{#tag:indicator|[[File:Semi-protection-shackle-keyhole.svg|20px|link=Project:Protected page|alt=Permanently protected {{module other|module|template}}|This high-risk {{module other|module|template}} is permanently semi-protected to prevent vandalism]]|name=&amp;quot;pp-default&amp;quot;}}[[Category:{{module other|Modules subject to page protection|Semi-protected templates}}|{{PAGENAME}}]]&lt;br /&gt;
|sysop={{#tag:indicator|[[File:Full-protection-shackle-keyhole.svg|20px|link=Project:Protected page|alt=Permanently protected {{module other|module|template}}|This high-risk {{module other|module|template}} is permanently protected to prevent vandalism]]|name=&amp;quot;pp-default&amp;quot;}}[[Category:{{module other|Modules subject to page protection|Fully protected templates}}|{{PAGENAME}}]]&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Tl&amp;diff=483</id>
		<title>Template:Tl</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Tl&amp;diff=483"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{((}}{{ll|Template:{{{1}}}|nsp=0}}{{))}}&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:))&amp;diff=481</id>
		<title>Template:))</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:))&amp;diff=481"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;}}&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation}}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:((&amp;diff=479</id>
		<title>Template:((</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:((&amp;diff=479"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;{{&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{documentation}}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note/styles.css&amp;diff=477</id>
		<title>Template:Note/styles.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note/styles.css&amp;diff=477"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.note {&lt;br /&gt;
    background-position: left 7px top 50%;&lt;br /&gt;
    padding: 0.5em 0.5em 0.5em 40px;&lt;br /&gt;
    margin: 0.5em 0;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
    background-color: #f8f9fa;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
    border: 1px solid #ddd;&lt;br /&gt;
}&lt;br /&gt;
.note-inline {&lt;br /&gt;
    display: inline-block;&lt;br /&gt;
    vertical-align: middle;&lt;br /&gt;
}&lt;br /&gt;
.note-info {&lt;br /&gt;
    background-color: #eaf3ff;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_information-progressive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #a3caff;&lt;br /&gt;
    padding-left: 40px;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-reminder {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_lightbulb-yellow.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-warn {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_alert-warning.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.note-error {&lt;br /&gt;
    background-color: #fee7e6;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_notice-destructive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #c33;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen {&lt;br /&gt;
    html.skin-theme-clientpref-night .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (prefers-color-scheme: dark) {&lt;br /&gt;
    /* automatic mode */&lt;br /&gt;
    html.skin-theme-clientpref-os .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note/en&amp;diff=475</id>
		<title>Template:Note/en</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note/en&amp;diff=475"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;{{#if: {{{1|{{{content|{{{text|{{{demo|&amp;lt;noinclude&amp;gt;demo&amp;lt;/noinclude&amp;gt;}}}}}}}}}}}} | &amp;lt;templatestyles src=&amp;quot;Note/styles.css&amp;quot; /&amp;gt;&amp;lt;div role=&amp;quot;note&amp;quot; class=&amp;quot;note note-{{#switch: {{{2|{{{type|}}}}}}&lt;br /&gt;
    |gotcha=error&lt;br /&gt;
    |warning=warn&lt;br /&gt;
    |notice=info&lt;br /&gt;
    |=info&lt;br /&gt;
    |#default={{{2|{{{type|}}}}}}&lt;br /&gt;
    }} {{#ifeq:{{{inline|}}}|1|note-inline}}&amp;quot;&amp;gt;{{{1|{{{content|{{{text}}}}}}}}}&amp;lt;/div&amp;gt;&lt;br /&gt;
  | [[File:OOjs UI icon lightbulb-yellow.svg|18px|alt=Note|link=]]&amp;amp;nbsp;&#039;&#039;&#039;Note:&#039;&#039;&#039; }}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
== Usage ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Note|text=Foo}}&lt;br /&gt;
{{Note|type=info|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Multiple&amp;lt;br&amp;gt;lines&amp;lt;br&amp;gt;of&amp;lt;br&amp;gt;text}}&lt;br /&gt;
{{Note|type=warn|text=Foo}}&lt;br /&gt;
{{Note|type=error|text=Foo}}&lt;br /&gt;
{{Note}} Loose test&lt;br /&gt;
&lt;br /&gt;
* Text {{Note|inline=1|text=Foo}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|text=Foo}}&lt;br /&gt;
{{Note|type=info|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Multiple&amp;lt;br&amp;gt;lines&amp;lt;br&amp;gt;of&amp;lt;br&amp;gt;text}}&lt;br /&gt;
{{Note|type=warn|text=Foo}}&lt;br /&gt;
{{Note|type=error|text=Foo}}&lt;br /&gt;
{{Note}} Loose test&lt;br /&gt;
&lt;br /&gt;
* Text {{Note|inline=1|text=Foo}}&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{Note/doc}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|warn}}, shortcut for this template with &amp;lt;code&amp;gt;type=warning&amp;lt;/code&amp;gt;.&lt;br /&gt;
* {{tl|mbox}}, and in particular the namespace-agnostic {{tl|ombox}}, which by default resembles a typical &amp;quot;info&amp;quot; template.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Templates{{#translation:}}|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Documentation/styles.css&amp;diff=473</id>
		<title>Module:Documentation/styles.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Documentation/styles.css&amp;diff=473"/>
		<updated>2025-05-15T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.ts-doc-sandbox .mbox-image	{&lt;br /&gt;
	padding:.75em 0 .75em .75em;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
.ts-doc-doc {&lt;br /&gt;
	clear: both;&lt;br /&gt;
	background-color: #eaf3ff;&lt;br /&gt;
	color: var(--color-base, #202122);&lt;br /&gt;
	border: 1px solid #a3caff;&lt;br /&gt;
	margin-top: 1em;&lt;br /&gt;
	border-top-left-radius: 2px;&lt;br /&gt;
	border-top-right-radius: 2px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header {&lt;br /&gt;
	background-color: #cbd6f6;&lt;br /&gt;
	color: var(--color-base, #202122);&lt;br /&gt;
	padding: .642857em 1em .5em;&lt;br /&gt;
	border-top-left-radius: 2px;&lt;br /&gt;
	border-top-right-radius: 2px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-heading {&lt;br /&gt;
	display: inline-block;&lt;br /&gt;
	padding-left: 30px;&lt;br /&gt;
	background: center left / 24px 24px no-repeat;&lt;br /&gt;
	/* @noflip */&lt;br /&gt;
	background-image: url( //upload.wikimedia.org/wikipedia/commons/f/fb/OOjs_UI_icon_puzzle-ltr.svg );&lt;br /&gt;
	height: 24px;&lt;br /&gt;
	line-height: 24px;&lt;br /&gt;
	font-size: 13px;&lt;br /&gt;
	font-weight: 600;&lt;br /&gt;
	letter-spacing: 1px;&lt;br /&gt;
	text-transform: uppercase;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header .ts-tlinks-tlinks {&lt;br /&gt;
	line-height: 24px;&lt;br /&gt;
	margin-left: 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header .ts-tlinks-tlinks a {&lt;br /&gt;
	color: var(--color-progressive, #36c);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header .ts-tlinks-tlinks a:active {&lt;br /&gt;
	color: var(--color-progressive--active, #233566);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header .ts-tlinks-tlinks a:visited {&lt;br /&gt;
	color: var(--color-visited, #6a60b0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-header .ts-tlinks-tlinks a:visited:active {&lt;br /&gt;
	color: var(--color-visited--active, #233566);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-content {&lt;br /&gt;
	padding: .214286em 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-content:after {&lt;br /&gt;
	content: &#039;&#039;;&lt;br /&gt;
	clear: both;&lt;br /&gt;
	display: block;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-content &amp;gt; :first-child {&lt;br /&gt;
	margin-top: .5em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-content &amp;gt; :last-child {&lt;br /&gt;
	margin-bottom: .5em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.ts-doc-footer {&lt;br /&gt;
	background-color: #eaf3ff;&lt;br /&gt;
	color: var(--color-base, #202122);&lt;br /&gt;
	border: 1px solid #a3caff;&lt;br /&gt;
	padding: .214286em 1em;&lt;br /&gt;
	margin-top: .214286em;&lt;br /&gt;
	font-style: italic;&lt;br /&gt;
	border-bottom-left-radius: 2px;&lt;br /&gt;
	border-bottom-right-radius: 2px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media all and (min-width: 720px) { &lt;br /&gt;
	.ts-doc-header .ts-tlinks-tlinks {&lt;br /&gt;
		float: right;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
html.skin-theme-clientpref-night .ts-doc-header {&lt;br /&gt;
	background-color: #3056a9;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
html.skin-theme-clientpref-night .ts-doc-heading {&lt;br /&gt;
	background-image: url( &#039;//upload.wikimedia.org/wikipedia/commons/d/d3/OOjs_UI_icon_puzzle-ltr-invert.svg&#039; );	&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
html.skin-theme-clientpref-night .ts-doc-doc,&lt;br /&gt;
html.skin-theme-clientpref-night .ts-doc-footer {&lt;br /&gt;
	background-color: #1b223d;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (prefers-color-scheme: dark) {&lt;br /&gt;
	html.skin-theme-clientpref-os .ts-doc-header {&lt;br /&gt;
		background-color: #3056a9;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	html.skin-theme-clientpref-os .ts-doc-heading {&lt;br /&gt;
		background-image: url( &#039;//upload.wikimedia.org/wikipedia/commons/d/d3/OOjs_UI_icon_puzzle-ltr-invert.svg&#039; );	&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	html.skin-theme-clientpref-os .ts-doc-doc,&lt;br /&gt;
	html.skin-theme-clientpref-os .ts-doc-footer {&lt;br /&gt;
		background-color: #1b223d;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Navbar/styles.css&amp;diff=471</id>
		<title>Module:Navbar/styles.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Navbar/styles.css&amp;diff=471"/>
		<updated>2025-05-15T16:37:19Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/** {{Shared Template Warning}}&lt;br /&gt;
 * This TemplateStyles page is separately used for [[Template:Navbar]]&lt;br /&gt;
 * because of course there are two versions of the same template.&lt;br /&gt;
 * Be careful when adjusting styles accordingly.&lt;br /&gt;
 */&lt;br /&gt;
.navbar {&lt;br /&gt;
	display: inline;&lt;br /&gt;
	font-size: 88%;&lt;br /&gt;
	font-weight: normal;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar ul {&lt;br /&gt;
	display: inline;&lt;br /&gt;
	white-space: nowrap;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbar li {&lt;br /&gt;
	word-spacing: -0.125em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Navbar styling when nested in navbox */&lt;br /&gt;
.navbox .navbar {&lt;br /&gt;
	display: block;&lt;br /&gt;
	font-size: 100%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.navbox-title .navbar {&lt;br /&gt;
	/* @noflip */&lt;br /&gt;
	float: left;&lt;br /&gt;
	/* @noflip */&lt;br /&gt;
	text-align: left;&lt;br /&gt;
	/* @noflip */&lt;br /&gt;
	margin-right: 0.5em;&lt;br /&gt;
	width: 6em;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Documentation/i18n&amp;diff=469</id>
		<title>Module:Documentation/i18n</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Documentation/i18n&amp;diff=469"/>
		<updated>2025-05-15T16:37:18Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local format = require(&#039;Module:TNT&#039;).format&lt;br /&gt;
local i18n = {}&lt;br /&gt;
&lt;br /&gt;
i18n[&#039;cfg-error-msg-type&#039;] = format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-type&#039;)&lt;br /&gt;
i18n[&#039;cfg-error-msg-empty&#039;] = format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-empty&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the template namespace.&lt;br /&gt;
i18n[&#039;template-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;template-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the module namespace.&lt;br /&gt;
i18n[&#039;module-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;module-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;file-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the file namespace.&lt;br /&gt;
i18n[&#039;file-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;file-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;other-namespaces-heading&#039;]&lt;br /&gt;
-- The heading shown in other namespaces.&lt;br /&gt;
i18n[&#039;other-namespaces-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;other-namespaces-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;view-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;view&amp;quot; links.&lt;br /&gt;
i18n[&#039;view-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;view-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;edit-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;edit&amp;quot; links.&lt;br /&gt;
i18n[&#039;edit-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;history-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;history&amp;quot; links.&lt;br /&gt;
i18n[&#039;history-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;history-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;purge-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;purge&amp;quot; links.&lt;br /&gt;
i18n[&#039;purge-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;purge-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;create-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;create&amp;quot; links.&lt;br /&gt;
i18n[&#039;create-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;create-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
return i18n&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:TNT&amp;diff=467</id>
		<title>Module:TNT</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:TNT&amp;diff=467"/>
		<updated>2025-05-15T16:37:18Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--&lt;br /&gt;
-- INTRO:   (!!! DO NOT RENAME THIS PAGE !!!)&lt;br /&gt;
--    This module allows any template or module to be copy/pasted between&lt;br /&gt;
--    wikis without any translation changes. All translation text is stored&lt;br /&gt;
--    in the global  Data:*.tab  pages on Commons, and used everywhere.&lt;br /&gt;
--&lt;br /&gt;
-- SEE:   https://www.mediawiki.org/wiki/Multilingual_Templates_and_Modules&lt;br /&gt;
--&lt;br /&gt;
-- ATTENTION:&lt;br /&gt;
--    Please do NOT rename this module - it has to be identical on all wikis.&lt;br /&gt;
--    This code is maintained at https://www.mediawiki.org/wiki/Module:TNT&lt;br /&gt;
--    Please do not modify it anywhere else, as it may get copied and override your changes.&lt;br /&gt;
--    Suggestions can be made at https://www.mediawiki.org/wiki/Module_talk:TNT&lt;br /&gt;
--&lt;br /&gt;
-- DESCRIPTION:&lt;br /&gt;
--    The &amp;quot;msg&amp;quot; function uses a Commons dataset to translate a message&lt;br /&gt;
--    with a given key (e.g. source-table), plus optional arguments&lt;br /&gt;
--    to the wiki markup in the current content language.&lt;br /&gt;
--    Use lang=xx to set language.  Example:&lt;br /&gt;
--&lt;br /&gt;
--    {{#invoke:TNT | msg&lt;br /&gt;
--     | I18n/Template:Graphs.tab  &amp;lt;!-- https://commons.wikimedia.org/wiki/Data:I18n/Template:Graphs.tab --&amp;gt;&lt;br /&gt;
--     | source-table              &amp;lt;!-- uses a translation message with id = &amp;quot;source-table&amp;quot; --&amp;gt;&lt;br /&gt;
--     | param1 }}                 &amp;lt;!-- optional parameter --&amp;gt;&lt;br /&gt;
--&lt;br /&gt;
--&lt;br /&gt;
--    The &amp;quot;doc&amp;quot; function will generate the &amp;lt;templatedata&amp;gt; parameter documentation for templates.&lt;br /&gt;
--    This way all template parameters can be stored and localized in a single Commons dataset.&lt;br /&gt;
--    NOTE: &amp;quot;doc&amp;quot; assumes that all documentation is located in Data:Templatedata/* on Commons.&lt;br /&gt;
--&lt;br /&gt;
--    {{#invoke:TNT | doc | Graph:Lines }}&lt;br /&gt;
--        uses https://commons.wikimedia.org/wiki/Data:Templatedata/Graph:Lines.tab&lt;br /&gt;
--        if the current page is Template:Graph:Lines/doc&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
local i18nDataset = &#039;I18n/Module:TNT.tab&#039;&lt;br /&gt;
&lt;br /&gt;
-- Forward declaration of the local functions&lt;br /&gt;
local sanitizeDataset, loadData, link, formatMessage&lt;br /&gt;
&lt;br /&gt;
function p.msg(frame)&lt;br /&gt;
	local dataset, id&lt;br /&gt;
	local params = {}&lt;br /&gt;
	local lang = nil&lt;br /&gt;
	for k, v in pairs(frame.args) do&lt;br /&gt;
		if k == 1 then&lt;br /&gt;
			dataset = mw.text.trim(v)&lt;br /&gt;
		elseif k == 2 then&lt;br /&gt;
			id = mw.text.trim(v)&lt;br /&gt;
		elseif type(k) == &#039;number&#039; then&lt;br /&gt;
			params[k - 2] = mw.text.trim(v)&lt;br /&gt;
		elseif k == &#039;lang&#039; and v ~= &#039;_&#039; then&lt;br /&gt;
			lang = mw.text.trim(v)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return formatMessage(dataset, id, params, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Identical to p.msg() above, but used from other lua modules&lt;br /&gt;
-- Parameters:  name of dataset, message key, optional arguments&lt;br /&gt;
-- Example with 2 params:  format(&#039;I18n/Module:TNT&#039;, &#039;error_bad_msgkey&#039;, &#039;my-key&#039;, &#039;my-dataset&#039;)&lt;br /&gt;
function p.format(dataset, key, ...)&lt;br /&gt;
	local checkType = require(&#039;libraryUtil&#039;).checkType&lt;br /&gt;
	checkType(&#039;format&#039;, 1, dataset, &#039;string&#039;)&lt;br /&gt;
	checkType(&#039;format&#039;, 2, key, &#039;string&#039;)&lt;br /&gt;
	return formatMessage(dataset, key, {...})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Identical to p.msg() above, but used from other lua modules with the language param&lt;br /&gt;
-- Parameters:  language code, name of dataset, message key, optional arguments&lt;br /&gt;
-- Example with 2 params:  formatInLanguage(&#039;es&#039;, I18n/Module:TNT&#039;, &#039;error_bad_msgkey&#039;, &#039;my-key&#039;, &#039;my-dataset&#039;)&lt;br /&gt;
function p.formatInLanguage(lang, dataset, key, ...)&lt;br /&gt;
	local checkType = require(&#039;libraryUtil&#039;).checkType&lt;br /&gt;
	checkType(&#039;formatInLanguage&#039;, 1, lang, &#039;string&#039;)&lt;br /&gt;
	checkType(&#039;formatInLanguage&#039;, 2, dataset, &#039;string&#039;)&lt;br /&gt;
	checkType(&#039;formatInLanguage&#039;, 3, key, &#039;string&#039;)&lt;br /&gt;
	return formatMessage(dataset, key, {...}, lang)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Obsolete function that adds a &#039;c:&#039; prefix to the first param.&lt;br /&gt;
-- &amp;quot;Sandbox/Sample.tab&amp;quot; -&amp;gt; &#039;c:Data:Sandbox/Sample.tab&#039;&lt;br /&gt;
function p.link(frame)&lt;br /&gt;
	return link(frame.args[1])&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.doc(frame)&lt;br /&gt;
	local dataset = &#039;Templatedata/&#039; .. sanitizeDataset(frame.args[1])&lt;br /&gt;
	return frame:extensionTag(&#039;templatedata&#039;, p.getTemplateData(dataset)) ..&lt;br /&gt;
		   formatMessage(i18nDataset, &#039;edit_doc&#039;, {link(dataset)})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getTemplateData(dataset)&lt;br /&gt;
	-- TODO: add &#039;_&#039; parameter once lua starts reindexing properly for &amp;quot;all&amp;quot; languages&lt;br /&gt;
	local data = loadData(dataset)&lt;br /&gt;
	local names = {}&lt;br /&gt;
	for _, field in ipairs(data.schema.fields) do&lt;br /&gt;
		table.insert(names, field.name)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local numOnly = true&lt;br /&gt;
	local params = {}&lt;br /&gt;
	local paramOrder = {}&lt;br /&gt;
	for _, row in ipairs(data.data) do&lt;br /&gt;
		local newVal = {}&lt;br /&gt;
		local name = nil&lt;br /&gt;
		for pos, columnName in ipairs(names) do&lt;br /&gt;
			if columnName == &#039;name&#039; then&lt;br /&gt;
				name = row[pos]&lt;br /&gt;
			else&lt;br /&gt;
				newVal[columnName] = row[pos]&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if name then&lt;br /&gt;
			if (&lt;br /&gt;
				(type(name) ~= &amp;quot;number&amp;quot;)&lt;br /&gt;
				and (&lt;br /&gt;
					(type(name) ~= &amp;quot;string&amp;quot;)&lt;br /&gt;
					or not string.match(name, &amp;quot;^%d+$&amp;quot;)&lt;br /&gt;
				)&lt;br /&gt;
			) then&lt;br /&gt;
				numOnly = false&lt;br /&gt;
			end&lt;br /&gt;
			params[name] = newVal&lt;br /&gt;
			table.insert(paramOrder, name)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Work around json encoding treating {&amp;quot;1&amp;quot;:{...}} as an [{...}]&lt;br /&gt;
	if numOnly then&lt;br /&gt;
		params[&#039;zzz123&#039;]=&#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local json = mw.text.jsonEncode({&lt;br /&gt;
		params=params,&lt;br /&gt;
		paramOrder=paramOrder,&lt;br /&gt;
		description=data.description,&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	if numOnly then&lt;br /&gt;
		json = string.gsub(json,&#039;&amp;quot;zzz123&amp;quot;:&amp;quot;&amp;quot;,?&#039;, &amp;quot;&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return json&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Local functions&lt;br /&gt;
&lt;br /&gt;
sanitizeDataset = function(dataset)&lt;br /&gt;
	if not dataset then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	dataset = mw.text.trim(dataset)&lt;br /&gt;
	if dataset == &#039;&#039; then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif string.sub(dataset,-4) ~= &#039;.tab&#039; then&lt;br /&gt;
		return dataset .. &#039;.tab&#039;&lt;br /&gt;
	else&lt;br /&gt;
		return dataset&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
loadData = function(dataset, lang)&lt;br /&gt;
	dataset = sanitizeDataset(dataset)&lt;br /&gt;
	if not dataset then&lt;br /&gt;
		error(formatMessage(i18nDataset, &#039;error_no_dataset&#039;, {}))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Give helpful error to thirdparties who try and copy this module.&lt;br /&gt;
	if not mw.ext or not mw.ext.data or not mw.ext.data.get then&lt;br /&gt;
		error(string.format([[&#039;&#039;&#039;Missing JsonConfig extension, or not properly configured;&lt;br /&gt;
Cannot load https://commons.wikimedia.org/wiki/Data:%s.&lt;br /&gt;
See https://www.mediawiki.org/wiki/Extension:JsonConfig#Supporting_Wikimedia_templates&#039;&#039;&#039;]], dataset))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = mw.ext.data.get(dataset, lang)&lt;br /&gt;
&lt;br /&gt;
	if data == false then&lt;br /&gt;
		if dataset == i18nDataset then&lt;br /&gt;
			-- Prevent cyclical calls&lt;br /&gt;
			error(&#039;Missing Commons dataset &#039; .. i18nDataset)&lt;br /&gt;
		else&lt;br /&gt;
			error(formatMessage(i18nDataset, &#039;error_bad_dataset&#039;, {link(dataset)}))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Given a dataset name, convert it to a title with the &#039;commons:data:&#039; prefix&lt;br /&gt;
link = function(dataset)&lt;br /&gt;
	return &#039;c:Data:&#039; .. mw.text.trim(dataset or &#039;&#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
formatMessage = function(dataset, key, params, lang)&lt;br /&gt;
	for _, row in pairs(loadData(dataset, lang).data) do&lt;br /&gt;
		local id, msg = unpack(row)&lt;br /&gt;
		if id == key then&lt;br /&gt;
			local result = mw.message.newRawMessage(msg, unpack(params or {}))&lt;br /&gt;
			return result:plain()&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if dataset == i18nDataset then&lt;br /&gt;
		-- Prevent cyclical calls&lt;br /&gt;
		error(&#039;Invalid message key &amp;quot;&#039; .. key .. &#039;&amp;quot;&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		error(formatMessage(i18nDataset, &#039;error_bad_msgkey&#039;, {key, link(dataset)}))&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Documentation/config&amp;diff=465</id>
		<title>Module:Documentation/config</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Documentation/config&amp;diff=465"/>
		<updated>2025-05-15T16:37:17Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 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 _format = require(&#039;Module:TNT&#039;).format&lt;br /&gt;
local function format(id)&lt;br /&gt;
	return _format(&#039;I18n/Documentation&#039;, id)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Do not edit this line.&lt;br /&gt;
&lt;br /&gt;
cfg[&#039;templatestyles-scr&#039;] = &#039;Module:Documentation/styles.css&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Protection template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;protection-template&#039;]&lt;br /&gt;
-- The name of the template that displays the protection icon (a padlock on enwiki).&lt;br /&gt;
cfg[&#039;protection-template&#039;] = &#039;pp-template&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;protection-reason-edit&#039;]&lt;br /&gt;
-- The protection reason for edit-protected templates to pass to&lt;br /&gt;
-- [[Module:Protection banner]].&lt;br /&gt;
cfg[&#039;protection-reason-edit&#039;] = &#039;template&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;protection-template-args&#039;]&lt;br /&gt;
-- Any arguments to send to the protection template. This should be a Lua table.&lt;br /&gt;
-- For example, if the protection template is &amp;quot;pp-template&amp;quot;, and the wikitext template invocation&lt;br /&gt;
-- looks like &amp;quot;{{pp-template|docusage=yes}}&amp;quot;, then this table should look like &amp;quot;{docusage = &#039;yes&#039;}&amp;quot;.&lt;br /&gt;
 --]]&lt;br /&gt;
 cfg[&#039;protection-template-args&#039;] = {docusage = &#039;yes&#039;}&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[&#039;sandbox-subpage&#039;]. 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[&#039;sandbox-notice-image&#039;]&lt;br /&gt;
-- The image displayed in the sandbox notice.&lt;br /&gt;
cfg[&#039;sandbox-notice-image&#039;] = &#039;[[File:Edit In Sandbox Icon - Color.svg|40px|alt=|link=]]&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-template&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-other&#039;]&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[&#039;sandbox-notice-blurb&#039;] or&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-template&#039;] = format(&#039;sandbox-notice-pagetype-template&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-module&#039;] = format(&#039;sandbox-notice-pagetype-module&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-other&#039;] = format(&#039;sandbox-notice-pagetype-other&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-display&#039;]&lt;br /&gt;
-- Either cfg[&#039;sandbox-notice-blurb&#039;] or cfg[&#039;sandbox-notice-diff-blurb&#039;] 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[&#039;sandbox-notice-pagetype-template&#039;],&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;] or cfg[&#039;sandbox-notice-pagetype-other&#039;] 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[&#039;sandbox-notice-compare-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-blurb&#039;] = format(&#039;sandbox-notice-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-diff-blurb&#039;] = format(&#039;sandbox-notice-diff-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-compare-link-display&#039;] = format(&#039;sandbox-notice-compare-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;] 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[&#039;sandbox-notice-testcases-link-display&#039;] is the display value for that link.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] 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[&#039;sandbox-notice-testcases-run-link-display&#039;] is the display value for the link to run the test&lt;br /&gt;
-- cases.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-blurb&#039;] = format(&#039;sandbox-notice-testcases-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-link-display&#039;] = format(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] = format(&#039;sandbox-notice-testcases-run-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-link-display&#039;] = format(&#039;sandbox-notice-testcases-run-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-category&#039;]&lt;br /&gt;
-- A category to add to all template sandboxes.&lt;br /&gt;
cfg[&#039;sandbox-category&#039;] = &#039;Template sandboxes&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Start box configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;documentation-icon-wikitext&#039;]&lt;br /&gt;
-- The wikitext for the icon shown at the top of the template.&lt;br /&gt;
cfg[&#039;documentation-icon-wikitext&#039;] = &#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Link box (end box) configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;transcluded-from-blurb&#039;]&lt;br /&gt;
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.&lt;br /&gt;
cfg[&#039;transcluded-from-blurb&#039;] = format(&#039;transcluded-from-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;create-module-doc-blurb&#039;]&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[&#039;module-preload&#039;] and the&lt;br /&gt;
-- display cfg[&#039;create-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;create-module-doc-blurb&#039;] = format(&#039;create-module-doc-blurb&#039;)&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[&#039;experiment-blurb-template&#039;]&lt;br /&gt;
-- cfg[&#039;experiment-blurb-module&#039;]&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&#039;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[&#039;experiment-blurb-template&#039;] and cfg[&#039;experiment-blurb-module&#039;], 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[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-edit-link-display&#039;] | cfg[&#039;compare-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- If the sandbox doesn&#039;t exist, it is in the format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-create-link-display&#039;] | cfg[&#039;mirror-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- The link for cfg[&#039;sandbox-create-link-display&#039;] link preloads the page with cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- or cfg[&#039;module-sandbox-preload&#039;], depending on the current namespace. The link for cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- loads a default edit summary of cfg[&#039;mirror-edit-summary&#039;].&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[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-edit-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, it is in the format:&lt;br /&gt;
-- &lt;br /&gt;
--     cfg[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-create-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, the link for cfg[&#039;testcases-create-link-display&#039;] preloads the&lt;br /&gt;
-- page with cfg[&#039;template-testcases-preload&#039;] or cfg[&#039;module-testcases-preload&#039;], depending on the current&lt;br /&gt;
-- namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;experiment-blurb-template&#039;] = format(&#039;experiment-blurb-template&#039;)&lt;br /&gt;
cfg[&#039;experiment-blurb-module&#039;] = format(&#039;experiment-blurb-module&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for sandboxes.&lt;br /&gt;
cfg[&#039;sandbox-subpage&#039;] = &#039;sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for template sandbox pages.&lt;br /&gt;
cfg[&#039;template-sandbox-preload&#039;] = &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module sandbox pages.&lt;br /&gt;
cfg[&#039;module-sandbox-preload&#039;] = &#039;Template:Documentation/preload-module-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;sandbox&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-link-display&#039;] = format(&#039;sandbox-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-edit-link-display&#039;] = format(&#039;sandbox-edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-create-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-create-link-display&#039;] = format(&#039;sandbox-create-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;compare-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;compare&amp;quot; links.&lt;br /&gt;
cfg[&#039;compare-link-display&#039;] = format(&#039;compare-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-edit-summary&#039;]&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[&#039;mirror-edit-summary&#039;] = &#039;Create sandbox version of $1&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;mirror&amp;quot; links.&lt;br /&gt;
cfg[&#039;mirror-link-display&#039;] = format(&#039;mirror-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-preload&#039;]&lt;br /&gt;
-- The page to preload when a user clicks the &amp;quot;mirror&amp;quot; link.&lt;br /&gt;
cfg[&#039;mirror-link-preload&#039;] = &#039;Template:Documentation/mirror&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Test cases link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for test cases.&lt;br /&gt;
cfg[&#039;testcases-subpage&#039;] = &#039;testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for template test cases pages.&lt;br /&gt;
cfg[&#039;template-testcases-preload&#039;] = &#039;Template:Documentation/preload-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module test cases pages.&lt;br /&gt;
cfg[&#039;module-testcases-preload&#039;] = &#039;Template:Documentation/preload-module-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;testcases&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-link-display&#039;] = format(&#039;testcases-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-edit-link-display&#039;] = format(&#039;testcases-edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-create-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-create-link-display&#039;] = format(&#039;testcases-create-link-display&#039;)&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[&#039;add-categories-blurb&#039;]&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[&#039;doc-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;add-categories-blurb&#039;] = format(&#039;add-categories-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-link-display&#039;]&lt;br /&gt;
-- The text to display when linking to the /doc subpage.&lt;br /&gt;
cfg[&#039;doc-link-display&#039;] = &#039;/doc&#039;&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[&#039;subpages-blurb&#039;]&lt;br /&gt;
-- The &amp;quot;Subpages of this template&amp;quot; blurb. $1 is a link to the main template&#039;s subpages with a&lt;br /&gt;
-- display value of cfg[&#039;subpages-link-display&#039;]. 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[&#039;subpages-blurb&#039;] = format(&#039;subpages-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;subpages-link-display&#039;]&lt;br /&gt;
-- The text to display for the &amp;quot;subpages of this page&amp;quot; link. $1 is cfg[&#039;template-pagetype&#039;],&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;] or cfg[&#039;default-pagetype&#039;], 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[&#039;subpages-link-display&#039;] = format(&#039;subpages-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for template pages.&lt;br /&gt;
cfg[&#039;template-pagetype&#039;] = format(&#039;template-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for Lua module pages.&lt;br /&gt;
cfg[&#039;module-pagetype&#039;] = format(&#039;module-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;default-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for pages other than templates or Lua modules.&lt;br /&gt;
cfg[&#039;default-pagetype&#039;] = format(&#039;default-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Doc link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-subpage&#039;]&lt;br /&gt;
-- The name of the subpage typically used for documentation pages.&lt;br /&gt;
cfg[&#039;doc-subpage&#039;] = &#039;doc&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;file-docpage-preload&#039;]&lt;br /&gt;
-- Preload file for documentation page in the file namespace.&lt;br /&gt;
cfg[&#039;file-docpage-preload&#039;] = &#039;Template:Documentation/preload-filespace&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;docpage-preload&#039;]&lt;br /&gt;
-- Preload file for template documentation pages in all namespaces.&lt;br /&gt;
cfg[&#039;docpage-preload&#039;] = &#039;Template:Documentation/preload&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module documentation pages.&lt;br /&gt;
cfg[&#039;module-preload&#039;] = &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Print version configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage used for print versions.&lt;br /&gt;
cfg[&#039;print-subpage&#039;] = &#039;Print&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-link-display&#039;]&lt;br /&gt;
-- The text to display when linking to the /Print subpage.&lt;br /&gt;
cfg[&#039;print-link-display&#039;] = &#039;/Print&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-blurb&#039;]&lt;br /&gt;
-- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg[&#039;print-link-display&#039;].&lt;br /&gt;
cfg[&#039;print-blurb&#039;] = format(&#039;print-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;display-print-category&#039;]&lt;br /&gt;
-- Set to true to enable output of cfg[&#039;print-category&#039;] if a /Print subpage exists.&lt;br /&gt;
-- This should be a boolean value (either true or false).&lt;br /&gt;
cfg[&#039;display-print-category&#039;] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-category&#039;]&lt;br /&gt;
-- Category to output if cfg[&#039;display-print-category&#039;] is set to true, and a /Print subpage exists.&lt;br /&gt;
cfg[&#039;print-category&#039;] = &#039;Templates with print versions&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- HTML and CSS configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-id&#039;]&lt;br /&gt;
-- The &amp;quot;id&amp;quot; attribute of the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg[&#039;main-div-id&#039;] = &#039;template-documentation&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-classes&#039;]&lt;br /&gt;
-- The CSS classes added to the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg[&#039;main-div-class&#039;] = &#039;ts-doc-doc&#039;&lt;br /&gt;
cfg[&#039;header-div-class&#039;] = &#039;ts-doc-header&#039;&lt;br /&gt;
cfg[&#039;heading-div-class&#039;] = &#039;ts-doc-heading&#039;&lt;br /&gt;
cfg[&#039;content-div-class&#039;] = &#039;ts-doc-content&#039;&lt;br /&gt;
cfg[&#039;footer-div-class&#039;] = &#039;ts-doc-footer plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
cfg[&#039;sandbox-class&#039;] = &#039;ts-doc-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-linkclasses&#039;]&lt;br /&gt;
-- The CSS classes used for the [view][edit][history] or [create] links in the start box.&lt;br /&gt;
cfg[&#039;start-box-linkclasses&#039;] = &#039;ts-tlinks-tlinks mw-editsection-like plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-link-id&#039;]&lt;br /&gt;
-- The HTML &amp;quot;id&amp;quot; attribute for the links in the start box.&lt;br /&gt;
cfg[&#039;start-box-link-id&#039;] = &#039;doc_editlinks&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking category configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;display-strange-usage-category&#039;]&lt;br /&gt;
-- Set to true to enable output of cfg[&#039;strange-usage-category&#039;] 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[&#039;display-strange-usage-category&#039;] = false&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;strange-usage-category&#039;]&lt;br /&gt;
-- Category to output if cfg[&#039;display-strange-usage-category&#039;] is set to true and the module is used on a&lt;br /&gt;
-- /doc subpage or a /testcases subpage.&lt;br /&gt;
cfg[&#039;strange-usage-category&#039;] = &#039;Pages with strange ((documentation)) usage&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--&lt;br /&gt;
-- Don&#039;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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Documentation&amp;diff=463</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Documentation&amp;diff=463"/>
		<updated>2025-05-15T16:37:17Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 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(&#039;Module:Arguments&#039;).getArgs&lt;br /&gt;
local messageBox = require(&#039;Module:Message box&#039;)&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&#039;Module:Documentation/config&#039;)&lt;br /&gt;
local i18n = mw.loadData(&#039;Module:Documentation/i18n&#039;)&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 &#039;string&#039;.&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 &#039;Foo $2 bar $1.&#039;,&lt;br /&gt;
	-- message(&#039;foo-message&#039;, {&#039;baz&#039;, &#039;qux&#039;}) 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 &#039;string&#039;&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(require(&#039;Module:TNT&#039;).format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-type&#039;, cfgKey, expectType, 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(require(&#039;Module:TNT&#039;).format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-empty&#039;, &#039;$&#039; .. match, cfgKey), 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = ugsub(msg, &#039;$([1-9][0-9]*)&#039;, 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(&#039;[[%s|%s]]&#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&#039;[[%s]]&#039;, 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 .. &#039;:&#039; .. 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(&#039;[%s %s]&#039;, 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(&#039;#&#039;, ...)&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 &#039;&amp;lt;small style=&amp;quot;font-style: normal;&amp;quot;&amp;gt;(&#039; .. table.concat(ret, &#039; &amp;amp;#124; &#039;) .. &#039;)&amp;lt;/small&amp;gt;&#039;&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) == &#039;string&#039; then&lt;br /&gt;
					value = value:match(&#039;^%s*(.-)%s*$&#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &#039;heading&#039; or value ~= &#039;&#039; 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;
-- Load TemplateStyles&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.main = function(frame)&lt;br /&gt;
	local parent = frame.getParent(frame)&lt;br /&gt;
	local output = p._main(parent.args)&lt;br /&gt;
	return frame:extensionTag{ name=&#039;templatestyles&#039;, args = { src= message(&#039;templatestyles-scr&#039;) } } .. output&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Main function&lt;br /&gt;
----------------------------------------------------------------------------&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;
	-- &#039;main-div-id&#039; --&amp;gt; &#039;template-documentation&#039;&lt;br /&gt;
	-- &#039;main-div-classes&#039; --&amp;gt; &#039;template-documentation iezoomfix&#039;&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._getModuleWikitext(args, env))&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&#039;t have to worry about unclosed tags.&lt;br /&gt;
		:tag(&#039;div&#039;)&lt;br /&gt;
			:attr(&#039;id&#039;, message(&#039;main-div-id&#039;))&lt;br /&gt;
			:addClass(message(&#039;main-div-class&#039;))&lt;br /&gt;
			:wikitext(p._startBox(args, env))&lt;br /&gt;
			:wikitext(p._content(args, env))&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&#039;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&#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&#039;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;
		-- &#039;sandbox-subpage&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
		-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&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(&#039;sandbox-subpage&#039;) or subpage == message(&#039;testcases-subpage&#039;) 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;
		-- &#039;doc-subpage&#039; --&amp;gt; &#039;doc&#039;&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 .. &#039;/&#039; .. message(&#039;doc-subpage&#039;)&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;
		-- &#039;sandbox-subpage&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &#039;/&#039; .. message(&#039;sandbox-subpage&#039;))&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;
		-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &#039;/&#039; .. message(&#039;testcases-subpage&#039;))&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;
		-- &#039;print-subpage&#039; --&amp;gt; &#039;Print&#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&#039;print-subpage&#039;))&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 .. &#039;:&#039; .. 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;
				&#039;Special:ComparePages&#039;,&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;
p.getModuleWikitext = makeInvokeFunc(&#039;_getModuleWikitext&#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &#039;Scribunto&#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&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;
	-- &#039;sandbox-notice-image&#039; --&amp;gt; &#039;[[Image:Sandbox.svg|50px|alt=|link=]]&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-blurb&#039; --&amp;gt; &#039;This is the $1 for $2.&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-diff-blurb&#039; --&amp;gt; &#039;This is the $1 for $2 ($3).&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-template&#039; --&amp;gt; &#039;[[w:Wikipedia:Template test cases|template sandbox]] page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-module&#039; --&amp;gt; &#039;[[w:Wikipedia:Template test cases|module sandbox]] page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-pagetype-other&#039; --&amp;gt; &#039;sandbox page&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-compare-link-display&#039; --&amp;gt; &#039;diff&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-testcases-blurb&#039; --&amp;gt; &#039;See also the companion subpage for $1.&#039;&lt;br /&gt;
	-- &#039;sandbox-notice-testcases-link-display&#039; --&amp;gt; &#039;test cases&#039;&lt;br /&gt;
	-- &#039;sandbox-category&#039; --&amp;gt; &#039;Template sandboxes&#039;&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(&#039;sandbox-notice-image&#039;)&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 = &#039;&#039;&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local isPreviewing = frame:preprocess(&#039;{{REVISIONID}}&#039;) == &#039;&#039; -- True if the page is being previewed.&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-template&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-module&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&#039;sandbox-notice-pagetype-other&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if isPreviewing or not compareUrl then&lt;br /&gt;
		text = text .. message(&#039;sandbox-notice-blurb&#039;, {pagetype, templateLink})&lt;br /&gt;
	else&lt;br /&gt;
		local compareDisplay = message(&#039;sandbox-notice-compare-link-display&#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&#039;sandbox-notice-diff-blurb&#039;, {pagetype, templateLink, compareLink})&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(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&#039;sandbox-notice-testcases-run-link-display&#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &#039;&amp;lt;br /&amp;gt;&#039; .. message(&#039;sandbox-notice-testcases-run-blurb&#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &#039;&amp;lt;br /&amp;gt;&#039; .. message(&#039;sandbox-notice-testcases-blurb&#039;, {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(&#039;sandbox-category&#039;))&lt;br /&gt;
	omargs.text = text&lt;br /&gt;
	omargs.class = message(&#039;sandbox-class&#039;)&lt;br /&gt;
	local ret = &#039;&amp;lt;div style=&amp;quot;clear: both;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&#039;&lt;br /&gt;
	ret = ret .. messageBox.main(&#039;ombox&#039;, 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;
	-- &#039;protection-template&#039; --&amp;gt; &#039;pp-template&#039;&lt;br /&gt;
	-- &#039;protection-template-args&#039; --&amp;gt; {docusage = &#039;yes&#039;}&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local protectionLevels&lt;br /&gt;
	local protectionTemplate = message(&#039;protection-template&#039;)&lt;br /&gt;
	local namespace = title.namespace&lt;br /&gt;
	if not (protectionTemplate and (namespace == 10 or namespace == 828)) then&lt;br /&gt;
		-- Don&#039;t display the protection template if we are not in the template or module namespaces.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&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 editLevels = protectionLevels.edit&lt;br /&gt;
	local moveLevels = protectionLevels.move&lt;br /&gt;
	if moveLevels and moveLevels[1] == &#039;sysop&#039; or editLevels and editLevels[1] then&lt;br /&gt;
		-- The page is full-move protected, or full, template, or semi-protected.&lt;br /&gt;
		local frame = mw.getCurrentFrame()&lt;br /&gt;
		return frame:expandTemplate{title = protectionTemplate, args = message(&#039;protection-template-args&#039;, nil, &#039;table&#039;)}&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(&#039;_startBox&#039;)&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;
	-- &#039;view-link-display&#039; --&amp;gt; &#039;view&#039;&lt;br /&gt;
	-- &#039;edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;history-link-display&#039; --&amp;gt; &#039;history&#039;&lt;br /&gt;
	-- &#039;purge-link-display&#039; --&amp;gt; &#039;purge&#039;&lt;br /&gt;
	-- &#039;file-docpage-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-filespace&#039;&lt;br /&gt;
	-- &#039;module-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
	-- &#039;docpage-preload&#039; --&amp;gt; &#039;Template:Documentation/preload&#039;&lt;br /&gt;
	-- &#039;create-link-display&#039; --&amp;gt; &#039;create&#039;&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 = i18n[&#039;view-link-display&#039;]&lt;br /&gt;
	data.editLinkDisplay = i18n[&#039;edit-link-display&#039;]&lt;br /&gt;
	data.historyLinkDisplay = i18n[&#039;history-link-display&#039;]&lt;br /&gt;
	data.purgeLinkDisplay = i18n[&#039;purge-link-display&#039;]&lt;br /&gt;
	-- Create link if /doc doesn&#039;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(&#039;file-docpage-preload&#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&#039;module-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&#039;docpage-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = i18n[&#039;create-link-display&#039;]&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(&#039;%[&#039;, &#039;&amp;amp;#91;&#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&#039;%]&#039;, &#039;&amp;amp;#93;&#039;)&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 = &#039;edit&#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &#039;history&#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &#039;purge&#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &#039;[%s] [%s] [%s] [%s]&#039;&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 = &#039;edit&#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &#039;[%s]&#039;&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&#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &#039;documentation-icon-wikitext&#039; --&amp;gt; &#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]&#039;&lt;br /&gt;
	-- &#039;template-namespace-heading&#039; --&amp;gt; &#039;Template documentation&#039;&lt;br /&gt;
	-- &#039;module-namespace-heading&#039; --&amp;gt; &#039;Module documentation&#039;&lt;br /&gt;
	-- &#039;file-namespace-heading&#039; --&amp;gt; &#039;Summary&#039;&lt;br /&gt;
	-- &#039;other-namespaces-heading&#039; --&amp;gt; &#039;Documentation&#039;&lt;br /&gt;
	-- &#039;start-box-linkclasses&#039; --&amp;gt; &#039;mw-editsection-like plainlinks&#039;&lt;br /&gt;
	-- &#039;start-box-link-id&#039; --&amp;gt; &#039;doc_editlinks&#039;&lt;br /&gt;
	-- &#039;testcases-create-link-display&#039; --&amp;gt; &#039;create&#039;&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 == &#039;&#039; then&lt;br /&gt;
		-- Don&#039;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 = i18n[&#039;template-namespace-heading&#039;]&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = i18n[&#039;module-namespace-heading&#039;]&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = i18n[&#039;file-namespace-heading&#039;]&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = i18n[&#039;other-namespaces-heading&#039;]&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(&#039;start-box-linkclasses&#039;)&lt;br /&gt;
		data.linksId = message(&#039;start-box-link-id&#039;)&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(&#039;div&#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		:addClass(message(&#039;header-div-class&#039;))&lt;br /&gt;
		:tag(&#039;div&#039;)&lt;br /&gt;
			:addClass(message(&#039;heading-div-class&#039;))&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox&lt;br /&gt;
			:tag(&#039;div&#039;)&lt;br /&gt;
				:addClass(data.linksClass)&lt;br /&gt;
				:attr(&#039;id&#039;, 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(&#039;_content&#039;)&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}&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;
	local cbox = mw.html.create(&#039;div&#039;)&lt;br /&gt;
	cbox&lt;br /&gt;
		:addClass(message(&#039;content-div-class&#039;))&lt;br /&gt;
		:wikitext(&#039;\n&#039; .. (content or &#039;&#039;) .. &#039;\n&#039;)&lt;br /&gt;
	return tostring(cbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&#039;_contentTitle&#039;)&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 &#039;&#039;&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(&#039;_endBox&#039;)&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;
	&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[&#039;link box&#039;]&lt;br /&gt;
	if linkBox == &#039;off&#039;&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 footer text field.&lt;br /&gt;
	local text = &#039;&#039;&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 &#039;&#039;) -- &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&#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &#039;&#039;)&lt;br /&gt;
			text = text .. &#039;&amp;lt;br /&amp;gt;&#039;&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&#039;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 &#039;&#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &#039; &#039; .. (p.makeSubpagesBlurb(args, env) or &#039;&#039;) --&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 .. &#039;&amp;lt;br /&amp;gt;&#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ebox = mw.html.create(&#039;div&#039;)&lt;br /&gt;
	ebox&lt;br /&gt;
		:addClass(message(&#039;footer-div-class&#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
	return tostring(ebox)&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;
	-- &#039;edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;history-link-display&#039; --&amp;gt; &#039;history&#039;&lt;br /&gt;
	-- &#039;transcluded-from-blurb&#039; --&amp;gt; &lt;br /&gt;
	-- &#039;The above [[w:Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[w:Wikipedia:Transclusion|transcluded]] from $1.&#039;&lt;br /&gt;
	-- &#039;module-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
	-- &#039;create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;create-module-doc-blurb&#039; --&amp;gt;&lt;br /&gt;
	-- &#039;You might want to $1 a documentation page for this [[w:Wikipedia:Lua|Scribunto module]].&#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle or args.content 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 = &#039;edit&#039;}&lt;br /&gt;
		local editDisplay = i18n[&#039;edit-link-display&#039;]&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &#039;history&#039;}&lt;br /&gt;
		local historyDisplay = i18n[&#039;history-link-display&#039;]&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&#039;transcluded-from-blurb&#039;, {docLink})&lt;br /&gt;
			.. &#039; &#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &#039;&amp;lt;br /&amp;gt;&#039;&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 = &#039;edit&#039;, preload = message(&#039;module-preload&#039;)}&lt;br /&gt;
		local createDisplay = i18n[&#039;create-link-display&#039;]&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&#039;create-module-doc-blurb&#039;, {createLink})&lt;br /&gt;
			.. &#039;&amp;lt;br /&amp;gt;&#039;&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&#039;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;
	-- &#039;sandbox-link-display&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
	-- &#039;sandbox-edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;compare-link-display&#039; --&amp;gt; &#039;diff&#039;&lt;br /&gt;
	-- &#039;module-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-sandbox&#039;&lt;br /&gt;
	-- &#039;template-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
	-- &#039;sandbox-create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;mirror-edit-summary&#039; --&amp;gt; &#039;Create sandbox version of $1&#039;&lt;br /&gt;
	-- &#039;mirror-link-display&#039; --&amp;gt; &#039;mirror&#039;&lt;br /&gt;
	-- &#039;mirror-link-preload&#039; --&amp;gt; &#039;Template:Documentation/mirror&#039;&lt;br /&gt;
	-- &#039;sandbox-link-display&#039; --&amp;gt; &#039;sandbox&#039;&lt;br /&gt;
	-- &#039;testcases-link-display&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;testcases-edit-link-display&#039;--&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;template-sandbox-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
	-- &#039;testcases-create-link-display&#039; --&amp;gt; &#039;create&#039;&lt;br /&gt;
	-- &#039;testcases-link-display&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;testcases-edit-link-display&#039; --&amp;gt; &#039;edit&#039;&lt;br /&gt;
	-- &#039;module-testcases-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-module-testcases&#039;&lt;br /&gt;
	-- &#039;template-testcases-preload&#039; --&amp;gt; &#039;Template:Documentation/preload-testcases&#039;&lt;br /&gt;
	-- &#039;experiment-blurb-module&#039; --&amp;gt; &#039;Editors can experiment in this module&#039;s $1 and $2 pages.&#039;&lt;br /&gt;
	-- &#039;experiment-blurb-template&#039; --&amp;gt; &#039;Editors can experiment in this template&#039;s $1 and $2 pages.&#039;&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(&#039;sandbox-link-display&#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &#039;edit&#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&#039;sandbox-edit-link-display&#039;)&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(&#039;compare-link-display&#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &#039; &#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&#039;module-sandbox-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&#039;template-sandbox-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &#039;edit&#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&#039;sandbox-create-link-display&#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&#039;mirror-edit-summary&#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&#039;mirror-link-preload&#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &#039;edit&#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		local mirrorDisplay = message(&#039;mirror-link-display&#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&#039;sandbox-link-display&#039;) .. &#039; &#039; .. 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(&#039;testcases-link-display&#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &#039;edit&#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&#039;testcases-edit-link-display&#039;)&lt;br /&gt;
		local testcasesEditLink = makeUrlLink(testcasesEditUrl, testcasesEditDisplay)&lt;br /&gt;
		testcasesLinks = testcasesLink .. &#039; &#039; .. makeToolbar(testcasesEditLink)&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message(&#039;module-testcases-preload&#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&#039;template-testcases-preload&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &#039;edit&#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&#039;testcases-create-link-display&#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&#039;testcases-link-display&#039;) .. &#039; &#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &#039;experiment-blurb-module&#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &#039;experiment-blurb-template&#039;&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;
	-- &#039;doc-link-display&#039; --&amp;gt; &#039;/doc&#039;&lt;br /&gt;
	-- &#039;add-categories-blurb&#039; --&amp;gt; &#039;Please add categories to the $1 subpage.&#039;&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(&#039;doc-link-display&#039;))&lt;br /&gt;
	return message(&#039;add-categories-blurb&#039;, {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;
	-- &#039;template-pagetype&#039; --&amp;gt; &#039;template&#039;&lt;br /&gt;
	-- &#039;module-pagetype&#039; --&amp;gt; &#039;module&#039;&lt;br /&gt;
	-- &#039;default-pagetype&#039; --&amp;gt; &#039;page&#039;&lt;br /&gt;
	-- &#039;subpages-link-display&#039; --&amp;gt; &#039;Subpages of this $1&#039;&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(&#039;template-pagetype&#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&#039;module-pagetype&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&#039;default-pagetype&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&#039;Special:PrefixIndex/&#039; .. templateTitle.prefixedText .. &#039;/&#039;,&lt;br /&gt;
		message(&#039;subpages-link-display&#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&#039;subpages-blurb&#039;, {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;
	-- &#039;print-link-display&#039; --&amp;gt; &#039;/Print&#039;&lt;br /&gt;
	-- &#039;print-blurb&#039; --&amp;gt; &#039;A [[Help:Books/for experts#Improving the book layout|print version]]&#039;&lt;br /&gt;
	--		.. &#039; of this template exists at $1.&#039;&lt;br /&gt;
	--		.. &#039; If you make a change to this template, please update the print version as well.&#039;&lt;br /&gt;
	-- &#039;display-print-category&#039; --&amp;gt; true&lt;br /&gt;
	-- &#039;print-category&#039; --&amp;gt; &#039;Templates with print versions&#039;&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(&#039;print-link-display&#039;))&lt;br /&gt;
		ret = message(&#039;print-blurb&#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&#039;display-print-category&#039;, nil, &#039;boolean&#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&#039;print-category&#039;))&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;
	-- &#039;display-strange-usage-category&#039; --&amp;gt; true&lt;br /&gt;
	-- &#039;doc-subpage&#039; --&amp;gt; &#039;doc&#039;&lt;br /&gt;
	-- &#039;testcases-subpage&#039; --&amp;gt; &#039;testcases&#039;&lt;br /&gt;
	-- &#039;strange-usage-category&#039; --&amp;gt; &#039;Wikipedia pages with strange ((documentation)) usage&#039;&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 = &#039;&#039;&lt;br /&gt;
	if message(&#039;display-strange-usage-category&#039;, nil, &#039;boolean&#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&#039;doc-subpage&#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&#039;testcases-subpage&#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&#039;strange-usage-category&#039;))&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Sandbox_other&amp;diff=461</id>
		<title>Template:Sandbox other</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Sandbox_other&amp;diff=461"/>
		<updated>2025-05-15T16:37:16Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#switch:{{SUBPAGENAME}}|sandbox|doc={{{1|}}}|#default={{{2|}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Transclude&amp;diff=459</id>
		<title>Template:Transclude</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Transclude&amp;diff=459"/>
		<updated>2025-05-15T16:37:16Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;{{#switch: {{NAMESPACE: {{{1}}} }}&lt;br /&gt;
 |#default = {{FULLPAGENAME: {{{1}}} }} &amp;lt;!-- leading namespace prefix, eg &amp;quot;Template:Foo&amp;quot; --&amp;gt;&lt;br /&gt;
 |{{ns:0}} = &lt;br /&gt;
    {{#ifeq: {{NAMESPACE: {{{1}}} }} | {{NAMESPACE: Template{{{1}}} }}&lt;br /&gt;
      | Template:{{{1}}}            &amp;lt;!-- no leading colon, eg &amp;quot;Foo&amp;quot; --&amp;gt;&lt;br /&gt;
      | {{PAGENAME: {{{1}}} }}      &amp;lt;!-- leading colon, eg &amp;quot;:Foo&amp;quot;, so we want the article --&amp;gt;&lt;br /&gt;
    }}&lt;br /&gt;
}}&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Yesno&amp;diff=457</id>
		<title>Template:Yesno</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Yesno&amp;diff=457"/>
		<updated>2025-05-15T16:37:16Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;#switch: {{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;lc: {{{1|¬}}} }}&lt;br /&gt;
 |no&lt;br /&gt;
 |n&lt;br /&gt;
 |false&lt;br /&gt;
 |0        = {{{no|&amp;lt;!-- null --&amp;gt;}}}&lt;br /&gt;
 |         = {{{blank|{{{no|&amp;lt;!-- null --&amp;gt;}}}}}}&lt;br /&gt;
 |¬        = {{{¬|}}}&lt;br /&gt;
 |yes&lt;br /&gt;
 |y&lt;br /&gt;
 |true&lt;br /&gt;
 |1        = {{{yes|yes}}}&lt;br /&gt;
 |#default = {{{def|{{{yes|yes}}}}}}&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:TemplateData_header/en&amp;diff=455</id>
		<title>Template:TemplateData header/en</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:TemplateData_header/en&amp;diff=455"/>
		<updated>2025-05-15T16:37:16Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;{{#switch:&lt;br /&gt;
|=&lt;br /&gt;
&amp;lt;div class=&amp;quot;templatedata-header&amp;quot;&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{yesno|{{{editlinks|}}}}}&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{#ifexpr:&amp;lt;!--&lt;br /&gt;
		--&amp;gt;{{#if:{{{docpage|}}}&amp;lt;!--&lt;br /&gt;
			--&amp;gt;|{{#ifeq:{{FULLPAGENAME}}|{{transclude|{{{docpage}}}}}|0|1}}&amp;lt;!--&lt;br /&gt;
			--&amp;gt;|not{{IsDocSubpage|false=0}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|{{Navbar|{{{docpage|{{BASEPAGENAME}}/doc}}}|plain=1|brackets=1|style=float:{{dir|{{PAGELANGUAGE}}|left|right}};}}&amp;lt;!--&lt;br /&gt;
	--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&lt;br /&gt;
{{#if:{{{noheader|}}}||This is the [[Special:MyLanguage/Help:TemplateData|TemplateData]] documentation for this template used by [[Special:MyLanguage/VisualEditor|VisualEditor]] and other tools.}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;{{{1|{{BASEPAGENAME}}}}}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox|&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{#if:{{IsDocSubpage|false=}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|[[Category:TemplateData documentation{{#translation:}}]]&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|[[Category:Templates using TemplateData{{#translation:}}]]&amp;lt;!--&lt;br /&gt;
	--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
| #default=&lt;br /&gt;
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:{{pagelang}}|{{pagelang}}|{{int:lang}}}}}}&lt;br /&gt;
}}&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
&lt;br /&gt;
Inserts a brief header for the template data section.&lt;br /&gt;
Adds the /doc subpage to {{ll|Category:TemplateData documentation}} and the template page to {{ll|Category:Templates using TemplateData}}.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{#tag:syntaxhighlight|&lt;br /&gt;
==TemplateData== or ==Parameters== or ==Usage==&lt;br /&gt;
{{((}}TemplateData header{{))}}&lt;br /&gt;
{{^(}}templatedata{{)^}}{&lt;br /&gt;
...&lt;br /&gt;
}{{^(}}/templatedata{{)^}}&lt;br /&gt;
|lang=html&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Use {{tmpl|0=&amp;lt;code&amp;gt;{{((}}TemplateData header{{!}}$1{{))}}&amp;lt;/code&amp;gt;|Template name}} to display a name for the template other than the default, which is {{ll|Help:Magic words#Variables|&amp;lt;nowiki&amp;gt;{{BASEPAGENAME}}&amp;lt;/nowiki&amp;gt;}}.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&lt;br /&gt;
{{TemplateData header|Template name}}&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{TemplateData header|noheader=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to omit the first sentence of the header text.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&lt;br /&gt;
{{TemplateData header|noheader=1}}&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Parameters==&lt;br /&gt;
{{TemplateData header/doc}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:TemplateData_header&amp;diff=453</id>
		<title>Template:TemplateData header</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:TemplateData_header&amp;diff=453"/>
		<updated>2025-05-15T16:37:15Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;{{#switch:&amp;lt;translate&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
|=&lt;br /&gt;
&amp;lt;div class=&amp;quot;templatedata-header&amp;quot;&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{yesno|{{{editlinks|}}}}}&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{#ifexpr:&amp;lt;!--&lt;br /&gt;
		--&amp;gt;{{#if:{{{docpage|}}}&amp;lt;!--&lt;br /&gt;
			--&amp;gt;|{{#ifeq:{{FULLPAGENAME}}|{{transclude|{{{docpage}}}}}|0|1}}&amp;lt;!--&lt;br /&gt;
			--&amp;gt;|not{{IsDocSubpage|false=0}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|{{Navbar|{{{docpage|{{BASEPAGENAME}}/doc}}}|plain=1|brackets=1|style=float:{{dir|{{PAGELANGUAGE}}|left|right}};}}&amp;lt;!--&lt;br /&gt;
	--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&lt;br /&gt;
{{#if:{{{noheader|}}}||&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; This is the [[&amp;lt;tvar name=1&amp;gt;Special:MyLanguage/Help:TemplateData&amp;lt;/tvar&amp;gt;|TemplateData]] documentation for this template used by [[&amp;lt;tvar name=2&amp;gt;Special:MyLanguage/VisualEditor&amp;lt;/tvar&amp;gt;|VisualEditor]] and other tools.&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;{{{1|{{BASEPAGENAME}}}}}&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox|&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{#if:{{IsDocSubpage|false=}}&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|[[Category:TemplateData documentation{{#translation:}}]]&amp;lt;!--&lt;br /&gt;
		--&amp;gt;|[[Category:Templates using TemplateData{{#translation:}}]]&amp;lt;!--&lt;br /&gt;
	--&amp;gt;}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
| #default=&lt;br /&gt;
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:TemplateData header|noshift=1|uselang={{#if:{{pagelang}}|{{pagelang}}|{{int:lang}}}}}}&lt;br /&gt;
}}&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; Inserts a brief header for the template data section.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Adds the &amp;lt;tvar name=1&amp;gt;/doc&amp;lt;/tvar&amp;gt; subpage to &amp;lt;tvar name=2&amp;gt;{{ll|Category:TemplateData documentation}}&amp;lt;/tvar&amp;gt; and the template page to &amp;lt;tvar name=3&amp;gt;{{ll|Category:Templates using TemplateData}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Usage == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{#tag:syntaxhighlight|&lt;br /&gt;
==TemplateData== or ==Parameters== or ==Usage==&lt;br /&gt;
{{((}}TemplateData header{{))}}&lt;br /&gt;
{{^(}}templatedata{{)^}}{&lt;br /&gt;
...&lt;br /&gt;
}{{^(}}/templatedata{{)^}}&lt;br /&gt;
|lang=html&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:5--&amp;gt;&lt;br /&gt;
Use {{&amp;lt;tvar name=1&amp;gt;tmpl|0=&amp;lt;code&amp;gt;{{((}}TemplateData header{{!}}$1{{))}}&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;|Template name}} to display a name for the template other than the default, which is &amp;lt;tvar name=&amp;quot;2&amp;quot;&amp;gt;{{ll|Help:Magic words#Variables|&amp;lt;nowiki&amp;gt;{{BASEPAGENAME}}&amp;lt;/nowiki&amp;gt;}}&amp;lt;/tvar&amp;gt;.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&lt;br /&gt;
{{TemplateData header|Template name}}&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
Use &amp;lt;tvar name=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{TemplateData header|noheader=1}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt; to omit the first sentence of the header text.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&amp;lt;dd&amp;gt;&lt;br /&gt;
{{TemplateData header|noheader=1}}&lt;br /&gt;
&amp;lt;/dd&amp;gt;&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
==Parameters== &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{TemplateData header/doc}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:IsDocSubpage&amp;diff=451</id>
		<title>Template:IsDocSubpage</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:IsDocSubpage&amp;diff=451"/>
		<updated>2025-05-15T16:37:14Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;onlyinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#ifexpr: (&lt;br /&gt;
	{{#ifeq:{{lc:{{SUBPAGENAME}}}}|{{lc:{{{override|doc}}}}}|1|0}} or (&lt;br /&gt;
		{{#ifeq:{{lc:{{#titleparts:{{FULLPAGENAME}}|-1|-2}}}}|{{lc:{{{override|doc}}}}}|1|0}}&lt;br /&gt;
		and {{#if:{{#translation:}}|1|0}}&lt;br /&gt;
	)&lt;br /&gt;
)&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{{true|1}}}&amp;lt;!--&lt;br /&gt;
	--&amp;gt;|{{{false|}}}&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&amp;lt;/includeonly&amp;gt;&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage and interwikis in Wikidata, not here! --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Documentation_subpage/en&amp;diff=449</id>
		<title>Template:Documentation subpage/en</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Documentation_subpage/en&amp;diff=449"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#switch:&lt;br /&gt;
| =&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
 --&amp;gt;{{#if:{{IsDocSubpage|override={{{override|doc}}}|false=}}&lt;br /&gt;
     | &amp;lt;!--(this template has been transcluded on a /doc or /{{{override}}} page)--&amp;gt;&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{#ifeq:{{{doc-notice|show}}} |show&lt;br /&gt;
          | {{Mbox&lt;br /&gt;
             | type = notice&lt;br /&gt;
             | style = margin-bottom:1.0em;&lt;br /&gt;
             | image = [[File:OOjs UI icon book-ltr.svg|40px|alt=|class=skin-invert]]&lt;br /&gt;
             | text =&lt;br /&gt;
&#039;&#039;&#039;This is a [[w:Wikipedia:Template documentation|documentation]] [[Special:MyLanguage/Help:Subpages|subpage]] for {{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}.&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{text2|}}}{{{text1|}}}&lt;br /&gt;
  |It contains usage information, [[Special:MyLanguage/Help:Categories|categories]] and other content that is not part of the original {{{text2|{{{text1}}}}}}.&lt;br /&gt;
  |It contains usage information, [[Special:MyLanguage/Help:Categories|categories]] and other content that is not part of the original {{SUBJECTSPACE}} page.&lt;br /&gt;
  }}&lt;br /&gt;
            }}&lt;br /&gt;
         }}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{#if:{{{inhibit|}}} |&amp;lt;!--(don&#039;t categorize)--&amp;gt;&lt;br /&gt;
          |   &amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
               --&amp;gt;{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}&lt;br /&gt;
                   | [[Category:{{#switch:{{SUBJECTSPACE}}&lt;br /&gt;
                           | Template | Project = Template&lt;br /&gt;
                           | Module   = Module&lt;br /&gt;
                           | User     = User&lt;br /&gt;
                           | #default = MediaWiki&lt;br /&gt;
                       }} documentation pages{{#translation:}}]]&lt;br /&gt;
                   | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]&lt;br /&gt;
                  }}&amp;lt;!--&lt;br /&gt;
           --&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
         }}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
(completing initial #ifeq: at start of template:)&lt;br /&gt;
--&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
     | &amp;lt;!--(this template has not been transcluded on a /doc or /{{{override}}} page)--&amp;gt;&lt;br /&gt;
    }}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
| #default=&lt;br /&gt;
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation subpage|noshift=1|uselang={{int:lang}}}}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Use this template on Template Documentation subpage (/doc).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
*{{tl|Documentation}}&lt;br /&gt;
*{{tl|tl}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Documentation_subpage&amp;diff=447</id>
		<title>Template:Documentation subpage</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Documentation_subpage&amp;diff=447"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#switch:&amp;lt;translate&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
| =&lt;br /&gt;
&amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
 --&amp;gt;{{#if:{{IsDocSubpage|override={{{override|doc}}}|false=}}&lt;br /&gt;
     | &amp;lt;!--(this template has been transcluded on a /doc or /{{{override}}} page)--&amp;gt;&lt;br /&gt;
&amp;lt;/includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{#ifeq:{{{doc-notice|show}}} |show&lt;br /&gt;
          | {{Mbox&lt;br /&gt;
             | type = notice&lt;br /&gt;
             | style = margin-bottom:1.0em;&lt;br /&gt;
             | image = [[File:OOjs UI icon book-ltr.svg|40px|alt=|class=skin-invert]]&lt;br /&gt;
             | text =&lt;br /&gt;
&#039;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; This is a [[w:Wikipedia:Template documentation|documentation]] [[&amp;lt;tvar name=2&amp;gt;Special:MyLanguage/Help:Subpages&amp;lt;/tvar&amp;gt;|subpage]] for &amp;lt;tvar name=1&amp;gt;{{{1|[[:{{SUBJECTSPACE}}:{{BASEPAGENAME}}]]}}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&#039;&#039;&#039;&amp;lt;br /&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#if:{{{text2|}}}{{{text1|}}}&lt;br /&gt;
  |&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; It contains usage information, [[&amp;lt;tvar name=7&amp;gt;Special:MyLanguage/Help:Categories&amp;lt;/tvar&amp;gt;|categories]] and other content that is not part of the original &amp;lt;tvar name=1&amp;gt;{{{text2|{{{text1}}}}}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
  |&amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; It contains usage information, [[&amp;lt;tvar name=7&amp;gt;Special:MyLanguage/Help:Categories&amp;lt;/tvar&amp;gt;|categories]] and other content that is not part of the original &amp;lt;tvar name=1&amp;gt;{{SUBJECTSPACE}}&amp;lt;/tvar&amp;gt; page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
  }}&lt;br /&gt;
            }}&lt;br /&gt;
         }}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{DEFAULTSORT:{{{defaultsort|{{PAGENAME}}}}}}}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
      --&amp;gt;{{#if:{{{inhibit|}}} |&amp;lt;!--(don&#039;t categorize)--&amp;gt;&lt;br /&gt;
          |   &amp;lt;includeonly&amp;gt;&amp;lt;!--&lt;br /&gt;
               --&amp;gt;{{#ifexist:{{NAMESPACE}}:{{BASEPAGENAME}}&lt;br /&gt;
                   | [[Category:{{#switch:{{SUBJECTSPACE}}&lt;br /&gt;
                           | Template | Project = Template&lt;br /&gt;
                           | Module   = Module&lt;br /&gt;
                           | User     = User&lt;br /&gt;
                           | #default = MediaWiki&lt;br /&gt;
                       }} documentation pages{{#translation:}}]]&lt;br /&gt;
                   | [[Category:Documentation subpages without corresponding pages{{#translation:}}]]&lt;br /&gt;
                  }}&amp;lt;!--&lt;br /&gt;
           --&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
         }}&amp;lt;!--&lt;br /&gt;
&lt;br /&gt;
(completing initial #ifeq: at start of template:)&lt;br /&gt;
--&amp;gt;&amp;lt;includeonly&amp;gt;&lt;br /&gt;
     | &amp;lt;!--(this template has not been transcluded on a /doc or /{{{override}}} page)--&amp;gt;&lt;br /&gt;
    }}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/includeonly&amp;gt;&lt;br /&gt;
| #default=&lt;br /&gt;
  {{#invoke:Template translation|renderTranslatedTemplate|template=Template:Documentation subpage|noshift=1|uselang={{int:lang}}}}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Usage == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
Use this template on Template Documentation subpage (/doc).&lt;br /&gt;
&lt;br /&gt;
== See also == &amp;lt;!--T:8--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
*{{tl|Documentation}}&lt;br /&gt;
*{{tl|tl}}&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Translatable/en&amp;diff=445</id>
		<title>Template:Translatable/en</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Translatable/en&amp;diff=445"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#ifeq:{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}|&lt;br /&gt;
|{{{1|{{FULLPAGENAME}}}}}&lt;br /&gt;
|{{#invoke:String|sub|{{{1|{{FULLPAGENAME}}}}}&lt;br /&gt;
  |1&lt;br /&gt;
  |{{#expr:{{#invoke:String|len|{{{1|{{FULLPAGENAME}}}}}}}-{{#invoke:String|len|{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}}}-1}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
{{Lua|Module:String}}&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
* {{tlx|translatable}}&lt;br /&gt;
{{translatable}}&lt;br /&gt;
* {{tlx|translatable|2=Page name}}&lt;br /&gt;
{{translatable|1=Page name}}&lt;br /&gt;
* {{tlx|translatable|2=Page name/{{PAGELANGUAGE}} }}&lt;br /&gt;
{{translatable|1=Page name/{{PAGELANGUAGE}} }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Internationalization templates{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Documentation/en&amp;diff=443</id>
		<title>Template:Documentation/en</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Documentation/en&amp;diff=443"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&lt;br /&gt;
{{Lua|Module:Documentation}}&lt;br /&gt;
This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.&lt;br /&gt;
It is intended for pages which are [[Special:MyLanguage/Help:Transclusion|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Customising display ===&lt;br /&gt;
&lt;br /&gt;
Overrides exist to customise the output in special cases:&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;documentation{{!}}&#039;&#039;&#039;heading&#039;&#039;&#039;=&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; - change the text of the &amp;quot;documentation&amp;quot; heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template&#039;s documentation and categories.&lt;br /&gt;
It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[:en:Special:Diff/69888944|developer&#039;s explanation]]).&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[w:Template:Documentation subpage]]&lt;br /&gt;
* {{tim|Documentation}}&lt;br /&gt;
* [[w:Wikipedia:Template documentation]]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Formatting templates{{#translation:}}|Template documentation]]&lt;br /&gt;
[[Category:Template documentation{{#translation:}}| ]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#if:{{{content|}}}|&lt;br /&gt;
[[Category:Template documentation pages{{#translation:}}]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Documentation&amp;diff=441</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Documentation&amp;diff=441"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&lt;br /&gt;
{{Lua|Module:Documentation}}&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:12--&amp;gt; This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; It is intended for pages which are [[&amp;lt;tvar name=1&amp;gt;Special:MyLanguage/Help:Transclusion&amp;lt;/tvar&amp;gt;|transcluded]] in other pages, i.e. templates, whether in the template namespace or not.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Usage == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Customising display === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:4--&amp;gt;&lt;br /&gt;
Overrides exist to customise the output in special cases:&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;documentation{{!}}&#039;&#039;&#039;heading&#039;&#039;&#039;=&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; - &amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; change the text of the &amp;quot;documentation&amp;quot; heading.&amp;lt;/translate&amp;gt; &amp;lt;translate&amp;gt;&amp;lt;!--T:10--&amp;gt; If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Rationale == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:7--&amp;gt; This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template&#039;s documentation and categories.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; It also reduces server resources by circumventing a [[w:Wikipedia:Template limits|technical limitation of templates]] (see a [[&amp;lt;tvar name=1&amp;gt;:en:Special:Diff/69888944&amp;lt;/tvar&amp;gt;|developer&#039;s explanation]]).&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== See also == &amp;lt;!--T:9--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; [[w:Template:Documentation subpage]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
* {{tim|Documentation}}&lt;br /&gt;
* &amp;lt;translate&amp;gt;&amp;lt;!--T:11--&amp;gt; [[w:Wikipedia:Template documentation]]&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Formatting templates{{#translation:}}|Template documentation]]&lt;br /&gt;
[[Category:Template documentation{{#translation:}}| ]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;includeonly&amp;gt;{{#if:{{{content|}}}|&lt;br /&gt;
[[Category:Template documentation pages{{#translation:}}]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Arguments&amp;diff=439</id>
		<title>Module:Arguments</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Arguments&amp;diff=439"/>
		<updated>2025-05-15T16:37:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module provides easy processing of arguments passed to Scribunto from&lt;br /&gt;
-- #invoke. It is intended for use by other Lua modules, and should not be&lt;br /&gt;
-- called from #invoke directly.&lt;br /&gt;
&lt;br /&gt;
local libraryUtil = require(&#039;libraryUtil&#039;)&lt;br /&gt;
local checkType = libraryUtil.checkType&lt;br /&gt;
&lt;br /&gt;
local arguments = {}&lt;br /&gt;
&lt;br /&gt;
-- Generate four different tidyVal functions, so that we don&#039;t have to check the&lt;br /&gt;
-- options every time we call it.&lt;br /&gt;
&lt;br /&gt;
local function tidyValDefault(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		val = val:match(&#039;^%s*(.-)%s*$&#039;)&lt;br /&gt;
		if val == &#039;&#039; then&lt;br /&gt;
			return nil&lt;br /&gt;
		else&lt;br /&gt;
			return val&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValTrimOnly(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		return val:match(&#039;^%s*(.-)%s*$&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValRemoveBlanksOnly(key, val)&lt;br /&gt;
	if type(val) == &#039;string&#039; then&lt;br /&gt;
		if val:find(&#039;%S&#039;) then&lt;br /&gt;
			return val&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return val&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function tidyValNoChange(key, val)&lt;br /&gt;
	return val&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function matchesTitle(given, title)&lt;br /&gt;
	local tp = type( given )&lt;br /&gt;
	return (tp == &#039;string&#039; or tp == &#039;number&#039;) and mw.title.new( given ).prefixedText == title&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local translate_mt = { __index = function(t, k) return k end }&lt;br /&gt;
&lt;br /&gt;
function arguments.getArgs(frame, options)&lt;br /&gt;
	checkType(&#039;getArgs&#039;, 1, frame, &#039;table&#039;, true)&lt;br /&gt;
	checkType(&#039;getArgs&#039;, 2, options, &#039;table&#039;, true)&lt;br /&gt;
	frame = frame or {}&lt;br /&gt;
	options = options or {}&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Set up argument translation.&lt;br /&gt;
	--]]&lt;br /&gt;
	options.translate = options.translate or {}&lt;br /&gt;
	if getmetatable(options.translate) == nil then&lt;br /&gt;
		setmetatable(options.translate, translate_mt)&lt;br /&gt;
	end&lt;br /&gt;
	if options.backtranslate == nil then&lt;br /&gt;
		options.backtranslate = {}&lt;br /&gt;
		for k,v in pairs(options.translate) do&lt;br /&gt;
			options.backtranslate[v] = k&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if options.backtranslate and getmetatable(options.backtranslate) == nil then&lt;br /&gt;
		setmetatable(options.backtranslate, {&lt;br /&gt;
			__index = function(t, k)&lt;br /&gt;
				if options.translate[k] ~= k then&lt;br /&gt;
					return nil&lt;br /&gt;
				else&lt;br /&gt;
					return k&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Get the argument tables. If we were passed a valid frame object, get the&lt;br /&gt;
	-- frame arguments (fargs) and the parent frame arguments (pargs), depending&lt;br /&gt;
	-- on the options set and on the parent frame&#039;s availability. If we weren&#039;t&lt;br /&gt;
	-- passed a valid frame object, we are being called from another Lua module&lt;br /&gt;
	-- or from the debug console, so assume that we were passed a table of args&lt;br /&gt;
	-- directly, and assign it to a new variable (luaArgs).&lt;br /&gt;
	--]]&lt;br /&gt;
	local fargs, pargs, luaArgs&lt;br /&gt;
	if type(frame.args) == &#039;table&#039; and type(frame.getParent) == &#039;function&#039; then&lt;br /&gt;
		if options.wrappers then&lt;br /&gt;
			--[[&lt;br /&gt;
			-- The wrappers option makes Module:Arguments look up arguments in&lt;br /&gt;
			-- either the frame argument table or the parent argument table, but&lt;br /&gt;
			-- not both. This means that users can use either the #invoke syntax&lt;br /&gt;
			-- or a wrapper template without the loss of performance associated&lt;br /&gt;
			-- with looking arguments up in both the frame and the parent frame.&lt;br /&gt;
			-- Module:Arguments will look up arguments in the parent frame&lt;br /&gt;
			-- if it finds the parent frame&#039;s title in options.wrapper;&lt;br /&gt;
			-- otherwise it will look up arguments in the frame object passed&lt;br /&gt;
			-- to getArgs.&lt;br /&gt;
			--]]&lt;br /&gt;
			local parent = frame:getParent()&lt;br /&gt;
			if not parent then&lt;br /&gt;
				fargs = frame.args&lt;br /&gt;
			else&lt;br /&gt;
				local title = parent:getTitle():gsub(&#039;/sandbox$&#039;, &#039;&#039;)&lt;br /&gt;
				local found = false&lt;br /&gt;
				if matchesTitle(options.wrappers, title) then&lt;br /&gt;
					found = true&lt;br /&gt;
				elseif type(options.wrappers) == &#039;table&#039; then&lt;br /&gt;
					for _,v in pairs(options.wrappers) do&lt;br /&gt;
						if matchesTitle(v, title) then&lt;br /&gt;
							found = true&lt;br /&gt;
							break&lt;br /&gt;
						end&lt;br /&gt;
					end&lt;br /&gt;
				end&lt;br /&gt;
&lt;br /&gt;
				-- We test for false specifically here so that nil (the default) acts like true.&lt;br /&gt;
				if found or options.frameOnly == false then&lt;br /&gt;
					pargs = parent.args&lt;br /&gt;
				end&lt;br /&gt;
				if not found or options.parentOnly == false then&lt;br /&gt;
					fargs = frame.args&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			-- options.wrapper isn&#039;t set, so check the other options.&lt;br /&gt;
			if not options.parentOnly then&lt;br /&gt;
				fargs = frame.args&lt;br /&gt;
			end&lt;br /&gt;
			if not options.frameOnly then&lt;br /&gt;
				local parent = frame:getParent()&lt;br /&gt;
				pargs = parent and parent.args or nil&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if options.parentFirst then&lt;br /&gt;
			fargs, pargs = pargs, fargs&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		luaArgs = frame&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set the order of precedence of the argument tables. If the variables are&lt;br /&gt;
	-- nil, nothing will be added to the table, which is how we avoid clashes&lt;br /&gt;
	-- between the frame/parent args and the Lua args.&lt;br /&gt;
	local argTables = {fargs}&lt;br /&gt;
	argTables[#argTables + 1] = pargs&lt;br /&gt;
	argTables[#argTables + 1] = luaArgs&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generate the tidyVal function. If it has been specified by the user, we&lt;br /&gt;
	-- use that; if not, we choose one of four functions depending on the&lt;br /&gt;
	-- options chosen. This is so that we don&#039;t have to call the options table&lt;br /&gt;
	-- every time the function is called.&lt;br /&gt;
	--]]&lt;br /&gt;
	local tidyVal = options.valueFunc&lt;br /&gt;
	if tidyVal then&lt;br /&gt;
		if type(tidyVal) ~= &#039;function&#039; then&lt;br /&gt;
			error(&lt;br /&gt;
				&amp;quot;bad value assigned to option &#039;valueFunc&#039;&amp;quot;&lt;br /&gt;
					.. &#039;(function expected, got &#039;&lt;br /&gt;
					.. type(tidyVal)&lt;br /&gt;
					.. &#039;)&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		end&lt;br /&gt;
	elseif options.trim ~= false then&lt;br /&gt;
		if options.removeBlanks ~= false then&lt;br /&gt;
			tidyVal = tidyValDefault&lt;br /&gt;
		else&lt;br /&gt;
			tidyVal = tidyValTrimOnly&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if options.removeBlanks ~= false then&lt;br /&gt;
			tidyVal = tidyValRemoveBlanksOnly&lt;br /&gt;
		else&lt;br /&gt;
			tidyVal = tidyValNoChange&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Set up the args, metaArgs and nilArgs tables. args will be the one&lt;br /&gt;
	-- accessed from functions, and metaArgs will hold the actual arguments. Nil&lt;br /&gt;
	-- arguments are memoized in nilArgs, and the metatable connects all of them&lt;br /&gt;
	-- together.&lt;br /&gt;
	--]]&lt;br /&gt;
	local args, metaArgs, nilArgs, metatable = {}, {}, {}, {}&lt;br /&gt;
	setmetatable(args, metatable)&lt;br /&gt;
&lt;br /&gt;
	local function mergeArgs(tables)&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Accepts multiple tables as input and merges their keys and values&lt;br /&gt;
		-- into one table. If a value is already present it is not overwritten;&lt;br /&gt;
		-- tables listed earlier have precedence. We are also memoizing nil&lt;br /&gt;
		-- values, which can be overwritten if they are &#039;s&#039; (soft).&lt;br /&gt;
		--]]&lt;br /&gt;
		for _, t in ipairs(tables) do&lt;br /&gt;
			for key, val in pairs(t) do&lt;br /&gt;
				if metaArgs[key] == nil and nilArgs[key] ~= &#039;h&#039; then&lt;br /&gt;
					local tidiedVal = tidyVal(key, val)&lt;br /&gt;
					if tidiedVal == nil then&lt;br /&gt;
						nilArgs[key] = &#039;s&#039;&lt;br /&gt;
					else&lt;br /&gt;
						metaArgs[key] = tidiedVal&lt;br /&gt;
					end&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;
	-- Define metatable behaviour. Arguments are memoized in the metaArgs table,&lt;br /&gt;
	-- and are only fetched from the argument tables once. Fetching arguments&lt;br /&gt;
	-- from the argument tables is the most resource-intensive step in this&lt;br /&gt;
	-- module, so we try and avoid it where possible. For this reason, nil&lt;br /&gt;
	-- arguments are also memoized, in the nilArgs table. Also, we keep a record&lt;br /&gt;
	-- in the metatable of when pairs and ipairs have been called, so we do not&lt;br /&gt;
	-- run pairs and ipairs on the argument tables more than once. We also do&lt;br /&gt;
	-- not run ipairs on fargs and pargs if pairs has already been run, as all&lt;br /&gt;
	-- the arguments will already have been copied over.&lt;br /&gt;
	--]]&lt;br /&gt;
&lt;br /&gt;
	metatable.__index = function (t, key)&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Fetches an argument when the args table is indexed. First we check&lt;br /&gt;
		-- to see if the value is memoized, and if not we try and fetch it from&lt;br /&gt;
		-- the argument tables. When we check memoization, we need to check&lt;br /&gt;
		-- metaArgs before nilArgs, as both can be non-nil at the same time.&lt;br /&gt;
		-- If the argument is not present in metaArgs, we also check whether&lt;br /&gt;
		-- pairs has been run yet. If pairs has already been run, we return nil.&lt;br /&gt;
		-- This is because all the arguments will have already been copied into&lt;br /&gt;
		-- metaArgs by the mergeArgs function, meaning that any other arguments&lt;br /&gt;
		-- must be nil.&lt;br /&gt;
		--]]&lt;br /&gt;
		if type(key) == &#039;string&#039; then&lt;br /&gt;
			key = options.translate[key]&lt;br /&gt;
		end&lt;br /&gt;
		local val = metaArgs[key]&lt;br /&gt;
		if val ~= nil then&lt;br /&gt;
			return val&lt;br /&gt;
		elseif metatable.donePairs or nilArgs[key] then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		for _, argTable in ipairs(argTables) do&lt;br /&gt;
			local argTableVal = tidyVal(key, argTable[key])&lt;br /&gt;
			if argTableVal ~= nil then&lt;br /&gt;
				metaArgs[key] = argTableVal&lt;br /&gt;
				return argTableVal&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		nilArgs[key] = &#039;h&#039;&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__newindex = function (t, key, val)&lt;br /&gt;
		-- This function is called when a module tries to add a new value to the&lt;br /&gt;
		-- args table, or tries to change an existing value.&lt;br /&gt;
		if type(key) == &#039;string&#039; then&lt;br /&gt;
			key = options.translate[key]&lt;br /&gt;
		end&lt;br /&gt;
		if options.readOnly then&lt;br /&gt;
			error(&lt;br /&gt;
				&#039;could not write to argument table key &amp;quot;&#039;&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. &#039;&amp;quot;; the table is read-only&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		elseif options.noOverwrite and args[key] ~= nil then&lt;br /&gt;
			error(&lt;br /&gt;
				&#039;could not write to argument table key &amp;quot;&#039;&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. &#039;&amp;quot;; overwriting existing arguments is not permitted&#039;,&lt;br /&gt;
				2&lt;br /&gt;
			)&lt;br /&gt;
		elseif val == nil then&lt;br /&gt;
			--[[&lt;br /&gt;
			-- If the argument is to be overwritten with nil, we need to erase&lt;br /&gt;
			-- the value in metaArgs, so that __index, __pairs and __ipairs do&lt;br /&gt;
			-- not use a previous existing value, if present; and we also need&lt;br /&gt;
			-- to memoize the nil in nilArgs, so that the value isn&#039;t looked&lt;br /&gt;
			-- up in the argument tables if it is accessed again.&lt;br /&gt;
			--]]&lt;br /&gt;
			metaArgs[key] = nil&lt;br /&gt;
			nilArgs[key] = &#039;h&#039;&lt;br /&gt;
		else&lt;br /&gt;
			metaArgs[key] = val&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function translatenext(invariant)&lt;br /&gt;
		local k, v = next(invariant.t, invariant.k)&lt;br /&gt;
		invariant.k = k&lt;br /&gt;
		if k == nil then&lt;br /&gt;
			return nil&lt;br /&gt;
		elseif type(k) ~= &#039;string&#039; or not options.backtranslate then&lt;br /&gt;
			return k, v&lt;br /&gt;
		else&lt;br /&gt;
			local backtranslate = options.backtranslate[k]&lt;br /&gt;
			if backtranslate == nil then&lt;br /&gt;
				-- Skip this one. This is a tail call, so this won&#039;t cause stack overflow&lt;br /&gt;
				return translatenext(invariant)&lt;br /&gt;
			else&lt;br /&gt;
				return backtranslate, v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__pairs = function ()&lt;br /&gt;
		-- Called when pairs is run on the args table.&lt;br /&gt;
		if not metatable.donePairs then&lt;br /&gt;
			mergeArgs(argTables)&lt;br /&gt;
			metatable.donePairs = true&lt;br /&gt;
		end&lt;br /&gt;
		return translatenext, { t = metaArgs }&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function inext(t, i)&lt;br /&gt;
		-- This uses our __index metamethod&lt;br /&gt;
		local v = t[i + 1]&lt;br /&gt;
		if v ~= nil then&lt;br /&gt;
			return i + 1, v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	metatable.__ipairs = function (t)&lt;br /&gt;
		-- Called when ipairs is run on the args table.&lt;br /&gt;
		return inext, t, 0&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return args&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return arguments&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Yesno&amp;diff=437</id>
		<title>Module:Yesno</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Yesno&amp;diff=437"/>
		<updated>2025-05-15T16:37:12Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 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) == &#039;string&#039; 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 == &#039;yes&#039;&lt;br /&gt;
		or val == &#039;y&#039;&lt;br /&gt;
		or val == &#039;true&#039;&lt;br /&gt;
		or val == &#039;t&#039;&lt;br /&gt;
		or val == &#039;on&#039;&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 == &#039;no&#039;&lt;br /&gt;
		or val == &#039;n&#039;&lt;br /&gt;
		or val == &#039;false&#039;&lt;br /&gt;
		or val == &#039;f&#039;&lt;br /&gt;
		or val == &#039;off&#039;&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Message_box&amp;diff=435</id>
		<title>Module:Message box</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Message_box&amp;diff=435"/>
		<updated>2025-05-15T16:37:12Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 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(&#039;strict&#039;)&lt;br /&gt;
local getArgs&lt;br /&gt;
local yesno = require(&#039;Module:Yesno&#039;)&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 = &#039;Module:Message box/configuration&#039;&lt;br /&gt;
local DEMOSPACES = {talk = &#039;tmbox&#039;, image = &#039;imbox&#039;, file = &#039;imbox&#039;, category = &#039;cmbox&#039;, article = &#039;ambox&#039;, main = &#039;ambox&#039;}&lt;br /&gt;
local TEMPLATE_STYLES = &#039;Module:Message box/%s.css&#039;&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), &#039;^&#039; .. prefix .. &#039;([1-9]%d*)$&#039;)&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;
	obj.boxType = boxType&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 ~= &#039;&#039; 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;
				obj.boxType = DEMOSPACES[demospace]&lt;br /&gt;
			elseif string.find( demospace, &#039;talk&#039; ) then&lt;br /&gt;
				-- demo as a talk page&lt;br /&gt;
				obj.cfg = cfg.tmbox&lt;br /&gt;
				obj.boxType = &#039;tmbox&#039;&lt;br /&gt;
			else&lt;br /&gt;
				-- default to ombox&lt;br /&gt;
				obj.cfg = cfg.ombox&lt;br /&gt;
				obj.boxType = &#039;ombox&#039;&lt;br /&gt;
			end&lt;br /&gt;
		elseif ns == 0 then&lt;br /&gt;
			obj.cfg = cfg.ambox -- main namespace&lt;br /&gt;
			obj.boxType = &#039;ambox&#039;&lt;br /&gt;
		elseif ns == 6 then&lt;br /&gt;
			obj.cfg = cfg.imbox -- file namespace&lt;br /&gt;
			obj.boxType = &#039;imbox&#039;&lt;br /&gt;
		elseif ns == 14 then&lt;br /&gt;
			obj.cfg = cfg.cmbox -- category namespace&lt;br /&gt;
			obj.boxType = &#039;cmbox&#039;&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;
				obj.boxType = &#039;tmbox&#039;&lt;br /&gt;
			else&lt;br /&gt;
				obj.cfg = cfg.ombox -- other namespaces or invalid input&lt;br /&gt;
				obj.boxType = &#039;ombox&#039;&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 ~= &#039;&#039; 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(&#039;[[Category:%s|%s]]&#039;, cat, sort)&lt;br /&gt;
	else&lt;br /&gt;
		cat = string.format(&#039;[[Category:%s]]&#039;, 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;
	self.classes[class] = 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function MessageBox:removeClass(class)&lt;br /&gt;
	if not class then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	self.classes[class] = nil&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 == &#039;SUBST&#039;&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;
	for _, class in ipairs(cfg.classes or {}) do&lt;br /&gt;
		self:addClass(class)&lt;br /&gt;
	end&lt;br /&gt;
	if self.name then&lt;br /&gt;
		self:addClass(&#039;box-&#039; .. string.gsub(self.name,&#039; &#039;,&#039;_&#039;))&lt;br /&gt;
	end&lt;br /&gt;
	local plainlinks = yesno(args.plainlinks)&lt;br /&gt;
	if plainlinks == true then&lt;br /&gt;
		self:addClass(&#039;plainlinks&#039;)&lt;br /&gt;
	elseif plainlinks == false then&lt;br /&gt;
		self:removeClass(&#039;plainlinks&#039;)&lt;br /&gt;
	end&lt;br /&gt;
	if self.isSmall then&lt;br /&gt;
		self:addClass(cfg.smallClass or &#039;mbox-small&#039;)&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;
				&#039;^[tT][eE][mM][pP][lL][aA][tT][eE][%s_]*:[%s_]*(.*)$&#039;&lt;br /&gt;
			) or self.name&lt;br /&gt;
			templateName = &#039;Template:&#039; .. 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 == &#039;&#039; then&lt;br /&gt;
				sect = &#039;This &#039; .. (cfg.sectionDefault or &#039;page&#039;)&lt;br /&gt;
			elseif type(args.sect) == &#039;string&#039; then&lt;br /&gt;
				sect = &#039;This &#039; .. args.sect&lt;br /&gt;
			end&lt;br /&gt;
			local issue = args.issue&lt;br /&gt;
			issue = type(issue) == &#039;string&#039; and issue ~= &#039;&#039; and issue or nil&lt;br /&gt;
			local text = args.text&lt;br /&gt;
			text = type(text) == &#039;string&#039; 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, &#039; &#039;)&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 == &#039;&#039;&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 = &#039;#&#039;&lt;br /&gt;
		elseif talk == &#039;&#039; 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&#039;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 = &#039;Relevant discussion may be found on&#039;&lt;br /&gt;
				if talkArgIsTalkPage then&lt;br /&gt;
					talkText = string.format(&lt;br /&gt;
						&#039;%s [[%s|%s]].&#039;,&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;
						&#039;%s the [[%s#%s|talk page]].&#039;,&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 ~= &#039;&#039; and args.fix or nil&lt;br /&gt;
		local date&lt;br /&gt;
		if args.date and args.date ~= &#039;&#039; then&lt;br /&gt;
			date = args.date&lt;br /&gt;
		elseif args.date == &#039;&#039; and self.isTemplatePage then&lt;br /&gt;
			date = lang:formatDate(&#039;F Y&#039;)&lt;br /&gt;
		end&lt;br /&gt;
		if date then&lt;br /&gt;
			self.date = string.format(&amp;quot; &amp;lt;small class=&#039;date-container&#039;&amp;gt;&#039;&#039;(&amp;lt;span class=&#039;date&#039;&amp;gt;%s&amp;lt;/span&amp;gt;)&#039;&#039;&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 = &#039;border:none;padding:0px;width:1px&#039;&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 ~= &#039;blank&#039; and imageLeft ~= &#039;none&#039;&lt;br /&gt;
		or not cfg.imageCheckBlank and imageLeft ~= &#039;none&#039;&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 &#039;30x30px&#039;)&lt;br /&gt;
				or &#039;40x40px&#039;&lt;br /&gt;
			self.imageLeft = string.format(&#039;[[File:%s|%s|link=|alt=]]&#039;, self.typeImage&lt;br /&gt;
				or &#039;Information icon4.svg&#039;, 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 == &#039;none&#039;) 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{&#039;cat&#039;, &#039;category&#039;, &#039;all&#039;} do&lt;br /&gt;
		args[prefix .. &#039;1&#039;] = 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) == &#039;string&#039; and date&lt;br /&gt;
	local preposition = &#039;from&#039;&lt;br /&gt;
	for _, num in ipairs(nums) do&lt;br /&gt;
		local mainCat = args[&#039;cat&#039; .. tostring(num)]&lt;br /&gt;
			or args[&#039;category&#039; .. tostring(num)]&lt;br /&gt;
		local allCat = args[&#039;all&#039; .. tostring(num)]&lt;br /&gt;
		mainCat = type(mainCat) == &#039;string&#039; and mainCat&lt;br /&gt;
		allCat = type(allCat) == &#039;string&#039; and allCat&lt;br /&gt;
		if mainCat and date and date ~= &#039;&#039; then&lt;br /&gt;
			local catTitle = string.format(&#039;%s %s %s&#039;, mainCat, preposition, date)&lt;br /&gt;
			self:addCat(0, catTitle)&lt;br /&gt;
			catTitle = getTitleObject(&#039;Category:&#039; .. catTitle)&lt;br /&gt;
			if not catTitle or not catTitle.exists then&lt;br /&gt;
				self:addCat(0, &#039;Articles with invalid date parameter in template&#039;)&lt;br /&gt;
			end&lt;br /&gt;
		elseif mainCat and (not date or date == &#039;&#039;) 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 = &#039;C&#039;&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.isSubstituted then&lt;br /&gt;
		self:addCat(&#039;all&#039;, &#039;Pages with incorrectly substituted templates&#039;)&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(&#039;Module:Category handler&#039;)._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(&#039;b&#039;)&lt;br /&gt;
			:addClass(&#039;error&#039;)&lt;br /&gt;
			:wikitext(string.format(&lt;br /&gt;
				&#039;Template &amp;lt;code&amp;gt;%s[[Template:%s|%s]]%s&amp;lt;/code&amp;gt; has been incorrectly substituted.&#039;,&lt;br /&gt;
				mw.text.nowiki(&#039;{{&#039;), self.name, self.name, mw.text.nowiki(&#039;}}&#039;)&lt;br /&gt;
			))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Add TemplateStyles&lt;br /&gt;
	root:wikitext(mw.getCurrentFrame():extensionTag{&lt;br /&gt;
		name = &#039;templatestyles&#039;,&lt;br /&gt;
		args = { src = TEMPLATE_STYLES:format(self.boxType) },&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	-- Create the box table.&lt;br /&gt;
	local boxTable&lt;br /&gt;
	-- Check for fmbox because not all interface messages have mw-parser-output&lt;br /&gt;
	-- which is necessary for TemplateStyles. Add the wrapper class if it is and&lt;br /&gt;
	-- then start the actual mbox, else start the mbox.&lt;br /&gt;
	if self.boxType == &#039;fmbox&#039; then&lt;br /&gt;
		boxTable = root:tag(&#039;div&#039;)&lt;br /&gt;
			:addClass(&#039;mw-parser-output&#039;)&lt;br /&gt;
			:tag(&#039;table&#039;)&lt;br /&gt;
	else&lt;br /&gt;
		boxTable = root:tag(&#039;table&#039;)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	boxTable:attr(&#039;id&#039;, self.id or nil)&lt;br /&gt;
	for class, _ in pairs(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(&#039;role&#039;, &#039;presentation&#039;)&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(&#039;tr&#039;)&lt;br /&gt;
	if self.imageLeft then&lt;br /&gt;
		local imageLeftCell = row:tag(&#039;td&#039;):addClass(&#039;mbox-image&#039;)&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(&#039;div&#039;):css(&#039;width&#039;, &#039;52px&#039;)&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&#039;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(&#039;td&#039;)&lt;br /&gt;
			:addClass(&#039;mbox-empty-cell&#039;)&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(&#039;td&#039;):addClass(&#039;mbox-text&#039;)&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(&#039;div&#039;)&lt;br /&gt;
		textCellDiv&lt;br /&gt;
			:addClass(&#039;mbox-text-span&#039;)&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(&#039;span&#039;)&lt;br /&gt;
				:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
				:wikitext(self.talk and (&#039; &#039; .. self.talk) or nil)&lt;br /&gt;
				:wikitext(self.fix and (&#039; &#039; .. self.fix) or nil)&lt;br /&gt;
		end&lt;br /&gt;
		textCellDiv:wikitext(self.date and (&#039; &#039; .. self.date) or nil)&lt;br /&gt;
		if self.info and not self.isSmall then&lt;br /&gt;
			textCellDiv&lt;br /&gt;
				:tag(&#039;span&#039;)&lt;br /&gt;
				:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
				:wikitext(self.info and (&#039; &#039; .. self.info) or nil)&lt;br /&gt;
		end&lt;br /&gt;
		if self.removalNotice then&lt;br /&gt;
			textCellDiv:tag(&#039;small&#039;)&lt;br /&gt;
				:addClass(&#039;hide-when-compact&#039;)&lt;br /&gt;
				:tag(&#039;i&#039;)&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(&#039;td&#039;):addClass(&#039;mbox-imageright&#039;)&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(&#039;div&#039;):css(&#039;width&#039;, &#039;52px&#039;)&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(&#039;tr&#039;)&lt;br /&gt;
			:tag(&#039;td&#039;)&lt;br /&gt;
				:attr(&#039;colspan&#039;, self.imageRight and &#039;3&#039; or &#039;2&#039;)&lt;br /&gt;
				:addClass(&#039;mbox-text&#039;)&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(&#039;div&#039;)&lt;br /&gt;
			:css(&#039;text-align&#039;, &#039;center&#039;)&lt;br /&gt;
			:wikitext(string.format(&lt;br /&gt;
				&#039;This message box is using an invalid &amp;quot;type=%s&amp;quot; parameter and needs fixing.&#039;,&lt;br /&gt;
				self.type or &#039;&#039;&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(&#039;Module:Arguments&#039;).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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Module:Template_translation&amp;diff=433</id>
		<title>Module:Template translation</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Module:Template_translation&amp;diff=433"/>
		<updated>2025-05-15T16:37:11Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local this = {}&lt;br /&gt;
&lt;br /&gt;
function this.checkLanguage(subpage, default)&lt;br /&gt;
    --[[Check first if there&#039;s an any invalid character that would cause the&lt;br /&gt;
        mw.language.isKnownLanguageTag function() to throw an exception:&lt;br /&gt;
        - all ASCII controls in [\000-\031\127],&lt;br /&gt;
        - double quote (&amp;quot;), sharp sign (#), ampersand (&amp;amp;), apostrophe (&#039;),&lt;br /&gt;
        - slash (/), colon (:), semicolon (;), lower than (&amp;lt;), greater than (&amp;gt;),&lt;br /&gt;
        - brackets and braces ([, ], {, }), pipe (|), backslash (\\)&lt;br /&gt;
        All other characters are accepted, including space and all non-ASCII&lt;br /&gt;
        characters (including \192, which is invalid in UTF-8).&lt;br /&gt;
    --]]&lt;br /&gt;
    if mw.language.isValidCode(subpage) and mw.language.isKnownLanguageTag(subpage)&lt;br /&gt;
    --[[However &amp;quot;SupportedLanguages&amp;quot; are too restrictive, as they discard many&lt;br /&gt;
        valid BCP47 script variants (only because MediaWiki still does not&lt;br /&gt;
        define automatic transliterators for them, e.g. &amp;quot;en-dsrt&amp;quot; or&lt;br /&gt;
        &amp;quot;fr-brai&amp;quot; for French transliteration in Braille), and country variants,&lt;br /&gt;
        (useful in localized data, even if they are no longer used for&lt;br /&gt;
        translations, such as zh-cn, also useful for legacy codes).&lt;br /&gt;
        We want to avoid matching subpagenames containing any uppercase letter,&lt;br /&gt;
        (even if they are considered valid in BCP 47, in which they are&lt;br /&gt;
        case-insensitive; they are not &amp;quot;SupportedLanguages&amp;quot; for MediaWiki, so&lt;br /&gt;
        they are not &amp;quot;KnownLanguageTags&amp;quot; for MediaWiki).&lt;br /&gt;
        To be more restrictive, we exclude tags&lt;br /&gt;
        * for specific uses in template subpages and unusable as language tags;&lt;br /&gt;
        * that is not ASCII and not a lowercase letter, minus-hyphen, or digit,&lt;br /&gt;
          or does not start by a letter or does not finish by a letter or digit;&lt;br /&gt;
        * or that has subtags with more than 8 characters between hyphens;&lt;br /&gt;
        * or that has two hyphens.&lt;br /&gt;
    --]]&lt;br /&gt;
    or  subpage ~= &amp;quot;doc&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;layout&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;button&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;buttons&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;sandbox&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;testcase&amp;quot;&lt;br /&gt;
    and subpage ~= &amp;quot;testcases&amp;quot;&lt;br /&gt;
    and string.find(subpage, &amp;quot;^[%l][%-%d%l]*[%d%l]$&amp;quot;) ~= nil&lt;br /&gt;
    and string.find(subpage, &amp;quot;[%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l][%d%l]&amp;quot;) == nil&lt;br /&gt;
    and string.find(subpage, &amp;quot;%-%-&amp;quot;) == nil then&lt;br /&gt;
        return subpage&lt;br /&gt;
    end&lt;br /&gt;
    -- Otherwise there&#039;s currently no known language subpage&lt;br /&gt;
    return default&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the last subpage of an arbitrary page if it is a translation.&lt;br /&gt;
    To be used from templates.&lt;br /&gt;
    ]]&lt;br /&gt;
function this.getLanguageSubpage(frame)&lt;br /&gt;
	local title = frame and frame.args[1]&lt;br /&gt;
	if not title or title == &#039;&#039; then&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	return this._getLanguageSubpage(title)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the last subpage of an arbitrary page if it is a translation.&lt;br /&gt;
    To be used from Lua.&lt;br /&gt;
    ]]&lt;br /&gt;
function this._getLanguageSubpage(title)&lt;br /&gt;
	if type(title) == &#039;string&#039; then&lt;br /&gt;
		title = mw.title.new(title)&lt;br /&gt;
	end&lt;br /&gt;
	if not title then&lt;br /&gt;
		-- invalid title&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	--[[This code does not work in all namespaces where the Translate tool works.&lt;br /&gt;
	--  It works in the main namespace on Meta because it allows subpages there&lt;br /&gt;
	--  It would not work in the main namespace of English Wikipedia (but the&lt;br /&gt;
	--  articles are monolignual on that wiki).&lt;br /&gt;
	--  On Meta-Wiki the main space uses subpages and its pages are translated.&lt;br /&gt;
	--  The Translate tool allows translatng pages in all namespaces, even if&lt;br /&gt;
	--  the namespace officially does not have subpages.&lt;br /&gt;
	--  On Meta-Wiki the Category namespace still does not have subpages enabled,&lt;br /&gt;
	--  even if they would be very useful for categorizing templates, that DO have&lt;br /&gt;
	--  subpages (for documentatio and tstboxes pages). This is a misconfiguration&lt;br /&gt;
	--  bug of Meta-Wiki. The work-around is to split the full title and then&lt;br /&gt;
	--  get the last titlepart.&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	--]]&lt;br /&gt;
	local titleparts = mw.text.split(title.fullText, &#039;/&#039;)&lt;br /&gt;
	local subpage = titleparts[#titleparts]&lt;br /&gt;
	return this.checkLanguage(subpage, &#039;&#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the last subpage of the current page if it is a translation.&lt;br /&gt;
    ]]&lt;br /&gt;
function this.getCurrentLanguageSubpage()&lt;br /&gt;
	return this._getLanguageSubpage(mw.title.getCurrentTitle())&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the first part of the language code of the subpage, before the &#039;-&#039;.&lt;br /&gt;
--]]&lt;br /&gt;
function this.getMainLanguageSubpage()&lt;br /&gt;
	parts = mw.text.split(this.getCurrentLanguageSubpage(), &#039;-&#039;)&lt;br /&gt;
	return parts[1]&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the last subpage of the current frame if it is a translation.&lt;br /&gt;
    Not used locally.&lt;br /&gt;
--]]&lt;br /&gt;
function this.getFrameLanguageSubpage(frame)&lt;br /&gt;
	return this._getLanguageSubpage(frame:getParent():getTitle())&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the language of the current page. Not used locally.&lt;br /&gt;
--]]&lt;br /&gt;
function this.getLanguage()&lt;br /&gt;
    local subpage = mw.title.getCurrentTitle().subpageText&lt;br /&gt;
    return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[Get the language of the current frame. Not used locally.&lt;br /&gt;
--]]&lt;br /&gt;
function this.getFrameLanguage(frame)&lt;br /&gt;
    local titleparts = mw.text.split(frame:getParent():getTitle(), &#039;/&#039;)&lt;br /&gt;
    local subpage = titleparts[#titleparts]&lt;br /&gt;
    return this.checkLanguage(subpage, mw.language.getContentLanguage():getCode())&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function this.title(namespace, basepagename, subpage)&lt;br /&gt;
    local message, title&lt;br /&gt;
    local pagename = basepagename&lt;br /&gt;
    if (subpage or &#039;&#039;) ~= &#039;&#039; then&lt;br /&gt;
        pagename = pagename .. &#039;/&#039; .. subpage&lt;br /&gt;
    end&lt;br /&gt;
    local valid, title = xpcall(function()&lt;br /&gt;
            return mw.title.new(pagename, namespace) -- costly&lt;br /&gt;
        end, function(msg) -- catch undocumented exception (!?)&lt;br /&gt;
            -- thrown when namespace does not exist. The doc still&lt;br /&gt;
            -- says it should return a title, even in that case...&lt;br /&gt;
            message = msg&lt;br /&gt;
        end)&lt;br /&gt;
    if valid and title ~= nil and (title.id or 0) ~= 0 then&lt;br /&gt;
        return title&lt;br /&gt;
    end&lt;br /&gt;
    return { -- &amp;quot;pseudo&amp;quot; mw.title object with id = nil in case of error&lt;br /&gt;
        prefixedText = pagename, -- the only property we need below&lt;br /&gt;
        message = message -- only for debugging&lt;br /&gt;
    }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[If on a translation subpage (like Foobar/de), this function returns&lt;br /&gt;
    a given template in the same language, if the translation is available.&lt;br /&gt;
    Otherwise, the template is returned in its default language, without&lt;br /&gt;
    modification.&lt;br /&gt;
    This is aimed at replacing the current implementation of Template:TNTN.&lt;br /&gt;
&lt;br /&gt;
    This version does not expand the returned template name: this solves the&lt;br /&gt;
    problem of self-recursion in TNT when translatable templates need themselves&lt;br /&gt;
    to transclude other translable templates (such as Tnavbar).&lt;br /&gt;
--]]&lt;br /&gt;
function this.getTranslatedTemplate(frame, withStatus)&lt;br /&gt;
    local args = frame.args&lt;br /&gt;
    local pagename = args[&#039;template&#039;]&lt;br /&gt;
    --[[Check whether the pagename is actually in the Template namespace, or&lt;br /&gt;
        if we&#039;re transcluding a main-namespace page.&lt;br /&gt;
        (added for backward compatibility of Template:TNT)&lt;br /&gt;
        ]]&lt;br /&gt;
    local namespace, title = args[&#039;tntns&#039;] or &#039;&#039;&lt;br /&gt;
    if namespace ~= &#039;&#039; then -- Checks for tntns parameter for custom ns.&lt;br /&gt;
        title = this.title(namespace, pagename) -- Costly&lt;br /&gt;
    else -- Supposes that set page is in ns10.&lt;br /&gt;
    	namespace = &#039;Template&#039;&lt;br /&gt;
        title = this.title(namespace, pagename) -- Costly&lt;br /&gt;
        if title.id == nil then -- not found in the Template namespace, assume the main namespace (for backward compatibility)&lt;br /&gt;
    	    namespace = &#039;&#039;&lt;br /&gt;
            title = this.title(namespace, pagename) -- Costly&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    -- Get the last subpage and check if it matches a known language code.&lt;br /&gt;
    local subpage = args[&#039;uselang&#039;] or &#039;&#039;&lt;br /&gt;
    if subpage == &#039;&#039; then&lt;br /&gt;
        subpage = this.getCurrentLanguageSubpage()&lt;br /&gt;
    end&lt;br /&gt;
    if subpage == &#039;&#039; then&lt;br /&gt;
        -- Check if a translation of the pagename exists in English&lt;br /&gt;
        local newtitle = this.title(namespace, pagename, &#039;en&#039;) -- Costly&lt;br /&gt;
        -- Use the translation when it exists&lt;br /&gt;
        if newtitle.id ~= nil then&lt;br /&gt;
            title = newtitle&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        -- Check if a translation of the pagename exists in that language&lt;br /&gt;
        local newtitle = this.title(namespace, pagename, subpage) -- Costly&lt;br /&gt;
        if newtitle.id == nil then&lt;br /&gt;
            -- Check if a translation of the pagename exists in English&lt;br /&gt;
            newtitle = this.title(namespace, pagename, &#039;en&#039;) -- Costly&lt;br /&gt;
        end&lt;br /&gt;
        -- Use the translation when it exists&lt;br /&gt;
        if newtitle.id ~= nil then&lt;br /&gt;
            title = newtitle&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    -- At this point the title should exist&lt;br /&gt;
    if withStatus then&lt;br /&gt;
    	-- status returned to Lua function below&lt;br /&gt;
        return title.prefixedText, title.id ~= nil&lt;br /&gt;
    else&lt;br /&gt;
    	-- returned directly to MediaWiki&lt;br /&gt;
        return title.prefixedText&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[If on a translation subpage (like Foobar/de), this function renders&lt;br /&gt;
    a given template in the same language, if the translation is available.&lt;br /&gt;
    Otherwise, the template is rendered in its default language, without&lt;br /&gt;
    modification.&lt;br /&gt;
    This is aimed at replacing the current implementation of Template:TNT.&lt;br /&gt;
    &lt;br /&gt;
    Note that translatable templates cannot transclude themselves other&lt;br /&gt;
    translatable templates, as it will recurse on TNT. Use TNTN instead&lt;br /&gt;
    to return only the effective template name to expand externally, with&lt;br /&gt;
    template parameters also provided externally.&lt;br /&gt;
--]]&lt;br /&gt;
function this.renderTranslatedTemplate(frame)&lt;br /&gt;
	local title, found = this.getTranslatedTemplate(frame, true)&lt;br /&gt;
    -- At this point the title should exist prior to performing the expansion&lt;br /&gt;
    -- of the template, otherwise render a red link to the missing page&lt;br /&gt;
    -- (resolved in its assumed namespace). If we don&#039;t tet this here, a&lt;br /&gt;
    -- script error would be thrown. Returning a red link is consistant with&lt;br /&gt;
    -- MediaWiki behavior when attempting to transclude inexistant templates.&lt;br /&gt;
	if not found then&lt;br /&gt;
		return &#039;[[&#039; .. title .. &#039;]]&#039;&lt;br /&gt;
	end&lt;br /&gt;
    -- Copy args pseudo-table to a proper table so we can feed it to expandTemplate.&lt;br /&gt;
    -- Then render the pagename.&lt;br /&gt;
    local args = frame.args&lt;br /&gt;
    local pargs = (frame:getParent() or {}).args&lt;br /&gt;
    local arguments = {}&lt;br /&gt;
    if (args[&#039;noshift&#039;] or &#039;&#039;) == &#039;&#039; then&lt;br /&gt;
        for k, v in pairs(pargs) do&lt;br /&gt;
            local n = tonumber(k) or 0&lt;br /&gt;
            if n &amp;lt;= 0 then -- unnumbered args&lt;br /&gt;
                arguments[k] = v&lt;br /&gt;
            elseif n &amp;gt;= 2 then -- numbered args &amp;gt;= 2 need to be shifted&lt;br /&gt;
                arguments[n - 1] = v&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else -- special case where TNT is used as autotranslate&lt;br /&gt;
    	-- (don&#039;t shift again what is shifted in the invokation)&lt;br /&gt;
        for k, v in pairs(pargs) do&lt;br /&gt;
            arguments[k] = v&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    arguments[&#039;template&#039;] = title -- override the existing parameter of the base template name supplied with the full name of the actual template expanded&lt;br /&gt;
    arguments[&#039;tntns&#039;] = nil -- discard the specified namespace override&lt;br /&gt;
    arguments[&#039;uselang&#039;] = args[&#039;uselang&#039;] -- argument forwarded into parent frame&lt;br /&gt;
    arguments[&#039;noshift&#039;] = args[&#039;noshift&#039;] -- argument forwarded into parent frame&lt;br /&gt;
    return frame:expandTemplate{title = &#039;:&#039; .. title, args = arguments}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[A helper for mocking TNT in Special:TemplateSandbox. TNT breaks&lt;br /&gt;
    TemplateSandbox; mocking it with this method means templates won&#039;t be&lt;br /&gt;
    localized but at least TemplateSandbox substitutions will work properly.&lt;br /&gt;
    Won&#039;t work with complex uses.&lt;br /&gt;
--]]&lt;br /&gt;
function this.mockTNT(frame)&lt;br /&gt;
    local pargs = (frame:getParent() or {}).args&lt;br /&gt;
    local arguments = {}&lt;br /&gt;
    for k, v in pairs(pargs) do&lt;br /&gt;
        local n = tonumber(k) or 0&lt;br /&gt;
        if n &amp;lt;= 0 then -- unnumbered args&lt;br /&gt;
            arguments[k] = v&lt;br /&gt;
        elseif n &amp;gt;= 2 then -- numbered args &amp;gt;= 2 need to be shifted&lt;br /&gt;
            arguments[n - 1] = v&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    if not pargs[1] then&lt;br /&gt;
    	return &#039;&#039;&lt;br /&gt;
	end&lt;br /&gt;
    return frame:expandTemplate{title = &#039;Template:&#039; .. pargs[1], args = arguments}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return this&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Dir&amp;diff=431</id>
		<title>Template:Dir</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Dir&amp;diff=431"/>
		<updated>2025-05-15T16:35:29Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#ifeq:{{#dir:{{{lang|{{{1|{{int:lang}}}}}}}}}}|rtl|{{{2|{{{rtl|rtl}}}}}}|{{{3|{{{ltr|ltr}}}}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Localized_link&amp;diff=429</id>
		<title>Template:Localized link</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Localized_link&amp;diff=429"/>
		<updated>2025-05-15T16:35:29Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#ifeq:{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME:{{translatable}}}}&amp;lt;!--self link (including translation pages)--&amp;gt;&lt;br /&gt;
  |&amp;lt;b&amp;gt;&lt;br /&gt;
}}&amp;lt;!----&amp;gt;[[Special:MyLanguage/{{{1}}}|{{#if:{{{2|}}}&lt;br /&gt;
|{{{2}}}&lt;br /&gt;
|{{{2|{{#ifexist:Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page display title/{{PAGELANGUAGE}}&amp;lt;!--if the source page, PAGELANGUAGE returns en--&amp;gt;&lt;br /&gt;
  |{{#ifexpr:{{#if:{{{nsp|}}}|1|0}} and {{NAMESPACENUMBER:{{{1}}}}}!=0&lt;br /&gt;
    |{{#ifeq:{{PAGELANGUAGE}}|en&lt;br /&gt;
      |{{PAGENAME:{{{1}}}}}&lt;br /&gt;
      |&amp;lt;!-- check whether the string is not empty --&amp;gt;&amp;lt;!--&lt;br /&gt;
    --&amp;gt;{{#if:{{PAGENAME:{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} }} }}&lt;br /&gt;
         |{{#ifeq:{{#invoke:string|find|{{PAGENAME:{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} }} }}|:}}|0&lt;br /&gt;
           |{{PAGENAME:{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} }} }}&lt;br /&gt;
           | {{#invoke:string|match|{{PAGENAME:{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} }} }}|:(.*)}}&lt;br /&gt;
         }}&lt;br /&gt;
         |&amp;lt;!-- pass parameter to, e.g., &amp;quot;Template:LC zh&amp;quot;; check whether the string is not empty --&amp;gt;&amp;lt;!--&lt;br /&gt;
       --&amp;gt;{{#if:{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} | nsp = 0 }}&lt;br /&gt;
           |{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} | nsp = 0 }}&lt;br /&gt;
           |{{{1}}}&lt;br /&gt;
        }}&lt;br /&gt;
      }}&lt;br /&gt;
    }}&lt;br /&gt;
    |{{ {{TNTN|Translations:{{#if:{{NAMESPACE:{{{1}}}}}|{{NAMESPACE:{{{1}}}}}:}}{{PAGENAME:{{{1}}}}}/Page_display_title}} }}&lt;br /&gt;
  }}&lt;br /&gt;
  &amp;lt;!--if the translation page does not exist (or called from the source page), output as is--&amp;gt;&lt;br /&gt;
  |{{#if:{{{nsp|}}}&lt;br /&gt;
    |{{#if:{{PAGENAME:{{{1}}}}}&lt;br /&gt;
      |{{PAGENAME:{{{1}}}}}&lt;br /&gt;
      |{{{1}}}&lt;br /&gt;
    }}&lt;br /&gt;
    |{{{1}}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&amp;lt;!--#ifexist--&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}}&amp;lt;!--{{{2|--&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;}}&amp;lt;!--#if:{{{2|}}}--&amp;gt;&amp;lt;!--&lt;br /&gt;
--&amp;gt;]]&amp;lt;!--&lt;br /&gt;
--&amp;gt;{{#ifeq:{{FULLPAGENAME:{{{1}}}}}|{{FULLPAGENAME:{{translatable}}}}&amp;lt;!--self link (including translation pages)--&amp;gt;&lt;br /&gt;
  |&amp;lt;/b&amp;gt;&lt;br /&gt;
}}&amp;lt;span style=&amp;quot;display:none&amp;quot;&amp;gt;[[:{{{1}}}| ]]&amp;lt;/span&amp;gt;&amp;lt;!-- T63547 --&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&lt;br /&gt;
{{tsh|ll|LL}}&lt;br /&gt;
{{High-use|35000}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Purpose == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:8--&amp;gt; This helper template can be used to link to [[&amp;lt;tvar name=1&amp;gt;Special:LanguageStats&amp;lt;/tvar&amp;gt;|translatable pages]] in the user&#039;s language.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;translate&amp;gt;&amp;lt;!--T:9--&amp;gt; It uses the special page prefix &amp;lt;tvar name=1&amp;gt;&amp;lt;code&amp;gt;Special:MyLanguage/&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;, which checks if there is a translated version of a page in the user&#039;s language, and links to it if there is one, and links to a fallback language where available, or the default wiki language version (English in MediaWiki) if there isn&#039;t.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:10--&amp;gt;&lt;br /&gt;
It should be used in translated pages, so that they link to the right page even if there is no translated page in that language.&lt;br /&gt;
&lt;br /&gt;
== Usage == &amp;lt;!--T:2--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{Localized link/doc}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
&amp;lt;!--T:11--&amp;gt;&lt;br /&gt;
If the &amp;quot;&amp;lt;tvar name=1&amp;gt;&amp;lt;code&amp;gt;nsp&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;&amp;quot; parameter is not defined, as link text this displays the full pagename (including the namespace); otherwise — if the &amp;quot;&amp;lt;tvar name=1&amp;gt;&amp;lt;code&amp;gt;nsp&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;&amp;quot; parameter is defined to any value the link text displays the short pagename (without the namespace).&lt;br /&gt;
&lt;br /&gt;
=== Examples of simple usage === &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{(}}{{!}} class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
{{!}}-&lt;br /&gt;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Use&amp;lt;/translate&amp;gt;&lt;br /&gt;
! &amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Becomes&amp;lt;/translate&amp;gt;&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{Tlx|ll|Communication}}&lt;br /&gt;
{{!}} {{ll|Communication}}&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{Tlx|ll|Communication|コミュニケーション}}&lt;br /&gt;
{{!}} {{ll|Communication|コミュニケーション}}&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{Tlx|ll|Project:About}}&lt;br /&gt;
{{!}} {{ll|Project:About}}&lt;br /&gt;
{{!}}-&lt;br /&gt;
{{!}} {{Tlx|ll|Project:About|nsp{{=}}0}}&lt;br /&gt;
{{!}} {{ll|Project:About|nsp=0}}&lt;br /&gt;
{{!}}{{)}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Usage in translatable pages == &amp;lt;!--T:6--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--T:12--&amp;gt;&lt;br /&gt;
On pages prepared for translation with the &amp;lt;tvar name=1&amp;gt;{{ll|Extension:Translate|nsp=0}}&amp;lt;/tvar&amp;gt; extension, this template may be used in three ways.&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:13--&amp;gt; Substitute this template, then embed the wikilink target in a &amp;lt;tvar name=1&amp;gt;{{#tag:syntaxhighlight|{{^(}}tvar name=id{{)^}}...{{^(}}/tvar{{)^}}|lang=html|inline=1}}&amp;lt;/tvar&amp;gt;, separate from the translatable text of the link.&amp;lt;/translate&amp;gt;&lt;br /&gt;
#: &amp;lt;translate&amp;gt;&amp;lt;!--T:22--&amp;gt; For example, instead of &amp;lt;tvar name=1&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ll|Communication|About communication}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;, the translation markup in the translatable page will be &amp;lt;tvar name=2&amp;gt;{{#tag:syntaxhighlight|[[{{^(}}tvar name=1{{)^}}Special:MyLanguage/Communication{{^(}}/tvar{{)^}}|About communication]]|lang=html|inline=1}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:14--&amp;gt; Alternatively, exclude this code from the translatable section.&amp;lt;/translate&amp;gt;&lt;br /&gt;
#: &amp;lt;translate&amp;gt;&amp;lt;!--T:23--&amp;gt; For example, for &amp;lt;tvar name=1&amp;gt;&amp;lt;code&amp;gt;some text &amp;lt;nowiki&amp;gt;{{ll|Communication|About communication}}&amp;lt;/nowiki&amp;gt; some text&amp;lt;/code&amp;gt;&amp;lt;/tvar&amp;gt;, the translation markup in the translatable page will be:&amp;lt;/translate&amp;gt;&lt;br /&gt;
#: {{#tag:syntaxhighlight|{{^(}}translate{{)^}}some text{{^(}}/translate{{)^}} {{((}}ll{{!}}Communication{{!}}2={{^(}}translate{{)^}}About communication{{^(}}/translate{{)^}}{{))}} {{^(}}translate{{)^}}some text{{^(}}/translate{{)^}}|lang=html|inline=1}}&lt;br /&gt;
#: &amp;lt;translate&amp;gt;&amp;lt;!--T:15--&amp;gt; This is useful for bulleted lists of links, e.g. in the &amp;quot;See also:&amp;quot; sections.&amp;lt;/translate&amp;gt;&lt;br /&gt;
# &amp;lt;translate&amp;gt;&amp;lt;!--T:16--&amp;gt; If link text is the same as the name of the target page, all of the code could also be embedded into &amp;lt;tvar name=1&amp;gt;{{tag|tvar|open}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
#: &amp;lt;translate&amp;gt;&amp;lt;!--T:24--&amp;gt; For example, instead of &amp;lt;tvar name=1&amp;gt;{{Tlx|ll|Communication}}&amp;lt;/tvar&amp;gt;, the wikicode in the translatable page will be &amp;lt;tvar name=2&amp;gt;{{#tag:syntaxhighlight|{{^(}}tvar name=1{{)^}}{{((}}ll{{!}}Communication{{))}}{{^(}}/tvar{{)^}}|lang=html|inline=1}}&amp;lt;/tvar&amp;gt;.&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test cases ==&lt;br /&gt;
{{Localized link/testcases}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== See also == &amp;lt;!--T:7--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* [[Template:Localized link/messagedoc]] — &amp;lt;translate&amp;gt;&amp;lt;!--T:17--&amp;gt; should be used for message documentation in translatable pages that use this template.&amp;lt;/translate&amp;gt;&lt;br /&gt;
* {{tl|Translatable template}} - &amp;lt;translate&amp;gt;&amp;lt;!--T:18--&amp;gt; alias &amp;lt;tvar name=1&amp;gt;{{tl|TNT}}&amp;lt;/tvar&amp;gt; or &amp;lt;tvar name=2&amp;gt;{{tl|tnt}}&amp;lt;/tvar&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
* {{tl|Translatable template name}} - &amp;lt;translate&amp;gt;&amp;lt;!--T:19--&amp;gt; alias &amp;lt;tvar name=1&amp;gt;{{tl|TNTN}}&amp;lt;/tvar&amp;gt; or &amp;lt;tvar name=2&amp;gt;{{tl|tntn}}&amp;lt;/tvar&amp;gt;&amp;lt;/translate&amp;gt;&lt;br /&gt;
* {{tl|Page language link}} - &amp;lt;translate&amp;gt;&amp;lt;!--T:20--&amp;gt; alias &amp;lt;tvar name=1&amp;gt;{{tl|pll}}&amp;lt;/tvar&amp;gt;&amp;lt;/translate&amp;gt; - &amp;lt;translate&amp;gt;&amp;lt;!--T:21--&amp;gt; add a link from a translatable page to another translatable page in the same language&amp;lt;/translate&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Internationalization templates{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Ll&amp;diff=427</id>
		<title>Template:Ll</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Ll&amp;diff=427"/>
		<updated>2025-05-15T16:35:27Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Template:Localized link]]&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Pagelang&amp;diff=425</id>
		<title>Template:Pagelang</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Pagelang&amp;diff=425"/>
		<updated>2025-05-15T16:35:26Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#ifeq:{{#invoke:Template translation|getLanguageSubpage|{{{1|}}}}}|en&lt;br /&gt;
|{{#ifeq:{{#titleparts:{{{1|{{PAGENAME}}}}}||-1}}|en&lt;br /&gt;
  |{{#invoke:Template translation|getLanguageSubpage|{{{1|}}}}}&lt;br /&gt;
  }}&lt;br /&gt;
|{{#invoke:Template translation|getLanguageSubpage|{{{1|}}}}}&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>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Translatable&amp;diff=423</id>
		<title>Template:Translatable</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Translatable&amp;diff=423"/>
		<updated>2025-05-15T16:35:26Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;languages /&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;{{#ifeq:{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}|&lt;br /&gt;
|{{{1|{{FULLPAGENAME}}}}}&lt;br /&gt;
|{{#invoke:String|sub|{{{1|{{FULLPAGENAME}}}}}&lt;br /&gt;
  |1&lt;br /&gt;
  |{{#expr:{{#invoke:String|len|{{{1|{{FULLPAGENAME}}}}}}}-{{#invoke:String|len|{{pagelang|{{{1|{{FULLPAGENAME}}}}}}}}}-1}}&lt;br /&gt;
  }}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation|content=&lt;br /&gt;
{{Lua|Module:String}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Examples == &amp;lt;!--T:1--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
* {{tlx|translatable}}&lt;br /&gt;
{{translatable}}&lt;br /&gt;
* {{tlx|translatable|2=&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Page name&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
{{translatable|1=&amp;lt;translate&amp;gt;&amp;lt;!--T:3--&amp;gt; Page name&amp;lt;/translate&amp;gt;}}&lt;br /&gt;
* {{tlx|translatable|2=&amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Page name&amp;lt;/translate&amp;gt;/{{PAGELANGUAGE}} }}&lt;br /&gt;
{{translatable|1=&amp;lt;translate&amp;gt;&amp;lt;!--T:5--&amp;gt; Page name&amp;lt;/translate&amp;gt;/{{PAGELANGUAGE}} }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Internationalization templates{{#translation:}}]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note&amp;diff=421</id>
		<title>Template:Note</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note&amp;diff=421"/>
		<updated>2025-05-15T16:35:26Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
&amp;lt;onlyinclude&amp;gt;{{#if: {{{1|{{{content|{{{text|{{{demo|&amp;lt;noinclude&amp;gt;demo&amp;lt;/noinclude&amp;gt;}}}}}}}}}}}} | &amp;lt;templatestyles src=&amp;quot;Note/styles.css&amp;quot; /&amp;gt;&amp;lt;div role=&amp;quot;note&amp;quot; class=&amp;quot;note note-{{#switch: {{{2|{{{type|}}}}}}&lt;br /&gt;
    |gotcha=error&lt;br /&gt;
    |warning=warn&lt;br /&gt;
    |notice=info&lt;br /&gt;
    |=info&lt;br /&gt;
    |#default={{{2|{{{type|}}}}}}&lt;br /&gt;
    }} {{#ifeq:{{{inline|}}}|1|note-inline}}&amp;quot;&amp;gt;{{{1|{{{content|{{{text}}}}}}}}}&amp;lt;/div&amp;gt;&lt;br /&gt;
  | [[File:OOjs UI icon lightbulb-yellow.svg|18px|alt=&amp;lt;translate&amp;gt;&amp;lt;!--T:1--&amp;gt; Note&amp;lt;/translate&amp;gt;|link=]]&amp;amp;nbsp;&#039;&#039;&#039;&amp;lt;translate&amp;gt;&amp;lt;!--T:2--&amp;gt; Note:&amp;lt;/translate&amp;gt;&#039;&#039;&#039; }}&amp;lt;!--&lt;br /&gt;
--&amp;gt;&amp;lt;/onlyinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&amp;lt;translate&amp;gt;&lt;br /&gt;
== Usage == &amp;lt;!--T:3--&amp;gt;&lt;br /&gt;
&amp;lt;/translate&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{{Note|text=Foo}}&lt;br /&gt;
{{Note|type=info|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Multiple&amp;lt;br&amp;gt;lines&amp;lt;br&amp;gt;of&amp;lt;br&amp;gt;text}}&lt;br /&gt;
{{Note|type=warn|text=Foo}}&lt;br /&gt;
{{Note|type=error|text=Foo}}&lt;br /&gt;
{{Note}} &amp;lt;translate nowrap&amp;gt;&amp;lt;!--T:6--&amp;gt; Loose test&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Text {{Note|inline=1|text=Foo}}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Note|text=Foo}}&lt;br /&gt;
{{Note|type=info|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Foo}}&lt;br /&gt;
{{Note|type=reminder|text=Multiple&amp;lt;br&amp;gt;lines&amp;lt;br&amp;gt;of&amp;lt;br&amp;gt;text}}&lt;br /&gt;
{{Note|type=warn|text=Foo}}&lt;br /&gt;
{{Note|type=error|text=Foo}}&lt;br /&gt;
{{Note}} &amp;lt;translate&amp;gt;&amp;lt;!--T:4--&amp;gt; Loose test&amp;lt;/translate&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Text {{Note|inline=1|text=Foo}}&lt;br /&gt;
&lt;br /&gt;
== Parameters ==&lt;br /&gt;
&lt;br /&gt;
{{Note/doc}}&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* {{tl|warn}}, shortcut for this template with &amp;lt;code&amp;gt;type=warning&amp;lt;/code&amp;gt;.&lt;br /&gt;
* {{tl|mbox}}, and in particular the namespace-agnostic {{tl|ombox}}, which by default resembles a typical &amp;quot;info&amp;quot; template.&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
[[Category:Templates{{#translation:}}|{{PAGENAME}}]]&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note/style.css&amp;diff=419</id>
		<title>Template:Note/style.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note/style.css&amp;diff=419"/>
		<updated>2025-05-15T16:32:25Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: Created page with &amp;quot;.note {     background-position: left 7px top 50%;     padding: 0.5em 0.5em 0.5em 40px;     margin: 0.5em 0;     overflow: hidden;     background-color: #f8f9fa;     color: #333;     background-repeat: no-repeat;     border: 1px solid #ddd; } .note-inline {     display: inline-block;     vertical-align: middle; } .note-info {     background-color: #eaf3ff;     color: #333;     /* File:OOjs_UI_icon_information-progressive.svg */     background-image: url(https://uploa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.note {&lt;br /&gt;
    background-position: left 7px top 50%;&lt;br /&gt;
    padding: 0.5em 0.5em 0.5em 40px;&lt;br /&gt;
    margin: 0.5em 0;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
    background-color: #f8f9fa;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
    border: 1px solid #ddd;&lt;br /&gt;
}&lt;br /&gt;
.note-inline {&lt;br /&gt;
    display: inline-block;&lt;br /&gt;
    vertical-align: middle;&lt;br /&gt;
}&lt;br /&gt;
.note-info {&lt;br /&gt;
    background-color: #eaf3ff;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_information-progressive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #a3caff;&lt;br /&gt;
    padding-left: 40px;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-reminder {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_lightbulb-yellow.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-warn {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_alert-warning.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.note-error {&lt;br /&gt;
    background-color: #fee7e6;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_notice-destructive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #c33;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen {&lt;br /&gt;
    html.skin-theme-clientpref-night .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (prefers-color-scheme: dark) {&lt;br /&gt;
    /* automatic mode */&lt;br /&gt;
    html.skin-theme-clientpref-os .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Template:Note/styles.css&amp;diff=418</id>
		<title>Template:Note/styles.css</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Template:Note/styles.css&amp;diff=418"/>
		<updated>2025-05-15T14:49:16Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: Created page with &amp;quot;.note {     background-position: left 7px top 50%;     padding: 0.5em 0.5em 0.5em 40px;     margin: 0.5em 0;     overflow: hidden;     background-color: #f8f9fa;     color: #333;     background-repeat: no-repeat;     border: 1px solid #ddd; } .note-inline {     display: inline-block;     vertical-align: middle; } .note-info {     background-color: #eaf3ff;     color: #333;     /* File:OOjs_UI_icon_information-progressive.svg */     background-image: url(https://uploa...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.note {&lt;br /&gt;
    background-position: left 7px top 50%;&lt;br /&gt;
    padding: 0.5em 0.5em 0.5em 40px;&lt;br /&gt;
    margin: 0.5em 0;&lt;br /&gt;
    overflow: hidden;&lt;br /&gt;
    background-color: #f8f9fa;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
    border: 1px solid #ddd;&lt;br /&gt;
}&lt;br /&gt;
.note-inline {&lt;br /&gt;
    display: inline-block;&lt;br /&gt;
    vertical-align: middle;&lt;br /&gt;
}&lt;br /&gt;
.note-info {&lt;br /&gt;
    background-color: #eaf3ff;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_information-progressive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/e/ec/OOjs_UI_icon_information-progressive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #a3caff;&lt;br /&gt;
    padding-left: 40px;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-reminder {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_lightbulb-yellow.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/a/a8/OOjs_UI_icon_lightbulb-yellow.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
.note-warn {&lt;br /&gt;
    background-color: #fff9ea;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_alert-warning.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/3/3b/OOjs_UI_icon_alert-warning.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #fc3;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.note-error {&lt;br /&gt;
    background-color: #fee7e6;&lt;br /&gt;
    color: #333;&lt;br /&gt;
    /* [[File:OOjs_UI_icon_notice-destructive.svg]] */&lt;br /&gt;
    background-image: url(https://upload.wikimedia.org/wikipedia/commons/b/bf/OOjs_UI_icon_notice-destructive.svg);&lt;br /&gt;
    background-size: 25px;&lt;br /&gt;
    border-color: #c33;&lt;br /&gt;
    min-height: 25px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen {&lt;br /&gt;
    html.skin-theme-clientpref-night .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (prefers-color-scheme: dark) {&lt;br /&gt;
    /* automatic mode */&lt;br /&gt;
    html.skin-theme-clientpref-os .note {&lt;br /&gt;
        background-color: transparent;&lt;br /&gt;
        color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Getting_Started_with_V2&amp;diff=410</id>
		<title>Getting Started with V2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Getting_Started_with_V2&amp;diff=410"/>
		<updated>2025-03-03T13:43:18Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: /* Step2: Flash the bootloader to your STM32 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gathers information on how to get started with the Open Mower v2 software. Although things are getting stable, expect some changes and issues at the moment. If you have any questions, reach out on Discord, we try to help.&lt;br /&gt;
&lt;br /&gt;
== Reflashing the Bootloader onto the STM32 ==&lt;br /&gt;
If you got one of the very first x-core boards, you will need to re-flash the bootloader (there have been breaking changes in the protocol).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
&lt;br /&gt;
- CM4 on the core board&lt;br /&gt;
&lt;br /&gt;
- DHCP server on the ethernet where the STM32 is connected (I recommend installing isc-dhcp-server. Its easy and works well for met)&lt;br /&gt;
&lt;br /&gt;
- OpenOCD installed on the CM4 (see here for how to do it: https://core.x-tech.online/docs/tutorials/flashing-stm32-from-cm4/)&lt;br /&gt;
&lt;br /&gt;
- Docker or Podman installed on the CM4. I am using podman here, you can replace `podman` for `docker` and it should work the same.&lt;br /&gt;
&lt;br /&gt;
=== Step1: Get the latest firmware ===&lt;br /&gt;
SSH into your CM4 and execute the following commands:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ~/bootloader &amp;amp;&amp;amp; cd ~/bootloader&lt;br /&gt;
&lt;br /&gt;
wget https://github.com/xtech/fw-xcore-boot/releases/download/v1.1.3/xcore-boot-v1.1.3.zip&lt;br /&gt;
&lt;br /&gt;
unzip xcore-boot-v1.1.3.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now have a folder `artifacts` in your working directory. It contains the bootloader binaries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step2: Flash the bootloader to your STM32 ===&lt;br /&gt;
Run the following command to write the bootloader to your STM32.&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openocd -f interface/xcore.cfg -f target/stm32h7x.cfg -c &amp;quot;program artifacts/bootloader/xcore-boot.elf verify reset exit&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When the command succeeded, the updated bootloader is stored in the STM32.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Check, if it worked ===&lt;br /&gt;
Whenever the bootloader is running, the Heartbeat LED (heart icon on the PCB) should be flashing *BLUE*. Check, if this is the case.&lt;br /&gt;
&lt;br /&gt;
If this is not the case, the STM32 is in user-program mode and not in the bootloader. In order to force the STM32 into the bootloader, you need to power cycle the STM32 (RESET button is not enough).&lt;br /&gt;
&lt;br /&gt;
After power cycling, you should see the blue LED flashing. If not, ask on Discord - something has gone wrong.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Use the bootloader host program to connect to the bootloader. ===&lt;br /&gt;
In this step we test that the host application can talk to the bootloader.&lt;br /&gt;
&lt;br /&gt;
Run the following command to disable the developer mode on the bootloader:&lt;br /&gt;
 podman run --rm -it --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 set_dev_mode --disable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Information about the used flags:&lt;br /&gt;
&lt;br /&gt;
* --rm: removes the temporary container after uploading the firmware&lt;br /&gt;
* -it: Allows terminal output to be instantly visible&lt;br /&gt;
* --network=host: Allows the container to access the hosts&#039; network directly&lt;br /&gt;
* --interface=eth0: Forces the bootloader software to use eth0, change to whatever your ethernet interface name is&lt;br /&gt;
* set_dev_mode --disable: Disables the bootloader&#039;s developer mode. Developer mode will just jump into the user space program without any verification. You won&#039;t need it when using the bootloader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A successful run should look like this:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openmower@openmower:~/bootloader $ podman run --rm -it --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 set_dev_mode --disable&lt;br /&gt;
&lt;br /&gt;
Using interface eth0 with IP 172.16.78.1&lt;br /&gt;
&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot;application-mode&lt;br /&gt;
&lt;br /&gt;
Board in application mode, sending RESET to board&lt;br /&gt;
&lt;br /&gt;
Timeout (1/25)&lt;br /&gt;
&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot&lt;br /&gt;
&lt;br /&gt;
Found board at 172.16.78.150&lt;br /&gt;
&lt;br /&gt;
Connected to 172.16.78.150:8007&lt;br /&gt;
&lt;br /&gt;
Variables received from board:&lt;br /&gt;
&lt;br /&gt;
BOOTLOADER VERSION: xcore-boot v1.1&lt;br /&gt;
&lt;br /&gt;
BOARD: xcore&lt;br /&gt;
&lt;br /&gt;
HARDWARE VERSION: 1.1.7&lt;br /&gt;
&lt;br /&gt;
CARRIER BOARD: hw-openmower-yardforce&lt;br /&gt;
&lt;br /&gt;
CARRIER BOARD VERSION: 1.0.1&lt;br /&gt;
&lt;br /&gt;
Sent SET_DEV_MODE to board&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Got command: SET_DEV_MODE&lt;br /&gt;
&lt;br /&gt;
Received HASH OK&lt;br /&gt;
&lt;br /&gt;
Sent new value to board&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Dev Mode: Disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;Successfully updated EEPROM&lt;br /&gt;
&lt;br /&gt;
Error reading line: Connection closed by remote host&lt;br /&gt;
&lt;br /&gt;
Connection closed&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Upload a user firmware ===&lt;br /&gt;
We can now use the bootloader to upload a firmware to the STM32.&lt;br /&gt;
&lt;br /&gt;
In this example we flash the OpenMower v2 firmware for a YardForce robot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Download the firmware you want to upload (.bin file)&lt;br /&gt;
# Get it here: https://github.com/xtech/fw-openmower-v2/actions&lt;br /&gt;
# Select the latest successful run, login and download the artifact&lt;br /&gt;
&lt;br /&gt;
# Extract the zip:&lt;br /&gt;
unzip openmower.zip&lt;br /&gt;
&lt;br /&gt;
# Upload the firmware&lt;br /&gt;
podman run --rm -it -v $(pwd):/workdir --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 upload /workdir/openmower-yardforce.bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;A successful run should look like this:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openmower@openmower:~/firmware $ podman run --rm -it -v $(pwd):/workdir --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 upload /workdir/openmower-yardforce.bin&lt;br /&gt;
Using interface eth0 with IP 172.16.78.1&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot;application-mode&lt;br /&gt;
Board in application mode, sending RESET to board&lt;br /&gt;
Timeout (1/25)&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot&lt;br /&gt;
Found board at 172.16.78.150&lt;br /&gt;
File SHA256: 92d8213153e4a757edaff8070c3c51b7de48da1383bb2c9ef1042c3469b89130&lt;br /&gt;
File Length: 191208&lt;br /&gt;
Connected to 172.16.78.150:8007&lt;br /&gt;
Variables received from board:&lt;br /&gt;
BOOTLOADER VERSION: xcore-boot v1.1&lt;br /&gt;
BOARD: xcore&lt;br /&gt;
HARDWARE VERSION: 1.1.7&lt;br /&gt;
CARRIER BOARD: hw-openmower-yardforce&lt;br /&gt;
CARRIER BOARD VERSION: 1.0.1&lt;br /&gt;
Sending UPLOAD command&lt;br /&gt;
&amp;gt; Got command: UPLOAD&lt;br /&gt;
Received SEND HASH&lt;br /&gt;
Sent SHA256 to board&lt;br /&gt;
Received HASH OK&lt;br /&gt;
Sent file length to board&lt;br /&gt;
&amp;gt;Image size: 191208&lt;br /&gt;
&amp;gt;Erasing 2 Flash Pages.&lt;br /&gt;
&amp;gt;Erasing Chip...&lt;br /&gt;
&amp;gt;Erasing Done&lt;br /&gt;
Uploading file...&lt;br /&gt;
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 191k/191k [00:01&amp;lt;00:00, 182kB/s]&lt;br /&gt;
File content sent&lt;br /&gt;
Connection closed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Getting_Started_with_V2&amp;diff=409</id>
		<title>Getting Started with V2</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Getting_Started_with_V2&amp;diff=409"/>
		<updated>2025-03-03T13:37:38Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: Created page with &amp;quot;This page gathers information on how to get started with the Open Mower v2 software. Although things are getting stable, expect some changes and issues at the moment. If you have any questions, reach out on Discord, we try to help.  == Reflashing the Bootloader onto the STM32 == If you got one of the very first x-core boards, you will need to re-flash the bootloader (there have been breaking changes in the protocol).   Requirements:  - CM4 on the core board  - DHCP serve...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page gathers information on how to get started with the Open Mower v2 software. Although things are getting stable, expect some changes and issues at the moment. If you have any questions, reach out on Discord, we try to help.&lt;br /&gt;
&lt;br /&gt;
== Reflashing the Bootloader onto the STM32 ==&lt;br /&gt;
If you got one of the very first x-core boards, you will need to re-flash the bootloader (there have been breaking changes in the protocol).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Requirements:&lt;br /&gt;
&lt;br /&gt;
- CM4 on the core board&lt;br /&gt;
&lt;br /&gt;
- DHCP server on the ethernet where the STM32 is connected (I recommend installing isc-dhcp-server. Its easy and works well for met)&lt;br /&gt;
&lt;br /&gt;
- OpenOCD installed on the CM4 (see here for how to do it: https://core.x-tech.online/docs/tutorials/flashing-stm32-from-cm4/)&lt;br /&gt;
&lt;br /&gt;
- Docker or Podman installed on the CM4. I am using podman here, you can replace `podman` for `docker` and it should work the same.&lt;br /&gt;
&lt;br /&gt;
=== Step1: Get the latest firmware ===&lt;br /&gt;
SSH into your CM4 and execute the following commands:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdir ~/bootloader &amp;amp;&amp;amp; cd ~/bootloader&lt;br /&gt;
&lt;br /&gt;
wget https://github.com/xtech/fw-xcore-boot/releases/download/v1.1.3/xcore-boot-v1.1.3.zip&lt;br /&gt;
&lt;br /&gt;
unzip xcore-boot-v1.1.3.zip&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You should now have a folder `artifacts` in your working directory. It contains the bootloader binaries.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Step2: Flash the bootloader to your STM32 ===&lt;br /&gt;
Run the following command to write the bootloader to your STM32.&lt;br /&gt;
&lt;br /&gt;
`openocd -f interface/xcore.cfg -f target/stm32h7x.cfg -c &amp;quot;program artifacts/bootloader/xcore-boot.elf verify reset exit&amp;quot;`&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the command succeeded, the updated bootloader is stored in the STM32.&lt;br /&gt;
&lt;br /&gt;
=== Step 3: Check, if it worked ===&lt;br /&gt;
Whenever the bootloader is running, the Heartbeat LED (heart icon on the PCB) should be flashing *BLUE*. Check, if this is the case.&lt;br /&gt;
&lt;br /&gt;
If this is not the case, the STM32 is in user-program mode and not in the bootloader. In order to force the STM32 into the bootloader, you need to power cycle the STM32 (RESET button is not enough).&lt;br /&gt;
&lt;br /&gt;
After power cycling, you should see the blue LED flashing. If not, ask on Discord - something has gone wrong.&lt;br /&gt;
&lt;br /&gt;
=== Step 4: Use the bootloader host program to connect to the bootloader. ===&lt;br /&gt;
In this step we test that the host application can talk to the bootloader.&lt;br /&gt;
&lt;br /&gt;
Run the following command to disable the developer mode on the bootloader:&lt;br /&gt;
 podman run --rm -it --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 set_dev_mode --disable&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Information about the used flags:&lt;br /&gt;
&lt;br /&gt;
* --rm: removes the temporary container after uploading the firmware&lt;br /&gt;
* -it: Allows terminal output to be instantly visible&lt;br /&gt;
* --network=host: Allows the container to access the hosts&#039; network directly&lt;br /&gt;
* --interface=eth0: Forces the bootloader software to use eth0, change to whatever your ethernet interface name is&lt;br /&gt;
* set_dev_mode --disable: Disables the bootloader&#039;s developer mode. Developer mode will just jump into the user space program without any verification. You won&#039;t need it when using the bootloader.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A successful run should look like this:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openmower@openmower:~/bootloader $ podman run --rm -it --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 set_dev_mode --disable&lt;br /&gt;
&lt;br /&gt;
Using interface eth0 with IP 172.16.78.1&lt;br /&gt;
&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot;application-mode&lt;br /&gt;
&lt;br /&gt;
Board in application mode, sending RESET to board&lt;br /&gt;
&lt;br /&gt;
Timeout (1/25)&lt;br /&gt;
&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot&lt;br /&gt;
&lt;br /&gt;
Found board at 172.16.78.150&lt;br /&gt;
&lt;br /&gt;
Connected to 172.16.78.150:8007&lt;br /&gt;
&lt;br /&gt;
Variables received from board:&lt;br /&gt;
&lt;br /&gt;
BOOTLOADER VERSION: xcore-boot v1.1&lt;br /&gt;
&lt;br /&gt;
BOARD: xcore&lt;br /&gt;
&lt;br /&gt;
HARDWARE VERSION: 1.1.7&lt;br /&gt;
&lt;br /&gt;
CARRIER BOARD: hw-openmower-yardforce&lt;br /&gt;
&lt;br /&gt;
CARRIER BOARD VERSION: 1.0.1&lt;br /&gt;
&lt;br /&gt;
Sent SET_DEV_MODE to board&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Got command: SET_DEV_MODE&lt;br /&gt;
&lt;br /&gt;
Received HASH OK&lt;br /&gt;
&lt;br /&gt;
Sent new value to board&lt;br /&gt;
&lt;br /&gt;
&amp;gt; Dev Mode: Disabled.&lt;br /&gt;
&lt;br /&gt;
&amp;gt;Successfully updated EEPROM&lt;br /&gt;
&lt;br /&gt;
Error reading line: Connection closed by remote host&lt;br /&gt;
&lt;br /&gt;
Connection closed&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Step 5: Upload a user firmware ===&lt;br /&gt;
We can now use the bootloader to upload a firmware to the STM32.&lt;br /&gt;
&lt;br /&gt;
In this example we flash the OpenMower v2 firmware for a YardForce robot.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Download the firmware you want to upload (.bin file)&lt;br /&gt;
# Get it here: https://github.com/xtech/fw-openmower-v2/actions&lt;br /&gt;
# Select the latest successful run, login and download the artifact&lt;br /&gt;
&lt;br /&gt;
# Extract the zip:&lt;br /&gt;
unzip openmower.zip&lt;br /&gt;
&lt;br /&gt;
# Upload the firmware&lt;br /&gt;
podman run --rm -it -v $(pwd):/workdir --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 upload /workdir/openmower-yardforce.bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;A successful run should look like this:&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
openmower@openmower:~/firmware $ podman run --rm -it -v $(pwd):/workdir --network=host ghcr.io/xtech/fw-xcore-boot --interface=eth0 upload /workdir/openmower-yardforce.bin&lt;br /&gt;
Using interface eth0 with IP 172.16.78.1&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot;application-mode&lt;br /&gt;
Board in application mode, sending RESET to board&lt;br /&gt;
Timeout (1/25)&lt;br /&gt;
Received advertisement from 172.16.78.150: BOARD_ADVERTISEMENT:xcore-boot&lt;br /&gt;
Found board at 172.16.78.150&lt;br /&gt;
File SHA256: 92d8213153e4a757edaff8070c3c51b7de48da1383bb2c9ef1042c3469b89130&lt;br /&gt;
File Length: 191208&lt;br /&gt;
Connected to 172.16.78.150:8007&lt;br /&gt;
Variables received from board:&lt;br /&gt;
BOOTLOADER VERSION: xcore-boot v1.1&lt;br /&gt;
BOARD: xcore&lt;br /&gt;
HARDWARE VERSION: 1.1.7&lt;br /&gt;
CARRIER BOARD: hw-openmower-yardforce&lt;br /&gt;
CARRIER BOARD VERSION: 1.0.1&lt;br /&gt;
Sending UPLOAD command&lt;br /&gt;
&amp;gt; Got command: UPLOAD&lt;br /&gt;
Received SEND HASH&lt;br /&gt;
Sent SHA256 to board&lt;br /&gt;
Received HASH OK&lt;br /&gt;
Sent file length to board&lt;br /&gt;
&amp;gt;Image size: 191208&lt;br /&gt;
&amp;gt;Erasing 2 Flash Pages.&lt;br /&gt;
&amp;gt;Erasing Chip...&lt;br /&gt;
&amp;gt;Erasing Done&lt;br /&gt;
Uploading file...&lt;br /&gt;
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 191k/191k [00:01&amp;lt;00:00, 182kB/s]&lt;br /&gt;
File content sent&lt;br /&gt;
Connection closed&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Main_Page&amp;diff=408</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Main_Page&amp;diff=408"/>
		<updated>2025-03-03T13:08:09Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== The OpenMower Community Wiki ==&lt;br /&gt;
&lt;br /&gt;
Welcome to the OpenMower Community Wiki!&lt;br /&gt;
&lt;br /&gt;
This WIKI was only just started on 2022-04-22, but we&#039;ll collaborate on getting good information on the OpenMower project collected here.&lt;br /&gt;
&lt;br /&gt;
If you want to contribute to the Wiki: [https://discord.gg/jE7QNaSxW7 join the Discord], ask at the [https://discord.com/channels/958476543846412329/967345181013725194 #wiki-authors channel] for a wiki account and a wiki admin will create one.&lt;br /&gt;
&lt;br /&gt;
Also head over to the [https://discord.com/channels/958476543846412329/967345181013725194 #wiki-authors channel] if you want talk about wiki related stuff.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to Get Started ==&lt;br /&gt;
&lt;br /&gt;
One of the first steps currently is to browse around the discord and understand what the project is about. You can also have a look at Clemens&#039; second video ([https://www.youtube.com/watch?v=_bImqD-pQSA here]) of the project that details how to assemble the bot. &lt;br /&gt;
&lt;br /&gt;
First: Check the &#039;&#039;&#039;[[FAQ]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
When you&#039;re ready, you can have a look at the &#039;&#039;&#039;[[Building the Mower]]&#039;&#039;&#039; section to see the Bill of Materials and steps required and check out &#039;&#039;&#039;[[Builder Road Map]]&#039;&#039;&#039; for a practical take on what to do.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;(Note this wiki is in progress and not complete yet, but we&#039;re working on it!)&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;⚡ Before checking out the community wiki head over to the Official Documentation at [https://openmower.de/ openmower.de] ⚡&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
&lt;br /&gt;
===[[FAQ]]===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;There is a continually evolving [[FAQ]] that is a good starting point for understanding the project and getting answers to some key questions.&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===[[Project overview|Project overview and timeline]]===&lt;br /&gt;
&lt;br /&gt;
Current status and future goals - [[Project overview|See it here]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Hardware Revisions===&lt;br /&gt;
&lt;br /&gt;
Open Mower hardware revisions, changelog, info: [https://openmower.de/docs/versions/ Moved to the official docs]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===[[System Image|Software Installation]] &#039;&#039;Old bare metal installation - not for users&#039;&#039;===&lt;br /&gt;
&lt;br /&gt;
On this page, you can find steps how to install a basic OpenMower system image.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===[[Running OpenMower]]===&lt;br /&gt;
&lt;br /&gt;
On this page, you can find steps how to run the OpenMower software.&lt;br /&gt;
We&#039;re doing:&lt;br /&gt;
- Starting the Software&lt;br /&gt;
- Magnetometer Calibration&lt;br /&gt;
- Recording a Map&lt;br /&gt;
- Starting the Mowing Process&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===[[Mini HOWTOs]]===&lt;br /&gt;
&lt;br /&gt;
On this page, you can find small HOWTOs for various things. Set [[Mini HOWTOs|here]]&lt;br /&gt;
&lt;br /&gt;
===Where to find more information===&lt;br /&gt;
&lt;br /&gt;
The entry points for more information are:&lt;br /&gt;
&lt;br /&gt;
*[https://discord.com/channels/958476543846412329/958476543846412331 The Discord for the project]&lt;br /&gt;
*[https://discord.com/channels/958476543846412329/958476543846412332 Annoncements in the Discord]&lt;br /&gt;
*[https://youtube.com/c/ClemensElflein/videos YouTube]&lt;br /&gt;
*[https://github.com/ClemensElflein/OpenMower Open Mower Main GitHub Repo - Overall and hardware]&lt;br /&gt;
*[https://github.com/ClemensElflein/open_mower_ros Open Mower GitHub Repo for the ROS logic in the OpenMower]&lt;br /&gt;
*[https://github.com/ClemensElflein/xESC xESC Motor Controller Repo (custom part for main board)]&lt;br /&gt;
*[[Getting Started with V2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==How to contribute==&lt;br /&gt;
&lt;br /&gt;
At the moment, there are different ways to contribute:&lt;br /&gt;
&lt;br /&gt;
*Building your own mower, testing the software and reporting bugs / committing fixes on the github repository&lt;br /&gt;
&lt;br /&gt;
*If you&#039;re not scared to see the inside of some mowers, please help us understand more about how they are built following instructions in the &#039;&#039;&#039;[[Mower Dissection]]&#039;&#039;&#039; page.&lt;br /&gt;
&lt;br /&gt;
*And finally, [https://www.patreon.com/ClemensElflein Patreon to support Clemens&#039; amazing work]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Disclaimer==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;This Wiki is provided as-is and free of charge. No guarantees of any kind are made that the information contained herein is exact or correct or does not violate any local regulations or cause any security risk. Any use you make of any information given here is at your own discretion and risk.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Flashing_Xesc_firmware&amp;diff=314</id>
		<title>Flashing Xesc firmware</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Flashing_Xesc_firmware&amp;diff=314"/>
		<updated>2022-12-13T09:22:23Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: /* Connecting everything */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&#039;&#039;This page will guide you through the steps needed to flash and configure the XESCs for use with the OpenMower Project&lt;br /&gt;
&lt;br /&gt;
This mini-HOWTO is meant to guide you through the different steps.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;THIS PAGE IS CONSIDERED A WORK IN PROGRESS AND WILL BE UPDATED REGULARLY&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Disclaimer ==&lt;br /&gt;
&#039;&#039;This Wiki is provided as-is and free of charge. No guarantees of any kind are made that the information contained herein is exact or correct or does not violate any local regulations or cause any security risk. Any use you make of any information given here is at your own discretion and risk.&lt;br /&gt;
Please note that motors can be dangerous, especially the mowing one. Always take the blade apart when building / testing around the bot, and make sure nothing contacts any of the moving parts.&lt;br /&gt;
&lt;br /&gt;
We cannot be held responsible for your actions.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== STM32 Version ==&lt;br /&gt;
&#039;&#039;In this section, we will guide you through the first flashing and configuration of your STM32 based XESC&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Only linux have been tested for now, but other OS will come.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
For this how-to, you will need:&lt;br /&gt;
- A Linux Computer with internet connection&lt;br /&gt;
- The XESC you want to flash&lt;br /&gt;
- A micro USB cable&lt;br /&gt;
- A ST programmer (STlink v2 or blue pill for exemple)&lt;br /&gt;
- Some wires to connect the XESC and the STLINK&lt;br /&gt;
&lt;br /&gt;
=== Setting Up Your Machine ===&lt;br /&gt;
&lt;br /&gt;
We created a script to make sure everything on your machine is setup correctly. To use it:&lt;br /&gt;
&lt;br /&gt;
- Run a terminal on your computer&lt;br /&gt;
- run &amp;lt;code&amp;gt;wget https://github.com/vamatis/Random/blob/main/xesc-computer-setup-script.sh &amp;lt;/code&amp;gt;&lt;br /&gt;
- then &amp;lt;code&amp;gt;chmod u+x xesc-computer-setup-script.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
- and finally &amp;lt;code&amp;gt;sudo ./xesc-computer-setup-script.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The script will create a XESC-Setup folder with the following architecture:&lt;br /&gt;
&lt;br /&gt;
- XESC-Setup&lt;br /&gt;
  - bldc-bootloader&lt;br /&gt;
  - xesc_firmware&lt;br /&gt;
  - configs&lt;br /&gt;
&lt;br /&gt;
The bldc-bootloader folder contains the VESC bootloader for the STM32&lt;br /&gt;
The xesc_firmware contains the custom firmware for the XESC&lt;br /&gt;
The config folder contains configurations for the drive and mower motors&lt;br /&gt;
&lt;br /&gt;
Once you have that done, you&#039;re ready to proceed!&lt;br /&gt;
&lt;br /&gt;
=== Connecting everything ===&lt;br /&gt;
Depending on the Programmer you use, you will need to connect either 3 or 4 wires between the programmer and XESC.&lt;br /&gt;
These wires are:&lt;br /&gt;
- 3V3V (not mandatory, depends on the programmer used)&lt;br /&gt;
- SWDIO -&amp;gt; the dataline&lt;br /&gt;
- SWDCLK -&amp;gt; the clockline&lt;br /&gt;
- GND&lt;br /&gt;
&lt;br /&gt;
Looking at the XESC from the top (USB on top) and with the usb port facing towards you, the pinout is as follows:&lt;br /&gt;
3V3&lt;br /&gt;
SWCLK&lt;br /&gt;
GND&lt;br /&gt;
SWDIO&lt;br /&gt;
RESET&lt;br /&gt;
&lt;br /&gt;
Note that we won&#039;t use the reset line.&lt;br /&gt;
&lt;br /&gt;
=== Flashing the Bootloader ===&lt;br /&gt;
&lt;br /&gt;
=== Flashing the Firmware ===&lt;br /&gt;
&lt;br /&gt;
=== Connection to VESC TOOL and configuration ===&lt;br /&gt;
&lt;br /&gt;
== RP2040 Version ==&lt;br /&gt;
&#039;&#039;In this section, we will guide you through the first flashing and configuration of your RP2040 based XESC&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Compared to the STM32 version, flashing the RP2040 XESC is pretty simple:&lt;br /&gt;
&lt;br /&gt;
- Connect your XESC to your computer using the micro USB port&lt;br /&gt;
XESC will then appear as a mass storage device.&lt;br /&gt;
- Copy/Paste the firmware file to that new storage&lt;br /&gt;
&lt;br /&gt;
On the RP2040 version, ROS automatically loads the necessary config for the OPENMOWER motors, so you don&#039;t need to do anything else.&lt;br /&gt;
&lt;br /&gt;
Enjoy your flashed XESCs!&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=300</id>
		<title>Running OpenMower</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=300"/>
		<updated>2022-08-23T11:19:05Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Now that you have your hardware assembled and the basic software installed on your mower, we can calibrate the magnetometer and start recordings maps and mowing the lawn.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to follow this guide, you will need the following:&lt;br /&gt;
&lt;br /&gt;
#A mower modified to run the OpenMower software&lt;br /&gt;
#A working system image, where you can run the OpenMower software&lt;br /&gt;
#An ssh connection to your mower&lt;br /&gt;
#An Xbox GamePad&lt;br /&gt;
#Some source for RTK corrections, I&#039;m using a local base station for this.&lt;br /&gt;
#Optional, but very useful: A Linux PC where you can run RVIZ to visualize what your mower is doing&lt;br /&gt;
&lt;br /&gt;
==Test Setup for this Guide==&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup1.jpg|thumb|My GPS Test Setup]]&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup2.jpg|thumb|Open Mower GPS Test Setup Detail]]&lt;br /&gt;
&lt;br /&gt;
===Hardware Used===&lt;br /&gt;
For this guide, I&#039;m using the following setup:&lt;br /&gt;
* YardForce Classic 500 mower with OpenMower Mainboard and system image as described [[System Image|here]] which is connected to a router via WiFi&lt;br /&gt;
* A local RTK base station connected to a router via ethernet&lt;br /&gt;
* A GPS antenna on a large tripod (~3 m height) connected to the RTK base station&lt;br /&gt;
* A PC connected to the same network for testing&lt;br /&gt;
* I am using a relative coordinate system for positioning (check mower_config.sh, if you are not sure about that)&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
I have used a static IP configuration with the following settings:&lt;br /&gt;
&#039;&#039;&#039;RTK base station:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: rtkbase.local&lt;br /&gt;
* IP-Address: 192.168.0.100&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Robot:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: openmower.local&lt;br /&gt;
* IP-Address: 192.168.0.101&lt;br /&gt;
&lt;br /&gt;
===Connect the Components===&lt;br /&gt;
First connect the components like it is shown in the pictures on the right. The GPS antenna is connected to the Raspberry Pi base station. The RaspberryPi GPS base station is powered via USB-C power supply and is connected to the router via ethernet. The router needs to be powered as well using the included power supply. My laptop and the mower are both connected to the router via WiFi.&lt;br /&gt;
&lt;br /&gt;
===Testing the Connection===&lt;br /&gt;
After connecting the components as described and powering everything, make sure that the network connection works as expected. To do this ping the base station and the mower from your PC using both the IP address and their hostname. If both works, the network setup is successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing RTK GPS==&lt;br /&gt;
Once you have confirmed, that the network is working correctly, test the RTK GPS. Do this by connecting to your mower using &#039;&#039;&#039;two separate ssh sessions&#039;&#039;&#039;: one for starting the OpenMower software and the other one for looking at the GPS data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the first terminal, start the GPS communication part of the OpenMower software by typing &amp;lt;code&amp;gt;roslaunch open_mower _gps.launch&amp;lt;/code&amp;gt;. You should see some console output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second terminal, run &amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned&amp;lt;/code&amp;gt;. There should be messages shown in the terminal. We are interested in the following fields of the message: &#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait for the accuracy to reach the value of 100. &#039;&#039;&#039;Depending on your configuration, this might take some time. Wait at least 30 minutes before starting to debug anything. First time fix will take some time!&#039;&#039;&#039; If your accuracy number drops to 100 and is stable at this value, your RTK GPS is working as intended. If the values does not drop, there is an issue with the RTK setup.&lt;br /&gt;
&lt;br /&gt;
If you are happy with your accuracy, stop the OpenMower software by pressing &amp;lt;code&amp;gt;CRTL+C&amp;lt;/code&amp;gt; in your first terminal.&lt;br /&gt;
&lt;br /&gt;
==Magnetometer Calibration==&lt;br /&gt;
[[File:Mag Calibration.png|thumb|Example output of the mag_calibration node.]]&lt;br /&gt;
After verifying, that the RTK GPS is working as intended, you will need to calibrate your magnetometer. This is important, because the magnets and metal parts embedded in the mower will interfere with the magnetic sensor. That&#039;s why it&#039;s important to &#039;&#039;&#039;do this after finishing the assembly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to start magnetometer calibration, start the OpenMower software on the mower using ssh: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower _comms.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will start the communication layer between ROS and the mower&#039;s hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now start a second terminal and ssh into your mower.&lt;br /&gt;
&lt;br /&gt;
You can test, that the communication works by using the following command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /mower/imu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now see the raw IMU data printed to the terminal. If this is not the case, you have an error in your setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to cancel the data display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can start the calibration process by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosrun mower_logic mag_calibration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rotate the mower &#039;&#039;&#039;slowly&#039;&#039;&#039; around all three axes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T&#039;&#039;&#039; push the emergency stop button during the calibration. It has magnets embedded and will lead to &#039;&#039;&#039;wrong calibration.&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
As soon as you&#039;re finished, press the enter button. The final values are printed to the terminal.  &lt;br /&gt;
&lt;br /&gt;
Stop the first ROS process by pressing &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can copy and paste the values into your &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Now &#039;&#039;&#039;reload the &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;&#039;&#039;&#039; by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source ~/mower_config.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Area Recording ==&lt;br /&gt;
Finally, you can record your mowing areas and the docking station position.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;There is also a YouTube animation available, watch that first and then read the following text: https://www.youtube.com/watch?v=j7qkwuoHJpI&#039;&#039;&#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I recommend that you start with a simple area with lots of space around first. This way if something goes wrong, your mower won&#039;t instantly crash. You will need to record at least one area and your docking station in order to start mowing.&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
Basically, there are three things to record: The &#039;&#039;&#039;Navigation Area, Mowing Areas&#039;&#039;&#039; and the &#039;&#039;&#039;Docking Station position.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;mowing areas&#039;&#039;&#039; are the areas which will be mowed by the mower. Each mowing area consists of &#039;&#039;&#039;an outline&#039;&#039;&#039; and optionally &#039;&#039;&#039;areas to avoid&#039;&#039;&#039;.&lt;br /&gt;
* The &#039;&#039;&#039;navigation area&#039;&#039;&#039; is the area which the robot may enter during navigation. This is needed to roam between mowing areas and also to find a way to the docking station, if it&#039;s not inside a mowing area.&lt;br /&gt;
* The &#039;&#039;&#039;docking station&#039;&#039;&#039; is defined by a position and an orientation. Since the orientation of the mower is not 100% perfect due to magnetometer noise, we&#039;ll record two points which are then connected by a line. The direction of this line determines the docking orientation. More on that later&lt;br /&gt;
[[File:OpenMower Gamepad.png|thumb|OpenMower Gamepad Controls &amp;lt;small&amp;gt;(image licensed from shutterstock.com)&amp;lt;/small&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
During recording mode, you can move the mower and control the recording process using the Xbox game pad:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hold A&#039;&#039;&#039; to move the mower using the &#039;&#039;&#039;left analog stick.&#039;&#039;&#039; Press &#039;&#039;&#039;RB for turbo mode.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Press B&#039;&#039;&#039; to start / stop recording of the current polygon.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + D-PAD UP&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;navigation area&#039;&#039;&#039;. The robot is allowed to enter the area for navigation (e.g. driving to another area or to the docking station), but the are will not be mowed by the mower.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + D-PAD DOWN&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;mowing area&#039;&#039;&#039;. The robot will mow this area. You will need &#039;&#039;&#039;at least one&#039;&#039;&#039; mowing area, for the robot to work.&lt;br /&gt;
* &#039;&#039;&#039;Press X&#039;&#039;&#039; to record the first point of the docking position, &#039;&#039;&#039;Press X&#039;&#039;&#039; again to record the second position of the docking station and save it to the map.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You start and stop the recording mode using buttons on the mower:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Press S1&#039;&#039;&#039; to start the recording mode&lt;br /&gt;
* &#039;&#039;&#039;Press Home&#039;&#039;&#039; to stop the recording mode&lt;br /&gt;
&lt;br /&gt;
=== Recording the Mowing Areas ===&lt;br /&gt;
At first I like to record the mowing areas. Start with &#039;&#039;&#039;one area which is obstacle free.&#039;&#039;&#039; As soon as you are more confident in the mower&#039;s positioning, you can add more areas complex areas which may also be close to obstacles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to start recording an area, start the OpenMower software using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower open_mower.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the recording, make sure that you have a good GPS fix. You can do that by using the following command &#039;&#039;&#039;in a second terminal:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned/accLength&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will print the current GPS accuracy in &#039;&#039;&#039;0.1 mm&#039;&#039;&#039; steps. At full accuracy, you should get a value of 100. &#039;&#039;&#039;If it is larger, check your GPS config!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, with the OpenMower software running and with a good GPS fix, you can start the area recording process. &#039;&#039;&#039;For this you will need a gamepad connected to your mower.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Start the recording process by either pushing the S1 button on your mower or by executing the following command in a terminal to simulate the button press:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~/open_mower_ros/utils/mower_buttons/press_s1.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to move your mower using the GamePad (see controls section above).&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=299</id>
		<title>Running OpenMower</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=299"/>
		<updated>2022-08-23T11:18:13Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: /* Controls */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Now that you have your hardware assembled and the basic software installed on your mower, we can calibrate the magnetometer and start recordings maps and mowing the lawn.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to follow this guide, you will need the following:&lt;br /&gt;
&lt;br /&gt;
#A mower modified to run the OpenMower software&lt;br /&gt;
#A working system image, where you can run the OpenMower software&lt;br /&gt;
#An ssh connection to your mower&lt;br /&gt;
#An Xbox GamePad&lt;br /&gt;
#Some source for RTK corrections, I&#039;m using a local base station for this.&lt;br /&gt;
#Optional, but very useful: A Linux PC where you can run RVIZ to visualize what your mower is doing&lt;br /&gt;
&lt;br /&gt;
==Test Setup for this Guide==&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup1.jpg|thumb|My GPS Test Setup]]&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup2.jpg|thumb|Open Mower GPS Test Setup Detail]]&lt;br /&gt;
&lt;br /&gt;
===Hardware Used===&lt;br /&gt;
For this guide, I&#039;m using the following setup:&lt;br /&gt;
* YardForce Classic 500 mower with OpenMower Mainboard and system image as described [[System Image|here]] which is connected to a router via WiFi&lt;br /&gt;
* A local RTK base station connected to a router via ethernet&lt;br /&gt;
* A GPS antenna on a large tripod (~3 m height) connected to the RTK base station&lt;br /&gt;
* A PC connected to the same network for testing&lt;br /&gt;
* I am using a relative coordinate system for positioning (check mower_config.sh, if you are not sure about that)&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
I have used a static IP configuration with the following settings:&lt;br /&gt;
&#039;&#039;&#039;RTK base station:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: rtkbase.local&lt;br /&gt;
* IP-Address: 192.168.0.100&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Robot:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: openmower.local&lt;br /&gt;
* IP-Address: 192.168.0.101&lt;br /&gt;
&lt;br /&gt;
===Connect the Components===&lt;br /&gt;
First connect the components like it is shown in the pictures on the right. The GPS antenna is connected to the Raspberry Pi base station. The RaspberryPi GPS base station is powered via USB-C power supply and is connected to the router via ethernet. The router needs to be powered as well using the included power supply. My laptop and the mower are both connected to the router via WiFi.&lt;br /&gt;
&lt;br /&gt;
===Testing the Connection===&lt;br /&gt;
After connecting the components as described and powering everything, make sure that the network connection works as expected. To do this ping the base station and the mower from your PC using both the IP address and their hostname. If both works, the network setup is successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing RTK GPS==&lt;br /&gt;
Once you have confirmed, that the network is working correctly, test the RTK GPS. Do this by connecting to your mower using &#039;&#039;&#039;two separate ssh sessions&#039;&#039;&#039;: one for starting the OpenMower software and the other one for looking at the GPS data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the first terminal, start the GPS communication part of the OpenMower software by typing &amp;lt;code&amp;gt;roslaunch open_mower _gps.launch&amp;lt;/code&amp;gt;. You should see some console output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second terminal, run &amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned&amp;lt;/code&amp;gt;. There should be messages shown in the terminal. We are interested in the following fields of the message: &#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait for the accuracy to reach the value of 100. &#039;&#039;&#039;Depending on your configuration, this might take some time. Wait at least 30 minutes before starting to debug anything. First time fix will take some time!&#039;&#039;&#039; If your accuracy number drops to 100 and is stable at this value, your RTK GPS is working as intended. If the values does not drop, there is an issue with the RTK setup.&lt;br /&gt;
&lt;br /&gt;
If you are happy with your accuracy, stop the OpenMower software by pressing &amp;lt;code&amp;gt;CRTL+C&amp;lt;/code&amp;gt; in your first terminal.&lt;br /&gt;
&lt;br /&gt;
==Magnetometer Calibration==&lt;br /&gt;
[[File:Mag Calibration.png|thumb|Example output of the mag_calibration node.]]&lt;br /&gt;
After verifying, that the RTK GPS is working as intended, you will need to calibrate your magnetometer. This is important, because the magnets and metal parts embedded in the mower will interfere with the magnetic sensor. That&#039;s why it&#039;s important to &#039;&#039;&#039;do this after finishing the assembly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to start magnetometer calibration, start the OpenMower software on the mower using ssh: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower _comms.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will start the communication layer between ROS and the mower&#039;s hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now start a second terminal and ssh into your mower.&lt;br /&gt;
&lt;br /&gt;
You can test, that the communication works by using the following command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /mower/imu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now see the raw IMU data printed to the terminal. If this is not the case, you have an error in your setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to cancel the data display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can start the calibration process by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosrun mower_logic mag_calibration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rotate the mower &#039;&#039;&#039;slowly&#039;&#039;&#039; around all three axes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T&#039;&#039;&#039; push the emergency stop button during the calibration. It has magnets embedded and will lead to &#039;&#039;&#039;wrong calibration.&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
As soon as you&#039;re finished, press the enter button. The final values are printed to the terminal.  &lt;br /&gt;
&lt;br /&gt;
Stop the first ROS process by pressing &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can copy and paste the values into your &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Now &#039;&#039;&#039;reload the &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;&#039;&#039;&#039; by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source ~/mower_config.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Area Recording ==&lt;br /&gt;
Finally, you can record your mowing areas and the docking station position.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;There is also a YouTube animation available, watch that first and then read the following text:&#039;&#039;&#039;&amp;lt;/big&amp;gt; https://www.youtube.com/watch?v=j7qkwuoHJpI&lt;br /&gt;
&lt;br /&gt;
I recommend that you start with a simple area with lots of space around first. This way if something goes wrong, your mower won&#039;t instantly crash. You will need to record at least one area and your docking station in order to start mowing.&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
Basically, there are three things to record: The &#039;&#039;&#039;Navigation Area, Mowing Areas&#039;&#039;&#039; and the &#039;&#039;&#039;Docking Station position.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;mowing areas&#039;&#039;&#039; are the areas which will be mowed by the mower. Each mowing area consists of &#039;&#039;&#039;an outline&#039;&#039;&#039; and optionally &#039;&#039;&#039;areas to avoid&#039;&#039;&#039;.&lt;br /&gt;
* The &#039;&#039;&#039;navigation area&#039;&#039;&#039; is the area which the robot may enter during navigation. This is needed to roam between mowing areas and also to find a way to the docking station, if it&#039;s not inside a mowing area.&lt;br /&gt;
* The &#039;&#039;&#039;docking station&#039;&#039;&#039; is defined by a position and an orientation. Since the orientation of the mower is not 100% perfect due to magnetometer noise, we&#039;ll record two points which are then connected by a line. The direction of this line determines the docking orientation. More on that later&lt;br /&gt;
[[File:OpenMower Gamepad.png|thumb|OpenMower Gamepad Controls &amp;lt;small&amp;gt;(image licensed from shutterstock.com)&amp;lt;/small&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
During recording mode, you can move the mower and control the recording process using the Xbox game pad:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hold A&#039;&#039;&#039; to move the mower using the &#039;&#039;&#039;left analog stick.&#039;&#039;&#039; Press &#039;&#039;&#039;RB for turbo mode.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Press B&#039;&#039;&#039; to start / stop recording of the current polygon.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + D-PAD UP&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;navigation area&#039;&#039;&#039;. The robot is allowed to enter the area for navigation (e.g. driving to another area or to the docking station), but the are will not be mowed by the mower.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + D-PAD DOWN&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;mowing area&#039;&#039;&#039;. The robot will mow this area. You will need &#039;&#039;&#039;at least one&#039;&#039;&#039; mowing area, for the robot to work.&lt;br /&gt;
* &#039;&#039;&#039;Press X&#039;&#039;&#039; to record the first point of the docking position, &#039;&#039;&#039;Press X&#039;&#039;&#039; again to record the second position of the docking station and save it to the map.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You start and stop the recording mode using buttons on the mower:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Press S1&#039;&#039;&#039; to start the recording mode&lt;br /&gt;
* &#039;&#039;&#039;Press Home&#039;&#039;&#039; to stop the recording mode&lt;br /&gt;
&lt;br /&gt;
=== Recording the Mowing Areas ===&lt;br /&gt;
At first I like to record the mowing areas. Start with &#039;&#039;&#039;one area which is obstacle free.&#039;&#039;&#039; As soon as you are more confident in the mower&#039;s positioning, you can add more areas complex areas which may also be close to obstacles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to start recording an area, start the OpenMower software using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower open_mower.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the recording, make sure that you have a good GPS fix. You can do that by using the following command &#039;&#039;&#039;in a second terminal:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned/accLength&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will print the current GPS accuracy in &#039;&#039;&#039;0.1 mm&#039;&#039;&#039; steps. At full accuracy, you should get a value of 100. &#039;&#039;&#039;If it is larger, check your GPS config!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, with the OpenMower software running and with a good GPS fix, you can start the area recording process. &#039;&#039;&#039;For this you will need a gamepad connected to your mower.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Start the recording process by either pushing the S1 button on your mower or by executing the following command in a terminal to simulate the button press:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~/open_mower_ros/utils/mower_buttons/press_s1.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to move your mower using the GamePad (see controls section above).&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=298</id>
		<title>Running OpenMower</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Running_OpenMower&amp;diff=298"/>
		<updated>2022-08-23T11:16:31Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Now that you have your hardware assembled and the basic software installed on your mower, we can calibrate the magnetometer and start recordings maps and mowing the lawn.&lt;br /&gt;
&lt;br /&gt;
==Prerequisites==&lt;br /&gt;
In order to follow this guide, you will need the following:&lt;br /&gt;
&lt;br /&gt;
#A mower modified to run the OpenMower software&lt;br /&gt;
#A working system image, where you can run the OpenMower software&lt;br /&gt;
#An ssh connection to your mower&lt;br /&gt;
#An Xbox GamePad&lt;br /&gt;
#Some source for RTK corrections, I&#039;m using a local base station for this.&lt;br /&gt;
#Optional, but very useful: A Linux PC where you can run RVIZ to visualize what your mower is doing&lt;br /&gt;
&lt;br /&gt;
==Test Setup for this Guide==&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup1.jpg|thumb|My GPS Test Setup]]&lt;br /&gt;
[[File:OpenMower-GPS-Test-Setup2.jpg|thumb|Open Mower GPS Test Setup Detail]]&lt;br /&gt;
&lt;br /&gt;
===Hardware Used===&lt;br /&gt;
For this guide, I&#039;m using the following setup:&lt;br /&gt;
* YardForce Classic 500 mower with OpenMower Mainboard and system image as described [[System Image|here]] which is connected to a router via WiFi&lt;br /&gt;
* A local RTK base station connected to a router via ethernet&lt;br /&gt;
* A GPS antenna on a large tripod (~3 m height) connected to the RTK base station&lt;br /&gt;
* A PC connected to the same network for testing&lt;br /&gt;
* I am using a relative coordinate system for positioning (check mower_config.sh, if you are not sure about that)&lt;br /&gt;
&lt;br /&gt;
===Network Configuration===&lt;br /&gt;
I have used a static IP configuration with the following settings:&lt;br /&gt;
&#039;&#039;&#039;RTK base station:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: rtkbase.local&lt;br /&gt;
* IP-Address: 192.168.0.100&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Robot:&#039;&#039;&#039;&lt;br /&gt;
* Hostname: openmower.local&lt;br /&gt;
* IP-Address: 192.168.0.101&lt;br /&gt;
&lt;br /&gt;
===Connect the Components===&lt;br /&gt;
First connect the components like it is shown in the pictures on the right. The GPS antenna is connected to the Raspberry Pi base station. The RaspberryPi GPS base station is powered via USB-C power supply and is connected to the router via ethernet. The router needs to be powered as well using the included power supply. My laptop and the mower are both connected to the router via WiFi.&lt;br /&gt;
&lt;br /&gt;
===Testing the Connection===&lt;br /&gt;
After connecting the components as described and powering everything, make sure that the network connection works as expected. To do this ping the base station and the mower from your PC using both the IP address and their hostname. If both works, the network setup is successful.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Testing RTK GPS==&lt;br /&gt;
Once you have confirmed, that the network is working correctly, test the RTK GPS. Do this by connecting to your mower using &#039;&#039;&#039;two separate ssh sessions&#039;&#039;&#039;: one for starting the OpenMower software and the other one for looking at the GPS data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the first terminal, start the GPS communication part of the OpenMower software by typing &amp;lt;code&amp;gt;roslaunch open_mower _gps.launch&amp;lt;/code&amp;gt;. You should see some console output.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second terminal, run &amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned&amp;lt;/code&amp;gt;. There should be messages shown in the terminal. We are interested in the following fields of the message: &#039;&#039;&#039;TODO&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Wait for the accuracy to reach the value of 100. &#039;&#039;&#039;Depending on your configuration, this might take some time. Wait at least 30 minutes before starting to debug anything. First time fix will take some time!&#039;&#039;&#039; If your accuracy number drops to 100 and is stable at this value, your RTK GPS is working as intended. If the values does not drop, there is an issue with the RTK setup.&lt;br /&gt;
&lt;br /&gt;
If you are happy with your accuracy, stop the OpenMower software by pressing &amp;lt;code&amp;gt;CRTL+C&amp;lt;/code&amp;gt; in your first terminal.&lt;br /&gt;
&lt;br /&gt;
==Magnetometer Calibration==&lt;br /&gt;
[[File:Mag Calibration.png|thumb|Example output of the mag_calibration node.]]&lt;br /&gt;
After verifying, that the RTK GPS is working as intended, you will need to calibrate your magnetometer. This is important, because the magnets and metal parts embedded in the mower will interfere with the magnetic sensor. That&#039;s why it&#039;s important to &#039;&#039;&#039;do this after finishing the assembly!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to start magnetometer calibration, start the OpenMower software on the mower using ssh: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower _comms.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will start the communication layer between ROS and the mower&#039;s hardware.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now start a second terminal and ssh into your mower.&lt;br /&gt;
&lt;br /&gt;
You can test, that the communication works by using the following command: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /mower/imu&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now see the raw IMU data printed to the terminal. If this is not the case, you have an error in your setup.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Press &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt; to cancel the data display.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now you can start the calibration process by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rosrun mower_logic mag_calibration&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now rotate the mower &#039;&#039;&#039;slowly&#039;&#039;&#039; around all three axes. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;DON&#039;T&#039;&#039;&#039; push the emergency stop button during the calibration. It has magnets embedded and will lead to &#039;&#039;&#039;wrong calibration.&#039;&#039;&#039;  &lt;br /&gt;
&lt;br /&gt;
As soon as you&#039;re finished, press the enter button. The final values are printed to the terminal.  &lt;br /&gt;
&lt;br /&gt;
Stop the first ROS process by pressing &amp;lt;code&amp;gt;CTRL+C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
You can copy and paste the values into your &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;.  &lt;br /&gt;
&lt;br /&gt;
Now &#039;&#039;&#039;reload the &amp;lt;code&amp;gt;mower_config.sh&amp;lt;/code&amp;gt;&#039;&#039;&#039; by entering: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;source ~/mower_config.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Area Recording ==&lt;br /&gt;
Finally, you can record your mowing areas and the docking station position.&lt;br /&gt;
&lt;br /&gt;
I recommend that you start with a simple area with lots of space around first. This way if something goes wrong, your mower won&#039;t instantly crash. You will need to record at least one area and your docking station in order to start mowing.&lt;br /&gt;
&lt;br /&gt;
=== Overview ===&lt;br /&gt;
Basically, there are three things to record: The &#039;&#039;&#039;Navigation Area, Mowing Areas&#039;&#039;&#039; and the &#039;&#039;&#039;Docking Station position.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;mowing areas&#039;&#039;&#039; are the areas which will be mowed by the mower. Each mowing area consists of &#039;&#039;&#039;an outline&#039;&#039;&#039; and optionally &#039;&#039;&#039;areas to avoid&#039;&#039;&#039;.&lt;br /&gt;
* The &#039;&#039;&#039;navigation area&#039;&#039;&#039; is the area which the robot may enter during navigation. This is needed to roam between mowing areas and also to find a way to the docking station, if it&#039;s not inside a mowing area.&lt;br /&gt;
* The &#039;&#039;&#039;docking station&#039;&#039;&#039; is defined by a position and an orientation. Since the orientation of the mower is not 100% perfect due to magnetometer noise, we&#039;ll record two points which are then connected by a line. The direction of this line determines the docking orientation. More on that later&lt;br /&gt;
[[File:OpenMower Gamepad.png|thumb|OpenMower Gamepad Controls &amp;lt;small&amp;gt;(image licensed from shutterstock.com)&amp;lt;/small&amp;gt;]]&lt;br /&gt;
&lt;br /&gt;
=== Controls ===&lt;br /&gt;
During recording mode, you can move the mower and control the recording process using the Xbox game pad:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Hold A&#039;&#039;&#039; to move the mower using the &#039;&#039;&#039;left analog stick.&#039;&#039;&#039; Press &#039;&#039;&#039;RB for turbo mode.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Press B&#039;&#039;&#039; to start / stop recording of the current polygon.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + UP&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;navigation area&#039;&#039;&#039;. The robot is allowed to enter the area for navigation (e.g. driving to another area or to the docking station), but the are will not be mowed by the mower.&lt;br /&gt;
* &#039;&#039;&#039;Press Y + DOWN&#039;&#039;&#039; to finish your current area and add it to the map as a &#039;&#039;&#039;mowing area&#039;&#039;&#039;. The robot will mow this area. You will need &#039;&#039;&#039;at least one&#039;&#039;&#039; mowing area, for the robot to work.&lt;br /&gt;
* &#039;&#039;&#039;Press X&#039;&#039;&#039; to record the first point of the docking position, &#039;&#039;&#039;Press X&#039;&#039;&#039; again to record the second position of the docking station and save it to the map.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
You start and stop the recording mode using buttons on the mower:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Press S1&#039;&#039;&#039; to start the recording mode&lt;br /&gt;
* &#039;&#039;&#039;Press Home&#039;&#039;&#039; to stop the recording mode&lt;br /&gt;
&lt;br /&gt;
=== Recording the Mowing Areas ===&lt;br /&gt;
At first I like to record the mowing areas. Start with &#039;&#039;&#039;one area which is obstacle free.&#039;&#039;&#039; As soon as you are more confident in the mower&#039;s positioning, you can add more areas complex areas which may also be close to obstacles.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In order to start recording an area, start the OpenMower software using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;roslaunch open_mower open_mower.launch&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Before starting the recording, make sure that you have a good GPS fix. You can do that by using the following command &#039;&#039;&#039;in a second terminal:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;rostopic echo /ublox/navrelposned/accLength&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will print the current GPS accuracy in &#039;&#039;&#039;0.1 mm&#039;&#039;&#039; steps. At full accuracy, you should get a value of 100. &#039;&#039;&#039;If it is larger, check your GPS config!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Now, with the OpenMower software running and with a good GPS fix, you can start the area recording process. &#039;&#039;&#039;For this you will need a gamepad connected to your mower.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Start the recording process by either pushing the S1 button on your mower or by executing the following command in a terminal to simulate the button press:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;~/open_mower_ros/utils/mower_buttons/press_s1.sh&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should now be able to move your mower using the GamePad (see controls section above).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&#039;&#039;&#039;There is also a YouTube animation available:&#039;&#039;&#039;&amp;lt;/big&amp;gt; https://www.youtube.com/watch?v=j7qkwuoHJpI&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=File:OpenMower-GPS-Test-Setup2.jpg&amp;diff=297</id>
		<title>File:OpenMower-GPS-Test-Setup2.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=File:OpenMower-GPS-Test-Setup2.jpg&amp;diff=297"/>
		<updated>2022-08-23T10:47:57Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open Mower GPS Test Setup Detail&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=File:OpenMower-GPS-Test-Setup1.jpg&amp;diff=296</id>
		<title>File:OpenMower-GPS-Test-Setup1.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=File:OpenMower-GPS-Test-Setup1.jpg&amp;diff=296"/>
		<updated>2022-08-23T10:40:40Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Open Mower GPS Test Setup showing the GPS antenna, RTK base and router.&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Flashing_firmware_on_the_Pi_Pico&amp;diff=252</id>
		<title>Flashing firmware on the Pi Pico</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Flashing_firmware_on_the_Pi_Pico&amp;diff=252"/>
		<updated>2022-07-22T21:23:45Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Very rudimentary for now - check https://www.youtube.com/watch?v=_bImqD-pQSA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to flash the pi pico from the raspberry pi using openocd ==&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Directly copied from a discord conversation&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
use the .bin file if flashing via openocd or the uf2 file for flashing via usb mass storage&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
bridge the jumpers like on the right picture (you can leave them like this during normal operation, the idea is that instead of the jumpers you can use an external debugger on those pins as well)&lt;br /&gt;
[[File:Bridge-these-Jumpers-for-flashing-Pico-via-SWD and OCD.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on your raspi do&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd open_mower_ros/utils/scripts/&lt;br /&gt;
sudo ./upload_firmware.sh /path/to/your/firmware.bin&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Neopixel color&lt;br /&gt;
|red&lt;br /&gt;
|during boot&lt;br /&gt;
|-&lt;br /&gt;
|orange - red flashing&lt;br /&gt;
|emergency mode and ros is disconnected&lt;br /&gt;
|-&lt;br /&gt;
|green - red flashing&lt;br /&gt;
|emergency mode and ros is connected&lt;br /&gt;
|-&lt;br /&gt;
|steady green&lt;br /&gt;
|ros is connected and no emergency mode is detected&lt;br /&gt;
(all voltages are OK, wheels aren&#039;t lifted, emergency button is not pressed)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Flashing_firmware_on_the_Pi_Pico&amp;diff=251</id>
		<title>Flashing firmware on the Pi Pico</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Flashing_firmware_on_the_Pi_Pico&amp;diff=251"/>
		<updated>2022-07-22T21:23:11Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Very rudimentary for now - check https://www.youtube.com/watch?v=_bImqD-pQSA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== How to flash the pi pico from the raspberry pi using openocd ==&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Directly copied from a discord conversation&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
use the .bin file if flashing via openocd or the uf2 file for flashing via usb mass storage&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
bridge the jumpers like on the right picture (you can leave them like this during normal operation, the idea is that instead of the jumpers you can use an external debugger on those pins as well)&lt;br /&gt;
[[File:Bridge-these-Jumpers-for-flashing-Pico-via-SWD and OCD.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
on your raspi do&amp;lt;syntaxhighlight lang=&amp;quot;shell&amp;quot;&amp;gt;&lt;br /&gt;
cd open_mower_ros/utils/scripts/&lt;br /&gt;
sudo ./upload_firmware.sh /path/to/your/firmware.elf&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+Neopixel color&lt;br /&gt;
|red&lt;br /&gt;
|during boot&lt;br /&gt;
|-&lt;br /&gt;
|orange - red flashing&lt;br /&gt;
|emergency mode and ros is disconnected&lt;br /&gt;
|-&lt;br /&gt;
|green - red flashing&lt;br /&gt;
|emergency mode and ros is connected&lt;br /&gt;
|-&lt;br /&gt;
|steady green&lt;br /&gt;
|ros is connected and no emergency mode is detected&lt;br /&gt;
(all voltages are OK, wheels aren&#039;t lifted, emergency button is not pressed)&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
	<entry>
		<id>https://wiki.openmower.de/index.php?title=Building_the_Mower&amp;diff=246</id>
		<title>Building the Mower</title>
		<link rel="alternate" type="text/html" href="https://wiki.openmower.de/index.php?title=Building_the_Mower&amp;diff=246"/>
		<updated>2022-07-22T20:53:20Z</updated>

		<summary type="html">&lt;p&gt;Clemens Elflein: /* Bill OF Materials */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the OpenMower Building guide!&lt;br /&gt;
&lt;br /&gt;
Note: This WIKI was only just started on 2022-04-22, but are actively working on filling it up and making a good documentation for the new builders out there!&lt;br /&gt;
&lt;br /&gt;
== Warning ==&lt;br /&gt;
Please note that this project currently is in a very early stage! So don&#039;t go buying stuff right away! You will need to order and solder your own boards, since there are no assembled boards for sale yet.&lt;br /&gt;
&lt;br /&gt;
Please make sure that you&#039;re actually allowed to build this device in your area. There may be laws / patents prohibiting you of doing so!&lt;br /&gt;
&lt;br /&gt;
Please just be responsible and if you&#039;re not sure what you&#039;re doing, please don&#039;t do anything.&lt;br /&gt;
&lt;br /&gt;
BTW the warranty of your brand new mower will obviously be void as soon as you modify it in any way, so be aware.&lt;br /&gt;
&lt;br /&gt;
== Intro ==&lt;br /&gt;
Below you can find an overview of the major parts and components in the OpenMower.&lt;br /&gt;
&lt;br /&gt;
There is a also another page with a [[Builder Road Map|&#039;&#039;&#039;Builder Road Map&#039;&#039;&#039;]] that gives guide to how to go about building your own OpenMower project.&lt;br /&gt;
&lt;br /&gt;
== Bill OF Materials ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;margin:auto&amp;quot;&lt;br /&gt;
|+ Open Mower Bill of Materials&lt;br /&gt;
|-&lt;br /&gt;
! Name !! Description &lt;br /&gt;
!Optional!! Availability !! Quantity Required !! Source Link 1 !! Alternate Source&lt;br /&gt;
|-&lt;br /&gt;
| Mower (Yardforce Classic 500) || Base building block &lt;br /&gt;
| || Off the shelf || 1 ||https://amzn.to/3NWgIxk&lt;br /&gt;
|  &#039;&#039;&#039;Note:&#039;&#039;&#039; Earlier, we had a reference to myrobotcenter. However, they have gone into reconstruction, so be aware of that vendor!&lt;br /&gt;
|-&lt;br /&gt;
| OpenMower Mainboard || The core of the new electronics. &lt;br /&gt;
| || Custom || 1 || [https://octopart.com/bom-tool/ODFKeG8J Components Octopart BOM]&lt;br /&gt;
| WIP&lt;br /&gt;
|-&lt;br /&gt;
| xESC || Motor drivers &lt;br /&gt;
| || Custom || 3 || Components Octoparts BOM:&lt;br /&gt;
- [https://octopart.com/bom-tool/p1aqUopq RP2040 &#039;&#039;without&#039;&#039; CAN]&lt;br /&gt;
&lt;br /&gt;
- [https://octopart.com/bom-tool/tZ27Fd1N RP2040 &#039;&#039;with&#039;&#039; CAN]&lt;br /&gt;
&lt;br /&gt;
- [https://octopart.com/bom-tool/hUY6qiSp STM32] &lt;br /&gt;
|  WIP&lt;br /&gt;
|-&lt;br /&gt;
| Raspebrry Pi 4 || The brain of the robot. Also used to send RTK correction data from the base station.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the base station the Raspberry Pi can be any model with Ethernet and USB, for the robot we need the Raspberry Pi 4 with at least 4 GB of RAM.&lt;br /&gt;
| || Off the shelf || 2 || https://rpilocator.com/?cat=PI4&amp;amp;instock&amp;lt;nowiki/&amp;gt;|| WIP&lt;br /&gt;
|-&lt;br /&gt;
| Ardusimple RTK2B GPS || Positioning system for the bot &lt;br /&gt;
| || Off the shelf || 2 || https://www.ardusimple.com/product/simplertk2b-basic-starter-kit-ip65/ || https://www.ardusimple.com/product/simplertk2b-basic-starter-kit-ip65/&lt;br /&gt;
|-&lt;br /&gt;
| Raspberry Pi Pico|| Microcontroller talking to peripherals, soldered to the OpenMower mainboard&lt;br /&gt;
| ||Off the shelf||1||Widely available||&lt;br /&gt;
|-&lt;br /&gt;
|MPU 9250 (hard to get, end of life) or WT901&lt;br /&gt;
|9-axis accelerometer sitting on Mainboard allowing for direction through compass and dead reckoning of movement between GPS updates.&lt;br /&gt;
|&lt;br /&gt;
|Off the shelf&lt;br /&gt;
|1&lt;br /&gt;
|NO LINKS ANYMORE, since most of the delivered modules are fakes.&lt;br /&gt;
Alternative would be the WT901: &lt;br /&gt;
&lt;br /&gt;
https://amzn.to/3PQsV6O&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|3D printed brackets||To hold the GPS inside the bot&lt;br /&gt;
| ||Custom||1||https://www.printables.com/fr/model/175826-openmower-gps-mount-for-yardforce-classic-500&amp;lt;nowiki/&amp;gt;||WIP&lt;br /&gt;
|-&lt;br /&gt;
|SMA Angle Adapter&lt;br /&gt;
|Needed to connect the GPS without bending the wire too much&lt;br /&gt;
|&lt;br /&gt;
|Off the shelf&lt;br /&gt;
|1&lt;br /&gt;
|https://amzn.to/3K913b1&lt;br /&gt;
|WIP&lt;br /&gt;
|-&lt;br /&gt;
|CC/CV Step Down module&lt;br /&gt;
| As charger for the docking station&lt;br /&gt;
|&lt;br /&gt;
|Off the shelf&lt;br /&gt;
|1&lt;br /&gt;
|https://amzn.to/3NUdRVL&lt;br /&gt;
|WIP&lt;br /&gt;
|-&lt;br /&gt;
|Docking Station Adapter PCB&lt;br /&gt;
|A PCB to hold the module in place.&lt;br /&gt;
|&lt;br /&gt;
|Custom&lt;br /&gt;
|1&lt;br /&gt;
| WIP&lt;br /&gt;
|WIP&lt;br /&gt;
|-&lt;br /&gt;
|GPS PCB&lt;br /&gt;
| A ground plane PCB to improve GPS reception&lt;br /&gt;
|&lt;br /&gt;
|Custom&lt;br /&gt;
|1&lt;br /&gt;
|WIP&lt;br /&gt;
|WIP&lt;br /&gt;
|-&lt;br /&gt;
|USB Angle Adapter&lt;br /&gt;
|If you want to use the Classic 500&#039;s USB port&lt;br /&gt;
|YES&lt;br /&gt;
|Off the shelf&lt;br /&gt;
|1&lt;br /&gt;
|https://amzn.to/3ukNAIj&lt;br /&gt;
|WIP&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Building the bot==&lt;br /&gt;
&lt;br /&gt;
Once you have gathered up all of the parts, components, tools, and have a set of PCB&#039;s, it&#039;s time to start building the OpenMower Robot. &lt;br /&gt;
&lt;br /&gt;
First thing first, watch all of Clemen&#039;s Youtube video&#039;s, and then watch them again. They contain a Treasure Trove of information and should be used as a reference. https://youtu.be/_bImqD-pQSA&lt;br /&gt;
&lt;br /&gt;
Get Organized: Before you start assembling and soldering the PCB&#039;s, it&#039;s recommended to organize all of your parts. One method is to print off the iBOM.html file, tape it to a piece of cardboard, and then put double sided tape next to each line item. Only take out the parts/components you need for (1) xESC at a time, or the parts for the Mainboard, then place them on the double sided tape. Here are a couple of examples:&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:MainBoard-Parts-on-iBOM-wiki.jpg&lt;br /&gt;
File:XESC-Parts-on-iBOM-wiki.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Now you want to apply solder paste to your PCB, BUT, before you apply solder paste to your PCB&#039;s with a stencil, make sure to wipe down both the PCB and the stencil with isopropanol alcohol to clean the surface, this helps more than you would think. Once the IPA has evaporated, align your stencil on top of the PCB, and use masking tape or painters tape on one side to act as a hinge, so after you apply the solder paste, you can carefully remove the stencil. Please reference Clemen&#039;s Youtube video for soldering:  https://youtu.be/Y16kbAK3vaU&lt;br /&gt;
&lt;br /&gt;
Here is an example photo of a PCB after applying the solder paste:&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:SolderPaste-Example.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Make sure to inspect your entire PCB and the alignment of all components before soldering with a hot-plate / oven / hot-air. See the photo below for an example of all xESC (STM32 version) components placed on the top side of the PCB, being inspected before soldering.&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Solder Paste Inspection.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;Here is a photo showing top and bottom of (3) completed xESC boards. (STM32 version)&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:3-xESCs-complete STM32-Version.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
Here is a collection of photos of the OpenMower MainBoard from various Discord Users: (c.ez, vamatis, bhammy187)&amp;lt;gallery&amp;gt;&lt;br /&gt;
File:Test-5V-on-MainBoard.jpg&lt;br /&gt;
File:Vamatis-mainboard-diode-direction-wiki.jpg&lt;br /&gt;
File:Full-power-to-MainBoard.jpg&lt;br /&gt;
File:MB-R11 R12-wiki.jpg&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Setup and test==&lt;/div&gt;</summary>
		<author><name>Clemens Elflein</name></author>
	</entry>
</feed>