<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://pdkb.chivanet.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jawitkien</id>
		<title>Public Domain Knowledge Bank - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://pdkb.chivanet.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jawitkien"/>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php/Special:Contributions/Jawitkien"/>
		<updated>2026-05-05T14:04:55Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1945</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1945"/>
				<updated>2021-06-23T15:49:14Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- DJW 20210623 add extra dependency info.&lt;br /&gt;
local dummy = require(&amp;#039;Module:Documentation&amp;#039;);&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; &lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: (DJW)chk: Module;Documentation/config for cfg defn. type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;container&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

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

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1943</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1943"/>
				<updated>2021-06-23T15:30:55Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; &lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: (DJW)chk: Module;Documentation/config for cfg defn. type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;container&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

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

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1941</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1941"/>
				<updated>2021-06-23T15:19:21Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; &lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;container&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1940</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1940"/>
				<updated>2021-06-23T15:15:21Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; &lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: Module-Documentation type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;containerZ&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1939</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1939"/>
				<updated>2021-06-23T15:13:48Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; &lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: Module-Documentation type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;container&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1938</id>
		<title>Module:Documentation</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Documentation&amp;diff=1938"/>
				<updated>2021-06-23T15:11:59Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &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(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
-- Get the config table.&lt;br /&gt;
local cfg = mw.loadData(&amp;#039;Module:Documentation/config&amp;#039;)&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 &amp;#039;string&amp;#039;.&lt;br /&gt;
	-- If the table valArray is present, strings such as $1, $2 etc. in the&lt;br /&gt;
	-- message are substituted with values from the table keys [1], [2] etc.&lt;br /&gt;
	-- For example, if the message &amp;quot;foo-message&amp;quot; had the value &amp;#039;Foo $2 bar $1.&amp;#039;,&lt;br /&gt;
	-- message(&amp;#039;foo-message&amp;#039;, {&amp;#039;baz&amp;#039;, &amp;#039;qux&amp;#039;}) would return &amp;quot;Foo qux bar baz.&amp;quot;&lt;br /&gt;
	--]]&lt;br /&gt;
	local msg = cfg[cfgKey]&lt;br /&gt;
	expectType = expectType or &amp;#039;string&amp;#039; or nil&lt;br /&gt;
	if type(msg) ~= expectType then&lt;br /&gt;
		error(&amp;#039;message: type error in message cfg.&amp;#039; .. cfgKey .. &amp;#039; (&amp;#039; .. expectType .. &amp;#039; expected, got &amp;#039; .. type(msg) .. &amp;#039;)&amp;#039;, 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(&amp;#039;message: no value found for key $&amp;#039; .. match .. &amp;#039; in message cfg.&amp;#039; .. cfgKey, 4)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return ugsub(msg, &amp;#039;$([1-9][0-9]*)&amp;#039;, 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 mw.ustring.format(&amp;#039;[[%s|%s]]&amp;#039;, page, display)&lt;br /&gt;
	else&lt;br /&gt;
		return mw.ustring.format(&amp;#039;[[%s]]&amp;#039;, page)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeWikilink = makeWikilink&lt;br /&gt;
&lt;br /&gt;
local function makeCategoryLink(cat, sort)&lt;br /&gt;
	local catns = mw.site.namespaces[14].name&lt;br /&gt;
	return makeWikilink(catns .. &amp;#039;:&amp;#039; .. cat, sort)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeCategoryLink = makeCategoryLink&lt;br /&gt;
&lt;br /&gt;
local function makeUrlLink(url, display)&lt;br /&gt;
	return mw.ustring.format(&amp;#039;[%s %s]&amp;#039;, url, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.makeUrlLink = makeUrlLink&lt;br /&gt;
&lt;br /&gt;
local function makeToolbar(...)&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	local lim = select(&amp;#039;#&amp;#039;, ...)&lt;br /&gt;
	if lim &amp;lt; 1 then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	for i = 1, lim do&lt;br /&gt;
		ret[#ret + 1] = select(i, ...)&lt;br /&gt;
	end&lt;br /&gt;
	-- &amp;#039;documentation-toolbar&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;span class=&amp;quot;&amp;#039; .. message(&amp;#039;toolbar-class&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;(&amp;#039;&lt;br /&gt;
		.. table.concat(ret, &amp;#039; &amp;amp;#124; &amp;#039;) .. &amp;#039;)&amp;lt;/span&amp;gt;&amp;#039;&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
p.makeToolbar = makeToolbar&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Argument processing&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
local function makeInvokeFunc(funcName)&lt;br /&gt;
	return function (frame)&lt;br /&gt;
		local args = getArgs(frame, {&lt;br /&gt;
			valueFunc = function (key, value)&lt;br /&gt;
				if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
					value = value:match(&amp;#039;^%s*(.-)%s*$&amp;#039;) -- Remove whitespace.&lt;br /&gt;
					if key == &amp;#039;heading&amp;#039; or value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
						return value&lt;br /&gt;
					else&lt;br /&gt;
						return nil&lt;br /&gt;
					end&lt;br /&gt;
				else&lt;br /&gt;
					return value&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		})&lt;br /&gt;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Entry points&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.nonexistent(frame)&lt;br /&gt;
	if mw.title.getCurrentTitle().subpageText == &amp;#039;testcases&amp;#039; then&lt;br /&gt;
		return frame:expandTemplate{title = &amp;#039;module test cases notice&amp;#039;}&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(&amp;#039;_main&amp;#039;)&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(&amp;#039;div&amp;#039;)&lt;br /&gt;
			-- &amp;#039;documentation-container&amp;#039;&lt;br /&gt;
			:addClass(message(&amp;#039;container&amp;#039;))&lt;br /&gt;
			:newline()&lt;br /&gt;
			:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
				-- &amp;#039;documentation&amp;#039;&lt;br /&gt;
				:addClass(message(&amp;#039;main-div-classes&amp;#039;))&lt;br /&gt;
				:newline()&lt;br /&gt;
				:wikitext(p._startBox(args, env))&lt;br /&gt;
				:wikitext(p._content(args, env))&lt;br /&gt;
				:tag(&amp;#039;div&amp;#039;)&lt;br /&gt;
					-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
					:addClass(message(&amp;#039;clear&amp;#039;))&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;
	-- &amp;#039;Module:Documentation/styles.css&amp;#039;&lt;br /&gt;
	return mw.getCurrentFrame():extensionTag (&lt;br /&gt;
		&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=cfg[&amp;#039;templatestyles&amp;#039;]&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;
	-- 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&amp;#039;s subject namespace.&lt;br /&gt;
	-- env.docSpace - the number of the namespace the title puts its documentation in.&lt;br /&gt;
	-- env.docpageBase - the text of the base page of the /doc, /sandbox and /testcases pages, with namespace.&lt;br /&gt;
	-- env.compareUrl - URL of the Special:ComparePages page comparing the sandbox with the template.&lt;br /&gt;
	-- &lt;br /&gt;
	-- All table lookups are passed through pcall so that errors are caught. If an error occurs, the value&lt;br /&gt;
	-- returned will be nil.&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local env, envFuncs = {}, {}&lt;br /&gt;
&lt;br /&gt;
	-- Set up the metatable. If triggered we call the corresponding function in the envFuncs table. The value&lt;br /&gt;
	-- returned by that function is memoized in the env table so that we don&amp;#039;t call any of the functions&lt;br /&gt;
	-- more than once. (Nils won&amp;#039;t be memoized.)&lt;br /&gt;
	setmetatable(env, {&lt;br /&gt;
		__index = function (t, key)&lt;br /&gt;
			local envFunc = envFuncs[key]&lt;br /&gt;
			if envFunc then&lt;br /&gt;
				local success, val = pcall(envFunc)&lt;br /&gt;
				if success then&lt;br /&gt;
					env[key] = val -- Memoise the value.&lt;br /&gt;
					return val&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	})	&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.title()&lt;br /&gt;
		-- The title object for the current page, or a test page passed with args.page.&lt;br /&gt;
		local title&lt;br /&gt;
		local titleArg = args.page&lt;br /&gt;
		if titleArg then&lt;br /&gt;
			title = mw.title.new(titleArg)&lt;br /&gt;
		else&lt;br /&gt;
			title = mw.title.getCurrentTitle()&lt;br /&gt;
		end&lt;br /&gt;
		return title&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.templateTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- The template (or module, etc.) title object.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local subjectSpace = env.subjectSpace&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local subpage = title.subpageText&lt;br /&gt;
		if subpage == message(&amp;#039;sandbox-subpage&amp;#039;) or subpage == message(&amp;#039;testcases-subpage&amp;#039;) then&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.baseText)&lt;br /&gt;
		else&lt;br /&gt;
			return mw.title.makeTitle(subjectSpace, title.text)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object of the /doc subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		local title = env.title&lt;br /&gt;
		local docname = args[1] -- User-specified doc page.&lt;br /&gt;
		local docpage&lt;br /&gt;
		if docname then&lt;br /&gt;
			docpage = docname&lt;br /&gt;
		else&lt;br /&gt;
			docpage = env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		return mw.title.new(docpage)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.sandboxTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /sandbox subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;sandbox-subpage&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;sandbox-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.testcasesTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /testcases subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return mw.title.new(env.docpageBase .. &amp;#039;/&amp;#039; .. message(&amp;#039;testcases-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.printTitle()&lt;br /&gt;
		--[[&lt;br /&gt;
		-- Title object for the /Print subpage.&lt;br /&gt;
		-- Messages:&lt;br /&gt;
		-- &amp;#039;print-subpage&amp;#039; --&amp;gt; &amp;#039;Print&amp;#039;&lt;br /&gt;
		--]]&lt;br /&gt;
		return env.templateTitle:subPageTitle(message(&amp;#039;print-subpage&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.protectionLevels()&lt;br /&gt;
		-- The protection levels table of the title object.&lt;br /&gt;
		return env.title.protectionLevels&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.subjectSpace()&lt;br /&gt;
		-- The subject namespace number.&lt;br /&gt;
		return mw.site.namespaces[env.title.namespace].subject.id&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	function envFuncs.docSpace()&lt;br /&gt;
		-- The documentation namespace number. For most namespaces this is the&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 .. &amp;#039;:&amp;#039; .. templateTitle.text&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function envFuncs.compareUrl()&lt;br /&gt;
		-- Diff link between the sandbox and the main template using [[Special:ComparePages]].&lt;br /&gt;
		local templateTitle = env.templateTitle&lt;br /&gt;
		local sandboxTitle = env.sandboxTitle&lt;br /&gt;
		if templateTitle.exists and sandboxTitle.exists then&lt;br /&gt;
			local compareUrl = mw.uri.fullUrl(&lt;br /&gt;
				&amp;#039;Special:ComparePages&amp;#039;,&lt;br /&gt;
				{ page1 = templateTitle.prefixedText, page2 = sandboxTitle.prefixedText}&lt;br /&gt;
			)&lt;br /&gt;
			return tostring(compareUrl)&lt;br /&gt;
		else&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
	end		&lt;br /&gt;
&lt;br /&gt;
	return env&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Auxiliary templates&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.getModuleWikitext = makeInvokeFunc(&amp;#039;_getModuleWikitext&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._getModuleWikitext(args, env)&lt;br /&gt;
	local currentTitle = mw.title.getCurrentTitle()&lt;br /&gt;
	if currentTitle.contentModel ~= &amp;#039;Scribunto&amp;#039; then return end&lt;br /&gt;
	pcall(require, currentTitle.prefixedText) -- if it fails, we don&amp;#039;t care&lt;br /&gt;
	local moduleWikitext =  package.loaded[&amp;quot;Module:Module wikitext&amp;quot;]&lt;br /&gt;
	if moduleWikitext then&lt;br /&gt;
		return moduleWikitext.main()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.sandboxNotice(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates a sandbox notice for display above sandbox pages.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-notice-image&amp;#039; --&amp;gt; &amp;#039;[[Image:Sandbox.svg|50px|alt=|link=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-diff-blurb&amp;#039; --&amp;gt; &amp;#039;This is the $1 for $2 ($3).&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-template&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|template sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-module&amp;#039; --&amp;gt; &amp;#039;[[Wikipedia:Template test cases|module sandbox]] page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-pagetype-other&amp;#039; --&amp;gt; &amp;#039;sandbox page&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-blurb&amp;#039; --&amp;gt; &amp;#039;See also the companion subpage for $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-notice-testcases-link-display&amp;#039; --&amp;gt; &amp;#039;test cases&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-category&amp;#039; --&amp;gt; &amp;#039;Template sandboxes&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not (subjectSpace and title and sandboxTitle and templateTitle&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(&amp;#039;sandbox-notice-image&amp;#039;)&lt;br /&gt;
	-- Get the text. We start with the opening blurb, which is something like&lt;br /&gt;
	-- &amp;quot;This is the template sandbox for [[Template:Foo]] (diff).&amp;quot;&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-template&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-module&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;sandbox-notice-pagetype-other&amp;#039;)&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(&amp;#039;sandbox-notice-compare-link-display&amp;#039;)&lt;br /&gt;
		local compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-diff-blurb&amp;#039;, {pagetype, templateLink, compareLink})&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. message(&amp;#039;sandbox-notice-blurb&amp;#039;, {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(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLinkDisplay = message(&amp;#039;sandbox-notice-testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-run-blurb&amp;#039;, {testcasesLink, testcasesRunLink})&lt;br /&gt;
		else&lt;br /&gt;
			local testcasesLinkDisplay = message(&amp;#039;sandbox-notice-testcases-link-display&amp;#039;)&lt;br /&gt;
			local testcasesLink = makeWikilink(testcasesTitle.prefixedText, testcasesLinkDisplay)&lt;br /&gt;
			text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. message(&amp;#039;sandbox-notice-testcases-blurb&amp;#039;, {testcasesLink})&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	-- Add the sandbox to the sandbox category.&lt;br /&gt;
	omargs.text = text .. makeCategoryLink(message(&amp;#039;sandbox-category&amp;#039;))&lt;br /&gt;
&lt;br /&gt;
	-- &amp;#039;documentation-clear&amp;#039;&lt;br /&gt;
	return &amp;#039;&amp;lt;div class=&amp;quot;&amp;#039; .. message(&amp;#039;clear&amp;#039;) .. &amp;#039;&amp;quot;&amp;gt;&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
		.. require(&amp;#039;Module:Message box&amp;#039;).main(&amp;#039;ombox&amp;#039;, 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;
	-- &amp;#039;protection-template&amp;#039; --&amp;gt; &amp;#039;pp-template&amp;#039;&lt;br /&gt;
	-- &amp;#039;protection-template-args&amp;#039; --&amp;gt; {docusage = &amp;#039;yes&amp;#039;}&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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			message(&amp;#039;protection-reason-edit&amp;#039;), small = true&lt;br /&gt;
		}&lt;br /&gt;
	elseif moveProt and moveProt ~= &amp;#039;autoconfirmed&amp;#039; 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(&amp;#039;Module:Protection banner&amp;#039;)._main{&lt;br /&gt;
			action = &amp;#039;move&amp;#039;, 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(&amp;#039;_startBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._startBox(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- This function generates the start box.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- The actual work is done by p.makeStartBoxLinksData and p.renderStartBoxLinks which make&lt;br /&gt;
	-- the [view] [edit] [history] [purge] links, and by p.makeStartBoxData and p.renderStartBox&lt;br /&gt;
	-- which generate the box HTML.&lt;br /&gt;
	--]]&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local links&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content 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;
	-- &amp;#039;view-link-display&amp;#039; --&amp;gt; &amp;#039;view&amp;#039;&lt;br /&gt;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;purge-link-display&amp;#039; --&amp;gt; &amp;#039;purge&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-filespace&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;docpage-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not title or not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if docTitle.isRedirect then &lt;br /&gt;
		docTitle = docTitle.redirectTarget&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local data = {}&lt;br /&gt;
	data.title = title&lt;br /&gt;
	data.docTitle = docTitle&lt;br /&gt;
	-- View, display, edit, and purge links if /doc exists.&lt;br /&gt;
	data.viewLinkDisplay = message(&amp;#039;view-link-display&amp;#039;)&lt;br /&gt;
	data.editLinkDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
	data.historyLinkDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
	data.purgeLinkDisplay = message(&amp;#039;purge-link-display&amp;#039;)&lt;br /&gt;
	-- Create link if /doc doesn&amp;#039;t exist.&lt;br /&gt;
	local preload = args.preload&lt;br /&gt;
	if not preload then&lt;br /&gt;
		if subjectSpace == 6 then -- File namespace&lt;br /&gt;
			preload = message(&amp;#039;file-docpage-preload&amp;#039;)&lt;br /&gt;
		elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
			preload = message(&amp;#039;module-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			preload = message(&amp;#039;docpage-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	data.preload = preload&lt;br /&gt;
	data.createLinkDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBoxLinks(data)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the [view][edit][history][purge] or [create] links from the data table.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxLinksData&lt;br /&gt;
	--]]&lt;br /&gt;
	&lt;br /&gt;
	local function escapeBrackets(s)&lt;br /&gt;
		-- Escapes square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%[&amp;#039;, &amp;#039;&amp;amp;#91;&amp;#039;) -- Replace square brackets with HTML entities.&lt;br /&gt;
		s = s:gsub(&amp;#039;%]&amp;#039;, &amp;#039;&amp;amp;#93;&amp;#039;)&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local ret&lt;br /&gt;
	local docTitle = data.docTitle&lt;br /&gt;
	local title = data.title&lt;br /&gt;
	if docTitle.exists then&lt;br /&gt;
		local viewLink = makeWikilink(docTitle.prefixedText, data.viewLinkDisplay)&lt;br /&gt;
		local editLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;}, data.editLinkDisplay)&lt;br /&gt;
		local historyLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;history&amp;#039;}, data.historyLinkDisplay)&lt;br /&gt;
		local purgeLink = makeUrlLink(title:fullUrl{action = &amp;#039;purge&amp;#039;}, data.purgeLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s] [%s] [%s] [%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, viewLink, editLink, historyLink, purgeLink)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = makeUrlLink(docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = data.preload}, data.createLinkDisplay)&lt;br /&gt;
		ret = &amp;#039;[%s]&amp;#039;&lt;br /&gt;
		ret = escapeBrackets(ret)&lt;br /&gt;
		ret = mw.ustring.format(ret, createLink)&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeStartBoxData(args, env, links)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Does initial processing of data to pass to the start-box render function, p.renderStartBox.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- @links - a string containing the [view][edit][history][purge] links - could be nil if there&amp;#039;s an error.&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;documentation-icon-wikitext&amp;#039; --&amp;gt; &amp;#039;[[File:Test Template Info-Icon - Version (2).svg|50px|link=|alt=]]&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Template documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Module documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;file-namespace-heading&amp;#039; --&amp;gt; &amp;#039;Summary&amp;#039;&lt;br /&gt;
	-- &amp;#039;other-namespaces-heading&amp;#039; --&amp;gt; &amp;#039;Documentation&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not subjectSpace then&lt;br /&gt;
		-- Default to an &amp;quot;other namespaces&amp;quot; namespace, so that we get at least some output&lt;br /&gt;
		-- if an error occurs.&lt;br /&gt;
		subjectSpace = 2&lt;br /&gt;
	end&lt;br /&gt;
	local data = {}&lt;br /&gt;
	&lt;br /&gt;
	-- Heading&lt;br /&gt;
	local heading = args.heading -- Blank values are not removed.&lt;br /&gt;
	if heading == &amp;#039;&amp;#039; then&lt;br /&gt;
		-- Don&amp;#039;t display the start box if the heading arg is defined but blank.&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	if heading then&lt;br /&gt;
		data.heading = heading&lt;br /&gt;
	elseif subjectSpace == 10 then -- Template namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;template-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then -- Module namespace&lt;br /&gt;
		data.heading = message(&amp;#039;documentation-icon-wikitext&amp;#039;) .. &amp;#039; &amp;#039; .. message(&amp;#039;module-namespace-heading&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 6 then -- File namespace&lt;br /&gt;
		data.heading = message(&amp;#039;file-namespace-heading&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		data.heading = message(&amp;#039;other-namespaces-heading&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Heading CSS&lt;br /&gt;
	local headingStyle = args[&amp;#039;heading-style&amp;#039;]&lt;br /&gt;
	if headingStyle then&lt;br /&gt;
		data.headingStyleText = headingStyle&lt;br /&gt;
	else&lt;br /&gt;
		-- &amp;#039;documentation-heading&amp;#039;&lt;br /&gt;
		data.headingClass = message(&amp;#039;main-div-heading-class&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Data for the [view][edit][history][purge] or [create] links.&lt;br /&gt;
	if links then&lt;br /&gt;
		-- &amp;#039;mw-editsection-like plainlinks&amp;#039;&lt;br /&gt;
		data.linksClass = message(&amp;#039;start-box-link-classes&amp;#039;)&lt;br /&gt;
		data.links = links&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return data&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.renderStartBox(data)&lt;br /&gt;
	-- Renders the start box html.&lt;br /&gt;
	-- @data - a table of data generated by p.makeStartBoxData.&lt;br /&gt;
	local sbox = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	sbox&lt;br /&gt;
		-- &amp;#039;documentation-startbox&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;start-box-class&amp;#039;))&lt;br /&gt;
		:newline()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.headingClass)&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(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(data.linksClass)&lt;br /&gt;
			:attr(&amp;#039;id&amp;#039;, data.linksId)&lt;br /&gt;
			:wikitext(links)&lt;br /&gt;
	end&lt;br /&gt;
	return tostring(sbox)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Documentation content&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.content = makeInvokeFunc(&amp;#039;_content&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._content(args, env)&lt;br /&gt;
	-- Displays the documentation contents&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	local content = args.content&lt;br /&gt;
	if not content and docTitle and docTitle.exists then&lt;br /&gt;
		content = args._content or mw.getCurrentFrame():expandTemplate{title = docTitle.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 &amp;#039;\n&amp;#039; .. (content or &amp;#039;&amp;#039;) .. &amp;#039;\n&amp;#039; &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.contentTitle = makeInvokeFunc(&amp;#039;_contentTitle&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._contentTitle(args, env)&lt;br /&gt;
	env = env or p.getEnvironment(args)&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not args.content and docTitle and docTitle.exists then&lt;br /&gt;
		return docTitle.prefixedText&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- End box&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
p.endBox = makeInvokeFunc(&amp;#039;_endBox&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._endBox(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- This function generates the end box (also known as the link box).&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	--]=]&lt;br /&gt;
	&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[&amp;#039;link box&amp;#039;]&lt;br /&gt;
	if linkBox == &amp;#039;off&amp;#039;&lt;br /&gt;
		or not (&lt;br /&gt;
			docTitle.exists&lt;br /&gt;
			or subjectSpace == 2&lt;br /&gt;
			or subjectSpace == 828&lt;br /&gt;
			or subjectSpace == 10&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Assemble the link box.&lt;br /&gt;
	local text = &amp;#039;&amp;#039;&lt;br /&gt;
	if linkBox then&lt;br /&gt;
		text = text .. linkBox&lt;br /&gt;
	else&lt;br /&gt;
		text = text .. (p.makeDocPageBlurb(args, env) or &amp;#039;&amp;#039;) -- &amp;quot;This documentation is transcluded from [[Foo]].&amp;quot; &lt;br /&gt;
		if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then&lt;br /&gt;
			-- We are in the user, template or module namespaces.&lt;br /&gt;
			-- Add sandbox and testcases links.&lt;br /&gt;
			-- &amp;quot;Editors can experiment in this template&amp;#039;s sandbox and testcases pages.&amp;quot;&lt;br /&gt;
			text = text .. (p.makeExperimentBlurb(args, env) or &amp;#039;&amp;#039;) .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
			if not args.content and not args[1] then&lt;br /&gt;
				-- &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
				-- Don&amp;#039;t show this message with inline docs or with an explicitly specified doc page,&lt;br /&gt;
				-- as then it is unclear where to add the categories.&lt;br /&gt;
				text = text .. (p.makeCategoriesBlurb(args, env) or &amp;#039;&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
			text = text .. &amp;#039; &amp;#039; .. (p.makeSubpagesBlurb(args, env) or &amp;#039;&amp;#039;) --&amp;quot;Subpages of this template&amp;quot;&lt;br /&gt;
			local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.&lt;br /&gt;
			if printBlurb then&lt;br /&gt;
				text = text .. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039; .. printBlurb&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local box = mw.html.create(&amp;#039;div&amp;#039;)&lt;br /&gt;
	-- &amp;#039;documentation-metadata&amp;#039;&lt;br /&gt;
	box:attr(&amp;#039;role&amp;#039;, &amp;#039;note&amp;#039;)&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-class&amp;#039;))&lt;br /&gt;
		-- &amp;#039;plainlinks&amp;#039;&lt;br /&gt;
		:addClass(message(&amp;#039;end-box-plainlinks&amp;#039;))&lt;br /&gt;
		:wikitext(text)&lt;br /&gt;
		:done()&lt;br /&gt;
&lt;br /&gt;
	return &amp;#039;\n&amp;#039; .. 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;
	-- &amp;#039;edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;history-link-display&amp;#039; --&amp;gt; &amp;#039;history&amp;#039;&lt;br /&gt;
	-- &amp;#039;transcluded-from-blurb&amp;#039; --&amp;gt; &lt;br /&gt;
	-- &amp;#039;The above [[Wikipedia:Template documentation|documentation]] &lt;br /&gt;
	-- is [[Help:Transclusion|transcluded]] from $1.&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;create-module-doc-blurb&amp;#039; --&amp;gt;&lt;br /&gt;
	-- &amp;#039;You might want to $1 a documentation page for this [[Wikipedia:Lua|Scribunto module]].&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local 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 = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local editDisplay = message(&amp;#039;edit-link-display&amp;#039;)&lt;br /&gt;
		local editLink = makeUrlLink(editUrl, editDisplay)&lt;br /&gt;
		local historyUrl = docTitle:fullUrl{action = &amp;#039;history&amp;#039;}&lt;br /&gt;
		local historyDisplay = message(&amp;#039;history-link-display&amp;#039;)&lt;br /&gt;
		local historyLink = makeUrlLink(historyUrl, historyDisplay)&lt;br /&gt;
		ret = message(&amp;#039;transcluded-from-blurb&amp;#039;, {docLink})&lt;br /&gt;
			.. &amp;#039; &amp;#039;&lt;br /&gt;
			.. makeToolbar(editLink, historyLink)&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	elseif env.subjectSpace == 828 then&lt;br /&gt;
		-- /doc does not exist; ask to create it.&lt;br /&gt;
		local createUrl = docTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = message(&amp;#039;module-preload&amp;#039;)}&lt;br /&gt;
		local createDisplay = message(&amp;#039;create-link-display&amp;#039;)&lt;br /&gt;
		local createLink = makeUrlLink(createUrl, createDisplay)&lt;br /&gt;
		ret = message(&amp;#039;create-module-doc-blurb&amp;#039;, {createLink})&lt;br /&gt;
			.. &amp;#039;&amp;lt;br /&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeExperimentBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Renders the text &amp;quot;Editors can experiment in this template&amp;#039;s sandbox (edit | diff) and testcases (edit) pages.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- &lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;compare-link-display&amp;#039; --&amp;gt; &amp;#039;diff&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-edit-summary&amp;#039; --&amp;gt; &amp;#039;Create sandbox version of $1&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-display&amp;#039; --&amp;gt; &amp;#039;mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;mirror-link-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/mirror&amp;#039;&lt;br /&gt;
	-- &amp;#039;sandbox-link-display&amp;#039; --&amp;gt; &amp;#039;sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039;--&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-sandbox-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-sandbox&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-create-link-display&amp;#039; --&amp;gt; &amp;#039;create&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-link-display&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-edit-link-display&amp;#039; --&amp;gt; &amp;#039;edit&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-module-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;template-testcases-preload&amp;#039; --&amp;gt; &amp;#039;Template:Documentation/preload-testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-module&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this module&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	-- &amp;#039;experiment-blurb-template&amp;#039; --&amp;gt; &amp;#039;Editors can experiment in this template&amp;#039;s $1 and $2 pages.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	local sandboxTitle = env.sandboxTitle&lt;br /&gt;
	local testcasesTitle = env.testcasesTitle&lt;br /&gt;
	local templatePage = templateTitle.prefixedText&lt;br /&gt;
	if not subjectSpace or not templateTitle or not sandboxTitle or not testcasesTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Make links.&lt;br /&gt;
	local sandboxLinks, testcasesLinks&lt;br /&gt;
	if sandboxTitle.exists then&lt;br /&gt;
		local sandboxPage = sandboxTitle.prefixedText&lt;br /&gt;
		local sandboxDisplay = message(&amp;#039;sandbox-link-display&amp;#039;)&lt;br /&gt;
		local sandboxLink = makeWikilink(sandboxPage, sandboxDisplay)&lt;br /&gt;
		local sandboxEditUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local sandboxEditDisplay = message(&amp;#039;sandbox-edit-link-display&amp;#039;)&lt;br /&gt;
		local sandboxEditLink = makeUrlLink(sandboxEditUrl, sandboxEditDisplay)&lt;br /&gt;
		local compareUrl = env.compareUrl&lt;br /&gt;
		local compareLink&lt;br /&gt;
		if compareUrl then&lt;br /&gt;
			local compareDisplay = message(&amp;#039;compare-link-display&amp;#039;)&lt;br /&gt;
			compareLink = makeUrlLink(compareUrl, compareDisplay)&lt;br /&gt;
		end&lt;br /&gt;
		sandboxLinks = sandboxLink .. &amp;#039; &amp;#039; .. makeToolbar(sandboxEditLink, compareLink)&lt;br /&gt;
	else&lt;br /&gt;
		local sandboxPreload&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			sandboxPreload = message(&amp;#039;module-sandbox-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			sandboxPreload = message(&amp;#039;template-sandbox-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local sandboxCreateUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = sandboxPreload}&lt;br /&gt;
		local sandboxCreateDisplay = message(&amp;#039;sandbox-create-link-display&amp;#039;)&lt;br /&gt;
		local sandboxCreateLink = makeUrlLink(sandboxCreateUrl, sandboxCreateDisplay)&lt;br /&gt;
		local mirrorSummary = message(&amp;#039;mirror-edit-summary&amp;#039;, {makeWikilink(templatePage)})&lt;br /&gt;
		local mirrorPreload = message(&amp;#039;mirror-link-preload&amp;#039;)&lt;br /&gt;
		local mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = mirrorPreload, summary = mirrorSummary}&lt;br /&gt;
		if subjectSpace == 828 then&lt;br /&gt;
			mirrorUrl = sandboxTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = templateTitle.prefixedText, summary = mirrorSummary}&lt;br /&gt;
		end&lt;br /&gt;
		local mirrorDisplay = message(&amp;#039;mirror-link-display&amp;#039;)&lt;br /&gt;
		local mirrorLink = makeUrlLink(mirrorUrl, mirrorDisplay)&lt;br /&gt;
		sandboxLinks = message(&amp;#039;sandbox-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(sandboxCreateLink, mirrorLink)&lt;br /&gt;
	end&lt;br /&gt;
	if testcasesTitle.exists then&lt;br /&gt;
		local testcasesPage = testcasesTitle.prefixedText&lt;br /&gt;
		local testcasesDisplay = message(&amp;#039;testcases-link-display&amp;#039;)&lt;br /&gt;
		local testcasesLink = makeWikilink(testcasesPage, testcasesDisplay)&lt;br /&gt;
		local testcasesEditUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;}&lt;br /&gt;
		local testcasesEditDisplay = message(&amp;#039;testcases-edit-link-display&amp;#039;)&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(&amp;#039;testcases-run-link-display&amp;#039;)&lt;br /&gt;
			local testcasesRunLink = makeWikilink(testcasesTitle.talkPageTitle.prefixedText, testcasesRunLinkDisplay)&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. makeToolbar(testcasesEditLink, testcasesRunLink)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesLinks = testcasesLink .. &amp;#039; &amp;#039; .. 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(&amp;#039;module-testcases-preload&amp;#039;)&lt;br /&gt;
		else&lt;br /&gt;
			testcasesPreload = message(&amp;#039;template-testcases-preload&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
		local testcasesCreateUrl = testcasesTitle:fullUrl{action = &amp;#039;edit&amp;#039;, preload = testcasesPreload}&lt;br /&gt;
		local testcasesCreateDisplay = message(&amp;#039;testcases-create-link-display&amp;#039;)&lt;br /&gt;
		local testcasesCreateLink = makeUrlLink(testcasesCreateUrl, testcasesCreateDisplay)&lt;br /&gt;
		testcasesLinks = message(&amp;#039;testcases-link-display&amp;#039;) .. &amp;#039; &amp;#039; .. makeToolbar(testcasesCreateLink)&lt;br /&gt;
	end&lt;br /&gt;
	local messageName&lt;br /&gt;
	if subjectSpace == 828 then&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-module&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		messageName = &amp;#039;experiment-blurb-template&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return message(messageName, {sandboxLinks, testcasesLinks})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeCategoriesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the text &amp;quot;Please add categories to the /doc subpage.&amp;quot;&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;doc-link-display&amp;#039; --&amp;gt; &amp;#039;/doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;add-categories-blurb&amp;#039; --&amp;gt; &amp;#039;Please add categories to the $1 subpage.&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local docTitle = env.docTitle&lt;br /&gt;
	if not docTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local docPathLink = makeWikilink(docTitle.prefixedText, message(&amp;#039;doc-link-display&amp;#039;))&lt;br /&gt;
	return message(&amp;#039;add-categories-blurb&amp;#039;, {docPathLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makeSubpagesBlurb(args, env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Generates the &amp;quot;Subpages of this template&amp;quot; link.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;template-pagetype&amp;#039; --&amp;gt; &amp;#039;template&amp;#039;&lt;br /&gt;
	-- &amp;#039;module-pagetype&amp;#039; --&amp;gt; &amp;#039;module&amp;#039;&lt;br /&gt;
	-- &amp;#039;default-pagetype&amp;#039; --&amp;gt; &amp;#039;page&amp;#039;&lt;br /&gt;
	-- &amp;#039;subpages-link-display&amp;#039; --&amp;gt; &amp;#039;Subpages of this $1&amp;#039;&lt;br /&gt;
	--]]&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	local templateTitle = env.templateTitle&lt;br /&gt;
	if not subjectSpace or not templateTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local pagetype&lt;br /&gt;
	if subjectSpace == 10 then&lt;br /&gt;
		pagetype = message(&amp;#039;template-pagetype&amp;#039;)&lt;br /&gt;
	elseif subjectSpace == 828 then&lt;br /&gt;
		pagetype = message(&amp;#039;module-pagetype&amp;#039;)&lt;br /&gt;
	else&lt;br /&gt;
		pagetype = message(&amp;#039;default-pagetype&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	local subpagesLink = makeWikilink(&lt;br /&gt;
		&amp;#039;Special:PrefixIndex/&amp;#039; .. templateTitle.prefixedText .. &amp;#039;/&amp;#039;,&lt;br /&gt;
		message(&amp;#039;subpages-link-display&amp;#039;, {pagetype})&lt;br /&gt;
	)&lt;br /&gt;
	return message(&amp;#039;subpages-blurb&amp;#039;, {subpagesLink})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.makePrintBlurb(args, env)&lt;br /&gt;
	--[=[&lt;br /&gt;
	-- Generates the blurb displayed when there is a print version of the template available.&lt;br /&gt;
	-- @args - a table of arguments passed by the user&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	--&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;print-link-display&amp;#039; --&amp;gt; &amp;#039;/Print&amp;#039;&lt;br /&gt;
	-- &amp;#039;print-blurb&amp;#039; --&amp;gt; &amp;#039;A [[Help:Books/for experts#Improving the book layout|print version]]&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; of this template exists at $1.&amp;#039;&lt;br /&gt;
	--		.. &amp;#039; If you make a change to this template, please update the print version as well.&amp;#039;&lt;br /&gt;
	-- &amp;#039;display-print-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;print-category&amp;#039; --&amp;gt; &amp;#039;Templates with print versions&amp;#039;&lt;br /&gt;
	--]=]&lt;br /&gt;
	local printTitle = env.printTitle&lt;br /&gt;
	if not printTitle then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local ret&lt;br /&gt;
	if printTitle.exists then&lt;br /&gt;
		local printLink = makeWikilink(printTitle.prefixedText, message(&amp;#039;print-link-display&amp;#039;))&lt;br /&gt;
		ret = message(&amp;#039;print-blurb&amp;#039;, {printLink})&lt;br /&gt;
		local displayPrintCategory = message(&amp;#039;display-print-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		if displayPrintCategory then&lt;br /&gt;
			ret = ret .. makeCategoryLink(message(&amp;#039;print-category&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
-- Tracking categories&lt;br /&gt;
----------------------------------------------------------------------------&lt;br /&gt;
&lt;br /&gt;
function p.addTrackingCategories(env)&lt;br /&gt;
	--[[&lt;br /&gt;
	-- Check if {{documentation}} is transcluded on a /doc or /testcases page.&lt;br /&gt;
	-- @env - environment table containing title objects, etc., generated with p.getEnvironment&lt;br /&gt;
	&lt;br /&gt;
	-- Messages:&lt;br /&gt;
	-- &amp;#039;display-strange-usage-category&amp;#039; --&amp;gt; true&lt;br /&gt;
	-- &amp;#039;doc-subpage&amp;#039; --&amp;gt; &amp;#039;doc&amp;#039;&lt;br /&gt;
	-- &amp;#039;testcases-subpage&amp;#039; --&amp;gt; &amp;#039;testcases&amp;#039;&lt;br /&gt;
	-- &amp;#039;strange-usage-category&amp;#039; --&amp;gt; &amp;#039;Wikipedia pages with strange ((documentation)) usage&amp;#039;&lt;br /&gt;
	-- &lt;br /&gt;
	-- /testcases pages in the module namespace are not categorised, as they may have&lt;br /&gt;
	-- {{documentation}} transcluded automatically.&lt;br /&gt;
	--]]&lt;br /&gt;
	local title = env.title&lt;br /&gt;
	local subjectSpace = env.subjectSpace&lt;br /&gt;
	if not title or not subjectSpace then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local subpage = title.subpageText&lt;br /&gt;
	local ret = &amp;#039;&amp;#039;&lt;br /&gt;
	if message(&amp;#039;display-strange-usage-category&amp;#039;, nil, &amp;#039;boolean&amp;#039;)&lt;br /&gt;
		and (&lt;br /&gt;
			subpage == message(&amp;#039;doc-subpage&amp;#039;)&lt;br /&gt;
			or subjectSpace ~= 828 and subpage == message(&amp;#039;testcases-subpage&amp;#039;)&lt;br /&gt;
		)&lt;br /&gt;
	then&lt;br /&gt;
		ret = ret .. makeCategoryLink(message(&amp;#039;strange-usage-category&amp;#039;))&lt;br /&gt;
	end&lt;br /&gt;
	return ret&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1937</id>
		<title>Template:In5</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1937"/>
				<updated>2021-06-23T15:04:58Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:in5|in5|1={{{1|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 {{Documentation}} &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Category:Smart formatting templates|In5]]--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1936</id>
		<title>Template:In5</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1936"/>
				<updated>2021-06-23T15:04:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:in5|in5|1={{{1|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- {{Documentation}} !--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Category:Smart formatting templates|In5]]--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1935</id>
		<title>Template:In5</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Template:In5&amp;diff=1935"/>
				<updated>2021-06-23T15:01:36Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:in5|in5|1={{{1|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;  {{Documentation}}  &amp;lt;!--In5--&amp;gt; &amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{{{{|safesubst:}}}#invoke:in5|in5|1={{{1|}}}}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--[[Category:Smart formatting templates|In5]]--&amp;gt;&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1934</id>
		<title>File:Semi-protection-shackle.svg</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1934"/>
				<updated>2021-06-23T14:59:47Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Jawitkien uploaded a new version of File:Semi-protection-shackle.svg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1933</id>
		<title>File:Semi-protection-shackle.svg</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1933"/>
				<updated>2021-06-23T14:59:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Jawitkien uploaded a new version of File:Semi-protection-shackle.svg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1932</id>
		<title>File:Semi-protection-shackle.svg</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=File:Semi-protection-shackle.svg&amp;diff=1932"/>
				<updated>2021-06-23T14:59:40Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:In5/doc&amp;diff=1931</id>
		<title>Module:In5/doc</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:In5/doc&amp;diff=1931"/>
				<updated>2021-06-23T14:53:20Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;{{module rating|alpha}}  This is a Lua implementation of the {{tl|in5}} template. Please see the template page for documentation.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{module rating|alpha}}&lt;br /&gt;
&lt;br /&gt;
This is a Lua implementation of the {{tl|in5}} template. Please see the template page for documentation.&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:In5&amp;diff=1930</id>
		<title>Module:In5</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:In5&amp;diff=1930"/>
				<updated>2021-06-23T14:52:34Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;-- This module implements {{in5}}.  local p = {}  function p.in5(frame)     local indent = frame.args[1]     -- Trim whitespace and convert to number. Default to 5 if not pres...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;-- This module implements {{in5}}.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.in5(frame)&lt;br /&gt;
    local indent = frame.args[1]&lt;br /&gt;
    -- Trim whitespace and convert to number. Default to 5 if not present,&lt;br /&gt;
    -- as per the template title.&lt;br /&gt;
    indent = tonumber( mw.text.trim(indent) ) or 5&lt;br /&gt;
    -- Round down to nearest integer. Decimal values produce funky results&lt;br /&gt;
    -- from the original template, but there&amp;#039;s no need for us to replicate that.&lt;br /&gt;
    indent = math.floor( indent )&lt;br /&gt;
    -- Don&amp;#039;t output anything for zero or less. Again, there was some funky output&lt;br /&gt;
    -- here for negatives, but now we&amp;#039;re in Lua we should use sane defaults.&lt;br /&gt;
    if indent &amp;lt;= 0 then&lt;br /&gt;
        return&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local base = &amp;#039;&amp;amp;nbsp; &amp;#039;&lt;br /&gt;
    local modulo = &amp;#039;&amp;amp;nbsp;&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
--[[&lt;br /&gt;
    Indent values and the corresponding values for base and modulo:&lt;br /&gt;
&lt;br /&gt;
    indent  base    modulo&lt;br /&gt;
    1       0       1&lt;br /&gt;
    2       0       2&lt;br /&gt;
    3       1       1&lt;br /&gt;
    4       1       2&lt;br /&gt;
    5       2       1&lt;br /&gt;
    6       2       2&lt;br /&gt;
    7       3       1&lt;br /&gt;
    8       3       2&lt;br /&gt;
    9       4       1&lt;br /&gt;
    10      4       2&lt;br /&gt;
]]&lt;br /&gt;
    &lt;br /&gt;
    local baseNum = math.floor( (indent - 1) / 2 )&lt;br /&gt;
    local modNum = math.fmod( indent - 1 , 2 ) + 1&lt;br /&gt;
    &lt;br /&gt;
    return mw.ustring.rep( base, baseNum) .. mw.ustring.rep( modulo, modNum )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Arguments/doc&amp;diff=1929</id>
		<title>Module:Arguments/doc</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Arguments/doc&amp;diff=1929"/>
				<updated>2021-06-23T14:50:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Used in system}}&lt;br /&gt;
{{Module rating|p}}&lt;br /&gt;
&lt;br /&gt;
This module provides easy processing of arguments passed from #invoke. It is a meta-module, meant for use by other modules, and should not be called from #invoke directly. Its features include:&lt;br /&gt;
* Easy trimming of arguments and removal of blank arguments.&lt;br /&gt;
* Arguments can be passed by both the current frame and by the parent frame at the same time. (More details below.)&lt;br /&gt;
* Arguments can be passed in directly from another Lua module or from the debug console.&lt;br /&gt;
* Most features can be customized.&lt;br /&gt;
&lt;br /&gt;
== Basic use ==&lt;br /&gt;
&lt;br /&gt;
First, you need to load the module. It contains one function, named &amp;lt;code&amp;gt;getArgs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In the most basic scenario, you can use getArgs inside your main function. The variable &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; is a table containing the arguments from #invoke. (See below for details.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	-- Main module code goes here.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, the recommended practice is to use a function just for processing arguments from #invoke. This means that if someone calls your module from another Lua module you don&amp;#039;t have to have a frame object available, which improves performance.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	-- Main module code goes here.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want multiple functions to use the arguments, and you also want them to be accessible from #invoke, you can use a wrapper function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
&lt;br /&gt;
local p = {}&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;
		return p[funcName](args)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.func1 = makeInvokeFunc(&amp;#039;_func1&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._func1(args)&lt;br /&gt;
	-- Code for the first function goes here.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
p.func2 = makeInvokeFunc(&amp;#039;_func2&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p._func2(args)&lt;br /&gt;
	-- Code for the second function goes here.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Options ===&lt;br /&gt;
&lt;br /&gt;
The following options are available. They are explained in the sections below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	trim = false,&lt;br /&gt;
	removeBlanks = false,&lt;br /&gt;
	valueFunc = function (key, value)&lt;br /&gt;
		-- Code for processing one argument&lt;br /&gt;
	end,&lt;br /&gt;
	frameOnly = true,&lt;br /&gt;
	parentOnly = true,&lt;br /&gt;
	parentFirst = true,&lt;br /&gt;
	wrappers = {&lt;br /&gt;
		&amp;#039;Template:A wrapper template&amp;#039;,&lt;br /&gt;
		&amp;#039;Template:Another wrapper template&amp;#039;&lt;br /&gt;
	},&lt;br /&gt;
	readOnly = true,&lt;br /&gt;
	noOverwrite = true&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Trimming and removing blanks ===&lt;br /&gt;
&lt;br /&gt;
Blank arguments often trip up coders new to converting MediaWiki templates to Lua. In template syntax, blank strings and strings consisting only of whitespace are considered false. However, in Lua, blank strings and strings consisting of whitespace are considered true. This means that if you don&amp;#039;t pay attention to such arguments when you write your Lua modules, you might treat something as true that should actually be treated as false. To avoid this, by default this module removes all blank arguments.&lt;br /&gt;
&lt;br /&gt;
Similarly, whitespace can cause problems when dealing with positional arguments. Although whitespace is trimmed for named arguments coming from #invoke, it is preserved for positional arguments. Most of the time this additional whitespace is not desired, so this module trims it off by default.&lt;br /&gt;
&lt;br /&gt;
However, sometimes you want to use blank arguments as input, and sometimes you want to keep additional whitespace. This can be necessary to convert some templates exactly as they were written. If you want to do this, you can set the &amp;lt;code&amp;gt;trim&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;removeBlanks&amp;lt;/code&amp;gt; arguments to &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	trim = false,&lt;br /&gt;
	removeBlanks = false&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Custom formatting of arguments ===&lt;br /&gt;
&lt;br /&gt;
Sometimes you want to remove some blank arguments but not others, or perhaps you might want to put all of the positional arguments in lower case. To do things like this you can use the &amp;lt;code&amp;gt;valueFunc&amp;lt;/code&amp;gt; option. The input to this option must be a function that takes two parameters, &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, and returns a single value. This value is what you will get when you access the field &amp;lt;code&amp;gt;key&amp;lt;/code&amp;gt; in the &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; table.&lt;br /&gt;
&lt;br /&gt;
Example 1: this function preserves whitespace for the first positional argument, but trims all other arguments and removes all other blank arguments.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	valueFunc = function (key, value)&lt;br /&gt;
		if key == 1 then&lt;br /&gt;
			return value&lt;br /&gt;
		elseif value then&lt;br /&gt;
			value = mw.text.trim(value)&lt;br /&gt;
			if value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				return value&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2: this function removes blank arguments and converts all arguments to lower case, but doesn&amp;#039;t trim whitespace from positional parameters.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	valueFunc = function (key, value)&lt;br /&gt;
		if not value then&lt;br /&gt;
			return nil&lt;br /&gt;
		end&lt;br /&gt;
		value = mw.ustring.lower(value)&lt;br /&gt;
		if mw.ustring.find(value, &amp;#039;%S&amp;#039;) then&lt;br /&gt;
			return value&lt;br /&gt;
		end&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: the above functions will fail if passed input that is not of type &amp;lt;code&amp;gt;string&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;nil&amp;lt;/code&amp;gt;. This might be the case if you use the &amp;lt;code&amp;gt;getArgs&amp;lt;/code&amp;gt; function in the main function of your module, and that function is called by another Lua module. In this case, you will need to check the type of your input. This is not a problem if you are using a function specially for arguments from #invoke (i.e. you have &amp;lt;code&amp;gt;p.main&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;p._main&amp;lt;/code&amp;gt; functions, or something similar).&lt;br /&gt;
&lt;br /&gt;
{{cot|Examples 1 and 2 with type checking}}&lt;br /&gt;
Example 1:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	valueFunc = function (key, value)&lt;br /&gt;
		if key == 1 then&lt;br /&gt;
			return value&lt;br /&gt;
		elseif type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
			value = mw.text.trim(value)&lt;br /&gt;
			if value ~= &amp;#039;&amp;#039; then&lt;br /&gt;
				return value&lt;br /&gt;
			else&lt;br /&gt;
				return nil&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example 2:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	valueFunc = function (key, value)&lt;br /&gt;
		if type(value) == &amp;#039;string&amp;#039; then&lt;br /&gt;
			value = mw.ustring.lower(value)&lt;br /&gt;
			if mw.ustring.find(value, &amp;#039;%S&amp;#039;) then&lt;br /&gt;
				return value&lt;br /&gt;
			else&lt;br /&gt;
				return nil&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			return value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{cob}}&lt;br /&gt;
&lt;br /&gt;
Also, please note that the &amp;lt;code&amp;gt;valueFunc&amp;lt;/code&amp;gt; function is called more or less every time an argument is requested from the &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; table, so if you care about performance you should make sure you aren&amp;#039;t doing anything inefficient with your code.&lt;br /&gt;
&lt;br /&gt;
=== Frames and parent frames ===&lt;br /&gt;
&lt;br /&gt;
Arguments in the &amp;lt;code&amp;gt;args&amp;lt;/code&amp;gt; table can be passed from the current frame or from its parent frame at the same time. To understand what this means, it is easiest to give an example. Let&amp;#039;s say that we have a module called &amp;lt;code&amp;gt;Module:ExampleArgs&amp;lt;/code&amp;gt;. This module prints the first two positional arguments that it is passed.&lt;br /&gt;
&lt;br /&gt;
{{cot|Module:ExampleArgs code}}&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local first = args[1] or &amp;#039;&amp;#039;&lt;br /&gt;
	local second = args[2] or &amp;#039;&amp;#039;&lt;br /&gt;
	return first .. &amp;#039; &amp;#039; .. second&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
{{cob}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Module:ExampleArgs&amp;lt;/code&amp;gt; is then called by &amp;lt;code&amp;gt;Template:ExampleArgs&amp;lt;/code&amp;gt;, which contains the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:ExampleArgs|main|firstInvokeArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. This produces the result &amp;quot;firstInvokeArg&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Now if we were to call &amp;lt;code&amp;gt;Template:ExampleArgs&amp;lt;/code&amp;gt;, the following would happen:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50em; max-width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 60%;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;width: 40%;&amp;quot; | Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg|secondTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg secondTemplateArg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
There are three options you can set to change this behaviour: &amp;lt;code&amp;gt;frameOnly&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;parentOnly&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;parentFirst&amp;lt;/code&amp;gt;. If you set &amp;lt;code&amp;gt;frameOnly&amp;lt;/code&amp;gt; then only arguments passed from the current frame will be accepted; if you set &amp;lt;code&amp;gt;parentOnly&amp;lt;/code&amp;gt; then only arguments passed from the parent frame will be accepted; and if you set &amp;lt;code&amp;gt;parentFirst&amp;lt;/code&amp;gt; then arguments will be passed from both the current and parent frames, but the parent frame will have priority over the current frame. Here are the results in terms of &amp;lt;code&amp;gt;Template:ExampleArgs&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
; frameOnly&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50em; max-width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 60%;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;width: 40%;&amp;quot; | Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg|secondTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
; parentOnly&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50em; max-width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 60%;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;width: 40%;&amp;quot; | Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstTemplateArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg|secondTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstTemplateArg secondTemplateArg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
; parentFirst&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;width: 50em; max-width: 100%;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;width: 60%;&amp;quot; | Code&lt;br /&gt;
! style=&amp;quot;width: 40%;&amp;quot; | Result&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstInvokeArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstTemplateArg&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{ExampleArgs|firstTemplateArg|secondTemplateArg}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
| firstTemplateArg secondTemplateArg&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# If you set both the &amp;lt;code&amp;gt;frameOnly&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;parentOnly&amp;lt;/code&amp;gt; options, the module won&amp;#039;t fetch any arguments at all from #invoke. This is probably not what you want.&lt;br /&gt;
# In some situations a parent frame may not be available, e.g. if getArgs is passed the parent frame rather than the current frame. In this case, only the frame arguments will be used (unless parentOnly is set, in which case no arguments will be used) and the &amp;lt;code&amp;gt;parentFirst&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;frameOnly&amp;lt;/code&amp;gt; options will have no effect.&lt;br /&gt;
&lt;br /&gt;
=== Wrappers ===&lt;br /&gt;
&lt;br /&gt;
The &amp;#039;&amp;#039;wrappers&amp;#039;&amp;#039; option is used to specify a limited number of templates as &amp;#039;&amp;#039;wrapper templates&amp;#039;&amp;#039;, that is, templates whose only purpose is to call a module. If the module detects that it is being called from a wrapper template, it will only check for arguments in the parent frame; otherwise it will only check for arguments in the frame passed to getArgs. This allows modules to be called by either #invoke or through a wrapper template without the loss of performance associated with having to check both the frame and the parent frame for each argument lookup.&lt;br /&gt;
&lt;br /&gt;
For example, the only content of [[Template:Side box]] (excluding content in {{tag|noinclude}} tags) is &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Side box|main}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. There is no point in checking the arguments passed directly to the #invoke statement for this template, as no arguments will ever be specified there. We can avoid checking arguments passed to #invoke by using the &amp;#039;&amp;#039;parentOnly&amp;#039;&amp;#039; option, but if we do this then #invoke will not work from other pages either. If this were the case, the {{para|text|Some text}} in the code &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Side box|main|text=Some text}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; would be ignored completely, no matter what page it was used from. By using the &amp;lt;code&amp;gt;wrappers&amp;lt;/code&amp;gt; option to specify &amp;#039;Template:Side box&amp;#039; as a wrapper, we can make &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;{{#invoke:Side box|main|text=Some text}}&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; work from most pages, while still not requiring that the module check for arguments on the [[Template:Side box]] page itself.&lt;br /&gt;
&lt;br /&gt;
Wrappers can be specified either as a string, or as an array of strings.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	wrappers = &amp;#039;Template:Wrapper template&amp;#039;&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local args = getArgs(frame, {&lt;br /&gt;
	wrappers = {&lt;br /&gt;
		&amp;#039;Template:Wrapper 1&amp;#039;,&lt;br /&gt;
		&amp;#039;Template:Wrapper 2&amp;#039;,&lt;br /&gt;
		-- Any number of wrapper templates can be added here.&lt;br /&gt;
	}&lt;br /&gt;
})&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
# The module will automatically detect if it is being called from a wrapper template&amp;#039;s /sandbox subpage, so there is no need to specify sandbox pages explicitly.&lt;br /&gt;
# The &amp;#039;&amp;#039;wrappers&amp;#039;&amp;#039; option effectively changes the default of the &amp;#039;&amp;#039;frameOnly&amp;#039;&amp;#039; and &amp;#039;&amp;#039;parentOnly&amp;#039;&amp;#039; options. If, for example, &amp;#039;&amp;#039;parentOnly&amp;#039;&amp;#039; were explicitly set to false with &amp;#039;&amp;#039;wrappers&amp;#039;&amp;#039; set, calls via wrapper templates would result in both frame and parent arguments being loaded, though calls not via wrapper templates would result in only frame arguments being loaded.&lt;br /&gt;
# If the &amp;#039;&amp;#039;wrappers&amp;#039;&amp;#039; option is set and no parent frame is available, the module will always get the arguments from the frame passed to &amp;lt;code&amp;gt;getArgs&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Writing to the args table ===&lt;br /&gt;
&lt;br /&gt;
Sometimes it can be useful to write new values to the args table. This is possible with the default settings of this module. (However, bear in mind that it is usually better coding style to create a new table with your new values and copy arguments from the args table as needed.)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
args.foo = &amp;#039;some value&amp;#039;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is possible to alter this behaviour with the &amp;lt;code&amp;gt;readOnly&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;noOverwrite&amp;lt;/code&amp;gt; options. If &amp;lt;code&amp;gt;readOnly&amp;lt;/code&amp;gt; is set then it is not possible to write any values to the args table at all. If &amp;lt;code&amp;gt;noOverwrite&amp;lt;/code&amp;gt; is set, then it is possible to add new values to the table, but it is not possible to add a value if it would overwrite any arguments that are passed from #invoke.&lt;br /&gt;
&lt;br /&gt;
=== Ref tags ===&lt;br /&gt;
&lt;br /&gt;
This module uses [[mw:Extension:Scribunto/Lua reference manual#Metatables|metatables]] to fetch arguments from #invoke. This allows access to both the frame arguments and the parent frame arguments without using the &amp;lt;code&amp;gt;pairs()&amp;lt;/code&amp;gt; function. This can help if your module might be passed {{tag|ref}} tags as input.&lt;br /&gt;
&lt;br /&gt;
As soon as {{tag|ref}} tags are accessed from Lua, they are processed by the MediaWiki software and the reference will appear in the reference list at the bottom of the article. If your module proceeds to omit the reference tag from the output, you will end up with a phantom reference – a reference that appears in the reference list but without any number linking to it. This has been a problem with modules that use &amp;lt;code&amp;gt;pairs()&amp;lt;/code&amp;gt; to detect whether to use the arguments from the frame or the parent frame, as those modules automatically process every available argument.&lt;br /&gt;
&lt;br /&gt;
This module solves this problem by allowing access to both frame and parent frame arguments, while still only fetching those arguments when it is necessary. The problem will still occur if you use &amp;lt;code&amp;gt;pairs(args)&amp;lt;/code&amp;gt; elsewhere in your module, however.&lt;br /&gt;
&lt;br /&gt;
=== Known limitations ===&lt;br /&gt;
&lt;br /&gt;
The use of metatables also has its downsides. Most of the normal Lua table tools won&amp;#039;t work properly on the args table, including the &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; operator, the &amp;lt;code&amp;gt;next()&amp;lt;/code&amp;gt; function, and the functions in the table library. If using these is important for your module, you should use your own argument processing function instead of this module.&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
[[Category:Lua metamodules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Lang-zh/doc&amp;diff=1928</id>
		<title>Module:Lang-zh/doc</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Lang-zh/doc&amp;diff=1928"/>
				<updated>2021-06-23T14:46:41Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;{{module rating|protected}} {{Lua|Module:Arguments|Module:No globals}}  == Usage ==  This is the module for the template {{tl|Lang-zh}}. Its main features are described on tha...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{module rating|protected}}&lt;br /&gt;
{{Lua|Module:Arguments|Module:No globals}}&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
This is the module for the template {{tl|Lang-zh}}. Its main features are described on that template&amp;#039;s [[Template:Lang-zh/doc|documentation page]], refer to that for how to use it in articles. This documentation describes some particular features of the module.&lt;br /&gt;
&lt;br /&gt;
The first table in the module lists the articles in which the template will put traditional Chinese first. Add articles to this list in the same fashion (the order doesn&amp;#039;t matter) to include them. If you cannot edit the module because its protected use the {{tl|edit template-protected}} template on its talk page to request a change.&lt;br /&gt;
&lt;br /&gt;
===Use from other modules===&lt;br /&gt;
&lt;br /&gt;
The module can be called directly from another module as well as a template. To do this first load the module&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local Zh = require(&amp;quot;Module:Lang-zh&amp;quot;)._Zh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then call it as follows, with the arguments in a table&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
local output = Zh{[&amp;quot;c&amp;quot;] = &amp;quot;中国&amp;quot;, [&amp;quot;p&amp;quot;] = &amp;quot;zhōngguó&amp;quot;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Tracking categories==&lt;br /&gt;
* {{Category link with count|Articles containing Chinese-language text}}&lt;br /&gt;
* {{Category link with count|Articles containing simplified Chinese-language text}}&lt;br /&gt;
* {{Category link with count|Articles containing traditional Chinese-language text}}&lt;br /&gt;
* {{Category link with count|Pages using template Zh with sup tags}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
[[Category:Modules that add a tracking category]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Module:Lang-zh&amp;diff=1927</id>
		<title>Module:Lang-zh</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Module:Lang-zh&amp;diff=1927"/>
				<updated>2021-06-23T14:45:37Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;require(&amp;#039;Module:No globals&amp;#039;)  local p = {}  -- articles in which traditional Chinese preceeds simplified Chinese local t1st = { 	[&amp;quot;228 Incident&amp;quot;] = true, 	[&amp;quot;Chinese calendar&amp;quot;]...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;require(&amp;#039;Module:No globals&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- articles in which traditional Chinese preceeds simplified Chinese&lt;br /&gt;
local t1st = {&lt;br /&gt;
	[&amp;quot;228 Incident&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Chinese calendar&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Lippo Centre, Hong Kong&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Republic of China&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Republic of China at the 1924 Summer Olympics&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Taiwan&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Taiwan (island)&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Taiwan Province&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;Wei Boyang&amp;quot;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- the labels for each part &lt;br /&gt;
local labels = {&lt;br /&gt;
	[&amp;quot;c&amp;quot;] = &amp;quot;Chinese&amp;quot;,&lt;br /&gt;
	[&amp;quot;s&amp;quot;] = &amp;quot;simplified Chinese&amp;quot;,&lt;br /&gt;
	[&amp;quot;t&amp;quot;] = &amp;quot;traditional Chinese&amp;quot;,&lt;br /&gt;
	[&amp;quot;p&amp;quot;] = &amp;quot;pinyin&amp;quot;,&lt;br /&gt;
	[&amp;quot;tp&amp;quot;] = &amp;quot;Tongyong Pinyin&amp;quot;,&lt;br /&gt;
	[&amp;quot;w&amp;quot;] = &amp;quot;Wade–Giles&amp;quot;,&lt;br /&gt;
	[&amp;quot;j&amp;quot;] = &amp;quot;Jyutping&amp;quot;,&lt;br /&gt;
	[&amp;quot;cy&amp;quot;] = &amp;quot;Cantonese Yale&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = &amp;quot;Sidney Lau&amp;quot;,&lt;br /&gt;
	[&amp;quot;poj&amp;quot;] = &amp;quot;Pe̍h-ōe-jī&amp;quot;,&lt;br /&gt;
	[&amp;quot;zhu&amp;quot;] = &amp;quot;Zhuyin Fuhao&amp;quot;,&lt;br /&gt;
	[&amp;quot;l&amp;quot;] = &amp;quot;lit.&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- article titles for wikilinks for each part&lt;br /&gt;
local wlinks = {&lt;br /&gt;
	[&amp;quot;c&amp;quot;] = &amp;quot;Chinese language&amp;quot;,&lt;br /&gt;
	[&amp;quot;s&amp;quot;] = &amp;quot;simplified Chinese characters&amp;quot;,&lt;br /&gt;
	[&amp;quot;t&amp;quot;] = &amp;quot;traditional Chinese characters&amp;quot;,&lt;br /&gt;
	[&amp;quot;p&amp;quot;] = &amp;quot;pinyin&amp;quot;,&lt;br /&gt;
	[&amp;quot;tp&amp;quot;] = &amp;quot;Tongyong Pinyin&amp;quot;,&lt;br /&gt;
	[&amp;quot;w&amp;quot;] = &amp;quot;Wade–Giles&amp;quot;,&lt;br /&gt;
	[&amp;quot;j&amp;quot;] = &amp;quot;Jyutping&amp;quot;,&lt;br /&gt;
	[&amp;quot;cy&amp;quot;] = &amp;quot;Yale romanization of Cantonese&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = &amp;quot;Sidney Lau romanisation&amp;quot;,&lt;br /&gt;
	[&amp;quot;poj&amp;quot;] = &amp;quot;Pe̍h-ōe-jī&amp;quot;,&lt;br /&gt;
	[&amp;quot;zhu&amp;quot;] = &amp;quot;Bopomofo&amp;quot;,&lt;br /&gt;
	[&amp;quot;l&amp;quot;] = &amp;quot;Literal translation&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- for those parts which are to be treated as languages their ISO code&lt;br /&gt;
local ISOlang = {&lt;br /&gt;
	[&amp;quot;c&amp;quot;] = &amp;quot;zh&amp;quot;,&lt;br /&gt;
	[&amp;quot;t&amp;quot;] = &amp;quot;zh-Hant&amp;quot;,&lt;br /&gt;
	[&amp;quot;s&amp;quot;] = &amp;quot;zh-Hans&amp;quot;,&lt;br /&gt;
	[&amp;quot;p&amp;quot;] = &amp;quot;zh-Latn-pinyin&amp;quot;,&lt;br /&gt;
	[&amp;quot;tp&amp;quot;] = &amp;quot;zh-Latn&amp;quot;,&lt;br /&gt;
	[&amp;quot;w&amp;quot;] = &amp;quot;zh-Latn-wadegile&amp;quot;,&lt;br /&gt;
	[&amp;quot;j&amp;quot;] = &amp;quot;yue-Latn-jyutping&amp;quot;,&lt;br /&gt;
	[&amp;quot;cy&amp;quot;] = &amp;quot;yue-Latn&amp;quot;,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = &amp;quot;yue-Latn&amp;quot;,&lt;br /&gt;
	[&amp;quot;poj&amp;quot;] = &amp;quot;nan-Latn&amp;quot;,&lt;br /&gt;
	[&amp;quot;zhu&amp;quot;] = &amp;quot;zh-Bopo&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local italic = {&lt;br /&gt;
	[&amp;quot;p&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;tp&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;w&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;j&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;cy&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;poj&amp;quot;] = true,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local superscript = {&lt;br /&gt;
	[&amp;quot;w&amp;quot;] = true,&lt;br /&gt;
	[&amp;quot;sl&amp;quot;] = true,&lt;br /&gt;
}&lt;br /&gt;
-- Categories for different kinds of Chinese text&lt;br /&gt;
local cats = {&lt;br /&gt;
	[&amp;quot;c&amp;quot;] = &amp;quot;[[Category:Articles containing Chinese-language text]]&amp;quot;,&lt;br /&gt;
	[&amp;quot;s&amp;quot;] = &amp;quot;[[Category:Articles containing simplified Chinese-language text]]&amp;quot;,&lt;br /&gt;
	[&amp;quot;t&amp;quot;] = &amp;quot;[[Category:Articles containing traditional Chinese-language text]]&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function p.Zh(frame)&lt;br /&gt;
	-- load arguments module to simplify handling of args&lt;br /&gt;
	local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs&lt;br /&gt;
	&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	return p._Zh(args)&lt;br /&gt;
end&lt;br /&gt;
	&lt;br /&gt;
function p._Zh(args)&lt;br /&gt;
	local uselinks = not (args[&amp;quot;links&amp;quot;] == &amp;quot;no&amp;quot;) -- whether to add links&lt;br /&gt;
	local uselabels = not (args[&amp;quot;labels&amp;quot;] == &amp;quot;no&amp;quot;) -- whether to have labels&lt;br /&gt;
	local capfirst = args[&amp;quot;scase&amp;quot;] ~= nil&lt;br /&gt;
 &lt;br /&gt;
	local t1 = false -- whether traditional Chinese characters go first&lt;br /&gt;
	local j1 = false -- whether Cantonese Romanisations go first&lt;br /&gt;
	local testChar&lt;br /&gt;
	if (args[&amp;quot;first&amp;quot;]) then&lt;br /&gt;
	 	 for testChar in mw.ustring.gmatch(args[&amp;quot;first&amp;quot;], &amp;quot;%a+&amp;quot;) do&lt;br /&gt;
			if (testChar == &amp;quot;t&amp;quot;) then&lt;br /&gt;
				t1 = true&lt;br /&gt;
			 end&lt;br /&gt;
			if (testChar == &amp;quot;j&amp;quot;) then&lt;br /&gt;
				j1 = true&lt;br /&gt;
			 end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if (t1 == false) then&lt;br /&gt;
		local title = mw.title.getCurrentTitle()&lt;br /&gt;
		t1 = t1st[title.text] == true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- based on setting/preference specify order&lt;br /&gt;
	local orderlist = {&amp;quot;c&amp;quot;, &amp;quot;s&amp;quot;, &amp;quot;t&amp;quot;, &amp;quot;p&amp;quot;, &amp;quot;tp&amp;quot;, &amp;quot;w&amp;quot;, &amp;quot;j&amp;quot;, &amp;quot;cy&amp;quot;, &amp;quot;sl&amp;quot;, &amp;quot;poj&amp;quot;, &amp;quot;zhu&amp;quot;, &amp;quot;l&amp;quot;}&lt;br /&gt;
	if (t1) then&lt;br /&gt;
		orderlist[2] = &amp;quot;t&amp;quot;&lt;br /&gt;
		orderlist[3] = &amp;quot;s&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	if (j1) then&lt;br /&gt;
		orderlist[4] = &amp;quot;j&amp;quot;&lt;br /&gt;
		orderlist[5] = &amp;quot;cy&amp;quot;&lt;br /&gt;
		orderlist[6] = &amp;quot;sl&amp;quot;&lt;br /&gt;
		orderlist[7] = &amp;quot;p&amp;quot;&lt;br /&gt;
		orderlist[8] = &amp;quot;tp&amp;quot;&lt;br /&gt;
		orderlist[9] = &amp;quot;w&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- rename rules. Rules to change parameters and labels based on other parameters&lt;br /&gt;
	if args[&amp;quot;hp&amp;quot;] then&lt;br /&gt;
		-- hp an alias for p ([hanyu] pinyin)&lt;br /&gt;
		args[&amp;quot;p&amp;quot;] = args[&amp;quot;hp&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
	if args[&amp;quot;tp&amp;quot;] then&lt;br /&gt;
		-- if also Tongyu pinyin use full name for Hanyu pinyin&lt;br /&gt;
		labels[&amp;quot;p&amp;quot;] = &amp;quot;Hanyu Pinyin&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (args[&amp;quot;s&amp;quot;] and args[&amp;quot;s&amp;quot;] == args[&amp;quot;t&amp;quot;]) then&lt;br /&gt;
		-- Treat simplified + traditional as Chinese if they&amp;#039;re the same&lt;br /&gt;
		args[&amp;quot;c&amp;quot;] = args[&amp;quot;s&amp;quot;]&lt;br /&gt;
		args[&amp;quot;s&amp;quot;] = nil&lt;br /&gt;
		args[&amp;quot;t&amp;quot;] = nil&lt;br /&gt;
	elseif (not (args[&amp;quot;s&amp;quot;] and args[&amp;quot;t&amp;quot;])) then&lt;br /&gt;
		-- use short label if only one of simplified and traditional&lt;br /&gt;
		labels[&amp;quot;s&amp;quot;] = labels[&amp;quot;c&amp;quot;]&lt;br /&gt;
		labels[&amp;quot;t&amp;quot;] = labels[&amp;quot;c&amp;quot;]&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local body = &amp;quot;&amp;quot; -- the output string&lt;br /&gt;
	local params -- for creating HTML spans&lt;br /&gt;
	local label -- the label, i.e. the bit preceeding the supplied text&lt;br /&gt;
	local val -- the supplied text&lt;br /&gt;
	&lt;br /&gt;
	-- go through all possible fields in loop, adding them to the output&lt;br /&gt;
	for i, part in ipairs(orderlist) do&lt;br /&gt;
		if (args[part]) then&lt;br /&gt;
			-- build label&lt;br /&gt;
			label = &amp;quot;&amp;quot;&lt;br /&gt;
			if (uselabels) then&lt;br /&gt;
				label = labels[part]&lt;br /&gt;
				if (capfirst) then&lt;br /&gt;
					label = mw.language.getContentLanguage():ucfirst(label)&lt;br /&gt;
					capfirst = false&lt;br /&gt;
				end&lt;br /&gt;
				if (uselinks) then&lt;br /&gt;
					label = &amp;quot;[[&amp;quot; .. wlinks[part] .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
				if (labels[part] ~= &amp;quot;lit.&amp;quot;) then&lt;br /&gt;
					label = label .. &amp;quot;&amp;amp;#58;&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					label = &amp;quot;&amp;lt;small&amp;gt;&amp;quot; .. label .. &amp;quot;&amp;lt;/small&amp;gt;&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
				label = label .. &amp;quot; &amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			-- build value&lt;br /&gt;
			val = args[part]&lt;br /&gt;
			if (cats[part]) and mw.title.getCurrentTitle().namespace == 0 then&lt;br /&gt;
				-- if has associated category AND current page in article namespace, add category&lt;br /&gt;
				val = cats[part] .. val&lt;br /&gt;
			end&lt;br /&gt;
			if (ISOlang[part]) then&lt;br /&gt;
				-- add span for language if needed&lt;br /&gt;
				params = {[&amp;quot;lang&amp;quot;] = ISOlang[part]}&lt;br /&gt;
				val = mw.text.tag({name=&amp;quot;span&amp;quot;,attrs=params, content=val})&lt;br /&gt;
			elseif (part == &amp;quot;l&amp;quot;) then&lt;br /&gt;
				-- put literals in quotes&lt;br /&gt;
				val = &amp;quot;&amp;#039;&amp;quot; .. val .. &amp;quot;&amp;#039;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			if (italic[part]) then&lt;br /&gt;
				-- italicise&lt;br /&gt;
				val = &amp;quot;&amp;lt;i&amp;gt;&amp;quot; .. val .. &amp;quot;&amp;lt;/i&amp;gt;&amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			if string.match(val, &amp;quot;&amp;lt;/?sup&amp;gt;&amp;quot;) then val = val..&amp;quot;[[Category:Pages using template Zh with sup tags]]&amp;quot; end&lt;br /&gt;
			if (superscript[part]) then&lt;br /&gt;
				-- superscript&lt;br /&gt;
				val = val:gsub(&amp;quot;(%d)&amp;quot;, &amp;quot;&amp;lt;sup&amp;gt;%1&amp;lt;/sup&amp;gt;&amp;quot;):gsub(&amp;quot;(%d)&amp;lt;/sup&amp;gt;%*&amp;lt;sup&amp;gt;(%d)&amp;quot;, &amp;quot;%1*%2&amp;quot;):gsub(&amp;quot;&amp;lt;sup&amp;gt;&amp;lt;sup&amp;gt;([%d%*]+)&amp;lt;/sup&amp;gt;&amp;lt;/sup&amp;gt;&amp;quot;, &amp;quot;&amp;lt;sup&amp;gt;%1&amp;lt;/sup&amp;gt;&amp;quot;)&lt;br /&gt;
			end&lt;br /&gt;
			-- add both to body&lt;br /&gt;
			body = body .. label .. val .. &amp;quot;; &amp;quot;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (body &amp;gt; &amp;quot;&amp;quot;) then -- check for empty string&lt;br /&gt;
		return string.sub(body, 1, -3) -- chop off final semicolon and space&lt;br /&gt;
	else --no named parameters; see if there&amp;#039;s a first parameter, ignoring its name&lt;br /&gt;
		if (args[1]) then&lt;br /&gt;
			-- if there is treat it as Chinese&lt;br /&gt;
			label = &amp;quot;&amp;quot;&lt;br /&gt;
			if (uselabels) then&lt;br /&gt;
				label = labels[&amp;quot;c&amp;quot;]&lt;br /&gt;
				if (uselinks) then&lt;br /&gt;
					label = &amp;quot;[[&amp;quot; .. wlinks[&amp;quot;c&amp;quot;] .. &amp;quot;|&amp;quot; .. label .. &amp;quot;]]&amp;quot;&lt;br /&gt;
				end&lt;br /&gt;
				label = label .. &amp;quot;&amp;amp;#58; &amp;quot;&lt;br /&gt;
			end&lt;br /&gt;
			-- default to show links and labels as no options given&lt;br /&gt;
			if mw.title.getCurrentTitle().namespace == 0 then&lt;br /&gt;
				-- if current page in article namespace&lt;br /&gt;
				val = cats[&amp;quot;c&amp;quot;] .. args[1]&lt;br /&gt;
			else&lt;br /&gt;
				val = args[1]&lt;br /&gt;
			end&lt;br /&gt;
			params = {[&amp;quot;lang&amp;quot;] = ISOlang[&amp;quot;c&amp;quot;]}&lt;br /&gt;
			val = mw.text.tag({name=&amp;quot;span&amp;quot;,attrs=params, content=val})&lt;br /&gt;
			return label .. val&lt;br /&gt;
		end&lt;br /&gt;
		return &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=Template:Zh&amp;diff=1926</id>
		<title>Template:Zh</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=Template:Zh&amp;diff=1926"/>
				<updated>2021-06-23T14:44:20Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;&amp;lt;includeonly&amp;gt;{{#invoke:Lang-zh|Zh}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;includeonly&amp;gt;{{#invoke:Lang-zh|Zh}}&amp;lt;/includeonly&amp;gt;&amp;lt;noinclude&amp;gt;{{documentation}}&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Bagua&amp;diff=1925</id>
		<title>I Ching/Bagua</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Bagua&amp;diff=1925"/>
				<updated>2021-06-23T14:42:57Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Another possible source of &amp;#039;&amp;#039;bagua&amp;#039;&amp;#039; is the following, attributed to [[King Wen of Zhou]] Dynasty: &amp;quot;When the world began, there was heaven and earth. Heaven mated with the earth and gave birth to everything in the world. Heaven is &amp;#039;&amp;#039;Qian&amp;#039;&amp;#039;-gua, and the Earth is &amp;#039;&amp;#039;Kun&amp;#039;&amp;#039;-gua. The remaining six guas are their sons and daughters&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The trigrams are related to the five elements of Wu Xing, used by [[Feng Shui]] practitioners and in [[Traditional Chinese Medicine]]. &lt;br /&gt;
&lt;br /&gt;
Those five elements are Water, Wood, Fire, Earth and Metal.&lt;br /&gt;
*: The Water (Kan) and Fire (Li) trigrams correspond directly with the Water and Fire elements.&lt;br /&gt;
*: The element of Wood corresponds with the trigrams of Wind (Xun) (as a gentle but inexorable force that can erode and penetrate stone) and Thunder (Zhen). &lt;br /&gt;
*: The element of Earth corresponds with both the trigrams of Earth (Kun) and Mountain (Gen). &lt;br /&gt;
*: The element of Metal corresponds with the trigrams of Heaven (Qian) and Lake (Dui).&lt;br /&gt;
&lt;br /&gt;
There are eight possible combinations to render the various trigrams ({{zh|labels=no|c=八卦}} &amp;#039;&amp;#039;bāguà&amp;#039;&amp;#039;):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Trigram figure&lt;br /&gt;
! Possible binary value&lt;br /&gt;
! Name&lt;br /&gt;
! Translation: &amp;#039;&amp;#039;Wilhelm&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;Wilhelm, R. &amp;amp; Baynes, C., (1967): &amp;quot;The I Ching or Book of Changes&amp;quot;, With foreword by Carl Jung, Introduction, Bollingen Series XIX, Princeton University Press, (1st ed. 1950)&amp;lt;/ref&amp;gt;&lt;br /&gt;
! Image in nature &amp;lt;small&amp;gt;(pp.l-li)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Direction &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;269)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Family relationship &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;274)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Body part &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;274)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Attribute &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;273)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Stage/ state &amp;lt;small&amp;gt;(pp.l-li)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Animal &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;273)&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ☰ || 111 || {{zh|labels=no|c=乾}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;qián&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the  Creative&amp;#039;&amp;#039;, (natural) force || heaven, sky&amp;lt;br /&amp;gt;{{lang|zh|天}}&lt;br /&gt;
| northwest || father || head || strong, persisting || creative || {{lang|zh|馬}}&amp;lt;br /&amp;gt;horse&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ☱ || 110 || {{lang|zh|兌}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;duì&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Joyous&amp;#039;&amp;#039;, open (reflection) || lake, marsh&amp;lt;br /&amp;gt;{{lang|zh|澤}}&lt;br /&gt;
| west || third daughter || mouth || pleasure || tranquil (complete devotion) || {{lang|zh|羊}}&amp;lt;br /&amp;gt;sheep, goat&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ☲ || 101 || {{lang|zh|離}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;lí&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Clinging&amp;#039;&amp;#039;, radiance || fire, glow&amp;lt;br /&amp;gt;{{lang|zh|火}}&lt;br /&gt;
| south || second daughter || eye || light-giving, humane &amp;quot;dependence&amp;quot; || clinging, clarity, adaptable || {{lang|zh|雉}}&amp;lt;br /&amp;gt;pheasant&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ☳ || 100 || {{lang|zh|震}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;zhèn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Arousing&amp;#039;&amp;#039;, shake || thunder&amp;lt;br /&amp;gt;{{lang|zh|雷}}&lt;br /&gt;
| east || first son || foot || inciting movement || initiative || {{lang|zh|龍}}&amp;lt;br /&amp;gt;dragon&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ☴ || 011 || {{lang|zh|巽}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;xùn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Gentle&amp;#039;&amp;#039;, ground || wind, air&amp;lt;br /&amp;gt;{{lang|zh|風}}&lt;br /&gt;
| southeast || first daughter || thigh || penetrating || gentle entrance || {{lang|zh|雞}}&amp;lt;br /&amp;gt;fowl&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ☵ || 010 || {{lang|zh|坎}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;kǎn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Abysmal&amp;#039;&amp;#039;, [[gorge]] || water&amp;lt;br /&amp;gt;{{lang|zh|水}}&lt;br /&gt;
| north || second son || ear || dangerous || in-motion || {{lang|zh|豕}}&amp;lt;br /&amp;gt;pig&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ☶ || 001 || {{lang|zh|艮}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;gèn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;Keeping Still&amp;#039;&amp;#039;, bound || mountain&amp;lt;br /&amp;gt;{{lang|zh|山}} || northeast || third son || hand || resting, stand-still || completion || {{lang|zh|狗}}&amp;lt;br /&amp;gt;wolf, dog&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ☷ || 000 || {{lang|zh|坤}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;kūn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Receptive&amp;#039;&amp;#039;, field || ground, earth&amp;lt;br /&amp;gt;{{lang|zh|地}}&lt;br /&gt;
| southwest || mother (consort) || belly || devoted, yielding || receptive || {{lang|zh|牛}}&amp;lt;br /&amp;gt;cow&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Hexagram lookup table===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-----&lt;br /&gt;
| width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:LightYellow;&amp;quot; | Upper →&amp;lt;br /&amp;gt;Lower ↓&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=乾}} Qián&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;Heaven&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坤}} Kūn&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;Ground&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Earth&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=震}} Zhèn&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;Thunder&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坎}} Kǎn&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;Water&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=艮}} Gèn&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;Mountain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=巽}} Xùn&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;Wind&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Air&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|t=離}} Lí&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;Flame&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Fire&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|t=兌}} Duì&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;Lake&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=乾}} Qián&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;Heaven&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 1|01]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 1|Force]] &lt;br /&gt;
| [[I Ching/Hexagram# 11|11]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 11|Pervading]]&lt;br /&gt;
| [[I Ching/Hexagram# 34|34]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 34|Great Invigorating]]&lt;br /&gt;
| [[I Ching/Hexagram# 5|05]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 5|Attending]] &lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 26|26]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 26|Great &amp;lt;br /&amp;gt;Accumulating]]&lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 9|09]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 9|Small &amp;lt;br /&amp;gt;Harvest]]&lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 14|14]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 14|Great &amp;lt;br /&amp;gt;Possessing]]&lt;br /&gt;
| [[I Ching/Hexagram# 43|43]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 43|Displacement]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坤}} Kūn&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;Earth&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 12|12]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 12|Obstruction]]&lt;br /&gt;
| [[I Ching/Hexagram# 2|02]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 2|Field]] &amp;lt;br /&amp;gt;&lt;br /&gt;
| [[I Ching/Hexagram# 16|16]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 16|Providing-For]]&lt;br /&gt;
| [[I Ching/Hexagram# 8|08]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 8|Grouping]]&lt;br /&gt;
| [[I Ching/Hexagram# 23|23]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 23|Stripping]]&lt;br /&gt;
| [[I Ching/Hexagram# 20|20]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 20|Viewing]]&lt;br /&gt;
| [[I Ching/Hexagram# 35|35]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 35|Prospering]]&lt;br /&gt;
| [[I Ching/Hexagram# 45|45]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 45|Clustering]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=震}} Zhèn&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;Thunder&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 25|25]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]] &amp;lt;br /&amp;gt; [[I Ching/Hexagram# 25|Innocence]]&lt;br /&gt;
| [[I Ching/Hexagram# 24|24]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 24|Returning]]&lt;br /&gt;
| [[I Ching/Hexagram# 51|51]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 51|Shake]]&lt;br /&gt;
| [[I Ching/Hexagram# 3|03]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 3|Sprouting]]&lt;br /&gt;
| [[I Ching/Hexagram# 27|27]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 27|Swallowing]]&lt;br /&gt;
| [[I Ching/Hexagram# 42|42]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 42|Augmenting]]&lt;br /&gt;
| [[I Ching/Hexagram# 21|21]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 21|Gnawing Bite]]&lt;br /&gt;
| [[I Ching/Hexagram# 17|17]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 17|Following]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坎}} Kǎn&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;Water&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 6|06]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 6|Arguing]]&lt;br /&gt;
| [[I Ching/Hexagram# 7|07]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 7|Leading]]&lt;br /&gt;
| [[I Ching/Hexagram# 40|40]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 40|Deliverance]]&lt;br /&gt;
| [[I Ching/Hexagram# 29|29]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 29|Gorge]]&lt;br /&gt;
| [[I Ching/Hexagram# 4|04]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 4|Enveloping]]&lt;br /&gt;
| [[I Ching/Hexagram# 59|59]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 59|Dispersing]]&lt;br /&gt;
| [[I Ching/Hexagram# 64|64]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 64|Before Completion]]&lt;br /&gt;
| [[I Ching/Hexagram# 47|47]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 47|Confining]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=艮}} Gèn&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;Mountain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 33|33]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 33|Retiring]]&lt;br /&gt;
| [[I Ching/Hexagram# 15|15]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 15|Humbling]]&lt;br /&gt;
| [[I Ching/Hexagram# 62|62]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 62|Small Exceeding]]&lt;br /&gt;
| [[I Ching/Hexagram# 39|39]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 39|Limping]]&lt;br /&gt;
| [[I Ching/Hexagram# 52|52]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 52|Bound]]&lt;br /&gt;
| [[I Ching/Hexagram# 53|53]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 53|Infiltrating]]&lt;br /&gt;
| [[I Ching/Hexagram# 56|56]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 56|Sojourning]]&lt;br /&gt;
| [[I Ching/Hexagram# 31|31]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 31|Conjoining]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=巽}} Xùn&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;Wind&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 44|44]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 44|Coupling]]&lt;br /&gt;
| [[I Ching/Hexagram# 46|46]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 46|Ascending]]&lt;br /&gt;
| [[I Ching/Hexagram# 32|32]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 32|Persevering]]&lt;br /&gt;
| [[I Ching/Hexagram# 48|48]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 48|Welling]]&lt;br /&gt;
| [[I Ching/Hexagram# 18|18]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 18|Correcting]]&lt;br /&gt;
| [[I Ching/Hexagram# 57|57]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 57|Ground]]&lt;br /&gt;
| [[I Ching/Hexagram# 50|50]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 50|Holding]]&lt;br /&gt;
| [[I Ching/Hexagram# 28|28]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 28|Great Exceeding]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=離}} Lí&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;Flame&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 13|13]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 13|Concording&amp;lt;br /&amp;gt;People]]&lt;br /&gt;
| [[I Ching/Hexagram# 36|36]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 36|Intelligence&amp;lt;br /&amp;gt;Hidden]]&lt;br /&gt;
| [[I Ching/Hexagram# 55|55]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 55|Abounding]]&lt;br /&gt;
| [[I Ching/Hexagram# 63|63]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 63|Already&amp;lt;br /&amp;gt;Fording]]&lt;br /&gt;
| [[I Ching/Hexagram# 22|22]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 22|Adorning]]&lt;br /&gt;
| [[I Ching/Hexagram# 37|37]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 37|Dwelling&amp;lt;br /&amp;gt;People]]&lt;br /&gt;
| [[I Ching/Hexagram# 30|30]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 30|Radiance]]&lt;br /&gt;
| [[I Ching/Hexagram# 49|49]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 49|Skinning]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=兌}} Duì&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;Lake&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 10|10]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 10|Treading]]&lt;br /&gt;
| [[I Ching/Hexagram# 19|19]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 19|Nearing]]&lt;br /&gt;
| [[I Ching/Hexagram# 54|54]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 54|Converting the Maiden]]&lt;br /&gt;
| [[I Ching/Hexagram# 60|60]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 60|Articulating]]&lt;br /&gt;
| [[I Ching/Hexagram# 41|41]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 41|Diminishing]]&lt;br /&gt;
| [[I Ching/Hexagram# 61|61]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 61|Inner Truth]]&lt;br /&gt;
| [[I Ching/Hexagram# 38|38]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 38|Polarising]]&lt;br /&gt;
| [[I Ching/Hexagram# 58|58]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 58|Open]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Bagua&amp;diff=1924</id>
		<title>I Ching/Bagua</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Bagua&amp;diff=1924"/>
				<updated>2021-06-23T14:39:20Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Page name&amp;quot;List of hexagrams of the I Ching#Hexagram&amp;quot; from WIkipedia changed to &amp;quot;I Ching/Hexagram#Hexagram&amp;quot; on PDKB wiki&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Another possible source of &amp;#039;&amp;#039;bagua&amp;#039;&amp;#039; is the following, attributed to [[King Wen of Zhou]] Dynasty: &amp;quot;When the world began, there was heaven and earth. Heaven mated with the earth and gave birth to everything in the world. Heaven is &amp;#039;&amp;#039;Qian&amp;#039;&amp;#039;-gua, and the Earth is &amp;#039;&amp;#039;Kun&amp;#039;&amp;#039;-gua. The remaining six guas are their sons and daughters&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The trigrams are related to the five elements of Wu Xing, used by [[Feng Shui]] practitioners and in [[Traditional Chinese Medicine]]. Those five elements are Water, Wood, Fire, Earth and Metal.  The Water (Kan) and Fire (Li) trigrams correspond directly with the Water and Fire elements.  The element of Earth corresponds with both the trigrams of Earth (Kun) and Mountain (Gen). The element of Wood corresponds with the trigrams of Wind (Xun) (as a gentle but inexorable force that can erode and penetrate stone) and Thunder (Zhen). The element of Metal corresponds with the trigrams of Heaven (Qian) and Lake (Dui).&lt;br /&gt;
&lt;br /&gt;
There are eight possible combinations to render the various trigrams ({{zh|labels=no|c=八卦}} &amp;#039;&amp;#039;bāguà&amp;#039;&amp;#039;):&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!&lt;br /&gt;
! Trigram figure&lt;br /&gt;
! Possible binary value&lt;br /&gt;
! Name&lt;br /&gt;
! Translation: &amp;#039;&amp;#039;Wilhelm&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;Wilhelm, R. &amp;amp; Baynes, C., (1967): &amp;quot;The I Ching or Book of Changes&amp;quot;, With foreword by Carl Jung, Introduction, Bollingen Series XIX, Princeton University Press, (1st ed. 1950)&amp;lt;/ref&amp;gt;&lt;br /&gt;
! Image in nature &amp;lt;small&amp;gt;(pp.l-li)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Direction &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;269)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Family relationship &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;274)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Body part &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;274)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Attribute &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;273)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Stage/ state &amp;lt;small&amp;gt;(pp.l-li)&amp;lt;/small&amp;gt;&lt;br /&gt;
! Animal &amp;lt;small&amp;gt;(p.&amp;amp;nbsp;273)&amp;lt;/small&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ☰ || 111 || {{zh|labels=no|c=乾}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;qián&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the  Creative&amp;#039;&amp;#039;, (natural) force || heaven, sky&amp;lt;br /&amp;gt;{{lang|zh|天}}&lt;br /&gt;
| northwest || father || head || strong, persisting || creative || {{lang|zh|馬}}&amp;lt;br /&amp;gt;horse&lt;br /&gt;
|-&lt;br /&gt;
| 2 || ☱ || 110 || {{lang|zh|兌}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;duì&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Joyous&amp;#039;&amp;#039;, open (reflection) || lake, marsh&amp;lt;br /&amp;gt;{{lang|zh|澤}}&lt;br /&gt;
| west || third daughter || mouth || pleasure || tranquil (complete devotion) || {{lang|zh|羊}}&amp;lt;br /&amp;gt;sheep, goat&lt;br /&gt;
|-&lt;br /&gt;
| 3 || ☲ || 101 || {{lang|zh|離}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;lí&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Clinging&amp;#039;&amp;#039;, radiance || fire, glow&amp;lt;br /&amp;gt;{{lang|zh|火}}&lt;br /&gt;
| south || second daughter || eye || light-giving, humane &amp;quot;dependence&amp;quot; || clinging, clarity, adaptable || {{lang|zh|雉}}&amp;lt;br /&amp;gt;pheasant&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ☳ || 100 || {{lang|zh|震}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;zhèn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Arousing&amp;#039;&amp;#039;, shake || thunder&amp;lt;br /&amp;gt;{{lang|zh|雷}}&lt;br /&gt;
| east || first son || foot || inciting movement || initiative || {{lang|zh|龍}}&amp;lt;br /&amp;gt;dragon&lt;br /&gt;
|-&lt;br /&gt;
| 5 || ☴ || 011 || {{lang|zh|巽}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;xùn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Gentle&amp;#039;&amp;#039;, ground || wind, air&amp;lt;br /&amp;gt;{{lang|zh|風}}&lt;br /&gt;
| southeast || first daughter || thigh || penetrating || gentle entrance || {{lang|zh|雞}}&amp;lt;br /&amp;gt;fowl&lt;br /&gt;
|-&lt;br /&gt;
| 6 || ☵ || 010 || {{lang|zh|坎}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;kǎn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Abysmal&amp;#039;&amp;#039;, [[gorge]] || water&amp;lt;br /&amp;gt;{{lang|zh|水}}&lt;br /&gt;
| north || second son || ear || dangerous || in-motion || {{lang|zh|豕}}&amp;lt;br /&amp;gt;pig&lt;br /&gt;
|-&lt;br /&gt;
| 7 || ☶ || 001 || {{lang|zh|艮}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;gèn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;Keeping Still&amp;#039;&amp;#039;, bound || mountain&amp;lt;br /&amp;gt;{{lang|zh|山}} || northeast || third son || hand || resting, stand-still || completion || {{lang|zh|狗}}&amp;lt;br /&amp;gt;wolf, dog&lt;br /&gt;
|-&lt;br /&gt;
| 8 || ☷ || 000 || {{lang|zh|坤}}&amp;lt;br /&amp;gt;&amp;#039;&amp;#039;kūn&amp;#039;&amp;#039; || &amp;#039;&amp;#039;the Receptive&amp;#039;&amp;#039;, field || ground, earth&amp;lt;br /&amp;gt;{{lang|zh|地}}&lt;br /&gt;
| southwest || mother (consort) || belly || devoted, yielding || receptive || {{lang|zh|牛}}&amp;lt;br /&amp;gt;cow&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Hexagram lookup table===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;text-align:center;&amp;quot;&lt;br /&gt;
|-----&lt;br /&gt;
| width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:LightYellow;&amp;quot; | Upper →&amp;lt;br /&amp;gt;Lower ↓&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=乾}} Qián&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;Heaven&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坤}} Kūn&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;Ground&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Earth&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=震}} Zhèn&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;Thunder&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坎}} Kǎn&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;Water&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=艮}} Gèn&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;Mountain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=巽}} Xùn&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;Wind&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Air&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|t=離}} Lí&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;Flame&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;Fire&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| valign=&amp;quot;top&amp;quot; width=&amp;quot;10%&amp;quot; ! style=&amp;quot;background:Gold;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|t=兌}} Duì&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;Lake&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=乾}} Qián&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;Heaven&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 1|01]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 1|Force]] &lt;br /&gt;
| [[I Ching/Hexagram# 11|11]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 11|Pervading]]&lt;br /&gt;
| [[I Ching/Hexagram# 34|34]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 34|Great Invigorating]]&lt;br /&gt;
| [[I Ching/Hexagram# 5|05]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 5|Attending]] &lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 26|26]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 26|Great &amp;lt;br /&amp;gt;Accumulating]]&lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 9|09]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 9|Small &amp;lt;br /&amp;gt;Harvest]]&lt;br /&gt;
| &amp;lt;br /&amp;gt;[[I Ching/Hexagram# 14|14]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 14|Great &amp;lt;br /&amp;gt;Possessing]]&lt;br /&gt;
| [[I Ching/Hexagram# 43|43]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 43|Displacement]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坤}} Kūn&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;Earth&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 12|12]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 12|Obstruction]]&lt;br /&gt;
| [[I Ching/Hexagram# 2|02]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 2|Field]] &amp;lt;br /&amp;gt;&lt;br /&gt;
| [[I Ching/Hexagram# 16|16]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 16|Providing-For]]&lt;br /&gt;
| [[I Ching/Hexagram# 8|08]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 8|Grouping]]&lt;br /&gt;
| [[I Ching/Hexagram# 23|23]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 23|Stripping]]&lt;br /&gt;
| [[I Ching/Hexagram# 20|20]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 20|Viewing]]&lt;br /&gt;
| [[I Ching/Hexagram# 35|35]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 35|Prospering]]&lt;br /&gt;
| [[I Ching/Hexagram# 45|45]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 45|Clustering]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=震}} Zhèn&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;Thunder&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 25|25]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]] &amp;lt;br /&amp;gt; [[I Ching/Hexagram# 25|Innocence]]&lt;br /&gt;
| [[I Ching/Hexagram# 24|24]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 24|Returning]]&lt;br /&gt;
| [[I Ching/Hexagram# 51|51]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 51|Shake]]&lt;br /&gt;
| [[I Ching/Hexagram# 3|03]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 3|Sprouting]]&lt;br /&gt;
| [[I Ching/Hexagram# 27|27]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 27|Swallowing]]&lt;br /&gt;
| [[I Ching/Hexagram# 42|42]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 42|Augmenting]]&lt;br /&gt;
| [[I Ching/Hexagram# 21|21]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 21|Gnawing Bite]]&lt;br /&gt;
| [[I Ching/Hexagram# 17|17]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 17|Following]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=坎}} Kǎn&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;Water&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 6|06]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 6|Arguing]]&lt;br /&gt;
| [[I Ching/Hexagram# 7|07]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 7|Leading]]&lt;br /&gt;
| [[I Ching/Hexagram# 40|40]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 40|Deliverance]]&lt;br /&gt;
| [[I Ching/Hexagram# 29|29]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 29|Gorge]]&lt;br /&gt;
| [[I Ching/Hexagram# 4|04]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 4|Enveloping]]&lt;br /&gt;
| [[I Ching/Hexagram# 59|59]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 59|Dispersing]]&lt;br /&gt;
| [[I Ching/Hexagram# 64|64]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 64|Before Completion]]&lt;br /&gt;
| [[I Ching/Hexagram# 47|47]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 47|Confining]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=艮}} Gèn&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;Mountain&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 33|33]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 33|Retiring]]&lt;br /&gt;
| [[I Ching/Hexagram# 15|15]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 15|Humbling]]&lt;br /&gt;
| [[I Ching/Hexagram# 62|62]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 62|Small Exceeding]]&lt;br /&gt;
| [[I Ching/Hexagram# 39|39]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 39|Limping]]&lt;br /&gt;
| [[I Ching/Hexagram# 52|52]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 52|Bound]]&lt;br /&gt;
| [[I Ching/Hexagram# 53|53]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 53|Infiltrating]]&lt;br /&gt;
| [[I Ching/Hexagram# 56|56]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 56|Sojourning]]&lt;br /&gt;
| [[I Ching/Hexagram# 31|31]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 31|Conjoining]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=巽}} Xùn&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;Wind&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 44|44]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 44|Coupling]]&lt;br /&gt;
| [[I Ching/Hexagram# 46|46]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 46|Ascending]]&lt;br /&gt;
| [[I Ching/Hexagram# 32|32]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 32|Persevering]]&lt;br /&gt;
| [[I Ching/Hexagram# 48|48]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 48|Welling]]&lt;br /&gt;
| [[I Ching/Hexagram# 18|18]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 18|Correcting]]&lt;br /&gt;
| [[I Ching/Hexagram# 57|57]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 57|Ground]]&lt;br /&gt;
| [[I Ching/Hexagram# 50|50]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 50|Holding]]&lt;br /&gt;
| [[I Ching/Hexagram# 28|28]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 28|Great Exceeding]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=離}} Lí&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;Flame&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 13|13]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 13|Concording&amp;lt;br /&amp;gt;People]]&lt;br /&gt;
| [[I Ching/Hexagram# 36|36]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 36|Intelligence&amp;lt;br /&amp;gt;Hidden]]&lt;br /&gt;
| [[I Ching/Hexagram# 55|55]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 55|Abounding]]&lt;br /&gt;
| [[I Ching/Hexagram# 63|63]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 63|Already&amp;lt;br /&amp;gt;Fording]]&lt;br /&gt;
| [[I Ching/Hexagram# 22|22]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 22|Adorning]]&lt;br /&gt;
| [[I Ching/Hexagram# 37|37]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 37|Dwelling&amp;lt;br /&amp;gt;People]]&lt;br /&gt;
| [[I Ching/Hexagram# 30|30]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 30|Radiance]]&lt;br /&gt;
| [[I Ching/Hexagram# 49|49]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 49|Skinning]]&lt;br /&gt;
|-&lt;br /&gt;
! style=&amp;quot;background:Pink;&amp;quot; |&amp;#039;&amp;#039;&amp;#039;{{zh|labels=no|c=兌}} Duì&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;Lake&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
| [[I Ching/Hexagram# 10|10]]&amp;lt;br /&amp;gt;[[File:Trigramme2630 ☰.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 10|Treading]]&lt;br /&gt;
| [[I Ching/Hexagram# 19|19]]&amp;lt;br /&amp;gt;[[File:Trigramme2637 ☷.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 19|Nearing]]&lt;br /&gt;
| [[I Ching/Hexagram# 54|54]]&amp;lt;br /&amp;gt;[[File:Trigramme2633 ☳.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 54|Converting the Maiden]]&lt;br /&gt;
| [[I Ching/Hexagram# 60|60]]&amp;lt;br /&amp;gt;[[File:Trigramme2635 ☵.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 60|Articulating]]&lt;br /&gt;
| [[I Ching/Hexagram# 41|41]]&amp;lt;br /&amp;gt;[[File:Trigramme2636 ☶.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 41|Diminishing]]&lt;br /&gt;
| [[I Ching/Hexagram# 61|61]]&amp;lt;br /&amp;gt;[[File:Trigramme2634 ☴.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 61|Inner Truth]]&lt;br /&gt;
| [[I Ching/Hexagram# 38|38]]&amp;lt;br /&amp;gt;[[File:Trigramme2632 ☲.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 38|Polarising]]&lt;br /&gt;
| [[I Ching/Hexagram# 58|58]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[File:Trigramme2631 ☱.svg]]&amp;lt;br /&amp;gt;[[I Ching/Hexagram# 58|Open]]&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Hexagram&amp;diff=1923</id>
		<title>I Ching/Hexagram</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Hexagram&amp;diff=1923"/>
				<updated>2021-06-23T14:25:28Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &amp;#039;&amp;#039;&amp;#039;hexagram&amp;#039;&amp;#039;&amp;#039; in this context is a figure composed of six stacked horizontal lines ([[wikt:爻|爻]] yáo), where each line is either [[Yin and yang|Yang]] (an unbroken, or solid line), or [[Yin and yang|Yin]] (broken, an open line with a gap in the center). The hexagram lines are traditionally counted from the bottom up, so the lowest line is considered line one while the top line is line six. Hexagrams are formed by combining the original [[I Ching/Bagua|eight trigrams]] in different combinations. Each hexagram is accompanied with a description, often cryptic, akin to parables. Each line in every hexagram is also given a similar description.&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Hexagram&amp;diff=1922</id>
		<title>I Ching/Hexagram</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Hexagram&amp;diff=1922"/>
				<updated>2021-06-23T14:24:49Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;A &amp;#039;&amp;#039;&amp;#039;hexagram&amp;#039;&amp;#039;&amp;#039; in this context is a figure composed of six stacked horizontal lines (爻 yáo), where each line is either Yang (an unbroken, or...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &amp;#039;&amp;#039;&amp;#039;hexagram&amp;#039;&amp;#039;&amp;#039; in this context is a figure composed of six stacked horizontal lines ([[wikt:爻|爻]] yáo), where each line is either [[Yin and yang|Yang]] (an unbroken, or solid line), or [[Yin and yang|Yin]] (broken, an open line with a gap in the center). The hexagram lines are traditionally counted from the bottom up, so the lowest line is considered line one while the top line is line six. Hexagrams are formed by combining the original [[Bagua|eight trigrams]] in different combinations. Each hexagram is accompanied with a description, often cryptic, akin to parables. Each line in every hexagram is also given a similar description.&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1921</id>
		<title>I Ching/Table</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1921"/>
				<updated>2021-06-23T14:23:44Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;margin: 0 0 1em 1em; border: 1px solid #aaaaaa; background: #f9f9f9;&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=0 cellspacing=0&lt;br /&gt;
! style=&amp;quot;padding: 0 5px 0 5px; background:#ccccff; text-align:center;&amp;quot; | [[I Ching]] [[I Ching/Hexagram|King Wen order for hexagrams]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-size: 100%; padding: 0 5px 0 5px; border-top: #aaa 1px solid;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background:#f9f9f9;text-align:center;&amp;quot; width=&amp;quot;480&amp;quot; border=&amp;quot;0&amp;quot; colspan=&amp;quot;16&amp;quot; |&lt;br /&gt;
|- &lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 1|01 ䷀]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 2|02 ䷁]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 3|03 ䷂]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 4|04 ䷃]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 5|05 ䷄]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 6|06 ䷅]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 7|07 ䷆]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 8|08 ䷇]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 9|09 ䷈]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 10|10 ䷉]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 11|11 ䷊]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 12|12 ䷋]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 13|13 ䷌]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 14|14 ䷍]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 15|15 ䷎]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 16|16 ䷏]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 17|17 ䷐]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 18|18 ䷑]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 19|19 ䷒]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 20|20 ䷓]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 21|21 ䷔]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 22|22 ䷕]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 23|23 ䷖]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 24|24 ䷗]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 25|25 ䷘]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 26|26 ䷙]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 27|27 ䷚]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 28|28 ䷛]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 29|29 ䷜]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 30|30 ䷝]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 31|31 ䷞]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 32|32 ䷟]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 33|33 ䷠]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 34|34 ䷡]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 35|35 ䷢]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 36|36 ䷣]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 37|37 ䷤]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 38|38 ䷥]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 39|39 ䷦]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 40|40 ䷧]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 41|41 ䷨]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 42|42 ䷩]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 43|43 ䷪]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 44|44 ䷫]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 45|45 ䷬]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 46|46 ䷭]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 47|47 ䷮]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 48|48 ䷯]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 49|49 ䷰]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 50|50 ䷱]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 51|51 ䷲]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 52|52 ䷳]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 53|53 ䷴]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 54|54 ䷵]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 55|55 ䷶]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 56|56 ䷷]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 57|57 ䷸]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 58|58 ䷹]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 59|59 ䷺]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 60|60 ䷻]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 61|61 ䷼]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 62|62 ䷽]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 63|63 ䷾]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 64|64 ䷿]]&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1920</id>
		<title>I Ching/Table</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1920"/>
				<updated>2021-06-23T14:22:05Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;margin: 0 0 1em 1em; border: 1px solid #aaaaaa; background: #f9f9f9;&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=0 cellspacing=0&lt;br /&gt;
! style=&amp;quot;padding: 0 5px 0 5px; background:#ccccff; text-align:center;&amp;quot; | [[I Ching]] [[I Ching/Hexagram|hexagrams]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-size: 100%; padding: 0 5px 0 5px; border-top: #aaa 1px solid;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background:#f9f9f9;text-align:center;&amp;quot; width=&amp;quot;480&amp;quot; border=&amp;quot;0&amp;quot; colspan=&amp;quot;16&amp;quot; |&lt;br /&gt;
|- &lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 1|01 ䷀]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 2|02 ䷁]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 3|03 ䷂]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 4|04 ䷃]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 5|05 ䷄]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 6|06 ䷅]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 7|07 ䷆]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 8|08 ䷇]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 9|09 ䷈]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 10|10 ䷉]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 11|11 ䷊]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 12|12 ䷋]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 13|13 ䷌]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 14|14 ䷍]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 15|15 ䷎]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 16|16 ䷏]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 17|17 ䷐]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 18|18 ䷑]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 19|19 ䷒]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 20|20 ䷓]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 21|21 ䷔]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 22|22 ䷕]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 23|23 ䷖]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 24|24 ䷗]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 25|25 ䷘]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 26|26 ䷙]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 27|27 ䷚]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 28|28 ䷛]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 29|29 ䷜]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 30|30 ䷝]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 31|31 ䷞]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 32|32 ䷟]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 33|33 ䷠]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 34|34 ䷡]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 35|35 ䷢]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 36|36 ䷣]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 37|37 ䷤]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 38|38 ䷥]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 39|39 ䷦]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 40|40 ䷧]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 41|41 ䷨]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 42|42 ䷩]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 43|43 ䷪]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 44|44 ䷫]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 45|45 ䷬]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 46|46 ䷭]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 47|47 ䷮]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 48|48 ䷯]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 49|49 ䷰]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 50|50 ䷱]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 51|51 ䷲]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 52|52 ䷳]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 53|53 ䷴]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 54|54 ䷵]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 55|55 ䷶]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 56|56 ䷷]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 57|57 ䷸]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 58|58 ䷹]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 59|59 ䷺]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 60|60 ䷻]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 61|61 ䷼]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 62|62 ䷽]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 63|63 ䷾]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 64|64 ䷿]]&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1919</id>
		<title>I Ching/Table</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I_Ching/Table&amp;diff=1919"/>
				<updated>2021-06-23T14:21:09Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Created page with &amp;quot;{| style=&amp;quot;margin: 0 0 1em 1em; border: 1px solid #aaaaaa; background: #f9f9f9;&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=0 cellspacing=0 ! style=&amp;quot;padding: 0 5px 0 5px; background:#ccccff; t...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| style=&amp;quot;margin: 0 0 1em 1em; border: 1px solid #aaaaaa; background: #f9f9f9;&amp;quot; align=&amp;quot;center&amp;quot; cellpadding=0 cellspacing=0&lt;br /&gt;
! style=&amp;quot;padding: 0 5px 0 5px; background:#ccccff; text-align:center;&amp;quot; | [[I Ching]] [[Hexagram (I Ching)|hexagrams]]&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;font-size: 100%; padding: 0 5px 0 5px; border-top: #aaa 1px solid;&amp;quot; |&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;background:#f9f9f9;text-align:center;&amp;quot; width=&amp;quot;480&amp;quot; border=&amp;quot;0&amp;quot; colspan=&amp;quot;16&amp;quot; |&lt;br /&gt;
|- &lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 1|01 ䷀]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 2|02 ䷁]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 3|03 ䷂]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 4|04 ䷃]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 5|05 ䷄]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 6|06 ䷅]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 7|07 ䷆]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 8|08 ䷇]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 9|09 ䷈]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 10|10 ䷉]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 11|11 ䷊]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 12|12 ䷋]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 13|13 ䷌]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 14|14 ䷍]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 15|15 ䷎]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 16|16 ䷏]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 17|17 ䷐]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 18|18 ䷑]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 19|19 ䷒]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 20|20 ䷓]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 21|21 ䷔]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 22|22 ䷕]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 23|23 ䷖]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 24|24 ䷗]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 25|25 ䷘]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 26|26 ䷙]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 27|27 ䷚]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 28|28 ䷛]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 29|29 ䷜]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 30|30 ䷝]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 31|31 ䷞]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 32|32 ䷟]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 33|33 ䷠]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 34|34 ䷡]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 35|35 ䷢]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 36|36 ䷣]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 37|37 ䷤]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 38|38 ䷥]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 39|39 ䷦]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 40|40 ䷧]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 41|41 ䷨]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 42|42 ䷩]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 43|43 ䷪]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 44|44 ䷫]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 45|45 ䷬]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 46|46 ䷭]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 47|47 ䷮]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 48|48 ䷯]]&lt;br /&gt;
|-&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 49|49 ䷰]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 50|50 ䷱]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 51|51 ䷲]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 52|52 ䷳]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 53|53 ䷴]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 54|54 ䷵]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 55|55 ䷶]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 56|56 ䷷]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 57|57 ䷸]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 58|58 ䷹]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 59|59 ䷺]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 60|60 ䷻]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 61|61 ䷼]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 62|62 ䷽]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 63|63 ䷾]]&lt;br /&gt;
| [[I Ching/Hexagram#Hexagram 64|64 ䷿]]&lt;br /&gt;
|}&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1918</id>
		<title>I-Ching</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1918"/>
				<updated>2021-06-23T14:19:30Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{short description|Wikimedia list article}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{DISPLAYTITLE:List of hexagrams of the &amp;#039;&amp;#039;I Ching&amp;#039;&amp;#039;}}&lt;br /&gt;
This is a list of the 64 &amp;#039;&amp;#039;&amp;#039;[[Hexagram (I Ching)|hexagrams]]&amp;#039;&amp;#039;&amp;#039; of the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[I Ching]]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;Book of Changes&amp;#039;&amp;#039;, and their [[Template:Unicode chart Yijing Hexagram Symbols|Unicode character codes]].&lt;br /&gt;
&lt;br /&gt;
This list is in [[King Wen sequence|King Wen order]]. (Cf. [[King Wen sequence#Other hexagram sequences|other hexagram sequences]].)&lt;br /&gt;
&lt;br /&gt;
{{:I Ching/Table}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 1 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-01.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 1&amp;#039;&amp;#039; is named {{lang|zh|乾}} (qián), &amp;quot;Force&amp;quot;. Other variations include &amp;quot;the creative&amp;quot;, &amp;quot;strong action&amp;quot;, &amp;quot;the key&amp;quot;,  and &amp;quot;god&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is the same.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Creative Heaven|1=4DC0|IncludeGB=no}}&amp;lt;!-- Note: setting IncludeGB to yes throughout breaks the page with “Node-count limit exceeded” errors --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Hexagram 2 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-02.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 2&amp;#039;&amp;#039; is named {{lang|zh|坤}} (kūn), &amp;quot;Field&amp;quot;. Other variations include &amp;quot;the receptive&amp;quot;, &amp;quot;acquiescence&amp;quot;, and &amp;quot;the flow&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Receptive Earth|1=4DC1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 3 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-03.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 3&amp;#039;&amp;#039; is named {{lang|zh|屯}} (zhūn), &amp;quot;Sprouting&amp;quot;. Other variations include &amp;quot;difficulty at the beginning&amp;quot;, &amp;quot;gathering support&amp;quot;, and &amp;quot;hoarding&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Difficulty at the Beginning|1=4DC2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 4 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-04.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 4&amp;#039;&amp;#039; is named {{lang|zh|蒙}} (méng), &amp;quot;Enveloping&amp;quot;. Other variations include &amp;quot;youthful folly&amp;quot;, &amp;quot;the young shoot&amp;quot;, and &amp;quot;discovering&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water. Its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Youthful Folly|1=4DC3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 5 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-05.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 5&amp;#039;&amp;#039; is named {{lang|zh|需}} (xū), &amp;quot;Attending&amp;quot;. Other variations include &amp;quot;waiting&amp;quot;, &amp;quot;moistened&amp;quot;, and &amp;quot;arriving&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Waiting|1=4DC4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 6 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-06.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 6&amp;#039;&amp;#039; is named {{lang|zh|訟}} (sòng), &amp;quot;Arguing&amp;quot;. Other variations include &amp;quot;conflict&amp;quot; and &amp;quot;lawsuit&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Conflict|1=4DC5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 7 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-07.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 7&amp;#039;&amp;#039; is named {{lang|zh|師}}  (shī), &amp;quot;Leading&amp;quot;. Other variations include &amp;quot;the army&amp;quot; and &amp;quot;the troops&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[水]]}}) water, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Army|1=4DC6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 8 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-08.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 8&amp;#039;&amp;#039; is named {{lang|zh|比}}  (bǐ), &amp;quot;Grouping&amp;quot;. Other variations include &amp;quot;holding together&amp;quot; and &amp;quot;alliance&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Holding Together|1=4DC7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 9 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-09.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 9&amp;#039;&amp;#039; is named {{lang|zh|小畜}}  (xiǎo xù), &amp;quot;Small Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the small&amp;quot; and &amp;quot;small harvest&amp;quot;. Its inner (lower) trigram is  ☰ ({{lang|zh|乾}}  qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) trigram is ☴ ({{lang|zh|巽}}  xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Taming|1=4DC8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 10 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-10.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 10&amp;#039;&amp;#039; is named {{lang|zh|履}} (lǚ), &amp;quot;Treading&amp;quot;. Other variations include &amp;quot;treading (conduct)&amp;quot; and &amp;quot;continuing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|[[澤]]}}) swamp, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Treading|1=4DC9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 11 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-11.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 11&amp;#039;&amp;#039; is named {{lang|zh|泰}} (tài), &amp;quot;Pervading&amp;quot;. Other variations include &amp;quot;peace&amp;quot; and &amp;quot;greatness&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Peace|1=4DCA|IncludeGB=no}}&lt;br /&gt;
== Hexagram 12 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-12.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 12&amp;#039;&amp;#039; is named {{lang|zh|否}} (pǐ), &amp;quot;Obstruction&amp;quot;. Other variations include &amp;quot;standstill (stagnation)&amp;quot; and &amp;quot;selfish persons&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Standstill|1=4DCB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 13 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-13.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 13&amp;#039;&amp;#039; is named {{lang|zh|同人}} (tóng rén), &amp;quot;Concording People&amp;quot;. Other variations include &amp;quot;fellowship with men&amp;quot; and &amp;quot;gathering men&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Fellowship|1=4DCC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 14 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-14.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 14&amp;#039;&amp;#039; is named {{lang|zh|大有}} (dà yǒu), &amp;quot;Great Possessing&amp;quot;. Other variations include &amp;quot;possession in great measure&amp;quot; and &amp;quot;the great possession&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Possession|1=4DCD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 15 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-15.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 15&amp;#039;&amp;#039; is named {{lang|zh|謙}} (qiān), &amp;quot;Humbling&amp;quot;. Other variations include &amp;quot;modesty&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain and its outer (upper) [[trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Modesty|1=4DCE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 16 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-16.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 16&amp;#039;&amp;#039; is named {{lang|zh|豫}} (yù), &amp;quot;Providing-For&amp;quot;. Other variations include &amp;quot;enthusiasm&amp;quot; and &amp;quot;excess&amp;quot;. Its inner  (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Enthusiasm|1=4DCF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 17 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-17.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 17&amp;#039;&amp;#039; is named {{lang|zh|隨}} (suí), &amp;quot;Following&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Following|1=4DD0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 18 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-18.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 18&amp;#039;&amp;#039; is named {{lang|zh|蠱}} (gǔ), &amp;quot;Correcting&amp;quot;. Other variations include &amp;quot;work on what has been spoiled (decay)&amp;quot;, &amp;#039;&amp;#039;decaying&amp;#039;&amp;#039; and &amp;quot;branch&amp;quot;.&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
   | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2001&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot&amp;#039;s+guide+to+I+Ching+%22Yu%22&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt; Its inner (lower) [[Ba gua|trigram]] is  ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer (upper) trigram is ☶ ({{lang|zh|艮 gèn}}) bound = ({{lang|zh|[[山]]}}) mountain. &amp;#039;&amp;#039;[[Gu (poison)|Gu]]&amp;#039;&amp;#039; is the name of a venom-based poison traditionally used in Chinese witchcraft.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Work on the Decayed|1=4DD1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 19 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-19.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 19&amp;#039;&amp;#039; is named {{lang|zh|臨}} (lín), &amp;quot;Nearing&amp;quot;. Other variations include &amp;quot;approach&amp;quot; and &amp;quot;the forest&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Approach|1=4DD2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 20 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-20.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 20&amp;#039;&amp;#039; is named {{lang|zh|觀}} (guān), &amp;quot;Viewing&amp;quot;. Other variations include &amp;quot;contemplation (view)&amp;quot; and &amp;quot;looking up&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Contemplation|1=4DD3|IncludeGB=no}}&lt;br /&gt;
== Hexagram 21 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-21.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 21&amp;#039;&amp;#039; is named {{lang|zh|噬嗑}} (shì kè), &amp;quot;Gnawing Bite&amp;quot;. Other variations include &amp;quot;biting through&amp;quot; and &amp;quot;biting and chewing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Shi+He%22+%22Gnawing%22&amp;amp;pg=PA128&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
{{charmap|name1=Hexagram for Biting Through|1=4DD4|IncludeGB=no}}&lt;br /&gt;
== Hexagram 22 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-22.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 22&amp;#039;&amp;#039; is named {{lang|zh|賁}} (bì), &amp;quot;Adorning&amp;quot;. Other variations include &amp;quot;grace&amp;quot; and &amp;quot;luxuriance&amp;quot;. Its inner (lower) [[bagua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer (upper) [[trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Bi%22+%22Adorning%22&amp;amp;pg=PA130&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Grace|1=4DD5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 23 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-23.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 23&amp;#039;&amp;#039; is named {{lang|zh|剝}} (bō), &amp;quot;Stripping&amp;quot;. Other variations include &amp;quot;splitting apart&amp;quot; and &amp;quot;flaying&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Splitting Apart|1=4DD6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 24 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-24.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 24&amp;#039;&amp;#039; is named {{lang|zh|復}} (fù), &amp;quot;Returning&amp;quot;. Other variations include &amp;quot;return (the turning point)&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Return|1=4DD7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 25 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-25.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 25&amp;#039;&amp;#039; is named {{lang|zh|無妄}} (wú wàng), &amp;quot;Without Embroiling&amp;quot;. Other variations include &amp;quot;innocence (the unexpected)&amp;quot; and &amp;quot;pestilence&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Innocence|1=4DD8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 26 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-26.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 26&amp;#039;&amp;#039; is named {{lang|zh|大畜}} (dà xù), &amp;quot;Great Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the great&amp;quot;, &amp;quot;great storage&amp;quot;, and &amp;quot;potential energy&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Taming|1=4DD9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 27 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-27.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 27&amp;#039;&amp;#039; is named {{lang|zh|頤}} (yí), &amp;quot;Swallowing&amp;quot;. Other variations include &amp;quot;the corners of the mouth (providing nourishment)&amp;quot;, &amp;quot;jaws&amp;quot; and &amp;quot;comfort/security&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Mouth Corners|1=4DDA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 28 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-28.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 28&amp;#039;&amp;#039; is named {{lang|zh|大過}} (dà guò), &amp;quot;Great Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the great&amp;quot;, &amp;quot;great surpassing&amp;quot; and &amp;quot;critical mass&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Preponderance|1=4DDB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 29 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-29.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 29&amp;#039;&amp;#039; is named {{lang|zh|坎}} (kǎn), &amp;quot;Gorge&amp;quot;. Other variations include &amp;quot;the [[Abyssal zone|abyss]]&amp;quot; (in the oceanographic sense) and &amp;quot;repeated entrapment&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is  identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Abysmal Water|1=4DDC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 30 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-30.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 30&amp;#039;&amp;#039; is named {{lang|zh|離}} (lí), &amp;quot;Radiance&amp;quot;. Other variations include &amp;quot;the clinging, fire&amp;quot; and &amp;quot;the net&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is  identical. The origin of the character has its roots in symbols of long-tailed birds such as the [[peacock]] or the legendary [[phoenix (mythology)|phoenix]].&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Clinging Fire|1=4DDD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 31 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-31.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 31&amp;#039;&amp;#039; is named {{lang|zh|咸}} (xián), &amp;quot;Conjoining&amp;quot;. Other variations include &amp;quot;influence (wooing)&amp;quot; and &amp;quot;feelings&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Influence|1=4DDE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 32 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-32.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 32&amp;#039;&amp;#039; is named {{lang|zh|恆}} (héng), &amp;quot;Persevering&amp;quot;. Other variations include &amp;quot;duration&amp;quot; and &amp;quot;constancy&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Duration|1=4DDF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 33 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-33.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 33&amp;#039;&amp;#039; is named {{lang|zh|遯}} (dùn), &amp;quot;Retiring&amp;quot;. Other variations include &amp;quot;retreat&amp;quot; and &amp;quot;yielding&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Retreat|1=4DE0|IncludeGB=no}}&lt;br /&gt;
== Hexagram 34 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-34.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 34&amp;#039;&amp;#039; is named {{lang|zh|大壯}} (dà zhuàng), &amp;quot;Great Invigorating&amp;quot;. Other variations include &amp;quot;the power of the great&amp;quot; and &amp;quot;great maturity&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{lang|zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Power|1=4DE1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 35 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-35.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 35&amp;#039;&amp;#039; is named {{lang|zh|晉}} (jìn), &amp;quot;Prospering&amp;quot;. Other variations include &amp;quot;progress&amp;quot; and &amp;quot;aquas&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Progress|1=4DE2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 36 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-36.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 36&amp;#039;&amp;#039; is named {{lang|zh|明夷}} (míng yí), &amp;quot;Darkening of the Light&amp;quot;. Other variations include &amp;quot;brilliance injured&amp;quot; and &amp;quot;intelligence hidden&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Darkening of the Light|1=4DE3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 37 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-37.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 37&amp;#039;&amp;#039; is named {{lang|zh|家人}} (jiā rén), &amp;quot;Dwelling People&amp;quot;. Other variations include &amp;quot;the family (the clan)&amp;quot; and &amp;quot;family members&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Family|1=4DE4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 38 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-38.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 38&amp;#039;&amp;#039; is named {{lang|zh|睽}} (kuí), &amp;quot;Polarising&amp;quot;. Other variations include &amp;quot;opposition&amp;quot; and &amp;quot;perversion&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Opposition|1=4DE5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 39 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-39.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 39&amp;#039;&amp;#039; is named {{lang|zh|蹇}} (jiǎn), &amp;quot;Limping&amp;quot;. Other variations include &amp;quot;obstruction&amp;quot; and &amp;quot;afoot&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Obstruction|1=4DE6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 40 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-40.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 40&amp;#039;&amp;#039; is named {{lang|zh|解}} (xiè), &amp;quot;Taking-Apart&amp;quot;. Other variations include &amp;quot;deliverance&amp;quot; and &amp;quot;untangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Deliverance|1=4DE7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 41 ==&lt;br /&gt;
[[File:Iching-hexagram-41.png|alt=|right|I ching 41- diminishing, {{lang|zh|山泽损}}]]&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 41&amp;#039;&amp;#039; is named {{lang|zh|損}} (sǔn), &amp;quot;Diminishing&amp;quot;. Other variations include &amp;quot;decrease&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Decrease|1=4DE8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 42 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-42.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 42&amp;#039;&amp;#039; is named {{lang|zh|益}} (yì), &amp;quot;Augmenting&amp;quot;. Other variations include &amp;quot;increase&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Increase|1=4DE9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 43 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-43.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 43&amp;#039;&amp;#039; is named {{lang|zh|夬}} (guài), &amp;quot;Displacement&amp;quot;. Other variations include &amp;quot;resoluteness&amp;quot;, &amp;quot;parting&amp;quot;, and &amp;quot;break-through&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Breakthrough|1=4DEA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 44 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-44.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 44&amp;#039;&amp;#039; is named {{lang|zh|姤}} (gòu), &amp;quot;Coupling&amp;quot;. Other variations include &amp;quot;coming to meet&amp;quot; and &amp;quot;meeting&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Coming to Meet|1=4DEB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 45 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-45.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 45&amp;#039;&amp;#039; is named {{lang|zh|萃}} (cuì), &amp;quot;Clustering&amp;quot;. Other variations include &amp;quot;gathering together (massing)&amp;quot; and &amp;quot;finished&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Gathering Together|1=4DEC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 46 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-46.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 46&amp;#039;&amp;#039; is named {{lang|zh|升}} (shēng), &amp;quot;Ascending&amp;quot;. Other variations include &amp;quot;pushing upward&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Pushing Upward|1=4DED|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 47 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-47.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 47&amp;#039;&amp;#039; is named {{lang|zh|困}} (kùn), &amp;quot;Confining&amp;quot;. Other variations include &amp;quot;oppression (exhaustion)&amp;quot; and &amp;quot;entangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Oppression|1=4DEE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 48 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-48.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 48&amp;#039;&amp;#039; is named {{lang|zh|井}} (jǐng), &amp;quot;Welling&amp;quot;. Other variations include &amp;quot;the well&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Well|1=4DEF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 49 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-49.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 49&amp;#039;&amp;#039; is named {{lang|zh|革}} (gé), &amp;quot;Skinning&amp;quot;. Other variations include &amp;quot;revolution (molting)&amp;quot; and &amp;quot;the bridle&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Revolution|1=4DF0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 50 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-50.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 50&amp;#039;&amp;#039; is named {{lang|zh|鼎}} (dǐng), &amp;quot;Holding&amp;quot;. Other variations include &amp;quot;the cauldron&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Cauldron|1=4DF1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 51 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-51.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 51&amp;#039;&amp;#039; is named {{lang|zh|震}} (zhèn), &amp;quot;Shake&amp;quot;. Other variations include &amp;quot;the arousing (shock, thunder)&amp;quot; and &amp;quot;thunder&amp;quot;. Both its inner and outer trigrams are ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Arousing Thunder|1=4DF2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 52 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-52.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 52&amp;#039;&amp;#039; is named {{lang|zh|艮}} (gèn), &amp;quot;Bound&amp;quot;. Other variations include &amp;quot;keeping still, mountain&amp;quot; and &amp;quot;stilling&amp;quot;. Both its inner and outer trigrams are ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Keeping Still Mountain|1=4DF3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 53 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-53.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 53&amp;#039;&amp;#039; is named {{lang|zh|漸}} (jiàn), &amp;quot;Infiltrating&amp;quot;. Other variations include &amp;quot;development (gradual progress)&amp;quot; and &amp;quot;advancement&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Development|1=4DF4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 54 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-54.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 54&amp;#039;&amp;#039; is named {{lang|zh|歸妹}} (guī mèi), &amp;quot;Converting the Maiden&amp;quot;. Other variations include &amp;quot;the marrying maiden&amp;quot; and &amp;quot;returning maiden&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Marrying Maiden|1=4DF5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 55 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-55.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 55&amp;#039;&amp;#039; is named {{lang|zh|豐}} (fēng), &amp;quot;Abounding&amp;quot;. Other variations include &amp;quot;abundance&amp;quot; and &amp;quot;fullness&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Water (Wu Xing)|火]]}}) fire, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Abundance|1=4DF6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 56 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-56.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 56&amp;#039;&amp;#039; is named {{lang|zh|旅}} (lǚ), &amp;quot;Sojourning&amp;quot;. Other variations include &amp;quot;the wanderer&amp;quot; and &amp;quot;traveling&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Wanderer|1=4DF7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 57 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-57.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 57&amp;#039;&amp;#039; is named {{linktext|lang=zh|巽}} (xùn), &amp;quot;Ground&amp;quot;. Other variations include &amp;quot;the gentle (the penetrating, wind)&amp;quot; and &amp;quot;calculations&amp;quot;. Both its inner and outer trigrams are ☴ ({{linktext|lang=zh|巽}} xùn) ground = ({{linktext|lang=zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Gentle Wind|1=4DF8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 58 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-58.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 58&amp;#039;&amp;#039; is named {{lang|zh|兌}} (duì), &amp;quot;Open&amp;quot;. Other variations include &amp;quot;the joyous, lake&amp;quot; and &amp;quot;usurpation&amp;quot;. Both its inner and outer trigrams are ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Joyous Lake|1=4DF9|IncludeGB=no}}&lt;br /&gt;
== Hexagram 59 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-59.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 59&amp;#039;&amp;#039; is named {{lang|zh|渙}} (huàn), &amp;quot;Dispersing&amp;quot;. Other variations include &amp;quot;dispersion (dissolution)&amp;quot; and &amp;quot;dispersal&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Dispersion|1=4DFA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 60 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-60.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 60&amp;#039;&amp;#039; is named {{lang|zh|節}} (jié), &amp;quot;Articulating&amp;quot;. Other variations include &amp;quot;limitation&amp;quot; and &amp;quot;moderation&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Limitation|1=4DFB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 61 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-61.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 61&amp;#039;&amp;#039; is named {{lang|zh|中孚}} (zhōng fú), &amp;quot;Center Returning&amp;quot;. Other variations include &amp;quot;inner truth&amp;quot; and &amp;quot;central return&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Inner Truth|1=4DFC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 62 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-62.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 62&amp;#039;&amp;#039; is named {{lang|zh|小過}} (xiǎo guò), &amp;quot;Small Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the small&amp;quot; and &amp;quot;small surpassing&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Preponderance|1=4DFD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 63 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-63.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 63&amp;#039;&amp;#039; is named {{lang|zh|既濟}} (jì jì), &amp;quot;Already Fording&amp;quot;. Other variations include &amp;quot;after completion&amp;quot; and &amp;quot;already completed&amp;quot; or &amp;quot;already done&amp;quot; . Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for After Completion|1=4DFE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 64 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-64.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 64&amp;#039;&amp;#039; is named {{lang|zh|未濟}} (wèi jì), &amp;quot;Not Yet Fording&amp;quot;. Other variations include &amp;quot;before completion&amp;quot; and &amp;quot;not yet completed&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Before Completion|1=4DFF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
| {{I Ching}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
| {{Taoism condensed}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{in lang|en|fr}} [http://wengu.tartarie.com/wg/wengu.php?l=Yijing Wilhelm, Baynes “The I Ching or Book of Changes”] &amp;lt;small&amp;gt;(Association Française des Professeurs de Chinois)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Asia topic|Literature of}}&lt;br /&gt;
&lt;br /&gt;
[[Category:I Ching]]&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1917</id>
		<title>I-Ching</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1917"/>
				<updated>2021-06-23T14:17:52Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{short description|Wikimedia list article}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{DISPLAYTITLE:List of hexagrams of the &amp;#039;&amp;#039;I Ching&amp;#039;&amp;#039;}}&lt;br /&gt;
This is a list of the 64 &amp;#039;&amp;#039;&amp;#039;[[Hexagram (I Ching)|hexagrams]]&amp;#039;&amp;#039;&amp;#039; of the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[I Ching]]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;Book of Changes&amp;#039;&amp;#039;, and their [[Template:Unicode chart Yijing Hexagram Symbols|Unicode character codes]].&lt;br /&gt;
&lt;br /&gt;
This list is in [[King Wen sequence|King Wen order]]. (Cf. [[King Wen sequence#Other hexagram sequences|other hexagram sequences]].)&lt;br /&gt;
&lt;br /&gt;
{{I Ching/Table}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 1 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-01.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 1&amp;#039;&amp;#039; is named {{lang|zh|乾}} (qián), &amp;quot;Force&amp;quot;. Other variations include &amp;quot;the creative&amp;quot;, &amp;quot;strong action&amp;quot;, &amp;quot;the key&amp;quot;,  and &amp;quot;god&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is the same.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Creative Heaven|1=4DC0|IncludeGB=no}}&amp;lt;!-- Note: setting IncludeGB to yes throughout breaks the page with “Node-count limit exceeded” errors --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Hexagram 2 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-02.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 2&amp;#039;&amp;#039; is named {{lang|zh|坤}} (kūn), &amp;quot;Field&amp;quot;. Other variations include &amp;quot;the receptive&amp;quot;, &amp;quot;acquiescence&amp;quot;, and &amp;quot;the flow&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Receptive Earth|1=4DC1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 3 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-03.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 3&amp;#039;&amp;#039; is named {{lang|zh|屯}} (zhūn), &amp;quot;Sprouting&amp;quot;. Other variations include &amp;quot;difficulty at the beginning&amp;quot;, &amp;quot;gathering support&amp;quot;, and &amp;quot;hoarding&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Difficulty at the Beginning|1=4DC2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 4 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-04.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 4&amp;#039;&amp;#039; is named {{lang|zh|蒙}} (méng), &amp;quot;Enveloping&amp;quot;. Other variations include &amp;quot;youthful folly&amp;quot;, &amp;quot;the young shoot&amp;quot;, and &amp;quot;discovering&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water. Its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Youthful Folly|1=4DC3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 5 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-05.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 5&amp;#039;&amp;#039; is named {{lang|zh|需}} (xū), &amp;quot;Attending&amp;quot;. Other variations include &amp;quot;waiting&amp;quot;, &amp;quot;moistened&amp;quot;, and &amp;quot;arriving&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Waiting|1=4DC4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 6 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-06.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 6&amp;#039;&amp;#039; is named {{lang|zh|訟}} (sòng), &amp;quot;Arguing&amp;quot;. Other variations include &amp;quot;conflict&amp;quot; and &amp;quot;lawsuit&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Conflict|1=4DC5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 7 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-07.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 7&amp;#039;&amp;#039; is named {{lang|zh|師}}  (shī), &amp;quot;Leading&amp;quot;. Other variations include &amp;quot;the army&amp;quot; and &amp;quot;the troops&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[水]]}}) water, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Army|1=4DC6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 8 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-08.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 8&amp;#039;&amp;#039; is named {{lang|zh|比}}  (bǐ), &amp;quot;Grouping&amp;quot;. Other variations include &amp;quot;holding together&amp;quot; and &amp;quot;alliance&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Holding Together|1=4DC7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 9 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-09.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 9&amp;#039;&amp;#039; is named {{lang|zh|小畜}}  (xiǎo xù), &amp;quot;Small Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the small&amp;quot; and &amp;quot;small harvest&amp;quot;. Its inner (lower) trigram is  ☰ ({{lang|zh|乾}}  qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) trigram is ☴ ({{lang|zh|巽}}  xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Taming|1=4DC8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 10 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-10.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 10&amp;#039;&amp;#039; is named {{lang|zh|履}} (lǚ), &amp;quot;Treading&amp;quot;. Other variations include &amp;quot;treading (conduct)&amp;quot; and &amp;quot;continuing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|[[澤]]}}) swamp, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Treading|1=4DC9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 11 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-11.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 11&amp;#039;&amp;#039; is named {{lang|zh|泰}} (tài), &amp;quot;Pervading&amp;quot;. Other variations include &amp;quot;peace&amp;quot; and &amp;quot;greatness&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Peace|1=4DCA|IncludeGB=no}}&lt;br /&gt;
== Hexagram 12 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-12.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 12&amp;#039;&amp;#039; is named {{lang|zh|否}} (pǐ), &amp;quot;Obstruction&amp;quot;. Other variations include &amp;quot;standstill (stagnation)&amp;quot; and &amp;quot;selfish persons&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Standstill|1=4DCB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 13 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-13.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 13&amp;#039;&amp;#039; is named {{lang|zh|同人}} (tóng rén), &amp;quot;Concording People&amp;quot;. Other variations include &amp;quot;fellowship with men&amp;quot; and &amp;quot;gathering men&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Fellowship|1=4DCC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 14 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-14.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 14&amp;#039;&amp;#039; is named {{lang|zh|大有}} (dà yǒu), &amp;quot;Great Possessing&amp;quot;. Other variations include &amp;quot;possession in great measure&amp;quot; and &amp;quot;the great possession&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Possession|1=4DCD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 15 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-15.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 15&amp;#039;&amp;#039; is named {{lang|zh|謙}} (qiān), &amp;quot;Humbling&amp;quot;. Other variations include &amp;quot;modesty&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain and its outer (upper) [[trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Modesty|1=4DCE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 16 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-16.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 16&amp;#039;&amp;#039; is named {{lang|zh|豫}} (yù), &amp;quot;Providing-For&amp;quot;. Other variations include &amp;quot;enthusiasm&amp;quot; and &amp;quot;excess&amp;quot;. Its inner  (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Enthusiasm|1=4DCF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 17 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-17.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 17&amp;#039;&amp;#039; is named {{lang|zh|隨}} (suí), &amp;quot;Following&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Following|1=4DD0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 18 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-18.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 18&amp;#039;&amp;#039; is named {{lang|zh|蠱}} (gǔ), &amp;quot;Correcting&amp;quot;. Other variations include &amp;quot;work on what has been spoiled (decay)&amp;quot;, &amp;#039;&amp;#039;decaying&amp;#039;&amp;#039; and &amp;quot;branch&amp;quot;.&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
   | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2001&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot&amp;#039;s+guide+to+I+Ching+%22Yu%22&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt; Its inner (lower) [[Ba gua|trigram]] is  ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer (upper) trigram is ☶ ({{lang|zh|艮 gèn}}) bound = ({{lang|zh|[[山]]}}) mountain. &amp;#039;&amp;#039;[[Gu (poison)|Gu]]&amp;#039;&amp;#039; is the name of a venom-based poison traditionally used in Chinese witchcraft.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Work on the Decayed|1=4DD1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 19 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-19.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 19&amp;#039;&amp;#039; is named {{lang|zh|臨}} (lín), &amp;quot;Nearing&amp;quot;. Other variations include &amp;quot;approach&amp;quot; and &amp;quot;the forest&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Approach|1=4DD2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 20 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-20.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 20&amp;#039;&amp;#039; is named {{lang|zh|觀}} (guān), &amp;quot;Viewing&amp;quot;. Other variations include &amp;quot;contemplation (view)&amp;quot; and &amp;quot;looking up&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Contemplation|1=4DD3|IncludeGB=no}}&lt;br /&gt;
== Hexagram 21 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-21.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 21&amp;#039;&amp;#039; is named {{lang|zh|噬嗑}} (shì kè), &amp;quot;Gnawing Bite&amp;quot;. Other variations include &amp;quot;biting through&amp;quot; and &amp;quot;biting and chewing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Shi+He%22+%22Gnawing%22&amp;amp;pg=PA128&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
{{charmap|name1=Hexagram for Biting Through|1=4DD4|IncludeGB=no}}&lt;br /&gt;
== Hexagram 22 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-22.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 22&amp;#039;&amp;#039; is named {{lang|zh|賁}} (bì), &amp;quot;Adorning&amp;quot;. Other variations include &amp;quot;grace&amp;quot; and &amp;quot;luxuriance&amp;quot;. Its inner (lower) [[bagua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer (upper) [[trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Bi%22+%22Adorning%22&amp;amp;pg=PA130&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Grace|1=4DD5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 23 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-23.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 23&amp;#039;&amp;#039; is named {{lang|zh|剝}} (bō), &amp;quot;Stripping&amp;quot;. Other variations include &amp;quot;splitting apart&amp;quot; and &amp;quot;flaying&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Splitting Apart|1=4DD6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 24 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-24.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 24&amp;#039;&amp;#039; is named {{lang|zh|復}} (fù), &amp;quot;Returning&amp;quot;. Other variations include &amp;quot;return (the turning point)&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Return|1=4DD7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 25 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-25.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 25&amp;#039;&amp;#039; is named {{lang|zh|無妄}} (wú wàng), &amp;quot;Without Embroiling&amp;quot;. Other variations include &amp;quot;innocence (the unexpected)&amp;quot; and &amp;quot;pestilence&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Innocence|1=4DD8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 26 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-26.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 26&amp;#039;&amp;#039; is named {{lang|zh|大畜}} (dà xù), &amp;quot;Great Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the great&amp;quot;, &amp;quot;great storage&amp;quot;, and &amp;quot;potential energy&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Taming|1=4DD9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 27 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-27.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 27&amp;#039;&amp;#039; is named {{lang|zh|頤}} (yí), &amp;quot;Swallowing&amp;quot;. Other variations include &amp;quot;the corners of the mouth (providing nourishment)&amp;quot;, &amp;quot;jaws&amp;quot; and &amp;quot;comfort/security&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Mouth Corners|1=4DDA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 28 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-28.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 28&amp;#039;&amp;#039; is named {{lang|zh|大過}} (dà guò), &amp;quot;Great Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the great&amp;quot;, &amp;quot;great surpassing&amp;quot; and &amp;quot;critical mass&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Preponderance|1=4DDB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 29 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-29.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 29&amp;#039;&amp;#039; is named {{lang|zh|坎}} (kǎn), &amp;quot;Gorge&amp;quot;. Other variations include &amp;quot;the [[Abyssal zone|abyss]]&amp;quot; (in the oceanographic sense) and &amp;quot;repeated entrapment&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is  identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Abysmal Water|1=4DDC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 30 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-30.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 30&amp;#039;&amp;#039; is named {{lang|zh|離}} (lí), &amp;quot;Radiance&amp;quot;. Other variations include &amp;quot;the clinging, fire&amp;quot; and &amp;quot;the net&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is  identical. The origin of the character has its roots in symbols of long-tailed birds such as the [[peacock]] or the legendary [[phoenix (mythology)|phoenix]].&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Clinging Fire|1=4DDD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 31 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-31.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 31&amp;#039;&amp;#039; is named {{lang|zh|咸}} (xián), &amp;quot;Conjoining&amp;quot;. Other variations include &amp;quot;influence (wooing)&amp;quot; and &amp;quot;feelings&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Influence|1=4DDE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 32 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-32.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 32&amp;#039;&amp;#039; is named {{lang|zh|恆}} (héng), &amp;quot;Persevering&amp;quot;. Other variations include &amp;quot;duration&amp;quot; and &amp;quot;constancy&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Duration|1=4DDF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 33 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-33.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 33&amp;#039;&amp;#039; is named {{lang|zh|遯}} (dùn), &amp;quot;Retiring&amp;quot;. Other variations include &amp;quot;retreat&amp;quot; and &amp;quot;yielding&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Retreat|1=4DE0|IncludeGB=no}}&lt;br /&gt;
== Hexagram 34 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-34.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 34&amp;#039;&amp;#039; is named {{lang|zh|大壯}} (dà zhuàng), &amp;quot;Great Invigorating&amp;quot;. Other variations include &amp;quot;the power of the great&amp;quot; and &amp;quot;great maturity&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{lang|zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Power|1=4DE1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 35 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-35.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 35&amp;#039;&amp;#039; is named {{lang|zh|晉}} (jìn), &amp;quot;Prospering&amp;quot;. Other variations include &amp;quot;progress&amp;quot; and &amp;quot;aquas&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Progress|1=4DE2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 36 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-36.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 36&amp;#039;&amp;#039; is named {{lang|zh|明夷}} (míng yí), &amp;quot;Darkening of the Light&amp;quot;. Other variations include &amp;quot;brilliance injured&amp;quot; and &amp;quot;intelligence hidden&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Darkening of the Light|1=4DE3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 37 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-37.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 37&amp;#039;&amp;#039; is named {{lang|zh|家人}} (jiā rén), &amp;quot;Dwelling People&amp;quot;. Other variations include &amp;quot;the family (the clan)&amp;quot; and &amp;quot;family members&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Family|1=4DE4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 38 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-38.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 38&amp;#039;&amp;#039; is named {{lang|zh|睽}} (kuí), &amp;quot;Polarising&amp;quot;. Other variations include &amp;quot;opposition&amp;quot; and &amp;quot;perversion&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Opposition|1=4DE5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 39 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-39.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 39&amp;#039;&amp;#039; is named {{lang|zh|蹇}} (jiǎn), &amp;quot;Limping&amp;quot;. Other variations include &amp;quot;obstruction&amp;quot; and &amp;quot;afoot&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Obstruction|1=4DE6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 40 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-40.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 40&amp;#039;&amp;#039; is named {{lang|zh|解}} (xiè), &amp;quot;Taking-Apart&amp;quot;. Other variations include &amp;quot;deliverance&amp;quot; and &amp;quot;untangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Deliverance|1=4DE7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 41 ==&lt;br /&gt;
[[File:Iching-hexagram-41.png|alt=|right|I ching 41- diminishing, {{lang|zh|山泽损}}]]&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 41&amp;#039;&amp;#039; is named {{lang|zh|損}} (sǔn), &amp;quot;Diminishing&amp;quot;. Other variations include &amp;quot;decrease&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Decrease|1=4DE8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 42 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-42.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 42&amp;#039;&amp;#039; is named {{lang|zh|益}} (yì), &amp;quot;Augmenting&amp;quot;. Other variations include &amp;quot;increase&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Increase|1=4DE9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 43 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-43.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 43&amp;#039;&amp;#039; is named {{lang|zh|夬}} (guài), &amp;quot;Displacement&amp;quot;. Other variations include &amp;quot;resoluteness&amp;quot;, &amp;quot;parting&amp;quot;, and &amp;quot;break-through&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Breakthrough|1=4DEA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 44 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-44.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 44&amp;#039;&amp;#039; is named {{lang|zh|姤}} (gòu), &amp;quot;Coupling&amp;quot;. Other variations include &amp;quot;coming to meet&amp;quot; and &amp;quot;meeting&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Coming to Meet|1=4DEB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 45 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-45.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 45&amp;#039;&amp;#039; is named {{lang|zh|萃}} (cuì), &amp;quot;Clustering&amp;quot;. Other variations include &amp;quot;gathering together (massing)&amp;quot; and &amp;quot;finished&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Gathering Together|1=4DEC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 46 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-46.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 46&amp;#039;&amp;#039; is named {{lang|zh|升}} (shēng), &amp;quot;Ascending&amp;quot;. Other variations include &amp;quot;pushing upward&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Pushing Upward|1=4DED|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 47 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-47.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 47&amp;#039;&amp;#039; is named {{lang|zh|困}} (kùn), &amp;quot;Confining&amp;quot;. Other variations include &amp;quot;oppression (exhaustion)&amp;quot; and &amp;quot;entangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Oppression|1=4DEE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 48 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-48.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 48&amp;#039;&amp;#039; is named {{lang|zh|井}} (jǐng), &amp;quot;Welling&amp;quot;. Other variations include &amp;quot;the well&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Well|1=4DEF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 49 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-49.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 49&amp;#039;&amp;#039; is named {{lang|zh|革}} (gé), &amp;quot;Skinning&amp;quot;. Other variations include &amp;quot;revolution (molting)&amp;quot; and &amp;quot;the bridle&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Revolution|1=4DF0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 50 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-50.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 50&amp;#039;&amp;#039; is named {{lang|zh|鼎}} (dǐng), &amp;quot;Holding&amp;quot;. Other variations include &amp;quot;the cauldron&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Cauldron|1=4DF1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 51 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-51.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 51&amp;#039;&amp;#039; is named {{lang|zh|震}} (zhèn), &amp;quot;Shake&amp;quot;. Other variations include &amp;quot;the arousing (shock, thunder)&amp;quot; and &amp;quot;thunder&amp;quot;. Both its inner and outer trigrams are ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Arousing Thunder|1=4DF2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 52 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-52.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 52&amp;#039;&amp;#039; is named {{lang|zh|艮}} (gèn), &amp;quot;Bound&amp;quot;. Other variations include &amp;quot;keeping still, mountain&amp;quot; and &amp;quot;stilling&amp;quot;. Both its inner and outer trigrams are ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Keeping Still Mountain|1=4DF3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 53 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-53.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 53&amp;#039;&amp;#039; is named {{lang|zh|漸}} (jiàn), &amp;quot;Infiltrating&amp;quot;. Other variations include &amp;quot;development (gradual progress)&amp;quot; and &amp;quot;advancement&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Development|1=4DF4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 54 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-54.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 54&amp;#039;&amp;#039; is named {{lang|zh|歸妹}} (guī mèi), &amp;quot;Converting the Maiden&amp;quot;. Other variations include &amp;quot;the marrying maiden&amp;quot; and &amp;quot;returning maiden&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Marrying Maiden|1=4DF5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 55 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-55.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 55&amp;#039;&amp;#039; is named {{lang|zh|豐}} (fēng), &amp;quot;Abounding&amp;quot;. Other variations include &amp;quot;abundance&amp;quot; and &amp;quot;fullness&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Water (Wu Xing)|火]]}}) fire, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Abundance|1=4DF6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 56 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-56.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 56&amp;#039;&amp;#039; is named {{lang|zh|旅}} (lǚ), &amp;quot;Sojourning&amp;quot;. Other variations include &amp;quot;the wanderer&amp;quot; and &amp;quot;traveling&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Wanderer|1=4DF7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 57 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-57.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 57&amp;#039;&amp;#039; is named {{linktext|lang=zh|巽}} (xùn), &amp;quot;Ground&amp;quot;. Other variations include &amp;quot;the gentle (the penetrating, wind)&amp;quot; and &amp;quot;calculations&amp;quot;. Both its inner and outer trigrams are ☴ ({{linktext|lang=zh|巽}} xùn) ground = ({{linktext|lang=zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Gentle Wind|1=4DF8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 58 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-58.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 58&amp;#039;&amp;#039; is named {{lang|zh|兌}} (duì), &amp;quot;Open&amp;quot;. Other variations include &amp;quot;the joyous, lake&amp;quot; and &amp;quot;usurpation&amp;quot;. Both its inner and outer trigrams are ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Joyous Lake|1=4DF9|IncludeGB=no}}&lt;br /&gt;
== Hexagram 59 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-59.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 59&amp;#039;&amp;#039; is named {{lang|zh|渙}} (huàn), &amp;quot;Dispersing&amp;quot;. Other variations include &amp;quot;dispersion (dissolution)&amp;quot; and &amp;quot;dispersal&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Dispersion|1=4DFA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 60 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-60.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 60&amp;#039;&amp;#039; is named {{lang|zh|節}} (jié), &amp;quot;Articulating&amp;quot;. Other variations include &amp;quot;limitation&amp;quot; and &amp;quot;moderation&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Limitation|1=4DFB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 61 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-61.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 61&amp;#039;&amp;#039; is named {{lang|zh|中孚}} (zhōng fú), &amp;quot;Center Returning&amp;quot;. Other variations include &amp;quot;inner truth&amp;quot; and &amp;quot;central return&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Inner Truth|1=4DFC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 62 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-62.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 62&amp;#039;&amp;#039; is named {{lang|zh|小過}} (xiǎo guò), &amp;quot;Small Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the small&amp;quot; and &amp;quot;small surpassing&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Preponderance|1=4DFD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 63 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-63.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 63&amp;#039;&amp;#039; is named {{lang|zh|既濟}} (jì jì), &amp;quot;Already Fording&amp;quot;. Other variations include &amp;quot;after completion&amp;quot; and &amp;quot;already completed&amp;quot; or &amp;quot;already done&amp;quot; . Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for After Completion|1=4DFE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 64 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-64.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 64&amp;#039;&amp;#039; is named {{lang|zh|未濟}} (wèi jì), &amp;quot;Not Yet Fording&amp;quot;. Other variations include &amp;quot;before completion&amp;quot; and &amp;quot;not yet completed&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Before Completion|1=4DFF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
| {{I Ching}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
| {{Taoism condensed}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{in lang|en|fr}} [http://wengu.tartarie.com/wg/wengu.php?l=Yijing Wilhelm, Baynes “The I Ching or Book of Changes”] &amp;lt;small&amp;gt;(Association Française des Professeurs de Chinois)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Asia topic|Literature of}}&lt;br /&gt;
&lt;br /&gt;
[[Category:I Ching]]&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	<entry>
		<id>https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1916</id>
		<title>I-Ching</title>
		<link rel="alternate" type="text/html" href="https://pdkb.chivanet.org/wiki/index.php?title=I-Ching&amp;diff=1916"/>
				<updated>2021-06-23T14:16:43Z</updated>
		
		<summary type="html">&lt;p&gt;Jawitkien: Initial page is a copy of&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{short description|Wikimedia list article}}&lt;br /&gt;
__NOTOC__&lt;br /&gt;
{{DISPLAYTITLE:List of hexagrams of the &amp;#039;&amp;#039;I Ching&amp;#039;&amp;#039;}}&lt;br /&gt;
This is a list of the 64 &amp;#039;&amp;#039;&amp;#039;[[Hexagram (I Ching)|hexagrams]]&amp;#039;&amp;#039;&amp;#039; of the &amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;[[I Ching]]&amp;#039;&amp;#039;&amp;#039;&amp;#039;&amp;#039;, or &amp;#039;&amp;#039;Book of Changes&amp;#039;&amp;#039;, and their [[Template:Unicode chart Yijing Hexagram Symbols|Unicode character codes]].&lt;br /&gt;
&lt;br /&gt;
This list is in [[King Wen sequence|King Wen order]]. (Cf. [[King Wen sequence#Other hexagram sequences|other hexagram sequences]].)&lt;br /&gt;
&lt;br /&gt;
{{I Ching}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 1 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-01.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 1&amp;#039;&amp;#039; is named {{lang|zh|乾}} (qián), &amp;quot;Force&amp;quot;. Other variations include &amp;quot;the creative&amp;quot;, &amp;quot;strong action&amp;quot;, &amp;quot;the key&amp;quot;,  and &amp;quot;god&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is the same.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Creative Heaven|1=4DC0|IncludeGB=no}}&amp;lt;!-- Note: setting IncludeGB to yes throughout breaks the page with “Node-count limit exceeded” errors --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Hexagram 2 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-02.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 2&amp;#039;&amp;#039; is named {{lang|zh|坤}} (kūn), &amp;quot;Field&amp;quot;. Other variations include &amp;quot;the receptive&amp;quot;, &amp;quot;acquiescence&amp;quot;, and &amp;quot;the flow&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Receptive Earth|1=4DC1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 3 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-03.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 3&amp;#039;&amp;#039; is named {{lang|zh|屯}} (zhūn), &amp;quot;Sprouting&amp;quot;. Other variations include &amp;quot;difficulty at the beginning&amp;quot;, &amp;quot;gathering support&amp;quot;, and &amp;quot;hoarding&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Difficulty at the Beginning|1=4DC2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 4 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-04.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 4&amp;#039;&amp;#039; is named {{lang|zh|蒙}} (méng), &amp;quot;Enveloping&amp;quot;. Other variations include &amp;quot;youthful folly&amp;quot;, &amp;quot;the young shoot&amp;quot;, and &amp;quot;discovering&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water. Its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Youthful Folly|1=4DC3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 5 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-05.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 5&amp;#039;&amp;#039; is named {{lang|zh|需}} (xū), &amp;quot;Attending&amp;quot;. Other variations include &amp;quot;waiting&amp;quot;, &amp;quot;moistened&amp;quot;, and &amp;quot;arriving&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Waiting|1=4DC4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 6 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-06.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 6&amp;#039;&amp;#039; is named {{lang|zh|訟}} (sòng), &amp;quot;Arguing&amp;quot;. Other variations include &amp;quot;conflict&amp;quot; and &amp;quot;lawsuit&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Conflict|1=4DC5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 7 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-07.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 7&amp;#039;&amp;#039; is named {{lang|zh|師}}  (shī), &amp;quot;Leading&amp;quot;. Other variations include &amp;quot;the army&amp;quot; and &amp;quot;the troops&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[水]]}}) water, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Army|1=4DC6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 8 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-08.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 8&amp;#039;&amp;#039; is named {{lang|zh|比}}  (bǐ), &amp;quot;Grouping&amp;quot;. Other variations include &amp;quot;holding together&amp;quot; and &amp;quot;alliance&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}}  kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☵ ({{lang|zh|坎}}  kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Holding Together|1=4DC7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 9 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-09.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 9&amp;#039;&amp;#039; is named {{lang|zh|小畜}}  (xiǎo xù), &amp;quot;Small Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the small&amp;quot; and &amp;quot;small harvest&amp;quot;. Its inner (lower) trigram is  ☰ ({{lang|zh|乾}}  qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) trigram is ☴ ({{lang|zh|巽}}  xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Taming|1=4DC8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 10 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-10.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 10&amp;#039;&amp;#039; is named {{lang|zh|履}} (lǚ), &amp;quot;Treading&amp;quot;. Other variations include &amp;quot;treading (conduct)&amp;quot; and &amp;quot;continuing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|[[澤]]}}) swamp, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Treading|1=4DC9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 11 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-11.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 11&amp;#039;&amp;#039; is named {{lang|zh|泰}} (tài), &amp;quot;Pervading&amp;quot;. Other variations include &amp;quot;peace&amp;quot; and &amp;quot;greatness&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Peace|1=4DCA|IncludeGB=no}}&lt;br /&gt;
== Hexagram 12 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-12.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 12&amp;#039;&amp;#039; is named {{lang|zh|否}} (pǐ), &amp;quot;Obstruction&amp;quot;. Other variations include &amp;quot;standstill (stagnation)&amp;quot; and &amp;quot;selfish persons&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Standstill|1=4DCB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 13 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-13.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 13&amp;#039;&amp;#039; is named {{lang|zh|同人}} (tóng rén), &amp;quot;Concording People&amp;quot;. Other variations include &amp;quot;fellowship with men&amp;quot; and &amp;quot;gathering men&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer (upper) [[trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Fellowship|1=4DCC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 14 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-14.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 14&amp;#039;&amp;#039; is named {{lang|zh|大有}} (dà yǒu), &amp;quot;Great Possessing&amp;quot;. Other variations include &amp;quot;possession in great measure&amp;quot; and &amp;quot;the great possession&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven, and its outer (upper) [[trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Possession|1=4DCD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 15 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-15.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 15&amp;#039;&amp;#039; is named {{lang|zh|謙}} (qiān), &amp;quot;Humbling&amp;quot;. Other variations include &amp;quot;modesty&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain and its outer (upper) [[trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Modesty|1=4DCE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 16 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-16.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 16&amp;#039;&amp;#039; is named {{lang|zh|豫}} (yù), &amp;quot;Providing-For&amp;quot;. Other variations include &amp;quot;enthusiasm&amp;quot; and &amp;quot;excess&amp;quot;. Its inner  (lower) [[Ba gua|trigram]] is  ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Enthusiasm|1=4DCF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 17 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-17.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 17&amp;#039;&amp;#039; is named {{lang|zh|隨}} (suí), &amp;quot;Following&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is  ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer (upper) [[trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Following|1=4DD0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 18 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-18.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 18&amp;#039;&amp;#039; is named {{lang|zh|蠱}} (gǔ), &amp;quot;Correcting&amp;quot;. Other variations include &amp;quot;work on what has been spoiled (decay)&amp;quot;, &amp;#039;&amp;#039;decaying&amp;#039;&amp;#039; and &amp;quot;branch&amp;quot;.&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
   | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2001&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot&amp;#039;s+guide+to+I+Ching+%22Yu%22&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt; Its inner (lower) [[Ba gua|trigram]] is  ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer (upper) trigram is ☶ ({{lang|zh|艮 gèn}}) bound = ({{lang|zh|[[山]]}}) mountain. &amp;#039;&amp;#039;[[Gu (poison)|Gu]]&amp;#039;&amp;#039; is the name of a venom-based poison traditionally used in Chinese witchcraft.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Work on the Decayed|1=4DD1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 19 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-19.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 19&amp;#039;&amp;#039; is named {{lang|zh|臨}} (lín), &amp;quot;Nearing&amp;quot;. Other variations include &amp;quot;approach&amp;quot; and &amp;quot;the forest&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer (upper) [[trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Approach|1=4DD2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 20 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-20.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 20&amp;#039;&amp;#039; is named {{lang|zh|觀}} (guān), &amp;quot;Viewing&amp;quot;. Other variations include &amp;quot;contemplation (view)&amp;quot; and &amp;quot;looking up&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth, and its outer (upper) [[trigram]] is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Contemplation|1=4DD3|IncludeGB=no}}&lt;br /&gt;
== Hexagram 21 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-21.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 21&amp;#039;&amp;#039; is named {{lang|zh|噬嗑}} (shì kè), &amp;quot;Gnawing Bite&amp;quot;. Other variations include &amp;quot;biting through&amp;quot; and &amp;quot;biting and chewing&amp;quot;. Its inner (lower) [[Ba gua|trigram]] is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Shi+He%22+%22Gnawing%22&amp;amp;pg=PA128&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
{{charmap|name1=Hexagram for Biting Through|1=4DD4|IncludeGB=no}}&lt;br /&gt;
== Hexagram 22 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-22.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 22&amp;#039;&amp;#039; is named {{lang|zh|賁}} (bì), &amp;quot;Adorning&amp;quot;. Other variations include &amp;quot;grace&amp;quot; and &amp;quot;luxuriance&amp;quot;. Its inner (lower) [[bagua|trigram]] is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer (upper) [[trigram]] is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&amp;lt;ref&amp;gt;{{cite book&lt;br /&gt;
  | last = Moran&lt;br /&gt;
  | first = Elizabeth&lt;br /&gt;
  |author2=Joseph Yu&lt;br /&gt;
  | title = The Complete Idiot&amp;#039;s Guide to the I Ching&lt;br /&gt;
  | year = 2002&lt;br /&gt;
  | publisher = Alpha (Pearson)&lt;br /&gt;
  | url = https://books.google.com/books?id=1CK2efLIY7sC&amp;amp;q=The+completely+Idiot%27s+guide+to+I+Ching+%22Bi%22+%22Adorning%22&amp;amp;pg=PA130&lt;br /&gt;
  | isbn = 9780028639796&lt;br /&gt;
 | access-date = 16 October 2008&lt;br /&gt;
  }}&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Grace|1=4DD5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 23 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-23.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 23&amp;#039;&amp;#039; is named {{lang|zh|剝}} (bō), &amp;quot;Stripping&amp;quot;. Other variations include &amp;quot;splitting apart&amp;quot; and &amp;quot;flaying&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Splitting Apart|1=4DD6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 24 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-24.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 24&amp;#039;&amp;#039; is named {{lang|zh|復}} (fù), &amp;quot;Returning&amp;quot;. Other variations include &amp;quot;return (the turning point)&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|[[地]]}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Return|1=4DD7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 25 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-25.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 25&amp;#039;&amp;#039; is named {{lang|zh|無妄}} (wú wàng), &amp;quot;Without Embroiling&amp;quot;. Other variations include &amp;quot;innocence (the unexpected)&amp;quot; and &amp;quot;pestilence&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|[[天]]}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Innocence|1=4DD8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 26 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-26.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 26&amp;#039;&amp;#039; is named {{lang|zh|大畜}} (dà xù), &amp;quot;Great Accumulating&amp;quot;. Other variations include &amp;quot;the taming power of the great&amp;quot;, &amp;quot;great storage&amp;quot;, and &amp;quot;potential energy&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Taming|1=4DD9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 27 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-27.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 27&amp;#039;&amp;#039; is named {{lang|zh|頤}} (yí), &amp;quot;Swallowing&amp;quot;. Other variations include &amp;quot;the corners of the mouth (providing nourishment)&amp;quot;, &amp;quot;jaws&amp;quot; and &amp;quot;comfort/security&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Mouth Corners|1=4DDA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 28 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-28.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 28&amp;#039;&amp;#039; is named {{lang|zh|大過}} (dà guò), &amp;quot;Great Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the great&amp;quot;, &amp;quot;great surpassing&amp;quot; and &amp;quot;critical mass&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Preponderance|1=4DDB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 29 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-29.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 29&amp;#039;&amp;#039; is named {{lang|zh|坎}} (kǎn), &amp;quot;Gorge&amp;quot;. Other variations include &amp;quot;the [[Abyssal zone|abyss]]&amp;quot; (in the oceanographic sense) and &amp;quot;repeated entrapment&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is  identical.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Abysmal Water|1=4DDC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 30 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-30.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 30&amp;#039;&amp;#039; is named {{lang|zh|離}} (lí), &amp;quot;Radiance&amp;quot;. Other variations include &amp;quot;the clinging, fire&amp;quot; and &amp;quot;the net&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is  identical. The origin of the character has its roots in symbols of long-tailed birds such as the [[peacock]] or the legendary [[phoenix (mythology)|phoenix]].&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Clinging Fire|1=4DDD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 31 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-31.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 31&amp;#039;&amp;#039; is named {{lang|zh|咸}} (xián), &amp;quot;Conjoining&amp;quot;. Other variations include &amp;quot;influence (wooing)&amp;quot; and &amp;quot;feelings&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is  ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Influence|1=4DDE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 32 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-32.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 32&amp;#039;&amp;#039; is named {{lang|zh|恆}} (héng), &amp;quot;Persevering&amp;quot;. Other variations include &amp;quot;duration&amp;quot; and &amp;quot;constancy&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Duration|1=4DDF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 33 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-33.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 33&amp;#039;&amp;#039; is named {{lang|zh|遯}} (dùn), &amp;quot;Retiring&amp;quot;. Other variations include &amp;quot;retreat&amp;quot; and &amp;quot;yielding&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Retreat|1=4DE0|IncludeGB=no}}&lt;br /&gt;
== Hexagram 34 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-34.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 34&amp;#039;&amp;#039; is named {{lang|zh|大壯}} (dà zhuàng), &amp;quot;Great Invigorating&amp;quot;. Other variations include &amp;quot;the power of the great&amp;quot; and &amp;quot;great maturity&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{lang|zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Great Power|1=4DE1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 35 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-35.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 35&amp;#039;&amp;#039; is named {{lang|zh|晉}} (jìn), &amp;quot;Prospering&amp;quot;. Other variations include &amp;quot;progress&amp;quot; and &amp;quot;aquas&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Progress|1=4DE2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 36 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-36.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 36&amp;#039;&amp;#039; is named {{lang|zh|明夷}} (míng yí), &amp;quot;Darkening of the Light&amp;quot;. Other variations include &amp;quot;brilliance injured&amp;quot; and &amp;quot;intelligence hidden&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Darkening of the Light|1=4DE3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 37 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-37.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 37&amp;#039;&amp;#039; is named {{lang|zh|家人}} (jiā rén), &amp;quot;Dwelling People&amp;quot;. Other variations include &amp;quot;the family (the clan)&amp;quot; and &amp;quot;family members&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Family|1=4DE4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 38 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-38.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 38&amp;#039;&amp;#039; is named {{lang|zh|睽}} (kuí), &amp;quot;Polarising&amp;quot;. Other variations include &amp;quot;opposition&amp;quot; and &amp;quot;perversion&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Opposition|1=4DE5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 39 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-39.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 39&amp;#039;&amp;#039; is named {{lang|zh|蹇}} (jiǎn), &amp;quot;Limping&amp;quot;. Other variations include &amp;quot;obstruction&amp;quot; and &amp;quot;afoot&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Obstruction|1=4DE6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 40 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-40.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 40&amp;#039;&amp;#039; is named {{lang|zh|解}} (xiè), &amp;quot;Taking-Apart&amp;quot;. Other variations include &amp;quot;deliverance&amp;quot; and &amp;quot;untangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Deliverance|1=4DE7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 41 ==&lt;br /&gt;
[[File:Iching-hexagram-41.png|alt=|right|I ching 41- diminishing, {{lang|zh|山泽损}}]]&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 41&amp;#039;&amp;#039; is named {{lang|zh|損}} (sǔn), &amp;quot;Diminishing&amp;quot;. Other variations include &amp;quot;decrease&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Decrease|1=4DE8|IncludeGB=no}}&lt;br /&gt;
== Hexagram 42 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-42.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 42&amp;#039;&amp;#039; is named {{lang|zh|益}} (yì), &amp;quot;Augmenting&amp;quot;. Other variations include &amp;quot;increase&amp;quot;. Its inner trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Increase|1=4DE9|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 43 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-43.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 43&amp;#039;&amp;#039; is named {{lang|zh|夬}} (guài), &amp;quot;Displacement&amp;quot;. Other variations include &amp;quot;resoluteness&amp;quot;, &amp;quot;parting&amp;quot;, and &amp;quot;break-through&amp;quot;. Its inner trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Breakthrough|1=4DEA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 44 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-44.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 44&amp;#039;&amp;#039; is named {{lang|zh|姤}} (gòu), &amp;quot;Coupling&amp;quot;. Other variations include &amp;quot;coming to meet&amp;quot; and &amp;quot;meeting&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☰ ({{lang|zh|乾}} qián) force = ({{lang|zh|天}}) heaven.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Coming to Meet|1=4DEB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 45 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-45.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 45&amp;#039;&amp;#039; is named {{lang|zh|萃}} (cuì), &amp;quot;Clustering&amp;quot;. Other variations include &amp;quot;gathering together (massing)&amp;quot; and &amp;quot;finished&amp;quot;. Its inner trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Gathering Together|1=4DEC|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 46 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-46.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 46&amp;#039;&amp;#039; is named {{lang|zh|升}} (shēng), &amp;quot;Ascending&amp;quot;. Other variations include &amp;quot;pushing upward&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☷ ({{lang|zh|坤}} kūn) field = ({{lang|zh|地}}) earth.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Pushing Upward|1=4DED|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 47 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-47.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 47&amp;#039;&amp;#039; is named {{lang|zh|困}} (kùn), &amp;quot;Confining&amp;quot;. Other variations include &amp;quot;oppression (exhaustion)&amp;quot; and &amp;quot;entangled&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Oppression|1=4DEE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 48 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-48.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 48&amp;#039;&amp;#039; is named {{lang|zh|井}} (jǐng), &amp;quot;Welling&amp;quot;. Other variations include &amp;quot;the well&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Well|1=4DEF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 49 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-49.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 49&amp;#039;&amp;#039; is named {{lang|zh|革}} (gé), &amp;quot;Skinning&amp;quot;. Other variations include &amp;quot;revolution (molting)&amp;quot; and &amp;quot;the bridle&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire, and its outer trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Revolution|1=4DF0|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 50 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-50.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 50&amp;#039;&amp;#039; is named {{lang|zh|鼎}} (dǐng), &amp;quot;Holding&amp;quot;. Other variations include &amp;quot;the cauldron&amp;quot;. Its inner trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Cauldron|1=4DF1|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 51 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-51.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 51&amp;#039;&amp;#039; is named {{lang|zh|震}} (zhèn), &amp;quot;Shake&amp;quot;. Other variations include &amp;quot;the arousing (shock, thunder)&amp;quot; and &amp;quot;thunder&amp;quot;. Both its inner and outer trigrams are ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Arousing Thunder|1=4DF2|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 52 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-52.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 52&amp;#039;&amp;#039; is named {{lang|zh|艮}} (gèn), &amp;quot;Bound&amp;quot;. Other variations include &amp;quot;keeping still, mountain&amp;quot; and &amp;quot;stilling&amp;quot;. Both its inner and outer trigrams are ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Keeping Still Mountain|1=4DF3|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 53 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-53.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 53&amp;#039;&amp;#039; is named {{lang|zh|漸}} (jiàn), &amp;quot;Infiltrating&amp;quot;. Other variations include &amp;quot;development (gradual progress)&amp;quot; and &amp;quot;advancement&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Development|1=4DF4|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 54 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-54.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 54&amp;#039;&amp;#039; is named {{lang|zh|歸妹}} (guī mèi), &amp;quot;Converting the Maiden&amp;quot;. Other variations include &amp;quot;the marrying maiden&amp;quot; and &amp;quot;returning maiden&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Marrying Maiden|1=4DF5|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 55 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-55.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 55&amp;#039;&amp;#039; is named {{lang|zh|豐}} (fēng), &amp;quot;Abounding&amp;quot;. Other variations include &amp;quot;abundance&amp;quot; and &amp;quot;fullness&amp;quot;. Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Water (Wu Xing)|火]]}}) fire, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Abundance|1=4DF6|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 56 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-56.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 56&amp;#039;&amp;#039; is named {{lang|zh|旅}} (lǚ), &amp;quot;Sojourning&amp;quot;. Other variations include &amp;quot;the wanderer&amp;quot; and &amp;quot;traveling&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|山}}) mountain, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|火}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Wanderer|1=4DF7|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 57 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-57.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 57&amp;#039;&amp;#039; is named {{linktext|lang=zh|巽}} (xùn), &amp;quot;Ground&amp;quot;. Other variations include &amp;quot;the gentle (the penetrating, wind)&amp;quot; and &amp;quot;calculations&amp;quot;. Both its inner and outer trigrams are ☴ ({{linktext|lang=zh|巽}} xùn) ground = ({{linktext|lang=zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Gentle Wind|1=4DF8|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 58 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-58.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 58&amp;#039;&amp;#039; is named {{lang|zh|兌}} (duì), &amp;quot;Open&amp;quot;. Other variations include &amp;quot;the joyous, lake&amp;quot; and &amp;quot;usurpation&amp;quot;. Both its inner and outer trigrams are ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for the Joyous Lake|1=4DF9|IncludeGB=no}}&lt;br /&gt;
== Hexagram 59 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-59.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 59&amp;#039;&amp;#039; is named {{lang|zh|渙}} (huàn), &amp;quot;Dispersing&amp;quot;. Other variations include &amp;quot;dispersion (dissolution)&amp;quot; and &amp;quot;dispersal&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|風}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Dispersion|1=4DFA|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 60 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-60.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 60&amp;#039;&amp;#039; is named {{lang|zh|節}} (jié), &amp;quot;Articulating&amp;quot;. Other variations include &amp;quot;limitation&amp;quot; and &amp;quot;moderation&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{lang|zh|澤}}) swamp, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|水}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Limitation|1=4DFB|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 61 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-61.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 61&amp;#039;&amp;#039; is named {{lang|zh|中孚}} (zhōng fú), &amp;quot;Center Returning&amp;quot;. Other variations include &amp;quot;inner truth&amp;quot; and &amp;quot;central return&amp;quot;. Its inner trigram is ☱ ({{lang|zh|兌}} duì) open = ({{linktext|lang=zh|澤}}) swamp, and its outer trigram is ☴ ({{lang|zh|巽}} xùn) ground = ({{lang|zh|[[風]]}}) wind.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Inner Truth|1=4DFC|IncludeGB=no}}&lt;br /&gt;
== Hexagram 62 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-62.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 62&amp;#039;&amp;#039; is named {{lang|zh|小過}} (xiǎo guò), &amp;quot;Small Exceeding&amp;quot;. Other variations include &amp;quot;preponderance of the small&amp;quot; and &amp;quot;small surpassing&amp;quot;. Its inner trigram is ☶ ({{lang|zh|艮}} gèn) bound = ({{lang|zh|[[山]]}}) mountain, and its outer trigram is ☳ ({{lang|zh|震}} zhèn) shake = ({{linktext|lang=zh|雷}}) thunder.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Small Preponderance|1=4DFD|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 63 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-63.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 63&amp;#039;&amp;#039; is named {{lang|zh|既濟}} (jì jì), &amp;quot;Already Fording&amp;quot;. Other variations include &amp;quot;after completion&amp;quot; and &amp;quot;already completed&amp;quot; or &amp;quot;already done&amp;quot; . Its inner trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire, and its outer trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for After Completion|1=4DFE|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
== Hexagram 64 ==&lt;br /&gt;
&lt;br /&gt;
[[image:iching-hexagram-64.svg|right]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Hexagram 64&amp;#039;&amp;#039; is named {{lang|zh|未濟}} (wèi jì), &amp;quot;Not Yet Fording&amp;quot;. Other variations include &amp;quot;before completion&amp;quot; and &amp;quot;not yet completed&amp;quot;. Its inner trigram is ☵ ({{lang|zh|坎}} kǎn) gorge = ({{lang|zh|[[Water (Wu Xing)|水]]}}) water, and its outer trigram is ☲ ({{lang|zh|離}} lí) radiance = ({{lang|zh|[[Fire (Wu Xing)|火]]}}) fire.&lt;br /&gt;
&lt;br /&gt;
{{charmap|name1=Hexagram for Before Completion|1=4DFF|IncludeGB=no}}&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
| {{I Ching}}&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
{| align=&amp;quot;right&amp;quot;&lt;br /&gt;
| {{Taoism condensed}}&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
* {{in lang|en|fr}} [http://wengu.tartarie.com/wg/wengu.php?l=Yijing Wilhelm, Baynes “The I Ching or Book of Changes”] &amp;lt;small&amp;gt;(Association Française des Professeurs de Chinois)&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Asia topic|Literature of}}&lt;br /&gt;
&lt;br /&gt;
[[Category:I Ching]]&lt;/div&gt;</summary>
		<author><name>Jawitkien</name></author>	</entry>

	</feed>