<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.boxofrocks.net/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://wiki.boxofrocks.net/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.boxofrocks.net/index.php?title=Module:Documentation&amp;action=history"/>
	<updated>2026-05-30T22:46:37Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.34.2</generator>
	<entry>
		<id>https://wiki.boxofrocks.net/index.php?title=Module:Documentation&amp;diff=311&amp;oldid=prev</id>
		<title>BoxWiki: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://wiki.boxofrocks.net/index.php?title=Module:Documentation&amp;diff=311&amp;oldid=prev"/>
		<updated>2021-05-13T15:52:07Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 15:52, 13 May 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>BoxWiki</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.boxofrocks.net/index.php?title=Module:Documentation&amp;diff=310&amp;oldid=prev</id>
		<title>CraftingTable&gt;Fadyblok240: Detect testing pages</title>
		<link rel="alternate" type="text/html" href="https://wiki.boxofrocks.net/index.php?title=Module:Documentation&amp;diff=310&amp;oldid=prev"/>
		<updated>2021-04-23T20:24:42Z</updated>

		<summary type="html">&lt;p&gt;Detect testing pages&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;
local defaultDocPage = 'doc'&lt;br /&gt;
&lt;br /&gt;
local getType = function( namespace, page )&lt;br /&gt;
	local pageType = 'template'&lt;br /&gt;
	if namespace == 'Module' then&lt;br /&gt;
		pageType = 'module'&lt;br /&gt;
	elseif namespace == 'Widget' then&lt;br /&gt;
		pageType = 'widget'&lt;br /&gt;
	elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.css$' ) then&lt;br /&gt;
		pageType = 'stylesheet'&lt;br /&gt;
	elseif page.fullText:gsub( '/' .. defaultDocPage .. '$', '' ):find( '%.js$' ) then&lt;br /&gt;
		pageType = 'script'&lt;br /&gt;
	elseif namespace == 'MediaWiki' then&lt;br /&gt;
		pageType = 'message'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return pageType&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( 'Module:ProcessArgs' ).norm()&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local docPage = args.page or page.nsText .. ':' .. page.baseText .. '/' .. defaultDocPage&lt;br /&gt;
	&lt;br /&gt;
	local out&lt;br /&gt;
	if not args.content and tostring( page ) == docPage then&lt;br /&gt;
		out = f:preprocess( '{{subst:Template:Documentation/preload}}' )&lt;br /&gt;
	else&lt;br /&gt;
		local templateArgs = {}&lt;br /&gt;
		for _, key in ipairs{ 'type', 'page', 'content' } do&lt;br /&gt;
			local val = args[key]&lt;br /&gt;
			if val then&lt;br /&gt;
				if key == 'content' then val = '\n' .. val .. '\n' end&lt;br /&gt;
				table.insert( templateArgs, key .. '=' .. val )&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		out = '{{documentation|' .. table.concat( templateArgs, '|' ) .. '}}'&lt;br /&gt;
		out = out:gsub( '|}}', '}}' )&lt;br /&gt;
		&lt;br /&gt;
		if not args.content then&lt;br /&gt;
			out = out .. '\n&amp;lt;!-- Put categories/interwiki on the documentation page --&amp;gt;'&lt;br /&gt;
		end&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 .. '[[Category:Pages with templates requiring substitution]]'&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 = require( 'Module:ProcessArgs' ).merge( true )&lt;br /&gt;
	local badDoc = args.baddoc&lt;br /&gt;
	if f:callParserFunction( '#dplvar', '$doc noheader' ) == '1' then&lt;br /&gt;
		if badDoc then&lt;br /&gt;
			f:callParserFunction( '#dplvar:set', '$doc bad', '1' )&lt;br /&gt;
		end&lt;br /&gt;
		return&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local subpage = page.subpageText&lt;br /&gt;
	if subpage == 'sandbox' or subpage == 'testcases' then&lt;br /&gt;
		page = page.basePageTitle&lt;br /&gt;
	end&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( 'div' ):addClass( 'documentation-header' )&lt;br /&gt;
	body&lt;br /&gt;
		:css{&lt;br /&gt;
			['margin-bottom'] = '0.8em',&lt;br /&gt;
			padding = '0.8em 1em 0.7em',&lt;br /&gt;
			['background-color'] = '#' .. ( badDoc and 'F9F2EA' or 'EAF4F9' ),&lt;br /&gt;
			border = '1px solid #AAA'&lt;br /&gt;
		}&lt;br /&gt;
		:tag( 'div' )&lt;br /&gt;
			:css( 'float', 'right' )&lt;br /&gt;
			:wikitext( '[[', page:fullUrl( 'action=purge' ), ' purge]]' )&lt;br /&gt;
		:done()&lt;br /&gt;
		:wikitext(&lt;br /&gt;
			'This is the documentation page. It ',&lt;br /&gt;
			pageType == 'module' and 'will' or 'should',&lt;br /&gt;
			' be transcluded into the main ', pageType, ' page. ',&lt;br /&gt;
			'See [[Template:Documentation]] for more information'&lt;br /&gt;
		)&lt;br /&gt;
	if badDoc then&lt;br /&gt;
		body:wikitext( &amp;quot;&amp;lt;br&amp;gt;'''This &amp;quot;, pageType, &amp;quot;'s documentation needs improving or additional information.'''&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	if not ( args.nocat or namespace == 'User' ) then&lt;br /&gt;
		body:wikitext( '[[Category:Documentation pages]]' )&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;
	-- 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( '^[\t\r\n\f ]+', '' ):gsub( '[\t\r\n\f ]+$', '' ))&lt;br /&gt;
		--return string.gsub( s, '^[\t\r\n\f ]*(.-)[\t\r\n\f ]*$', '%1' )&lt;br /&gt;
	end&lt;br /&gt;
	local args = require( 'Module:ProcessArgs' ).merge( true )&lt;br /&gt;
	local page = mw.title.getCurrentTitle()&lt;br /&gt;
	local subpage = page.subpageText&lt;br /&gt;
	if subpage == 'sandbox' or subpage == 'testcases' 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 '' )&lt;br /&gt;
	if docText == '' 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 namespace .. ':' .. page.text .. '/' .. 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;
	&lt;br /&gt;
	if not docText and not noDoc then&lt;br /&gt;
		f:callParserFunction( '#dplvar:set', '$doc noheader', '1' )&lt;br /&gt;
		docText = trim( f:expandTemplate{ title = ':' .. docPage.fullText }  )&lt;br /&gt;
		if f:callParserFunction( '#dplvar', '$doc bad' ) == '1' then&lt;br /&gt;
			badDoc = 1&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if docText == '' 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 = '\n' .. docText .. '\n'&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local action = 'edit'&lt;br /&gt;
	local preload = ''&lt;br /&gt;
	local colour = 'EAF4F9'&lt;br /&gt;
	local message&lt;br /&gt;
	local category&lt;br /&gt;
	if noDoc then&lt;br /&gt;
		action = 'create'&lt;br /&gt;
		preload = '&amp;amp;preload=Template:Documentation/preload'&lt;br /&gt;
		colour = 'F9EAEA'&lt;br /&gt;
		message = &amp;quot;'''This &amp;quot; .. pageType .. &amp;quot; has no documentation. &amp;quot; ..&lt;br /&gt;
			&amp;quot;If you know how to use this &amp;quot; .. pageType .. &amp;quot;, please create it.'''&amp;quot;&lt;br /&gt;
		if not ( args.nocat or namespace == 'User' ) then&lt;br /&gt;
			category = pageType .. 's with no documentation'&lt;br /&gt;
			if not mw.title.new( 'Category:' .. category ).exists then&lt;br /&gt;
				category = 'Pages with no documentation'&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif badDoc then&lt;br /&gt;
		colour = 'F9F2EA'&lt;br /&gt;
		message = &amp;quot;'''This &amp;quot; .. pageType .. &amp;quot;'s documentation needs improving or additional information.'''\n&amp;quot;&lt;br /&gt;
		if not ( args.nocat or namespace == 'User' ) then&lt;br /&gt;
			category = pageType .. 's with bad documentation'&lt;br /&gt;
			if not mw.title.new( 'Category:' .. category ).exists then&lt;br /&gt;
				category = 'Pages with bad documentation'&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local links = {&lt;br /&gt;
		'[' .. docPage:fullUrl( 'action=edit' .. preload ) .. ' ' .. action .. ']',&lt;br /&gt;
		'[' .. docPage:fullUrl( 'action=history' ) .. ' history]',&lt;br /&gt;
		'[' .. page:fullUrl( 'action=purge' ) .. ' purge]'&lt;br /&gt;
	}&lt;br /&gt;
	if not noDoc and page ~= docPage then&lt;br /&gt;
		table.insert( links, 1, '[[' .. docPage.fullText .. '|view]]' )&lt;br /&gt;
	end&lt;br /&gt;
	links = mw.html.create( 'span' )&lt;br /&gt;
		:css( 'float', 'right' )&lt;br /&gt;
		:wikitext( mw.text.nowiki( '[' ), table.concat( links, ' | ' ), mw.text.nowiki( ']' ) )&lt;br /&gt;
	&lt;br /&gt;
	local body = mw.html.create( 'div' ):addClass( 'documentation' )&lt;br /&gt;
	body:css{&lt;br /&gt;
		['background-color'] = '#' .. colour,&lt;br /&gt;
		border = '1px solid #AAA',&lt;br /&gt;
		padding = '0.8em 1em 0.7em',&lt;br /&gt;
		['margin-top'] = '1em',&lt;br /&gt;
		clear = 'both'&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	local header = mw.html.create( 'div' )&lt;br /&gt;
		:css{&lt;br /&gt;
			margin = '-0.8em -1em 0.8em',&lt;br /&gt;
			padding = '0.8em 1em 0.7em',&lt;br /&gt;
			['background-color'] = '#EAF4F9',&lt;br /&gt;
			['border-bottom'] = 'inherit'&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
	header&lt;br /&gt;
		:node( links )&lt;br /&gt;
		:tag( 'span' )&lt;br /&gt;
			:css{&lt;br /&gt;
				['font-weight'] = 'bold',&lt;br /&gt;
				['font-size'] = '130%',&lt;br /&gt;
				['margin-right'] = '1em',&lt;br /&gt;
				['line-height'] = '1'&lt;br /&gt;
			}&lt;br /&gt;
			:wikitext( 'Documentation' )&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( 'span' )&lt;br /&gt;
				:css( 'white-space', 'nowrap' )&lt;br /&gt;
				:wikitext( '[[#the-code|Jump to code ↴]]' )&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( 'div' )&lt;br /&gt;
				:css{&lt;br /&gt;
					margin = '0.7em -1em -0.7em',&lt;br /&gt;
					['background-color'] = '#EAF4F9',&lt;br /&gt;
					['border-top'] = 'inherit',&lt;br /&gt;
					padding = '0.8em 1em 0.7em',&lt;br /&gt;
					clear = 'both'&lt;br /&gt;
				}&lt;br /&gt;
				:node( links )&lt;br /&gt;
				:wikitext( 'The above documentation is transcluded from [[', docPage.fullText, ']].' )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if category then&lt;br /&gt;
		body:wikitext( f:expandTemplate{ title = 'Translation category', args = { category, project = '0' } } )&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local anchor = ''&lt;br /&gt;
	if not noDoc and pageType ~= 'template' and pageType ~= 'message' then&lt;br /&gt;
		anchor = mw.html.create( 'div' ):attr( 'id', 'the-code' )&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>CraftingTable&gt;Fadyblok240</name></author>
		
	</entry>
</feed>