<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://tsgdoc.socsci.ru.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=E.vandenberge</id>
	<title>TSG Doc - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://tsgdoc.socsci.ru.nl/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=E.vandenberge"/>
	<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php/Special:Contributions/E.vandenberge"/>
	<updated>2026-04-19T12:25:13Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.4</generator>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=System_Image/Changelog&amp;diff=6477</id>
		<title>System Image/Changelog</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=System_Image/Changelog&amp;diff=6477"/>
		<updated>2026-04-16T14:02:04Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Outdated}}&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.35==&lt;br /&gt;
&lt;br /&gt;
''Released 2025-03-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.34==&lt;br /&gt;
&lt;br /&gt;
''Released 2025-02-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Psychopy2024.2.4 is now the default version&lt;br /&gt;
* Python 3.10 is now the default version&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.33==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-10-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.32==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-09-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.31==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-08-09''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.30==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-07-05''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
* Psychopy2024.1.0 is the default version&lt;br /&gt;
* Piplist&lt;br /&gt;
* alabaster==0.7.12&lt;br /&gt;
* appdirs==1.4.4&lt;br /&gt;
* arabic-reshaper==2.1.3&lt;br /&gt;
* arrow==1.2.2&lt;br /&gt;
* astroid==2.11.6&lt;br /&gt;
* astunparse==1.6.3&lt;br /&gt;
* asyncio==3.4.3&lt;br /&gt;
* atomicwrites==1.4.0&lt;br /&gt;
* attrs==21.4.0&lt;br /&gt;
* autopep8==1.6.0&lt;br /&gt;
* Babel==2.10.3&lt;br /&gt;
* backcall==0.2.0&lt;br /&gt;
* bcrypt==3.2.2&lt;br /&gt;
* beautifulsoup4==4.11.1&lt;br /&gt;
* binaryornot==0.4.4&lt;br /&gt;
* black==22.6.0&lt;br /&gt;
* bleach==5.0.1&lt;br /&gt;
* bleak==0.14.3&lt;br /&gt;
* bleak-winrt==1.1.1&lt;br /&gt;
* blosc2==2.2.7&lt;br /&gt;
* cachetools==5.2.0&lt;br /&gt;
* certifi==2022.6.15&lt;br /&gt;
* cffi==1.15.0&lt;br /&gt;
* chardet==4.0.0&lt;br /&gt;
* charset-normalizer==2.0.12&lt;br /&gt;
* click==8.1.3&lt;br /&gt;
* cloudpickle==2.1.0&lt;br /&gt;
* colorama==0.4.5&lt;br /&gt;
* cookiecutter==2.1.1&lt;br /&gt;
* cryptography==37.0.2&lt;br /&gt;
* cycler==0.11.0&lt;br /&gt;
* DateTime==4.4&lt;br /&gt;
* debugpy==1.6.0&lt;br /&gt;
* decorator==4.4.2&lt;br /&gt;
* defusedxml==0.7.1&lt;br /&gt;
* diff-match-patch==20200713&lt;br /&gt;
* dill==0.3.5.1&lt;br /&gt;
* distlib==0.3.4&lt;br /&gt;
* docutils==0.18.1&lt;br /&gt;
* dukpy==0.2.3&lt;br /&gt;
* egi-pynetstation==0.0.0rc1&lt;br /&gt;
* elementpath==4.4.0&lt;br /&gt;
* entrypoints==0.4&lt;br /&gt;
* esprima==4.0.1&lt;br /&gt;
* et-xmlfile==1.1.0&lt;br /&gt;
* fastjsonschema==2.15.3&lt;br /&gt;
* ffpyplayer==4.3.5&lt;br /&gt;
* filelock==3.7.1&lt;br /&gt;
* flake8==4.0.1&lt;br /&gt;
* fonttools==4.33.3&lt;br /&gt;
* freetype-py==2.3.0&lt;br /&gt;
* future==0.18.2&lt;br /&gt;
* gevent==21.12.0&lt;br /&gt;
* gitdb==4.0.9&lt;br /&gt;
* GitPython==3.1.27&lt;br /&gt;
* glfw==2.5.3&lt;br /&gt;
* google-api-core==2.8.2&lt;br /&gt;
* google-auth==2.8.0&lt;br /&gt;
* google-cloud==0.34.0&lt;br /&gt;
* google-cloud-speech==2.14.1&lt;br /&gt;
* googleapis-common-protos==1.56.3&lt;br /&gt;
* greenlet==1.1.2&lt;br /&gt;
* grpcio==1.47.0&lt;br /&gt;
* grpcio-status==1.47.0&lt;br /&gt;
* hexbytes==1.2.0&lt;br /&gt;
* hidapi==0.14.0&lt;br /&gt;
* html2text==2024.2.26&lt;br /&gt;
* idna==3.3&lt;br /&gt;
* imageio==2.19.3&lt;br /&gt;
* imageio-ffmpeg==0.4.7&lt;br /&gt;
* imagesize==1.3.0&lt;br /&gt;
* importlib-metadata==4.12.0&lt;br /&gt;
* importlib-resources==5.8.0&lt;br /&gt;
* inflection==0.5.1&lt;br /&gt;
* intervaltree==3.1.0&lt;br /&gt;
* ipykernel==6.15.0&lt;br /&gt;
* ipython==7.34.0&lt;br /&gt;
* ipython-genutils==0.2.0&lt;br /&gt;
* isort==5.10.1&lt;br /&gt;
* javascripthon==0.12&lt;br /&gt;
* jedi==0.18.1&lt;br /&gt;
* jellyfish==0.9.0&lt;br /&gt;
* Jinja2==3.1.2&lt;br /&gt;
* jinja2-time==0.2.0&lt;br /&gt;
* joblib==1.2.0&lt;br /&gt;
* joycon-python==0.2.4&lt;br /&gt;
* json-tricks==3.15.5&lt;br /&gt;
* jsonschema==4.6.0&lt;br /&gt;
* jupyter-client==7.3.4&lt;br /&gt;
* jupyter-core==4.10.0&lt;br /&gt;
* jupyterlab-pygments==0.2.2&lt;br /&gt;
* keyring==23.6.0&lt;br /&gt;
* kiwisolver==1.4.3&lt;br /&gt;
* lazy-object-proxy==1.7.1&lt;br /&gt;
* macropy3==1.1.0b2&lt;br /&gt;
* markdown-it-py==2.1.0&lt;br /&gt;
* MarkupSafe==2.1.1&lt;br /&gt;
* matplotlib==3.5.2&lt;br /&gt;
* matplotlib-inline==0.1.3&lt;br /&gt;
* mccabe==0.6.1&lt;br /&gt;
* mdurl==0.1.1&lt;br /&gt;
* mistune==0.8.4&lt;br /&gt;
* mne==1.2.1&lt;br /&gt;
* mnelab==0.8.5&lt;br /&gt;
* moviepy==1.0.3&lt;br /&gt;
* msgpack==1.0.4&lt;br /&gt;
* msgpack-numpy==0.4.8&lt;br /&gt;
* mypy-extensions==0.4.3&lt;br /&gt;
* nbclient==0.6.4&lt;br /&gt;
* nbconvert==6.5.0&lt;br /&gt;
* nbformat==5.4.0&lt;br /&gt;
* ndindex==1.8&lt;br /&gt;
* nest-asyncio==1.5.5&lt;br /&gt;
* nidaqmx==0.6.3&lt;br /&gt;
* ntplib==0.4.0&lt;br /&gt;
* numexpr==2.8.3&lt;br /&gt;
* numpy==1.23.0&lt;br /&gt;
* numpydoc==1.4.0&lt;br /&gt;
* opencv-python==4.6.0.66&lt;br /&gt;
* openpyxl==3.0.10&lt;br /&gt;
* orjson==3.10.0&lt;br /&gt;
* packaging==21.3&lt;br /&gt;
* pandas==2.0.3&lt;br /&gt;
* * pandocfilters==1.5.0&lt;br /&gt;
* paramiko==2.11.0&lt;br /&gt;
* parso==0.8.3&lt;br /&gt;
* pathspec==0.9.0&lt;br /&gt;
* patsy==0.5.2&lt;br /&gt;
* pep8==1.7.1&lt;br /&gt;
* pexpect==4.8.0&lt;br /&gt;
* pickleshare==0.7.5&lt;br /&gt;
* pillow==10.3.0&lt;br /&gt;
* platformdirs==2.5.2&lt;br /&gt;
* pluggy==1.0.0&lt;br /&gt;
* pooch==1.6.0&lt;br /&gt;
* proglog==0.1.10&lt;br /&gt;
* prompt-toolkit==3.0.30&lt;br /&gt;
* proto-plus==1.20.6&lt;br /&gt;
* protobuf==3.20.1&lt;br /&gt;
* psutil==5.9.1&lt;br /&gt;
* psychopy==2024.1.0&lt;br /&gt;
* psychtoolbox==3.0.18.2&lt;br /&gt;
* ptyprocess==0.7.0&lt;br /&gt;
* py-cpuinfo==9.0.0&lt;br /&gt;
* pyasn1==0.4.8&lt;br /&gt;
* pyasn1-modules==0.2.8&lt;br /&gt;
* pybv==0.7.5&lt;br /&gt;
* pycodestyle==2.8.0&lt;br /&gt;
* pycparser==2.21&lt;br /&gt;
* PyDAQmx==1.4.6&lt;br /&gt;
* pydocstyle==6.1.1&lt;br /&gt;
* pyEDFlib==0.1.30&lt;br /&gt;
* pyflakes==2.4.0&lt;br /&gt;
* pygame==2.1.2&lt;br /&gt;
* pyglet==1.4.11&lt;br /&gt;
* PyGLM==2.7.1&lt;br /&gt;
* Pygments==2.12.0&lt;br /&gt;
* pylint==2.14.3&lt;br /&gt;
* pyls-spyder==0.4.0&lt;br /&gt;
* pylsl==1.16.0&lt;br /&gt;
* PyNaCl==1.5.0&lt;br /&gt;
* pyo==1.0.4&lt;br /&gt;
* pyparallel==0.2.2&lt;br /&gt;
* pyparsing==3.0.9&lt;br /&gt;
* pypi-search==2.0&lt;br /&gt;
* pypiwin32==223&lt;br /&gt;
* pyqmix==2021.1.2&lt;br /&gt;
* PyQt5==5.15.7&lt;br /&gt;
* PyQt5-Qt5==5.15.2&lt;br /&gt;
* PyQt5-sip==12.11.0&lt;br /&gt;
* PyQt6==6.6.1&lt;br /&gt;
* PyQt6-Qt6==6.6.3&lt;br /&gt;
* PyQt6-sip==13.6.0&lt;br /&gt;
* pyqtgraph==0.12.4&lt;br /&gt;
* PyQtWebEngine==5.15.6&lt;br /&gt;
* PyQtWebEngine-Qt5==5.15.2&lt;br /&gt;
* pyrsistent==0.18.1&lt;br /&gt;
* pyscab==1.0.1&lt;br /&gt;
* pyserial==3.5&lt;br /&gt;
* PySide6==6.4.0.1&lt;br /&gt;
* PySide6-Addons==6.4.0.1&lt;br /&gt;
* PySide6-Essentials==6.4.0.1&lt;br /&gt;
* python-bidi==0.4.2&lt;br /&gt;
* python-dateutil==2.8.2&lt;br /&gt;
* python-gitlab==3.6.0&lt;br /&gt;
* python-lsp-black==1.2.1&lt;br /&gt;
* python-lsp-jsonrpc==1.0.0&lt;br /&gt;
* python-lsp-server==1.4.1&lt;br /&gt;
* python-picard==0.7&lt;br /&gt;
* python-slugify==6.1.2&lt;br /&gt;
* python-vlc==3.0.11115&lt;br /&gt;
* pytoolconfig==1.1.2&lt;br /&gt;
* pytz==2022.1&lt;br /&gt;
* pywin32==304&lt;br /&gt;
* pywin32-ctypes==0.2.0&lt;br /&gt;
* pyWinhook==1.6.2&lt;br /&gt;
* pyxdf==1.16.3&lt;br /&gt;
* PyYAML==6.0&lt;br /&gt;
* pyzmq==23.2.0&lt;br /&gt;
* QDarkStyle==3.0.3&lt;br /&gt;
* qstylizer==0.2.1&lt;br /&gt;
* QtAwesome==1.1.1&lt;br /&gt;
* qtconsole==5.3.1&lt;br /&gt;
* qtm==2.1.1&lt;br /&gt;
* qtm-rt==3.0.1&lt;br /&gt;
* QtPy==2.1.0&lt;br /&gt;
* questplus==2023.1&lt;br /&gt;
* requests==2.28.0&lt;br /&gt;
* requests-toolbelt==0.9.1&lt;br /&gt;
* rope==1.2.0&lt;br /&gt;
* rsa==4.8&lt;br /&gt;
* Rtree==1.0.0&lt;br /&gt;
* ruamel.yaml==0.16.3&lt;br /&gt;
* RuSocSci==0.9.0&lt;br /&gt;
* scikit-learn==1.1.3&lt;br /&gt;
* scipy==1.8.1&lt;br /&gt;
* seaborn==0.11.2&lt;br /&gt;
* setuptools==56.0.0&lt;br /&gt;
* shiboken6==6.4.0.1&lt;br /&gt;
* six==1.16.0&lt;br /&gt;
* smmap==5.0.0&lt;br /&gt;
* snowballstemmer==2.2.0&lt;br /&gt;
* sortedcontainers==2.4.0&lt;br /&gt;
* SoundFile==0.10.3.post1&lt;br /&gt;
* soupsieve==2.3.2.post1&lt;br /&gt;
* SpeechRecognition==3.8.1&lt;br /&gt;
* Sphinx==5.0.2&lt;br /&gt;
* sphinxcontrib-applehelp==1.0.2&lt;br /&gt;
* sphinxcontrib-devhelp==1.0.2&lt;br /&gt;
* sphinxcontrib-htmlhelp==2.0.0&lt;br /&gt;
* sphinxcontrib-jsmath==1.0.1&lt;br /&gt;
* sphinxcontrib-qthelp==1.0.3&lt;br /&gt;
* sphinxcontrib-serializinghtml==1.1.5&lt;br /&gt;
* spyder==5.3.1&lt;br /&gt;
* spyder-kernels==2.3.1&lt;br /&gt;
* statsmodels==0.13.2&lt;br /&gt;
* tables==3.7.0&lt;br /&gt;
* text-unidecode==1.3&lt;br /&gt;
* textdistance==4.2.2&lt;br /&gt;
* threadpoolctl==3.1.0&lt;br /&gt;
* three-merge==0.1.1&lt;br /&gt;
* tinycss2==1.1.1&lt;br /&gt;
* TittaPy==1.0.0&lt;br /&gt;
* tobii-research==1.10.1&lt;br /&gt;
* toml==0.10.2&lt;br /&gt;
* tomli==2.0.1&lt;br /&gt;
* tomlkit==0.11.0&lt;br /&gt;
* tornado==6.1&lt;br /&gt;
* tqdm==4.64.0&lt;br /&gt;
* traitlets==5.3.0&lt;br /&gt;
* typing_extensions==4.2.0&lt;br /&gt;
* tzdata==2024.1&lt;br /&gt;
* ujson==5.3.0&lt;br /&gt;
* urllib3==1.26.9&lt;br /&gt;
* virtualenv==20.15.0&lt;br /&gt;
* virtualenvwrapper-win==1.2.7&lt;br /&gt;
* watchdog==2.1.9&lt;br /&gt;
* wcwidth==0.2.5&lt;br /&gt;
* webencodings==0.5.1&lt;br /&gt;
* websocket-client==1.3.3&lt;br /&gt;
* websockets==12.0&lt;br /&gt;
* wheel==0.37.1&lt;br /&gt;
* WMI==1.5.1&lt;br /&gt;
* wrapt==1.14.1&lt;br /&gt;
* wxPython==4.1.1&lt;br /&gt;
* xarray==2022.3.0&lt;br /&gt;
* * xlrd==2.0.1&lt;br /&gt;
* xmlschema==3.2.1&lt;br /&gt;
* yapf==0.32.0&lt;br /&gt;
* zipp==3.8.0&lt;br /&gt;
* zope.event==4.5.0&lt;br /&gt;
* zope.interface==5.4.0&lt;br /&gt;
* sr_research_pylink-2.1.1.0-cp38-cp38-win_amd64.whl&lt;br /&gt;
&lt;br /&gt;
* Psychopy 2024.1.4 is now a Virtual Environment&lt;br /&gt;
* Psychopy 2024.2.3 is now a Virtual Environment&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.29==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-06-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* Matlab 2024A&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.28==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-05-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* Virtualenv Psychopy2024.1.0.Python3.8(64bits)&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.27==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-04-05''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.26==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-03-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.25==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-02-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
* Default Python is versie 3.8.10 &lt;br /&gt;
* Psychopy is updated from Psychopy2022.2.4 to Psychopy2023.2.3&lt;br /&gt;
* VirtualEnvs zijn toegevoegd&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.24==&lt;br /&gt;
&lt;br /&gt;
''Released 2024-01-05''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.23==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-12-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.22==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-11-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.21==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-10-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
* GStreamer 1.0	1.20.1	GStreamer 1.0	1.20.4&lt;br /&gt;
* Microsoft Silverlight	5.1.30514.0	Microsoft Silverlight	5.1.50907.0&lt;br /&gt;
* Logitech G HUB	2021.3.5164	Logitech G HUB	2021.3.9205&lt;br /&gt;
* National Instruments is updated&lt;br /&gt;
* Presentation 22.1 01.21.21   Presentation 24.0 07.19.23&lt;br /&gt;
* Python virtual env. is updated&lt;br /&gt;
* PySide6            6.4.0.1	PySide6	6.5.2&lt;br /&gt;
* PySide6-Addons     6.4.0.1	PySide6-Addons	6.5.2&lt;br /&gt;
* PySide6-Essentials 6.4.0.1	PySide6-Essentials	6.5.2&lt;br /&gt;
* matplotlib         3.5.2	matplotlib	3.7.3&lt;br /&gt;
* mnelab             0.8.5	mnelab	0.8.6&lt;br /&gt;
* pip                23.1.2	pip	23.2.1&lt;br /&gt;
* shiboken6          6.4.0.1	shiboken6	6.5.2	&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* Psychopy2023.1.3 and Psychopy2023.2.2 virtual envs &lt;br /&gt;
* contourpy          1.1.0&lt;br /&gt;
* dpath              2.1.6&lt;br /&gt;
* hexbytes           0.3.1&lt;br /&gt;
* orjson             3.9.7&lt;br /&gt;
* pyscab             1.0.1&lt;br /&gt;
* python-lightblue   1.0.3&lt;br /&gt;
* qtm-rt             3.0.1&lt;br /&gt;
* websockets         11.0.3&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.20==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-09-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.19==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-08-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.18==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-07-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated to 22H2&lt;br /&gt;
* OBS Studio 25.04 OBS Studio 29.1.2&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.17==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-06-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.16==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-04-26''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* National Instruments is updated&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.15==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-03-30''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.14==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-03-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.13==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-02-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.12==&lt;br /&gt;
&lt;br /&gt;
''Released 2023-01-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
* Psychopy  2022.1.4    Psychopy 2022.2.4&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.11==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-12-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.10==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-11-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
*mnelab[full] package in Python 38&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.9==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-10-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated to 15.20&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.8==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-09-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.7==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-08-05''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.6==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-07-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
* Python 37            Python 38&lt;br /&gt;
* Psychopy 2020.1.0    Psychopy 2022.1.4&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.5==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-06-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
* Presentation 22.1 01.21.21		Presentation 23.0.10.27.21&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.4==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-05-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.3==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-04-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
* LiteManager Pro - Kijker 4.9&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.2==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-02-28''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.1==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-04-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 2.0==&lt;br /&gt;
&lt;br /&gt;
''Released 2022-07-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.7==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-12-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.6==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-11-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.5==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-10-01''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.4==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-09-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.3==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-08-06''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* ExperimentBuilder is updated to Version 2.3.38&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.2==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-05-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1.1==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-04-09''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Intel(R) Management Engine Components are updated&lt;br /&gt;
* Microsoft Visual C++ is updated&lt;br /&gt;
* Presentation 20.3 02.25.19		Presentation 22.1 01.21.21	&lt;br /&gt;
* Windows is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
* Java 2.8.251.8&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* LiteManager Pro - Viewer	4.9&lt;br /&gt;
* Microsoft Office 2016						English version added&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
&lt;br /&gt;
==Windows 10 Version 1==&lt;br /&gt;
&lt;br /&gt;
''Released 2021-01-11''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* Adobe Acrobat Reader DC	20.009.20067	Adobe 2019.008.20071&lt;br /&gt;
* Audacity 2.1.2							Audacity 2.3.3&lt;br /&gt;
* Bonjour Print Services	2.0.2.0			Bonjour Print Services 2.0.4.0&lt;br /&gt;
* Brainvision 2.1.1                         Brainvision     2.2.0&lt;br /&gt;
* Cyberduck 4.7.3	4.7.3					Cyberduck	7.3.0.32621&lt;br /&gt;
* Eyelink Dataviewer 2.4.1					Eyelink Dataviewer 3.1.97&lt;br /&gt;
* MATLAB R2015b                             MATLAB R2020b 9.9&lt;br /&gt;
* Microsoft Office 2010						Microsoft Office 2016&lt;br /&gt;
* Microsoft Visual C++ is updated&lt;br /&gt;
* Microsoft .NET Framework 4.7.1			Microsoft .NET Framework 4.8&lt;br /&gt;
* NI is updated&lt;br /&gt;
* Notepad++  7.1							Notepad++ (64-bit x64)	7.8.5&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome is updated &lt;br /&gt;
* Git 2.6.3									Git  2.26.0						&lt;br /&gt;
* Java 2.8.211.12							Java 2.8.251.8&lt;br /&gt;
* OBS Studio	23.2.1						OBS Studio 25.04&lt;br /&gt;
* Python 2.7.14								Python 3.7.6 &lt;br /&gt;
* 7-Zip 16.04								7-Zip 19.00 &lt;br /&gt;
&lt;br /&gt;
'''Package Python37'''              &lt;br /&gt;
&lt;br /&gt;
* alabaster                     0.7.12&lt;br /&gt;
* appdirs                       1.4.4&lt;br /&gt;
* arabic-reshaper               2.1.1&lt;br /&gt;
* astroid                       2.4.2&lt;br /&gt;
* astunparse                    1.6.3&lt;br /&gt;
* async-generator               1.10&lt;br /&gt;
* atomicwrites                  1.4.0&lt;br /&gt;
* attrs                         20.3.0&lt;br /&gt;
* autopep8                      1.5.4&lt;br /&gt;
* Babel                         2.9.0&lt;br /&gt;
* backcall                      0.2.0&lt;br /&gt;
* bcrypt                        3.2.0&lt;br /&gt;
* black                         20.8b1&lt;br /&gt;
* bleach                        3.2.1&lt;br /&gt;
* certifi                       2020.12.5&lt;br /&gt;
* cffi                          1.14.4&lt;br /&gt;
* chardet                       4.0.0&lt;br /&gt;
* click                         7.1.2&lt;br /&gt;
* cloudpickle                   1.6.0&lt;br /&gt;
* colorama                      0.4.4&lt;br /&gt;
* cryptography                  3.3.1&lt;br /&gt;
* cycler                        0.10.0&lt;br /&gt;
* decorator                     4.4.2&lt;br /&gt;
* defusedxml                    0.6.0&lt;br /&gt;
* diff-match-patch              20200713&lt;br /&gt;
* distlib                       0.3.1&lt;br /&gt;
* docutils                      0.16&lt;br /&gt;
* dukpy                         0.2.3&lt;br /&gt;
* entrypoints                   0.3&lt;br /&gt;
* esprima                       4.0.1&lt;br /&gt;
* et-xmlfile                    1.0.1&lt;br /&gt;
* filelock                      3.0.12&lt;br /&gt;
* flake8                        3.8.4&lt;br /&gt;
* freetype-py                   2.2.0&lt;br /&gt;
* future                        0.18.2&lt;br /&gt;
* gevent                        20.9.0&lt;br /&gt;
* gitdb                         4.0.5&lt;br /&gt;
* GitPython                     3.1.11&lt;br /&gt;
* glfw                          2.0.0&lt;br /&gt;
* greenlet                      0.4.17&lt;br /&gt;
* helpdev                       0.7.1&lt;br /&gt;
* idna                          2.10&lt;br /&gt;
* imageio                       2.9.0&lt;br /&gt;
* imageio-ffmpeg                0.4.2&lt;br /&gt;
* imagesize                     1.2.0&lt;br /&gt;
* importlib-metadata            2.0.0&lt;br /&gt;
* intervaltree                  3.1.0&lt;br /&gt;
* ipykernel                     5.4.2&lt;br /&gt;
* ipython                       7.19.0&lt;br /&gt;
* ipython-genutils              0.2.0&lt;br /&gt;
* isort                         5.6.4&lt;br /&gt;
* javascripthon                 0.11&lt;br /&gt;
* jdcal                         1.4.1&lt;br /&gt;
* jedi                          0.17.2&lt;br /&gt;
* Jinja2                        2.11.2&lt;br /&gt;
* json-tricks                   3.15.5&lt;br /&gt;
* jsonschema                    3.2.0&lt;br /&gt;
* jupyter-client                6.1.7&lt;br /&gt;
* jupyter-core                  4.7.0&lt;br /&gt;
* jupyterlab-pygments           0.1.2&lt;br /&gt;
* keyring                       21.5.0&lt;br /&gt;
* kiwisolver                    1.3.1&lt;br /&gt;
* lazy-object-proxy             1.4.3&lt;br /&gt;
* macropy3                      1.1.0b2&lt;br /&gt;
* MarkupSafe                    1.1.1&lt;br /&gt;
* matplotlib                    3.3.3&lt;br /&gt;
* mccabe                        0.6.1&lt;br /&gt;
* mistune                       0.8.4&lt;br /&gt;
* moviepy                       1.0.3&lt;br /&gt;
* msgpack                       1.0.2&lt;br /&gt;
* msgpack-numpy                 0.4.7.1&lt;br /&gt;
* mypy-extensions               0.4.3&lt;br /&gt;
* nbclient                      0.5.1&lt;br /&gt;
* nbconvert                     6.0.7&lt;br /&gt;
* nbformat                      5.0.8&lt;br /&gt;
* nest-asyncio                  1.4.3&lt;br /&gt;
* numexpr                       2.7.1&lt;br /&gt;
* numpy                         1.19.4+mkl&lt;br /&gt;
* numpydoc                      1.1.0&lt;br /&gt;
* opencv-python                 4.4.0.46&lt;br /&gt;
* openpyxl                      3.0.5&lt;br /&gt;
* packaging                     20.8&lt;br /&gt;
* pandas                        1.1.5&lt;br /&gt;
* pandocfilters                 1.4.3&lt;br /&gt;
* paramiko                      2.7.2&lt;br /&gt;
* parso                         0.7.0&lt;br /&gt;
* pathspec                      0.8.1&lt;br /&gt;
* patsy                         0.5.1&lt;br /&gt;
* pexpect                       4.8.0&lt;br /&gt;
* pickleshare                   0.7.5&lt;br /&gt;
* Pillow                        8.0.1&lt;br /&gt;
* pip                           21.0.1&lt;br /&gt;
* pluggy                        0.13.1&lt;br /&gt;
* proglog                       0.1.9&lt;br /&gt;
* prompt-toolkit                3.0.8&lt;br /&gt;
* psutil                        5.8.0&lt;br /&gt;
* PsychoPy                      2020.2.10&lt;br /&gt;
* psychtoolbox                  3.0.16&lt;br /&gt;
* ptyprocess                    0.6.0&lt;br /&gt;
* pycodestyle                   2.6.0&lt;br /&gt;
* pycparser                     2.20&lt;br /&gt;
* pydocstyle                    5.1.1&lt;br /&gt;
* pyflakes                      2.2.0&lt;br /&gt;
* pygame                        2.0.0&lt;br /&gt;
* pyglet                        1.3.2&lt;br /&gt;
* Pygments                      2.7.3&lt;br /&gt;
* pylint                        2.6.0&lt;br /&gt;
* pyls-black                    0.4.6&lt;br /&gt;
* pyls-spyder                   0.3.0&lt;br /&gt;
* PyNaCl                        1.4.0&lt;br /&gt;
* PyOpenGL                      3.1.5&lt;br /&gt;
* pyOpenSSL                     20.0.1&lt;br /&gt;
* pyosf                         1.0.5&lt;br /&gt;
* pyparsing                     2.4.7&lt;br /&gt;
* pypiwin32                     223&lt;br /&gt;
* pyqmix                        2019.1&lt;br /&gt;
* PyQt5                         5.12.3&lt;br /&gt;
* PyQt5-sip                     12.8.1&lt;br /&gt;
* PyQtWebEngine                 5.12.1&lt;br /&gt;
* pyrsistent                    0.17.3&lt;br /&gt;
* pyserial                      3.5&lt;br /&gt;
* python-bidi                   0.4.2&lt;br /&gt;
* python-dateutil               2.8.1&lt;br /&gt;
* python-gitlab                 2.5.0&lt;br /&gt;
* python-jsonrpc-server         0.4.0&lt;br /&gt;
* python-language-server        0.36.2&lt;br /&gt;
* python-vlc                    3.0.11115&lt;br /&gt;
* pytz                          2020.4&lt;br /&gt;
* pywin32                       228&lt;br /&gt;
* pywin32-ctypes                0.2.0&lt;br /&gt;
* pyWinhook                     1.6.2&lt;br /&gt;
* PyYAML                        5.3.1&lt;br /&gt;
* pyzmq                         20.0.0&lt;br /&gt;
* QDarkStyle                    2.8.1&lt;br /&gt;
* QtAwesome                     1.0.2&lt;br /&gt;
* qtconsole                     5.0.1&lt;br /&gt;
* QtPy                          1.9.0&lt;br /&gt;
* questplus                     2019.4&lt;br /&gt;
* regex                         2020.11.13&lt;br /&gt;
* requests                      2.25.1&lt;br /&gt;
* rope                          0.18.0&lt;br /&gt;
* ruamel.yaml                   0.16.12&lt;br /&gt;
* ruamel.yaml.clib              0.2.2&lt;br /&gt;
* RuSocSci                      0.8.7&lt;br /&gt;
* scipy                         1.5.4&lt;br /&gt;
* seaborn                       0.11.1&lt;br /&gt;
* setuptools                    41.2.0&lt;br /&gt;
* six                           1.15.0&lt;br /&gt;
* smmap                         3.0.4&lt;br /&gt;
* snowballstemmer               2.0.0&lt;br /&gt;
* sortedcontainers              2.3.0&lt;br /&gt;
* sounddevice                   0.4.1&lt;br /&gt;
* SoundFile                     0.10.3.post1&lt;br /&gt;
* Sphinx                        3.4.0&lt;br /&gt;
* sphinxcontrib-applehelp       1.0.2&lt;br /&gt;
* sphinxcontrib-devhelp         1.0.2&lt;br /&gt;
* sphinxcontrib-htmlhelp        1.0.3&lt;br /&gt;
* sphinxcontrib-jsmath          1.0.1&lt;br /&gt;
* sphinxcontrib-qthelp          1.0.3&lt;br /&gt;
* sphinxcontrib-serializinghtml 1.1.4&lt;br /&gt;
* spyder                        4.2.1&lt;br /&gt;
* spyder-kernels                1.10.1&lt;br /&gt;
* statsmodels                   0.12.1&lt;br /&gt;
* tables                        3.6.1&lt;br /&gt;
* testpath                      0.4.4&lt;br /&gt;
* textdistance                  4.2.0&lt;br /&gt;
* three-merge                   0.1.1&lt;br /&gt;
* toml                          0.10.2&lt;br /&gt;
* tornado                       6.1&lt;br /&gt;
* tqdm                          4.54.1&lt;br /&gt;
* traitlets                     5.0.5&lt;br /&gt;
* typed-ast                     1.4.1&lt;br /&gt;
* typing-extensions             3.7.4.3&lt;br /&gt;
* ujson                         4.0.1&lt;br /&gt;
* urllib3                       1.26.2&lt;br /&gt;
* virtualenv                    20.0.34&lt;br /&gt;
* virtualenvwrapper-win         1.2.6&lt;br /&gt;
* watchdog                      1.0.2&lt;br /&gt;
* wcwidth                       0.2.5&lt;br /&gt;
* webencodings                  0.5.1&lt;br /&gt;
* websocket-client              0.57.0&lt;br /&gt;
* wheel                         0.36.2&lt;br /&gt;
* wrapt                         1.12.1&lt;br /&gt;
* wxPython                      4.1.1&lt;br /&gt;
* xarray                        0.16.2&lt;br /&gt;
* xlrd                          2.0.1&lt;br /&gt;
* yapf                          0.30.0&lt;br /&gt;
* zipp                          3.3.0&lt;br /&gt;
* zope.event                    4.5.0&lt;br /&gt;
* zope.interface                5.2.0&lt;br /&gt;
&lt;br /&gt;
'''Package Python36'''             &lt;br /&gt;
&lt;br /&gt;
* alabaster                     0.7.12&lt;br /&gt;
* appdirs                       1.4.3&lt;br /&gt;
* arabic-reshaper               2.0.15&lt;br /&gt;
* astroid                       2.3.3&lt;br /&gt;
* astunparse                    1.6.3&lt;br /&gt;
* atomicwrites                  1.3.0&lt;br /&gt;
* attrs                         19.3.0&lt;br /&gt;
* autopep8                      1.5&lt;br /&gt;
* Babel                         2.8.0&lt;br /&gt;
* backcall                      0.1.0&lt;br /&gt;
* bcrypt                        3.1.7&lt;br /&gt;
* bleach                        3.1.3&lt;br /&gt;
* certifi                       2019.11.28&lt;br /&gt;
* cffi                          1.14.0&lt;br /&gt;
* chardet                       3.0.4&lt;br /&gt;
* cloudpickle                   1.3.0&lt;br /&gt;
* colorama                      0.4.3&lt;br /&gt;
* cryptography                  2.8&lt;br /&gt;
* cycler                        0.10.0&lt;br /&gt;
* decorator                     4.4.2&lt;br /&gt;
* defusedxml                    0.6.0&lt;br /&gt;
* diff-match-patch              20181111&lt;br /&gt;
* docutils                      0.16&lt;br /&gt;
* dukpy                         0.2.2&lt;br /&gt;
* entrypoints                   0.3&lt;br /&gt;
* esprima                       4.0.1&lt;br /&gt;
* et-xmlfile                    1.0.1&lt;br /&gt;
* flake8                        3.7.9&lt;br /&gt;
* freetype-py                   2.1.0.post1&lt;br /&gt;
* future                        0.18.2&lt;br /&gt;
* gevent                        1.4.0&lt;br /&gt;
* gitdb                         4.0.2&lt;br /&gt;
* GitPython                     3.1.0&lt;br /&gt;
* glfw                          1.11.0&lt;br /&gt;
* greenlet                      0.4.15&lt;br /&gt;
* helpdev                       0.6.10&lt;br /&gt;
* idna                          2.9&lt;br /&gt;
* imageio                       2.8.0&lt;br /&gt;
* imageio-ffmpeg                0.4.1&lt;br /&gt;
* imagesize                     1.2.0&lt;br /&gt;
* importlib-metadata            1.5.0&lt;br /&gt;
* intervaltree                  3.0.2&lt;br /&gt;
* ipykernel                     5.1.4&lt;br /&gt;
* ipython                       7.13.0&lt;br /&gt;
* ipython-genutils              0.2.0&lt;br /&gt;
* isort                         4.3.21&lt;br /&gt;
* javascripthon                 0.10&lt;br /&gt;
* jdcal                         1.4.1&lt;br /&gt;
* jedi                          0.15.2&lt;br /&gt;
* Jinja2                        2.11.1&lt;br /&gt;
* json-tricks                   3.14.0&lt;br /&gt;
* jsonschema                    3.2.0&lt;br /&gt;
* jupyter-client                6.0.0&lt;br /&gt;
* jupyter-core                  4.6.3&lt;br /&gt;
* keyring                       21.2.0&lt;br /&gt;
* kiwisolver                    1.1.0&lt;br /&gt;
* lazy-object-proxy             1.4.3&lt;br /&gt;
* macropy3                      1.1.0b2&lt;br /&gt;
* MarkupSafe                    1.1.1&lt;br /&gt;
* matplotlib                    3.2.0&lt;br /&gt;
* mccabe                        0.6.1&lt;br /&gt;
* mistune                       0.8.4&lt;br /&gt;
* moviepy                       1.0.1&lt;br /&gt;
* msgpack                       1.0.0&lt;br /&gt;
* msgpack-numpy                 0.4.4.3&lt;br /&gt;
* nbconvert                     5.6.1&lt;br /&gt;
* nbformat                      5.0.4&lt;br /&gt;
* numexpr                       2.7.1&lt;br /&gt;
* numpy                         1.18.2&lt;br /&gt;
* numpydoc                      0.9.2&lt;br /&gt;
* opencv-python                 4.2.0.32&lt;br /&gt;
* openpyxl                      3.0.3&lt;br /&gt;
* packaging                     20.3&lt;br /&gt;
* pandas                        1.0.2&lt;br /&gt;
* pandocfilters                 1.4.2&lt;br /&gt;
* paramiko                      2.7.1&lt;br /&gt;
* parso                         0.5.2&lt;br /&gt;
* pathtools                     0.1.2&lt;br /&gt;
* patsy                         0.5.1&lt;br /&gt;
* pexpect                       4.8.0&lt;br /&gt;
* pickleshare                   0.7.5&lt;br /&gt;
* Pillow                        7.0.0&lt;br /&gt;
* pip                           21.0.1&lt;br /&gt;
* pluggy                        0.13.1&lt;br /&gt;
* proglog                       0.1.9&lt;br /&gt;
* prompt-toolkit                3.0.4&lt;br /&gt;
* psutil                        5.7.0&lt;br /&gt;
* PsychoPy                      2020.1.2&lt;br /&gt;
* psychtoolbox                  3.0.16&lt;br /&gt;
* ptyprocess                    0.6.0&lt;br /&gt;
* pycodestyle                   2.5.0&lt;br /&gt;
* pycparser                     2.20&lt;br /&gt;
* pydocstyle                    5.0.2&lt;br /&gt;
* pyflakes                      2.1.1&lt;br /&gt;
* pygame                        1.9.6&lt;br /&gt;
* pyglet                        1.3.2&lt;br /&gt;
* Pygments                      2.6.1&lt;br /&gt;
* pylint                        2.4.4&lt;br /&gt;
* PyNaCl                        1.3.0&lt;br /&gt;
* PyOpenGL                      3.1.5&lt;br /&gt;
* pyOpenSSL                     19.1.0&lt;br /&gt;
* pyosf                         1.0.5&lt;br /&gt;
* pyparsing                     2.4.6&lt;br /&gt;
* pypiwin32                     223&lt;br /&gt;
* pyqmix                        2019.1&lt;br /&gt;
* PyQt5                         5.12.3&lt;br /&gt;
* PyQt5-sip                     12.7.1&lt;br /&gt;
* PyQtWebEngine                 5.12.1&lt;br /&gt;
* pyrsistent                    0.15.7&lt;br /&gt;
* pyserial                      3.4&lt;br /&gt;
* python-bidi                   0.4.2&lt;br /&gt;
* python-dateutil               2.8.1&lt;br /&gt;
* python-gitlab                 2.1.2&lt;br /&gt;
* python-jsonrpc-server         0.3.4&lt;br /&gt;
* python-language-server        0.31.9&lt;br /&gt;
* python-pygaze                 0.7.1&lt;br /&gt;
* pytz                          2019.3&lt;br /&gt;
* pywin32                       227&lt;br /&gt;
* pywin32-ctypes                0.2.0&lt;br /&gt;
* pyWinhook                     1.6.1&lt;br /&gt;
* PyYAML                        5.3&lt;br /&gt;
* pyzmq                         19.0.0&lt;br /&gt;
* QDarkStyle                    2.8&lt;br /&gt;
* QtAwesome                     0.7.0&lt;br /&gt;
* qtconsole                     4.7.1&lt;br /&gt;
* QtPy                          1.9.0&lt;br /&gt;
* questplus                     2019.4&lt;br /&gt;
* requests                      2.23.0&lt;br /&gt;
* rope                          0.16.0&lt;br /&gt;
* ruamel.yaml                   0.16.10&lt;br /&gt;
* ruamel.yaml.clib              0.2.0&lt;br /&gt;
* RuSocSci                      0.8.7&lt;br /&gt;
* scipy                         1.4.1&lt;br /&gt;
* seaborn                       0.10.0&lt;br /&gt;
* setuptools                    46.0.0&lt;br /&gt;
* six                           1.14.0&lt;br /&gt;
* smmap                         3.0.1&lt;br /&gt;
* snowballstemmer               2.0.0&lt;br /&gt;
* sortedcontainers              2.1.0&lt;br /&gt;
* sounddevice                   0.3.15&lt;br /&gt;
* SoundFile                     0.10.3.post1&lt;br /&gt;
* Sphinx                        2.4.4&lt;br /&gt;
* sphinxcontrib-applehelp       1.0.2&lt;br /&gt;
* sphinxcontrib-devhelp         1.0.2&lt;br /&gt;
* sphinxcontrib-htmlhelp        1.0.3&lt;br /&gt;
* sphinxcontrib-jsmath          1.0.1&lt;br /&gt;
* sphinxcontrib-qthelp          1.0.3&lt;br /&gt;
* sphinxcontrib-serializinghtml 1.1.4&lt;br /&gt;
* spyder                        4.1.3&lt;br /&gt;
* spyder-kernels                1.9.1&lt;br /&gt;
* statsmodels                   0.11.1&lt;br /&gt;
* tables                        3.6.1&lt;br /&gt;
* testpath                      0.4.4&lt;br /&gt;
* tobii-research                1.7.0&lt;br /&gt;
* tornado                       6.0.4&lt;br /&gt;
* tqdm                          4.43.0&lt;br /&gt;
* traitlets                     4.3.3&lt;br /&gt;
* typed-ast                     1.4.1&lt;br /&gt;
* urllib3                       1.25.8&lt;br /&gt;
* watchdog                      0.10.2&lt;br /&gt;
* wcwidth                       0.1.8&lt;br /&gt;
* webencodings                  0.5.1&lt;br /&gt;
* wheel                         0.34.2&lt;br /&gt;
* wrapt                         1.11.2&lt;br /&gt;
* wxPython                      4.0.7.post2&lt;br /&gt;
* xarray                        0.15.0&lt;br /&gt;
* xlrd                          1.2.0&lt;br /&gt;
* yapf                          0.29.0&lt;br /&gt;
* zipp                          3.1.0&lt;br /&gt;
 &lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
* OS Windows 7		OS Windows 10&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
* VPN-Client	2.2.2.0&lt;br /&gt;
* E-Prime 1.2 (1.2.1.841)&lt;br /&gt;
* ELAN 4.6.2	4.6.2.0&lt;br /&gt;
* GStreamer 1.0	1.10.0.1&lt;br /&gt;
* Movie Maker	16.4.3528.0331&lt;br /&gt;
* Photo Common	16.4.3528.0331&lt;br /&gt;
* Photo Gallery	16.4.3528.0331&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* MPC-HC 1.7.13 (64-bit)	1.7.13&lt;br /&gt;
* Tobii Eyetracking Presentation Workspace&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
&lt;br /&gt;
==Version 5.6==&lt;br /&gt;
&lt;br /&gt;
''Released 2020-07-03''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome	77.0.3865.75	Google Chrome 83.0.4103.116	&lt;br /&gt;
* Java 2.8.211.12	Java 2.8.251.8&lt;br /&gt;
    &lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
* Adobe Reader XI MUI 11.0.00&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* Zoom 5.1.1 (28546.0628)&lt;br /&gt;
* Adobe Acrobat Reader DC 20.009.20067&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
&lt;br /&gt;
==Version 5.5==&lt;br /&gt;
&lt;br /&gt;
''Released 2020-01-10''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
&lt;br /&gt;
* Ubuntu-partition is updated&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Google Chrome	74.0.3729.157	Google Chrome	77.0.3865.75&lt;br /&gt;
* Update for Microsoft .NET Framework 4.7.1 (KB4511516)&lt;br /&gt;
    &lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
&lt;br /&gt;
* Python 3.7.5 64-bits&lt;br /&gt;
* Psychopy 3.2.4 64 bits&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
&lt;br /&gt;
==Version 5.4==&lt;br /&gt;
&lt;br /&gt;
''Released 2019-10-04''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Microsoft Visual C++ 2017 Redistributable          Microsoft Visual C++ 2019 Redistributable&lt;br /&gt;
* Microsoft Visual C++ 2017 x64 Additional Runtime   Microsoft Visual C++ 2019 x64 Additional Runtime&lt;br /&gt;
* Microsoft Visual C++ 2017 Minimum Runtime          Microsoft Visual C++ 2019 Minimum Runtime&lt;br /&gt;
* Google Chrome	73.0.3683.86	                     Google Chrome	77.0.3865.75&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
* Microsoft .NET Framework  is updated to 4.7.1  &lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
* OBS Studio 23.2.1&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
* Adobe Reader  last documents are invisible&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version 5.3==&lt;br /&gt;
&lt;br /&gt;
''Released 2019-06-07''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Java		191		Java		211&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
* Presentation		20.2&lt;br /&gt;
* Presentation 		19.0&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
* Presentation		20.3&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
* Auto-update Silverlight disabled&lt;br /&gt;
* Experiment user added to input &amp;amp; dialout groups (Ubuntu)&lt;br /&gt;
&lt;br /&gt;
==Version 5.2==&lt;br /&gt;
&lt;br /&gt;
''Released 2018-11-02''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* RuSocSci	0.8.5		RuSocSci	0.8.6&lt;br /&gt;
* Java		171		Java		191&lt;br /&gt;
* Pip		10.0.1		Pip		18.1&lt;br /&gt;
* F-Secure is updated&lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
* Arduino		1.6.7&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
* Presentation		20.2&lt;br /&gt;
* Arduino		1.8.7&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
* the UsefulInfo is changed&lt;br /&gt;
* shortcuts of Git has been added to the Experiment user&lt;br /&gt;
&lt;br /&gt;
==Version 5.1==&lt;br /&gt;
&lt;br /&gt;
''Released 2018-10-05''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* F-Secure              12.00                   F-Secure                12.33&lt;br /&gt;
* Google Chrome		67.0.3396.99		Google Chrome		69.0.3497.100&lt;br /&gt;
* Beer is updated&lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
* Ubuntu-partition is updated&lt;br /&gt;
* Beer is updated&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
* PyLink for SR Research	2.7&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
* a new Microsoft Office 2010 license is implemented&lt;br /&gt;
* the startmenu programs has been pinned&lt;br /&gt;
&lt;br /&gt;
==Version 5==&lt;br /&gt;
&lt;br /&gt;
''Released 2018-07-06'' &lt;br /&gt;
&lt;br /&gt;
'''Software Updates''' &lt;br /&gt;
* Google Chrome		63.0.3239.84	Google Chrome		67.0.3396.99&lt;br /&gt;
* Google Update Helper	1.3.33.7	Google Update Helper	1.3.33.17&lt;br /&gt;
* Java Auto Updater	2.8.151.12	Java Auto Updater	2.8.171.11&lt;br /&gt;
* Microsoft .NETFramework4.7		Microsoft .NETFramework 4.7.1&lt;br /&gt;
* Java 8 		Update 151	Java 8 			Update 171&lt;br /&gt;
* RU_Connect		1.7		Ru-connect 		2_0_4_0&lt;br /&gt;
* asn1crypto		0.23.0		asn1crypto		0.24.0&lt;br /&gt;
* cffi			1.11.2		cffi			1.11.5&lt;br /&gt;
* comtypes		1.1.3		comtypes		1.1.4&lt;br /&gt;
* cryptography		2.1.2		cryptography		2.2.2&lt;br /&gt;
* cython		0.27.2		cython			0.28.3&lt;br /&gt;
* gevent		1.2.2		gevent			1.3.4&lt;br /&gt;
* greenlet		0.4.12		greenlet		0.4.13&lt;br /&gt;
* imageio		2.1.2		imageio			2.3.0&lt;br /&gt;
* ipaddress		1.0.18		ipaddress		1.0.22&lt;br /&gt;
* jdcal			1.3		jdcal			1.4&lt;br /&gt;
* json-tricks		3.8.0		json-tricks		3.12.1&lt;br /&gt;
* moviepy		0.2.3.2		moviepy			0.2.3.5&lt;br /&gt;
* msgpack-python	0.4.8		msgpack-python		0.5.6&lt;br /&gt;
* ndg-httpsclient	0.4.3		ndg-httpsclient		0.5.0&lt;br /&gt;
* nibabel		2.2.0		nibabel			2.3.0&lt;br /&gt;
* opencv-python		3.3.0.10	opencv-python		3.4.1.15&lt;br /&gt;
* openpyxl		2.4.9		openpyxl		2.5.4&lt;br /&gt;
* pillow		4.3.0		pillow			5.1.0&lt;br /&gt;
* pip			9.0.1		pip			10.0.1&lt;br /&gt;
* pipdeptree		0.10.1		pipdeptree		0.12.1&lt;br /&gt;
* psychopy		1.85.3		psychopy		1.90.2&lt;br /&gt;
* py			1.4.34		py			1.5.4&lt;br /&gt;
* pyasn1		0.3.7		pyasn1			0.4.3&lt;br /&gt;
* pydaqmx		1.3.2		pydaqmx			1.4.1&lt;br /&gt;
* pyopenssl		17.3.0		pyopenssl		18.0.0&lt;br /&gt;
* pypiwin32		219		pypiwin32		223&lt;br /&gt;
* pytest		3.2.3		pytest			3.6.2&lt;br /&gt;
* python-pygaze		0.6.0a21	python-pygaze		0.6.0a25&lt;br /&gt;
* pywin32		221		pywin32			223&lt;br /&gt;
* pyyaml		3.12		pyyaml			4.1&lt;br /&gt;
* rusocsci		0.7.9		rusocsci		0.8.5&lt;br /&gt;
* sounddevice		0.3.9		sounddevice		0.3.11&lt;br /&gt;
* spyder		3.2.4		spyder			3.2.8&lt;br /&gt;
* svgwrite		1.1.11		svgwrite		1.1.12&lt;br /&gt;
* tables		3.4.2		tables			3.4.4&lt;br /&gt;
* tqdm			4.11.2		tqdm			4.23.4&lt;br /&gt;
* wheel			0.30.0		wheel			0.31.1&lt;br /&gt;
* xlsxwriter		1.0.2		xlsxwriter		1.0.5&lt;br /&gt;
&lt;br /&gt;
'''Software Changes''' &lt;br /&gt;
* Ubuntu-partition is updated&lt;br /&gt;
* psychopy 1.85.3 psychopy 1.90.2&lt;br /&gt;
&lt;br /&gt;
'''Removed Software''' &lt;br /&gt;
&lt;br /&gt;
'''Added Software''' &lt;br /&gt;
* atomicwrites		1.1.5&lt;br /&gt;
* attrs			18.1.0&lt;br /&gt;
* cloudpickle		0.5.3&lt;br /&gt;
* funcsigs		1.0.2&lt;br /&gt;
* more-itertools	4.2.0&lt;br /&gt;
* pluggy		0.6.0&lt;br /&gt;
* pypubsub		4.0.0&lt;br /&gt;
* python-vlc		3.0.102&lt;br /&gt;
* soundfile		0.10.2&lt;br /&gt;
* wxpython		4.0.3&lt;br /&gt;
* zmq			0.0.0&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes''' &lt;br /&gt;
* a shortcut to the workgroupdrive is removed from the desktop&lt;br /&gt;
* a shortcut to VLCplayer is changed&lt;br /&gt;
&lt;br /&gt;
==Version 4==&lt;br /&gt;
''Released 2017-12-08''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Microsoft .NET Framework 4.6.1 	Microsoft .NET Framework 4.7&lt;br /&gt;
* alabaster	0.7.9			alabaster	0.7.10&lt;br /&gt;
* babel		2.3.4			babel		2.5.1&lt;br /&gt;
* certifi	2016.9.26		certifi		2017.7.27.1&lt;br /&gt;
* cffi		1.9.1			cffi		1.11.2&lt;br /&gt;
* colorama	0.3.7			colorama	0.3.9&lt;br /&gt;
* docutils	0.12			docutils	0.14&lt;br /&gt;
* expyriment	0.8.0			expyriment	0.9.0&lt;br /&gt;
* gevent	1.1.2			gevent		1.2.2&lt;br /&gt;
* greenlet	0.4.10			greenlet	0.4.12&lt;br /&gt;
* imageio	1.6			imageio		2.1.2&lt;br /&gt;
* jinja2	2.8			jinja2		2.9.6&lt;br /&gt;
* markupsafe	0.23			markupsafe	1.0&lt;br /&gt;
* matplotlib	1.5.3			matplotlib	2.1.0&lt;br /&gt;
* moviepy	0.2.2.11		moviepy		0.2.3.2&lt;br /&gt;
* numpy		1.11.3			numpy		1.13.1&lt;br /&gt;
* openpyxl	2.3.5			openpyxl	2.4.9&lt;br /&gt;
* pandas	0.19.1			pandas		0.21.0&lt;br /&gt;
* pillow	3.4.2			pillow		4.3.0&lt;br /&gt;
* psutil	4.4.2			psutil		5.4.0&lt;br /&gt;
* psychopy	1.84.2			psychopy	1.85.3&lt;br /&gt;
* py		1.4.31			py		1.4.34&lt;br /&gt;
* pycparser	2.17			pycparser	2.18&lt;br /&gt;
* pygments	2.1.3			pygments	2.2.0&lt;br /&gt;
* pyparallel	0.2.2			pyparallel	&lt;br /&gt;
* pyparsing	2.1.10			pyparsing	2.2.0&lt;br /&gt;
* pyqtgraph	0.9.10			pyqtgraph	0.10.0&lt;br /&gt;
* pyserial	3.2.1			pyserial	3.4&lt;br /&gt;
* pytest	3.0.3			pytest		3.2.3&lt;br /&gt;
* python-dateutil2.6.0			python-dateutil	2.6.1&lt;br /&gt;
* pytz		2016.7			pytz		2017.2&lt;br /&gt;
* pywin32	220			pywin32		221&lt;br /&gt;
* requests	2.11.1			requests	2.18.4&lt;br /&gt;
* rusocsci	0.7.8			rusocsci	0.7.9&lt;br /&gt;
* scipy		0.16.1			scipy		0.19.1&lt;br /&gt;
* seaborn	0.7.1			seaborn		0.8.1&lt;br /&gt;
* setuptools	20.10.1			setuptools	28.8.0&lt;br /&gt;
* six		1.10.0			six		1.11.0&lt;br /&gt;
* sphinx	1.5a2			sphinx		1.6.5&lt;br /&gt;
* tornado	4.4.2			tornado		4.5.2&lt;br /&gt;
* tqdm		4.10.0			tqdm		4.11.2&lt;br /&gt;
* python	2712			python		2714&lt;br /&gt;
* numpy		1.11.3			numpy		1.13.1&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
* Ubuntu-partition is updated&lt;br /&gt;
* python 	2.7.12 	 		python 		2.7.14&lt;br /&gt;
* psychopy	1.84.2			psychopy	1.85.3&lt;br /&gt;
&lt;br /&gt;
Psychopy 1.84 has been replaced with 1.85.&lt;br /&gt;
The default audio back-end has changed as a result.&lt;br /&gt;
If you experience problems with sound after this update, try our troubleshooting guide: [[Psychopy#Version_Change_to_1.85]]&lt;br /&gt;
&lt;br /&gt;
'''Removed Software'''&lt;br /&gt;
* ASIO4ALL	2.13&lt;br /&gt;
* OpenSesame 	3.0.2-py2.7-win32-1&lt;br /&gt;
* ansi		0.1.3&lt;br /&gt;
* arrow		0.10.0&lt;br /&gt;
* builder	0.1.0&lt;br /&gt;
* coverage	4.2&lt;br /&gt;
* datastore	0.3.6&lt;br /&gt;
* django	1.10.5&lt;br /&gt;
* freetype-py	1.0.2&lt;br /&gt;
* futures	3.0.5&lt;br /&gt;
* image		1.5.5&lt;br /&gt;
* iolabs	3.2&lt;br /&gt;
* library	0.0.0&lt;br /&gt;
* networkx	1.11&lt;br /&gt;
* output	1.0.1&lt;br /&gt;
* parallel	0.2.5&lt;br /&gt;
* pp		1.6.5&lt;br /&gt;
* pyaml		16.11.0&lt;br /&gt;
* pyo		0.8.3&lt;br /&gt;
* sphinx-rtd-theme 0.1.10a0&lt;br /&gt;
&lt;br /&gt;
'''Added Software'''&lt;br /&gt;
* HASP SRM Run-time	2.50.1.3928&lt;br /&gt;
* asn1crypto		0.23.0&lt;br /&gt;
* astroid		1.5.3&lt;br /&gt;
* backports.functools-lru-cache	1.4&lt;br /&gt;
* backports.shutil-get-terminal-size	1.0.0&lt;br /&gt;
* bleach		2.1.1&lt;br /&gt;
* boto			2.48.0&lt;br /&gt;
* bz2file		0.98&lt;br /&gt;
* chardet		3.0.4&lt;br /&gt;
* comtypes		1.1.3&lt;br /&gt;
* configparser		3.5.0&lt;br /&gt;
* cryptography		2.1.2&lt;br /&gt;
* cython		0.27.2&lt;br /&gt;
* entrypoints		0.2.3&lt;br /&gt;
* enum34		1.1.6&lt;br /&gt;
* functools32		3.2.3.post2&lt;br /&gt;
* future		0.16.0&lt;br /&gt;
* gensim		3.1.0&lt;br /&gt;
* hid			0.1.1&lt;br /&gt;
* html5lib		1.0b10&lt;br /&gt;
* idna			2.6&lt;br /&gt;
* ipaddress		1.0.18&lt;br /&gt;
* ipykernel		4.6.1&lt;br /&gt;
* ipython		5.5.0&lt;br /&gt;
* ipython-genutils	0.2.0&lt;br /&gt;
* ipywidgets		7.0.4&lt;br /&gt;
* isort			4.2.15&lt;br /&gt;
* jedi			0.11.0&lt;br /&gt;
* json-tricks		3.8.0&lt;br /&gt;
* jsonschema		2.6.0&lt;br /&gt;
* jupyter		1.0.0&lt;br /&gt;
* jupyter-client	5.1.0&lt;br /&gt;
* jupyter-console	5.2.0&lt;br /&gt;
* jupyter-core		4.3.0&lt;br /&gt;
* lazy-object-proxy	1.3.1&lt;br /&gt;
* mccabe		0.6.1&lt;br /&gt;
* mistune		0.8&lt;br /&gt;
* nbconvert		5.3.1&lt;br /&gt;
* nbformat		4.4.0&lt;br /&gt;
* ndg-httpsclient	0.4.3&lt;br /&gt;
* nibabel		2.2.0&lt;br /&gt;
* nltk			3.2.5&lt;br /&gt;
* nose			1.3.7&lt;br /&gt;
* notebook		5.2.1&lt;br /&gt;
* numexpr		2.6.4&lt;br /&gt;
* numpydoc		0.7.0&lt;br /&gt;
* opencv-python		3.3.0.10&lt;br /&gt;
* pandocfilters		1.4.2&lt;br /&gt;
* parso			0.1.0&lt;br /&gt;
* pathlib2		2.3.0&lt;br /&gt;
* patsy			0.4.1&lt;br /&gt;
* pattern		2.6&lt;br /&gt;
* pickleshare		0.7.4&lt;br /&gt;
* pipdeptree		0.10.1&lt;br /&gt;
* prompt-toolkit	1.0.15&lt;br /&gt;
* pyasn1		0.3.7&lt;br /&gt;
* pycodestyle		2.3.1&lt;br /&gt;
* pyfilesec		0.2.14&lt;br /&gt;
* pyflakes		1.6.0&lt;br /&gt;
* pyhook		1.5.1&lt;br /&gt;
* pylint		1.7.4&lt;br /&gt;
* pyopenssl		17.3.0&lt;br /&gt;
* pyosf			1.0.5&lt;br /&gt;
* pyzmq			16.0.3&lt;br /&gt;
* qtawesome		0.4.4&lt;br /&gt;
* qtconsole		4.3.1&lt;br /&gt;
* qtpy			1.3.1&lt;br /&gt;
* rope			0.10.7&lt;br /&gt;
* scandir		1.5&lt;br /&gt;
* scikit-learn		0.19.1&lt;br /&gt;
* simplegeneric		0.8.1&lt;br /&gt;
* smart-open		1.5.3&lt;br /&gt;
* sounddevice		0.3.9&lt;br /&gt;
* sphinxcontrib-websupport	1.0.1&lt;br /&gt;
* spyder		3.2.4&lt;br /&gt;
* statsmodels		0.8.0&lt;br /&gt;
* svgwrite		1.1.11&lt;br /&gt;
* tables		3.4.2&lt;br /&gt;
* testpath		0.3.1&lt;br /&gt;
* traitlets		4.3.2&lt;br /&gt;
* typing		3.6.2&lt;br /&gt;
* urllib3		1.22&lt;br /&gt;
* wcwidth		0.1.7&lt;br /&gt;
* webencodings		0.5.1&lt;br /&gt;
* wheel			0.30.0&lt;br /&gt;
* widgetsnbextension	3.0.7&lt;br /&gt;
* win-unicode-console	0.5&lt;br /&gt;
* wrapt			1.10.11&lt;br /&gt;
* wxPython 		2.8.12.1 &lt;br /&gt;
* xlrd			1.1.0&lt;br /&gt;
* xlsxwriter		1.0.2&lt;br /&gt;
* xlwt			1.3.0&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
* a shortcut to the workgroupdrive is placed on the desktop&lt;br /&gt;
* shortcuts to spyder an psychopy are placed on the desktop&lt;br /&gt;
* UsefulInfo is updated&lt;br /&gt;
&lt;br /&gt;
==Version 3.3==&lt;br /&gt;
''Released 2017-09-20''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Microsoft .NET Framework 4.6.1 (KB4040973)&lt;br /&gt;
* Google Chrome	60.0.3112.113&lt;br /&gt;
&lt;br /&gt;
'''Software Changes'''&lt;br /&gt;
* Anaconda is removed&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
* a shortcut to drive E: (DATA) is placed on the desktop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Version 3.1.1==&lt;br /&gt;
''Released 2017-05-19''&lt;br /&gt;
&lt;br /&gt;
'''Software Updates'''&lt;br /&gt;
* Arduino updated to version 1.6.7&lt;br /&gt;
* E-Prime 2.0 Standard SP2 (2.0.10.356)updated to version 2.0.10356&lt;br /&gt;
* F-Secure Client Security - DeepGuard  updated to version 5.0.58&lt;br /&gt;
* F-Secure Client Security - Virus &amp;amp; Spy Protection updated to version 9.51.223&lt;br /&gt;
* F-Secure Client Security - Web traffic scanning updated to version 3.00.453&lt;br /&gt;
* F-Secure Client Security - Browsing protection updated to version 2.00.1360&lt;br /&gt;
* F-Secure Client Security - E-Mail Scanning updated to version 6.00.543&lt;br /&gt;
* F-Secure Client Security updated to version 12.00&lt;br /&gt;
* GStreamer updated to version1.10.0.1&lt;br /&gt;
* Inquisit 4 updated to version4.0.8&lt;br /&gt;
* Java Auto Updater updated to version 2.8.121.13&lt;br /&gt;
* Java 8 updated to version 121	8.0.1210.13&lt;br /&gt;
* Microsoft Visual C++ 2005 Redistributable (x64)updated to version 8.0.61000&lt;br /&gt;
* NVIDIA Stereoscopic 3D Driver updated to version 7.17.13.7500&lt;br /&gt;
* Realtek High Definition Audio Driver updated to version 6.0.1.6068&lt;br /&gt;
* Renesas Electronics USB 3.0 Host Controller Driver updated to version 3.0.23.0&lt;br /&gt;
* SMI Experiment Suite 360°updated to version 3.6.149&lt;br /&gt;
* SMI iView SDK updated to version 4.2.63&lt;br /&gt;
* VLC media player updated to version 2.2.3&lt;br /&gt;
{{Listbreak}}&lt;br /&gt;
* actiCAP Control updated to version 1.02.0004&lt;br /&gt;
* Adobe Reader XI updated to version MUI 11.10&lt;br /&gt;
* Audacity updated to version 2.1.2 2..0&lt;br /&gt;
* BrainVision Recorder updated to version 1.20.0801&lt;br /&gt;
* BrainVision Analyzer updated to version 2.1.1&lt;br /&gt;
* Adobe Flash Player 23 ActiveX updated to version 23.0.0.185&lt;br /&gt;
* Bonjour updated to version 2.0.4.0&lt;br /&gt;
* Bonjour Print Services updated to version 2.0.2.0&lt;br /&gt;
* Cyberduck updated to version 4.7.3	&lt;br /&gt;
* E-Prime 1.2 updated to version 1.2.17&lt;br /&gt;
* ffdshow updated to version v1.3.4533 &lt;br /&gt;
* pyo version updated to version 0.8.2&lt;br /&gt;
* wxPython updated to version 3.0.2.0 for Python 2.7&lt;br /&gt;
* Presentation updated to version 19.0 11.14.16&lt;br /&gt;
* Python 2.7 pygame updated to version 1.9.2&lt;br /&gt;
* Python  updated to version 2.7.12&lt;br /&gt;
* PyQt GPL updated to version v4.11.4 for Python v2.7 (x32)&lt;br /&gt;
* .NET Framework updated to version 4.6.1&lt;br /&gt;
{{Listbreak}}&lt;br /&gt;
* Experiment Builder updated to version 1.10.1630&lt;br /&gt;
* Microsoft Office 2010 version 14.0.7015.1000&lt;br /&gt;
* Microsoft Silverlight	version 5.1.50901.0&lt;br /&gt;
* Notepad++ version 7.1&lt;br /&gt;
* OpenSesame version 3.0.2-py2.7-win32-1&lt;br /&gt;
* Slik Subversion version 1.9.2 (x64)&lt;br /&gt;
{{Listbreak}}&lt;br /&gt;
* EyeLink Developer's Kit 1.11.5.0 added&lt;br /&gt;
* Eyelink Dataviewer 2.4.1 added &lt;br /&gt;
* Google Chrome 56.0.2924.87 added&lt;br /&gt;
* NI complet package (64 bit) version 15.0.30 added&lt;br /&gt;
* Tobii Eyetracking SDK	version 2.4.12 added&lt;br /&gt;
* Tobii Eyetracking Tools version 0.0.0 added&lt;br /&gt;
* VPN-Client version 2.2.2.0&lt;br /&gt;
&lt;br /&gt;
'''Minor Changes'''&lt;br /&gt;
* Changing networkmode is updated&lt;br /&gt;
* Profile Experiment-user is on E: (Data)&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=System_Image&amp;diff=6476</id>
		<title>System Image</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=System_Image&amp;diff=6476"/>
		<updated>2026-04-16T14:01:37Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Outdated}}&lt;br /&gt;
{{Infobox software&lt;br /&gt;
| name                   = System Image&lt;br /&gt;
| logo                   = cd.png&lt;br /&gt;
| screenshot             = &lt;br /&gt;
| caption                = &lt;br /&gt;
| developer              = Technical Support Group&lt;br /&gt;
| installed version      = Latest&lt;br /&gt;
| installed version date = See [[System Image/Changelog | Changelog]]&lt;br /&gt;
| operating system       = Windows 11&lt;br /&gt;
| resources              = &amp;lt;!--&lt;br /&gt;
  {{Infobox tsg&lt;br /&gt;
    | child              = yes&lt;br /&gt;
    | downloads          = {{bulleted list&lt;br /&gt;
        | [http://www.ru.nl Some Download link]&lt;br /&gt;
        | [http://www.ru.nl Some other Download link]&lt;br /&gt;
    }}&lt;br /&gt;
    | manuals            = {{bulleted list&lt;br /&gt;
        | [http://www.ru.nl Quick start guide]&lt;br /&gt;
    }}&lt;br /&gt;
  }}--&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
Our [[Lab Computer]]s are installed with a [https://en.wikipedia.org/wiki/System_image System Image]. This helps us standardize, manage and maintain all software and drivers across all computers in the BSI and DCC research labs. A standardized image allows researchers to easily transfer their experiments from one lab to the other (e.g. in case of booking constraints) or conduct research in multiple labs simultaneously with identical settings.&lt;br /&gt;
&lt;br /&gt;
The TSG will periodically update this image to improve performance and security. &amp;lt;br/&amp;gt;&lt;br /&gt;
⚠️ During the update, the Windows (C:\) will be wiped, as may the Data (D:\) drive. Therefore, please back up your data from the Data drive to your network drive regularly (e.g. at the end of every day).&lt;br /&gt;
&lt;br /&gt;
==Pre-Installed Software==&lt;br /&gt;
Below is a list of the most frequently used applications that are installed as part of the system image. &amp;lt;br/&amp;gt;&lt;br /&gt;
⚠️This list is incomplete and outdated. Please contact our [[Administrator]] if you want to know if a certain program or additional version is installed, or check the [[System_Image/Changelog | changelog]].&lt;br /&gt;
&lt;br /&gt;
==== Research Applications ====&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product Name &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Publisher &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Installed Version &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | License Type &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Dongle Req.&lt;br /&gt;
|-&lt;br /&gt;
| [[Biopac]] || BioPac Student Lab || 3.7.7 || Commercial || {{Some|No}} &amp;lt;ref group=&amp;quot;fn&amp;quot;&amp;gt;Requires Biopac device to be attached&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Brainvision || Media Recorder || 1.23.0001 || Non-Commercial || {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| Brainvision || Analyzer || 2.2.0 || Non-Commercial || {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| E-Prime || PST-Software || 2.0.10356 || Research Only || {{Yes}}&lt;br /&gt;
|-&lt;br /&gt;
| Inquisit 6 || Millisecond Software || 6.6.3.6612 || Academic || {{No}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Matlab]] || MathWorks || 2024a || Academic || {{No}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Presentation]] || Neurobehavioral Systems || 25.0 || Academic || {{Some|Yes}} &amp;lt;ref group=&amp;quot;fn&amp;quot;&amp;gt;Limited network licenses are also available&amp;lt;/ref&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| [[Psychopy]] || Nottingham University || 2024.1.0 || GNU GPL || {{No}}&lt;br /&gt;
|-&lt;br /&gt;
| [[Python]] || Python || 3.10.11 || Open Source || {{No}}&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Standard Applications ====&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Product Name &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Publisher &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Installed Version &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | License Type &lt;br /&gt;
|-&lt;br /&gt;
| 7zip || 7zip || &amp;lt;!--19.00--&amp;gt; || GNU GPL/LGPL &lt;br /&gt;
|-&lt;br /&gt;
| Adobe Acrobat Reader || Adobe || 26.001.21431 || Commercial &lt;br /&gt;
|-&lt;br /&gt;
| Arduino IDE || Arduino || &amp;lt;!--1.6.3--&amp;gt; ||  GNU GPL/LGPL &lt;br /&gt;
|-&lt;br /&gt;
| Audacity || AudacityTeam || &amp;lt;!--2.3.3--&amp;gt; || GNU GPL &lt;br /&gt;
|-&lt;br /&gt;
| Cyberduck || Cyberduck || &amp;lt;!--9.2.4--&amp;gt; || Libre &lt;br /&gt;
|-&lt;br /&gt;
| [[Gitlab Social Sciences | Git]] || Git || &amp;lt;!--2.29.2--&amp;gt; || Open Source &lt;br /&gt;
|- &lt;br /&gt;
| [[OBS Studio]] || OBS Project  || 32.1 || GPL 2.0 &lt;br /&gt;
|-&lt;br /&gt;
| Office || Microsoft || 2016 Plus || Academic &lt;br /&gt;
|-&lt;br /&gt;
| VLC Media Player || VideoLan || &amp;lt;!--3.0.8--&amp;gt; || GNU GPL &lt;br /&gt;
|-&lt;br /&gt;
| WithSecure™ Client Security Premium  || F-Secure || &amp;lt;ref group=&amp;quot;fn&amp;quot;&amp;gt;As of image update date (see [[System_Image/Changelog|Changelog]])&amp;lt;/ref&amp;gt; || Academic &lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references group='fn'/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Changelog==&lt;br /&gt;
{{see also|System Image/Changelog}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Meta:Guidelines&amp;diff=6475</id>
		<title>Meta:Guidelines</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Meta:Guidelines&amp;diff=6475"/>
		<updated>2026-04-16T14:00:56Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* Banners */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a sample page for the tsgdoc Wiki and can be used as reference for creating new pages. Note that this introduction is conventionally placed above the Table Of Contents (TOC), so visitors can immediately see what this page is about, instead of having to scroll passed the TOC.&lt;br /&gt;
&lt;br /&gt;
For more general wiki conventions and formatting help , visit the [http://www.mediawiki.org/wiki/Help:Formatting MediaWiki Formatting Guide].&lt;br /&gt;
&lt;br /&gt;
==Page Names==&lt;br /&gt;
Page names should be descriptive and unique. Use singular nouns instead of plurals when possible (e.g. &amp;quot;Keyboard&amp;quot; instead of &amp;quot;Keyboards&amp;quot;). This makes linking from singular words easier, as you can just use:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;One [[Keyboard]], Two [[Keyboard]]s.&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
One [[Keyboard]], Two [[Keyboard]]s.&amp;lt;br/&amp;gt; &lt;br /&gt;
instead of&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;One [[Keyboards|Keyboard]], Two [[Keyboards]].&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
&lt;br /&gt;
Always try to group and categorize your information in a logical and user-friendly way. Prevent redundancies: only create subcategories if there are more of them at the same level (levels are indicated by number of = signs before and after the header), otherwise just collapse to the parent.&lt;br /&gt;
&lt;br /&gt;
You can add many levels of subheaders as you like, but after level 3 they become quite hard to distinguish and will clutter the TOC. If a subject requires many sub-subcategories, consider giving the subcategory its own page. Alternatively, if the sub-subcategories are only small in content, you could make non-TOC headers with simple '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download/External Links==&lt;br /&gt;
Links should be '''descriptive'''. Don't waste space by pasting the entire url or writing something like &amp;quot;Click [[Meta:Guidelines|here]] to download the documentation&amp;quot;. Examples:&lt;br /&gt;
*[[:File:Obs_tut_videoSet.png|Uploaded file with version control]]&lt;br /&gt;
*[[Media:BITSI_tempalte2015_duemilanove.zip|Directly downloadable file]] (zip)&lt;br /&gt;
&lt;br /&gt;
==Images==&lt;br /&gt;
[[File:placeholder.png|thumb|320px|Right-floating image thumbnail with description.]]&lt;br /&gt;
&lt;br /&gt;
To optimize screen space, images should be placed in a floating window, aligned to the right side of the screen. Larger images can be automatically resized to thumbnails, by specifying the thumbnail width. 300px is the preferred thumbnail size. Adding a description underneath the image is appreciated.&lt;br /&gt;
For more image formatting guidelines, visit the [http://www.mediawiki.org/wiki/Help:Images MediaWiki Images Guide].&lt;br /&gt;
&lt;br /&gt;
'''Inline Images'''&lt;br /&gt;
&lt;br /&gt;
Images that are used, for instance, as part of a step-by-step tutorial can be placed inline, with larger size to make them more readable. The exact size is up to you, but the width should not exceed 720px.&amp;lt;ref&amp;gt;Thumbnails 720px wide still fit comfortably within a browser window on half a 1920px desktop monitor.&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:placeholder.png|thumb|none|480px|Caption]]&lt;br /&gt;
&lt;br /&gt;
You can prevent text that is placed after the image from flowing next to the image by placing an HTML break behind it.&lt;br /&gt;
&lt;br /&gt;
==Tables==&lt;br /&gt;
&lt;br /&gt;
For tables, use the Wikitable markup. It is more readable and easy on the eye than the default one. There are multiple ways to create rows and columns, some used in the example below, but for more information, consult the [http://www.mediawiki.org/wiki/Help:Tables MediaWiki Table Formatting Guide]. &lt;br /&gt;
&lt;br /&gt;
By default, table columns will scale to fit the contents of the cell, but this usually results in a messy-looking table. Set fixed column-widths to keep the table nice and tight.&lt;br /&gt;
&lt;br /&gt;
For binary entries (e.g. Yes/No), a background color can be used to make it easier to recognize. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! width=&amp;quot;150px&amp;quot; | &lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 1&lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 2&lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 3&lt;br /&gt;
|-&lt;br /&gt;
| Regular Info || Info 1 || Info 2 || Info 3&lt;br /&gt;
|-&lt;br /&gt;
! Comparison&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Template || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{No}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Some}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Result || {{Yes}} || {{No}} || {{Some}}&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Custom name || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Yes|Yeah!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;  || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{No|Nuh-uh}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;  || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Some|Maybe?}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Result || {{Yes|Yeah!}} || {{No|Nuh-uh}} || {{Some|Maybe?}}&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Manual colors&lt;br /&gt;
| style=&amp;quot;background-color:#9F9;&amp;quot; | #9F9&lt;br /&gt;
| style=&amp;quot;background-color:#F99;&amp;quot; | #F99&lt;br /&gt;
| style=&amp;quot;background-color:#FFD;&amp;quot; | #FFD&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
If you want to add code, the syntax might interfere with the Mediawiki syntax. To prevent this from happening, place your code in one of the following preferred ways:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Fixed format text for short, single-line code.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Long code, spans entire width of the page.&lt;br /&gt;
Supports syntax highlighting of certain languages, like Python and HTML.&lt;br /&gt;
Change the lang=&amp;quot;&amp;quot; attribute to the correct language, e.g. lang=&amp;quot;python&amp;quot; or lang=&amp;quot;html5&amp;quot;&lt;br /&gt;
Use lang=&amp;quot;text&amp;quot; for non-supported languages.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot; line style=&amp;quot;height:15em; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
You can also add line numbering.&lt;br /&gt;
&lt;br /&gt;
If your code is longer than, say, 50 lines, you can add a style attribute to introduce a scrollbar, as sampled here. For a 50-line cutoff, use style=&amp;quot;height:50em; overflow:auto;&amp;quot;.&lt;br /&gt;
Note that this method will cause the print version of the page to cut off the code at the line limit mark and not print the rest of the code.&lt;br /&gt;
I might fix that, but if it's really crucial to have an entire page full of code, you should probably give it a separate page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Start Pirate Ipsum--&amp;gt;&lt;br /&gt;
Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm. Pinnace holystone mizzenmast quarter crow's nest nipperkin grog yardarm hempen halter furl. Swab barque interloper chantey doubloon starboard grog black jack gangway rutters.&lt;br /&gt;
Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.&lt;br /&gt;
Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow's nest rutters. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.&lt;br /&gt;
&amp;lt;!-- End Pirate Ipsum--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For command-line code, you can also style it like this for clarity:&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;ping 127.0.0.1 -n 50 -l 1024&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could also use the &amp;lt;nowiki&amp;gt;&amp;lt;tt&amp;gt; &amp;lt;pre&amp;gt; and nowiki &amp;lt;/nowiki&amp;gt; tags if better suited for your needs, whatever works best to present the code as clear and readable as possible.&lt;br /&gt;
&lt;br /&gt;
==Emoji==&lt;br /&gt;
It is encouraged to use [https://unicode.org/emoji/charts/full-emoji-list.html unicode emojis] (which you can just copy-paste as text) in places where they can draw extra attention, help illustrate your point, or break up the monotony of a long text. &lt;br /&gt;
&lt;br /&gt;
Be aware that emojis may be rendered differently in different browsers or operating systems, so try to pick ones that are common and unambiguous, and also recognizable at the scale they get reduced to when placed in-line on our Wiki. Also, Windows doesn't natively support flag emojis like 🇳🇱, for some reason.&lt;br /&gt;
&lt;br /&gt;
Lastly, don't overdo the emojis, as that could make it seem like our wiki was written by AI. &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
ℹ️ This is a piece of (extra) information. &lt;br /&gt;
&lt;br /&gt;
⚠️ This is a warning!&lt;br /&gt;
&lt;br /&gt;
❌ This is a no-go!&lt;br /&gt;
&lt;br /&gt;
✅ This is good.&lt;br /&gt;
&lt;br /&gt;
✨ This is something new!&lt;br /&gt;
&lt;br /&gt;
🚧 This is under construction.&lt;br /&gt;
&lt;br /&gt;
🐽 Oink.&lt;br /&gt;
&lt;br /&gt;
These are just examples; feel free to come up with your own conventions so we can later compare and discuss what works best.&lt;br /&gt;
&lt;br /&gt;
==Shields and Badges==&lt;br /&gt;
Github-style shields or badges are useful for providing software details like programming language and licensing at a glance. There's a case to be made for our Wiki and Gitlab READMEs to use similar layouts and features for more uniformity in our documentation, and so badges could help with that too. Unfortunately, it is currently a bit of a faff to implement badges on our wiki, as hotlinking or injecting dynamic content from external sources is disabled for security reasons.&lt;br /&gt;
&lt;br /&gt;
The workaround:&lt;br /&gt;
# Generate a badge at https://shields.io&lt;br /&gt;
# Create a new CSS rule in [[MediaWiki:Common.css]] (see examples at bottom)&lt;br /&gt;
# On the page you want to edit, add a custom span with class=&amp;quot;shield&amp;quot; and the id as named in the CSS, e.g.: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add to the list of shields below.&lt;br /&gt;
&lt;br /&gt;
===Available Shields===&lt;br /&gt;
:&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Banners==&lt;br /&gt;
If a page is, or needs to be, significantly changed, you can put a banner on top to warn/inform visitors.&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Notice|Did you know you could add banners?}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Notice|Did you know you could add banners?}}&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Warn|'''Look Out!'''}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Warn|'''Look Out!'''}}&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Outdated}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Outdated}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Meta:Guidelines&amp;diff=6474</id>
		<title>Meta:Guidelines</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Meta:Guidelines&amp;diff=6474"/>
		<updated>2026-04-16T13:59:35Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* Tables */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a sample page for the tsgdoc Wiki and can be used as reference for creating new pages. Note that this introduction is conventionally placed above the Table Of Contents (TOC), so visitors can immediately see what this page is about, instead of having to scroll passed the TOC.&lt;br /&gt;
&lt;br /&gt;
For more general wiki conventions and formatting help , visit the [http://www.mediawiki.org/wiki/Help:Formatting MediaWiki Formatting Guide].&lt;br /&gt;
&lt;br /&gt;
==Page Names==&lt;br /&gt;
Page names should be descriptive and unique. Use singular nouns instead of plurals when possible (e.g. &amp;quot;Keyboard&amp;quot; instead of &amp;quot;Keyboards&amp;quot;). This makes linking from singular words easier, as you can just use:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;One [[Keyboard]], Two [[Keyboard]]s.&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt; &lt;br /&gt;
One [[Keyboard]], Two [[Keyboard]]s.&amp;lt;br/&amp;gt; &lt;br /&gt;
instead of&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;One [[Keyboards|Keyboard]], Two [[Keyboards]].&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Categories==&lt;br /&gt;
&lt;br /&gt;
Always try to group and categorize your information in a logical and user-friendly way. Prevent redundancies: only create subcategories if there are more of them at the same level (levels are indicated by number of = signs before and after the header), otherwise just collapse to the parent.&lt;br /&gt;
&lt;br /&gt;
You can add many levels of subheaders as you like, but after level 3 they become quite hard to distinguish and will clutter the TOC. If a subject requires many sub-subcategories, consider giving the subcategory its own page. Alternatively, if the sub-subcategories are only small in content, you could make non-TOC headers with simple '''bold text'''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Download/External Links==&lt;br /&gt;
Links should be '''descriptive'''. Don't waste space by pasting the entire url or writing something like &amp;quot;Click [[Meta:Guidelines|here]] to download the documentation&amp;quot;. Examples:&lt;br /&gt;
*[[:File:Obs_tut_videoSet.png|Uploaded file with version control]]&lt;br /&gt;
*[[Media:BITSI_tempalte2015_duemilanove.zip|Directly downloadable file]] (zip)&lt;br /&gt;
&lt;br /&gt;
==Images==&lt;br /&gt;
[[File:placeholder.png|thumb|320px|Right-floating image thumbnail with description.]]&lt;br /&gt;
&lt;br /&gt;
To optimize screen space, images should be placed in a floating window, aligned to the right side of the screen. Larger images can be automatically resized to thumbnails, by specifying the thumbnail width. 300px is the preferred thumbnail size. Adding a description underneath the image is appreciated.&lt;br /&gt;
For more image formatting guidelines, visit the [http://www.mediawiki.org/wiki/Help:Images MediaWiki Images Guide].&lt;br /&gt;
&lt;br /&gt;
'''Inline Images'''&lt;br /&gt;
&lt;br /&gt;
Images that are used, for instance, as part of a step-by-step tutorial can be placed inline, with larger size to make them more readable. The exact size is up to you, but the width should not exceed 720px.&amp;lt;ref&amp;gt;Thumbnails 720px wide still fit comfortably within a browser window on half a 1920px desktop monitor.&amp;lt;/ref&amp;gt;&lt;br /&gt;
[[File:placeholder.png|thumb|none|480px|Caption]]&lt;br /&gt;
&lt;br /&gt;
You can prevent text that is placed after the image from flowing next to the image by placing an HTML break behind it.&lt;br /&gt;
&lt;br /&gt;
==Tables==&lt;br /&gt;
&lt;br /&gt;
For tables, use the Wikitable markup. It is more readable and easy on the eye than the default one. There are multiple ways to create rows and columns, some used in the example below, but for more information, consult the [http://www.mediawiki.org/wiki/Help:Tables MediaWiki Table Formatting Guide]. &lt;br /&gt;
&lt;br /&gt;
By default, table columns will scale to fit the contents of the cell, but this usually results in a messy-looking table. Set fixed column-widths to keep the table nice and tight.&lt;br /&gt;
&lt;br /&gt;
For binary entries (e.g. Yes/No), a background color can be used to make it easier to recognize. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! width=&amp;quot;150px&amp;quot; | &lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 1&lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 2&lt;br /&gt;
! width=&amp;quot;200px&amp;quot; | Item 3&lt;br /&gt;
|-&lt;br /&gt;
| Regular Info || Info 1 || Info 2 || Info 3&lt;br /&gt;
|-&lt;br /&gt;
! Comparison&lt;br /&gt;
! colspan=&amp;quot;3&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Template || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Yes}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{No}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Some}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Result || {{Yes}} || {{No}} || {{Some}}&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Custom name || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Yes|Yeah!}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;  || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{No|Nuh-uh}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt;  || &amp;lt;center&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{Some|Maybe?}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/center&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Result || {{Yes|Yeah!}} || {{No|Nuh-uh}} || {{Some|Maybe?}}&lt;br /&gt;
|-&lt;br /&gt;
! colspan=&amp;quot;4&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Manual colors&lt;br /&gt;
| style=&amp;quot;background-color:#9F9;&amp;quot; | #9F9&lt;br /&gt;
| style=&amp;quot;background-color:#F99;&amp;quot; | #F99&lt;br /&gt;
| style=&amp;quot;background-color:#FFD;&amp;quot; | #FFD&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Code==&lt;br /&gt;
&lt;br /&gt;
If you want to add code, the syntax might interfere with the Mediawiki syntax. To prevent this from happening, place your code in one of the following preferred ways:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Fixed format text for short, single-line code.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot;&amp;gt;&lt;br /&gt;
Long code, spans entire width of the page.&lt;br /&gt;
Supports syntax highlighting of certain languages, like Python and HTML.&lt;br /&gt;
Change the lang=&amp;quot;&amp;quot; attribute to the correct language, e.g. lang=&amp;quot;python&amp;quot; or lang=&amp;quot;html5&amp;quot;&lt;br /&gt;
Use lang=&amp;quot;text&amp;quot; for non-supported languages.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;text&amp;quot; line style=&amp;quot;height:15em; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
You can also add line numbering.&lt;br /&gt;
&lt;br /&gt;
If your code is longer than, say, 50 lines, you can add a style attribute to introduce a scrollbar, as sampled here. For a 50-line cutoff, use style=&amp;quot;height:50em; overflow:auto;&amp;quot;.&lt;br /&gt;
Note that this method will cause the print version of the page to cut off the code at the line limit mark and not print the rest of the code.&lt;br /&gt;
I might fix that, but if it's really crucial to have an entire page full of code, you should probably give it a separate page.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Start Pirate Ipsum--&amp;gt;&lt;br /&gt;
Prow scuttle parrel provost Sail ho shrouds spirits boom mizzenmast yardarm. Pinnace holystone mizzenmast quarter crow's nest nipperkin grog yardarm hempen halter furl. Swab barque interloper chantey doubloon starboard grog black jack gangway rutters.&lt;br /&gt;
Deadlights jack lad schooner scallywag dance the hempen jig carouser broadside cable strike colors. Bring a spring upon her cable holystone blow the man down spanker Shiver me timbers to go on account lookout wherry doubloon chase. Belay yo-ho-ho keelhaul squiffy black spot yardarm spyglass sheet transom heave to.&lt;br /&gt;
Sail ho Corsair red ensign hulk smartly boom jib rum gangway. Case shot Shiver me timbers gangplank crack Jennys tea cup ballast Blimey lee snow crow's nest rutters. Fluke jib scourge of the seven seas boatswain schooner gaff booty Jack Tar transom spirits.&lt;br /&gt;
&amp;lt;!-- End Pirate Ipsum--&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For command-line code, you can also style it like this for clarity:&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;ping 127.0.0.1 -n 50 -l 1024&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You could also use the &amp;lt;nowiki&amp;gt;&amp;lt;tt&amp;gt; &amp;lt;pre&amp;gt; and nowiki &amp;lt;/nowiki&amp;gt; tags if better suited for your needs, whatever works best to present the code as clear and readable as possible.&lt;br /&gt;
&lt;br /&gt;
==Emoji==&lt;br /&gt;
It is encouraged to use [https://unicode.org/emoji/charts/full-emoji-list.html unicode emojis] (which you can just copy-paste as text) in places where they can draw extra attention, help illustrate your point, or break up the monotony of a long text. &lt;br /&gt;
&lt;br /&gt;
Be aware that emojis may be rendered differently in different browsers or operating systems, so try to pick ones that are common and unambiguous, and also recognizable at the scale they get reduced to when placed in-line on our Wiki. Also, Windows doesn't natively support flag emojis like 🇳🇱, for some reason.&lt;br /&gt;
&lt;br /&gt;
Lastly, don't overdo the emojis, as that could make it seem like our wiki was written by AI. &lt;br /&gt;
&lt;br /&gt;
====Examples====&lt;br /&gt;
ℹ️ This is a piece of (extra) information. &lt;br /&gt;
&lt;br /&gt;
⚠️ This is a warning!&lt;br /&gt;
&lt;br /&gt;
❌ This is a no-go!&lt;br /&gt;
&lt;br /&gt;
✅ This is good.&lt;br /&gt;
&lt;br /&gt;
✨ This is something new!&lt;br /&gt;
&lt;br /&gt;
🚧 This is under construction.&lt;br /&gt;
&lt;br /&gt;
🐽 Oink.&lt;br /&gt;
&lt;br /&gt;
These are just examples; feel free to come up with your own conventions so we can later compare and discuss what works best.&lt;br /&gt;
&lt;br /&gt;
==Shields and Badges==&lt;br /&gt;
Github-style shields or badges are useful for providing software details like programming language and licensing at a glance. There's a case to be made for our Wiki and Gitlab READMEs to use similar layouts and features for more uniformity in our documentation, and so badges could help with that too. Unfortunately, it is currently a bit of a faff to implement badges on our wiki, as hotlinking or injecting dynamic content from external sources is disabled for security reasons.&lt;br /&gt;
&lt;br /&gt;
The workaround:&lt;br /&gt;
# Generate a badge at https://shields.io&lt;br /&gt;
# Create a new CSS rule in [[MediaWiki:Common.css]] (see examples at bottom)&lt;br /&gt;
# On the page you want to edit, add a custom span with class=&amp;quot;shield&amp;quot; and the id as named in the CSS, e.g.: &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
# Add to the list of shields below.&lt;br /&gt;
&lt;br /&gt;
===Available Shields===&lt;br /&gt;
:&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt; &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;span class=&amp;quot;shield&amp;quot; id=&amp;quot;shield-python310&amp;quot;)&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Banners==&lt;br /&gt;
If a page is, or needs to be, significantly changed, you can put a banner on top to warn/inform visitors.&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Notice|Did you know you could add banners?}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Notice|Did you know you could add banners?}}&lt;br /&gt;
&amp;lt;pre&amp;gt;{{Outdated}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
{{Outdated}}&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=DataHub&amp;diff=6473</id>
		<title>DataHub</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=DataHub&amp;diff=6473"/>
		<updated>2026-04-16T12:40:03Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Lab Streaming Layer&lt;br /&gt;
| developer              = Christian Kothe; Chadwick Boulay.&lt;br /&gt;
| status                 = -in development-&lt;br /&gt;
| programming language   = C, C++, Python, Java, C#, MATLAB&lt;br /&gt;
| operating system       = Windows, Linux, MacOS, Android, iOS&lt;br /&gt;
| genre                  = Data collection&lt;br /&gt;
| license                = Open source&lt;br /&gt;
| website                = [https://labstreaminglayer.readthedocs.io/info/intro.html LSL webpage]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
{{Infobox tsg&lt;br /&gt;
  | downloads          = {{bulleted list&lt;br /&gt;
      | [https://surfdrive.surf.nl/files/index.php/s/zSpGD53mDQGuPKW Viewer &amp;amp; Streamer]&lt;br /&gt;
    }}&lt;br /&gt;
  | manuals            = {{bulleted list&lt;br /&gt;
      | [https://labstreaminglayer.readthedocs.io/ Documentation]&lt;br /&gt;
      | [https://sccn.ucsd.edu/~mgrivich/LSL_Validation.html LSL Validation]&lt;br /&gt;
      | [https://labstreaminglayer.readthedocs.io/info/supported_devices.html Supported Devices and Tools]&lt;br /&gt;
  }}&lt;br /&gt;
  | templates             = {{bulleted list&lt;br /&gt;
      | [https://surfdrive.surf.nl/files/index.php/s/qggfMMKsnUIDO0k Example Scripts (zip)]&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The DataHub Makes use of the lab streaming layer. The lab streaming layer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access as well as optionally the centralized collection, viewing and disk recording of the data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Table of Contents will be generated here --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Our support for LSL is mainly done in python. Download python here: [https://www.python.org/downloads/release/python-376/ Please choose a 64 bit version.]. Run the installer and make sure to add Python to the file path (it's an option in the installer).&lt;br /&gt;
Open a command prompt, start with upgrading the pip installer by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;python -m pip install --upgrade pip&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Then:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;pip install pylsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
more info: [https://github.com/labstreaminglayer/liblsl-Python cross platform pylsl]&lt;br /&gt;
&lt;br /&gt;
===Versions===&lt;br /&gt;
Pylsl version 1.16.2 is installed on our [[Lab Computer]]s. Open a command and type the following to find the version used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;python&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt; import pylsl&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt; print(pylsl.__version__)&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
=== Python ===&lt;br /&gt;
Example demonstrating how to send LSL stream and marker data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3.10&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
&lt;br /&gt;
import time&lt;br /&gt;
import random&lt;br /&gt;
import keyboard&lt;br /&gt;
from pylsl import StreamInfo, StreamOutlet&lt;br /&gt;
&lt;br /&gt;
from pylsl import local_clock&lt;br /&gt;
&lt;br /&gt;
# --- Setup Marker Stream ---&lt;br /&gt;
print(&amp;quot;Setting up marker stream...&amp;quot;)&lt;br /&gt;
marker_info = StreamInfo(&lt;br /&gt;
    name=&amp;quot;MarkerStream&amp;quot;,&lt;br /&gt;
    type=&amp;quot;Markers&amp;quot;,&lt;br /&gt;
    channel_count=1,&lt;br /&gt;
    nominal_srate=0,  # Irregular sampling&lt;br /&gt;
    channel_format=&amp;quot;string&amp;quot;,&lt;br /&gt;
    source_id=&amp;quot;MarkerSource&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
marker_outlet = StreamOutlet(marker_info, chunk_size=1)&lt;br /&gt;
&lt;br /&gt;
# --- Setup Data Stream ---&lt;br /&gt;
print(&amp;quot;Setting up data stream...&amp;quot;)&lt;br /&gt;
data_info = StreamInfo(&lt;br /&gt;
    name=&amp;quot;TestStream&amp;quot;,&lt;br /&gt;
    type=&amp;quot;TestData&amp;quot;,&lt;br /&gt;
    channel_count=4,&lt;br /&gt;
    nominal_srate=100,&lt;br /&gt;
    channel_format=&amp;quot;float32&amp;quot;,&lt;br /&gt;
    source_id=&amp;quot;TestStream_Source&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
channels = data_info.desc().append_child(&amp;quot;channels&amp;quot;)&lt;br /&gt;
for name in [&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;]:&lt;br /&gt;
    chan = channels.append_child(&amp;quot;channel&amp;quot;)&lt;br /&gt;
    chan.append_child_value(&amp;quot;name&amp;quot;, name)&lt;br /&gt;
    chan.append_child_value(&amp;quot;unit&amp;quot;, &amp;quot;unitless&amp;quot;)&lt;br /&gt;
    chan.append_child_value(&amp;quot;type&amp;quot;, &amp;quot;TestData&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data_outlet = StreamOutlet(data_info, chunk_size=1)&lt;br /&gt;
&lt;br /&gt;
# --- Start Streaming ---&lt;br /&gt;
print(&amp;quot;Start streaming... Press 'q' to stop.&amp;quot;)&lt;br /&gt;
marker_outlet.push_sample([&amp;quot;Start&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
while not keyboard.is_pressed('q'):&lt;br /&gt;
    random_numbers = [random.randint(1, 2) for _ in range(4)]&lt;br /&gt;
    data_outlet.push_sample(random_numbers)&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
marker_outlet.push_sample([&amp;quot;Stop&amp;quot;])&lt;br /&gt;
print(&amp;quot;Streaming stopped.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Matlab ===&lt;br /&gt;
Please, read the instructions on the GitHub labstreaminglayer website (https://github.com/labstreaminglayer/liblsl-Matlab) on how to prepare Matlab to work with LSL. You can either use the latest release for your Matlab version, or if that doesn't workout well, build it from the source files. Make sure to add the liblsl-Matlab folder to your path recursively to make it available to your own scripts.&lt;br /&gt;
&lt;br /&gt;
A short example for sending lsl streaming data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot; line&amp;gt;&lt;br /&gt;
%% instantiate the library&lt;br /&gt;
disp('Loading library...');&lt;br /&gt;
lib = lsl_loadlib();&lt;br /&gt;
&lt;br /&gt;
% make a new stream outlet&lt;br /&gt;
disp('Creating a new streaminfo...');&lt;br /&gt;
info = lsl_streaminfo(lib,'BioSemi','EEG',8,100,'cf_float32','sdfwerr32432');&lt;br /&gt;
&lt;br /&gt;
disp('Opening an outlet...');&lt;br /&gt;
outlet = lsl_outlet(info);&lt;br /&gt;
&lt;br /&gt;
% send data into the outlet, sample by sample&lt;br /&gt;
disp('Now transmitting data...');&lt;br /&gt;
while true&lt;br /&gt;
    outlet.push_sample(randn(8,1));&lt;br /&gt;
    pause(0.01);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A short example for receiving lsl streaming data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot; line&amp;gt;&lt;br /&gt;
%% instantiate the library&lt;br /&gt;
disp('Loading the library...');&lt;br /&gt;
lib = lsl_loadlib();&lt;br /&gt;
&lt;br /&gt;
% resolve a stream...&lt;br /&gt;
disp('Resolving an EEG stream...');&lt;br /&gt;
result = {};&lt;br /&gt;
while isempty(result)&lt;br /&gt;
    result = lsl_resolve_byprop(lib,'type','EEG'); end&lt;br /&gt;
&lt;br /&gt;
% create a new inlet&lt;br /&gt;
disp('Opening an inlet...');&lt;br /&gt;
inlet = lsl_inlet(result{1});&lt;br /&gt;
&lt;br /&gt;
disp('Now receiving data...');&lt;br /&gt;
while true&lt;br /&gt;
    % get data from the inlet&lt;br /&gt;
    [vec,ts] = inlet.pull_sample();&lt;br /&gt;
    % and display it&lt;br /&gt;
    fprintf('%.2f\t',vec);&lt;br /&gt;
    fprintf('%.5f\n',ts);&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=DataHub&amp;diff=6472</id>
		<title>DataHub</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=DataHub&amp;diff=6472"/>
		<updated>2026-04-16T12:39:08Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* Versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = DataHub&lt;br /&gt;
| developer              = Christian Kothe; Chadwick Boulay.&lt;br /&gt;
| status                 = -in development-&lt;br /&gt;
| programming language   = C, C++, Python, Java, C#, MATLAB&lt;br /&gt;
| operating system       = Windows, Linux, MacOS, Android, iOS&lt;br /&gt;
| genre                  = Data collection&lt;br /&gt;
| license                = Open source&lt;br /&gt;
| website                = [https://labstreaminglayer.readthedocs.io/info/intro.html LSL webpage]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== Resources ===&lt;br /&gt;
{{Infobox tsg&lt;br /&gt;
  | downloads          = {{bulleted list&lt;br /&gt;
      | [https://surfdrive.surf.nl/files/index.php/s/zSpGD53mDQGuPKW viewer &amp;amp; streamer]&lt;br /&gt;
    }}&lt;br /&gt;
  | manuals            = {{bulleted list&lt;br /&gt;
      | [https://labstreaminglayer.readthedocs.io/ Documentation]&lt;br /&gt;
      | [https://sccn.ucsd.edu/~mgrivich/LSL_Validation.html LSL Validation]&lt;br /&gt;
      | [https://labstreaminglayer.readthedocs.io/info/supported_devices.html Supported Devices and Tools]&lt;br /&gt;
  }}&lt;br /&gt;
  | templates             = {{bulleted list&lt;br /&gt;
      | [https://surfdrive.surf.nl/files/index.php/s/qggfMMKsnUIDO0k example scripts (zip)]&lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The DataHub Makes use of the lab streaming layer. The lab streaming layer (LSL) is a system for the unified collection of measurement time series in research experiments that handles both the networking, time-synchronization, (near-) real-time access as well as optionally the centralized collection, viewing and disk recording of the data.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Table of Contents will be generated here --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
Our support for LSL is mainly done in python. Download python here: [https://www.python.org/downloads/release/python-376/ Please choose a 64 bit version.]. Run the installer and make sure to add Python to the file path (it's an option in the installer).&lt;br /&gt;
Open a command prompt, start with upgrading the pip installer by typing:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;python -m pip install --upgrade pip&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
Then:&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;pip install pylsl&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
more info: [https://github.com/labstreaminglayer/liblsl-Python cross platform pylsl]&lt;br /&gt;
&lt;br /&gt;
===Versions===&lt;br /&gt;
Pylsl version 1.16.2 is installed on our [[Lab Computer]]s. Open a command and type the following to find the version used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;c:&amp;gt;python&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt; import pylsl&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;&amp;gt;&amp;gt;&amp;gt; print(pylsl.__version__)&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Usage==&lt;br /&gt;
=== Python ===&lt;br /&gt;
Example demonstrating how to send LSL stream and marker data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; line&amp;gt;&lt;br /&gt;
#!/usr/bin/env python3.10&lt;br /&gt;
# -*- coding: utf-8 -*-&lt;br /&gt;
&lt;br /&gt;
import time&lt;br /&gt;
import random&lt;br /&gt;
import keyboard&lt;br /&gt;
from pylsl import StreamInfo, StreamOutlet&lt;br /&gt;
&lt;br /&gt;
from pylsl import local_clock&lt;br /&gt;
&lt;br /&gt;
# --- Setup Marker Stream ---&lt;br /&gt;
print(&amp;quot;Setting up marker stream...&amp;quot;)&lt;br /&gt;
marker_info = StreamInfo(&lt;br /&gt;
    name=&amp;quot;MarkerStream&amp;quot;,&lt;br /&gt;
    type=&amp;quot;Markers&amp;quot;,&lt;br /&gt;
    channel_count=1,&lt;br /&gt;
    nominal_srate=0,  # Irregular sampling&lt;br /&gt;
    channel_format=&amp;quot;string&amp;quot;,&lt;br /&gt;
    source_id=&amp;quot;MarkerSource&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
marker_outlet = StreamOutlet(marker_info, chunk_size=1)&lt;br /&gt;
&lt;br /&gt;
# --- Setup Data Stream ---&lt;br /&gt;
print(&amp;quot;Setting up data stream...&amp;quot;)&lt;br /&gt;
data_info = StreamInfo(&lt;br /&gt;
    name=&amp;quot;TestStream&amp;quot;,&lt;br /&gt;
    type=&amp;quot;TestData&amp;quot;,&lt;br /&gt;
    channel_count=4,&lt;br /&gt;
    nominal_srate=100,&lt;br /&gt;
    channel_format=&amp;quot;float32&amp;quot;,&lt;br /&gt;
    source_id=&amp;quot;TestStream_Source&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
channels = data_info.desc().append_child(&amp;quot;channels&amp;quot;)&lt;br /&gt;
for name in [&amp;quot;A&amp;quot;, &amp;quot;B&amp;quot;, &amp;quot;C&amp;quot;, &amp;quot;D&amp;quot;]:&lt;br /&gt;
    chan = channels.append_child(&amp;quot;channel&amp;quot;)&lt;br /&gt;
    chan.append_child_value(&amp;quot;name&amp;quot;, name)&lt;br /&gt;
    chan.append_child_value(&amp;quot;unit&amp;quot;, &amp;quot;unitless&amp;quot;)&lt;br /&gt;
    chan.append_child_value(&amp;quot;type&amp;quot;, &amp;quot;TestData&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
data_outlet = StreamOutlet(data_info, chunk_size=1)&lt;br /&gt;
&lt;br /&gt;
# --- Start Streaming ---&lt;br /&gt;
print(&amp;quot;Start streaming... Press 'q' to stop.&amp;quot;)&lt;br /&gt;
marker_outlet.push_sample([&amp;quot;Start&amp;quot;])&lt;br /&gt;
&lt;br /&gt;
while not keyboard.is_pressed('q'):&lt;br /&gt;
    random_numbers = [random.randint(1, 2) for _ in range(4)]&lt;br /&gt;
    data_outlet.push_sample(random_numbers)&lt;br /&gt;
    time.sleep(0.01)&lt;br /&gt;
&lt;br /&gt;
marker_outlet.push_sample([&amp;quot;Stop&amp;quot;])&lt;br /&gt;
print(&amp;quot;Streaming stopped.&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Matlab ===&lt;br /&gt;
Please, read the instructions on the GitHub labstreaminglayer website (https://github.com/labstreaminglayer/liblsl-Matlab) on how to prepare Matlab to work with LSL. You can either use the latest release for your Matlab version, or if that doesn't workout well, build it from the source files. Make sure to add the liblsl-Matlab folder to your path recursively to make it available to your own scripts.&lt;br /&gt;
&lt;br /&gt;
A short example for sending lsl streaming data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot; line&amp;gt;&lt;br /&gt;
%% instantiate the library&lt;br /&gt;
disp('Loading library...');&lt;br /&gt;
lib = lsl_loadlib();&lt;br /&gt;
&lt;br /&gt;
% make a new stream outlet&lt;br /&gt;
disp('Creating a new streaminfo...');&lt;br /&gt;
info = lsl_streaminfo(lib,'BioSemi','EEG',8,100,'cf_float32','sdfwerr32432');&lt;br /&gt;
&lt;br /&gt;
disp('Opening an outlet...');&lt;br /&gt;
outlet = lsl_outlet(info);&lt;br /&gt;
&lt;br /&gt;
% send data into the outlet, sample by sample&lt;br /&gt;
disp('Now transmitting data...');&lt;br /&gt;
while true&lt;br /&gt;
    outlet.push_sample(randn(8,1));&lt;br /&gt;
    pause(0.01);&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A short example for receiving lsl streaming data:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot; line&amp;gt;&lt;br /&gt;
%% instantiate the library&lt;br /&gt;
disp('Loading the library...');&lt;br /&gt;
lib = lsl_loadlib();&lt;br /&gt;
&lt;br /&gt;
% resolve a stream...&lt;br /&gt;
disp('Resolving an EEG stream...');&lt;br /&gt;
result = {};&lt;br /&gt;
while isempty(result)&lt;br /&gt;
    result = lsl_resolve_byprop(lib,'type','EEG'); end&lt;br /&gt;
&lt;br /&gt;
% create a new inlet&lt;br /&gt;
disp('Opening an inlet...');&lt;br /&gt;
inlet = lsl_inlet(result{1});&lt;br /&gt;
&lt;br /&gt;
disp('Now receiving data...');&lt;br /&gt;
while true&lt;br /&gt;
    % get data from the inlet&lt;br /&gt;
    [vec,ts] = inlet.pull_sample();&lt;br /&gt;
    % and display it&lt;br /&gt;
    fprintf('%.2f\t',vec);&lt;br /&gt;
    fprintf('%.5f\n',ts);&lt;br /&gt;
end&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Python&amp;diff=6471</id>
		<title>Python</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Python&amp;diff=6471"/>
		<updated>2026-04-16T12:38:02Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Python&lt;br /&gt;
| logo                   = Python-logo-generic.svg&lt;br /&gt;
| logo size              = 180px&lt;br /&gt;
| logo alt               = Python(tm)&lt;br /&gt;
| caption                = &lt;br /&gt;
| developer              = &lt;br /&gt;
| released               = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = &lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| latest preview version = &lt;br /&gt;
| latest preview date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| installed version      = 3.10.11 64-bits&lt;br /&gt;
| installed version date = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = Python&lt;br /&gt;
| operating system       = &lt;br /&gt;
| platform               = &lt;br /&gt;
| website                = [http://www.python.org python.org]&lt;br /&gt;
| resources              = {{Infobox tsg&lt;br /&gt;
  | child = yes&lt;br /&gt;
  | header1 = Workshop&lt;br /&gt;
  | data1 = {{bulleted list&lt;br /&gt;
      | [[Workshop: Python for behavioural scientists|Python for behavioural scientists]]&lt;br /&gt;
  }}&lt;br /&gt;
 }}  &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[[wikipedia:Python_(programming_language)|Python]] is a general-purpose, high-level programming language. It is also a [[wikipedia:Python_%28genus%29|type of snake]] and a [[wikipedia:Python_%28Efteling%29|rollercoaster]], but the language is probably more relevant to your research. &amp;lt;br/&amp;gt;&lt;br /&gt;
On the lab computers, there is support for Spyder, PyCharm and [[Psychopy]]. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Table of Contents will be generated here --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Psychopy==&lt;br /&gt;
{{see also|Psychopy}}&lt;br /&gt;
&lt;br /&gt;
When your script fails to load in Psychopy, because you need packages that are not installed on our lab computers, please contact TSG.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
===Example: TestArgs.py===&lt;br /&gt;
Execute the following script within the commandline (CMD): &amp;lt;code style=&amp;quot;background-color:#000; color:#fff; padding:1px 3px;&amp;quot;&amp;gt;python testArgs.py a.&amp;lt;/code&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
You should see the following result:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
number of argument:  2&lt;br /&gt;
 argv[0]: ./testArgs.py&lt;br /&gt;
 argv[1]: a&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[Psychopy]]&lt;br /&gt;
*[[Workshop: Python for social scientists]]&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
 ==References==&lt;br /&gt;
&amp;lt;references /&amp;gt; --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==External Links== &lt;br /&gt;
*{{Official website|http://www.python.org}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Matlab&amp;diff=6470</id>
		<title>Matlab</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Matlab&amp;diff=6470"/>
		<updated>2026-04-16T11:56:36Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* Matlab Libraries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox software&lt;br /&gt;
| name                   = Mathworks Matlab&lt;br /&gt;
| logo                   = Matlab_Logo.png&lt;br /&gt;
| screenshot             = &lt;br /&gt;
| caption                = &lt;br /&gt;
| developer              = &lt;br /&gt;
| released               = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| discontinued           = &lt;br /&gt;
| latest release version = &lt;br /&gt;
| latest release date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| latest preview version = &lt;br /&gt;
| latest preview date    = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| installed version      = &lt;br /&gt;
| installed version date = &amp;lt;!-- {{Start date and age|YYYY|MM|DD|df=yes}} --&amp;gt;&lt;br /&gt;
| status                 = Active&lt;br /&gt;
| programming language   = C, C++, Java, MATLAB&lt;br /&gt;
| operating system       = Microsoft Windows, Linux, MacOSX&lt;br /&gt;
| platform               = &lt;br /&gt;
| size                   = &lt;br /&gt;
| language               = &lt;br /&gt;
| genre                  = &lt;br /&gt;
| license                = Proprietary commercial software&lt;br /&gt;
| website                = [http://nl.mathworks.com/products/matlab/ www.mathworks.com/matlab]&lt;br /&gt;
&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
MATLAB (matrix laboratory) is a multi-paradigm numerical computing environment and fourth-generation programming language. A proprietary programming language developed by MathWorks, MATLAB allows matrix manipulations, plotting of functions and data, implementation of algorithms, creation of user interfaces, and interfacing with programs written in other languages, including C, C++, Java, Fortran and Python.&lt;br /&gt;
&lt;br /&gt;
== Installed Toolboxes ==&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
 | MATLAB || Simulink || Bioinformatics Toolbox || Control System Toolbox&lt;br /&gt;
 |-&lt;br /&gt;
 | Curve Fitting Toolbox || DSP System Toolbox || Data Acquisition Toolbox || Database Toolbox&lt;br /&gt;
 |-&lt;br /&gt;
 | DatapixxToolbox || Filter Design HDL Coder || Fixed-Point Designer || Image Acquisition Toolbox&lt;br /&gt;
 |-&lt;br /&gt;
 | Image Processing Toolbox || MATLAB Builder EX || MATLAB Builder JA || MATLAB Compiler&lt;br /&gt;
 |-&lt;br /&gt;
 | Mapping Toolbox || Neural Network Toolbox || Optimization Toolbox || Parallel Computing Toolbox&lt;br /&gt;
 |-&lt;br /&gt;
 | Partial Differential Equation Toolbox || Psychtoolbox || Signal Processing Toolbox || Simulink 3D Animation&lt;br /&gt;
 |-&lt;br /&gt;
 | Simulink Control Design || Spreadsheet Link EX || Statistics Toolbox || Symbolic Math Toolbox&lt;br /&gt;
 |-&lt;br /&gt;
 | System Identification Toolbox || Wavelet Toolbox || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Matlab Libraries ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Matlab Library  &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Description &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Installed&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | Installer Type&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; | URL&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| Psychtoolbox || Psychophysics Toolbox is a free set of Matlab and GNU/Octave functions for vision research. || {{Yes}} || Python installer || https://www.psychtoolbox.org/PsychtoolboxDownload &lt;br /&gt;
|-&lt;br /&gt;
| Gstreamer || GStreamer is a library for constructing graphs of media-handling components.  || {{Yes}} || Windows Installer || http://gstreamer.freedesktop.org/download/&lt;br /&gt;
|-&lt;br /&gt;
| BrainStream || BrainStream is a Matlab toolbox for designing and executing Brain-Computer-Interface (BCI) experiments.  || {{No}} || toolbox || [[BrainStream]]&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Default Location Psychtoolbox ==&lt;br /&gt;
&lt;br /&gt;
'''Windows'''&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;matlab&amp;quot; overflow:auto;&amp;quot;&amp;gt;&lt;br /&gt;
C:\toolbox\psychtoolbox&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== License ==&lt;br /&gt;
&lt;br /&gt;
For license and installation information click [http://wiki.science.ru.nl/cncz/Matlab '''here''']&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner&amp;diff=6469</id>
		<title>Module:Protection banner</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Protection_banner&amp;diff=6469"/>
		<updated>2026-04-16T11:42:21Z</updated>

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

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

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

		<summary type="html">&lt;p&gt;E.vandenberge: Undo revision 6465 by E.vandenberge (talk)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData('Module:Documentation/config')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is 'string'.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value 'Foo $2 bar $1.',&lt;br /&gt;
	-- message('foo-message', {'baz', 'qux'}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or 'string'&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)&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 format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. ':' .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return format('[%s %s]', url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select('#', ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- 'documentation-toolbar'&lt;br /&gt;
	return format(&lt;br /&gt;
		'&amp;lt;span class=&amp;quot;%s&amp;quot;&amp;gt;(%s)&amp;lt;/span&amp;gt;',&lt;br /&gt;
		message('toolbar-class'),&lt;br /&gt;
		table.concat(ret, ' &amp;amp;#124; ')&lt;br /&gt;
	)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == 'string' then&lt;br /&gt;
					value = value:match('^%s*(.-)%s*$') -- Remove whitespace.&lt;br /&gt;
					if key == 'heading' or value ~= '' then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == 'testcases' then&lt;br /&gt;
		return frame:expandTemplate{title = 'module test cases notice'}&lt;br /&gt;
	else&lt;br /&gt;
		return p.main(frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc('_main')&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--]]&lt;br /&gt;
	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;
		:tag('div')&lt;br /&gt;
			-- 'documentation-container'&lt;br /&gt;
			:addClass(message('container'))&lt;br /&gt;
			:attr('role', 'complementary')&lt;br /&gt;
			:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)&lt;br /&gt;
			:attr('aria-label', args.heading == '' and 'Documentation' or nil)&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				-- 'documentation'&lt;br /&gt;
				:addClass(message('main-div-classes'))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag('div')&lt;br /&gt;
					-- 'documentation-clear'&lt;br /&gt;
					:addClass(message('clear'))&lt;br /&gt;
					:done()&lt;br /&gt;
				:newline()&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(p._endBox(args, env))&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	-- 'Module:Documentation/styles.css'&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		'templatestyles', '', {src=cfg['templatestyles']&lt;br /&gt;
	}) .. 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&lt;br /&gt;
	-- objects and other namespace- or 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;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title's subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don't call any of the functions&lt;br /&gt;
	-- more than once. (Nils won't be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') or (subpage == message('doc-subpage') and mw.title.getCurrentTitle().namespace == env.docSpace) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. '/' .. message('doc-subpage')&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.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&lt;br /&gt;
		-- same as the subject namespace. However, pages in the Article, File,&lt;br /&gt;
		-- MediaWiki or Category namespaces must have their /doc, /sandbox and&lt;br /&gt;
		-- /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. ':' .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.canonicalUrl(&lt;br /&gt;
				'Special:ComparePages',&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')&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 ~= 'Scribunto' then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don'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;
	-- 'sandbox-notice-image' --&amp;gt; '[[File:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
	-- 'sandbox-notice-blurb' --&amp;gt; 'This is the $1 for $2.'&lt;br /&gt;
	-- 'sandbox-notice-diff-blurb' --&amp;gt; 'This is the $1 for $2 ($3).'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-template' --&amp;gt; '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-module' --&amp;gt; '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-other' --&amp;gt; 'sandbox page'&lt;br /&gt;
	-- 'sandbox-notice-compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'sandbox-notice-testcases-blurb' --&amp;gt; 'See also the companion subpage for $1.'&lt;br /&gt;
	-- 'sandbox-notice-testcases-link-display' --&amp;gt; 'test cases'&lt;br /&gt;
	-- 'sandbox-category' --&amp;gt; 'Template sandboxes'&lt;br /&gt;
	-- 'module-sandbox-category' --&amp;gt; 'Module sandboxes'&lt;br /&gt;
	-- 'other-sandbox-category' --&amp;gt; 'Sandboxes outside of template or module namespace'&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&lt;br /&gt;
		and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message('sandbox-notice-image')&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = '__EXPECTUNUSEDTEMPLATE__'&lt;br /&gt;
	local pagetype, sandboxCat&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-template')&lt;br /&gt;
		sandboxCat = message('sandbox-category')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-module')&lt;br /&gt;
		sandboxCat = message('module-sandbox-category')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-other')&lt;br /&gt;
		sandboxCat = message('other-sandbox-category')&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if compareUrl then&lt;br /&gt;
		local compareDisplay = message('sandbox-notice-compare-link-display')&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-blurb', {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(sandboxCat)&lt;br /&gt;
&lt;br /&gt;
	-- 'documentation-clear'&lt;br /&gt;
	return '&amp;lt;div class=&amp;quot;' .. message('clear') .. '&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;'&lt;br /&gt;
		.. require('Module:Message box').main('ombox', omargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'protection-template' --&amp;gt; 'pp-template'&lt;br /&gt;
	-- 'protection-template-args' --&amp;gt; {docusage = 'yes'}&lt;br /&gt;
	local protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editProt = protectionLevels.edit and protectionLevels.edit[1]&lt;br /&gt;
	local moveProt = protectionLevels.move and protectionLevels.move[1]&lt;br /&gt;
	if editProt then&lt;br /&gt;
		-- The page is edit-protected.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			message('protection-reason-edit'), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= 'autoconfirmed' then&lt;br /&gt;
		-- The page is move-protected but not edit-protected. Exclude move&lt;br /&gt;
		-- protection with the level &amp;quot;autoconfirmed&amp;quot;, as this is equivalent to&lt;br /&gt;
		-- no move protection at all.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			action = 'move', small = true&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc('_startBox')&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content or args[1] then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'view-link-display' --&amp;gt; 'view'&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'purge-link-display' --&amp;gt; 'purge'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'docpage-preload' --&amp;gt; 'Template:Documentation/preload'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create link if /doc doesn't exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message('module-preload')&lt;br /&gt;
		else&lt;br /&gt;
			preload = message('docpage-preload')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return {&lt;br /&gt;
		title = title,&lt;br /&gt;
		docTitle = docTitle,&lt;br /&gt;
		-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
		viewLinkDisplay = message('view-link-display'),&lt;br /&gt;
		editLinkDisplay = message('edit-link-display'),&lt;br /&gt;
		historyLinkDisplay = message('history-link-display'),&lt;br /&gt;
		purgeLinkDisplay = message('purge-link-display'),&lt;br /&gt;
		preload = preload,&lt;br /&gt;
		createLinkDisplay = message('create-link-display')&lt;br /&gt;
	}&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][purge] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	-- yes, we do intend to purge the template page on which the documentation appears&lt;br /&gt;
	local purgeLink = makeWikilink(&amp;quot;Special:Purge/&amp;quot; .. data.title.prefixedText, data.purgeLinkDisplay)&lt;br /&gt;
	&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, data.historyLinkDisplay)&lt;br /&gt;
		return &amp;quot;&amp;amp;#91;&amp;quot; .. viewLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. editLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. historyLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		return  &amp;quot;&amp;amp;#91;&amp;quot; .. createLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'documentation-icon-wikitext' --&amp;gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
	-- 'template-namespace-heading' --&amp;gt; 'Template documentation'&lt;br /&gt;
	-- 'module-namespace-heading' --&amp;gt; 'Module documentation'&lt;br /&gt;
	-- 'file-namespace-heading' --&amp;gt; 'Summary'&lt;br /&gt;
	-- 'other-namespaces-heading' --&amp;gt; 'Documentation'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == '' then&lt;br /&gt;
		-- Don't display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message('file-namespace-heading')&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message('other-namespaces-heading')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args['heading-style']&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- 'documentation-heading'&lt;br /&gt;
		data.headingClass = message('main-div-heading-class')&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;
		-- 'mw-editsection-like plainlinks'&lt;br /&gt;
		data.linksClass = message('start-box-link-classes')&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create('div')&lt;br /&gt;
	sbox&lt;br /&gt;
		-- 'documentation-startbox'&lt;br /&gt;
		:addClass(message('start-box-class'))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag('span')&lt;br /&gt;
			:addClass(data.headingClass)&lt;br /&gt;
			:attr('id', 'documentation-heading')&lt;br /&gt;
			:cssText(data.headingStyleText)&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox:tag('span')&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr('id', data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc('_content')&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	return '\n' .. (content or '') .. '\n' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc('_contentTitle')&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc('_endBox')&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args['link box']&lt;br /&gt;
	if linkBox == 'off'&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = ''&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or '') -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template's sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or '') .. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don't show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or '')&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create('div')&lt;br /&gt;
	-- 'documentation-metadata'&lt;br /&gt;
	box:attr('role', 'note')&lt;br /&gt;
		:addClass(message('end-box-class'))&lt;br /&gt;
		-- 'plainlinks'&lt;br /&gt;
		:addClass(message('end-box-plainlinks'))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return '\n' .. tostring(box)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'transcluded-from-blurb' --&amp;gt; &lt;br /&gt;
	-- 'The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'create-module-doc-blurb' --&amp;gt;&lt;br /&gt;
	-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editDisplay = message('edit-link-display')&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, editDisplay)&lt;br /&gt;
		local historyDisplay = message('history-link-display')&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, historyDisplay)&lt;br /&gt;
		return message('transcluded-from-blurb', {docLink})&lt;br /&gt;
			.. ' '&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}&lt;br /&gt;
		local createDisplay = message('create-link-display')&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		return message('create-module-doc-blurb', {createLink})&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'sandbox-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'module-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'sandbox-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'mirror-edit-summary' --&amp;gt; 'Create sandbox version of $1'&lt;br /&gt;
	-- 'mirror-link-display' --&amp;gt; 'mirror'&lt;br /&gt;
	-- 'mirror-link-preload' --&amp;gt; 'Template:Documentation/mirror'&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display'--&amp;gt; 'edit'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'module-testcases-preload' --&amp;gt; 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
	-- 'template-testcases-preload' --&amp;gt; 'Template:Documentation/preload-testcases'&lt;br /&gt;
	-- 'experiment-blurb-module' --&amp;gt; 'Editors can experiment in this module's $1 and $2 pages.'&lt;br /&gt;
	-- 'experiment-blurb-template' --&amp;gt; 'Editors can experiment in this template's $1 and $2 pages.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message('sandbox-link-display')&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditDisplay = message('sandbox-edit-link-display')&lt;br /&gt;
		local sandboxEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. sandboxPage, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message('compare-link-display')&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message('module-sandbox-preload')&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message('template-sandbox-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message('sandbox-create-link-display')&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message('mirror-link-preload')&lt;br /&gt;
		local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message('mirror-link-display')&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message('testcases-link-display')&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}&lt;br /&gt;
		local testcasesEditDisplay = message('testcases-edit-link-display')&lt;br /&gt;
		local testcasesEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. testcasesPage, testcasesEditDisplay)&lt;br /&gt;
		-- for Modules, add testcases run link if exists&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot;  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then&lt;br /&gt;
			local testcasesRunLinkDisplay = message('testcases-run-link-display')&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message('module-testcases-preload')&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message('template-testcases-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message('testcases-create-link-display')&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = 'experiment-blurb-module'&lt;br /&gt;
	else&lt;br /&gt;
		messageName = 'experiment-blurb-template'&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'doc-link-display' --&amp;gt; '/doc'&lt;br /&gt;
	-- 'add-categories-blurb' --&amp;gt; 'Please add categories to the $1 subpage.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))&lt;br /&gt;
	return message('add-categories-blurb', {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'template-pagetype' --&amp;gt; 'template'&lt;br /&gt;
	-- 'module-pagetype' --&amp;gt; 'module'&lt;br /&gt;
	-- 'default-pagetype' --&amp;gt; 'page'&lt;br /&gt;
	-- 'subpages-link-display' --&amp;gt; 'Subpages of this $1'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('template-pagetype')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('module-pagetype')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('default-pagetype')&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',&lt;br /&gt;
		message('subpages-link-display', {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message('subpages-blurb', {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'display-strange-usage-category' --&amp;gt; true&lt;br /&gt;
	-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
	-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'strange-usage-category' --&amp;gt; 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	if message('display-strange-usage-category', nil, 'boolean')&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message('doc-subpage')&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message('testcases-subpage')&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return makeCategoryLink(message('strange-usage-category'))&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6465</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6465"/>
		<updated>2026-04-16T10:49:14Z</updated>

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

		<summary type="html">&lt;p&gt;E.vandenberge: Reverted edits by E.vandenberge (talk) to last revision by en&amp;gt;Paine Ellsworth&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData('Module:Documentation/config')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is 'string'.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value 'Foo $2 bar $1.',&lt;br /&gt;
	-- message('foo-message', {'baz', 'qux'}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or 'string'&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)&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 format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. ':' .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return format('[%s %s]', url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select('#', ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- 'documentation-toolbar'&lt;br /&gt;
	return format(&lt;br /&gt;
		'&amp;lt;span class=&amp;quot;%s&amp;quot;&amp;gt;(%s)&amp;lt;/span&amp;gt;',&lt;br /&gt;
		message('toolbar-class'),&lt;br /&gt;
		table.concat(ret, ' &amp;amp;#124; ')&lt;br /&gt;
	)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == 'string' then&lt;br /&gt;
					value = value:match('^%s*(.-)%s*$') -- Remove whitespace.&lt;br /&gt;
					if key == 'heading' or value ~= '' then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == 'testcases' then&lt;br /&gt;
		return frame:expandTemplate{title = 'module test cases notice'}&lt;br /&gt;
	else&lt;br /&gt;
		return p.main(frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc('_main')&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--]]&lt;br /&gt;
	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;
		:tag('div')&lt;br /&gt;
			-- 'documentation-container'&lt;br /&gt;
			:addClass(message('container'))&lt;br /&gt;
			:attr('role', 'complementary')&lt;br /&gt;
			:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)&lt;br /&gt;
			:attr('aria-label', args.heading == '' and 'Documentation' or nil)&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				-- 'documentation'&lt;br /&gt;
				:addClass(message('main-div-classes'))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag('div')&lt;br /&gt;
					-- 'documentation-clear'&lt;br /&gt;
					:addClass(message('clear'))&lt;br /&gt;
					:done()&lt;br /&gt;
				:newline()&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(p._endBox(args, env))&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	-- 'Module:Documentation/styles.css'&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		'templatestyles', '', {src=cfg['templatestyles']&lt;br /&gt;
	}) .. 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&lt;br /&gt;
	-- objects and other namespace- or 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;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title's subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don't call any of the functions&lt;br /&gt;
	-- more than once. (Nils won't be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') or (subpage == message('doc-subpage') and mw.title.getCurrentTitle().namespace == env.docSpace) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. '/' .. message('doc-subpage')&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.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&lt;br /&gt;
		-- same as the subject namespace. However, pages in the Article, File,&lt;br /&gt;
		-- MediaWiki or Category namespaces must have their /doc, /sandbox and&lt;br /&gt;
		-- /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. ':' .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.canonicalUrl(&lt;br /&gt;
				'Special:ComparePages',&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')&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 ~= 'Scribunto' then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don'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;
	-- 'sandbox-notice-image' --&amp;gt; '[[File:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
	-- 'sandbox-notice-blurb' --&amp;gt; 'This is the $1 for $2.'&lt;br /&gt;
	-- 'sandbox-notice-diff-blurb' --&amp;gt; 'This is the $1 for $2 ($3).'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-template' --&amp;gt; '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-module' --&amp;gt; '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-other' --&amp;gt; 'sandbox page'&lt;br /&gt;
	-- 'sandbox-notice-compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'sandbox-notice-testcases-blurb' --&amp;gt; 'See also the companion subpage for $1.'&lt;br /&gt;
	-- 'sandbox-notice-testcases-link-display' --&amp;gt; 'test cases'&lt;br /&gt;
	-- 'sandbox-category' --&amp;gt; 'Template sandboxes'&lt;br /&gt;
	-- 'module-sandbox-category' --&amp;gt; 'Module sandboxes'&lt;br /&gt;
	-- 'other-sandbox-category' --&amp;gt; 'Sandboxes outside of template or module namespace'&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&lt;br /&gt;
		and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message('sandbox-notice-image')&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = '__EXPECTUNUSEDTEMPLATE__'&lt;br /&gt;
	local pagetype, sandboxCat&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-template')&lt;br /&gt;
		sandboxCat = message('sandbox-category')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-module')&lt;br /&gt;
		sandboxCat = message('module-sandbox-category')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-other')&lt;br /&gt;
		sandboxCat = message('other-sandbox-category')&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if compareUrl then&lt;br /&gt;
		local compareDisplay = message('sandbox-notice-compare-link-display')&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-blurb', {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(sandboxCat)&lt;br /&gt;
&lt;br /&gt;
	-- 'documentation-clear'&lt;br /&gt;
	return '&amp;lt;div class=&amp;quot;' .. message('clear') .. '&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;'&lt;br /&gt;
		.. require('Module:Message box').main('ombox', omargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'protection-template' --&amp;gt; 'pp-template'&lt;br /&gt;
	-- 'protection-template-args' --&amp;gt; {docusage = 'yes'}&lt;br /&gt;
	local protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editProt = protectionLevels.edit and protectionLevels.edit[1]&lt;br /&gt;
	local moveProt = protectionLevels.move and protectionLevels.move[1]&lt;br /&gt;
	if editProt then&lt;br /&gt;
		-- The page is edit-protected.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			message('protection-reason-edit'), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= 'autoconfirmed' then&lt;br /&gt;
		-- The page is move-protected but not edit-protected. Exclude move&lt;br /&gt;
		-- protection with the level &amp;quot;autoconfirmed&amp;quot;, as this is equivalent to&lt;br /&gt;
		-- no move protection at all.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			action = 'move', small = true&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc('_startBox')&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content or args[1] then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'view-link-display' --&amp;gt; 'view'&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'purge-link-display' --&amp;gt; 'purge'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'docpage-preload' --&amp;gt; 'Template:Documentation/preload'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create link if /doc doesn't exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message('module-preload')&lt;br /&gt;
		else&lt;br /&gt;
			preload = message('docpage-preload')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return {&lt;br /&gt;
		title = title,&lt;br /&gt;
		docTitle = docTitle,&lt;br /&gt;
		-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
		viewLinkDisplay = message('view-link-display'),&lt;br /&gt;
		editLinkDisplay = message('edit-link-display'),&lt;br /&gt;
		historyLinkDisplay = message('history-link-display'),&lt;br /&gt;
		purgeLinkDisplay = message('purge-link-display'),&lt;br /&gt;
		preload = preload,&lt;br /&gt;
		createLinkDisplay = message('create-link-display')&lt;br /&gt;
	}&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][purge] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	-- yes, we do intend to purge the template page on which the documentation appears&lt;br /&gt;
	local purgeLink = makeWikilink(&amp;quot;Special:Purge/&amp;quot; .. data.title.prefixedText, data.purgeLinkDisplay)&lt;br /&gt;
	&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, data.historyLinkDisplay)&lt;br /&gt;
		return &amp;quot;&amp;amp;#91;&amp;quot; .. viewLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. editLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. historyLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		return  &amp;quot;&amp;amp;#91;&amp;quot; .. createLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'documentation-icon-wikitext' --&amp;gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
	-- 'template-namespace-heading' --&amp;gt; 'Template documentation'&lt;br /&gt;
	-- 'module-namespace-heading' --&amp;gt; 'Module documentation'&lt;br /&gt;
	-- 'file-namespace-heading' --&amp;gt; 'Summary'&lt;br /&gt;
	-- 'other-namespaces-heading' --&amp;gt; 'Documentation'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == '' then&lt;br /&gt;
		-- Don't display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message('file-namespace-heading')&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message('other-namespaces-heading')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args['heading-style']&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- 'documentation-heading'&lt;br /&gt;
		data.headingClass = message('main-div-heading-class')&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;
		-- 'mw-editsection-like plainlinks'&lt;br /&gt;
		data.linksClass = message('start-box-link-classes')&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create('div')&lt;br /&gt;
	sbox&lt;br /&gt;
		-- 'documentation-startbox'&lt;br /&gt;
		:addClass(message('start-box-class'))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag('span')&lt;br /&gt;
			:addClass(data.headingClass)&lt;br /&gt;
			:attr('id', 'documentation-heading')&lt;br /&gt;
			:cssText(data.headingStyleText)&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox:tag('span')&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr('id', data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc('_content')&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	return '\n' .. (content or '') .. '\n' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc('_contentTitle')&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc('_endBox')&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args['link box']&lt;br /&gt;
	if linkBox == 'off'&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = ''&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or '') -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template's sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or '') .. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don't show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or '')&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create('div')&lt;br /&gt;
	-- 'documentation-metadata'&lt;br /&gt;
	box:attr('role', 'note')&lt;br /&gt;
		:addClass(message('end-box-class'))&lt;br /&gt;
		-- 'plainlinks'&lt;br /&gt;
		:addClass(message('end-box-plainlinks'))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return '\n' .. tostring(box)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'transcluded-from-blurb' --&amp;gt; &lt;br /&gt;
	-- 'The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'create-module-doc-blurb' --&amp;gt;&lt;br /&gt;
	-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editDisplay = message('edit-link-display')&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, editDisplay)&lt;br /&gt;
		local historyDisplay = message('history-link-display')&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, historyDisplay)&lt;br /&gt;
		return message('transcluded-from-blurb', {docLink})&lt;br /&gt;
			.. ' '&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}&lt;br /&gt;
		local createDisplay = message('create-link-display')&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		return message('create-module-doc-blurb', {createLink})&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'sandbox-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'module-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'sandbox-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'mirror-edit-summary' --&amp;gt; 'Create sandbox version of $1'&lt;br /&gt;
	-- 'mirror-link-display' --&amp;gt; 'mirror'&lt;br /&gt;
	-- 'mirror-link-preload' --&amp;gt; 'Template:Documentation/mirror'&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display'--&amp;gt; 'edit'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'module-testcases-preload' --&amp;gt; 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
	-- 'template-testcases-preload' --&amp;gt; 'Template:Documentation/preload-testcases'&lt;br /&gt;
	-- 'experiment-blurb-module' --&amp;gt; 'Editors can experiment in this module's $1 and $2 pages.'&lt;br /&gt;
	-- 'experiment-blurb-template' --&amp;gt; 'Editors can experiment in this template's $1 and $2 pages.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message('sandbox-link-display')&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditDisplay = message('sandbox-edit-link-display')&lt;br /&gt;
		local sandboxEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. sandboxPage, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message('compare-link-display')&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message('module-sandbox-preload')&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message('template-sandbox-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message('sandbox-create-link-display')&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message('mirror-link-preload')&lt;br /&gt;
		local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message('mirror-link-display')&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message('testcases-link-display')&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}&lt;br /&gt;
		local testcasesEditDisplay = message('testcases-edit-link-display')&lt;br /&gt;
		local testcasesEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. testcasesPage, testcasesEditDisplay)&lt;br /&gt;
		-- for Modules, add testcases run link if exists&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot;  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then&lt;br /&gt;
			local testcasesRunLinkDisplay = message('testcases-run-link-display')&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message('module-testcases-preload')&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message('template-testcases-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message('testcases-create-link-display')&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = 'experiment-blurb-module'&lt;br /&gt;
	else&lt;br /&gt;
		messageName = 'experiment-blurb-template'&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'doc-link-display' --&amp;gt; '/doc'&lt;br /&gt;
	-- 'add-categories-blurb' --&amp;gt; 'Please add categories to the $1 subpage.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))&lt;br /&gt;
	return message('add-categories-blurb', {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'template-pagetype' --&amp;gt; 'template'&lt;br /&gt;
	-- 'module-pagetype' --&amp;gt; 'module'&lt;br /&gt;
	-- 'default-pagetype' --&amp;gt; 'page'&lt;br /&gt;
	-- 'subpages-link-display' --&amp;gt; 'Subpages of this $1'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('template-pagetype')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('module-pagetype')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('default-pagetype')&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',&lt;br /&gt;
		message('subpages-link-display', {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message('subpages-blurb', {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'display-strange-usage-category' --&amp;gt; true&lt;br /&gt;
	-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
	-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'strange-usage-category' --&amp;gt; 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	if message('display-strange-usage-category', nil, 'boolean')&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message('doc-subpage')&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message('testcases-subpage')&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return makeCategoryLink(message('strange-usage-category'))&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6463</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation&amp;diff=6463"/>
		<updated>2026-04-16T10:40:23Z</updated>

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

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice|The wiki has been updated with information on our '''new lab computer and peripherals'''!}}&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Welcome to the TSG Wiki. &lt;br /&gt;
&lt;br /&gt;
On this wiki you will find documentation for the Hardware, Software and Research Equipment used in the lab environments of the research facilities of the Radboud University's Faculty of Social Sciences, as well as other useful information. &amp;lt;br/&amp;gt;&lt;br /&gt;
To learn more about the Technical Support Group, visit [http://www.ru.nl/socialsciences/technicalsupportgroup/ our website] or the [[TSG info|about]] section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- WHEN ADDING/RENAMING LIST ENTRIES, KEEP THEM IN ALPHABETICAL ORDER PLEASE --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📄Hardware Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[Audio Interface]]s&lt;br /&gt;
  | [[Balance Board]]&lt;br /&gt;
  | [[Biopac]]&lt;br /&gt;
  | [[Brainvision]]&lt;br /&gt;
  | [[ButtonBox]]es&lt;br /&gt;
  | [[Camera]]s&lt;br /&gt;
  | [[Lab Computer|Computers]]&lt;br /&gt;
  | [[Eyetracker]]s&lt;br /&gt;
  | [[Head Mounted Display]]s&lt;br /&gt;
  | [[Headphones]]&lt;br /&gt;
  | [[Ipod]] (Video &amp;amp; Audio Recording)&lt;br /&gt;
  | [[JoyStick]]s&lt;br /&gt;
  | [[Kinect]]&lt;br /&gt;
  | [[Laptop]]s&lt;br /&gt;
  | [[Microphone]]s&lt;br /&gt;
  | [[Monitor]]s&lt;br /&gt;
  | [[Optotrak]]  &lt;br /&gt;
  | [[Plux biosignals]]  &lt;br /&gt;
  | [[Qualisys]]&lt;br /&gt;
  | [[Structure sensor]]&lt;br /&gt;
  | [[TemperatureHumidity]]&lt;br /&gt;
  | [[TMSi]] &lt;br /&gt;
  | [[Vertical Sync sensor]]  &lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📃Software Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[FFmpeg]] (Video Conversion)&lt;br /&gt;
  | [[LSL]]&lt;br /&gt;
  | [[Matlab]]&lt;br /&gt;
  | [[OBS Studio]] (Screen/Webcam Recording)&lt;br /&gt;
  | [[Presentation]]&lt;br /&gt;
  | [[Psychopy]]&lt;br /&gt;
  | [[Python]]&lt;br /&gt;
  | [[System Image]]&lt;br /&gt;
  | [[Unity]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Online Experiments&lt;br /&gt;
 {{Bulleted list  &lt;br /&gt;
  | [[Online Experiments|Overview of Online Systems]]&lt;br /&gt;
  | [[jsPsych]]&lt;br /&gt;
  | [[LimeSurvey]]&lt;br /&gt;
  | [[Qualtrics]]&lt;br /&gt;
  | [[Online Experiments/Toolbox|Toolbox for online experiments]]&lt;br /&gt;
  | [[Web development]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Data Acquisition&lt;br /&gt;
{{Bulleted list   &lt;br /&gt;
  | [[Data Files|Data Formatting]]&lt;br /&gt;
  | [[Radcloud]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Stimuli&lt;br /&gt;
 {{Bulleted list &lt;br /&gt;
  | [[Audio]]  &lt;br /&gt;
  | [[Video Codecs]]  &lt;br /&gt;
  | [[Video Playback]]  &lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Miscellaneous&lt;br /&gt;
 {{Bulleted list  &lt;br /&gt;
  &amp;lt;!--| [https://wiki.dcc.science.ru.nl DCC Cluster]--&amp;gt;&lt;br /&gt;
  | [[Gitlab Social Sciences]]&lt;br /&gt;
  | [[IP Distribution Lab Computer]]&lt;br /&gt;
  | [[Mattermost Social Sciences]]&lt;br /&gt;
  | [[Virtualization Server]]  &lt;br /&gt;
 }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📄Lab Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[BalanceBoard Lab]]&lt;br /&gt;
  &amp;lt;!--| [[BCI Lab]]--&amp;gt;&lt;br /&gt;
  | [[Cubicle]]s (Standard Labs)&lt;br /&gt;
  | [[EEG Lab]]&lt;br /&gt;
  | [[Eye Tracker Lab]]&lt;br /&gt;
  | [[RIVER Lab]] (Virtual Reality)&lt;br /&gt;
  | [[SensoriMotorLab]]&lt;br /&gt;
  | [[Social Interaction Lab]]&lt;br /&gt;
  | [[Sound Recording Lab]]&lt;br /&gt;
  &amp;lt;!-- | [[VoiceKey Lab]] --&amp;gt;&lt;br /&gt;
  | [[TMS Lab]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Lab Use Policy and Guidelines&lt;br /&gt;
 {{Bulleted list&lt;br /&gt;
  | [[Booking labs]]&lt;br /&gt;
  | [[Media:EEG_lab_user_guide.pdf|EEG lab user guide]]&lt;br /&gt;
  | [[Media:Cleaningprocedure_EEG.pdf|EEG cleaning protocol]]&lt;br /&gt;
  | [[Using labs]]&lt;br /&gt;
  | [[Informed consent]]&lt;br /&gt;
 }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box&amp;diff=6461</id>
		<title>Module:Message box</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box&amp;diff=6461"/>
		<updated>2026-04-16T10:24:12Z</updated>

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

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--{{Notice|The wiki has been updated with information on our '''new lab computer and peripherals'''!}}--&amp;gt;&lt;br /&gt;
&amp;lt;br/&amp;gt;&lt;br /&gt;
Welcome to the TSG Wiki. &lt;br /&gt;
&lt;br /&gt;
On this wiki you will find documentation for the Hardware, Software and Research Equipment used in the lab environments of the research facilities of the Radboud University's Faculty of Social Sciences, as well as other useful information. &amp;lt;br/&amp;gt;&lt;br /&gt;
To learn more about the Technical Support Group, visit [http://www.ru.nl/socialsciences/technicalsupportgroup/ our website] or the [[TSG info|about]] section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- WHEN ADDING/RENAMING LIST ENTRIES, KEEP THEM IN ALPHABETICAL ORDER PLEASE --&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;width:100%;&amp;quot;&amp;gt;&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📄Hardware Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[Audio Interface]]s&lt;br /&gt;
  | [[Balance Board]]&lt;br /&gt;
  | [[Biopac]]&lt;br /&gt;
  | [[Brainvision]]&lt;br /&gt;
  | [[ButtonBox]]es&lt;br /&gt;
  | [[Camera]]s&lt;br /&gt;
  | [[Lab Computer|Computers]]&lt;br /&gt;
  | [[Eyetracker]]s&lt;br /&gt;
  | [[Head Mounted Display]]s&lt;br /&gt;
  | [[Headphones]]&lt;br /&gt;
  | [[Ipod]] (Video &amp;amp; Audio Recording)&lt;br /&gt;
  | [[JoyStick]]s&lt;br /&gt;
  | [[Kinect]]&lt;br /&gt;
  | [[Laptop]]s&lt;br /&gt;
  | [[Microphone]]s&lt;br /&gt;
  | [[Monitor]]s&lt;br /&gt;
  | [[Optotrak]]  &lt;br /&gt;
  | [[Plux biosignals]]  &lt;br /&gt;
  | [[Qualisys]]&lt;br /&gt;
  | [[Structure sensor]]&lt;br /&gt;
  | [[TemperatureHumidity]]&lt;br /&gt;
  | [[TMSi]] &lt;br /&gt;
  | [[Vertical Sync sensor]]  &lt;br /&gt;
  }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📃Software Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[FFmpeg]] (Video Conversion)&lt;br /&gt;
  | [[LSL]]&lt;br /&gt;
  | [[Matlab]]&lt;br /&gt;
  | [[OBS Studio]] (Screen/Webcam Recording)&lt;br /&gt;
  | [[Presentation]]&lt;br /&gt;
  | [[Psychopy]]&lt;br /&gt;
  | [[Python]]&lt;br /&gt;
  | [[System Image]]&lt;br /&gt;
  | [[Unity]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Online Experiments&lt;br /&gt;
 {{Bulleted list  &lt;br /&gt;
  | [[Online Experiments|Overview of Online Systems]]&lt;br /&gt;
  | [[jsPsych]]&lt;br /&gt;
  | [[LimeSurvey]]&lt;br /&gt;
  | [[Qualtrics]]&lt;br /&gt;
  | [[Online Experiments/Toolbox|Toolbox for online experiments]]&lt;br /&gt;
  | [[Web development]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Data Acquisition&lt;br /&gt;
{{Bulleted list   &lt;br /&gt;
  | [[Data Files|Data Formatting]]&lt;br /&gt;
  | [[Radcloud]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Stimuli&lt;br /&gt;
 {{Bulleted list &lt;br /&gt;
  | [[Audio]]  &lt;br /&gt;
  | [[Video Codecs]]  &lt;br /&gt;
  | [[Video Playback]]  &lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Miscellaneous&lt;br /&gt;
 {{Bulleted list  &lt;br /&gt;
  &amp;lt;!--| [https://wiki.dcc.science.ru.nl DCC Cluster]--&amp;gt;&lt;br /&gt;
  | [[Gitlab Social Sciences]]&lt;br /&gt;
  | [[IP Distribution Lab Computer]]&lt;br /&gt;
  | [[Mattermost Social Sciences]]&lt;br /&gt;
  | [[Virtualization Server]]  &lt;br /&gt;
 }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
{{Main Page/Frame&lt;br /&gt;
 | color      = be311a&lt;br /&gt;
 | title      = 📄Lab Documentation&lt;br /&gt;
 | content    = {{Bulleted list&lt;br /&gt;
  | [[BalanceBoard Lab]]&lt;br /&gt;
  &amp;lt;!--| [[BCI Lab]]--&amp;gt;&lt;br /&gt;
  | [[Cubicle]]s (Standard Labs)&lt;br /&gt;
  | [[EEG Lab]]&lt;br /&gt;
  | [[Eye Tracker Lab]]&lt;br /&gt;
  | [[RIVER Lab]] (Virtual Reality)&lt;br /&gt;
  | [[SensoriMotorLab]]&lt;br /&gt;
  | [[Social Interaction Lab]]&lt;br /&gt;
  | [[Sound Recording Lab]]&lt;br /&gt;
  &amp;lt;!-- | [[VoiceKey Lab]] --&amp;gt;&lt;br /&gt;
  | [[TMS Lab]]&lt;br /&gt;
 }}&amp;lt;br/&amp;gt;&lt;br /&gt;
;Lab Use Policy and Guidelines&lt;br /&gt;
 {{Bulleted list&lt;br /&gt;
  | [[Booking labs]]&lt;br /&gt;
  | [[Media:EEG_lab_user_guide.pdf|EEG lab user guide]]&lt;br /&gt;
  | [[Media:Cleaningprocedure_EEG.pdf|EEG cleaning protocol]]&lt;br /&gt;
  | [[Using labs]]&lt;br /&gt;
  | [[Informed consent]]&lt;br /&gt;
 }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Help:LimeSurvey/Demo_time&amp;diff=6459</id>
		<title>Help:LimeSurvey/Demo time</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Help:LimeSurvey/Demo_time&amp;diff=6459"/>
		<updated>2026-04-16T10:15:36Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* Limesurvey Demo time, Disappearing questions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://survey.socsci.ru.nl/index.php/615263?lang=en Try this demo survey]&lt;br /&gt;
==  Limesurvey Demo time, Disappearing questions == &lt;br /&gt;
A similar trick as we used with the [[Help:LimeSurvey/Demo video|h.264 video]] is also possible to let text disappear after a while. Type some text, click the ''source'' button. Let's assume it looks like this:&lt;br /&gt;
&lt;br /&gt;
 Following text disappears after five seconds:&amp;amp;lt;br/&amp;gt;&lt;br /&gt;
 Roses are red, violets are blue, I am gone, and so...&lt;br /&gt;
&lt;br /&gt;
now change it into the following:&lt;br /&gt;
&lt;br /&gt;
 Following text disappears after five seconds:&amp;amp;lt;br/&amp;gt;&lt;br /&gt;
 &amp;amp;lt;div id=&amp;quot;question17&amp;quot;&amp;gt;&lt;br /&gt;
   Roses are red, violets are blue, I am gone, and so...&lt;br /&gt;
 &amp;amp;lt;/div&amp;gt;&lt;br /&gt;
 &amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;
   setTimeout(&amp;quot;document.getElementById('question17').style.visibility='hidden'&amp;quot;, 3000);&lt;br /&gt;
 &amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Make sure the id (''question17'') is unique on the question page. It must appear precisely twice (as shown above). The 3000 is the time before the text disappears in ms. Try it in [https://survey.socsci.ru.nl/index.php/615263?lang=en demo time].&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=RIVER_Lab/Legacy&amp;diff=6458</id>
		<title>RIVER Lab/Legacy</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=RIVER_Lab/Legacy&amp;diff=6458"/>
		<updated>2026-04-16T10:13:31Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox tsg&lt;br /&gt;
| image = Riverlab2_01.png&lt;br /&gt;
| image alt = RIVER Lab 2&lt;br /&gt;
| caption = RIVER Lab 2 in 2015&lt;br /&gt;
| label1 = Location&lt;br /&gt;
| data1 = B.00.12a (RIVER Lab 1),&amp;lt;br/&amp;gt;B.00.10 (RIVER Lab 2)&lt;br /&gt;
| manuals = {{bulleted list&lt;br /&gt;
    | &amp;lt;del&amp;gt;&amp;lt;!--[[:File:riv2 quickstart.pdf|RIVER Lab 2 Oculus Quick Start Guide]]--&amp;gt;RIVER Lab 2 Oculus Quick Start Guide&amp;lt;/del&amp;gt;&lt;br /&gt;
    | &amp;lt;del&amp;gt;&amp;lt;!--[[:File:Vive_riv2_quickstart.pdf|RIVER Lab 2 Vive Quick Start Guide]]--&amp;gt;RIVER Lab 2 Vive Quick Start Guide&amp;lt;/del&amp;gt;&lt;br /&gt;
    }}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The Radboud Immersive Virtual Environment Research (RIVER) Labs 1 and 2 were two Behavioral Science Institute research labs dedicated to experiments in Virtual Reality (VR) in the Spinoza building.&lt;br /&gt;
&lt;br /&gt;
==Physical Properties==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;   &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;| &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;| [[File:Riverlab1_01.png|200px|Image: 200 pixels]]&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;| [[File:Riverlab2_01.png|200px|Image: 200 pixels]]&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| &lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| RIVER Lab 1&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| RIVER Lab 2&lt;br /&gt;
|-&lt;br /&gt;
! Room Properties&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| Room Number || B.00.12a || B.00.10&lt;br /&gt;
|-&lt;br /&gt;
| Room Size&amp;lt;ref&amp;gt;Effective tracking area&amp;lt;/ref&amp;gt; (m) || 4.0 * 8.0 || 5.0 * 7.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Equipment== &lt;br /&gt;
&lt;br /&gt;
Both RIVER labs come with special equipment for creating a digital immersive virtual environment. The following specifications apply to the current lab setup, operational since January 2014. For older specifications, please contact the [[RIVER_Lab/manager|lab manager]].&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;|  &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;|  RIVER Lab 1&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;|  RIVER Lab 2&lt;br /&gt;
|-&lt;br /&gt;
! Tracking&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; colspan=&amp;quot;2&amp;quot;|&lt;br /&gt;
|-&lt;br /&gt;
| Tracking System || Intersense IS-900 || AR-Tracking ARTTRACK3&lt;br /&gt;
|-&lt;br /&gt;
| Type || Inertial-Ultrasound Hybrid || Optical, 16 Cameras&lt;br /&gt;
|-&lt;br /&gt;
| Accuracy (mm) || 0.75 - 3.0 || &amp;lt;1.0&lt;br /&gt;
|-&lt;br /&gt;
| Update Rate (Hz) || 180 || 60&lt;br /&gt;
|-&lt;br /&gt;
| Tracking Software || Intersense Server || AR-Tracking DTrack 2.0&lt;br /&gt;
|-&lt;br /&gt;
| Tracker Type || Inertial-Ultrasound Hybrid Sensor || Passive retro-reflective markers&lt;br /&gt;
|-&lt;br /&gt;
! Virtual Reality&lt;br /&gt;
! scope=&amp;quot;row&amp;quot; colspan=&amp;quot;2&amp;quot; | &lt;br /&gt;
|-&lt;br /&gt;
| Wireless VR || style=&amp;quot;background-color:#F99;&amp;quot; | No || style=&amp;quot;background-color:#FFB;&amp;quot; | No&amp;lt;ref&amp;gt;Possible with Oculus Rift DK1 only.&amp;lt;/ref&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Stimulus PC || [[Computers|Dell Precision T3610]]&amp;lt;ref name=&amp;quot;stimpc&amp;quot;&amp;gt;Different graphics card installed (GTX1060 or GTX1080). For exact up-to-date specifications, please contact the [[RIVER_Lab/manager|lab manager]] &amp;lt;/ref&amp;gt; || [[Computers|Dell Precision T3610]]&amp;lt;ref name=&amp;quot;stimpc&amp;quot;/&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Stimulus Software || colspan=&amp;quot;2&amp;quot; style=&amp;quot;text-align:center&amp;quot;| [http://www.worldviz.com/products/vizard Worldviz Vizard 4.0], [https://unity3d.com/ Unity]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Head Mounted Displays ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| &lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Nvis Nvisor SX60&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| Oculus Rift Dev. Kit 1&lt;br /&gt;
! scope=&amp;quot;col&amp;quot;| HTC Vive&lt;br /&gt;
|-&lt;br /&gt;
| In service || style=&amp;quot;text-align:center;&amp;quot; | 2006 - October 2013 || style=&amp;quot;text-align:center;&amp;quot; | November 2013 - 2017 || style=&amp;quot;text-align:center;&amp;quot; | November 2016 -&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In RIVER Lab 2, five retro-reflective markers are attached to the [[Head Mounted Displays | Head Mounted Display]] (except HTC Vive) via a custom 3D-printed frame for tracking the participant's position and orientation; any internal tracking in the HMD is disabled.&lt;br /&gt;
&lt;br /&gt;
==== Vive ====&lt;br /&gt;
As of November 2016, standard HTC Vive setups are available in both RIVER Labs. These setups use the Vive's own &amp;quot;Lighthouse&amp;quot; tracking system instead of the lab's, and a standard [[Computers#Lab_Computer | Lab Computer]] (with upgraded graphics card). No wireless solution is available for the Vive (yet), so the tracking area is limited by the length of the cable and the range of the Lighthouse tracking system. &lt;br /&gt;
As of September 2017, the Vive in RIVER Lab 2 has been equipped with the Deluxe Audio Strap, which has built-in headphones.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- // MARKED FOR OBSOLESENCE&lt;br /&gt;
=== Stimulus PC (RIVER Lab 2) ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;   &lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;| &lt;br /&gt;
! scope=&amp;quot;col&amp;quot; style=&amp;quot;width:200px;&amp;quot;| [[File:riverpc.jpg|200px|Image: 200 pixels]]&lt;br /&gt;
|-&lt;br /&gt;
| Central Processing Unit (CPU) || [http://ark.intel.com/products/75123 Intel Core i7-4770K]&lt;br /&gt;
|-&lt;br /&gt;
| Memory || 16GB 1600Mhz DDR3&lt;br /&gt;
|-&lt;br /&gt;
| Chipset || Intel Z87&lt;br /&gt;
|-&lt;br /&gt;
| Audio Chip || Realtek ALC1150&lt;br /&gt;
|-&lt;br /&gt;
| Network Controller || Intel I217V + Realtek 8111GR (Dual Gigabit Ethernet)&lt;br /&gt;
|-&lt;br /&gt;
| Graphics Processing Unit (GPU) || Nvidia GeForce GTX780&lt;br /&gt;
|-&lt;br /&gt;
| Storage || Samsung SSD 840 EVO, 128GB&lt;br /&gt;
|}&lt;br /&gt;
=== Other Equipment ===&lt;br /&gt;
&lt;br /&gt;
In RIVER Lab 2, the following equipment is used to help create a fully wireless, low latency virtual reality experience (applies to Oculus DK1 only!):&lt;br /&gt;
*IOGear GW3DHDKIT wireless HDMI transmitter.&amp;lt;ref&amp;gt;http://www.iogear.com/product/GW3DHDKIT/&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Anker Astro Pro 14400mAh external battery.&amp;lt;ref&amp;gt;http://www.ianker.com/support-c1-g212.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
*Sennheiser RS160 wireless headphones.&amp;lt;ref&amp;gt;http://en-us.sennheiser.com/wireless-audio-headphones-digital-rs-160&amp;lt;/ref&amp;gt;&lt;br /&gt;
&amp;amp;nbsp; &lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
*[[Head Mounted Displays]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Sequence_of_URLs&amp;diff=6457</id>
		<title>Sequence of URLs</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Sequence_of_URLs&amp;diff=6457"/>
		<updated>2026-04-16T10:05:56Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.socsci.ru.nl/tsg/sequence Sequence of URLs] allows you to send the same data as URL parameters to a numbers of URLs that together make up your experiment. Typically You will start from SONA or Prolific, then go to an informed consent form, then to an online experiment or survey and then back to Prolific for completion of the experiment.&lt;br /&gt;
= Simple example =&lt;br /&gt;
If you want to visit two URLs and let both know that your name is John, you can visit these pages like this:&lt;br /&gt;
* https://www.ru.nl?name=John&lt;br /&gt;
* https://www.nos.nl?name=John&lt;br /&gt;
&lt;br /&gt;
But you may want to prevent having to type the same information twice. That is where [https://www.socsci.ru.nl/tsg/sequence Sequence of URLs] can help. Put your two URLs in a Sequence:&lt;br /&gt;
[[File:Overview .png|frame|center|A sequence of two URLs]]&lt;br /&gt;
&lt;br /&gt;
now you can visit the following two URLs:&lt;br /&gt;
* https://www.socsci.ru.nl/tsg/sequence/123456/0?name=John&lt;br /&gt;
* https://www.socsci.ru.nl/tsg/sequence/123456/1&lt;br /&gt;
&lt;br /&gt;
which will be automatically forwarded to the two URLs mentioned above. Note that the name is automatically send to both pages, while it was entered only for the first.&lt;br /&gt;
&lt;br /&gt;
= Prolific =&lt;br /&gt;
Imagine you want to conduct an online experiment with Prolific and you want to your participants to visit the following three places:&lt;br /&gt;
* Informed consent&lt;br /&gt;
* Online Experiment&lt;br /&gt;
* Prolific completion&lt;br /&gt;
&lt;br /&gt;
If the informed consent form is of the type that is most common in the Donders Center for Cognition, the experiment is on our exp server this will give you three URL's for these places like this:&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
&lt;br /&gt;
The last of the three comes from Prolific:&lt;br /&gt;
&lt;br /&gt;
[[File:Prolific completion.png|frame|center|Form on the Prolific study page showing the completion URL.]]&lt;br /&gt;
&lt;br /&gt;
Since you programmed ''coolExperiment'' yourself you can make sure that the last page contains a link to the completion URL, but to let the informed consent survey know where the experiment is, you have to add it in the first URL like this:&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321?url=https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
&lt;br /&gt;
You may have never done this before by hand, since it is done for you by [[URL Composer]]. This works but typically we want to make it even more complicated. The experiment wants to keep track of the ''prolific pid'' to identify unique participants. In the past we could use [[URL Composer]] for an even more complicated URL, but that no longer works (2023-06-16) therefore we need [https://www.socsci.ru.nl/tsg/sequence Sequence of URLs], a small tool that makes aliases for the three URLs in your experiment and keeps track of the ''prolific pid'' for you. Just enter the three URLs there:&lt;br /&gt;
&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321?url=https://www.socsci.ru.nl/tsg/sequence/123456/1&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Sequence of URLs.png|frame|center|Three URLs that make up an experiment]]&lt;br /&gt;
&lt;br /&gt;
Instead of linking to the informed consent form directly, you link prolific to the first URL in the sequence:&lt;br /&gt;
[[File:Prolific URL.png|frame|center|form on the prolific study page showing the experiment url.]]&lt;br /&gt;
&lt;br /&gt;
Now all three URLs will receive the prolific PID, study id, etc.&lt;br /&gt;
&lt;br /&gt;
= SONA and Prolific =&lt;br /&gt;
Imagine you want to conduct an online experiment with two panel systems that recruit participants to the same experiment, SONA and Prolific,  and you want to your participants to visit the following places:&lt;br /&gt;
* Online Experiment in Limesurvey&lt;br /&gt;
* SONA or Prolific completion, depending on where they were recruited&lt;br /&gt;
&lt;br /&gt;
As the three URLs in ''Sequence'' you input  (mutatis mutandis):&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://questions.socsci.ru.nl/index.php/654321&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (change the 6 digit number to your limesurvey number)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://radboud.sona-systems.com/services/SonaAPI.svc/WebstudyCredit?experiment_id=12345&amp;amp;credit_token=123456789abcdef&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (take your SONA completion url)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://app.prolific.co/submissions/complete?cc=ABC123&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (take your the Prolific completion url)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:ℹ️ We leave out the last part of the completion URL that the SONA experiment page gives (&amp;amp;survey_code=XXXXXX) since that is taken care of by ''Sequence''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As the SONA study url you should use without ''Sequence'':&lt;br /&gt;
&amp;lt;pre&amp;gt;https://questions.socsci.ru.nl/index.php/654321?survey_code=%SURVEY_CODE%&amp;lt;/pre&amp;gt;&lt;br /&gt;
but because you use ''Sequence'' you replace the first part:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/sequence/123456/0?survey_code=%SURVEY_CODE%&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the Prolific study url you should use without ''Sequence'':&lt;br /&gt;
&amp;lt;pre&amp;gt;https://questions.socsci.ru.nl/index.php/654321?PROLIFIC_PID={{%PROLIFIC_PID%}}&amp;amp;STUDY_ID={{%STUDY_ID%}}&amp;amp;SESSION_ID={{%SESSION_ID%}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
but with ''Sequence'' you replace the first part:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/sequence/123456/0?PROLIFIC_PID={{%PROLIFIC_PID%}}&amp;amp;STUDY_ID={{%STUDY_ID%}}&amp;amp;SESSION_ID={{%SESSION_ID%}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
:ℹ️ You only enter the part up to but not including the question mark in Prolific and Polific will add the rest.&lt;br /&gt;
&lt;br /&gt;
All that we now have to do is set a Limesurvey ''end url'' that points either to SONA or to Prolific:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/misc/redirect.php?url={if(is_empty('{PASSTHRU:PROLIFIC_PID}'), 'https://www.socsci.ru.nl/tsg/sequence/123456/1', 'https://www.socsci.ru.nl/tsg/sequence/123456/2')}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which in normal English means something like: if there is ''no'' PROLIFIC PID, go to ''Sequence'' page 1, otherwise go to ''Sequence'' page 2.&lt;br /&gt;
&lt;br /&gt;
= Privacy =&lt;br /&gt;
This method looks a bit like the way the worlds largest privacy breakers work. These web pages receive the name of the person visiting them without the participant sending it explicitly also.&lt;br /&gt;
&lt;br /&gt;
This is precisely the intention of ''Sequence'', but it is also very different. Rather than saving a persistent cookie and storing the participants information for later use, we save &lt;br /&gt;
only the precise information entered by the participant, store it only on the participants computer and store it only during the session. Therefore no cookie notice is required.&lt;br /&gt;
You only need to inform the participant that the information of the separate parts of the experiment is combined, like you would do anyway in your informed consent form.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Sequence_of_URLs&amp;diff=6456</id>
		<title>Sequence of URLs</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Sequence_of_URLs&amp;diff=6456"/>
		<updated>2026-04-16T10:04:57Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: /* SONA and Prolific */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[https://www.socsci.ru.nl/tsg/sequence Sequence of URLs] allows you to send the same data as URL parameters to a numbers of URLs that together make up your experiment. Typically You will start from SONA or Prolific, then go to an informed consent form, then to an online experiment or survey and then back to Prolific for completion of the experiment.&lt;br /&gt;
= Simple example =&lt;br /&gt;
If you want to visit two URLs and let both know that your name is John, you can visit these pages like this:&lt;br /&gt;
* https://www.ru.nl?name=John&lt;br /&gt;
* https://www.nos.nl?name=John&lt;br /&gt;
&lt;br /&gt;
But you may want to prevent having to type the same information twice. That is where [https://www.socsci.ru.nl/tsg/sequence Sequence of URLs] can help. Put your two URLs in a Sequence:&lt;br /&gt;
[[File:Overview .png|frame|center|A sequence of two URLs]]&lt;br /&gt;
&lt;br /&gt;
now you can visit the following two URLs:&lt;br /&gt;
* https://www.socsci.ru.nl/tsg/sequence/123456/0?name=John&lt;br /&gt;
* https://www.socsci.ru.nl/tsg/sequence/123456/1&lt;br /&gt;
&lt;br /&gt;
which will be automatically forwarded to the two URLs mentioned above. Note that the name is automatically send to both pages, while it was entered only for the first.&lt;br /&gt;
&lt;br /&gt;
= Prolific =&lt;br /&gt;
Imagine you want to conduct an online experiment with Prolific and you want to your participants to visit the following three places:&lt;br /&gt;
* Informed consent&lt;br /&gt;
* Online Experiment&lt;br /&gt;
* Prolific completion&lt;br /&gt;
&lt;br /&gt;
If the informed consent form is of the type that is most common in the Donders Center for Cognition, the experiment is on our exp server this will give you three URL's for these places like this:&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
&lt;br /&gt;
The last of the three comes from Prolific:&lt;br /&gt;
&lt;br /&gt;
[[File:Prolific completion.png|frame|center|Form on the Prolific study page showing the completion URL.]]&lt;br /&gt;
&lt;br /&gt;
Since you programmed ''coolExperiment'' yourself you can make sure that the last page contains a link to the completion URL, but to let the informed consent survey know where the experiment is, you have to add it in the first URL like this:&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321?url=https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
&lt;br /&gt;
You may have never done this before by hand, since it is done for you by [[URL Composer]]. This works but typically we want to make it even more complicated. The experiment wants to keep track of the ''prolific pid'' to identify unique participants. In the past we could use [[URL Composer]] for an even more complicated URL, but that no longer works (2023-06-16) therefore we need [https://www.socsci.ru.nl/tsg/sequence Sequence of URLs], a small tool that makes aliases for the three URLs in your experiment and keeps track of the ''prolific pid'' for you. Just enter the three URLs there:&lt;br /&gt;
&lt;br /&gt;
* https://questions.socsci.ru.nl/index.php/654321?url=https://www.socsci.ru.nl/tsg/sequence/123456/1&lt;br /&gt;
* https://exp.socsci.ru.nl/coolExperiment&lt;br /&gt;
* https://app.prolific.co/submissions/complete?cc=FJ2UID24&lt;br /&gt;
like this. &lt;br /&gt;
&lt;br /&gt;
[[File:Sequence of URLs.png|frame|center|Three URLs that make up an experiment]]&lt;br /&gt;
&lt;br /&gt;
Instead of linking to the informed consent form directly, you link prolific to the first URL in the sequence:&lt;br /&gt;
[[File:Prolific URL.png|frame|center|form on the prolific study page showing the experiment url.]]&lt;br /&gt;
&lt;br /&gt;
Now all three URLs will receive the prolific PID, study id, etc.&lt;br /&gt;
&lt;br /&gt;
= SONA and Prolific =&lt;br /&gt;
Imagine you want to conduct an online experiment with two panel systems that recruit participants to the same experiment, SONA and Prolific,  and you want to your participants to visit the following places:&lt;br /&gt;
* Online Experiment in Limesurvey&lt;br /&gt;
* SONA or Prolific completion, depending on where they were recruited&lt;br /&gt;
&lt;br /&gt;
As the three URLs in ''Sequence'' you input  (mutatis mutandis):&lt;br /&gt;
&amp;lt;ol&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;0&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://questions.socsci.ru.nl/index.php/654321&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (change the 6 digit number to your limesurvey number)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;1&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://radboud.sona-systems.com/services/SonaAPI.svc/WebstudyCredit?experiment_id=12345&amp;amp;credit_token=123456789abcdef&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (take your SONA completion url)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li value=&amp;quot;2&amp;quot;&amp;gt;&amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;https://app.prolific.co/submissions/complete?cc=ABC123&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; (take your the Prolific completion url)&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;/ol&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ℹ️ We leave out the last part of the completion URL that the SONA experiment page gives (&amp;amp;survey_code=XXXXXX) since that is taken care of by ''Sequence''&lt;br /&gt;
&lt;br /&gt;
As the SONA study url you should use without ''Sequence'':&lt;br /&gt;
&amp;lt;pre&amp;gt;https://questions.socsci.ru.nl/index.php/654321?survey_code=%SURVEY_CODE%&amp;lt;/pre&amp;gt;&lt;br /&gt;
but because you use ''Sequence'' you replace the first part:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/sequence/123456/0?survey_code=%SURVEY_CODE%&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As the Prolific study url you should use without ''Sequence'':&lt;br /&gt;
&amp;lt;pre&amp;gt;https://questions.socsci.ru.nl/index.php/654321?PROLIFIC_PID={{%PROLIFIC_PID%}}&amp;amp;STUDY_ID={{%STUDY_ID%}}&amp;amp;SESSION_ID={{%SESSION_ID%}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
but with ''Sequence'' you replace the first part:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/sequence/123456/0?PROLIFIC_PID={{%PROLIFIC_PID%}}&amp;amp;STUDY_ID={{%STUDY_ID%}}&amp;amp;SESSION_ID={{%SESSION_ID%}}&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that you only enter the part up to but not including the question mark in Prolific and Polific will add the rest.&lt;br /&gt;
&lt;br /&gt;
All that we now have to do is set a Limesurvey ''end url'' that points either to SONA or to Prolific:&lt;br /&gt;
&amp;lt;pre&amp;gt;https://www.socsci.ru.nl/tsg/misc/redirect.php?url={if(is_empty('{PASSTHRU:PROLIFIC_PID}'), 'https://www.socsci.ru.nl/tsg/sequence/123456/1', 'https://www.socsci.ru.nl/tsg/sequence/123456/2')}&amp;lt;/pre&amp;gt;&lt;br /&gt;
which in normal English means something like: if there is ''no'' PROLIFIC PID, go to ''Sequence'' page 1, otherwise go to ''Sequence'' page 2.&lt;br /&gt;
&lt;br /&gt;
= Privacy =&lt;br /&gt;
This method looks a bit like the way the worlds largest privacy breakers work. These web pages receive the name of the person visiting them without the participant sending it explicitly also.&lt;br /&gt;
&lt;br /&gt;
This is precisely the intention of ''Sequence'', but it is also very different. Rather than saving a persistent cookie and storing the participants information for later use, we save &lt;br /&gt;
only the precise information entered by the participant, store it only on the participants computer and store it only during the session. Therefore no cookie notice is required.&lt;br /&gt;
You only need to inform the participant that the information of the separate parts of the experiment is combined, like you would do anyway in your informed consent form.&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation/config&amp;diff=6455</id>
		<title>Module:Documentation/config</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Documentation/config&amp;diff=6455"/>
		<updated>2026-04-16T09:41:47Z</updated>

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

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{documentation}}.&lt;br /&gt;
&lt;br /&gt;
-- Get required modules.&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData('Module:Documentation/config')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Often-used functions.&lt;br /&gt;
local ugsub = mw.ustring.gsub&lt;br /&gt;
local format = mw.ustring.format&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Helper functions&lt;br /&gt;
--&lt;br /&gt;
-- These are defined as local functions, but are made available in the p&lt;br /&gt;
-- table for testing purposes.&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function message(cfgKey, valArray, expectType)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Gets a message from the cfg table and formats it if appropriate.&lt;br /&gt;
	-- The function raises an error if the value from the cfg table is not&lt;br /&gt;
	-- of the type expectType. The default type for expectType is 'string'.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value 'Foo $2 bar $1.',&lt;br /&gt;
	-- message('foo-message', {'baz', 'qux'}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or 'string'&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error('message: type error in message cfg.' .. cfgKey .. ' (' .. expectType .. ' expected, got ' .. type(msg) .. ')', 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not valArray then&lt;br /&gt;
		return msg&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local function getMessageVal(match)&lt;br /&gt;
		match = tonumber(match)&lt;br /&gt;
		return valArray[match] or error('message: no value found for key $' .. match .. ' in message cfg.' .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, '$([1-9][0-9]*)', getMessageVal)&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 format('[[%s|%s]]', page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return format('[[%s]]', page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. ':' .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return format('[%s %s]', url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select('#', ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- 'documentation-toolbar'&lt;br /&gt;
	return format(&lt;br /&gt;
		'&amp;lt;span class=&amp;quot;%s&amp;quot;&amp;gt;(%s)&amp;lt;/span&amp;gt;',&lt;br /&gt;
		message('toolbar-class'),&lt;br /&gt;
		table.concat(ret, ' &amp;amp;#124; ')&lt;br /&gt;
	)&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == 'string' then&lt;br /&gt;
					value = value:match('^%s*(.-)%s*$') -- Remove whitespace.&lt;br /&gt;
					if key == 'heading' or value ~= '' then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == 'testcases' then&lt;br /&gt;
		return frame:expandTemplate{title = 'module test cases notice'}&lt;br /&gt;
	else&lt;br /&gt;
		return p.main(frame)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.main = makeInvokeFunc('_main')&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function defines logic flow for the module.&lt;br /&gt;
	-- @args - table of arguments passed by the user&lt;br /&gt;
	--]]&lt;br /&gt;
	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;
		:tag('div')&lt;br /&gt;
			-- 'documentation-container'&lt;br /&gt;
			:addClass(message('container'))&lt;br /&gt;
			:attr('role', 'complementary')&lt;br /&gt;
			:attr('aria-labelledby', args.heading ~= '' and 'documentation-heading' or nil)&lt;br /&gt;
			:attr('aria-label', args.heading == '' and 'Documentation' or nil)&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag('div')&lt;br /&gt;
				-- 'documentation'&lt;br /&gt;
				:addClass(message('main-div-classes'))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag('div')&lt;br /&gt;
					-- 'documentation-clear'&lt;br /&gt;
					:addClass(message('clear'))&lt;br /&gt;
					:done()&lt;br /&gt;
				:newline()&lt;br /&gt;
				:done()&lt;br /&gt;
			:wikitext(p._endBox(args, env))&lt;br /&gt;
			:done()&lt;br /&gt;
		:wikitext(p.addTrackingCategories(env))&lt;br /&gt;
	-- 'Module:Documentation/styles.css'&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		'templatestyles', '', {src=cfg['templatestyles']&lt;br /&gt;
	}) .. 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&lt;br /&gt;
	-- objects and other namespace- or 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;
	--&lt;br /&gt;
	-- Data includes:&lt;br /&gt;
	-- env.protectionLevels - the protection levels table of the title object.&lt;br /&gt;
	-- env.subjectSpace - the number of the title's subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don't call any of the functions&lt;br /&gt;
	-- more than once. (Nils won't be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message('sandbox-subpage') or subpage == message('testcases-subpage') or (subpage == message('doc-subpage') and mw.title.getCurrentTitle().namespace == env.docSpace) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. '/' .. message('doc-subpage')&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'sandbox-subpage' --&amp;gt; 'sandbox'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('sandbox-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. '/' .. message('testcases-subpage'))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.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&lt;br /&gt;
		-- same as the subject namespace. However, pages in the Article, File,&lt;br /&gt;
		-- MediaWiki or Category namespaces must have their /doc, /sandbox and&lt;br /&gt;
		-- /testcases pages in talk space.&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		if subjectSpace == 0 or subjectSpace == 6 or subjectSpace == 8 or subjectSpace == 14 then&lt;br /&gt;
			return subjectSpace + 1&lt;br /&gt;
		else&lt;br /&gt;
			return subjectSpace&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docpageBase()&lt;br /&gt;
		-- The base page of the /doc, /sandbox, and /testcases subpages.&lt;br /&gt;
		-- For some namespaces this is the talk page, rather than the template page.&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local docSpace = env.docSpace&lt;br /&gt;
		local docSpaceText = mw.site.namespaces[docSpace].name&lt;br /&gt;
		-- Assemble the link. docSpace is never the main namespace, so we can hardcode the colon.&lt;br /&gt;
		return docSpaceText .. ':' .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.canonicalUrl(&lt;br /&gt;
				'Special:ComparePages',&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc('_getModuleWikitext')&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 ~= 'Scribunto' then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don'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;
	-- 'sandbox-notice-image' --&amp;gt; '[[File:Sandbox.svg|50px|alt=|link=]]'&lt;br /&gt;
	-- 'sandbox-notice-blurb' --&amp;gt; 'This is the $1 for $2.'&lt;br /&gt;
	-- 'sandbox-notice-diff-blurb' --&amp;gt; 'This is the $1 for $2 ($3).'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-template' --&amp;gt; '[[Wikipedia:Template test cases|template sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-module' --&amp;gt; '[[Wikipedia:Template test cases|module sandbox]] page'&lt;br /&gt;
	-- 'sandbox-notice-pagetype-other' --&amp;gt; 'sandbox page'&lt;br /&gt;
	-- 'sandbox-notice-compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'sandbox-notice-testcases-blurb' --&amp;gt; 'See also the companion subpage for $1.'&lt;br /&gt;
	-- 'sandbox-notice-testcases-link-display' --&amp;gt; 'test cases'&lt;br /&gt;
	-- 'sandbox-category' --&amp;gt; 'Template sandboxes'&lt;br /&gt;
	-- 'module-sandbox-category' --&amp;gt; 'Module sandboxes'&lt;br /&gt;
	-- 'other-sandbox-category' --&amp;gt; 'Sandboxes outside of template or module namespace'&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&lt;br /&gt;
		and mw.title.equals(title, sandboxTitle)) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Build the table of arguments to pass to {{ombox}}. We need just two fields, &amp;quot;image&amp;quot; and &amp;quot;text&amp;quot;.&lt;br /&gt;
	local omargs = {}&lt;br /&gt;
	omargs.image = message('sandbox-notice-image')&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = '__EXPECTUNUSEDTEMPLATE__'&lt;br /&gt;
	local pagetype, sandboxCat&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-template')&lt;br /&gt;
		sandboxCat = message('sandbox-category')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-module')&lt;br /&gt;
		sandboxCat = message('module-sandbox-category')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('sandbox-notice-pagetype-other')&lt;br /&gt;
		sandboxCat = message('other-sandbox-category')&lt;br /&gt;
	end&lt;br /&gt;
	local templateLink = makeWikilink(templateTitle.prefixedText)&lt;br /&gt;
	local compareUrl = env.compareUrl&lt;br /&gt;
	if compareUrl then&lt;br /&gt;
		local compareDisplay = message('sandbox-notice-compare-link-display')&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message('sandbox-notice-diff-blurb', {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message('sandbox-notice-blurb', {pagetype, templateLink})&lt;br /&gt;
	end&lt;br /&gt;
	-- Get the test cases page blurb if the page exists. This is something like&lt;br /&gt;
	-- &amp;quot;See also the companion subpage for [[Template:Foo/testcases|test cases]].&amp;quot;&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	if testcasesTitle and testcasesTitle.exists then&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot; then&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesRunLinkDisplay = message('sandbox-notice-testcases-run-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-run-blurb', {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message('sandbox-notice-testcases-link-display')&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. '&amp;lt;br /&amp;gt;' .. message('sandbox-notice-testcases-blurb', {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(sandboxCat)&lt;br /&gt;
&lt;br /&gt;
	-- 'documentation-clear'&lt;br /&gt;
	return '&amp;lt;div class=&amp;quot;' .. message('clear') .. '&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;'&lt;br /&gt;
		.. require('Module:Message box').main('ombox', omargs)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.protectionTemplate(env)&lt;br /&gt;
	-- Generates the padlock icon in the top right.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'protection-template' --&amp;gt; 'pp-template'&lt;br /&gt;
	-- 'protection-template-args' --&amp;gt; {docusage = 'yes'}&lt;br /&gt;
	local protectionLevels = env.protectionLevels&lt;br /&gt;
	if not protectionLevels then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local editProt = protectionLevels.edit and protectionLevels.edit[1]&lt;br /&gt;
	local moveProt = protectionLevels.move and protectionLevels.move[1]&lt;br /&gt;
	if editProt then&lt;br /&gt;
		-- The page is edit-protected.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			message('protection-reason-edit'), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= 'autoconfirmed' then&lt;br /&gt;
		-- The page is move-protected but not edit-protected. Exclude move&lt;br /&gt;
		-- protection with the level &amp;quot;autoconfirmed&amp;quot;, as this is equivalent to&lt;br /&gt;
		-- no move protection at all.&lt;br /&gt;
		return require('Module:Protection banner')._main{&lt;br /&gt;
			action = 'move', small = true&lt;br /&gt;
		}&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Start box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.startBox = makeInvokeFunc('_startBox')&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content or args[1] then&lt;br /&gt;
		-- No need to include the links if the documentation is on the template page itself.&lt;br /&gt;
		local linksData = p.makeStartBoxLinksData(args, env)&lt;br /&gt;
		if linksData then&lt;br /&gt;
			links = p.renderStartBoxLinks(linksData)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Generate the start box html.&lt;br /&gt;
	local data = p.makeStartBoxData(args, env, links)&lt;br /&gt;
	if data then&lt;br /&gt;
		return p.renderStartBox(data)&lt;br /&gt;
	else&lt;br /&gt;
		-- User specified no heading.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxLinksData(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Does initial processing of data to make the [view] [edit] [history] [purge] links.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'view-link-display' --&amp;gt; 'view'&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'purge-link-display' --&amp;gt; 'purge'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'docpage-preload' --&amp;gt; 'Template:Documentation/preload'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Create link if /doc doesn't exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message('module-preload')&lt;br /&gt;
		else&lt;br /&gt;
			preload = message('docpage-preload')&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return {&lt;br /&gt;
		title = title,&lt;br /&gt;
		docTitle = docTitle,&lt;br /&gt;
		-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
		viewLinkDisplay = message('view-link-display'),&lt;br /&gt;
		editLinkDisplay = message('edit-link-display'),&lt;br /&gt;
		historyLinkDisplay = message('history-link-display'),&lt;br /&gt;
		purgeLinkDisplay = message('purge-link-display'),&lt;br /&gt;
		preload = preload,&lt;br /&gt;
		createLinkDisplay = message('create-link-display')&lt;br /&gt;
	}&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][purge] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	-- yes, we do intend to purge the template page on which the documentation appears&lt;br /&gt;
	local purgeLink = makeWikilink(&amp;quot;Special:Purge/&amp;quot; .. data.title.prefixedText, data.purgeLinkDisplay)&lt;br /&gt;
	&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, data.historyLinkDisplay)&lt;br /&gt;
		return &amp;quot;&amp;amp;#91;&amp;quot; .. viewLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. editLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. historyLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:canonicalUrl{action = 'edit', preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		return  &amp;quot;&amp;amp;#91;&amp;quot; .. createLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there's an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'documentation-icon-wikitext' --&amp;gt; '[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]'&lt;br /&gt;
	-- 'template-namespace-heading' --&amp;gt; 'Template documentation'&lt;br /&gt;
	-- 'module-namespace-heading' --&amp;gt; 'Module documentation'&lt;br /&gt;
	-- 'file-namespace-heading' --&amp;gt; 'Summary'&lt;br /&gt;
	-- 'other-namespaces-heading' --&amp;gt; 'Documentation'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == '' then&lt;br /&gt;
		-- Don't display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('template-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message('documentation-icon-wikitext') .. ' ' .. message('module-namespace-heading')&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message('file-namespace-heading')&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message('other-namespaces-heading')&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args['heading-style']&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- 'documentation-heading'&lt;br /&gt;
		data.headingClass = message('main-div-heading-class')&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;
		-- 'mw-editsection-like plainlinks'&lt;br /&gt;
		data.linksClass = message('start-box-link-classes')&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create('div')&lt;br /&gt;
	sbox&lt;br /&gt;
		-- 'documentation-startbox'&lt;br /&gt;
		:addClass(message('start-box-class'))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag('span')&lt;br /&gt;
			:addClass(data.headingClass)&lt;br /&gt;
			:attr('id', 'documentation-heading')&lt;br /&gt;
			:cssText(data.headingStyleText)&lt;br /&gt;
			:wikitext(data.heading)&lt;br /&gt;
	local links = data.links&lt;br /&gt;
	if links then&lt;br /&gt;
		sbox:tag('span')&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr('id', data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc('_content')&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.prefixedText}&lt;br /&gt;
	end&lt;br /&gt;
	-- The line breaks below are necessary so that &amp;quot;=== Headings ===&amp;quot; at the start and end&lt;br /&gt;
	-- of docs are interpreted correctly.&lt;br /&gt;
	return '\n' .. (content or '') .. '\n' &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc('_contentTitle')&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return ''&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc('_endBox')&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&lt;br /&gt;
	-- Get environment data.&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not subjectSpace or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	-- Check whether we should output the end box at all. Add the end&lt;br /&gt;
	-- box by default if the documentation exists or if we are in the&lt;br /&gt;
	-- user, module or template namespaces.&lt;br /&gt;
	local linkBox = args['link box']&lt;br /&gt;
	if linkBox == 'off'&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = ''&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or '') -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template's sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or '') .. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don't show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or '')&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create('div')&lt;br /&gt;
	-- 'documentation-metadata'&lt;br /&gt;
	box:attr('role', 'note')&lt;br /&gt;
		:addClass(message('end-box-class'))&lt;br /&gt;
		-- 'plainlinks'&lt;br /&gt;
		:addClass(message('end-box-plainlinks'))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return '\n' .. tostring(box)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeDocPageBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Makes the blurb &amp;quot;This documentation is transcluded from [[Template:Foo]] (edit, history)&amp;quot;.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'history-link-display' --&amp;gt; 'history'&lt;br /&gt;
	-- 'transcluded-from-blurb' --&amp;gt; &lt;br /&gt;
	-- 'The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.'&lt;br /&gt;
	-- 'module-preload' --&amp;gt; 'Template:Documentation/preload-module-doc'&lt;br /&gt;
	-- 'create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'create-module-doc-blurb' --&amp;gt;&lt;br /&gt;
	-- 'You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].'&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		-- /doc exists; link to it.&lt;br /&gt;
		local docLink = makeWikilink(docTitle.prefixedText)&lt;br /&gt;
		local editDisplay = message('edit-link-display')&lt;br /&gt;
		local editLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. docTitle.prefixedText, editDisplay)&lt;br /&gt;
		local historyDisplay = message('history-link-display')&lt;br /&gt;
		local historyLink = makeWikilink(&amp;quot;Special:PageHistory/&amp;quot; .. docTitle.prefixedText, historyDisplay)&lt;br /&gt;
		return message('transcluded-from-blurb', {docLink})&lt;br /&gt;
			.. ' '&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:canonicalUrl{action = 'edit', preload = message('module-preload')}&lt;br /&gt;
		local createDisplay = message('create-link-display')&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		return message('create-module-doc-blurb', {createLink})&lt;br /&gt;
			.. '&amp;lt;br /&amp;gt;'&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template's sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'sandbox-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'compare-link-display' --&amp;gt; 'diff'&lt;br /&gt;
	-- 'module-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-module-sandbox'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'sandbox-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'mirror-edit-summary' --&amp;gt; 'Create sandbox version of $1'&lt;br /&gt;
	-- 'mirror-link-display' --&amp;gt; 'mirror'&lt;br /&gt;
	-- 'mirror-link-preload' --&amp;gt; 'Template:Documentation/mirror'&lt;br /&gt;
	-- 'sandbox-link-display' --&amp;gt; 'sandbox'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display'--&amp;gt; 'edit'&lt;br /&gt;
	-- 'template-sandbox-preload' --&amp;gt; 'Template:Documentation/preload-sandbox'&lt;br /&gt;
	-- 'testcases-create-link-display' --&amp;gt; 'create'&lt;br /&gt;
	-- 'testcases-link-display' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'testcases-edit-link-display' --&amp;gt; 'edit'&lt;br /&gt;
	-- 'module-testcases-preload' --&amp;gt; 'Template:Documentation/preload-module-testcases'&lt;br /&gt;
	-- 'template-testcases-preload' --&amp;gt; 'Template:Documentation/preload-testcases'&lt;br /&gt;
	-- 'experiment-blurb-module' --&amp;gt; 'Editors can experiment in this module's $1 and $2 pages.'&lt;br /&gt;
	-- 'experiment-blurb-template' --&amp;gt; 'Editors can experiment in this template's $1 and $2 pages.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message('sandbox-link-display')&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditDisplay = message('sandbox-edit-link-display')&lt;br /&gt;
		local sandboxEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. sandboxPage, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message('compare-link-display')&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. ' ' .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message('module-sandbox-preload')&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message('template-sandbox-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message('sandbox-create-link-display')&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message('mirror-edit-summary', {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message('mirror-link-preload')&lt;br /&gt;
		local mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:canonicalUrl{action = 'edit', preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message('mirror-link-display')&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message('sandbox-link-display') .. ' ' .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message('testcases-link-display')&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:canonicalUrl{action = 'edit'}&lt;br /&gt;
		local testcasesEditDisplay = message('testcases-edit-link-display')&lt;br /&gt;
		local testcasesEditLink = makeWikilink(&amp;quot;Special:EditPage/&amp;quot; .. testcasesPage, testcasesEditDisplay)&lt;br /&gt;
		-- for Modules, add testcases run link if exists&lt;br /&gt;
		if testcasesTitle.contentModel == &amp;quot;Scribunto&amp;quot;  and testcasesTitle.talkPageTitle and testcasesTitle.talkPageTitle.exists then&lt;br /&gt;
			local testcasesRunLinkDisplay = message('testcases-run-link-display')&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. ' ' .. makeToolbar(testcasesEditLink)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		local testcasesPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			testcasesPreload = message('module-testcases-preload')&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message('template-testcases-preload')&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:canonicalUrl{action = 'edit', preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message('testcases-create-link-display')&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message('testcases-link-display') .. ' ' .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = 'experiment-blurb-module'&lt;br /&gt;
	else&lt;br /&gt;
		messageName = 'experiment-blurb-template'&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'doc-link-display' --&amp;gt; '/doc'&lt;br /&gt;
	-- 'add-categories-blurb' --&amp;gt; 'Please add categories to the $1 subpage.'&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))&lt;br /&gt;
	return message('add-categories-blurb', {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'template-pagetype' --&amp;gt; 'template'&lt;br /&gt;
	-- 'module-pagetype' --&amp;gt; 'module'&lt;br /&gt;
	-- 'default-pagetype' --&amp;gt; 'page'&lt;br /&gt;
	-- 'subpages-link-display' --&amp;gt; 'Subpages of this $1'&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message('template-pagetype')&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message('module-pagetype')&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message('default-pagetype')&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',&lt;br /&gt;
		message('subpages-link-display', {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message('subpages-blurb', {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- 'display-strange-usage-category' --&amp;gt; true&lt;br /&gt;
	-- 'doc-subpage' --&amp;gt; 'doc'&lt;br /&gt;
	-- 'testcases-subpage' --&amp;gt; 'testcases'&lt;br /&gt;
	-- 'strange-usage-category' --&amp;gt; 'Wikipedia pages with strange ((documentation)) usage'&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	if message('display-strange-usage-category', nil, 'boolean')&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message('doc-subpage')&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message('testcases-subpage')&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return makeCategoryLink(message('strange-usage-category'))&lt;br /&gt;
	end&lt;br /&gt;
	return ''&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Documentation&amp;diff=6451</id>
		<title>Template:Documentation</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Documentation&amp;diff=6451"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:documentation|main|_content={{ {{#invoke:documentation|contentTitle}}}}}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Mdash&amp;diff=6449</id>
		<title>Template:Mdash</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Mdash&amp;diff=6449"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Template:Em dash]]&lt;br /&gt;
&lt;br /&gt;
{{Redirect category shell|&lt;br /&gt;
{{R from short name}}&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em_dash&amp;diff=6447</id>
		<title>Template:Em dash</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Em_dash&amp;diff=6447"/>
		<updated>2026-04-16T09:41:46Z</updated>

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;—&amp;lt;noinclude&amp;gt;{{Documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Uploader_information&amp;diff=6445</id>
		<title>Template:Uploader information</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Uploader_information&amp;diff=6445"/>
		<updated>2026-04-16T09:41:45Z</updated>

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

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{#invoke:Message box|imbox}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_media&amp;diff=6441</id>
		<title>Template:Non-free media</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Template:Non-free_media&amp;diff=6441"/>
		<updated>2026-04-16T09:41:45Z</updated>

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;#switch: {{&amp;lt;includeonly&amp;gt;safesubst:&amp;lt;/includeonly&amp;gt;lc: {{{1|¬}}} }}&lt;br /&gt;
 |no&lt;br /&gt;
 |n&lt;br /&gt;
 |f&lt;br /&gt;
 |false&lt;br /&gt;
 |off&lt;br /&gt;
 |0        = {{{no|}}}&lt;br /&gt;
 |         = {{{blank|{{{no|}}}}}}&lt;br /&gt;
 |¬        = {{{¬|}}}&lt;br /&gt;
 |yes&lt;br /&gt;
 |y&lt;br /&gt;
 |t&lt;br /&gt;
 |true&lt;br /&gt;
 |on&lt;br /&gt;
 |1        = {{{yes|yes}}}&lt;br /&gt;
 |#default = {{{def|{{{yes|yes}}}}}}&lt;br /&gt;
}}&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
	<entry>
		<id>http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box/configuration&amp;diff=6405</id>
		<title>Module:Message box/configuration</title>
		<link rel="alternate" type="text/html" href="http://tsgdoc.socsci.ru.nl/index.php?title=Module:Message_box/configuration&amp;diff=6405"/>
		<updated>2026-04-16T09:41:39Z</updated>

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

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

		<summary type="html">&lt;p&gt;E.vandenberge: 1 revision imported&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;amp;#123;&amp;amp;#123;&amp;lt;/span&amp;gt;[[Template:{{{1}}}|{{{1}}}]]&amp;lt;span class=&amp;quot;nowrap&amp;quot;&amp;gt;&amp;amp;#125;&amp;amp;#125;&amp;lt;/span&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation}}&lt;br /&gt;
&amp;lt;!-- Categories go on the /doc subpage and interwikis go on Wikidata. --&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>E.vandenberge</name></author>
	</entry>
</feed>