<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://help.gulfstatesflood.com/mediawiki/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://help.gulfstatesflood.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation"/>
	<link rel="alternate" type="text/html" href="https://help.gulfstatesflood.com/mediawiki/index.php?title=Module:Documentation&amp;action=history"/>
	<updated>2026-04-05T23:16:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.42.0</generator>
	<entry>
		<id>https://help.gulfstatesflood.com/mediawiki/index.php?title=Module:Documentation&amp;diff=6501&amp;oldid=prev</id>
		<title>WikiAdmin: Created page with &quot;-- &lt;nowiki&gt; local yesno = require(&quot;Module:Yesno&quot;)  local p = {}  local i18n = { 	codejump = &#039;Jump to code ↴&#039;, 	header = &#039;%s Documentation&#039;, 	doccat = &#039;Category:%s documentation&#039;, 	doc_msg = &#039;This is the documentation page, it should be transcluded into the main %s page. See Template:Documentation for more information&#039;, 	nocat = &#039;Category:Pages with templates requiring substitution&#039;, 	nodoc = &#039;This %s has no documentation. If you know how to use this %s, &lt;span class...&quot;</title>
		<link rel="alternate" type="text/html" href="https://help.gulfstatesflood.com/mediawiki/index.php?title=Module:Documentation&amp;diff=6501&amp;oldid=prev"/>
		<updated>2024-12-27T18:20:05Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- &amp;lt;nowiki&amp;gt; local yesno = require(&amp;quot;Module:Yesno&amp;quot;)  local p = {}  local i18n = { 	codejump = &amp;#039;Jump to code ↴&amp;#039;, 	header = &amp;#039;%s Documentation&amp;#039;, 	doccat = &amp;#039;Category:%s documentation&amp;#039;, 	doc_msg = &amp;#039;This is the documentation page, it should be transcluded into the main %s page. See &lt;a href=&quot;/Template:Documentation&quot; title=&quot;Template:Documentation&quot;&gt;Template:Documentation&lt;/a&gt; for more information&amp;#039;, 	nocat = &amp;#039;Category:Pages with templates requiring substitution&amp;#039;, 	nodoc = &amp;#039;This %s has no documentation. If you know how to use this %s, &amp;lt;span class...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
local yesno = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local i18n = {&lt;br /&gt;
	codejump = &amp;#039;Jump to code ↴&amp;#039;,&lt;br /&gt;
	header = &amp;#039;%s Documentation&amp;#039;,&lt;br /&gt;
	doccat = &amp;#039;Category:%s documentation&amp;#039;,&lt;br /&gt;
	doc_msg = &amp;#039;This is the documentation page, it should be transcluded into the main %s page. See [[Template:Documentation]] for more information&amp;#039;,&lt;br /&gt;
	nocat = &amp;#039;Category:Pages with templates requiring substitution&amp;#039;,&lt;br /&gt;
	nodoc = &amp;#039;This %s has no documentation. If you know how to use this %s, &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[%s please create it]&amp;lt;/span&amp;gt;.&amp;#039;,&lt;br /&gt;
	nodoc_cat = &amp;#039;Category:%s with no documentation&amp;#039;,&lt;br /&gt;
	pagetype_module = &amp;#039;module&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_template = &amp;#039;template&amp;#039;,&lt;br /&gt;
	transcluded = &amp;#039;The above documentation is transcluded from [[%s]].&amp;#039;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
local function getType( namespace, page )&lt;br /&gt;
	local pageType = i18n[&amp;#039;pagetype_template&amp;#039;]&lt;br /&gt;
	if namespace == &amp;#039;Module&amp;#039; then&lt;br /&gt;
		pageType = i18n[&amp;#039;pagetype_module&amp;#039;]&lt;br /&gt;
	elseif page.fullText:gsub( &amp;#039;/doc$&amp;#039;, &amp;#039;&amp;#039; ):find( &amp;#039;%.css$&amp;#039; ) then&lt;br /&gt;
		pageType = i18n[&amp;#039;pagetype_stylesheet&amp;#039;]&lt;br /&gt;
	elseif page.fullText:gsub( &amp;#039;/doc$&amp;#039;, &amp;#039;&amp;#039; ):find( &amp;#039;%.js$&amp;#039; ) then&lt;br /&gt;
		pageType = i18n[&amp;#039;pagetype_script&amp;#039;]&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return pageType&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function ucfirst( s )&lt;br /&gt;
	return mw.ustring.upper( mw.ustring.sub( s, 1, 1 ) )&lt;br /&gt;
		.. mw.ustring.sub( s, 2 )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns true if `f` is probably a Scribunto Frame object&lt;br /&gt;
local function isFrame( f )&lt;br /&gt;
	return type( f ) == &amp;#039;table&amp;#039;&lt;br /&gt;
		and type( f.args ) == &amp;#039;table&amp;#039;&lt;br /&gt;
		and type( f.getParent ) == &amp;#039;function&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Creating a documentation page or transclution through {{subst:doc}}&lt;br /&gt;
function p.create( f )&lt;br /&gt;
	local args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).norm()&lt;br /&gt;
&lt;br /&gt;
	local page = args.page&lt;br /&gt;
		and mw.title.new( args.page )&lt;br /&gt;
		or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	local docPage = page.nsText .. &amp;#039;:&amp;#039; .. page.baseText .. &amp;#039;/doc&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local out&lt;br /&gt;
	if page.fullText == docPage then&lt;br /&gt;
		out = f:preprocess( &amp;#039;{{subst:Template:Documentation/preload}}&amp;#039; )&lt;br /&gt;
	else&lt;br /&gt;
		local pageType = &amp;#039;&amp;#039;&lt;br /&gt;
		if args.type then&lt;br /&gt;
			pageType = &amp;#039;|type=&amp;#039; .. args.type&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		out = &amp;#039;{{Documentation&amp;#039; .. pageType .. &amp;#039;}}\n&amp;#039; ..&lt;br /&gt;
			&amp;#039;&amp;lt;!-- Put categories/interwiki on the documentation page --&amp;gt;&amp;#039;&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 .. &amp;#039;[[&amp;#039; .. i18n[&amp;#039;nocat&amp;#039;] .. &amp;#039;]]&amp;#039;&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;
-- Header on the documentation page&lt;br /&gt;
function p.docPage( f )&lt;br /&gt;
	local args&lt;br /&gt;
	if isFrame( f ) then&lt;br /&gt;
		args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	else&lt;br /&gt;
		args = f&lt;br /&gt;
		f = mw.getCurrentFrame()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local page = args.page&lt;br /&gt;
		and mw.title.new( args.page )&lt;br /&gt;
		or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	if page.subpageText ~= &amp;#039;doc&amp;#039; and not args.demo then&lt;br /&gt;
		return&lt;br /&gt;
	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;
	&lt;br /&gt;
	local body = mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
	body&lt;br /&gt;
		:css{&lt;br /&gt;
			[&amp;#039;margin-bottom&amp;#039;] = &amp;#039;0.8em&amp;#039;,&lt;br /&gt;
			padding = &amp;#039;0.8em 1em 0.7em&amp;#039;,&lt;br /&gt;
			[&amp;#039;background-color&amp;#039;] = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
			border = &amp;#039;1px solid #AAA&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
		:tag( &amp;#039;div&amp;#039; )&lt;br /&gt;
			:css( &amp;#039;float&amp;#039;, &amp;#039;right&amp;#039; )&lt;br /&gt;
			:wikitext( &amp;#039;[[&amp;#039;, page:fullUrl( &amp;#039;action=purge&amp;#039; ), &amp;#039; purge]]&amp;#039; )&lt;br /&gt;
		:done()&lt;br /&gt;
		:wikitext(string.format(i18n[&amp;#039;doc_msg&amp;#039;], pageType))&lt;br /&gt;
	if not args.nocat and not args.demo then&lt;br /&gt;
		body:wikitext( &amp;#039;[[&amp;#039; .. string.format( i18n[&amp;#039;doccat&amp;#039;], ucfirst( pageType ) ) .. &amp;#039;]]&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return body&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wrapper around the documentation on the main page&lt;br /&gt;
function p.page( f )&lt;br /&gt;
	local args&lt;br /&gt;
	if isFrame( f ) then&lt;br /&gt;
		args = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	else&lt;br /&gt;
		args = f&lt;br /&gt;
		f = mw.getCurrentFrame()&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local page = args.page&lt;br /&gt;
		and mw.title.new( args.page )&lt;br /&gt;
		or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	local namespace = page.nsText&lt;br /&gt;
	local docPage = mw.title.new( namespace .. &amp;#039;:&amp;#039; .. page.text .. &amp;#039;/doc&amp;#039; )&lt;br /&gt;
	local noDoc = args.nodoc or not docPage.exists&lt;br /&gt;
	local pageType = mw.ustring.lower( args.type or getType( namespace, page ) )&lt;br /&gt;
	&lt;br /&gt;
	local docText&lt;br /&gt;
	if not noDoc then&lt;br /&gt;
		docText = mw.text.trim( f:expandTemplate{ title = &amp;#039;:&amp;#039; .. docPage.fullText }  )&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;
		else&lt;br /&gt;
			docText = &amp;#039;\n&amp;#039; .. docText .. &amp;#039;\n&amp;#039;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local action = &amp;#039;edit&amp;#039;&lt;br /&gt;
	local preload = &amp;#039;&amp;#039;&lt;br /&gt;
	local colour = &amp;#039;inherit&amp;#039;&lt;br /&gt;
	local message&lt;br /&gt;
	local category&lt;br /&gt;
	if noDoc then&lt;br /&gt;
		action = &amp;#039;create&amp;#039;&lt;br /&gt;
		preload = &amp;#039;&amp;amp;redlink=1&amp;amp;preload=Template:Documentation/preload&amp;#039;&lt;br /&gt;
		colour = &amp;#039;inherit&amp;#039;&lt;br /&gt;
		message = string.format(&amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot; .. i18n[&amp;#039;nodoc&amp;#039;] .. &amp;quot;&amp;#039;&amp;#039;&amp;#039;&amp;quot;, pageType, pageType, docPage:fullUrl( &amp;#039;action=edit&amp;#039; .. preload ))&lt;br /&gt;
		if not args.nocat then&lt;br /&gt;
			category = string.format(i18n[&amp;#039;nodoc_cat&amp;#039;], ucfirst( pageType .. &amp;#039;s&amp;#039; ) )&lt;br /&gt;
			if not mw.title.new( category ).exists then&lt;br /&gt;
				category = string.format(i18n[&amp;#039;nodoc_cat&amp;#039;],&amp;#039;Page&amp;#039;)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local links = {&lt;br /&gt;
		&amp;#039;[[Special:EditPage/&amp;#039; .. docPage.fullText .. &amp;#039;|&amp;#039; .. action .. &amp;#039;]]&amp;#039;,&lt;br /&gt;
		&amp;#039;[[Special:Purge/&amp;#039; .. page.fullText .. &amp;#039;|purge]]&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	if not noDoc then&lt;br /&gt;
		table.insert( links, 1, &amp;#039;[[&amp;#039; .. docPage.fullText .. &amp;#039;|view]]&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	links = mw.html.create( &amp;#039;span&amp;#039; )&lt;br /&gt;
		:css( &amp;#039;float&amp;#039;, &amp;#039;right&amp;#039; )&lt;br /&gt;
		:wikitext( mw.text.nowiki( &amp;#039;[&amp;#039; ), table.concat( links, &amp;#039; | &amp;#039; ), mw.text.nowiki( &amp;#039;]&amp;#039; ) )&lt;br /&gt;
	&lt;br /&gt;
	local body = mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
	body:css{&lt;br /&gt;
		[&amp;#039;background-color&amp;#039;] = colour,&lt;br /&gt;
		border = &amp;#039;1px solid #AAA&amp;#039;,&lt;br /&gt;
		padding = &amp;#039;0.8em 1em 0.7em&amp;#039;,&lt;br /&gt;
		[&amp;#039;margin-top&amp;#039;] = &amp;#039;1em&amp;#039;,&lt;br /&gt;
		clear = &amp;#039;both&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	local header = mw.html.create( &amp;#039;div&amp;#039; )&lt;br /&gt;
		:css{&lt;br /&gt;
			margin = &amp;#039;-0.8em -1em 0.8em&amp;#039;,&lt;br /&gt;
			padding = &amp;#039;0.8em 1em 0.7em&amp;#039;,&lt;br /&gt;
			[&amp;#039;background-color&amp;#039;] = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
			[&amp;#039;border-bottom&amp;#039;] = &amp;#039;inherit&amp;#039;&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
	header&lt;br /&gt;
		:node( links )&lt;br /&gt;
		:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
			:css{&lt;br /&gt;
				[&amp;#039;font-weight&amp;#039;] = &amp;#039;bold&amp;#039;,&lt;br /&gt;
				[&amp;#039;font-size&amp;#039;] = &amp;#039;130%&amp;#039;,&lt;br /&gt;
				[&amp;#039;margin-right&amp;#039;] = &amp;#039;1em&amp;#039;,&lt;br /&gt;
				[&amp;#039;line-height&amp;#039;] = &amp;#039;1&amp;#039;&lt;br /&gt;
			}&lt;br /&gt;
			:wikitext( i18n[&amp;#039;header&amp;#039;]:format( ucfirst( pageType ) ) )&lt;br /&gt;
	&lt;br /&gt;
	if not noDoc and pageType ~= i18n[&amp;#039;pagetype_template&amp;#039;] and pageType ~= &amp;#039;message&amp;#039; then&lt;br /&gt;
		header&lt;br /&gt;
			:tag( &amp;#039;span&amp;#039; )&lt;br /&gt;
				:css( &amp;#039;white-space&amp;#039;, &amp;#039;nowrap&amp;#039; )&lt;br /&gt;
				:wikitext( &amp;#039;[[#the-code|&amp;#039; .. i18n[&amp;#039;codejump&amp;#039;] .. &amp;#039;]]&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	body&lt;br /&gt;
		:node( header )&lt;br /&gt;
		:wikitext( message )&lt;br /&gt;
		:wikitext( docText )&lt;br /&gt;
	&lt;br /&gt;
	if not noDoc then&lt;br /&gt;
		body&lt;br /&gt;
			:tag( &amp;#039;div&amp;#039; )&lt;br /&gt;
				:css{&lt;br /&gt;
					margin = &amp;#039;0.7em -1em -0.7em&amp;#039;,&lt;br /&gt;
					[&amp;#039;background-color&amp;#039;] = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
					[&amp;#039;border-top&amp;#039;] = &amp;#039;inherit&amp;#039;,&lt;br /&gt;
					padding = &amp;#039;0.8em 1em 0.7em&amp;#039;,&lt;br /&gt;
					clear = &amp;#039;both&amp;#039;&lt;br /&gt;
				}&lt;br /&gt;
				:node( links )&lt;br /&gt;
				:wikitext( i18n[&amp;#039;transcluded&amp;#039;]:format( docPage.fullText ) )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if category then&lt;br /&gt;
		body:wikitext( &amp;#039;[[&amp;#039;, category, &amp;#039;]]&amp;#039; )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local anchor = &amp;#039;&amp;#039;&lt;br /&gt;
	if not noDoc and pageType ~= i18n[&amp;#039;pagetype_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 tostring( body ) .. tostring( anchor )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>WikiAdmin</name></author>
	</entry>
</feed>