<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://theblockheads.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation</id>
	<title>Module:Documentation - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://theblockheads.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation"/>
	<link rel="alternate" type="text/html" href="https://theblockheads.wiki/index.php?title=Module:Documentation&amp;action=history"/>
	<updated>2026-04-12T07:11:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://theblockheads.wiki/index.php?title=Module:Documentation&amp;diff=25031&amp;oldid=prev</id>
		<title>JarlPenguin: Created page with &quot;local p = {}  -- Load modules (language wikis exclusive) -- ...  -- Customizable strings local i18n = { 	-- default settings, change when necessary 	defaultDocPage = &#039;doc&#039;,	-- documentation page suffix 	defaultSandboxPage = &#039;sandbox&#039;,	-- sandbox page suffix 	defaultTestCasePage = &#039;testcases&#039;,	-- testcases page suffix 	defaultPreload = &#039;Template:Documentation/preload&#039;,	-- page that stores qualified documentation page contents 	defaultStyles = &#039;Module:Documentation/styles....&quot;</title>
		<link rel="alternate" type="text/html" href="https://theblockheads.wiki/index.php?title=Module:Documentation&amp;diff=25031&amp;oldid=prev"/>
		<updated>2024-08-06T18:38:06Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {}  -- Load modules (language wikis exclusive) -- ...  -- Customizable strings local i18n = { 	-- default settings, change when necessary 	defaultDocPage = &amp;#039;doc&amp;#039;,	-- documentation page suffix 	defaultSandboxPage = &amp;#039;sandbox&amp;#039;,	-- sandbox page suffix 	defaultTestCasePage = &amp;#039;testcases&amp;#039;,	-- testcases page suffix 	defaultPreload = &amp;#039;Template:Documentation/preload&amp;#039;,	-- page that stores qualified documentation page contents 	defaultStyles = &amp;#039;Module:Documentation/styles....&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Load modules (language wikis exclusive)&lt;br /&gt;
-- ...&lt;br /&gt;
&lt;br /&gt;
-- Customizable strings&lt;br /&gt;
local i18n = {&lt;br /&gt;
	-- default settings, change when necessary&lt;br /&gt;
	defaultDocPage = &amp;#039;doc&amp;#039;,	-- documentation page suffix&lt;br /&gt;
	defaultSandboxPage = &amp;#039;sandbox&amp;#039;,	-- sandbox page suffix&lt;br /&gt;
	defaultTestCasePage = &amp;#039;testcases&amp;#039;,	-- testcases page suffix&lt;br /&gt;
	defaultPreload = &amp;#039;Template:Documentation/preload&amp;#039;,	-- page that stores qualified documentation page contents&lt;br /&gt;
	defaultStyles = &amp;#039;Module:Documentation/styles.css&amp;#039;,	-- stylesheet for this module when using TemplateStyles, remove or set to nil if your wiki not use this&lt;br /&gt;
&lt;br /&gt;
	-- format strings, should not be translated&lt;br /&gt;
	commonInternalLink = &amp;#039;[[%s]]&amp;#039;,&lt;br /&gt;
	commonInternalLinkPipe = &amp;#039;[[%s|%s]]&amp;#039;,&lt;br /&gt;
	commonExternalLink = &amp;#039;[%s]&amp;#039;,&lt;br /&gt;
	commonExternalLinkWithName = &amp;#039;[%s %s]&amp;#039;,&lt;br /&gt;
	commonNamespacedPage = &amp;#039;%s:%s&amp;#039;,&lt;br /&gt;
	commonNamespacedPageWithSub = &amp;#039;%s:%s/%s&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
	-- namespace names, translate if your language prefers localized namespace name, although remain it untouched most likely not affect anything&lt;br /&gt;
	namespaceCategory = &amp;#039;Category&amp;#039;,&lt;br /&gt;
	namespaceSpecial = &amp;#039;Special&amp;#039;,&lt;br /&gt;
	namespaceUser = &amp;#039;User&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
	-- names of special pages, translate if your language prefers localized namespace name, although remain it untouched will still correctly linked to target page&lt;br /&gt;
	specialPurge = &amp;#039;Purge&amp;#039;,&lt;br /&gt;
	specialEdit = &amp;#039;EditPage&amp;#039;,&lt;br /&gt;
	specialHistory = &amp;#039;PageHistory&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
	-- translate following types if your language displays differ&lt;br /&gt;
	pageType_template = &amp;#039;template&amp;#039;,&lt;br /&gt;
	pageType_module = &amp;#039;module&amp;#039;,&lt;br /&gt;
	pageType_widget = &amp;#039;widget&amp;#039;,&lt;br /&gt;
	pageType_stylesheet = &amp;#039;stylesheet&amp;#039;,&lt;br /&gt;
	pageType_script = &amp;#039;script&amp;#039;,&lt;br /&gt;
	pageType_message = &amp;#039;message&amp;#039;,&lt;br /&gt;
&lt;br /&gt;
	-- modify them if your wiki use different style to displaying links&lt;br /&gt;
	linkBar = &amp;#039;%s&amp;#039;,	-- format used for whole link bar&lt;br /&gt;
	linkFormat = mw.text.nowiki( &amp;#039;[&amp;#039; ) .. &amp;#039;%s&amp;#039; .. mw.text.nowiki( &amp;#039;]&amp;#039; ),	-- format used for each individual links&lt;br /&gt;
	linkSeparator = &amp;#039; &amp;#039;,	-- separator between links&lt;br /&gt;
&lt;br /&gt;
	-- name of different type of links, change them if necessary&lt;br /&gt;
	linkTextPurge = mw.getCurrentFrame():callParserFunction( &amp;#039;int:smw_purge&amp;#039; ):lower(),&lt;br /&gt;
	linkTextView = mw.getCurrentFrame():callParserFunction( &amp;#039;int:view&amp;#039; ):lower(),&lt;br /&gt;
	linkTextEdit = mw.getCurrentFrame():callParserFunction( &amp;#039;int:edit&amp;#039; ):lower(),&lt;br /&gt;
	linkTextHistory = mw.getCurrentFrame():callParserFunction( &amp;#039;int:history_short&amp;#039; ):lower(),&lt;br /&gt;
	linkTextCreate = mw.getCurrentFrame():callParserFunction( &amp;#039;int:create&amp;#039; ):lower(),&lt;br /&gt;
&lt;br /&gt;
	-- strings used in p.create(): contents shown when using {{docc}} or {{subst:docc}}&lt;br /&gt;
	createOutputFormat = &amp;#039;%s%s&amp;#039;,	-- overall format&lt;br /&gt;
	createSplitDocPagePrompt = &amp;#039;\n&amp;lt;!-- Put categories/interwikis on the documentation page --&amp;gt;&amp;#039;,	-- this string is shown when a separate documentation page is created&lt;br /&gt;
	createNoSubstCategory = &amp;#039;Pages with templates requiring substitution&amp;#039;,	-- tracking category for using {{docc}} without substitution&lt;br /&gt;
&lt;br /&gt;
	-- strings used in p.docPage(): contents shown in documentation page&lt;br /&gt;
	docPagePrompt = &amp;#039;This is the documentation page. It %s transcluded into %s. See [[Template:Documentation]] for more information.&amp;#039;,	-- message shown as documentation header in documentation pages. Params: word used when page is a module or not; code page&amp;#039;s type&lt;br /&gt;
	docPagePromptWill = &amp;#039;is&amp;#039;,	-- word used when code page is a module page&lt;br /&gt;
	docPagePromptShould = &amp;#039;should be&amp;#039;,	-- word used when code is not a module page&lt;br /&gt;
	docPageBadDocPrompt = &amp;quot;&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;This %s&amp;#039;s documentation needs improving or additional information.&amp;#039;&amp;#039;&amp;#039;&amp;quot;,	-- additional message if a documentation page marked as baddoc&lt;br /&gt;
	docPageCategory = &amp;#039;Documentation pages&amp;#039;,	-- tracking category for documentation pages&lt;br /&gt;
&lt;br /&gt;
	-- strings used in p.page(): contents shown in code page&lt;br /&gt;
	pageNoDocPrompt = &amp;quot;&amp;#039;&amp;#039;&amp;#039;This %s has no documentation. If you know how to use this %s, please create it.&amp;#039;&amp;#039;&amp;#039;&amp;quot;,	-- message shown when a separate documentation page is not exist, both parameters refers to page type&lt;br /&gt;
	pageNoDocCategory = &amp;#039;%ss with no documentation&amp;#039;,	-- tracking category for pages without documentation, parameters refers to page type&lt;br /&gt;
	pageNoDocCategoryDefault = &amp;#039;Pages with no documentation&amp;#039;,	-- fallback tracking category for pages without documentation&lt;br /&gt;
	pageBadDocPrompt = &amp;quot;&amp;#039;&amp;#039;&amp;#039;This %s&amp;#039;s documentation needs improving or additional information.&amp;#039;&amp;#039;&amp;#039;\n&amp;quot;,	-- message shown when a documentation page marked as baddoc, both parameters refers to page type&lt;br /&gt;
	pageBadDocCategory = &amp;#039;%ss with bad documentation&amp;#039;,	-- tracking category for pages marked as baddoc, parameters refers to page type&lt;br /&gt;
	pageBadDocCategoryDefault = &amp;#039;Pages with bad documentation&amp;#039;,	-- fallback tracking category for pages marked as baddoc&lt;br /&gt;
	pageDocHeaderTitle = &amp;#039;Documentation&amp;#039;,	-- message shown as the title of the documentation header&lt;br /&gt;
	pageDocJumpToCode = &amp;#039;Jump to code ↴&amp;#039;,	-- text of the link to jump to the code&lt;br /&gt;
	pageDocHeaderBottom = &amp;#039;The above documentation is transcluded from %s.&amp;#039;,	-- message shown as the bottom line of the documentation header&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Customizable functions&lt;br /&gt;
local function pageCategoryHandler( category )&lt;br /&gt;
	return mw.getCurrentFrame():expandTemplate{ title = &amp;#039;translation category&amp;#039;, args = { category, project = &amp;#039;0&amp;#039; } }&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Load modules&lt;br /&gt;
local loadStyles = require( &amp;#039;Module:TSLoader&amp;#039; ).call&lt;br /&gt;
&lt;br /&gt;
local static = require( &amp;#039;Module:Static&amp;#039; )&lt;br /&gt;
if not static.Documentation then&lt;br /&gt;
	static.Documentation = {}&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Internal functions&lt;br /&gt;
local function getType( namespace, page )&lt;br /&gt;
	local pageType = &amp;#039;template&amp;#039;&lt;br /&gt;
	if namespace == &amp;#039;Module&amp;#039; then&lt;br /&gt;
		pageType = &amp;#039;module&amp;#039;&lt;br /&gt;
	elseif namespace == &amp;#039;Widget&amp;#039; then&lt;br /&gt;
		pageType = &amp;#039;widget&amp;#039;&lt;br /&gt;
	elseif page.fullText:gsub( &amp;#039;/&amp;#039; .. i18n.defaultDocPage .. &amp;#039;$&amp;#039;, &amp;#039;&amp;#039; ):find( &amp;#039;%.css$&amp;#039; ) then&lt;br /&gt;
		pageType = &amp;#039;stylesheet&amp;#039;&lt;br /&gt;
	elseif page.fullText:gsub( &amp;#039;/&amp;#039; .. i18n.defaultDocPage .. &amp;#039;$&amp;#039;, &amp;#039;&amp;#039; ):find( &amp;#039;%.js$&amp;#039; ) then&lt;br /&gt;
		pageType = &amp;#039;script&amp;#039;&lt;br /&gt;
	elseif namespace == &amp;#039;MediaWiki&amp;#039; then&lt;br /&gt;
		pageType = &amp;#039;message&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return pageType&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function getDisplayType( pageType )&lt;br /&gt;
	return i18n[ &amp;#039;pageType_&amp;#039; .. pageType ] or i18n.pageType_template&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Exported functions&lt;br /&gt;
function p.create( f )	-- Creating a documentation page or transclusion through {{subst:docc}}&lt;br /&gt;
	local args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).norm()&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local docPage = args.page or i18n.commonNamespacedPageWithSub:format( page.nsText, page.baseText, i18n.defaultDocPage )&lt;br /&gt;
&lt;br /&gt;
	local out&lt;br /&gt;
	if not args.content and tostring( page ) == docPage then&lt;br /&gt;
		local pageType = mw.ustring.lower( args.type or getType( page.nsText, page ) )&lt;br /&gt;
		local pageTypeDisplay = getDisplayType( pageType )&lt;br /&gt;
		out = f:preprocess( mw.title.new( i18n.defaultPreload ):getContent():gsub( &amp;#039;$1&amp;#039; , pageTypeDisplay ) )&lt;br /&gt;
	else&lt;br /&gt;
		local templateArgs = {}&lt;br /&gt;
		for _, key in ipairs{ &amp;#039;type&amp;#039;, &amp;#039;page&amp;#039;, &amp;#039;content&amp;#039;, &amp;#039;nodoc&amp;#039;, &amp;#039;baddoc&amp;#039; } do&lt;br /&gt;
			local val = args[ key ]&lt;br /&gt;
			if val then&lt;br /&gt;
				if key == &amp;#039;content&amp;#039; then val = &amp;#039;\n&amp;#039; .. val .. &amp;#039;\n&amp;#039; end&lt;br /&gt;
				table.insert( templateArgs, key .. &amp;#039;=&amp;#039; .. val )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		out = &amp;#039;{{documentation|&amp;#039; .. table.concat( templateArgs, &amp;#039;|&amp;#039; ) .. &amp;#039;}}&amp;#039;&lt;br /&gt;
		out = out:gsub( &amp;#039;|}}&amp;#039;, &amp;#039;}}&amp;#039; )&lt;br /&gt;
		out = i18n.createOutputFormat:format( out, args.content and &amp;#039;&amp;#039; or i18n.createSplitDocPagePrompt )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not mw.isSubsting() then&lt;br /&gt;
		out = f:preprocess( out )&lt;br /&gt;
		if not args.nocat then&lt;br /&gt;
			out = out .. i18n.commonInternalLink:format( i18n.commonNamespacedPage:format( i18n.namespaceCategory, i18n.createNoSubstCategory ) )&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return out&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.docPage( f )	-- Header on the documentation page&lt;br /&gt;
	local args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	local badDoc = args.baddoc&lt;br /&gt;
&lt;br /&gt;
	if badDoc then&lt;br /&gt;
		static.Documentation.badDoc = &amp;#039;1&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	local subpage = page.subpageText&lt;br /&gt;
	if subpage == i18n.defaultSandboxPage or subpage == i18n.defaultTestCasePage then&lt;br /&gt;
		page = page.basePageTitle&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local docPage = mw.title.new( args.page or i18n.commonNamespacedPageWithSub:format( page.nsText, page.baseText, i18n.defaultDocPage ) )&lt;br /&gt;
	if docPage ~= page then return end&lt;br /&gt;
&lt;br /&gt;
	local namespace = page.nsText&lt;br /&gt;
	local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )&lt;br /&gt;
	local pageTypeDisplay = getDisplayType( pageType )&lt;br /&gt;
&lt;br /&gt;
	local body = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;documentation&amp;#039; )&lt;br /&gt;
	body&lt;br /&gt;
		:addClass( badDoc and &amp;#039;documentation-badDoc&amp;#039; or &amp;#039;&amp;#039; )&lt;br /&gt;
		:tag( &amp;#039;div&amp;#039; )&lt;br /&gt;
			:attr( &amp;#039;id&amp;#039;, &amp;#039;documentation-header-tools&amp;#039; )&lt;br /&gt;
			:wikitext( i18n.linkBar:format( i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonNamespacedPageWithSub:format( i18n.namespaceSpecial, i18n.specialPurge, page.fullText ), i18n.linkTextPurge ) ) ) )&lt;br /&gt;
		:done()&lt;br /&gt;
		:wikitext( i18n.docPagePrompt:format( pageType == &amp;#039;module&amp;#039; and i18n.docPagePromptWill or i18n.docPagePromptShould, i18n.commonInternalLink:format( i18n.commonNamespacedPage:format( namespace, page.baseText ) ) ) )&lt;br /&gt;
	if badDoc then&lt;br /&gt;
		body:wikitext( i18n.docPageBadDocPrompt:format( pageTypeDisplay ) )&lt;br /&gt;
	end&lt;br /&gt;
	if not ( args.nocat or namespace == i18n.namespaceUser ) then&lt;br /&gt;
		body:wikitext( i18n.commonInternalLink:format( i18n.commonNamespacedPage:format( i18n.namespaceCategory, i18n.docPageCategory ) ) )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return loadStyles( i18n.defaultStyles ) .. tostring( body )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.page( f )	-- Wrapper around the documentation on the main page&lt;br /&gt;
	-- mw.text.trim uses mw.ustring.gsub, which silently fails on large strings&lt;br /&gt;
	local function trim( s )&lt;br /&gt;
		return ( s:gsub( &amp;#039;^[\t\r\n\f ]+&amp;#039;, &amp;#039;&amp;#039; ):gsub( &amp;#039;[\t\r\n\f ]+$&amp;#039;, &amp;#039;&amp;#039; ) )&lt;br /&gt;
		--return string.gsub( s, &amp;#039;^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$&amp;#039;, &amp;#039;%1&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	local args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local subpage = page.subpageText&lt;br /&gt;
	if subpage == i18n.defaultSandboxPage or subpage == i18n.defaultTestCasePage then&lt;br /&gt;
		page = page.basePageTitle&lt;br /&gt;
	end&lt;br /&gt;
	local namespace = page.nsText&lt;br /&gt;
	local docText = trim( args.content or &amp;#039;&amp;#039; )&lt;br /&gt;
	if docText == &amp;#039;&amp;#039; then docText = nil end&lt;br /&gt;
&lt;br /&gt;
	local docPage&lt;br /&gt;
	local noDoc&lt;br /&gt;
	if docText then&lt;br /&gt;
		docPage = page&lt;br /&gt;
	else&lt;br /&gt;
		docPage = mw.title.new( args.page or i18n.commonNamespacedPageWithSub:format( namespace, page.text, i18n.defaultDocPage ) )&lt;br /&gt;
		noDoc = args.nodoc or not docPage.exists&lt;br /&gt;
	end&lt;br /&gt;
	local badDoc = args.baddoc&lt;br /&gt;
	local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )&lt;br /&gt;
	local pageTypeDisplay = getDisplayType( pageType )&lt;br /&gt;
&lt;br /&gt;
	if not docText and not noDoc then&lt;br /&gt;
		docText = trim( f:expandTemplate{ title = &amp;#039;:&amp;#039; .. docPage.fullText } )&lt;br /&gt;
		if static.Documentation.badDoc and static.Documentation.badDoc == &amp;#039;1&amp;#039; then&lt;br /&gt;
			badDoc = 1&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if docText == &amp;#039;&amp;#039; then&lt;br /&gt;
			docText = nil&lt;br /&gt;
			noDoc = 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if docText then&lt;br /&gt;
		docText = &amp;#039;\n&amp;#039; .. docText .. &amp;#039;\n&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local docClass = &amp;#039;&amp;#039;&lt;br /&gt;
	local message&lt;br /&gt;
	local category&lt;br /&gt;
	if noDoc then&lt;br /&gt;
		docClass = &amp;#039;documentation-noDoc&amp;#039;&lt;br /&gt;
		message = i18n.pageNoDocPrompt:format( pageTypeDisplay, pageTypeDisplay )&lt;br /&gt;
		if not ( args.nocat or namespace == i18n.namespaceUser ) then&lt;br /&gt;
			category = i18n.pageNoDocCategory:format( pageTypeDisplay )&lt;br /&gt;
			if not mw.title.new( i18n.commonNamespacedPage:format( i18n.namespaceCategory, category ) ).exists then&lt;br /&gt;
				category = i18n.pageNoDocCategoryDefault&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif badDoc then&lt;br /&gt;
		docClass = &amp;#039;documentation-badDoc&amp;#039;&lt;br /&gt;
		message = i18n.pageBadDocPrompt:format( pageTypeDisplay )&lt;br /&gt;
		if not ( args.nocat or namespace == i18n.namespaceUser ) then&lt;br /&gt;
			category = i18n.pageBadDocCategory:format( pageTypeDisplay )&lt;br /&gt;
			if not mw.title.new( i18n.commonNamespacedPage:format( i18n.namespaceCategory, category ) ).exists then&lt;br /&gt;
				category = i18n.pageBadDocCategoryDefault&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Generates the link bar&lt;br /&gt;
	local links = mw.html.create( &amp;#039;span&amp;#039; )&lt;br /&gt;
		:attr( &amp;#039;id&amp;#039;, &amp;#039;documentation-header-tools&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
	local linkList = {}&lt;br /&gt;
	if not noDoc then&lt;br /&gt;
		if page ~= docPage then&lt;br /&gt;
			table.insert( linkList, i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( docPage.fullText, i18n.linkTextView ) ) )&lt;br /&gt;
		end&lt;br /&gt;
		table.insert( linkList, i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonNamespacedPageWithSub:format( i18n.namespaceSpecial, i18n.specialEdit, docPage.fullText ), i18n.linkTextEdit ) ) )&lt;br /&gt;
		table.insert( linkList, i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonNamespacedPageWithSub:format( i18n.namespaceSpecial, i18n.specialHistory, docPage.fullText ), i18n.linkTextHistory ) ) )&lt;br /&gt;
	else&lt;br /&gt;
		table.insert( linkList, i18n.linkFormat:format( i18n.commonExternalLinkWithName:format( docPage:canonicalUrl{ action = &amp;#039;edit&amp;#039;, preload = i18n.defaultPreload, preloadparams = pageTypeDisplay }, i18n.linkTextCreate ) ) )&lt;br /&gt;
	end&lt;br /&gt;
	table.insert( linkList, i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonNamespacedPageWithSub:format( i18n.namespaceSpecial, i18n.specialPurge, docPage.fullText ), i18n.linkTextPurge ) ) )&lt;br /&gt;
	links:wikitext( i18n.linkBar:format( table.concat( linkList, i18n.linkSeparator ) ) )&lt;br /&gt;
&lt;br /&gt;
	local body = mw.html.create( &amp;#039;div&amp;#039; ):addClass( &amp;#039;documentation&amp;#039; )&lt;br /&gt;
	body&lt;br /&gt;
		:addClass( docClass )&lt;br /&gt;
&lt;br /&gt;
	local header = mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
		:addClass( &amp;#039;documentation-header-top&amp;#039; )&lt;br /&gt;
&lt;br /&gt;
	header&lt;br /&gt;
		:node( links )&lt;br /&gt;
		:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
			:addClass( &amp;#039;documentation-header-title&amp;#039; )&lt;br /&gt;
			:wikitext( i18n.pageDocHeaderTitle )&lt;br /&gt;
&lt;br /&gt;
	local codePages = {&lt;br /&gt;
		module = true,&lt;br /&gt;
		stylesheet = true,&lt;br /&gt;
		script = true,&lt;br /&gt;
	}&lt;br /&gt;
	if not noDoc and codePages[ pageType ] then&lt;br /&gt;
		header&lt;br /&gt;
			:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
				:attr( &amp;#039;id&amp;#039;, &amp;#039;documentation-jump-to-code&amp;#039; )&lt;br /&gt;
				:wikitext( i18n.commonInternalLinkPipe:format( &amp;#039;#the-code&amp;#039;, i18n.pageDocJumpToCode ) )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	body&lt;br /&gt;
		:node( header ):done()&lt;br /&gt;
		:wikitext( message )&lt;br /&gt;
		:wikitext( docText )&lt;br /&gt;
&lt;br /&gt;
	if not noDoc and page ~= docPage then&lt;br /&gt;
		body&lt;br /&gt;
			:tag( &amp;#039;div&amp;#039; )&lt;br /&gt;
				:addClass( &amp;#039;documentation-header-bottom&amp;#039; )&lt;br /&gt;
				:node( links )&lt;br /&gt;
				:wikitext( i18n.pageDocHeaderBottom:format( i18n.commonInternalLink:format( docPage.fullText ) ) )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if category then&lt;br /&gt;
		body:wikitext( pageCategoryHandler( category ) )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local anchor = &amp;#039;&amp;#039;&lt;br /&gt;
	if not noDoc and pageType ~= &amp;#039;template&amp;#039; and pageType ~= &amp;#039;message&amp;#039; then&lt;br /&gt;
		anchor = mw.html.create( &amp;#039;div&amp;#039; ):attr( &amp;#039;id&amp;#039;, &amp;#039;the-code&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return loadStyles( i18n.defaultStyles ) .. tostring( body ) .. tostring( anchor )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>JarlPenguin</name></author>
	</entry>
</feed>