<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://sandboxwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sandbox</id>
	<title>Sandbox Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://sandboxwiki.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Sandbox"/>
	<link rel="alternate" type="text/html" href="https://sandboxwiki.com/Special:Contributions/Sandbox"/>
	<updated>2026-06-01T17:14:59Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Gadget-Navbar.js&amp;diff=31</id>
		<title>MediaWiki:Gadget-Navbar.js</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Gadget-Navbar.js&amp;diff=31"/>
		<updated>2026-05-16T00:57:01Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(function () {&lt;br /&gt;
    var style =&lt;br /&gt;
        &#039;.czn-navbar{position:absolute;top:0;left:0;width:100%;height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 40px;box-sizing:border-box;z-index:9999;border-bottom:1px solid rgba(255,255,255,0.05); a:visited{color:#fff}}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__left,.czn-navbar__right{flex:1;display:flex;align-items:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__left{justify-content:flex-start}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__center{display:flex;justify-content:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__right{justify-content:flex-end;gap:20px}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__logo-link{display:block}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__logo{height:40px;width:auto;object-fit:contain;display:block}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search{position:relative}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-form{display:flex;align-items:center;margin:0}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input{background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.2);color:#fff;padding:8px 85px 8px 15px;border-radius:20px;width:240px;outline:none;transition:all 0.3s;font-size:14px;box-sizing:border-box}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input::placeholder{color:rgba(255,255,255,0.4)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input:focus{border-color:#ff540c;background:rgba(255,255,255,0.15)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-button{position:absolute;right:4px;top:50%;transform:translateY(-50%);background:#ff540c;color:#fff;border:none;padding:5px 14px;border-radius:16px;cursor:pointer;font-size:12px;font-weight:bold;letter-spacing:1px;transition:all 0.3s}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-button:hover{background:#ff6a2a}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__menu{display:flex;list-style:none;gap:30px;margin:0;padding:0;height:100%;align-items:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item{position:relative;list-style:none}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__link{text-decoration:none!important;display:flex;align-items:center;justify-content:center;padding:10px 0;color:#ffffff;font-size:14px;font-weight:bold;letter-spacing:2px;transition:color 0.3s}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item:hover&amp;gt;.czn-navbar__link,.czn-navbar__item--active&amp;gt;.czn-navbar__link{color:#ff540c}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__dropdown{position:absolute;top:100%;left:50%;transform:translateX(-50%) translateY(15px);background:rgba(0,0,0,0.85);border-radius:8px;min-width:160px;padding:10px 0;opacity:0;visibility:hidden;transition:all 0.4s cubic-bezier(0.175,0.885,0.32,1.275);box-shadow:0 10px 30px rgba(0,0,0,0.5);list-style:none;margin:0}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item:hover&amp;gt;.czn-navbar__dropdown{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__dropdown .czn-navbar__link{padding:12px 20px;text-align:center;display:block;font-size:13px;letter-spacing:1px}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__toggle{display:none;color:#fff;font-size:28px;cursor:pointer;z-index:10001;position:relative;background:none;border:none;padding:0;line-height:1}&#039; +&lt;br /&gt;
        &#039;@media(max-width:900px){&#039; +&lt;br /&gt;
            &#039;.czn-navbar{padding:0 20px}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__logo-link{display:none}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__search{display:none}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__toggle{display:block}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__menu{position:fixed;top:0;left:-100%;width:260px;height:100vh;background:rgba(15,15,15,0.98);flex-direction:column;gap:0;padding-top:80px;transition:left 0.4s ease-in-out;overflow-y:auto;border-right:1px solid rgba(255,255,255,0.1);z-index:10000;margin:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__menu--open{left:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__item{width:100%}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__link{padding:15px 20px;justify-content:flex-start;border-bottom:1px solid rgba(255,255,255,0.05)}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__dropdown{position:static;transform:none!important;opacity:1;visibility:visible;box-shadow:none;background:transparent;padding:0;width:100%;border-radius:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__dropdown .czn-navbar__link{padding-left:40px;background:rgba(255,255,255,0.02);text-align:left}&#039; +&lt;br /&gt;
        &#039;}&#039;;&lt;br /&gt;
&lt;br /&gt;
    var BASE = &#039;https://sandboxwiki.com/index.php/&#039;;&lt;br /&gt;
    var ACTION_BASE = &#039;https://sandboxwiki.com/index.php&#039;;&lt;br /&gt;
&lt;br /&gt;
    function wikiUrl(title) {&lt;br /&gt;
        return BASE + encodeURIComponent(title).replace(/%2F/g, &#039;/&#039;).replace(/%3A/g, &#039;:&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function actionUrl(title, action) {&lt;br /&gt;
        return ACTION_BASE + &#039;?title=&#039; + encodeURIComponent(title) + &#039;&amp;amp;action=&#039; + action;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var navHtml =&lt;br /&gt;
        &#039;&amp;lt;nav class=&amp;quot;czn-navbar&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__left&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;button class=&amp;quot;czn-navbar__toggle&amp;quot; id=&amp;quot;czn-navbar-toggle&amp;quot; type=&amp;quot;button&amp;quot;&amp;gt;☰&amp;lt;/button&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__logo-link&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;img src=&amp;quot;https://sandboxwiki.com/images/e/ed/Bi_chaos_zero_nightmare.png&amp;quot; alt=&amp;quot;bi_chaos_zero_nightmare.png&amp;quot; class=&amp;quot;czn-navbar__logo&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__center&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;ul class=&amp;quot;czn-navbar__menu&amp;quot; id=&amp;quot;czn-navbar-menu&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item czn-navbar__item--active&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;HOME&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;BACK&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + actionUrl(&#039;Main_Page&#039;, &#039;purge&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;PURGE&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;WIKI&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Combatant&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;COMBATANT&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Partner&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;PARTNER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Card&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;CARD&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Relic&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;RELIC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Encounter&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ENCOUNTER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;DATA&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Fate&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;FATE&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Item&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ITEM&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Art&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ART&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;TOOLS&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Deck_Builder&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;DECK BUILDER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__right&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;div class=&amp;quot;czn-navbar__search&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;form action=&amp;quot;&#039; + ACTION_BASE + &#039;&amp;quot; method=&amp;quot;get&amp;quot; class=&amp;quot;czn-navbar__search-form&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;title&amp;quot; value=&amp;quot;Special:Search&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;search&amp;quot; placeholder=&amp;quot;Search WIKI...&amp;quot; class=&amp;quot;czn-navbar__search-input&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;button type=&amp;quot;submit&amp;quot; name=&amp;quot;go&amp;quot; class=&amp;quot;czn-navbar__search-button&amp;quot;&amp;gt;SEARCH&amp;lt;/button&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/form&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
        &#039;&amp;lt;/nav&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    function q(s) { return document.querySelector(s); }&lt;br /&gt;
&lt;br /&gt;
    function initNav() {&lt;br /&gt;
        if (q(&#039;.czn-navbar&#039;)) return;&lt;br /&gt;
&lt;br /&gt;
        var styleTag = document.createElement(&#039;style&#039;);&lt;br /&gt;
        styleTag.type = &#039;text/css&#039;;&lt;br /&gt;
        if (styleTag.styleSheet) {&lt;br /&gt;
            styleTag.styleSheet.cssText = style;&lt;br /&gt;
        } else {&lt;br /&gt;
            styleTag.appendChild(document.createTextNode(style));&lt;br /&gt;
        }&lt;br /&gt;
        document.getElementsByTagName(&#039;head&#039;)[0].appendChild(styleTag);&lt;br /&gt;
&lt;br /&gt;
        var body = document.body || document.getElementsByTagName(&#039;body&#039;)[0];&lt;br /&gt;
        body.insertAdjacentHTML(&#039;afterbegin&#039;, navHtml);&lt;br /&gt;
&lt;br /&gt;
        var mobileBtn = document.getElementById(&#039;czn-navbar-toggle&#039;);&lt;br /&gt;
        var navMenu = document.getElementById(&#039;czn-navbar-menu&#039;);&lt;br /&gt;
&lt;br /&gt;
        if (mobileBtn &amp;amp;&amp;amp; navMenu) {&lt;br /&gt;
            mobileBtn.addEventListener(&#039;click&#039;, function (e) {&lt;br /&gt;
                e.stopPropagation();&lt;br /&gt;
                navMenu.classList.toggle(&#039;czn-navbar__menu--open&#039;);&lt;br /&gt;
                mobileBtn.innerHTML = navMenu.classList.contains(&#039;czn-navbar__menu--open&#039;) ? &#039;✕&#039; : &#039;☰&#039;;&lt;br /&gt;
            });&lt;br /&gt;
&lt;br /&gt;
            document.addEventListener(&#039;click&#039;, function (e) {&lt;br /&gt;
                if (window.innerWidth &amp;lt;= 900) {&lt;br /&gt;
                    if (!navMenu.contains(e.target) &amp;amp;&amp;amp; !mobileBtn.contains(e.target)) {&lt;br /&gt;
                        navMenu.classList.remove(&#039;czn-navbar__menu--open&#039;);&lt;br /&gt;
                        mobileBtn.innerHTML = &#039;☰&#039;;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    initNav();&lt;br /&gt;
})();&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=30</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=30"/>
		<updated>2026-05-16T00:51:21Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
@import url(&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
@font-face {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    src: url(&#039;/fonts/czn.ttf&#039;) format(&#039;truetype&#039;);&lt;br /&gt;
    font-weight: normal;&lt;br /&gt;
    font-style: normal;&lt;br /&gt;
    font-display: swap;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
:root {&lt;br /&gt;
    --color-czn: #ff540c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Fix -webkit-focus-ring-color */&lt;br /&gt;
a:focus {&lt;br /&gt;
    outline: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a:focus,a:hover {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    background: url(https://sandboxwiki.com/images/3/3a/Bg.png);&lt;br /&gt;
    background-attachment: fixed;&lt;br /&gt;
    background-size: cover;&lt;br /&gt;
    background-position: center;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#p-logo, #p-navigation, #p-tb, #mw-head, .mw-editsection, .mw-footer {&lt;br /&gt;
    display: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mw-page-base {&lt;br /&gt;
    background: transparent;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#content {&lt;br /&gt;
    width: 1200px;&lt;br /&gt;
    max-width: 1200px;&lt;br /&gt;
    margin: auto;&lt;br /&gt;
    border: none;&lt;br /&gt;
    border-radius: 8px;&lt;br /&gt;
    background: rgba(255,255,255,0.8);&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Gadgets-definition&amp;diff=29</id>
		<title>MediaWiki:Gadgets-definition</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Gadgets-definition&amp;diff=29"/>
		<updated>2026-05-16T00:50:29Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;== System == * Navbar[ResourceLoader|default|hidden]|Navbar.js&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== System ==&lt;br /&gt;
* Navbar[ResourceLoader|default|hidden]|Navbar.js&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Gadget-Navbar.js&amp;diff=28</id>
		<title>MediaWiki:Gadget-Navbar.js</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Gadget-Navbar.js&amp;diff=28"/>
		<updated>2026-05-16T00:49:30Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;(function () {     var style =         &amp;#039;.czn-navbar{position:absolute;top:0;left:0;width:100%;height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 40px;z-index:9999;border-bottom:1px solid rgba(255,255,255,0.05)}&amp;#039; +         &amp;#039;.czn-navbar__left,.czn-navbar__right{flex:1;display:flex;align-items:center}&amp;#039; +         &amp;#039;.czn-navbar__left{justify-content:flex-start}&amp;#039; +         &amp;#039;.czn-navbar__center{display:flex;justify-content:center}&amp;#039; +         &amp;#039;.cz...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;(function () {&lt;br /&gt;
    var style =&lt;br /&gt;
        &#039;.czn-navbar{position:absolute;top:0;left:0;width:100%;height:70px;display:flex;align-items:center;justify-content:space-between;padding:0 40px;z-index:9999;border-bottom:1px solid rgba(255,255,255,0.05)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__left,.czn-navbar__right{flex:1;display:flex;align-items:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__left{justify-content:flex-start}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__center{display:flex;justify-content:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__right{justify-content:flex-end;gap:20px}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__logo-link{display:block}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__logo{height:40px;width:auto;object-fit:contain;display:block}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search{position:relative}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-form{display:flex;align-items:center;margin:0}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input{background:rgba(255,255,255,0.1);border:1px solid rgba(255,255,255,0.2);color:#fff;padding:8px 85px 8px 15px;border-radius:20px;width:240px;outline:none;transition:all 0.3s;font-size:14px;box-sizing:border-box}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input::placeholder{color:rgba(255,255,255,0.4)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-input:focus{border-color:#ff540c;background:rgba(255,255,255,0.15)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-button{position:absolute;right:4px;top:50%;transform:translateY(-50%);background:#ff540c;color:#fff;border:none;padding:5px 14px;border-radius:16px;cursor:pointer;font-size:12px;font-weight:bold;letter-spacing:1px;transition:all 0.3s}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__search-button:hover{background:#ff6a2a}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__menu{display:flex;list-style:none;gap:30px;margin:0;padding:0;height:100%;align-items:center}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item{position:relative;list-style:none}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__link{text-decoration:none!important;display:flex;align-items:center;justify-content:center;padding:10px 0;color:#ffffff;font-size:14px;font-weight:bold;letter-spacing:2px;transition:color 0.3s}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item:hover&amp;gt;.czn-navbar__link,.czn-navbar__item--active&amp;gt;.czn-navbar__link{color:#ff540c}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__dropdown{position:absolute;top:100%;left:50%;transform:translateX(-50%) translateY(15px);background:rgba(0,0,0,0.85);border-radius:8px;min-width:160px;padding:10px 0;opacity:0;visibility:hidden;transition:all 0.4s cubic-bezier(0.175,0.885,0.32,1.275);box-shadow:0 10px 30px rgba(0,0,0,0.5);list-style:none;margin:0}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__item:hover&amp;gt;.czn-navbar__dropdown{opacity:1;visibility:visible;transform:translateX(-50%) translateY(0)}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__dropdown .czn-navbar__link{padding:12px 20px;text-align:center;display:block;font-size:13px;letter-spacing:1px}&#039; +&lt;br /&gt;
        &#039;.czn-navbar__toggle{display:none;color:#fff;font-size:28px;cursor:pointer;z-index:10001;position:relative;background:none;border:none;padding:0;line-height:1}&#039; +&lt;br /&gt;
        &#039;@media(max-width:900px){&#039; +&lt;br /&gt;
            &#039;.czn-navbar{padding:0 20px}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__logo-link{display:none}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__search{display:none}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__toggle{display:block}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__menu{position:fixed;top:0;left:-100%;width:260px;height:100vh;background:rgba(15,15,15,0.98);flex-direction:column;gap:0;padding-top:80px;transition:left 0.4s ease-in-out;overflow-y:auto;border-right:1px solid rgba(255,255,255,0.1);z-index:10000;margin:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__menu--open{left:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__item{width:100%}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__link{padding:15px 20px;justify-content:flex-start;border-bottom:1px solid rgba(255,255,255,0.05)}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__dropdown{position:static;transform:none!important;opacity:1;visibility:visible;box-shadow:none;background:transparent;padding:0;width:100%;border-radius:0}&#039; +&lt;br /&gt;
            &#039;.czn-navbar__dropdown .czn-navbar__link{padding-left:40px;background:rgba(255,255,255,0.02);text-align:left}&#039; +&lt;br /&gt;
        &#039;}&#039;;&lt;br /&gt;
&lt;br /&gt;
    var BASE = &#039;https://sandboxwiki.com/index.php/&#039;;&lt;br /&gt;
    var ACTION_BASE = &#039;https://sandboxwiki.com/index.php&#039;;&lt;br /&gt;
&lt;br /&gt;
    function wikiUrl(title) {&lt;br /&gt;
        return BASE + encodeURIComponent(title).replace(/%2F/g, &#039;/&#039;).replace(/%3A/g, &#039;:&#039;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    function actionUrl(title, action) {&lt;br /&gt;
        return ACTION_BASE + &#039;?title=&#039; + encodeURIComponent(title) + &#039;&amp;amp;action=&#039; + action;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    var navHtml =&lt;br /&gt;
        &#039;&amp;lt;nav class=&amp;quot;czn-navbar&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__left&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;button class=&amp;quot;czn-navbar__toggle&amp;quot; id=&amp;quot;czn-navbar-toggle&amp;quot; type=&amp;quot;button&amp;quot;&amp;gt;☰&amp;lt;/button&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__logo-link&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;img src=&amp;quot;https://sandboxwiki.com/images/e/ed/Bi_chaos_zero_nightmare.png&amp;quot; alt=&amp;quot;bi_chaos_zero_nightmare.png&amp;quot; class=&amp;quot;czn-navbar__logo&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__center&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;ul class=&amp;quot;czn-navbar__menu&amp;quot; id=&amp;quot;czn-navbar-menu&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item czn-navbar__item--active&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;HOME&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Main_Page&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;BACK&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + actionUrl(&#039;Main_Page&#039;, &#039;purge&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;PURGE&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;WIKI&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Combatant&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;COMBATANT&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Partner&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;PARTNER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Card&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;CARD&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Relic&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;RELIC&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Encounter&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ENCOUNTER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;DATA&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Fate&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;FATE&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Item&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ITEM&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Art&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;ART&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;a href=&amp;quot;#&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;TOOLS&amp;lt;/a&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;ul class=&amp;quot;czn-navbar__dropdown&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                            &#039;&amp;lt;li class=&amp;quot;czn-navbar__item&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;&#039; + wikiUrl(&#039;Deck_Builder&#039;) + &#039;&amp;quot; class=&amp;quot;czn-navbar__link&amp;quot;&amp;gt;DECK BUILDER&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/li&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/ul&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;div class=&amp;quot;czn-navbar__right&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;div class=&amp;quot;czn-navbar__search&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;form action=&amp;quot;&#039; + ACTION_BASE + &#039;&amp;quot; method=&amp;quot;get&amp;quot; class=&amp;quot;czn-navbar__search-form&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;title&amp;quot; value=&amp;quot;Special:Search&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;search&amp;quot; placeholder=&amp;quot;Search WIKI...&amp;quot; class=&amp;quot;czn-navbar__search-input&amp;quot;&amp;gt;&#039; +&lt;br /&gt;
                        &#039;&amp;lt;button type=&amp;quot;submit&amp;quot; name=&amp;quot;go&amp;quot; class=&amp;quot;czn-navbar__search-button&amp;quot;&amp;gt;SEARCH&amp;lt;/button&amp;gt;&#039; +&lt;br /&gt;
                    &#039;&amp;lt;/form&amp;gt;&#039; +&lt;br /&gt;
                &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
            &#039;&amp;lt;/div&amp;gt;&#039; +&lt;br /&gt;
        &#039;&amp;lt;/nav&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
    function q(s) { return document.querySelector(s); }&lt;br /&gt;
&lt;br /&gt;
    function initNav() {&lt;br /&gt;
        if (q(&#039;.czn-navbar&#039;)) return;&lt;br /&gt;
&lt;br /&gt;
        var styleTag = document.createElement(&#039;style&#039;);&lt;br /&gt;
        styleTag.type = &#039;text/css&#039;;&lt;br /&gt;
        if (styleTag.styleSheet) {&lt;br /&gt;
            styleTag.styleSheet.cssText = style;&lt;br /&gt;
        } else {&lt;br /&gt;
            styleTag.appendChild(document.createTextNode(style));&lt;br /&gt;
        }&lt;br /&gt;
        document.getElementsByTagName(&#039;head&#039;)[0].appendChild(styleTag);&lt;br /&gt;
&lt;br /&gt;
        var body = document.body || document.getElementsByTagName(&#039;body&#039;)[0];&lt;br /&gt;
        body.insertAdjacentHTML(&#039;afterbegin&#039;, navHtml);&lt;br /&gt;
&lt;br /&gt;
        var mobileBtn = document.getElementById(&#039;czn-navbar-toggle&#039;);&lt;br /&gt;
        var navMenu = document.getElementById(&#039;czn-navbar-menu&#039;);&lt;br /&gt;
&lt;br /&gt;
        if (mobileBtn &amp;amp;&amp;amp; navMenu) {&lt;br /&gt;
            mobileBtn.addEventListener(&#039;click&#039;, function (e) {&lt;br /&gt;
                e.stopPropagation();&lt;br /&gt;
                navMenu.classList.toggle(&#039;czn-navbar__menu--open&#039;);&lt;br /&gt;
                mobileBtn.innerHTML = navMenu.classList.contains(&#039;czn-navbar__menu--open&#039;) ? &#039;✕&#039; : &#039;☰&#039;;&lt;br /&gt;
            });&lt;br /&gt;
&lt;br /&gt;
            document.addEventListener(&#039;click&#039;, function (e) {&lt;br /&gt;
                if (window.innerWidth &amp;lt;= 900) {&lt;br /&gt;
                    if (!navMenu.contains(e.target) &amp;amp;&amp;amp; !mobileBtn.contains(e.target)) {&lt;br /&gt;
                        navMenu.classList.remove(&#039;czn-navbar__menu--open&#039;);&lt;br /&gt;
                        mobileBtn.innerHTML = &#039;☰&#039;;&lt;br /&gt;
                    }&lt;br /&gt;
                }&lt;br /&gt;
            });&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    initNav();&lt;br /&gt;
})();&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=File:Bi_chaos_zero_nightmare.png&amp;diff=27</id>
		<title>File:Bi chaos zero nightmare.png</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=File:Bi_chaos_zero_nightmare.png&amp;diff=27"/>
		<updated>2026-05-16T00:47:35Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=26</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=26"/>
		<updated>2026-05-15T13:59:48Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Template:Documentation/styles.css&amp;quot; /&amp;gt;&lt;br /&gt;
{{#invoke:Documentation|main}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
[[Category:Documentation templates]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=25</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=25"/>
		<updated>2026-05-15T13:59:19Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
    local docTitle = mw.title.new(currentTitle.prefixedText .. &#039;/doc&#039;)&lt;br /&gt;
    &lt;br /&gt;
    local container = mw.html.create(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation&#039;)&lt;br /&gt;
&lt;br /&gt;
    local header = container:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-header&#039;)&lt;br /&gt;
&lt;br /&gt;
    header:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-title&#039;)&lt;br /&gt;
        :wikitext(&#039;&amp;lt;i class=&amp;quot;fas fa-book-open&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; Template documentation&#039;)&lt;br /&gt;
&lt;br /&gt;
    local links = header:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-links&#039;)&lt;br /&gt;
&lt;br /&gt;
    if docTitle.exists then&lt;br /&gt;
        links:wikitext(string.format(&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-eye&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [[%s|View]] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-edit&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s Edit] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-history&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s History] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-sync-alt&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s Purge] ]&#039;,&lt;br /&gt;
            docTitle.prefixedText,&lt;br /&gt;
            docTitle:fullUrl(&#039;action=edit&#039;),&lt;br /&gt;
            docTitle:fullUrl(&#039;action=history&#039;),&lt;br /&gt;
            currentTitle:fullUrl(&#039;action=purge&#039;)&lt;br /&gt;
        ))&lt;br /&gt;
    else&lt;br /&gt;
        links:wikitext(string.format(&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-plus-circle&amp;quot; style=&amp;quot;color:#d33;&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s Create documentation] ]&#039;,&lt;br /&gt;
            docTitle:fullUrl(&#039;action=edit&amp;amp;redlink=1&#039;)&lt;br /&gt;
        ))&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local content = container:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-content&#039;)&lt;br /&gt;
&lt;br /&gt;
    if docTitle.exists then&lt;br /&gt;
        content:wikitext(frame:expandTemplate{ title = docTitle.prefixedText })&lt;br /&gt;
    else&lt;br /&gt;
        content:wikitext(&#039;&amp;lt;i class=&amp;quot;fas fa-exclamation-circle&amp;quot; style=&amp;quot;color:#d33;&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; This template has no documentation yet. Please click the link above to create it.&#039;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return tostring(container)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=24</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=24"/>
		<updated>2026-05-15T13:56:30Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;templatestyles src=&amp;quot;Template:Documentation/styles.css&amp;quot; /&amp;gt;&lt;br /&gt;
{{#invoke:Documentation|main}}&lt;br /&gt;
&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;!-- 请将 Template:Documentation 的分类加在下方 --&amp;gt;&lt;br /&gt;
[[Category:文档模板]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=23</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=23"/>
		<updated>2026-05-15T13:56:11Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Replaced content with &amp;quot;-- Module:Documentation local p = {}  function p.main(frame)     local currentTitle = mw.title.getCurrentTitle()     local docTitle = mw.title.new(currentTitle.prefixedText .. &amp;#039;/doc&amp;#039;)          -- 创建主容器     local container = mw.html.create(&amp;#039;div&amp;#039;)         :addClass(&amp;#039;template-documentation&amp;#039;)      -- 创建头部区域     local header = container:tag(&amp;#039;div&amp;#039;)         :addClass(&amp;#039;template-documentation-header&amp;#039;)      -- 标题及图标 (使用 FontAwesome)     head...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- Module:Documentation&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
    local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
    local docTitle = mw.title.new(currentTitle.prefixedText .. &#039;/doc&#039;)&lt;br /&gt;
    &lt;br /&gt;
    -- 创建主容器&lt;br /&gt;
    local container = mw.html.create(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation&#039;)&lt;br /&gt;
&lt;br /&gt;
    -- 创建头部区域&lt;br /&gt;
    local header = container:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-header&#039;)&lt;br /&gt;
&lt;br /&gt;
    -- 标题及图标 (使用 FontAwesome)&lt;br /&gt;
    header:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-title&#039;)&lt;br /&gt;
        :wikitext(&#039;&amp;lt;i class=&amp;quot;fas fa-book-open&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; 模板文档&#039;)&lt;br /&gt;
&lt;br /&gt;
    -- 操作链接及图标&lt;br /&gt;
    local links = header:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-links&#039;)&lt;br /&gt;
&lt;br /&gt;
    if docTitle.exists then&lt;br /&gt;
        -- 如果文档存在，显示查看、编辑、历史&lt;br /&gt;
        links:wikitext(string.format(&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-eye&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [[%s|查看]] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-edit&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s 编辑] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-history&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s 历史] ] &#039; ..&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-sync-alt&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s 刷新] ]&#039;,&lt;br /&gt;
            docTitle.prefixedText,&lt;br /&gt;
            docTitle:fullUrl(&#039;action=edit&#039;),&lt;br /&gt;
            docTitle:fullUrl(&#039;action=history&#039;),&lt;br /&gt;
            currentTitle:fullUrl(&#039;action=purge&#039;)&lt;br /&gt;
        ))&lt;br /&gt;
    else&lt;br /&gt;
        -- 如果文档不存在，显示创建链接&lt;br /&gt;
        links:wikitext(string.format(&lt;br /&gt;
            &#039;[ &amp;lt;i class=&amp;quot;fas fa-plus-circle&amp;quot; style=&amp;quot;color:#d33;&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; [%s 创建文档] ]&#039;,&lt;br /&gt;
            docTitle:fullUrl(&#039;action=edit&amp;amp;redlink=1&#039;)&lt;br /&gt;
        ))&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- 创建内容区域&lt;br /&gt;
    local content = container:tag(&#039;div&#039;)&lt;br /&gt;
        :addClass(&#039;template-documentation-content&#039;)&lt;br /&gt;
&lt;br /&gt;
    if docTitle.exists then&lt;br /&gt;
        -- 嵌入包含 /doc 页面的内容&lt;br /&gt;
        content:wikitext(frame:expandTemplate{ title = docTitle.prefixedText })&lt;br /&gt;
    else&lt;br /&gt;
        content:wikitext(&#039;&amp;lt;i class=&amp;quot;fas fa-exclamation-circle&amp;quot; style=&amp;quot;color:#d33;&amp;quot;&amp;gt;&amp;lt;/i&amp;gt; 该模板暂无文档。请点击上方链接创建。&#039;)&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    return tostring(container)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Template:Documentation/styles.css&amp;diff=22</id>
		<title>Template:Documentation/styles.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Template:Documentation/styles.css&amp;diff=22"/>
		<updated>2026-05-15T13:55:48Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;.template-documentation {     clear: both;     margin: 1em 0 0 0;     border: 1px dashed #a2a9b1;     background-color: #ecfcf4;     padding: 1em;     box-shadow: 0 1px 3px rgba(0,0,0,0.05); }  .template-documentation-header {     display: flex;     justify-content: space-between;     align-items: center;     padding-bottom: 0.5em;     border-bottom: 1px solid #8bd9a8;     margin-bottom: 1em; }  .template-documentation-title {     font-size: 125%;     font-weight: bold;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;.template-documentation {&lt;br /&gt;
    clear: both;&lt;br /&gt;
    margin: 1em 0 0 0;&lt;br /&gt;
    border: 1px dashed #a2a9b1;&lt;br /&gt;
    background-color: #ecfcf4;&lt;br /&gt;
    padding: 1em;&lt;br /&gt;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-header {&lt;br /&gt;
    display: flex;&lt;br /&gt;
    justify-content: space-between;&lt;br /&gt;
    align-items: center;&lt;br /&gt;
    padding-bottom: 0.5em;&lt;br /&gt;
    border-bottom: 1px solid #8bd9a8;&lt;br /&gt;
    margin-bottom: 1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-title {&lt;br /&gt;
    font-size: 125%;&lt;br /&gt;
    font-weight: bold;&lt;br /&gt;
    color: #000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-title i {&lt;br /&gt;
    color: #14866d;&lt;br /&gt;
    margin-right: 5px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-links {&lt;br /&gt;
    font-size: 90%;&lt;br /&gt;
    color: #54595d;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-links i {&lt;br /&gt;
    margin-right: 3px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.template-documentation-content {&lt;br /&gt;
    font-size: 100%;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=21</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=21"/>
		<updated>2026-05-15T13:47:11Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:Documentation|main}}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=20</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Template:Documentation&amp;diff=20"/>
		<updated>2026-05-15T13:46:11Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Replaced content with &amp;quot;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:TableTools&amp;diff=19</id>
		<title>Module:TableTools</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:TableTools&amp;diff=19"/>
		<updated>2026-05-15T13:41:25Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;--[[ ------------------------------------------------------------------------------------ --                               TableTools                                       -- --                                                                                -- -- This module includes a number of functions for dealing with Lua tables.        -- -- It is a meta-module, meant to be called from other Lua modules, and should     -- -- not be called directly from #invoke....&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--                               TableTools                                       --&lt;br /&gt;
--                                                                                --&lt;br /&gt;
-- This module includes a number of functions for dealing with Lua tables.        --&lt;br /&gt;
-- It is a meta-module, meant to be called from other Lua modules, and should     --&lt;br /&gt;
-- not be called directly from #invoke.                                           --&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local libraryUtil = require(&#039;libraryUtil&#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Define often-used variables and functions.&lt;br /&gt;
local floor = math.floor&lt;br /&gt;
local infinity = math.huge&lt;br /&gt;
local checkType = libraryUtil.checkType&lt;br /&gt;
local checkTypeMulti = libraryUtil.checkTypeMulti&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- isPositiveInteger&lt;br /&gt;
--&lt;br /&gt;
-- This function returns true if the given value is a positive integer, and false&lt;br /&gt;
-- if not. Although it doesn&#039;t operate on tables, it is included here as it is&lt;br /&gt;
-- useful for determining whether a given table key is in the array part or the&lt;br /&gt;
-- hash part of a table.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.isPositiveInteger(v)&lt;br /&gt;
	if type(v) == &#039;number&#039; and v &amp;gt;= 1 and floor(v) == v and v &amp;lt; infinity then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- isNan&lt;br /&gt;
--&lt;br /&gt;
-- This function returns true if the given number is a NaN value, and false&lt;br /&gt;
-- if not. Although it doesn&#039;t operate on tables, it is included here as it is&lt;br /&gt;
-- useful for determining whether a value can be a valid table key. Lua will&lt;br /&gt;
-- generate an error if a NaN is used as a table key.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.isNan(v)&lt;br /&gt;
	if type(v) == &#039;number&#039; and tostring(v) == &#039;-nan&#039; then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- shallowClone&lt;br /&gt;
--&lt;br /&gt;
-- This returns a clone of a table. The value returned is a new table, but all&lt;br /&gt;
-- subtables and functions are shared. Metamethods are respected, but the returned&lt;br /&gt;
-- table will have no metatable of its own.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.shallowClone(t)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k, v in pairs(t) do&lt;br /&gt;
		ret[k] = v&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- removeDuplicates&lt;br /&gt;
--&lt;br /&gt;
-- This removes duplicate values from an array. Non-positive-integer keys are&lt;br /&gt;
-- ignored. The earliest value is kept, and all subsequent duplicate values are&lt;br /&gt;
-- removed, but otherwise the array order is unchanged.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.removeDuplicates(t)&lt;br /&gt;
	checkType(&#039;removeDuplicates&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	local isNan = p.isNan&lt;br /&gt;
	local ret, exists = {}, {}&lt;br /&gt;
	for i, v in ipairs(t) do&lt;br /&gt;
		if isNan(v) then&lt;br /&gt;
			-- NaNs can&#039;t be table keys, and they are also unique, so we don&#039;t need to check existence.&lt;br /&gt;
			ret[#ret + 1] = v&lt;br /&gt;
		else&lt;br /&gt;
			if not exists[v] then&lt;br /&gt;
				ret[#ret + 1] = v&lt;br /&gt;
				exists[v] = true&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end			&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- numKeys&lt;br /&gt;
--&lt;br /&gt;
-- This takes a table and returns an array containing the numbers of any numerical&lt;br /&gt;
-- keys that have non-nil values, sorted in numerical order.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.numKeys(t)&lt;br /&gt;
	checkType(&#039;numKeys&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	local isPositiveInteger = p.isPositiveInteger&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(t) do&lt;br /&gt;
		if isPositiveInteger(k) then&lt;br /&gt;
			nums[#nums + 1] = k&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;
------------------------------------------------------------------------------------&lt;br /&gt;
-- affixNums&lt;br /&gt;
--&lt;br /&gt;
-- This takes a table and returns an array containing the numbers of keys with the&lt;br /&gt;
-- specified prefix and suffix. For example, for the table&lt;br /&gt;
-- {a1 = &#039;foo&#039;, a3 = &#039;bar&#039;, a6 = &#039;baz&#039;} and the prefix &amp;quot;a&amp;quot;, affixNums will&lt;br /&gt;
-- return {1, 3, 6}.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.affixNums(t, prefix, suffix)&lt;br /&gt;
	checkType(&#039;affixNums&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	checkType(&#039;affixNums&#039;, 2, prefix, &#039;string&#039;, true)&lt;br /&gt;
	checkType(&#039;affixNums&#039;, 3, suffix, &#039;string&#039;, true)&lt;br /&gt;
&lt;br /&gt;
	local function cleanPattern(s)&lt;br /&gt;
		-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.&lt;br /&gt;
		s = s:gsub(&#039;([%(%)%%%.%[%]%*%+%-%?%^%$])&#039;, &#039;%%%1&#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	prefix = prefix or &#039;&#039;&lt;br /&gt;
	suffix = suffix or &#039;&#039;&lt;br /&gt;
	prefix = cleanPattern(prefix)&lt;br /&gt;
	suffix = cleanPattern(suffix)&lt;br /&gt;
	local pattern = &#039;^&#039; .. prefix .. &#039;([1-9]%d*)&#039; .. suffix .. &#039;$&#039;&lt;br /&gt;
&lt;br /&gt;
	local nums = {}&lt;br /&gt;
	for k, v in pairs(t) do&lt;br /&gt;
		if type(k) == &#039;string&#039; then			&lt;br /&gt;
			local num = mw.ustring.match(k, pattern)&lt;br /&gt;
			if num then&lt;br /&gt;
				nums[#nums + 1] = tonumber(num)&lt;br /&gt;
			end&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;
------------------------------------------------------------------------------------&lt;br /&gt;
-- numData&lt;br /&gt;
--&lt;br /&gt;
-- Given a table with keys like (&amp;quot;foo1&amp;quot;, &amp;quot;bar1&amp;quot;, &amp;quot;foo2&amp;quot;, &amp;quot;baz2&amp;quot;), returns a table&lt;br /&gt;
-- of subtables in the format &lt;br /&gt;
-- { [1] = {foo = &#039;text&#039;, bar = &#039;text&#039;}, [2] = {foo = &#039;text&#039;, baz = &#039;text&#039;} }&lt;br /&gt;
-- Keys that don&#039;t end with an integer are stored in a subtable named &amp;quot;other&amp;quot;.&lt;br /&gt;
-- The compress option compresses the table so that it can be iterated over with&lt;br /&gt;
-- ipairs.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.numData(t, compress)&lt;br /&gt;
	checkType(&#039;numData&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	checkType(&#039;numData&#039;, 2, compress, &#039;boolean&#039;, true)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for k, v in pairs(t) do&lt;br /&gt;
		local prefix, num = mw.ustring.match(tostring(k), &#039;^([^0-9]*)([1-9][0-9]*)$&#039;)&lt;br /&gt;
		if num then&lt;br /&gt;
			num = tonumber(num)&lt;br /&gt;
			local subtable = ret[num] or {}&lt;br /&gt;
			if prefix == &#039;&#039; then&lt;br /&gt;
				-- Positional parameters match the blank string; put them at the start of the subtable instead.&lt;br /&gt;
				prefix = 1&lt;br /&gt;
			end&lt;br /&gt;
			subtable[prefix] = v&lt;br /&gt;
			ret[num] = subtable&lt;br /&gt;
		else&lt;br /&gt;
			local subtable = ret.other or {}&lt;br /&gt;
			subtable[k] = v&lt;br /&gt;
			ret.other = subtable&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if compress then&lt;br /&gt;
		local other = ret.other&lt;br /&gt;
		ret = p.compressSparseArray(ret)&lt;br /&gt;
		ret.other = other&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- compressSparseArray&lt;br /&gt;
--&lt;br /&gt;
-- This takes an array with one or more nil values, and removes the nil values&lt;br /&gt;
-- while preserving the order, so that the array can be safely traversed with&lt;br /&gt;
-- ipairs.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.compressSparseArray(t)&lt;br /&gt;
	checkType(&#039;compressSparseArray&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local nums = p.numKeys(t)&lt;br /&gt;
	for _, num in ipairs(nums) do&lt;br /&gt;
		ret[#ret + 1] = t[num]&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- sparseIpairs&lt;br /&gt;
--&lt;br /&gt;
-- This is an iterator for sparse arrays. It can be used like ipairs, but can&lt;br /&gt;
-- handle nil values.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
function p.sparseIpairs(t)&lt;br /&gt;
	checkType(&#039;sparseIpairs&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	local nums = p.numKeys(t)&lt;br /&gt;
	local i = 0&lt;br /&gt;
	local lim = #nums&lt;br /&gt;
	return function ()&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		if i &amp;lt;= lim then&lt;br /&gt;
			local key = nums[i]&lt;br /&gt;
			return key, t[key]&lt;br /&gt;
		else&lt;br /&gt;
			return nil, nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
-- size&lt;br /&gt;
--&lt;br /&gt;
-- This returns the size of a key/value pair table. It will also work on arrays,&lt;br /&gt;
-- but for arrays it is more efficient to use the # operator.&lt;br /&gt;
------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
function p.size(t)&lt;br /&gt;
	checkType(&#039;size&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	local i = 0&lt;br /&gt;
	for k in pairs(t) do&lt;br /&gt;
		i = i + 1&lt;br /&gt;
	end&lt;br /&gt;
	return i&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
local function defaultKeySort(item1, item2)&lt;br /&gt;
	-- &amp;quot;number&amp;quot; &amp;lt; &amp;quot;string&amp;quot;, so numbers will be sorted before strings.&lt;br /&gt;
	local type1, type2 = type(item1), type(item2)&lt;br /&gt;
	if type1 ~= type2 then&lt;br /&gt;
		return type1 &amp;lt; type2&lt;br /&gt;
	else -- This will fail with table, boolean, function.&lt;br /&gt;
		return item1 &amp;lt; item2&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Returns a list of the keys in a table, sorted using either a default&lt;br /&gt;
	comparison function or a custom keySort function.&lt;br /&gt;
]]&lt;br /&gt;
function p.keysToList(t, keySort, checked)&lt;br /&gt;
	if not checked then&lt;br /&gt;
		checkType(&#039;keysToList&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
		checkTypeMulti(&#039;keysToList&#039;, 2, keySort, { &#039;function&#039;, &#039;boolean&#039;, &#039;nil&#039; })&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local list = {}&lt;br /&gt;
	local index = 1&lt;br /&gt;
	for key, value in pairs(t) do&lt;br /&gt;
		list[index] = key&lt;br /&gt;
		index = index + 1&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if keySort ~= false then&lt;br /&gt;
		keySort = type(keySort) == &#039;function&#039; and keySort or defaultKeySort&lt;br /&gt;
		&lt;br /&gt;
		table.sort(list, keySort)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return list&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Iterates through a table, with the keys sorted using the keysToList function.&lt;br /&gt;
	If there are only numerical keys, sparseIpairs is probably more efficient.&lt;br /&gt;
]]&lt;br /&gt;
function p.sortedPairs(t, keySort)&lt;br /&gt;
	checkType(&#039;sortedPairs&#039;, 1, t, &#039;table&#039;)&lt;br /&gt;
	checkType(&#039;sortedPairs&#039;, 2, keySort, &#039;function&#039;, true)&lt;br /&gt;
	&lt;br /&gt;
	local list = p.keysToList(t, keySort, true)&lt;br /&gt;
	&lt;br /&gt;
	local i = 0&lt;br /&gt;
	return function()&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		local key = list[i]&lt;br /&gt;
		if key ~= nil then&lt;br /&gt;
			return key, t[key]&lt;br /&gt;
		else&lt;br /&gt;
			return nil, nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Returns true if all keys in the table are consecutive integers starting at 1.&lt;br /&gt;
--]]&lt;br /&gt;
function p.isArray(t)&lt;br /&gt;
	checkType(&amp;quot;isArray&amp;quot;, 1, t, &amp;quot;table&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	local i = 0&lt;br /&gt;
	for k, v in pairs(t) do&lt;br /&gt;
		i = i + 1&lt;br /&gt;
		if t[i] == nil then&lt;br /&gt;
			return false&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- { &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot; } -&amp;gt; { a = 1, b = 2, c = 3 }&lt;br /&gt;
function p.invert(array)&lt;br /&gt;
	checkType(&amp;quot;invert&amp;quot;, 1, array, &amp;quot;table&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	local map = {}&lt;br /&gt;
	for i, v in ipairs(array) do&lt;br /&gt;
		map[v] = i&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return map&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	{ &amp;quot;a&amp;quot;, &amp;quot;b&amp;quot;, &amp;quot;c&amp;quot; } -&amp;gt; { [&amp;quot;a&amp;quot;] = true, [&amp;quot;b&amp;quot;] = true, [&amp;quot;c&amp;quot;] = true }&lt;br /&gt;
--]]&lt;br /&gt;
function p.listToSet(t)&lt;br /&gt;
	checkType(&amp;quot;listToSet&amp;quot;, 1, t, &amp;quot;table&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	local set = {}&lt;br /&gt;
	for _, item in ipairs(t) do&lt;br /&gt;
		set[item] = true&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return set&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Recursive deep copy function.&lt;br /&gt;
	Preserves identities of subtables.&lt;br /&gt;
	&lt;br /&gt;
]]&lt;br /&gt;
local function _deepCopy(orig, includeMetatable, already_seen)&lt;br /&gt;
	-- Stores copies of tables indexed by the original table.&lt;br /&gt;
	already_seen = already_seen or {}&lt;br /&gt;
	&lt;br /&gt;
	local copy = already_seen[orig]&lt;br /&gt;
	if copy ~= nil then&lt;br /&gt;
		return copy&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if type(orig) == &#039;table&#039; then&lt;br /&gt;
		copy = {}&lt;br /&gt;
		for orig_key, orig_value in pairs(orig) do&lt;br /&gt;
			copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)&lt;br /&gt;
		end&lt;br /&gt;
		already_seen[orig] = copy&lt;br /&gt;
		&lt;br /&gt;
		if includeMetatable then&lt;br /&gt;
			local mt = getmetatable(orig)&lt;br /&gt;
			if mt ~= nil then&lt;br /&gt;
				local mt_copy = deepcopy(mt, includeMetatable, already_seen)&lt;br /&gt;
				setmetatable(copy, mt_copy)&lt;br /&gt;
				already_seen[mt] = mt_copy&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else -- number, string, boolean, etc&lt;br /&gt;
		copy = orig&lt;br /&gt;
	end&lt;br /&gt;
	return copy&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.deepCopy(orig, noMetatable, already_seen)&lt;br /&gt;
	checkType(&amp;quot;deepCopy&amp;quot;, 3, already_seen, &amp;quot;table&amp;quot;, true)&lt;br /&gt;
	&lt;br /&gt;
	return _deepCopy(orig, not noMetatable, already_seen)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
	Concatenates all values in the table that are indexed by a number, in order.&lt;br /&gt;
	sparseConcat{ a, nil, c, d }  =&amp;gt;  &amp;quot;acd&amp;quot;&lt;br /&gt;
	sparseConcat{ nil, b, c, d }  =&amp;gt;  &amp;quot;bcd&amp;quot;&lt;br /&gt;
]]&lt;br /&gt;
function p.sparseConcat(t, sep, i, j)&lt;br /&gt;
	local list = {}&lt;br /&gt;
	&lt;br /&gt;
	local list_i = 0&lt;br /&gt;
	for _, v in p.sparseIpairs(t) do&lt;br /&gt;
		list_i = list_i + 1&lt;br /&gt;
		list[list_i] = v&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return table.concat(list, sep, i, j)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- This returns the length of a table, or the first integer key n counting from&lt;br /&gt;
-- 1 such that t[n + 1] is nil. It is similar to the operator #, but may return&lt;br /&gt;
-- a different value when there are gaps in the array portion of the table.&lt;br /&gt;
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.&lt;br /&gt;
-- Note: #frame.args in frame object always be set to 0, regardless of &lt;br /&gt;
-- the number of unnamed template parameters, so use this function for&lt;br /&gt;
-- frame.args.&lt;br /&gt;
--]]&lt;br /&gt;
function p.length(t)&lt;br /&gt;
	local i = 1&lt;br /&gt;
	while t[i] ~= nil do&lt;br /&gt;
		i = i + 1&lt;br /&gt;
	end&lt;br /&gt;
	return i - 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.inArray(arr, valueToFind)&lt;br /&gt;
	checkType(&amp;quot;inArray&amp;quot;, 1, arr, &amp;quot;table&amp;quot;)&lt;br /&gt;
	&lt;br /&gt;
	-- if valueToFind is nil, error?&lt;br /&gt;
	&lt;br /&gt;
	for _, v in ipairs(arr) do&lt;br /&gt;
		if v == valueToFind then&lt;br /&gt;
			return true&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Yesno&amp;diff=18</id>
		<title>Module:Yesno</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Yesno&amp;diff=18"/>
		<updated>2026-05-15T13:40:32Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;-- Function allowing for consistent treatment of boolean-like wikitext input. -- It works similarly to the template {{yesno}}.  return function (val, default) 	-- If your wiki uses non-ascii characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you 	-- should replace &amp;quot;val:lower()&amp;quot; with &amp;quot;mw.ustring.lower(val)&amp;quot; in the 	-- following line. 	val = type(val) == &amp;#039;string&amp;#039; and val:lower() or val 	if val == nil then 		return nil 	elseif val == true  		or val == &amp;#039;yes&amp;#039; 		or val == &amp;#039;y&amp;#039; 		or val =...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- Function allowing for consistent treatment of boolean-like wikitext input.&lt;br /&gt;
-- It works similarly to the template {{yesno}}.&lt;br /&gt;
&lt;br /&gt;
return function (val, default)&lt;br /&gt;
	-- If your wiki uses non-ascii characters for any of &amp;quot;yes&amp;quot;, &amp;quot;no&amp;quot;, etc., you&lt;br /&gt;
	-- should replace &amp;quot;val:lower()&amp;quot; with &amp;quot;mw.ustring.lower(val)&amp;quot; in the&lt;br /&gt;
	-- following line.&lt;br /&gt;
	val = type(val) == &#039;string&#039; and val:lower() or val&lt;br /&gt;
	if val == nil then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif val == true &lt;br /&gt;
		or val == &#039;yes&#039;&lt;br /&gt;
		or val == &#039;y&#039;&lt;br /&gt;
		or val == &#039;true&#039;&lt;br /&gt;
		or val == &#039;t&#039;&lt;br /&gt;
		or val == &#039;on&#039;&lt;br /&gt;
		or tonumber(val) == 1&lt;br /&gt;
	then&lt;br /&gt;
		return true&lt;br /&gt;
	elseif val == false&lt;br /&gt;
		or val == &#039;no&#039;&lt;br /&gt;
		or val == &#039;n&#039;&lt;br /&gt;
		or val == &#039;false&#039;&lt;br /&gt;
		or val == &#039;f&#039;&lt;br /&gt;
		or val == &#039;off&#039;&lt;br /&gt;
		or tonumber(val) == 0&lt;br /&gt;
	then&lt;br /&gt;
		return false&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:TNT/config&amp;diff=17</id>
		<title>Module:TNT/config</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:TNT/config&amp;diff=17"/>
		<updated>2026-05-15T13:40:13Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;local p = {};  -- The tracking category name for global TemplateData pages located on Commons -- under &amp;quot;Data:Templatedata/&amp;quot; instead of &amp;quot;Data:TemplateData/&amp;quot;, -- defaults to `&amp;quot;Templates using legacy global TemplateData table name&amp;quot;` -- when not set; set to `false` to disable all categorisation p.legacyTemplateDataCategoryName = nil;  -- Whether to add the language subtag to the template name using {{#translation:}}, -- defaults to `false` p.translatableCategoryLink = true;...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local p = {};&lt;br /&gt;
&lt;br /&gt;
-- The tracking category name for global TemplateData pages located on Commons&lt;br /&gt;
-- under &amp;quot;Data:Templatedata/&amp;quot; instead of &amp;quot;Data:TemplateData/&amp;quot;,&lt;br /&gt;
-- defaults to `&amp;quot;Templates using legacy global TemplateData table name&amp;quot;`&lt;br /&gt;
-- when not set; set to `false` to disable all categorisation&lt;br /&gt;
p.legacyTemplateDataCategoryName = nil;&lt;br /&gt;
&lt;br /&gt;
-- Whether to add the language subtag to the template name using {{#translation:}},&lt;br /&gt;
-- defaults to `false`&lt;br /&gt;
p.translatableCategoryLink = true;&lt;br /&gt;
&lt;br /&gt;
return p;&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:TNT&amp;diff=16</id>
		<title>Module:TNT</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:TNT&amp;diff=16"/>
		<updated>2026-05-15T13:39:49Z</updated>

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

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;/**  * {{ombox}} (other pages message box) styles  *  * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-enwp-boxes.css  * @revision 2021-07-15  */ table.ombox { 	margin: 4px 10%; 	border-collapse: collapse; 	/* Default &amp;quot;notice&amp;quot; gray */ 	border: 1px solid #a2a9b1; 	background-color: #f8f9fa; 	color: #333; 	box-sizing: border-box; }  /* An empty narrow cell */ .ombox td.mbox-empty-cell { 	border: none; 	padding: 0; 	width: 1px; }  /* The message body cell(s) */ .om...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/**&lt;br /&gt;
 * {{ombox}} (other pages message box) styles&lt;br /&gt;
 *&lt;br /&gt;
 * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-enwp-boxes.css&lt;br /&gt;
 * @revision 2021-07-15&lt;br /&gt;
 */&lt;br /&gt;
table.ombox {&lt;br /&gt;
	margin: 4px 10%;&lt;br /&gt;
	border-collapse: collapse;&lt;br /&gt;
	/* Default &amp;quot;notice&amp;quot; gray */&lt;br /&gt;
	border: 1px solid #a2a9b1;&lt;br /&gt;
	background-color: #f8f9fa;&lt;br /&gt;
	color: #333;&lt;br /&gt;
	box-sizing: border-box;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* An empty narrow cell */&lt;br /&gt;
.ombox td.mbox-empty-cell {&lt;br /&gt;
	border: none;&lt;br /&gt;
	padding: 0;&lt;br /&gt;
	width: 1px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* The message body cell(s) */&lt;br /&gt;
.ombox th.mbox-text,&lt;br /&gt;
.ombox td.mbox-text {&lt;br /&gt;
	border: none;&lt;br /&gt;
	/* 0.9em left/right */&lt;br /&gt;
	padding: 0.25em 0.9em;&lt;br /&gt;
	/* Make all mboxes the same width regardless of text length */&lt;br /&gt;
	width: 100%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* The left image cell */&lt;br /&gt;
.ombox td.mbox-image {&lt;br /&gt;
	border: none;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
	padding: 2px 0 2px 0.9em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* The right image cell */&lt;br /&gt;
.ombox td.mbox-imageright {&lt;br /&gt;
	border: none;&lt;br /&gt;
	text-align: center;&lt;br /&gt;
	padding: 2px 0.9em 2px 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-notice {&lt;br /&gt;
	/* Gray */&lt;br /&gt;
	border-color: #a2a9b1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-speedy {&lt;br /&gt;
	/* Pink */&lt;br /&gt;
	background-color: #fee7e6;&lt;br /&gt;
	color: #333;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-speedy,&lt;br /&gt;
table.ombox-delete {&lt;br /&gt;
	/* Red */&lt;br /&gt;
	border-color: #b32424;&lt;br /&gt;
	border-width: 2px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-content {&lt;br /&gt;
	/* Orange */&lt;br /&gt;
	border-color: #f28500;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-style {&lt;br /&gt;
	/* Yellow */&lt;br /&gt;
	border-color: #fc3;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-move {&lt;br /&gt;
	/* Purple */&lt;br /&gt;
	border-color: #9932cc;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
table.ombox-protection {&lt;br /&gt;
	/* Gray-gold */&lt;br /&gt;
	border-color: #a2a9b1;&lt;br /&gt;
	border-width: 2px;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * {{ombox|small=1}} styles&lt;br /&gt;
 *&lt;br /&gt;
 * These &amp;quot;.mbox-small&amp;quot; classes must be placed after all other&lt;br /&gt;
 * &amp;quot;.ombox&amp;quot; classes. &amp;quot;html body.mediawiki .ombox&amp;quot;&lt;br /&gt;
 * is so they apply only to other page message boxes.&lt;br /&gt;
 *&lt;br /&gt;
 * @source https://www.mediawiki.org/wiki/MediaWiki:Gadget-enwp-boxes.css&lt;br /&gt;
 * @revision 2021-07-15&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/* For the &amp;quot;small=yes&amp;quot; option. */&lt;br /&gt;
html body.mediawiki .ombox.mbox-small {&lt;br /&gt;
	clear: right;&lt;br /&gt;
	float: right;&lt;br /&gt;
	margin: 4px 0 4px 1em;&lt;br /&gt;
	box-sizing: border-box;&lt;br /&gt;
	width: 238px;&lt;br /&gt;
	font-size: 88%;&lt;br /&gt;
	line-height: 1.25em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen {&lt;br /&gt;
	html.skin-theme-clientpref-night table.ombox {&lt;br /&gt;
	    background-color: transparent;&lt;br /&gt;
	    color: inherit;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (prefers-color-scheme: dark) {&lt;br /&gt;
    /* automatic mode */&lt;br /&gt;
    html.skin-theme-clientpref-os table.ombox {&lt;br /&gt;
    	background-color: transparent;&lt;br /&gt;
    	color: inherit;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
@media screen and (max-width: 720px) {&lt;br /&gt;
  table.ombox {&lt;br /&gt;
	margin: 4px auto;&lt;br /&gt;
  }&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Message_box/configuration&amp;diff=14</id>
		<title>Module:Message box/configuration</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Message_box/configuration&amp;diff=14"/>
		<updated>2026-05-15T13:38:57Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;-------------------------------------------------------------------------------- --                          Message box configuration                         -- --                                                                            -- -- This module contains configuration data for Module:Message box.        -- --------------------------------------------------------------------------------  return { 	ambox = { 		types = { 			speedy = { 				class = &amp;#039;ambox-spee...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--------------------------------------------------------------------------------&lt;br /&gt;
--                          Message box configuration                         --&lt;br /&gt;
--                                                                            --&lt;br /&gt;
-- This module contains configuration data for [[Module:Message box]].        --&lt;br /&gt;
--------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
return {&lt;br /&gt;
	ambox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = &#039;ambox-speedy&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = &#039;ambox-delete&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon alert-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			warning = { -- alias for content&lt;br /&gt;
				class = &#039;ambox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = &#039;ambox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = &#039;ambox-style&#039;,&lt;br /&gt;
				image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = &#039;ambox-move&#039;,&lt;br /&gt;
				image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = &#039;ambox-protection&#039;,&lt;br /&gt;
				image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = &#039;ambox-notice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default                     = &#039;notice&#039;,&lt;br /&gt;
		allowBlankParams            = {&#039;talk&#039;, &#039;sect&#039;, &#039;date&#039;, &#039;issue&#039;, &#039;fix&#039;, &#039;subst&#039;, &#039;hidden&#039;},&lt;br /&gt;
		allowSmall                  = true,&lt;br /&gt;
		smallParam                  = &#039;left&#039;,&lt;br /&gt;
		smallClass                  = &#039;mbox-small-left&#039;,&lt;br /&gt;
		substCheck                  = true,&lt;br /&gt;
		classes                     = {&#039;metadata&#039;, &#039;plainlinks&#039;, &#039;ambox&#039;},&lt;br /&gt;
		imageEmptyCell              = true,&lt;br /&gt;
		imageCheckBlank             = true,&lt;br /&gt;
		imageSmallSize              = &#039;20x20px&#039;,&lt;br /&gt;
		imageCellDiv                = true,&lt;br /&gt;
		useCollapsibleTextFields    = true,&lt;br /&gt;
		imageRightNone              = true,&lt;br /&gt;
		sectionDefault              = &#039;article&#039;,&lt;br /&gt;
		allowMainspaceCategories    = true,&lt;br /&gt;
		templateCategory            = &#039;Article message templates&#039;,&lt;br /&gt;
	        templateCategoryRequireName = true,&lt;br /&gt;
		templateErrorCategory       = nil,&lt;br /&gt;
		templateErrorParamsToCheck  = {&#039;issue&#039;, &#039;fix&#039;, &#039;subst&#039;}&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	cmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = &#039;cmbox-speedy&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = &#039;cmbox-delete&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon alert-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = &#039;cmbox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = &#039;cmbox-style&#039;,&lt;br /&gt;
				image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = &#039;cmbox-move&#039;,&lt;br /&gt;
				image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = &#039;cmbox-protection&#039;,&lt;br /&gt;
				image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = &#039;cmbox-notice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			caution = {&lt;br /&gt;
				class = &#039;cmbox-style&#039;,&lt;br /&gt;
				image = &#039;Ambox warning yellow.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = &#039;notice&#039;,&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {&#039;plainlinks&#039;, &#039;cmbox&#039;},&lt;br /&gt;
		imageEmptyCell       = true&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	fmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			warning = {&lt;br /&gt;
				class = &#039;fmbox-warning&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			editnotice = {&lt;br /&gt;
				class = &#039;fmbox-editnotice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			system = {&lt;br /&gt;
				class = &#039;fmbox-system&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = &#039;system&#039;,&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {&#039;plainlinks&#039;, &#039;fmbox&#039;},&lt;br /&gt;
		imageEmptyCell       = false,&lt;br /&gt;
		imageRightNone       = false&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	imbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = &#039;imbox-speedy&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = &#039;imbox-delete&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon alert-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = &#039;imbox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = &#039;imbox-style&#039;,&lt;br /&gt;
				image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = &#039;imbox-move&#039;,&lt;br /&gt;
				image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = &#039;imbox-protection&#039;,&lt;br /&gt;
				image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			license = {&lt;br /&gt;
				class = &#039;imbox-license licensetpl&#039;,&lt;br /&gt;
				image = &#039;Imbox-license.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			featured = {&lt;br /&gt;
				class = &#039;imbox-featured&#039;,&lt;br /&gt;
				image = &#039;Cscr-featured.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = &#039;imbox-notice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = &#039;notice&#039;,&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {&#039;imbox&#039;},&lt;br /&gt;
		usePlainlinksParam   = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		below                = true,&lt;br /&gt;
		templateCategory     = &#039;File message boxes&#039;&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	ombox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = &#039;ombox-speedy&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = &#039;ombox-delete&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon alert-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			warning = { -- alias for content&lt;br /&gt;
				class = &#039;ombox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = &#039;ombox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = &#039;ombox-style&#039;,&lt;br /&gt;
				image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = &#039;ombox-move&#039;,&lt;br /&gt;
				image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = &#039;ombox-protection&#039;,&lt;br /&gt;
				image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = &#039;ombox-notice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			critical = {&lt;br /&gt;
				class = &#039;mbox-critical&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = &#039;notice&#039;,&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {&#039;plainlinks&#039;, &#039;ombox&#039;},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		imageRightNone       = true&lt;br /&gt;
	},&lt;br /&gt;
	&lt;br /&gt;
	tmbox = {&lt;br /&gt;
		types = {&lt;br /&gt;
			speedy = {&lt;br /&gt;
				class = &#039;tmbox-speedy&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon clock-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			delete = {&lt;br /&gt;
				class = &#039;tmbox-delete&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon alert-destructive.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			content = {&lt;br /&gt;
				class = &#039;tmbox-content&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon notice-warning.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			style = {&lt;br /&gt;
				class = &#039;tmbox-style&#039;,&lt;br /&gt;
				image = &#039;Edit-clear.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			move = {&lt;br /&gt;
				class = &#039;tmbox-move&#039;,&lt;br /&gt;
				image = &#039;Merge-split-transwiki default.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			protection = {&lt;br /&gt;
				class = &#039;tmbox-protection&#039;,&lt;br /&gt;
				image = &#039;Semi-protection-shackle-keyhole.svg&#039;&lt;br /&gt;
			},&lt;br /&gt;
			notice = {&lt;br /&gt;
				class = &#039;tmbox-notice&#039;,&lt;br /&gt;
				image = &#039;OOjs UI icon information-progressive.svg&#039;&lt;br /&gt;
			}&lt;br /&gt;
		},&lt;br /&gt;
		default              = &#039;notice&#039;,&lt;br /&gt;
		showInvalidTypeError = true,&lt;br /&gt;
		classes              = {&#039;plainlinks&#039;, &#039;tmbox&#039;},&lt;br /&gt;
		allowSmall           = true,&lt;br /&gt;
		imageRightNone       = true,&lt;br /&gt;
		imageEmptyCell       = true,&lt;br /&gt;
		imageEmptyCellStyle  = true,&lt;br /&gt;
		templateCategory     = &#039;Talk message boxes&#039;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Message_box&amp;diff=13</id>
		<title>Module:Message box</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Message_box&amp;diff=13"/>
		<updated>2026-05-15T13:38:24Z</updated>

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

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;local format = require(&amp;#039;Module:TNT&amp;#039;).format local i18n = {}  i18n[&amp;#039;cfg-error-msg-type&amp;#039;] = format(&amp;#039;I18n/Documentation&amp;#039;, &amp;#039;cfg-error-msg-type&amp;#039;) i18n[&amp;#039;cfg-error-msg-empty&amp;#039;] = format(&amp;#039;I18n/Documentation&amp;#039;, &amp;#039;cfg-error-msg-empty&amp;#039;)  -- cfg[&amp;#039;template-namespace-heading&amp;#039;] -- The heading shown in the template namespace. i18n[&amp;#039;template-namespace-heading&amp;#039;] = format(&amp;#039;I18n/Documentation&amp;#039;, &amp;#039;template-namespace-heading&amp;#039;)  -- cfg[&amp;#039;module-namespace-heading&amp;#039;] -- The heading shown in the module...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local format = require(&#039;Module:TNT&#039;).format&lt;br /&gt;
local i18n = {}&lt;br /&gt;
&lt;br /&gt;
i18n[&#039;cfg-error-msg-type&#039;] = format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-type&#039;)&lt;br /&gt;
i18n[&#039;cfg-error-msg-empty&#039;] = format(&#039;I18n/Documentation&#039;, &#039;cfg-error-msg-empty&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the template namespace.&lt;br /&gt;
i18n[&#039;template-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;template-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the module namespace.&lt;br /&gt;
i18n[&#039;module-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;module-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;file-namespace-heading&#039;]&lt;br /&gt;
-- The heading shown in the file namespace.&lt;br /&gt;
i18n[&#039;file-namespace-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;file-namespace-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;other-namespaces-heading&#039;]&lt;br /&gt;
-- The heading shown in other namespaces.&lt;br /&gt;
i18n[&#039;other-namespaces-heading&#039;] = format(&#039;I18n/Documentation&#039;, &#039;other-namespaces-heading&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;view-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;view&amp;quot; links.&lt;br /&gt;
i18n[&#039;view-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;view-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;edit-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;edit&amp;quot; links.&lt;br /&gt;
i18n[&#039;edit-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;history-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;history&amp;quot; links.&lt;br /&gt;
i18n[&#039;history-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;history-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;purge-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;purge&amp;quot; links.&lt;br /&gt;
i18n[&#039;purge-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;purge-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;create-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;create&amp;quot; links.&lt;br /&gt;
i18n[&#039;create-link-display&#039;] = format(&#039;I18n/Documentation&#039;, &#039;create-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
return i18n&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Documentation/styles.css&amp;diff=11</id>
		<title>Module:Documentation/styles.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Documentation/styles.css&amp;diff=11"/>
		<updated>2026-05-15T13:36:56Z</updated>

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

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;---------------------------------------------------------------------------------------------------- -- --                               Configuration for Module:Documentation -- -- Here you can set the values of the parameters and messages used in Module:Documentation to -- localise it to your wiki and your language. Unless specified otherwise, values given here -- should be string values. ---------------------------------------------------------------------------------...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;----------------------------------------------------------------------------------------------------&lt;br /&gt;
--&lt;br /&gt;
--                               Configuration for Module:Documentation&lt;br /&gt;
--&lt;br /&gt;
-- Here you can set the values of the parameters and messages used in Module:Documentation to&lt;br /&gt;
-- localise it to your wiki and your language. Unless specified otherwise, values given here&lt;br /&gt;
-- should be string values.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local _format = require(&#039;Module:TNT&#039;).format&lt;br /&gt;
local function format(id)&lt;br /&gt;
	return _format(&#039;I18n/Documentation&#039;, id)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local cfg = {} -- Do not edit this line.&lt;br /&gt;
&lt;br /&gt;
cfg[&#039;templatestyles-scr&#039;] = &#039;Module:Documentation/styles.css&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Protection template configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;protection-template&#039;]&lt;br /&gt;
-- The name of the template that displays the protection icon (a padlock on enwiki).&lt;br /&gt;
cfg[&#039;protection-template&#039;] = &#039;pp-template&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;protection-reason-edit&#039;]&lt;br /&gt;
-- The protection reason for edit-protected templates to pass to&lt;br /&gt;
-- [[Module:Protection banner]].&lt;br /&gt;
cfg[&#039;protection-reason-edit&#039;] = &#039;template&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;protection-template-args&#039;]&lt;br /&gt;
-- Any arguments to send to the protection template. This should be a Lua table.&lt;br /&gt;
-- For example, if the protection template is &amp;quot;pp-template&amp;quot;, and the wikitext template invocation&lt;br /&gt;
-- looks like &amp;quot;{{pp-template|docusage=yes}}&amp;quot;, then this table should look like &amp;quot;{docusage = &#039;yes&#039;}&amp;quot;.&lt;br /&gt;
 --]]&lt;br /&gt;
 cfg[&#039;protection-template-args&#039;] = {docusage = &#039;yes&#039;}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox notice configuration&lt;br /&gt;
--&lt;br /&gt;
-- On sandbox pages the module can display a template notifying users that the current page is a&lt;br /&gt;
-- sandbox, and the location of test cases pages, etc. The module decides whether the page is a&lt;br /&gt;
-- sandbox or not based on the value of cfg[&#039;sandbox-subpage&#039;]. The following settings configure the&lt;br /&gt;
-- messages that the notices contains.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-notice-image&#039;]&lt;br /&gt;
-- The image displayed in the sandbox notice.&lt;br /&gt;
cfg[&#039;sandbox-notice-image&#039;] = &#039;[[File:Edit In Sandbox Icon - Color.svg|40px|alt=|link=]]&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-template&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-other&#039;]&lt;br /&gt;
-- The page type of the sandbox page. The message that is displayed depends on the current subject&lt;br /&gt;
-- namespace. This message is used in either cfg[&#039;sandbox-notice-blurb&#039;] or&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-template&#039;] = format(&#039;sandbox-notice-pagetype-template&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-module&#039;] = format(&#039;sandbox-notice-pagetype-module&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-pagetype-other&#039;] = format(&#039;sandbox-notice-pagetype-other&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-diff-display&#039;]&lt;br /&gt;
-- Either cfg[&#039;sandbox-notice-blurb&#039;] or cfg[&#039;sandbox-notice-diff-blurb&#039;] is the opening sentence&lt;br /&gt;
-- of the sandbox notice. The latter has a diff link, but the former does not. $1 is the page&lt;br /&gt;
-- type, which is either cfg[&#039;sandbox-notice-pagetype-template&#039;],&lt;br /&gt;
-- cfg[&#039;sandbox-notice-pagetype-module&#039;] or cfg[&#039;sandbox-notice-pagetype-other&#039;] depending what&lt;br /&gt;
-- namespace we are in. $2 is a link to the main template page, and $3 is a diff link between&lt;br /&gt;
-- the sandbox and the main template. The display value of the diff link is set by &lt;br /&gt;
-- cfg[&#039;sandbox-notice-compare-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-blurb&#039;] = format(&#039;sandbox-notice-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-diff-blurb&#039;] = format(&#039;sandbox-notice-diff-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-compare-link-display&#039;] = format(&#039;sandbox-notice-compare-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-link-display&#039;]&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-blurb&#039;] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit. $1 is a link to the test cases page.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-link-display&#039;] is the display value for that link.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] is a sentence notifying the user that there is a test cases page&lt;br /&gt;
-- corresponding to this sandbox that they can edit, along with a link to run it. $1 is a link to the test&lt;br /&gt;
-- cases page, and $2 is a link to the page to run it.&lt;br /&gt;
-- cfg[&#039;sandbox-notice-testcases-run-link-display&#039;] is the display value for the link to run the test&lt;br /&gt;
-- cases.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-blurb&#039;] = format(&#039;sandbox-notice-testcases-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-link-display&#039;] = format(&#039;sandbox-notice-testcases-link-display&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-blurb&#039;] = format(&#039;sandbox-notice-testcases-run-blurb&#039;)&lt;br /&gt;
cfg[&#039;sandbox-notice-testcases-run-link-display&#039;] = format(&#039;sandbox-notice-testcases-run-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-category&#039;]&lt;br /&gt;
-- A category to add to all template sandboxes.&lt;br /&gt;
cfg[&#039;sandbox-category&#039;] = &#039;Template sandboxes&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Start box configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;documentation-icon-wikitext&#039;]&lt;br /&gt;
-- The wikitext for the icon shown at the top of the template.&lt;br /&gt;
cfg[&#039;documentation-icon-wikitext&#039;] = &#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=Documentation icon]]&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Link box (end box) configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;transcluded-from-blurb&#039;]&lt;br /&gt;
-- Notice displayed when the docs are transcluded from another page. $1 is a wikilink to that page.&lt;br /&gt;
cfg[&#039;transcluded-from-blurb&#039;] = format(&#039;transcluded-from-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;create-module-doc-blurb&#039;]&lt;br /&gt;
-- Notice displayed in the module namespace when the documentation subpage does not exist.&lt;br /&gt;
-- $1 is a link to create the documentation page with the preload cfg[&#039;module-preload&#039;] and the&lt;br /&gt;
-- display cfg[&#039;create-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;create-module-doc-blurb&#039;] = format(&#039;create-module-doc-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Experiment blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;experiment-blurb-template&#039;]&lt;br /&gt;
-- cfg[&#039;experiment-blurb-module&#039;]&lt;br /&gt;
-- The experiment blurb is the text inviting editors to experiment in sandbox and test cases pages.&lt;br /&gt;
-- It is only shown in the template and module namespaces. With the default English settings, it&lt;br /&gt;
-- might look like this:&lt;br /&gt;
--&lt;br /&gt;
-- Editors can experiment in this template&#039;s sandbox (edit | diff) and testcases (edit) pages.&lt;br /&gt;
--&lt;br /&gt;
-- In this example, &amp;quot;sandbox&amp;quot;, &amp;quot;edit&amp;quot;, &amp;quot;diff&amp;quot;, &amp;quot;testcases&amp;quot;, and &amp;quot;edit&amp;quot; would all be links.&lt;br /&gt;
--&lt;br /&gt;
-- There are two versions, cfg[&#039;experiment-blurb-template&#039;] and cfg[&#039;experiment-blurb-module&#039;], depending&lt;br /&gt;
-- on what namespace we are in.&lt;br /&gt;
-- &lt;br /&gt;
-- Parameters:&lt;br /&gt;
--&lt;br /&gt;
-- $1 is a link to the sandbox page. If the sandbox exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-edit-link-display&#039;] | cfg[&#039;compare-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- If the sandbox doesn&#039;t exist, it is in the format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;sandbox-link-display&#039;] (cfg[&#039;sandbox-create-link-display&#039;] | cfg[&#039;mirror-link-display&#039;])&lt;br /&gt;
-- &lt;br /&gt;
-- The link for cfg[&#039;sandbox-create-link-display&#039;] link preloads the page with cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- or cfg[&#039;module-sandbox-preload&#039;], depending on the current namespace. The link for cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- loads a default edit summary of cfg[&#039;mirror-edit-summary&#039;].&lt;br /&gt;
--&lt;br /&gt;
-- $2 is a link to the test cases page. If the test cases page exists, it is in the following format:&lt;br /&gt;
--&lt;br /&gt;
--     cfg[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-edit-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, it is in the format:&lt;br /&gt;
-- &lt;br /&gt;
--     cfg[&#039;testcases-link-display&#039;] (cfg[&#039;testcases-create-link-display&#039;])&lt;br /&gt;
--&lt;br /&gt;
-- If the test cases page doesn&#039;t exist, the link for cfg[&#039;testcases-create-link-display&#039;] preloads the&lt;br /&gt;
-- page with cfg[&#039;template-testcases-preload&#039;] or cfg[&#039;module-testcases-preload&#039;], depending on the current&lt;br /&gt;
-- namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;experiment-blurb-template&#039;] = format(&#039;experiment-blurb-template&#039;)&lt;br /&gt;
cfg[&#039;experiment-blurb-module&#039;] = format(&#039;experiment-blurb-module&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Sandbox link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for sandboxes.&lt;br /&gt;
cfg[&#039;sandbox-subpage&#039;] = &#039;sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for template sandbox pages.&lt;br /&gt;
cfg[&#039;template-sandbox-preload&#039;] = &#039;Template:Documentation/preload-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-sandbox-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module sandbox pages.&lt;br /&gt;
cfg[&#039;module-sandbox-preload&#039;] = &#039;Template:Documentation/preload-module-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;sandbox&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-link-display&#039;] = format(&#039;sandbox-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-edit-link-display&#039;] = format(&#039;sandbox-edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;sandbox-create-link-display&#039;]&lt;br /&gt;
-- The text to display for sandbox &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;sandbox-create-link-display&#039;] = format(&#039;sandbox-create-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;compare-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;compare&amp;quot; links.&lt;br /&gt;
cfg[&#039;compare-link-display&#039;] = format(&#039;compare-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-edit-summary&#039;]&lt;br /&gt;
-- The default edit summary to use when a user clicks the &amp;quot;mirror&amp;quot; link. $1 is a wikilink to the&lt;br /&gt;
-- template page.&lt;br /&gt;
cfg[&#039;mirror-edit-summary&#039;] = &#039;Create sandbox version of $1&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;mirror&amp;quot; links.&lt;br /&gt;
cfg[&#039;mirror-link-display&#039;] = format(&#039;mirror-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;mirror-link-preload&#039;]&lt;br /&gt;
-- The page to preload when a user clicks the &amp;quot;mirror&amp;quot; link.&lt;br /&gt;
cfg[&#039;mirror-link-preload&#039;] = &#039;Template:Documentation/mirror&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Test cases link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage typically used for test cases.&lt;br /&gt;
cfg[&#039;testcases-subpage&#039;] = &#039;testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for template test cases pages.&lt;br /&gt;
cfg[&#039;template-testcases-preload&#039;] = &#039;Template:Documentation/preload-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-testcases-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module test cases pages.&lt;br /&gt;
cfg[&#039;module-testcases-preload&#039;] = &#039;Template:Documentation/preload-module-testcases&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-link-display&#039;]&lt;br /&gt;
-- The text to display for &amp;quot;testcases&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-link-display&#039;] = format(&#039;testcases-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-edit-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;edit&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-edit-link-display&#039;] = format(&#039;testcases-edit-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;testcases-create-link-display&#039;]&lt;br /&gt;
-- The text to display for test cases &amp;quot;create&amp;quot; links.&lt;br /&gt;
cfg[&#039;testcases-create-link-display&#039;] = format(&#039;testcases-create-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Add categories blurb configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;add-categories-blurb&#039;]&lt;br /&gt;
-- Text to direct users to add categories to the /doc subpage. Not used if the &amp;quot;content&amp;quot; or&lt;br /&gt;
-- &amp;quot;docname fed&amp;quot; arguments are set, as then it is not clear where to add the categories. $1 is a&lt;br /&gt;
-- link to the /doc subpage with a display value of cfg[&#039;doc-link-display&#039;].&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;add-categories-blurb&#039;] = format(&#039;add-categories-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-link-display&#039;]&lt;br /&gt;
-- The text to display when linking to the /doc subpage.&lt;br /&gt;
cfg[&#039;doc-link-display&#039;] = &#039;/doc&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Subpages link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;subpages-blurb&#039;]&lt;br /&gt;
-- The &amp;quot;Subpages of this template&amp;quot; blurb. $1 is a link to the main template&#039;s subpages with a&lt;br /&gt;
-- display value of cfg[&#039;subpages-link-display&#039;]. In the English version this blurb is simply&lt;br /&gt;
-- the link followed by a period, and the link display provides the actual text.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;subpages-blurb&#039;] = format(&#039;subpages-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- cfg[&#039;subpages-link-display&#039;]&lt;br /&gt;
-- The text to display for the &amp;quot;subpages of this page&amp;quot; link. $1 is cfg[&#039;template-pagetype&#039;],&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;] or cfg[&#039;default-pagetype&#039;], depending on whether the current page is in&lt;br /&gt;
-- the template namespace, the module namespace, or another namespace.&lt;br /&gt;
--]]&lt;br /&gt;
cfg[&#039;subpages-link-display&#039;] = format(&#039;subpages-link-display&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;template-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for template pages.&lt;br /&gt;
cfg[&#039;template-pagetype&#039;] = format(&#039;template-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for Lua module pages.&lt;br /&gt;
cfg[&#039;module-pagetype&#039;] = format(&#039;module-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;default-pagetype&#039;]&lt;br /&gt;
-- The pagetype to display for pages other than templates or Lua modules.&lt;br /&gt;
cfg[&#039;default-pagetype&#039;] = format(&#039;default-pagetype&#039;)&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Doc link configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;doc-subpage&#039;]&lt;br /&gt;
-- The name of the subpage typically used for documentation pages.&lt;br /&gt;
cfg[&#039;doc-subpage&#039;] = &#039;doc&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;file-docpage-preload&#039;]&lt;br /&gt;
-- Preload file for documentation page in the file namespace.&lt;br /&gt;
cfg[&#039;file-docpage-preload&#039;] = &#039;Template:Documentation/preload-filespace&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;docpage-preload&#039;]&lt;br /&gt;
-- Preload file for template documentation pages in all namespaces.&lt;br /&gt;
cfg[&#039;docpage-preload&#039;] = &#039;Template:Documentation/preload&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;module-preload&#039;]&lt;br /&gt;
-- Preload file for Lua module documentation pages.&lt;br /&gt;
cfg[&#039;module-preload&#039;] = &#039;Template:Documentation/preload-module-doc&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Print version configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-subpage&#039;]&lt;br /&gt;
-- The name of the template subpage used for print versions.&lt;br /&gt;
cfg[&#039;print-subpage&#039;] = &#039;Print&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-link-display&#039;]&lt;br /&gt;
-- The text to display when linking to the /Print subpage.&lt;br /&gt;
cfg[&#039;print-link-display&#039;] = &#039;/Print&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-blurb&#039;]&lt;br /&gt;
-- Text to display if a /Print subpage exists. $1 is a link to the subpage with a display value of cfg[&#039;print-link-display&#039;].&lt;br /&gt;
cfg[&#039;print-blurb&#039;] = format(&#039;print-blurb&#039;)&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;display-print-category&#039;]&lt;br /&gt;
-- Set to true to enable output of cfg[&#039;print-category&#039;] if a /Print subpage exists.&lt;br /&gt;
-- This should be a boolean value (either true or false).&lt;br /&gt;
cfg[&#039;display-print-category&#039;] = true&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;print-category&#039;]&lt;br /&gt;
-- Category to output if cfg[&#039;display-print-category&#039;] is set to true, and a /Print subpage exists.&lt;br /&gt;
cfg[&#039;print-category&#039;] = &#039;Templates with print versions&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- HTML and CSS configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-id&#039;]&lt;br /&gt;
-- The &amp;quot;id&amp;quot; attribute of the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg[&#039;main-div-id&#039;] = &#039;template-documentation&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;main-div-classes&#039;]&lt;br /&gt;
-- The CSS classes added to the main HTML &amp;quot;div&amp;quot; tag.&lt;br /&gt;
cfg[&#039;main-div-class&#039;] = &#039;ts-doc-doc&#039;&lt;br /&gt;
cfg[&#039;header-div-class&#039;] = &#039;ts-doc-header&#039;&lt;br /&gt;
cfg[&#039;heading-div-class&#039;] = &#039;ts-doc-heading&#039;&lt;br /&gt;
cfg[&#039;content-div-class&#039;] = &#039;ts-doc-content&#039;&lt;br /&gt;
cfg[&#039;footer-div-class&#039;] = &#039;ts-doc-footer plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
cfg[&#039;sandbox-class&#039;] = &#039;ts-doc-sandbox&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-linkclasses&#039;]&lt;br /&gt;
-- The CSS classes used for the [view][edit][history] or [create] links in the start box.&lt;br /&gt;
cfg[&#039;start-box-linkclasses&#039;] = &#039;ts-tlinks-tlinks mw-editsection-like plainlinks&#039;&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;start-box-link-id&#039;]&lt;br /&gt;
-- The HTML &amp;quot;id&amp;quot; attribute for the links in the start box.&lt;br /&gt;
cfg[&#039;start-box-link-id&#039;] = &#039;doc_editlinks&#039;&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- Tracking category configuration&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;display-strange-usage-category&#039;]&lt;br /&gt;
-- Set to true to enable output of cfg[&#039;strange-usage-category&#039;] if the module is used on a /doc subpage&lt;br /&gt;
-- or a /testcases subpage. This should be a boolean value (either true or false).&lt;br /&gt;
cfg[&#039;display-strange-usage-category&#039;] = false&lt;br /&gt;
&lt;br /&gt;
-- cfg[&#039;strange-usage-category&#039;]&lt;br /&gt;
-- Category to output if cfg[&#039;display-strange-usage-category&#039;] is set to true and the module is used on a&lt;br /&gt;
-- /doc subpage or a /testcases subpage.&lt;br /&gt;
cfg[&#039;strange-usage-category&#039;] = &#039;Pages with strange ((documentation)) usage&#039;&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
-- End configuration&lt;br /&gt;
--&lt;br /&gt;
-- Don&#039;t edit anything below this line.&lt;br /&gt;
----------------------------------------------------------------------------------------------------&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
return cfg&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=8</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=Module:Documentation&amp;diff=8"/>
		<updated>2026-05-15T13:32:43Z</updated>

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

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

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt; {{documentation|content=  {{Lua|Module:Documentation}} This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page. It is intended for pages which are [https://www.mediawiki.org/wiki/Help:Transclusion transcluded] in other pages, i.e. templates, whether in th...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=&lt;br /&gt;
&lt;br /&gt;
{{Lua|Module:Documentation}}&lt;br /&gt;
This template automatically displays a documentation box like the one you are seeing now, of which the content is sometimes transcluded from another page.&lt;br /&gt;
It is intended for pages which are [https://www.mediawiki.org/wiki/Help:Transclusion transcluded] in other pages, i.e. templates, whether in the template namespace or not.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
=== Customising display ===&lt;br /&gt;
&lt;br /&gt;
Overrides exist to customise the output in special cases:&lt;br /&gt;
* &amp;lt;nowiki&amp;gt;{{&amp;lt;/nowiki&amp;gt;documentation{{!}}&#039;&#039;&#039;heading&#039;&#039;&#039;=&amp;lt;nowiki&amp;gt;}}&amp;lt;/nowiki&amp;gt; - change the text of the &amp;quot;documentation&amp;quot; heading. If this is set to blank, the entire heading line (including the first [edit] link) will also disappear.&lt;br /&gt;
&lt;br /&gt;
== Rationale ==&lt;br /&gt;
This template allows any page to use any documentation page, and makes it possible to protect templates while allowing anyone to edit the template&#039;s documentation and categories.&lt;br /&gt;
It also reduces server resources by circumventing a [https://en.wikipedia.org/wiki/Help:Template_limits limitation of templates](see a [https://en.wikipedia.org/wiki/Special:Diff/69888944 developer&#039;s explanation]).&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=5</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=5"/>
		<updated>2026-05-15T12:53:16Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
@import url(&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
@font-face {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    src: url(&#039;/fonts/czn.ttf&#039;) format(&#039;truetype&#039;);&lt;br /&gt;
    font-weight: normal;&lt;br /&gt;
    font-style: normal;&lt;br /&gt;
    font-display: swap;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
:root {&lt;br /&gt;
    --color-czn: #ff540c;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/* Fix -webkit-focus-ring-color */&lt;br /&gt;
a:focus {&lt;br /&gt;
    outline: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
a:focus,a:hover {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    background: url(https://sandboxwiki.com/images/3/3a/Bg.png);&lt;br /&gt;
    background-attachment: fixed;&lt;br /&gt;
    background-size: cover;&lt;br /&gt;
    background-position: center;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#p-logo, #p-navigation, #p-tb, #mw-head, .mw-editsection, .mw-footer {&lt;br /&gt;
    display: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mw-page-base {&lt;br /&gt;
    background: transparent;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#content {&lt;br /&gt;
    width: 1200px;&lt;br /&gt;
    max-width: 1200px;&lt;br /&gt;
    border: none;&lt;br /&gt;
    border-radius: 8px;&lt;br /&gt;
    background: rgba(255,255,255,0.8);&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=4</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=4"/>
		<updated>2026-05-15T12:51:59Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
@import url(&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
@font-face {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    src: url(&#039;/fonts/czn.ttf&#039;) format(&#039;truetype&#039;);&lt;br /&gt;
    font-weight: normal;&lt;br /&gt;
    font-style: normal;&lt;br /&gt;
    font-display: swap;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
body {&lt;br /&gt;
    font-family: &#039;czn&#039;;&lt;br /&gt;
    background: url(https://sandboxwiki.com/images/3/3a/Bg.png);&lt;br /&gt;
    background-attachment: fixed;&lt;br /&gt;
    background-size: cover;&lt;br /&gt;
    background-position: center;&lt;br /&gt;
    background-repeat: no-repeat;&lt;br /&gt;
}&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=File:Bg.png&amp;diff=3</id>
		<title>File:Bg.png</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=File:Bg.png&amp;diff=3"/>
		<updated>2026-05-15T12:51:22Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: File uploaded with MsUpload&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;File uploaded with MsUpload&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
	<entry>
		<id>https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=2</id>
		<title>MediaWiki:Common.css</title>
		<link rel="alternate" type="text/html" href="https://sandboxwiki.com/index.php?title=MediaWiki:Common.css&amp;diff=2"/>
		<updated>2026-05-15T12:28:38Z</updated>

		<summary type="html">&lt;p&gt;Sandbox: Created page with &amp;quot;/* CSS placed here will be applied to all skins */  @import url(&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css&amp;quot;);&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;/* CSS placed here will be applied to all skins */&lt;br /&gt;
&lt;br /&gt;
@import url(&amp;quot;https://cdnjs.cloudflare.com/ajax/libs/font-awesome/7.0.1/css/all.min.css&amp;quot;);&lt;/div&gt;</summary>
		<author><name>Sandbox</name></author>
	</entry>
</feed>