<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://tsgdoc.socsci.ru.nl/api.php?action=feedrecentchanges&amp;days=7&amp;feedformat=atom&amp;hideminor=1&amp;limit=50&amp;urlversion=1</id>
	<title>TSG Doc  - Recent changes [en]</title>
	<link rel="self" type="application/atom+xml" href="http://tsgdoc.socsci.ru.nl/api.php?action=feedrecentchanges&amp;days=7&amp;feedformat=atom&amp;hideminor=1&amp;limit=50&amp;urlversion=1"/>
	<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/Special:RecentChanges"/>
	<updated>2026-04-17T12:46:17Z</updated>
	<subtitle>Track the most recent changes to the wiki in this feed.</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation/config&amp;diff=6455&amp;oldid=0</id>
		<title>Module:Documentation/config</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation/config&amp;diff=6455&amp;oldid=0"/>
		<updated>2026-04-16T09:41:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Documentation/config&quot; title=&quot;Module:Documentation/config&quot;&gt;Module:Documentation/config&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;----------------------------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                               Configuration for Module:Documentation&lt;br /&gt;
--&lt;br /&gt;
-- Here you can set the values of the parameters and messages used in Module:Documentation to&lt;br /&gt;
-- localise it to your wiki and your language. Unless specified otherwise, values given here&lt;br /&gt;
-- should be string values.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Do not edit this line.&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Protection template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['protection-reason-edit']&lt;br /&gt;
-- The protection reason for edit-protected templates to pass to&lt;br /&gt;
-- [[Module:Protection banner]].&lt;br /&gt;
cfg['protection-reason-edit'] = 'template'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox notice configuration&lt;br /&gt;
--&lt;br /&gt;
-- On sandbox pages the module can display a template notifying users that the current page is a&lt;br /&gt;
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a&lt;br /&gt;
-- sandbox or not based on the value of cfg['sandbox-subpage']. The following settings configure the&lt;br /&gt;
-- messages that the notices contains.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-notice-image']&lt;br /&gt;
-- The image displayed in the sandbox notice.&lt;br /&gt;
cfg['sandbox-notice-image'] = '[[File:Edit In Sandbox Icon - Color.svg|50px|alt=|link=]]'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-template']&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-module']&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-other']&lt;br /&gt;
-- The page type of the sandbox page. The message that is displayed depends on the current subject&lt;br /&gt;
-- namespace. This message is used in either cfg['sandbox-notice-blurb'] or&lt;br /&gt;
-- cfg['sandbox-notice-diff-blurb'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-pagetype-template'] = '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
cfg['sandbox-notice-pagetype-module'] = '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
cfg['sandbox-notice-pagetype-other'] = 'sandbox page'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-diff-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-diff-display']&lt;br /&gt;
-- Either cfg['sandbox-notice-blurb'] or cfg['sandbox-notice-diff-blurb'] is the opening sentence&lt;br /&gt;
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page&lt;br /&gt;
-- type, which is either cfg['sandbox-notice-pagetype-template'],&lt;br /&gt;
-- cfg['sandbox-notice-pagetype-module'] or cfg['sandbox-notice-pagetype-other'] depending what&lt;br /&gt;
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between&lt;br /&gt;
-- the sandbox and the main template. The display value of the diff link is set by &lt;br /&gt;
-- cfg['sandbox-notice-compare-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-blurb'] = 'This is the $1 for $2.'&lt;br /&gt;
cfg['sandbox-notice-diff-blurb'] = 'This is the $1 for $2 ($3).'&lt;br /&gt;
cfg['sandbox-notice-compare-link-display'] = 'diff'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['sandbox-notice-testcases-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-link-display']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-blurb']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-link-display']&lt;br /&gt;
-- cfg['sandbox-notice-testcases-blurb'] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-link-display'] is the display value for that link.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-blurb'] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test&lt;br /&gt;
-- cases page, and $2 is a link to the page to run it.&lt;br /&gt;
-- cfg['sandbox-notice-testcases-run-link-display'] is the display value for the link to run the test&lt;br /&gt;
-- cases.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['sandbox-notice-testcases-blurb'] = 'See also the companion subpage for $1.'&lt;br /&gt;
cfg['sandbox-notice-testcases-link-display'] = 'test cases'&lt;br /&gt;
cfg['sandbox-notice-testcases-run-blurb'] = 'See also the companion subpage for $1 ($2).'&lt;br /&gt;
cfg['sandbox-notice-testcases-run-link-display'] = 'run'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-category'] - A category to add to all template sandboxes.&lt;br /&gt;
-- cfg['module-sandbox-category'] - A category to add to all module sandboxes.&lt;br /&gt;
-- cfg['module-sandbox-category'] - A category to add to all sandboxe not in templates or modules.&lt;br /&gt;
cfg['sandbox-category'] = 'Template sandboxes'&lt;br /&gt;
cfg['module-sandbox-category'] = 'Module sandboxes'&lt;br /&gt;
cfg['other-sandbox-category'] = 'Sandboxes outside of template or module namespace'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Start box configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['documentation-icon-wikitext']&lt;br /&gt;
-- The wikitext for the icon shown at the top of the template.&lt;br /&gt;
cfg['documentation-icon-wikitext'] = '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-namespace-heading']&lt;br /&gt;
-- The heading shown in the template namespace.&lt;br /&gt;
cfg['template-namespace-heading'] = 'Template documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-namespace-heading']&lt;br /&gt;
-- The heading shown in the module namespace.&lt;br /&gt;
cfg['module-namespace-heading'] = 'Module documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['file-namespace-heading']&lt;br /&gt;
-- The heading shown in the file namespace.&lt;br /&gt;
cfg['file-namespace-heading'] = 'Summary'&lt;br /&gt;
&lt;br /&gt;
-- cfg['other-namespaces-heading']&lt;br /&gt;
-- The heading shown in other namespaces.&lt;br /&gt;
cfg['other-namespaces-heading'] = 'Documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['view-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;view&amp;quot; links.&lt;br /&gt;
cfg['view-link-display'] = 'view'&lt;br /&gt;
&lt;br /&gt;
-- cfg['edit-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['history-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;history&amp;quot; links.&lt;br /&gt;
cfg['history-link-display'] = 'history'&lt;br /&gt;
&lt;br /&gt;
-- cfg['purge-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;purge&amp;quot; links.&lt;br /&gt;
cfg['purge-link-display'] = 'purge'&lt;br /&gt;
&lt;br /&gt;
-- cfg['create-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Link box (end box) configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['transcluded-from-blurb']&lt;br /&gt;
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.&lt;br /&gt;
cfg['transcluded-from-blurb'] = 'The above [[Wikipedia:Template documentation|documentation]] is [[Help:Transclusion|transcluded]] from $1.'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['create-module-doc-blurb']&lt;br /&gt;
-- Notice displayed in the module namespace when the documentation subpage does not exist.&lt;br /&gt;
-- $1 is a link to create the documentation page with the preload cfg['module-preload'] and the&lt;br /&gt;
-- display cfg['create-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['create-module-doc-blurb'] = 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Experiment blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['experiment-blurb-template']&lt;br /&gt;
-- cfg['experiment-blurb-module']&lt;br /&gt;
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.&lt;br /&gt;
-- It is only shown in the template and module namespaces. With the default English settings, it&lt;br /&gt;
-- might look like this:&lt;br /&gt;
--&lt;br /&gt;
-- Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&lt;br /&gt;
--&lt;br /&gt;
-- In this example, &amp;quot;sandbox&amp;quot;, &amp;quot;edit&amp;quot;, &amp;quot;diff&amp;quot;, &amp;quot;testcases&amp;quot;, and &amp;quot;edit&amp;quot; would all be links.&lt;br /&gt;
--&lt;br /&gt;
-- There are two versions, cfg['experiment-blurb-template'] and cfg['experiment-blurb-module'], depending&lt;br /&gt;
-- on what namespace we are in.&lt;br /&gt;
-- &lt;br /&gt;
-- Parameters:&lt;br /&gt;
--&lt;br /&gt;
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['sandbox-link-display'] (cfg['sandbox-edit-link-display'] | cfg['compare-link-display'])&lt;br /&gt;
-- &lt;br /&gt;
-- If the sandbox doesn't exist, it is in the format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['sandbox-link-display'] (cfg['sandbox-create-link-display'] | cfg['mirror-link-display'])&lt;br /&gt;
-- &lt;br /&gt;
-- The link for cfg['sandbox-create-link-display'] link preloads the page with cfg['template-sandbox-preload']&lt;br /&gt;
-- or cfg['module-sandbox-preload'], depending on the current namespace. The link for cfg['mirror-link-display']&lt;br /&gt;
-- loads a default edit summary of cfg['mirror-edit-summary'].&lt;br /&gt;
--&lt;br /&gt;
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg['testcases-link-display'] (cfg['testcases-edit-link-display'] | cfg['testcases-run-link-display'])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn't exist, it is in the format:&lt;br /&gt;
-- &lt;br /&gt;
--     cfg['testcases-link-display'] (cfg['testcases-create-link-display'])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn't exist, the link for cfg['testcases-create-link-display'] preloads the&lt;br /&gt;
-- page with cfg['template-testcases-preload'] or cfg['module-testcases-preload'], depending on the current&lt;br /&gt;
-- namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['experiment-blurb-template'] = &amp;quot;Editors can experiment in this template's $1 and $2 pages.&amp;quot;&lt;br /&gt;
cfg['experiment-blurb-module'] = &amp;quot;Editors can experiment in this module's $1 and $2 pages.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-subpage']&lt;br /&gt;
-- The name of the template subpage typically used for sandboxes.&lt;br /&gt;
cfg['sandbox-subpage'] = 'sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-sandbox-preload']&lt;br /&gt;
-- Preload file for template sandbox pages.&lt;br /&gt;
cfg['template-sandbox-preload'] = 'Template:Documentation/preload-sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-sandbox-preload']&lt;br /&gt;
-- Preload file for Lua module sandbox pages.&lt;br /&gt;
cfg['module-sandbox-preload'] = 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;sandbox&amp;quot; links.&lt;br /&gt;
cfg['sandbox-link-display'] = 'sandbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-edit-link-display']&lt;br /&gt;
-- The text to display for sandbox &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['sandbox-edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['sandbox-create-link-display']&lt;br /&gt;
-- The text to display for sandbox &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['sandbox-create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
-- cfg['compare-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;compare&amp;quot; links.&lt;br /&gt;
cfg['compare-link-display'] = 'diff'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-edit-summary']&lt;br /&gt;
-- The default edit summary to use when a user clicks the &amp;quot;mirror&amp;quot; link. $1 is a wikilink to the&lt;br /&gt;
-- template page.&lt;br /&gt;
cfg['mirror-edit-summary'] = 'Create sandbox version of $1'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;mirror&amp;quot; links.&lt;br /&gt;
cfg['mirror-link-display'] = 'mirror'&lt;br /&gt;
&lt;br /&gt;
-- cfg['mirror-link-preload']&lt;br /&gt;
-- The page to preload when a user clicks the &amp;quot;mirror&amp;quot; link.&lt;br /&gt;
cfg['mirror-link-preload'] = 'Template:Documentation/mirror'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Test cases link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-subpage']&lt;br /&gt;
-- The name of the template subpage typically used for test cases.&lt;br /&gt;
cfg['testcases-subpage'] = 'testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-testcases-preload']&lt;br /&gt;
-- Preload file for template test cases pages.&lt;br /&gt;
cfg['template-testcases-preload'] = 'Template:Documentation/preload-testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-testcases-preload']&lt;br /&gt;
-- Preload file for Lua module test cases pages.&lt;br /&gt;
cfg['module-testcases-preload'] = 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-link-display']&lt;br /&gt;
-- The text to display for &amp;quot;testcases&amp;quot; links.&lt;br /&gt;
cfg['testcases-link-display'] = 'testcases'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-edit-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg['testcases-edit-link-display'] = 'edit'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-run-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;run&amp;quot; links.&lt;br /&gt;
cfg['testcases-run-link-display'] = 'run'&lt;br /&gt;
&lt;br /&gt;
-- cfg['testcases-create-link-display']&lt;br /&gt;
-- The text to display for test cases &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg['testcases-create-link-display'] = 'create'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Add categories blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['add-categories-blurb']&lt;br /&gt;
-- Text to direct users to add categories to the /doc subpage. Not used if the &amp;quot;content&amp;quot; or&lt;br /&gt;
-- &amp;quot;docname fed&amp;quot; arguments are set, as then it is not clear where to add the categories. $1 is a&lt;br /&gt;
-- link to the /doc subpage with a display value of cfg['doc-link-display'].&lt;br /&gt;
--]]&lt;br /&gt;
cfg['add-categories-blurb'] = 'Add categories to the $1 subpage.'&lt;br /&gt;
&lt;br /&gt;
-- cfg['doc-link-display']&lt;br /&gt;
-- The text to display when linking to the /doc subpage.&lt;br /&gt;
cfg['doc-link-display'] = '/doc'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Subpages link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['subpages-blurb']&lt;br /&gt;
-- The &amp;quot;Subpages of this template&amp;quot; blurb. $1 is a link to the main template's subpages with a&lt;br /&gt;
-- display value of cfg['subpages-link-display']. In the English version this blurb is simply&lt;br /&gt;
-- the link followed by a period, and the link display provides the actual text.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['subpages-blurb'] = '$1.'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg['subpages-link-display']&lt;br /&gt;
-- The text to display for the &amp;quot;subpages of this page&amp;quot; link. $1 is cfg['template-pagetype'],&lt;br /&gt;
-- cfg['module-pagetype'] or cfg['default-pagetype'], depending on whether the current page is in&lt;br /&gt;
-- the template namespace, the module namespace, or another namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg['subpages-link-display'] = 'Subpages of this $1'&lt;br /&gt;
&lt;br /&gt;
-- cfg['template-pagetype']&lt;br /&gt;
-- The pagetype to display for template pages.&lt;br /&gt;
cfg['template-pagetype'] = 'template'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-pagetype']&lt;br /&gt;
-- The pagetype to display for Lua module pages.&lt;br /&gt;
cfg['module-pagetype'] = 'module'&lt;br /&gt;
&lt;br /&gt;
-- cfg['default-pagetype']&lt;br /&gt;
-- The pagetype to display for pages other than templates or Lua modules.&lt;br /&gt;
cfg['default-pagetype'] = 'page'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Doc link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['doc-subpage']&lt;br /&gt;
-- The name of the subpage typically used for documentation pages.&lt;br /&gt;
cfg['doc-subpage'] = 'doc'&lt;br /&gt;
&lt;br /&gt;
-- cfg['docpage-preload']&lt;br /&gt;
-- Preload file for template documentation pages in all namespaces.&lt;br /&gt;
cfg['docpage-preload'] = 'Template:Documentation/preload'&lt;br /&gt;
&lt;br /&gt;
-- cfg['module-preload']&lt;br /&gt;
-- Preload file for Lua module documentation pages.&lt;br /&gt;
cfg['module-preload'] = 'Template:Documentation/preload-module-doc'&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- HTML and CSS configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['templatestyles']&lt;br /&gt;
-- The name of the TemplateStyles page where CSS is kept.&lt;br /&gt;
-- Sandbox CSS will be at Module:Documentation/sandbox/styles.css when needed.&lt;br /&gt;
cfg['templatestyles'] = 'Module:Documentation/styles.css'&lt;br /&gt;
&lt;br /&gt;
-- cfg['container']&lt;br /&gt;
-- Class which can be used to set flex or grid CSS on the&lt;br /&gt;
-- two child divs documentation and documentation-metadata&lt;br /&gt;
cfg['container'] = 'documentation-container'&lt;br /&gt;
&lt;br /&gt;
-- cfg['main-div-classes']&lt;br /&gt;
-- Classes added to the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg['main-div-classes'] = 'documentation'&lt;br /&gt;
&lt;br /&gt;
-- cfg['main-div-heading-class']&lt;br /&gt;
-- Class for the main heading for templates and modules and assoc. talk spaces&lt;br /&gt;
cfg['main-div-heading-class'] = 'documentation-heading'&lt;br /&gt;
&lt;br /&gt;
-- cfg['start-box-class']&lt;br /&gt;
-- Class for the start box&lt;br /&gt;
cfg['start-box-class'] = 'documentation-startbox'&lt;br /&gt;
&lt;br /&gt;
-- cfg['start-box-link-classes']&lt;br /&gt;
-- Classes used for the [view][edit][history] or [create] links in the start box.&lt;br /&gt;
-- mw-editsection-like is per [[Wikipedia:Village pump (technical)/Archive 117]]&lt;br /&gt;
cfg['start-box-link-classes'] = 'mw-editsection-like plainlinks'&lt;br /&gt;
&lt;br /&gt;
-- cfg['end-box-class']&lt;br /&gt;
-- Class for the end box.&lt;br /&gt;
cfg['end-box-class'] = 'documentation-metadata'&lt;br /&gt;
&lt;br /&gt;
-- cfg['end-box-plainlinks']&lt;br /&gt;
-- Plainlinks&lt;br /&gt;
cfg['end-box-plainlinks'] = 'plainlinks'&lt;br /&gt;
&lt;br /&gt;
-- cfg['toolbar-class']&lt;br /&gt;
-- Class added for toolbar links.&lt;br /&gt;
cfg['toolbar-class'] = 'documentation-toolbar'&lt;br /&gt;
&lt;br /&gt;
-- cfg['clear']&lt;br /&gt;
-- Just used to clear things.&lt;br /&gt;
cfg['clear'] = 'documentation-clear'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking category configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg['display-strange-usage-category']&lt;br /&gt;
-- Set to true to enable output of cfg['strange-usage-category'] if the module is used on a /doc subpage&lt;br /&gt;
-- or a /testcases subpage. This should be a boolean value (either true or false).&lt;br /&gt;
cfg['display-strange-usage-category'] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg['strange-usage-category']&lt;br /&gt;
-- Category to output if cfg['display-strange-usage-category'] is set to true and the module is used on a&lt;br /&gt;
-- /doc subpage or a /testcases subpage.&lt;br /&gt;
cfg['strange-usage-category'] = 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--&lt;br /&gt;
-- Don't edit anything below this line.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
return cfg&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6453&amp;oldid=0</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6453&amp;oldid=0"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Documentation&quot; title=&quot;Module:Documentation&quot;&gt;Module:Documentation&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;a href=&quot;http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;amp;diff=6453&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Documentation&amp;diff=6451&amp;oldid=0</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Documentation&amp;diff=6451&amp;oldid=0"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Documentation&quot; title=&quot;Template:Documentation&quot;&gt;Template:Documentation&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Mdash&amp;diff=6449&amp;oldid=0</id>
		<title>Template:Mdash</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Mdash&amp;diff=6449&amp;oldid=0"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Mdash&quot; class=&quot;mw-redirect&quot; title=&quot;Template:Mdash&quot;&gt;Template:Mdash&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;#REDIRECT [[Template:Em dash]]&lt;br /&gt;
&lt;br /&gt;
{{Redirect category shell|&lt;br /&gt;
{{R from short name}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em_dash&amp;diff=6447&amp;oldid=0</id>
		<title>Template:Em dash</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em_dash&amp;diff=6447&amp;oldid=0"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Em_dash&quot; title=&quot;Template:Em dash&quot;&gt;Template:Em dash&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;—&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Uploader_information&amp;diff=6445&amp;oldid=0</id>
		<title>Template:Uploader information</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Uploader_information&amp;diff=6445&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Uploader_information&quot; title=&quot;Template:Uploader information&quot;&gt;Template:Uploader information&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#invoke:Message box|imbox&lt;br /&gt;
| type  = notice&lt;br /&gt;
| image = [[File:Ambox warning blue.svg|50px|alt=Attention|link=]]&lt;br /&gt;
| style = background: var(--background-color-progressive-subtle, #f1f4fd); color:inherit;&lt;br /&gt;
|text = '''To the uploader''':&lt;br /&gt;
# Please add a detailed '''[[Wikipedia:Non-free use rationale guideline|non-free use rationale]]''' for each article the image is used in, which must also declare compliance with the other parts of the non-free content criteria, as well as the '''source''' of the work and '''copyright information'''.&lt;br /&gt;
# For example non-free use rationales, see [[Wikipedia:Use rationale examples]].&lt;br /&gt;
{{{additional notes|}}}&lt;br /&gt;
''' To patrollers and administrators''': If this image has an {{em|appropriate}} rationale please append {{para|image has rationale|yes}} as a parameter to the license template.}}{{file other|[[Category:Wikipedia non-free files for NFUR review]]}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Imbox&amp;diff=6443&amp;oldid=0</id>
		<title>Template:Imbox</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Imbox&amp;diff=6443&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Imbox&quot; title=&quot;Template:Imbox&quot;&gt;Template:Imbox&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{#invoke:Message box|imbox}}&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>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_media&amp;diff=6441&amp;oldid=0</id>
		<title>Template:Non-free media</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_media&amp;diff=6441&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Non-free_media&quot; title=&quot;Template:Non-free media&quot;&gt;Template:Non-free media&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{file other   &amp;lt;!-- Only categorise when on image pages. --&amp;gt;&lt;br /&gt;
| [[Category:All non-free media]]{{#ifeq:{{{metadata}}}|no||&amp;lt;div class=&amp;quot;licensetpl&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;&amp;lt;div class=&amp;quot;licensetpl_short&amp;quot;&amp;gt;Fair use&amp;lt;/div&amp;gt;&amp;lt;div class=&amp;quot;licensetpl_nonfree&amp;quot;&amp;gt;true&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;}}__NOINDEX__&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage; interwikis go to Wikidata, thank you! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Para&amp;diff=6439&amp;oldid=0</id>
		<title>Template:Para</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Para&amp;diff=6439&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Para&quot; title=&quot;Template:Para&quot;&gt;Template:Para&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{{Requested move notice|1=TM:parameter|2=Template talk:Para#Requested move 12 April 2026}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&amp;lt;code class=&amp;quot;tpl-para&amp;quot; style=&amp;quot;word-break:break-word;{{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{plain|}}}|border: none; background-color: inherit;}} {{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{plain|}}}{{{mxt|}}}{{{green|}}}{{{!mxt|}}}{{{red|}}}|color: {{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{mxt|}}}{{{green|}}}|#006400|{{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{!mxt|}}}{{{red|}}}|#8B0000|inherit}}}};}} {{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{style|}}}|{{{style}}}}}&amp;quot;&amp;gt;&amp;amp;#124;{{SAFESUBST:&amp;lt;noinclude /&amp;gt;#if:{{{1|}}}|{{{1}}}&amp;amp;#61;}}{{{2|}}}&amp;lt;/code&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!--Categories and interwikis go near the bottom of the /doc subpage.--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Yesno-no&amp;diff=6437&amp;oldid=0</id>
		<title>Template:Yesno-no</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Yesno-no&amp;diff=6437&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Yesno-no&quot; title=&quot;Template:Yesno-no&quot;&gt;Template:Yesno-no&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{safesubst:&amp;lt;noinclude /&amp;gt;yesno|{{{1}}}|yes={{{yes|yes}}}|no={{{no|no}}}|blank={{{blank|no}}}|¬={{{¬|no}}}|def={{{def|no}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation|Template:Yesno/doc}}&lt;br /&gt;
&amp;lt;!--Categories go in the doc page referenced above; interwikis go in Wikidata.--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em&amp;diff=6435&amp;oldid=0</id>
		<title>Template:Em</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em&amp;diff=6435&amp;oldid=0"/>
		<updated>2026-04-16T09:41:45Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Em&quot; title=&quot;Template:Em&quot;&gt;Template:Em&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;em {{#if:{{{role|}}}|role=&amp;quot;{{{role}}}&amp;quot;}} {{#if:{{{class|}}}|class=&amp;quot;{{{class}}}&amp;quot;}} {{#if:{{{id|}}}|id=&amp;quot;{{{id}}}&amp;quot;}} {{#if:{{{style|}}}|style=&amp;quot;{{{style}}}&amp;quot;}} {{#if:{{{title|}}}|title=&amp;quot;{{{title}}}&amp;quot;}}&amp;gt;{{{1}}}&amp;lt;/em&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage, interwikis to Wikidata, not here --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner/config&amp;diff=6433&amp;oldid=0</id>
		<title>Module:Protection banner/config</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner/config&amp;diff=6433&amp;oldid=0"/>
		<updated>2026-04-16T09:41:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Protection_banner/config&quot; title=&quot;Module:Protection banner/config&quot;&gt;Module:Protection banner/config&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;a href=&quot;http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner/config&amp;amp;diff=6433&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner&amp;diff=6431&amp;oldid=0</id>
		<title>Module:Protection banner</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner&amp;diff=6431&amp;oldid=0"/>
		<updated>2026-04-16T09:41:44Z</updated>

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

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:File_link&quot; title=&quot;Module:File link&quot;&gt;Module:File link&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module provides a library for formatting file wikilinks.&lt;br /&gt;
&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
local checkType = require('libraryUtil').checkType&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	checkType('_main', 1, args, 'table')&lt;br /&gt;
&lt;br /&gt;
	-- This is basically libraryUtil.checkTypeForNamedArg, but we are rolling our&lt;br /&gt;
	-- own function to get the right error level.&lt;br /&gt;
	local function checkArg(key, val, level)&lt;br /&gt;
		if type(val) ~= 'string' then&lt;br /&gt;
			error(string.format(&lt;br /&gt;
				&amp;quot;type error in '%s' parameter of '_main' (expected string, got %s)&amp;quot;,&lt;br /&gt;
				key, type(val)&lt;br /&gt;
			), level)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret = {}&lt;br /&gt;
&lt;br /&gt;
	-- Adds a positional parameter to the buffer.&lt;br /&gt;
	local function addPositional(key)&lt;br /&gt;
		local val = args[key]&lt;br /&gt;
		if not val then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		checkArg(key, val, 4)&lt;br /&gt;
		ret[#ret + 1] = val&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Adds a named parameter to the buffer. We assume that the parameter name&lt;br /&gt;
	-- is the same as the argument key.&lt;br /&gt;
	local function addNamed(key)&lt;br /&gt;
		local val = args[key]&lt;br /&gt;
		if not val then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		checkArg(key, val, 4)&lt;br /&gt;
		ret[#ret + 1] = key .. '=' .. val&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Filename&lt;br /&gt;
	checkArg('file', args.file, 3)&lt;br /&gt;
	ret[#ret + 1] = 'File:' .. args.file&lt;br /&gt;
&lt;br /&gt;
	-- Format&lt;br /&gt;
	if args.format then&lt;br /&gt;
		checkArg('format', args.format)&lt;br /&gt;
		if args.formatfile then&lt;br /&gt;
			checkArg('formatfile', args.formatfile)&lt;br /&gt;
			ret[#ret + 1] = args.format .. '=' .. args.formatfile&lt;br /&gt;
		else&lt;br /&gt;
			ret[#ret + 1] = args.format&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Border&lt;br /&gt;
	if yesno(args.border) then&lt;br /&gt;
		ret[#ret + 1] = 'border'&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	addPositional('location')&lt;br /&gt;
	addPositional('alignment')&lt;br /&gt;
	addPositional('size')&lt;br /&gt;
	addNamed('upright')&lt;br /&gt;
	addNamed('link')&lt;br /&gt;
	addNamed('alt')&lt;br /&gt;
	addNamed('page')&lt;br /&gt;
	addNamed('class')&lt;br /&gt;
	addNamed('lang')&lt;br /&gt;
	addNamed('start')&lt;br /&gt;
	addNamed('end')&lt;br /&gt;
	addNamed('thumbtime')&lt;br /&gt;
	addPositional('caption')&lt;br /&gt;
&lt;br /&gt;
	return string.format('[[%s]]', table.concat(ret, '|'))&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local origArgs = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
		wrappers = 'Template:File link'&lt;br /&gt;
	})&lt;br /&gt;
	if not origArgs.file then&lt;br /&gt;
		error(&amp;quot;'file' parameter missing from [[Template:File link]]&amp;quot;, 0)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Copy the arguments that were passed to a new table to avoid looking up&lt;br /&gt;
	-- every possible parameter in the frame object.&lt;br /&gt;
	local args = {}&lt;br /&gt;
	for k, v in pairs(origArgs) do&lt;br /&gt;
		-- Make _BLANK a special argument to add a blank parameter. For use in&lt;br /&gt;
		-- conditional templates etc. it is useful for blank arguments to be&lt;br /&gt;
		-- ignored, but we still need a way to specify them so that we can do&lt;br /&gt;
		-- things like [[File:Example.png|link=]].&lt;br /&gt;
		if v == '_BLANK' then&lt;br /&gt;
			v = ''&lt;br /&gt;
		end&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Effective_protection_level&amp;diff=6427&amp;oldid=0</id>
		<title>Module:Effective protection level</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Effective_protection_level&amp;diff=6427&amp;oldid=0"/>
		<updated>2026-04-16T09:41:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Effective_protection_level&quot; title=&quot;Module:Effective protection level&quot;&gt;Module:Effective protection level&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
-- Returns the permission required to perform a given action on a given title.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == 'table' and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action == 'autoreview' then&lt;br /&gt;
		local level = mw.ext.FlaggedRevs.getStabilitySettings(title)&lt;br /&gt;
		level = level and level.autoreview&lt;br /&gt;
		if level == 'review' then&lt;br /&gt;
			return 'reviewer'&lt;br /&gt;
		elseif level ~= '' then&lt;br /&gt;
			return level&lt;br /&gt;
		else&lt;br /&gt;
			return nil -- not '*'. a page not being PC-protected is distinct from it being PC-protected with anyone able to review. also not '', as that would mean PC-protected but nobody can review&lt;br /&gt;
		end&lt;br /&gt;
	elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' and action ~= 'undelete' then&lt;br /&gt;
		error( 'First parameter must be one of edit, move, create, upload, undelete, autoreview', 2 )&lt;br /&gt;
	end&lt;br /&gt;
	if title.namespace == 8 then -- MediaWiki namespace&lt;br /&gt;
		if title.text:sub(-3) == '.js' or title.text:sub(-4) == '.css' or title.contentModel == 'javascript' or title.contentModel == 'css' then -- site JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		elseif title.baseText == &amp;quot;Gadgets-definition&amp;quot; then&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		else -- any non-JS/CSS MediaWiki page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	elseif title.namespace == 2 and title.isSubpage then&lt;br /&gt;
		if title.contentModel == 'javascript' or title.contentModel == 'css' then -- user JS or CSS page&lt;br /&gt;
			return 'interfaceadmin'&lt;br /&gt;
		elseif title.contentModel == 'json' then -- user JSON page&lt;br /&gt;
			return 'sysop'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if action == 'undelete' then&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	end&lt;br /&gt;
	local level = title.protectionLevels[action] and title.protectionLevels[action][1]&lt;br /&gt;
	if level == 'sysop' or level == 'editprotected' then&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif title.cascadingProtection.restrictions[action] and title.cascadingProtection.restrictions[action][1] then -- used by a cascading-protected page&lt;br /&gt;
		return 'sysop'&lt;br /&gt;
	elseif level == 'templateeditor' then&lt;br /&gt;
		return 'templateeditor'&lt;br /&gt;
	elseif action == 'move' then&lt;br /&gt;
		local blacklistentry = mw.ext.TitleBlacklist.test('edit', pagename) -- Testing action edit is correct, since this is for the source page. The target page name gets tested with action move.&lt;br /&gt;
		if blacklistentry and not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'templateeditor'&lt;br /&gt;
		elseif title.namespace == 6 then&lt;br /&gt;
			return 'filemover'&lt;br /&gt;
		elseif level == 'extendedconfirmed' then&lt;br /&gt;
			return 'extendedconfirmed'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local blacklistentry = mw.ext.TitleBlacklist.test(action, pagename)&lt;br /&gt;
	if blacklistentry then&lt;br /&gt;
		if not blacklistentry.params.autoconfirmed then&lt;br /&gt;
			return 'templateeditor'&lt;br /&gt;
		elseif level == 'extendedconfirmed' then&lt;br /&gt;
			return 'extendedconfirmed'&lt;br /&gt;
		else&lt;br /&gt;
			return 'autoconfirmed'&lt;br /&gt;
		end&lt;br /&gt;
	elseif level == 'editsemiprotected' then -- create-semiprotected pages return this for some reason&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	elseif level then&lt;br /&gt;
		return level&lt;br /&gt;
	elseif action == 'upload' then&lt;br /&gt;
		return 'autoconfirmed'&lt;br /&gt;
	elseif action == 'create' and title.namespace % 2 == 0 and title.namespace ~= 118 then -- You need to be registered, but not autoconfirmed, to create non-talk pages other than drafts&lt;br /&gt;
		if title.namespace == 0 then&lt;br /&gt;
			return 'autoconfirmed' -- Per [[WP:ACPERM]], you need to be autoconfirmed to create pages in mainspace&lt;br /&gt;
		end&lt;br /&gt;
		return 'user'&lt;br /&gt;
	else&lt;br /&gt;
		return '*'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Effective_protection_expiry&amp;diff=6425&amp;oldid=0</id>
		<title>Module:Effective protection expiry</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Effective_protection_expiry&amp;diff=6425&amp;oldid=0"/>
		<updated>2026-04-16T09:41:43Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Effective_protection_expiry&quot; title=&quot;Module:Effective protection expiry&quot;&gt;Module:Effective protection expiry&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Returns the expiry of a restriction of an action on a given title, or unknown if it cannot be known.&lt;br /&gt;
-- If no title is specified, the title of the page being displayed is used.&lt;br /&gt;
function p._main(action, pagename)&lt;br /&gt;
	local title&lt;br /&gt;
	if type(pagename) == 'table' and pagename.prefixedText then&lt;br /&gt;
		title = pagename&lt;br /&gt;
	elseif pagename then&lt;br /&gt;
		title = mw.title.new(pagename)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.title.getCurrentTitle()&lt;br /&gt;
	end&lt;br /&gt;
	pagename = title.prefixedText&lt;br /&gt;
	if action == 'autoreview' then&lt;br /&gt;
		local stabilitySettings = mw.ext.FlaggedRevs.getStabilitySettings(title)&lt;br /&gt;
		return stabilitySettings and stabilitySettings.expiry or 'unknown'&lt;br /&gt;
	elseif action ~= 'edit' and action ~= 'move' and action ~= 'create' and action ~= 'upload' then&lt;br /&gt;
		error( 'First parameter must be one of edit, move, create, upload, autoreview', 2 )&lt;br /&gt;
	end&lt;br /&gt;
	local rawExpiry = mw.getCurrentFrame():callParserFunction('PROTECTIONEXPIRY', action, pagename)&lt;br /&gt;
	if rawExpiry == 'infinity' then&lt;br /&gt;
		return 'infinity'&lt;br /&gt;
	elseif rawExpiry == '' then&lt;br /&gt;
		return 'unknown'&lt;br /&gt;
	else&lt;br /&gt;
		local year, month, day, hour, minute, second = rawExpiry:match(&lt;br /&gt;
			'^(%d%d%d%d)(%d%d)(%d%d)(%d%d)(%d%d)(%d%d)$'&lt;br /&gt;
		)&lt;br /&gt;
		if year then&lt;br /&gt;
			return string.format(&lt;br /&gt;
				'%s-%s-%sT%s:%s:%s',&lt;br /&gt;
				year, month, day, hour, minute, second&lt;br /&gt;
			)&lt;br /&gt;
		else&lt;br /&gt;
			error('internal error in Module:Effective protection expiry; malformed expiry timestamp')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
setmetatable(p, { __index = function(t, k)&lt;br /&gt;
	return function(frame)&lt;br /&gt;
		return t._main(k, frame.args[1])&lt;br /&gt;
	end&lt;br /&gt;
end })&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/blacklist&amp;diff=6423&amp;oldid=0</id>
		<title>Module:Category handler/blacklist</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/blacklist&amp;diff=6423&amp;oldid=0"/>
		<updated>2026-04-16T09:41:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Category_handler/blacklist&quot; title=&quot;Module:Category handler/blacklist&quot;&gt;Module:Category handler/blacklist&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module contains the blacklist used by [[Module:Category handler]].&lt;br /&gt;
-- Pages that match Lua patterns in this list will not be categorised unless&lt;br /&gt;
-- categorisation is explicitly requested.&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	'^Main Page$', -- don't categorise the main page.&lt;br /&gt;
&lt;br /&gt;
	-- Don't categorise the following pages or their subpages.&lt;br /&gt;
	-- &amp;quot;%f[/\0]&amp;quot; matches if the next character is &amp;quot;/&amp;quot; or the end of the string.&lt;br /&gt;
	'^Wikipedia:Cascade%-protected items%f[/\0]',&lt;br /&gt;
	'^User:UBX%f[/\0]', -- The userbox &amp;quot;template&amp;quot; space.&lt;br /&gt;
	'^User talk:UBX%f[/\0]',&lt;br /&gt;
&lt;br /&gt;
	-- Don't categorise subpages of these pages, but allow&lt;br /&gt;
	-- categorisation of the base page.&lt;br /&gt;
	'^Wikipedia:Template index/.*$',&lt;br /&gt;
&lt;br /&gt;
	-- Don't categorise archives.&lt;br /&gt;
	'/[aA]rchive',&lt;br /&gt;
	&amp;quot;^Wikipedia:Administrators' noticeboard/IncidentArchive%d+$&amp;quot;,&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/shared&amp;diff=6421&amp;oldid=0</id>
		<title>Module:Category handler/shared</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/shared&amp;diff=6421&amp;oldid=0"/>
		<updated>2026-04-16T09:41:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Category_handler/shared&quot; title=&quot;Module:Category handler/shared&quot;&gt;Module:Category handler/shared&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module contains shared functions used by [[Module:Category handler]]&lt;br /&gt;
-- and its submodules.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.matchesBlacklist(page, blacklist)&lt;br /&gt;
	for i, pattern in ipairs(blacklist) do&lt;br /&gt;
		local match = mw.ustring.match(page, pattern)&lt;br /&gt;
		if match then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getParamMappings(useLoadData)&lt;br /&gt;
	local dataPage = 'Module:Namespace detect/data'&lt;br /&gt;
	if useLoadData then&lt;br /&gt;
		return mw.loadData(dataPage).mappings&lt;br /&gt;
	else&lt;br /&gt;
		return require(dataPage).mappings&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.getNamespaceParameters(titleObj, mappings)&lt;br /&gt;
	-- We don't use title.nsText for the namespace name because it adds&lt;br /&gt;
	-- underscores.&lt;br /&gt;
	local mappingsKey&lt;br /&gt;
	if titleObj.isTalkPage then&lt;br /&gt;
		mappingsKey = 'talk'&lt;br /&gt;
	else&lt;br /&gt;
		mappingsKey = mw.site.namespaces[titleObj.namespace].name&lt;br /&gt;
	end&lt;br /&gt;
	mappingsKey = mw.ustring.lower(mappingsKey)&lt;br /&gt;
	return mappings[mappingsKey] or {}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/config&amp;diff=6419&amp;oldid=0</id>
		<title>Module:Category handler/config</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/config&amp;diff=6419&amp;oldid=0"/>
		<updated>2026-04-16T09:41:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Category_handler/config&quot; title=&quot;Module:Category handler/config&quot;&gt;Module:Category handler/config&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--            [[Module:Category handler]] configuration data                  --&lt;br /&gt;
--       Language-specific parameter names and values can be set here.        --&lt;br /&gt;
--       For blacklist config, see [[Module:Category handler/blacklist]].     --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Don't edit this line.&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                       Start configuration data                             --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                              Parameter names                               --&lt;br /&gt;
-- These configuration items specify custom parameter names.                  --&lt;br /&gt;
-- To add one extra name, you can use this format:                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- foo = 'parameter name',                                                    --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- To add multiple names, you can use this format:                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'},        --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
cfg.parameters = {&lt;br /&gt;
	&lt;br /&gt;
	-- The nocat and categories parameter suppress&lt;br /&gt;
	-- categorisation. They are used with Module:Yesno, and work as follows:&lt;br /&gt;
	--&lt;br /&gt;
	-- cfg.nocat:&lt;br /&gt;
	-- Result of yesno()                        Effect&lt;br /&gt;
	-- true                                     Categorisation is suppressed&lt;br /&gt;
	-- false                                    Categorisation is allowed, and&lt;br /&gt;
	--                                          the blacklist check is skipped&lt;br /&gt;
	-- nil                                      Categorisation is allowed&lt;br /&gt;
	--&lt;br /&gt;
	-- cfg.categories:&lt;br /&gt;
	-- Result of yesno()                        Effect&lt;br /&gt;
	-- true                                     Categorisation is allowed, and&lt;br /&gt;
	--                                          the blacklist check is skipped&lt;br /&gt;
	-- false                                    Categorisation is suppressed&lt;br /&gt;
	-- nil                                      Categorisation is allowed&lt;br /&gt;
	nocat = 'nocat',&lt;br /&gt;
	categories = 'categories',&lt;br /&gt;
	&lt;br /&gt;
	-- The parameter name for the legacy &amp;quot;category2&amp;quot; parameter. This skips the&lt;br /&gt;
	-- blacklist if set to the cfg.category2Yes value, and suppresses&lt;br /&gt;
	-- categorisation if present but equal to anything other than&lt;br /&gt;
	-- cfg.category2Yes or cfg.category2Negative.&lt;br /&gt;
	category2 = 'category2',&lt;br /&gt;
	&lt;br /&gt;
	-- cfg.subpage is the parameter name to specify how to behave on subpages.&lt;br /&gt;
	subpage = 'subpage',&lt;br /&gt;
	&lt;br /&gt;
	-- The parameter for data to return in all namespaces.&lt;br /&gt;
	all = 'all',&lt;br /&gt;
	&lt;br /&gt;
	-- The parameter name for data to return if no data is specified for the&lt;br /&gt;
	-- namespace that is detected.&lt;br /&gt;
	other = 'other',&lt;br /&gt;
	&lt;br /&gt;
	-- The parameter name used to specify a page other than the current page;&lt;br /&gt;
	-- used for testing and demonstration.&lt;br /&gt;
	demopage = 'page',&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                              Parameter values                              --&lt;br /&gt;
-- These are set values that can be used with certain parameters. Only one    --&lt;br /&gt;
-- value can be specified, like this:                                         --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- cfg.foo = 'value name'                                                     --                                               --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- The following settings are used with the cfg.category2 parameter. Setting&lt;br /&gt;
-- cfg.category2 to cfg.category2Yes skips the blacklist, and if cfg.category2&lt;br /&gt;
-- is present but equal to anything other than cfg.category2Yes or&lt;br /&gt;
-- cfg.category2Negative then it supresses cateogrisation.&lt;br /&gt;
cfg.category2Yes = 'yes'&lt;br /&gt;
cfg.category2Negative = '¬'&lt;br /&gt;
&lt;br /&gt;
-- The following settings are used with the cfg.subpage parameter.&lt;br /&gt;
-- cfg.subpageNo is the value to specify to not categorise on subpages;&lt;br /&gt;
-- cfg.subpageOnly is the value to specify to only categorise on subpages.&lt;br /&gt;
cfg.subpageNo = 'no'&lt;br /&gt;
cfg.subpageOnly = 'only'&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                           Default namespaces                               --&lt;br /&gt;
-- This is a table of namespaces to categorise by default. The keys are the   --&lt;br /&gt;
-- namespace numbers.                                                         --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
cfg.defaultNamespaces = {&lt;br /&gt;
	[  0] = true, -- main&lt;br /&gt;
	[  6] = true, -- file&lt;br /&gt;
	[ 12] = true, -- help&lt;br /&gt;
	[ 14] = true, -- category&lt;br /&gt;
	[100] = true, -- portal&lt;br /&gt;
	[108] = true, -- book&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                                Wrappers                                    --&lt;br /&gt;
-- This is a wrapper template or a list of wrapper templates to be passed to  --&lt;br /&gt;
-- [[Module:Arguments]].                                                      --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
cfg.wrappers = 'Template:Category handler'&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                           End configuration data                           --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return cfg -- Don't edit this line.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/data&amp;diff=6417&amp;oldid=0</id>
		<title>Module:Category handler/data</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler/data&amp;diff=6417&amp;oldid=0"/>
		<updated>2026-04-16T09:41:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Category_handler/data&quot; title=&quot;Module:Category handler/data&quot;&gt;Module:Category handler/data&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module assembles data to be passed to [[Module:Category handler]] using&lt;br /&gt;
-- mw.loadData. This includes the configuration data and whether the current&lt;br /&gt;
-- page matches the title blacklist.&lt;br /&gt;
&lt;br /&gt;
local data = require('Module:Category handler/config')&lt;br /&gt;
local mShared = require('Module:Category handler/shared')&lt;br /&gt;
local blacklist = require('Module:Category handler/blacklist')&lt;br /&gt;
local title = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
data.currentTitleMatchesBlacklist = mShared.matchesBlacklist(&lt;br /&gt;
	title.prefixedText,&lt;br /&gt;
	blacklist&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
data.currentTitleNamespaceParameters = mShared.getNamespaceParameters(&lt;br /&gt;
	title,&lt;br /&gt;
	mShared.getParamMappings()&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
return data&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler&amp;diff=6415&amp;oldid=0</id>
		<title>Module:Category handler</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Category_handler&amp;diff=6415&amp;oldid=0"/>
		<updated>2026-04-16T09:41:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Category_handler&quot; title=&quot;Module:Category handler&quot;&gt;Module:Category handler&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--                              CATEGORY HANDLER                              --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--      This module implements the {{category handler}} template in Lua,      --&lt;br /&gt;
--      with a few improvements: all namespaces and all namespace aliases     --&lt;br /&gt;
--      are supported, and namespace names are detected automatically for     --&lt;br /&gt;
--      the local wiki. This module requires [[Module:Namespace detect]]      --&lt;br /&gt;
--      and [[Module:Yesno]] to be available on the local wiki. It can be     --&lt;br /&gt;
--      configured for different wikis by altering the values in              --&lt;br /&gt;
--      [[Module:Category handler/config]], and pages can be blacklisted      --&lt;br /&gt;
--      from categorisation by using [[Module:Category handler/blacklist]].   --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- Load required modules&lt;br /&gt;
local yesno = require('Module:Yesno')&lt;br /&gt;
&lt;br /&gt;
-- Lazily load things we don't always need&lt;br /&gt;
local mShared, mappings&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function trimWhitespace(s, removeBlanks)&lt;br /&gt;
	if type(s) ~= 'string' then&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
	s = s:match('^%s*(.-)%s*$')&lt;br /&gt;
	if removeBlanks then&lt;br /&gt;
		if s ~= '' then&lt;br /&gt;
			return s&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- CategoryHandler class&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local CategoryHandler = {}&lt;br /&gt;
CategoryHandler.__index = CategoryHandler&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler.new(data, args)&lt;br /&gt;
	local obj = setmetatable({ _data = data, _args = args }, CategoryHandler)&lt;br /&gt;
	&lt;br /&gt;
	-- Set the title object&lt;br /&gt;
	do&lt;br /&gt;
		local pagename = obj:parameter('demopage')&lt;br /&gt;
		local success, titleObj&lt;br /&gt;
		if pagename then&lt;br /&gt;
			success, titleObj = pcall(mw.title.new, pagename)&lt;br /&gt;
		end&lt;br /&gt;
		if success and titleObj then&lt;br /&gt;
			obj.title = titleObj&lt;br /&gt;
			if titleObj == mw.title.getCurrentTitle() then&lt;br /&gt;
				obj._usesCurrentTitle = true&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			obj.title = mw.title.getCurrentTitle()&lt;br /&gt;
			obj._usesCurrentTitle = true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Set suppression parameter values&lt;br /&gt;
	for _, key in ipairs{'nocat', 'categories'} do&lt;br /&gt;
		local value = obj:parameter(key)&lt;br /&gt;
		value = trimWhitespace(value, true)&lt;br /&gt;
		obj['_' .. key] = yesno(value)&lt;br /&gt;
	end&lt;br /&gt;
	do&lt;br /&gt;
		local subpage = obj:parameter('subpage')&lt;br /&gt;
		local category2 = obj:parameter('category2')&lt;br /&gt;
		if type(subpage) == 'string' then&lt;br /&gt;
			subpage = mw.ustring.lower(subpage)&lt;br /&gt;
		end&lt;br /&gt;
		if type(category2) == 'string' then&lt;br /&gt;
			subpage = mw.ustring.lower(category2)&lt;br /&gt;
		end&lt;br /&gt;
		obj._subpage = trimWhitespace(subpage, true)&lt;br /&gt;
		obj._category2 = trimWhitespace(category2) -- don't remove blank values&lt;br /&gt;
	end&lt;br /&gt;
	return obj&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:parameter(key)&lt;br /&gt;
	local parameterNames = self._data.parameters[key]&lt;br /&gt;
	local pntype = type(parameterNames)&lt;br /&gt;
	if pntype == 'string' or pntype == 'number' then&lt;br /&gt;
		return self._args[parameterNames]&lt;br /&gt;
	elseif pntype == 'table' then&lt;br /&gt;
		for _, name in ipairs(parameterNames) do&lt;br /&gt;
			local value = self._args[name]&lt;br /&gt;
			if value ~= nil then&lt;br /&gt;
				return value&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return nil&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			'invalid config key &amp;quot;%s&amp;quot;',&lt;br /&gt;
			tostring(key)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:isSuppressedByArguments()&lt;br /&gt;
	return&lt;br /&gt;
		-- See if a category suppression argument has been set.&lt;br /&gt;
		self._nocat == true&lt;br /&gt;
		or self._categories == false&lt;br /&gt;
		or (&lt;br /&gt;
			self._category2&lt;br /&gt;
			and self._category2 ~= self._data.category2Yes&lt;br /&gt;
			and self._category2 ~= self._data.category2Negative&lt;br /&gt;
		)&lt;br /&gt;
&lt;br /&gt;
		-- Check whether we are on a subpage, and see if categories are&lt;br /&gt;
		-- suppressed based on our subpage status.&lt;br /&gt;
		or self._subpage == self._data.subpageNo and self.title.isSubpage&lt;br /&gt;
		or self._subpage == self._data.subpageOnly and not self.title.isSubpage&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:shouldSkipBlacklistCheck()&lt;br /&gt;
	-- Check whether the category suppression arguments indicate we&lt;br /&gt;
	-- should skip the blacklist check.&lt;br /&gt;
	return self._nocat == false&lt;br /&gt;
		or self._categories == true&lt;br /&gt;
		or self._category2 == self._data.category2Yes&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:matchesBlacklist()&lt;br /&gt;
	if self._usesCurrentTitle then&lt;br /&gt;
		return self._data.currentTitleMatchesBlacklist&lt;br /&gt;
	else&lt;br /&gt;
		mShared = mShared or require('Module:Category handler/shared')&lt;br /&gt;
		return mShared.matchesBlacklist(&lt;br /&gt;
			self.title.prefixedText,&lt;br /&gt;
			mw.loadData('Module:Category handler/blacklist')&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:isSuppressed()&lt;br /&gt;
	-- Find if categories are suppressed by either the arguments or by&lt;br /&gt;
	-- matching the blacklist.&lt;br /&gt;
	return self:isSuppressedByArguments()&lt;br /&gt;
		or not self:shouldSkipBlacklistCheck() and self:matchesBlacklist()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:getNamespaceParameters()&lt;br /&gt;
	if self._usesCurrentTitle then&lt;br /&gt;
		return self._data.currentTitleNamespaceParameters&lt;br /&gt;
	else&lt;br /&gt;
		if not mappings then&lt;br /&gt;
			mShared = mShared or require('Module:Category handler/shared')&lt;br /&gt;
			mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData&lt;br /&gt;
		end&lt;br /&gt;
		return mShared.getNamespaceParameters(&lt;br /&gt;
			self.title,&lt;br /&gt;
			mappings&lt;br /&gt;
		)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:namespaceParametersExist()&lt;br /&gt;
	-- Find whether any namespace parameters have been specified.&lt;br /&gt;
	-- We use the order &amp;quot;all&amp;quot; --&amp;gt; namespace params --&amp;gt; &amp;quot;other&amp;quot; as this is what&lt;br /&gt;
	-- the old template did.&lt;br /&gt;
	if self:parameter('all') then&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
	if not mappings then&lt;br /&gt;
		mShared = mShared or require('Module:Category handler/shared')&lt;br /&gt;
		mappings = mShared.getParamMappings(true) -- gets mappings with mw.loadData&lt;br /&gt;
	end&lt;br /&gt;
	for ns, params in pairs(mappings) do&lt;br /&gt;
		for i, param in ipairs(params) do&lt;br /&gt;
			if self._args[param] then&lt;br /&gt;
				return true&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if self:parameter('other') then&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function CategoryHandler:getCategories()&lt;br /&gt;
	local params = self:getNamespaceParameters()&lt;br /&gt;
	local nsCategory&lt;br /&gt;
	for i, param in ipairs(params) do&lt;br /&gt;
		local value = self._args[param]&lt;br /&gt;
		if value ~= nil then&lt;br /&gt;
			nsCategory = value&lt;br /&gt;
			break&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if nsCategory ~= nil or self:namespaceParametersExist() then&lt;br /&gt;
		-- Namespace parameters exist - advanced usage.&lt;br /&gt;
		if nsCategory == nil then&lt;br /&gt;
			nsCategory = self:parameter('other')&lt;br /&gt;
		end&lt;br /&gt;
		local ret = {self:parameter('all')}&lt;br /&gt;
		local numParam = tonumber(nsCategory)&lt;br /&gt;
		if numParam and numParam &amp;gt;= 1 and math.floor(numParam) == numParam then&lt;br /&gt;
			-- nsCategory is an integer&lt;br /&gt;
			ret[#ret + 1] = self._args[numParam]&lt;br /&gt;
		else&lt;br /&gt;
			ret[#ret + 1] = nsCategory&lt;br /&gt;
		end&lt;br /&gt;
		if #ret &amp;lt; 1 then&lt;br /&gt;
			return nil&lt;br /&gt;
		else&lt;br /&gt;
			return table.concat(ret)&lt;br /&gt;
		end&lt;br /&gt;
	elseif self._data.defaultNamespaces[self.title.namespace] then&lt;br /&gt;
		-- Namespace parameters don't exist, simple usage.&lt;br /&gt;
		return self._args[1]&lt;br /&gt;
	end&lt;br /&gt;
	return nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
-- Exports&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p._exportClasses()&lt;br /&gt;
	-- Used for testing purposes.&lt;br /&gt;
	return {&lt;br /&gt;
		CategoryHandler = CategoryHandler&lt;br /&gt;
	}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args, data)&lt;br /&gt;
	data = data or mw.loadData('Module:Category handler/data')&lt;br /&gt;
	local handler = CategoryHandler.new(data, args)&lt;br /&gt;
	if handler:isSuppressed() then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	return handler:getCategories()&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame, data)&lt;br /&gt;
	data = data or mw.loadData('Module:Category handler/data')&lt;br /&gt;
	local args = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
		wrappers = data.wrappers,&lt;br /&gt;
		valueFunc = function (k, v)&lt;br /&gt;
			v = trimWhitespace(v)&lt;br /&gt;
			if type(k) == 'number' then&lt;br /&gt;
				if v ~= '' then&lt;br /&gt;
					return v&lt;br /&gt;
				else&lt;br /&gt;
					return nil&lt;br /&gt;
				end&lt;br /&gt;
			else&lt;br /&gt;
				return v&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	})&lt;br /&gt;
	return p._main(args, data)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:String&amp;diff=6413&amp;oldid=0</id>
		<title>Module:String</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:String&amp;diff=6413&amp;oldid=0"/>
		<updated>2026-04-16T09:41:40Z</updated>

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

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Namespace_detect/config&quot; title=&quot;Module:Namespace detect/config&quot;&gt;Module:Namespace detect/config&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                    Namespace detect configuration data                     --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module stores configuration data for Module:Namespace detect. Here    --&lt;br /&gt;
-- you can localise the module to your wiki's language.                       --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- To activate a configuration item, you need to uncomment it. This means     --&lt;br /&gt;
-- that you need to remove the text &amp;quot;-- &amp;quot; at the start of the line.           --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Don't edit this line.&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                              Parameter names                               --&lt;br /&gt;
-- These configuration items specify custom parameter names. Values added     --&lt;br /&gt;
-- here will work in addition to the default English parameter names.         --&lt;br /&gt;
-- To add one extra name, you can use this format:                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- cfg.foo = 'parameter name'                                                 --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- To add multiple names, you can use this format:                            --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- cfg.foo = {'parameter name 1', 'parameter name 2', 'parameter name 3'}     --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
---- This parameter displays content for the main namespace:&lt;br /&gt;
-- cfg.main = 'main'&lt;br /&gt;
&lt;br /&gt;
---- This parameter displays in talk namespaces:&lt;br /&gt;
-- cfg.talk = 'talk'&lt;br /&gt;
&lt;br /&gt;
---- This parameter displays content for &amp;quot;other&amp;quot; namespaces (namespaces for which&lt;br /&gt;
---- parameters have not been specified):&lt;br /&gt;
-- cfg.other = 'other'&lt;br /&gt;
&lt;br /&gt;
---- This parameter makes talk pages behave as though they are the corresponding&lt;br /&gt;
---- subject namespace. Note that this parameter is used with [[Module:Yesno]].&lt;br /&gt;
---- Edit that module to change the default values of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc.&lt;br /&gt;
-- cfg.subjectns = 'subjectns'&lt;br /&gt;
&lt;br /&gt;
---- This parameter sets a demonstration namespace:&lt;br /&gt;
-- cfg.demospace = 'demospace'&lt;br /&gt;
&lt;br /&gt;
---- This parameter sets a specific page to compare:&lt;br /&gt;
cfg.demopage = 'page'&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                           Table configuration                              --&lt;br /&gt;
-- These configuration items allow customisation of the &amp;quot;table&amp;quot; function,     --&lt;br /&gt;
-- used to generate a table of possible parameters in the module              --&lt;br /&gt;
-- documentation.                                                             --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
---- The header for the namespace column in the wikitable containing the list of&lt;br /&gt;
---- possible subject-space parameters.&lt;br /&gt;
-- cfg.wikitableNamespaceHeader = 'Namespace'&lt;br /&gt;
&lt;br /&gt;
---- The header for the wikitable containing the list of possible subject-space&lt;br /&gt;
---- parameters.&lt;br /&gt;
-- cfg.wikitableAliasesHeader = 'Aliases'&lt;br /&gt;
&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
--                        End of configuration data                           --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return cfg -- Don't edit this line.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Namespace_detect/data&amp;diff=6409&amp;oldid=0</id>
		<title>Module:Namespace detect/data</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Namespace_detect/data&amp;diff=6409&amp;oldid=0"/>
		<updated>2026-04-16T09:41:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Namespace_detect/data&quot; title=&quot;Module:Namespace detect/data&quot;&gt;Module:Namespace detect/data&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                          Namespace detect data                             --&lt;br /&gt;
-- This module holds data for [[Module:Namespace detect]] to be loaded per    --&lt;br /&gt;
-- page, rather than per #invoke, for performance reasons.                    --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local cfg = require('Module:Namespace detect/config')&lt;br /&gt;
&lt;br /&gt;
local function addKey(t, key, defaultKey)&lt;br /&gt;
	if key ~= defaultKey then&lt;br /&gt;
		t[#t + 1] = key&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Get a table of parameters to query for each default parameter name.&lt;br /&gt;
-- This allows wikis to customise parameter names in the cfg table while&lt;br /&gt;
-- ensuring that default parameter names will always work. The cfg table&lt;br /&gt;
-- values can be added as a string, or as an array of strings.&lt;br /&gt;
&lt;br /&gt;
local defaultKeys = {&lt;br /&gt;
	'main',&lt;br /&gt;
	'talk',&lt;br /&gt;
	'other',&lt;br /&gt;
	'subjectns',&lt;br /&gt;
	'demospace',&lt;br /&gt;
	'demopage'&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local argKeys = {}&lt;br /&gt;
for i, defaultKey in ipairs(defaultKeys) do&lt;br /&gt;
	argKeys[defaultKey] = {defaultKey}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
for defaultKey, t in pairs(argKeys) do&lt;br /&gt;
	local cfgValue = cfg[defaultKey]&lt;br /&gt;
	local cfgValueType = type(cfgValue)&lt;br /&gt;
	if cfgValueType == 'string' then&lt;br /&gt;
		addKey(t, cfgValue, defaultKey)&lt;br /&gt;
	elseif cfgValueType == 'table' then&lt;br /&gt;
		for i, key in ipairs(cfgValue) do&lt;br /&gt;
			addKey(t, key, defaultKey)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	cfg[defaultKey] = nil -- Free the cfg value as we don't need it any more.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getParamMappings()&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Returns a table of how parameter names map to namespace names. The keys&lt;br /&gt;
	-- are the actual namespace names, in lower case, and the values are the&lt;br /&gt;
	-- possible parameter names for that namespace, also in lower case. The&lt;br /&gt;
	-- table entries are structured like this:&lt;br /&gt;
	-- {&lt;br /&gt;
	--   [''] = {'main'},&lt;br /&gt;
	--   ['wikipedia'] = {'wikipedia', 'project', 'wp'},&lt;br /&gt;
	--   ...&lt;br /&gt;
	-- }&lt;br /&gt;
	--]]&lt;br /&gt;
	local mappings = {}&lt;br /&gt;
	local mainNsName = mw.site.subjectNamespaces[0].name&lt;br /&gt;
	mainNsName = mw.ustring.lower(mainNsName)&lt;br /&gt;
	mappings[mainNsName] = mw.clone(argKeys.main)&lt;br /&gt;
	mappings['talk'] = mw.clone(argKeys.talk)&lt;br /&gt;
	for nsid, ns in pairs(mw.site.subjectNamespaces) do&lt;br /&gt;
		if nsid ~= 0 then -- Exclude main namespace.&lt;br /&gt;
			local nsname = mw.ustring.lower(ns.name)&lt;br /&gt;
			local canonicalName = mw.ustring.lower(ns.canonicalName)&lt;br /&gt;
			mappings[nsname] = {nsname}&lt;br /&gt;
			if canonicalName ~= nsname then&lt;br /&gt;
				table.insert(mappings[nsname], canonicalName)&lt;br /&gt;
			end&lt;br /&gt;
			for _, alias in ipairs(ns.aliases) do&lt;br /&gt;
				table.insert(mappings[nsname], mw.ustring.lower(alias))&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return mappings&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	argKeys = argKeys,&lt;br /&gt;
	cfg = cfg,&lt;br /&gt;
	mappings = getParamMappings()&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Yesno&amp;diff=6407&amp;oldid=0</id>
		<title>Template:Yesno</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Yesno&amp;diff=6407&amp;oldid=0"/>
		<updated>2026-04-16T09:41:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Yesno&quot; title=&quot;Template:Yesno&quot;&gt;Template:Yesno&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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;
 |f&lt;br /&gt;
 |false&lt;br /&gt;
 |off&lt;br /&gt;
 |0        = {{{no|}}}&lt;br /&gt;
 |         = {{{blank|{{{no|}}}}}}&lt;br /&gt;
 |¬        = {{{¬|}}}&lt;br /&gt;
 |yes&lt;br /&gt;
 |y&lt;br /&gt;
 |t&lt;br /&gt;
 |true&lt;br /&gt;
 |on&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>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box/configuration&amp;diff=6405&amp;oldid=0</id>
		<title>Module:Message box/configuration</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box/configuration&amp;diff=6405&amp;oldid=0"/>
		<updated>2026-04-16T09:41:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Message_box/configuration&quot; title=&quot;Module:Message box/configuration&quot;&gt;Module:Message box/configuration&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                          Message box configuration                         --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module contains configuration data for [[Module:Message box]].        --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	ambox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'ambox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'ambox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'ambox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'ambox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'ambox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'ambox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'ambox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default                     = 'notice',&lt;br /&gt;
		allowBlankParams            = {'talk', 'sect', 'date', 'issue', 'fix', 'subst', 'hidden'},&lt;br /&gt;
		allowSmall                  = true,&lt;br /&gt;
		smallParam                  = 'left',&lt;br /&gt;
		smallClass                  = 'mbox-small-left',&lt;br /&gt;
		substCheck                  = true,&lt;br /&gt;
		classes                     = {'metadata', 'ambox'},&lt;br /&gt;
		imageEmptyCell              = true,&lt;br /&gt;
		imageCheckBlank             = true,&lt;br /&gt;
		imageSmallSize              = '20x20px',&lt;br /&gt;
		imageCellDiv                = true,&lt;br /&gt;
		useCollapsibleTextFields    = true,&lt;br /&gt;
		imageRightNone              = true,&lt;br /&gt;
		sectionDefault              = 'article',&lt;br /&gt;
		allowMainspaceCategories    = true,&lt;br /&gt;
		templateCategory            = 'Article message templates',&lt;br /&gt;
	        templateCategoryRequireName = true,&lt;br /&gt;
		templateErrorCategory       = 'Article message templates with missing parameters',&lt;br /&gt;
		templateErrorParamsToCheck  = {'issue', 'fix', 'subst'},&lt;br /&gt;
		removalNotice               = '&amp;lt;small&amp;gt;[[Help:Maintenance template removal|Learn how and when to remove this message]]&amp;lt;/small&amp;gt;',&lt;br /&gt;
		templatestyles              = 'Module:Message box/ambox.css'&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	cmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'cmbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'cmbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'cmbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'cmbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'cmbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'cmbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'cmbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'cmbox'},&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		templatestyles       = 'Module:Message box/cmbox.css',&lt;br /&gt;
		div_structure        = true,&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	fmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			warning = {&lt;br /&gt;
				class = 'fmbox-warning',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			editnotice = {&lt;br /&gt;
				class = 'fmbox-editnotice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			},&lt;br /&gt;
			system = {&lt;br /&gt;
				class = 'fmbox-system',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'system',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'fmbox'},&lt;br /&gt;
		imageEmptyCell       = false,&lt;br /&gt;
		imageRightNone       = false,&lt;br /&gt;
		templatestyles       = 'Module:Message box/fmbox.css',&lt;br /&gt;
		div_structure        = true,&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	imbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'imbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'imbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'imbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'imbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'imbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'imbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			license = {&lt;br /&gt;
				class = 'imbox-license licensetpl',&lt;br /&gt;
				image = 'Imbox-license.svg'&lt;br /&gt;
			},&lt;br /&gt;
			[&amp;quot;license-related&amp;quot;] = {&lt;br /&gt;
				class = 'imbox-license',&lt;br /&gt;
				image = 'Imbox-license.svg'&lt;br /&gt;
			},&lt;br /&gt;
			featured = {&lt;br /&gt;
				class = 'imbox-featured',&lt;br /&gt;
				image = 'Cscr-featured.svg',&lt;br /&gt;
				imageNeedsLink = true&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'imbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'imbox'},&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		below                = true,&lt;br /&gt;
		templateCategory     = 'File message boxes',&lt;br /&gt;
		templatestyles       = 'Module:Message box/imbox.css',&lt;br /&gt;
		div_structure        = true,&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	ombox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'ombox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'ombox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'ombox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'ombox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'ombox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'ombox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'ombox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'ombox'},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		imageRightNone       = true,&lt;br /&gt;
		templatestyles       = 'Module:Message box/ombox.css'&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	tmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = 'tmbox-speedy',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = 'tmbox-delete',&lt;br /&gt;
				image = 'Ambox warning pn.svg'&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = 'tmbox-content',&lt;br /&gt;
				image = 'Ambox important.svg'&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = 'tmbox-style',&lt;br /&gt;
				image = 'Edit-clear.svg'&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = 'tmbox-move',&lt;br /&gt;
				image = 'Merge-split-transwiki default.svg'&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = 'tmbox-protection',&lt;br /&gt;
				image = 'Semi-protection-shackle-keyhole.svg'&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = 'tmbox-notice',&lt;br /&gt;
				image = 'Information icon4.svg'&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = 'notice',&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {'tmbox'},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageRightNone       = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		templateCategory     = 'Talk message boxes',&lt;br /&gt;
		templatestyles       = 'Module:Message box/tmbox.css'&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box&amp;diff=6403&amp;oldid=0</id>
		<title>Module:Message box</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box&amp;diff=6403&amp;oldid=0"/>
		<updated>2026-04-16T09:41:38Z</updated>

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

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Template_link&quot; title=&quot;Template:Template link&quot;&gt;Template:Template link&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;amp;#123;&amp;amp;#123;&amp;lt;/span&amp;gt;[[Template:{{{1}}}|{{{1}}}]]&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;amp;#125;&amp;amp;#125;&amp;lt;/span&amp;gt;&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>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Tl&amp;diff=6399&amp;oldid=0</id>
		<title>Template:Tl</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Tl&amp;diff=6399&amp;oldid=0"/>
		<updated>2026-04-16T09:41:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Tl&quot; class=&quot;mw-redirect&quot; title=&quot;Template:Tl&quot;&gt;Template:Tl&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;#REDIRECT [[Template:Template link]]&lt;br /&gt;
&lt;br /&gt;
{{Redirect category shell|&lt;br /&gt;
{{R from move}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Arguments&amp;diff=6397&amp;oldid=0</id>
		<title>Module:Arguments</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Arguments&amp;diff=6397&amp;oldid=0"/>
		<updated>2026-04-16T09:41:37Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Arguments&quot; title=&quot;Module:Arguments&quot;&gt;Module:Arguments&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&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('libraryUtil')&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'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) == 'string' then&lt;br /&gt;
		val = val:match('^%s*(.-)%s*$')&lt;br /&gt;
		if val == '' 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) == 'string' then&lt;br /&gt;
		return val:match('^%s*(.-)%s*$')&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) == 'string' then&lt;br /&gt;
		if val:find('%S') 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 == 'string' or tp == 'number') 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('getArgs', 1, frame, 'table', true)&lt;br /&gt;
	checkType('getArgs', 2, options, 'table', 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's availability. If we weren'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) == 'table' and type(frame.getParent) == 'function' 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'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('/sandbox$', '')&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) == 'table' 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'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'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) ~= 'function' then&lt;br /&gt;
			error(&lt;br /&gt;
				&amp;quot;bad value assigned to option 'valueFunc'&amp;quot;&lt;br /&gt;
					.. '(function expected, got '&lt;br /&gt;
					.. type(tidyVal)&lt;br /&gt;
					.. ')',&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 's' (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] ~= 'h' then&lt;br /&gt;
					local tidiedVal = tidyVal(key, val)&lt;br /&gt;
					if tidiedVal == nil then&lt;br /&gt;
						nilArgs[key] = 's'&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) == 'string' 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] = 'h'&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) == 'string' 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;
				'could not write to argument table key &amp;quot;'&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. '&amp;quot;; the table is read-only',&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;
				'could not write to argument table key &amp;quot;'&lt;br /&gt;
					.. tostring(key)&lt;br /&gt;
					.. '&amp;quot;; overwriting existing arguments is not permitted',&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'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] = 'h'&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) ~= 'string' 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'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>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Yesno&amp;diff=6395&amp;oldid=0</id>
		<title>Module:Yesno</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Yesno&amp;diff=6395&amp;oldid=0"/>
		<updated>2026-04-16T09:41:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Module:Yesno&quot; title=&quot;Module:Yesno&quot;&gt;Module:Yesno&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- Function allowing for consistent treatment of boolean-like wikitext input.&lt;br /&gt;
-- It works similarly to the template {{yesno}}.&lt;br /&gt;
&lt;br /&gt;
return function (val, default)&lt;br /&gt;
	-- If your wiki uses non-ascii characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you&lt;br /&gt;
	-- should replace &amp;quot;val:lower()&amp;quot; with &amp;quot;mw.ustring.lower(val)&amp;quot; in the&lt;br /&gt;
	-- following line.&lt;br /&gt;
	val = type(val) == 'string' and val:lower() or val&lt;br /&gt;
	if val == nil then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif val == true &lt;br /&gt;
		or val == 'yes'&lt;br /&gt;
		or val == 'y'&lt;br /&gt;
		or val == 'true'&lt;br /&gt;
		or val == 't'&lt;br /&gt;
		or val == 'on'&lt;br /&gt;
		or tonumber(val) == 1&lt;br /&gt;
	then&lt;br /&gt;
		return true&lt;br /&gt;
	elseif val == false&lt;br /&gt;
		or val == 'no'&lt;br /&gt;
		or val == 'n'&lt;br /&gt;
		or val == 'false'&lt;br /&gt;
		or val == 'f'&lt;br /&gt;
		or val == 'off'&lt;br /&gt;
		or tonumber(val) == 0&lt;br /&gt;
	then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Unordered_list&amp;diff=6393&amp;oldid=0</id>
		<title>Template:Unordered list</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Unordered_list&amp;diff=6393&amp;oldid=0"/>
		<updated>2026-04-16T09:41:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Unordered_list&quot; class=&quot;mw-redirect&quot; title=&quot;Template:Unordered list&quot;&gt;Template:Unordered list&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;#REDIRECT [[Template:Bulleted list]]&lt;br /&gt;
{{R from move}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Lang&amp;diff=6391&amp;oldid=0</id>
		<title>Template:Lang</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Lang&amp;diff=6391&amp;oldid=0"/>
		<updated>2026-04-16T09:41:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Lang&quot; title=&quot;Template:Lang&quot;&gt;Template:Lang&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:Lang|{{{fn|lang}}}}}&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>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Flatlist&amp;diff=6389&amp;oldid=0</id>
		<title>Template:Flatlist</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Flatlist&amp;diff=6389&amp;oldid=0"/>
		<updated>2026-04-16T09:41:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Flatlist&quot; title=&quot;Template:Flatlist&quot;&gt;Template:Flatlist&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Hlist/styles.css&amp;quot;/&amp;gt;&amp;lt;div class=&amp;quot;hlist {{{class|}}}&amp;quot; {{#if:{{{style|}}}{{{indent|}}}|style=&amp;quot;{{#if:{{{indent|}}}|margin-left: {{#expr:{{{indent}}}*1.6}}em;}} {{{style|}}}&amp;quot;}}&amp;gt;{{#if:{{{1|}}}|&lt;br /&gt;
{{{1}}}&lt;br /&gt;
&amp;lt;/div&amp;gt;}}{{#invoke:Check for unknown parameters|check|unknown={{main other|[[Category:Pages using flatlist with unknown parameters|_VALUE_{{PAGENAME}}]]}}|preview=Page using [[Template:Flatlist]] with unknown parameter &amp;quot;_VALUE_&amp;quot;|ignoreblank=y| 1 | class | indent | style }}&amp;lt;noinclude&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;!-- Needed to prevent Linter errors here; when Flatlist without parameters is used to start a list, Endflatlist provides the closing /div tag. --&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_logo/doc&amp;diff=6387&amp;oldid=0</id>
		<title>Template:Non-free logo/doc</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_logo/doc&amp;diff=6387&amp;oldid=0"/>
		<updated>2026-04-16T09:41:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Non-free_logo/doc&quot; title=&quot;Template:Non-free logo/doc&quot;&gt;Template:Non-free logo/doc&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Documentation subpage}}&lt;br /&gt;
&amp;lt;!-- Please place categories where indicated at the bottom of this page and interwikis at Wikidata (see [[Wikipedia:Wikidata]]) --&amp;gt;&lt;br /&gt;
{{High-risk}}&lt;br /&gt;
&lt;br /&gt;
Place this template in the file description pages of non-free [[Wikipedia:Logos|logos]]. Do not use this template for [[Wikipedia:Logos#Copyright-free logos|copyright-free logos]].&lt;br /&gt;
&lt;br /&gt;
[[Wikipedia:Transclusion|Transcluding]] this template in a file description page will automatically include the page in [[:Category:All non-free logos]]. It may also be used to add ''one'' other category—see [[:Category:Wikipedia images of logos]] for potential category options—as follows:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;Non-free logo|''Add category name here and omit the 'Category:' prefix''}}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the category name is redirected, e.g. after renaming or merging, this template will resolve the redirect i.e. put the image page in the target category rather than the redirected category.&lt;br /&gt;
&lt;br /&gt;
===Registered trademarks===&lt;br /&gt;
If the image is also a registered trademark, include the &amp;lt;code&amp;gt;regtrademark=yes&amp;lt;/code&amp;gt; parameter as shown below:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Non-free logo|regtrademark=yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
If the image is a non-registered trademark, add &amp;lt;code&amp;gt;nonregtrademark=yes&amp;lt;/code&amp;gt; as shown below:&lt;br /&gt;
:&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Non-free logo|nonregtrademark=yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===See also===&lt;br /&gt;
*{{tl|Non-free use rationale logo}} {{mdash}} Non-free use media rationale (Non-Free logo)&lt;br /&gt;
*{{tl|PD-textlogo}} {{mdash}} A template for tagging copyright-free logos&lt;br /&gt;
* {{tl|Trademark}} {{mdash}} A template for tagging logos protected by trademark instead of or in addition to copyright&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{Sandbox other||&lt;br /&gt;
&amp;lt;!-- Categories below this line, please; interwikis at Wikidata --&amp;gt;&lt;br /&gt;
[[Category:All non-free logos| ]]&lt;br /&gt;
[[Category:Wikipedia non-free file copyright templates|Logo]]&lt;br /&gt;
&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_logo&amp;diff=6385&amp;oldid=0</id>
		<title>Template:Non-free logo</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_logo&amp;diff=6385&amp;oldid=0"/>
		<updated>2026-04-16T09:41:34Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; imported &lt;a href=&quot;/index.php/Template:Non-free_logo&quot; title=&quot;Template:Non-free logo&quot;&gt;Template:Non-free logo&lt;/a&gt; by file upload (1 revision)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Imbox&lt;br /&gt;
 |type  = license&lt;br /&gt;
 |image = {{#ifeq:{{Yesno-no|{{{regtrademark}}}}}|yes&lt;br /&gt;
  |[[File:NotCommons-emblem-registered-trademark.svg|50px|Registered trademark]]&lt;br /&gt;
  |{{#ifeq:{{Yesno-no|{{{nonregtrademark}}}}}|yes|[[File:NotCommons-emblem-nonregistered-trademark.svg|50px|Non-registered trademark]]|[[File:NotCommons-emblem-copyrighted.svg|50px|Copyrighted]]}}&lt;br /&gt;
 }}&lt;br /&gt;
 |text  = This is a '''[[logo]]''' of an organization, item, or event, and is protected by [[copyright]]{{#ifeq:{{Yesno-no|{{{regtrademark}}}}}|yes|&amp;amp;#32;and [[trademark]]}}{{#ifeq:{{Yesno-no|{{{nonregtrademark}}}}}|yes|&amp;amp;#32;and [[trademark|a nonregistered trademark]]}}. The use of '''low-resolution''' images on the [[Main Page|English-language Wikipedia]], hosted on servers in the United States by the non-profit [[wmf:Home|Wikimedia Foundation]], of logos for certain uses involving identification and critical commentary may qualify as '''[[Wikipedia:Non-free content criteria|non-free use]]''' under the [[copyright law of the United States]]. '''Any other uses of this image, on Wikipedia or elsewhere, may be [[copyright infringement]].''' Certain commercial use of this image may also be trademark infringement. See [[Wikipedia:Non-free content]] and [[Wikipedia:Logos]].&lt;br /&gt;
Use of the logo here does not imply endorsement of the organization by Wikipedia or the [[Wikimedia Foundation]], nor vice versa.&lt;br /&gt;
&amp;lt;span class=&amp;quot;licensetpl_short licensetpl_long&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;Fair use&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;licensetpl_link&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;{{fullurl:{{FULLPAGENAME}}}}&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;licensetpl_nonfree&amp;quot; style=&amp;quot;display:none&amp;quot;&amp;gt;true&amp;lt;/span&amp;gt; &lt;br /&gt;
|below={{#ifeq:{{Yesno-no|{{{image_has_rationale|{{{image has rationale}}}}}}}}|yes|&lt;br /&gt;
{{file other|[[Category:Wikipedia non-free files with NFUR stated]]{{#ifeq:{{{auto|}}}|yes|[[Category:Wikipedia non-free files with NFUR stated (bot-assessed)]]}}}}&lt;br /&gt;
|{{Uploader information|additional notes=&lt;br /&gt;
# This tag is only for use on images of logos.&lt;br /&gt;
# '''[[Template:Non-free use rationale logo]]''' may be helpful for stating the rationale. &lt;br /&gt;
# Please do not use this template to tag non-free icons of computer software. Such items should be tagged with {{tl|Non-free computer icon}} template.&lt;br /&gt;
# '''Regarding uses other than in the original article:''' Check the [[Wikipedia:Non-free content criteria|non-free use criteria]] and do not assume that existing rationales can be simply copied and pasted, as they may not necessarily apply.&lt;br /&gt;
}} }}&lt;br /&gt;
}}&lt;br /&gt;
{{Non-free media}}&amp;lt;includeonly&amp;gt;{{file other|[[Category:All non-free logos]]{{#if:{{{1|}}}|[[Category:{{resolve category redirect|{{{1}}}}}]]}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- PLEASE ADD CATEGORIES TO THE /doc SUBPAGE; INTERWIKIS GO TO WIKIDATA, THANK YOU! --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php/Here</id>
		<title>Here</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/Here"/>
		<updated>2026-04-15T15:29:36Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; deleted page &lt;a href=&quot;/index.php?title=Here&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Here (page does not exist)&quot;&gt;Here&lt;/a&gt; Seemed to be misnamed page for Webgazer&lt;/p&gt;
</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Webgazer_eye_tracking_solution_implemented_as_jsPsych_plugin.&amp;diff=6382&amp;oldid=0</id>
		<title>Webgazer eye tracking solution implemented as jsPsych plugin.</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Webgazer_eye_tracking_solution_implemented_as_jsPsych_plugin.&amp;diff=6382&amp;oldid=0"/>
		<updated>2026-04-15T15:28:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; moved page &lt;a href=&quot;/index.php?title=Webgazer_eye_tracking_solution_implemented_as_jsPsych_plugin.&amp;amp;redirect=no&quot; class=&quot;mw-redirect&quot; title=&quot;Webgazer eye tracking solution implemented as jsPsych plugin.&quot;&gt;Webgazer eye tracking solution implemented as jsPsych plugin.&lt;/a&gt; to &lt;a href=&quot;/index.php/Webgazer&quot; title=&quot;Webgazer&quot;&gt;Webgazer&lt;/a&gt; Simplify page title&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Webgazer is an open source library for eye tracking solutions using common webcams, licensed under GPLv3[http://www.gnu.org/licenses/gpl-3.0.en.html]. For more detailed information, please visit the authors website: https://webgazer.cs.brown.edu, it explains how it can be used in your own application. An example of how Webgazer can be used in your own jsPsych experiment is described below.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==jsPsych example==&lt;br /&gt;
The code is available here: [https://gitlab.socsci.ru.nl/tsg/webgazer_calibration_example]&lt;br /&gt;
The implementation is based on the demo example from the Brown HCI group (https://webgazer.cs.brown.edu/calibration.html?). In the demo example, there are a few dependencies as listed below that link to external servers. In this example, the corresponding utilised tools have been downloaded and added locally to the server. To stay up to date, these links may be restored to have future implementations benefit from new developments.&amp;lt;br&amp;gt;&lt;br /&gt;
The experiment starts with a calibration and then runs a simple experiment where it is asked to look at the fixation cross in the middle of the screen and then focus as soon as possible on random red spheres popping up on the edges or corners of the screen. At the end. all the corresponding eye gazing tracings are shown in a graphic. Only eye gazing x,y-coordinates are saved as data to the server, no video data is stored. The calibration part and presentation of an image, (i.e. one trial) together with everything that is needed to get the eye tracking data saved is implemented as jsPsych plugins: webgazer-calibration-plugin.js and webgazer-trial-plugin.js. The jsPsych implementation of the experiment itself is put together in main.js.&amp;lt;br&amp;gt;&lt;br /&gt;
For server data storage, it uses the Radcloud Mini solution: https://www.socsci.ru.nl/wilberth/radcloud/index.html &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
To run this example:http:&lt;br /&gt;
//exp.socsci.ru.nl/webgazer/webgazer_calibration_example/jsp_webgazer.html&lt;br /&gt;
&lt;br /&gt;
==Webgazer credits:==&lt;br /&gt;
If you use WebGazer.js please cite the following paper (https://jeffhuang.com/Final_WebGazer_IJCAI16.pdf):@inproceedings{papoutsaki2016webgazer,&amp;lt;br&amp;gt;&lt;br /&gt;
author = {Alexandra Papoutsaki and Patsorn Sangkloy and James Laskey and Nediyana Daskalova and Jeff Huang and James Hays},&amp;lt;br&amp;gt;&lt;br /&gt;
title = {WebGazer: Scalable Webcam Eye Tracking Using User Interactions},&amp;lt;br&amp;gt;&lt;br /&gt;
booktitle = {Proceedings of the 25th International Joint Conference on Artificial Intelligence (IJCAI)},&amp;lt;br&amp;gt;&lt;br /&gt;
pages = {3839--3845}, year = {2016}, organization={AAAI}&lt;br /&gt;
&lt;br /&gt;
==WebGazer download:==&lt;br /&gt;
webgazer.js: https://webgazer.cs.brown.edu&lt;br /&gt;
&lt;br /&gt;
==WebGazer dependencies:==&lt;br /&gt;
In webgazer.js original web page links were changed to local copies of the models:&lt;br /&gt;
   // const BLAZEFACE_MODEL_URL=&amp;quot;https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1&amp;quot;;&lt;br /&gt;
      const BLAZEFACE_MODEL_URL=&amp;quot;./model/tfjs/blazeface&amp;quot;;&lt;br /&gt;
   // const FACEMESH_GRAPHMODEL_PATH = 'https://tfhub.dev/mediapipe/tfjs-model/facemesh/1/default/1';&lt;br /&gt;
      const FACEMESH_GRAPHMODEL_PATH = './model/tfjs/facemesh';&lt;br /&gt;
   models downloaded from:&lt;br /&gt;
      Model BlazeFace: https://tfhub.dev/tensorflow/tfjs-model/blazeface/1/default/1&lt;br /&gt;
      Model FaceMesh: https://tfhub.dev/mediapipe/tfjs-model/facemesh/1/default/1&lt;br /&gt;
==Other dependencies:==&lt;br /&gt;
localforage: https://raw.githubusercontent.com/localForage/localForage/master/dist/localforage.js&amp;lt;br&amp;gt;&lt;br /&gt;
bootstrap: https://getbootstrap.com/docs/4.3/getting-started/download/&amp;lt;br&amp;gt;&lt;br /&gt;
sweetalert: sweetalert.min.js just copied from webgazer demo because not found here: https://github.com/t4t5/sweetalert&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php/Template:R_protected</id>
		<title>Template:R protected</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/Template:R_protected"/>
		<updated>2026-04-15T15:24:06Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; deleted page &lt;a href=&quot;/index.php?title=Template:R_protected&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:R protected (page does not exist)&quot;&gt;Template:R protected&lt;/a&gt; content was: &amp;quot;#REDIRECT &lt;a href=&quot;/index.php?title=Template:R_fully_protected&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Template:R fully protected (page does not exist)&quot;&gt;Template:R fully protected&lt;/a&gt;  {{Redr|from move|rtrt|tsh}}&amp;quot;, and the only contributor was &amp;quot;&lt;a href=&quot;/index.php/Special:Contributions/E.vandenberge&quot; title=&quot;Special:Contributions/E.vandenberge&quot;&gt;E.vandenberge&lt;/a&gt;&amp;quot; (&lt;a href=&quot;/index.php?title=User_talk:E.vandenberge&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:E.vandenberge (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php/User:T.rensen</id>
		<title>User:T.rensen</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/User:T.rensen"/>
		<updated>2026-04-15T15:23:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; deleted page &lt;a href=&quot;/index.php?title=User:T.rensen&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User:T.rensen (page does not exist)&quot;&gt;User:T.rensen&lt;/a&gt; content was: &amp;quot;#REDIRECT &lt;a href=&quot;/index.php?title=Truus_Rensen&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Truus Rensen (page does not exist)&quot;&gt;Truus_Rensen&lt;/a&gt;&amp;quot;, and the only contributor was &amp;quot;&lt;a href=&quot;/index.php/Special:Contributions/E.vandenberge&quot; title=&quot;Special:Contributions/E.vandenberge&quot;&gt;E.vandenberge&lt;/a&gt;&amp;quot; (&lt;a href=&quot;/index.php?title=User_talk:E.vandenberge&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:E.vandenberge (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Some&amp;diff=6373&amp;oldid=0</id>
		<title>Template:Some</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Some&amp;diff=6373&amp;oldid=0"/>
		<updated>2026-04-15T14:18:02Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;noinclude&amp;gt;{| class=&amp;quot;wikitable&amp;quot; |- |&amp;lt;/noinclude&amp;gt;style=&amp;quot;background: #FFD; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&amp;quot; class=&amp;quot;partial tabl...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;noinclude&amp;gt;{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;/noinclude&amp;gt;style=&amp;quot;background: #FFD; color:black; vertical-align: middle; text-align: {{{align|center}}}; {{{style|}}}&amp;quot; class=&amp;quot;partial table-partial&amp;quot;|{{{1|Some}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
{{Documentation|Template:Table cell templates/doc}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php/Truus_Rensen</id>
		<title>Truus Rensen</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/Truus_Rensen"/>
		<updated>2026-04-15T11:54:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; deleted page &lt;a href=&quot;/index.php?title=Truus_Rensen&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Truus Rensen (page does not exist)&quot;&gt;Truus Rensen&lt;/a&gt; content was: &amp;quot;{{Infobox staff | name           = Truus Rensen | image          = Default-avatar.jpg | caption        =  | role           = IT Support | expertise      =  | email          = truus.rensen@ru.nl | website        =  | telephone      = 13019 | office         = 00.318 | building       = Maria Montessori | working_days   = {{unbulleted_list | Monday | Tuesday | We...&amp;quot;, and the only contributor was &amp;quot;&lt;a href=&quot;/index.php/Special:Contributions/E.vandenberge&quot; title=&quot;Special:Contributions/E.vandenberge&quot;&gt;E.vandenberge&lt;/a&gt;&amp;quot; (&lt;a href=&quot;/index.php?title=User_talk:E.vandenberge&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;User talk:E.vandenberge (page does not exist)&quot;&gt;talk&lt;/a&gt;)&lt;/p&gt;
</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=ButtonBox%5CMicrosoft_Windows_driver_issue&amp;diff=6342&amp;oldid=0</id>
		<title>ButtonBox\Microsoft Windows driver issue</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=ButtonBox%5CMicrosoft_Windows_driver_issue&amp;diff=6342&amp;oldid=0"/>
		<updated>2026-04-14T15:33:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; moved page &lt;a href=&quot;/index.php?title=ButtonBox%5CMicrosoft_Windows_driver_issue&amp;amp;redirect=no&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;ButtonBox\Microsoft Windows driver issue (page does not exist)&quot;&gt;ButtonBox\Microsoft Windows driver issue&lt;/a&gt; to &lt;a href=&quot;/index.php/ButtonBox/Microsoft_Windows_driver_issue&quot; title=&quot;ButtonBox/Microsoft Windows driver issue&quot;&gt;ButtonBox/Microsoft Windows driver issue&lt;/a&gt; without leaving a redirect&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Buttonbox driver issue ==&lt;br /&gt;
&lt;br /&gt;
Future Technology Devices International Ltd. (ftdi) is currently convincing people not to use their software for hardware produced by other companies in a rather aggressive way. As a result you may see the text NON GENUINE DEVICE FOUND! or part of it when connecting to our buttonbox from Windows 7 or later. The issue does not occur on operating systems that do their own driver management (Linux, OSX, iOS, Android). If you see this warning, please follow these instructions.&lt;br /&gt;
&lt;br /&gt;
Download FTDI_drivers_2.08.24.zip and unzip it somewhere. Note that most likely redistributing this driver like we do here is a violation of the FTDI EULA. Do not use this driver if that is an issue for your project. The driver can be found on the lab computer and the installer can be found [smb://cnas.ru.nl/Wrkgrp/TDD/Donders-DCC-TDD/Drivers/FTDI_drivers_2.08.24.zip here].&lt;br /&gt;
&lt;br /&gt;
Plug in the buttonbox and wait for all the drivers to be installed and loaded. If you plugged in the buttonbox before, this will be almost immediately.&lt;br /&gt;
&lt;br /&gt;
Click the Windows start button, Computer, System Properties, Device Manager. Unfold Universal Serial Bus controllers. You now see the screen below.&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar0.png]]&lt;br /&gt;
&lt;br /&gt;
Right-click USB Serial Converter and choose Update Driver Software...&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar1.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Browse my computer for driver software.&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar2.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Let me pick...&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar3.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Have disk en select the file ftdibus.inf from the previously unzipped file. Click OK, next&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar4.png]]&lt;br /&gt;
&lt;br /&gt;
Click yes, close and ignore anything that windows may say about restarting the computer. Your buttonbox now works.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Microsoft_Windows_driver_issue&amp;diff=6339&amp;oldid=0</id>
		<title>Microsoft Windows driver issue</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Microsoft_Windows_driver_issue&amp;diff=6339&amp;oldid=0"/>
		<updated>2026-04-14T15:32:28Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; moved page &lt;a href=&quot;/index.php?title=Microsoft_Windows_driver_issue&amp;amp;redirect=no&quot; class=&quot;mw-redirect&quot; title=&quot;Microsoft Windows driver issue&quot;&gt;Microsoft Windows driver issue&lt;/a&gt; to &lt;a href=&quot;/index.php?title=ButtonBox%5CMicrosoft_Windows_driver_issue&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;ButtonBox\Microsoft Windows driver issue (page does not exist)&quot;&gt;ButtonBox\Microsoft Windows driver issue&lt;/a&gt; Scope&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Buttonbox driver issue ==&lt;br /&gt;
&lt;br /&gt;
Future Technology Devices International Ltd. (ftdi) is currently convincing people not to use their software for hardware produced by other companies in a rather aggressive way. As a result you may see the text NON GENUINE DEVICE FOUND! or part of it when connecting to our buttonbox from Windows 7 or later. The issue does not occur on operating systems that do their own driver management (Linux, OSX, iOS, Android). If you see this warning, please follow these instructions.&lt;br /&gt;
&lt;br /&gt;
Download FTDI_drivers_2.08.24.zip and unzip it somewhere. Note that most likely redistributing this driver like we do here is a violation of the FTDI EULA. Do not use this driver if that is an issue for your project. The driver can be found on the lab computer and the installer can be found [smb://cnas.ru.nl/Wrkgrp/TDD/Donders-DCC-TDD/Drivers/FTDI_drivers_2.08.24.zip here].&lt;br /&gt;
&lt;br /&gt;
Plug in the buttonbox and wait for all the drivers to be installed and loaded. If you plugged in the buttonbox before, this will be almost immediately.&lt;br /&gt;
&lt;br /&gt;
Click the Windows start button, Computer, System Properties, Device Manager. Unfold Universal Serial Bus controllers. You now see the screen below.&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar0.png]]&lt;br /&gt;
&lt;br /&gt;
Right-click USB Serial Converter and choose Update Driver Software...&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar1.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Browse my computer for driver software.&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar2.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Let me pick...&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar3.png]]&lt;br /&gt;
&lt;br /&gt;
Choose Have disk en select the file ftdibus.inf from the previously unzipped file. Click OK, next&lt;br /&gt;
&lt;br /&gt;
[[File:Ftdiwar4.png]]&lt;br /&gt;
&lt;br /&gt;
Click yes, close and ignore anything that windows may say about restarting the computer. Your buttonbox now works.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=File:ChooseLanguageSettings.png&amp;diff=6333&amp;oldid=0</id>
		<title>File:ChooseLanguageSettings.png</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=File:ChooseLanguageSettings.png&amp;diff=6333&amp;oldid=0"/>
		<updated>2026-04-14T12:00:57Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; uploaded a new version of &lt;a href=&quot;/index.php/File:ChooseLanguageSettings.png&quot; title=&quot;File:ChooseLanguageSettings.png&quot;&gt;File:ChooseLanguageSettings.png&lt;/a&gt; Updated to 2026 lab computer with Windows 11&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=File:K70_PRO_TKL_Manual_Quick_Start_Guide_CORSAIR.pdf&amp;diff=6331&amp;oldid=0</id>
		<title>File:K70 PRO TKL Manual Quick Start Guide CORSAIR.pdf</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=File:K70_PRO_TKL_Manual_Quick_Start_Guide_CORSAIR.pdf&amp;diff=6331&amp;oldid=0"/>
		<updated>2026-04-14T08:40:39Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php/User:E.vandenberge&quot; class=&quot;mw-redirect mw-userlink&quot; title=&quot;User:E.vandenberge&quot;&gt;&lt;bdi&gt;E.vandenberge&lt;/bdi&gt;&lt;/a&gt; uploaded &lt;a href=&quot;/index.php/File:K70_PRO_TKL_Manual_Quick_Start_Guide_CORSAIR.pdf&quot; title=&quot;File:K70 PRO TKL Manual Quick Start Guide CORSAIR.pdf&quot;&gt;File:K70 PRO TKL Manual Quick Start Guide CORSAIR.pdf&lt;/a&gt; Source: https://www.corsair.com/eu/en/explorer/gamer/keyboards/k70-pro-tkl/&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Summary ==&lt;br /&gt;
Source: https://www.corsair.com/eu/en/explorer/gamer/keyboards/k70-pro-tkl/&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
</feed>