<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.parallelmc.org/w/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.parallelmc.org/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ADocumentation"/>
	<link rel="alternate" type="text/html" href="https://wiki.parallelmc.org/w/index.php?title=Module:Documentation&amp;action=history"/>
	<updated>2026-04-28T20:30:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.5</generator>
	<entry>
		<id>https://wiki.parallelmc.org/w/index.php?title=Module:Documentation&amp;diff=2643&amp;oldid=prev</id>
		<title>Diamondback88: 1 revision imported: Imported from minecraft.wiki</title>
		<link rel="alternate" type="text/html" href="https://wiki.parallelmc.org/w/index.php?title=Module:Documentation&amp;diff=2643&amp;oldid=prev"/>
		<updated>2023-10-24T06:33:08Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Imported from minecraft.wiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 08:33, 24 October 2023&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>Diamondback88</name></author>
	</entry>
	<entry>
		<id>https://wiki.parallelmc.org/w/index.php?title=Module:Documentation&amp;diff=2642&amp;oldid=prev</id>
		<title>minecraft&gt;ItsPlantseed at 11:01, 27 September 2023</title>
		<link rel="alternate" type="text/html" href="https://wiki.parallelmc.org/w/index.php?title=Module:Documentation&amp;diff=2642&amp;oldid=prev"/>
		<updated>2023-09-27T11:01:59Z</updated>

		<summary type="html">&lt;p&gt;&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 = &amp;#039;doc&amp;#039;&lt;br /&gt;
&lt;br /&gt;
local getType = function( 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; .. 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; .. 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;
	&lt;br /&gt;
	return pageType&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Creating a documentation page or transclusion through {{subst:docc}}&lt;br /&gt;
function p.create( f )&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 page.nsText .. &amp;#039;:&amp;#039; .. page.baseText .. &amp;#039;/&amp;#039; .. 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( &amp;#039;{{subst:Template:Documentation/preload}}&amp;#039; )&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; } 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;
		&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;
		&lt;br /&gt;
		if not args.content then&lt;br /&gt;
			out = out .. &amp;#039;\n&amp;lt;!-- Put categories/interwikis on the documentation page --&amp;gt;&amp;#039;&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 .. &amp;#039;[[Category:Pages with templates requiring substitution]]&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 = require( &amp;#039;Module:ProcessArgs&amp;#039; ).merge( true )&lt;br /&gt;
	local badDoc = args.baddoc&lt;br /&gt;
	if f:callParserFunction( &amp;#039;#dplvar&amp;#039;, &amp;#039;$doc noheader&amp;#039; ) == &amp;#039;1&amp;#039; then&lt;br /&gt;
		if badDoc then&lt;br /&gt;
			f:callParserFunction( &amp;#039;#dplvar:set&amp;#039;, &amp;#039;$doc bad&amp;#039;, &amp;#039;1&amp;#039; )&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 == &amp;#039;sandbox&amp;#039; or subpage == &amp;#039;testcases&amp;#039; 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( &amp;#039;div&amp;#039; ):addClass( &amp;#039;documentation-header&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( &amp;#039;[[&amp;#039;, page:fullUrl( &amp;#039;action=purge&amp;#039; ), &amp;#039; &amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:smw purge}}}}&amp;#039;) .. &amp;#039;]]&amp;#039; )&lt;br /&gt;
		:done()&lt;br /&gt;
		:wikitext(&lt;br /&gt;
			&amp;#039;This is the documentation page. It &amp;#039;,&lt;br /&gt;
			pageType == &amp;#039;module&amp;#039; and &amp;#039;will&amp;#039; or &amp;#039;should&amp;#039;,&lt;br /&gt;
			&amp;#039; be transcluded into the main &amp;#039;, pageType, &amp;#039; page. &amp;#039;,&lt;br /&gt;
			&amp;#039;See [[Template:Documentation]] for more information&amp;#039;&lt;br /&gt;
		)&lt;br /&gt;
	if badDoc then&lt;br /&gt;
		body:wikitext( &amp;quot;&amp;lt;br&amp;gt;&amp;#039;&amp;#039;&amp;#039;This &amp;quot;, pageType, &amp;quot;&amp;#039;s documentation needs improving or additional information.&amp;#039;&amp;#039;&amp;#039;&amp;quot; )&lt;br /&gt;
	end&lt;br /&gt;
	if not ( args.nocat or namespace == &amp;#039;User&amp;#039; ) then&lt;br /&gt;
		body:wikitext( &amp;#039;[[Category:Documentation pages]]&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;
	-- 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 == &amp;#039;sandbox&amp;#039; or subpage == &amp;#039;testcases&amp;#039; 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 namespace .. &amp;#039;:&amp;#039; .. page.text .. &amp;#039;/&amp;#039; .. 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( &amp;#039;#dplvar:set&amp;#039;, &amp;#039;$doc noheader&amp;#039;, &amp;#039;1&amp;#039; )&lt;br /&gt;
		docText = trim( f:expandTemplate{ title = &amp;#039;:&amp;#039; .. docPage.fullText }  )&lt;br /&gt;
		if f:callParserFunction( &amp;#039;#dplvar&amp;#039;, &amp;#039;$doc bad&amp;#039; ) == &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 = &amp;quot;&amp;#039;&amp;#039;&amp;#039;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;#039;&amp;#039;&amp;#039;&amp;quot;&lt;br /&gt;
		if not ( args.nocat or namespace == &amp;#039;User&amp;#039; ) then&lt;br /&gt;
			category = pageType .. &amp;#039;s with no documentation&amp;#039;&lt;br /&gt;
			if not mw.title.new( &amp;#039;Category:&amp;#039; .. category ).exists then&lt;br /&gt;
				category = &amp;#039;Pages with no documentation&amp;#039;&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 = &amp;quot;&amp;#039;&amp;#039;&amp;#039;This &amp;quot; .. pageType .. &amp;quot;&amp;#039;s documentation needs improving or additional information.&amp;#039;&amp;#039;&amp;#039;\n&amp;quot;&lt;br /&gt;
		if not ( args.nocat or namespace == &amp;#039;User&amp;#039; ) then&lt;br /&gt;
			category = pageType .. &amp;#039;s with bad documentation&amp;#039;&lt;br /&gt;
			if not mw.title.new( &amp;#039;Category:&amp;#039; .. category ).exists then&lt;br /&gt;
				category = &amp;#039;Pages with bad documentation&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Generates the [view][edit][history][refresh] or [create][refresh] links&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 purgeLink = &amp;#039;[[Special:Purge/&amp;#039; .. docPage.fullText .. &amp;#039;|&amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:smw purge}}}}&amp;#039;) .. &amp;#039;]]&amp;#039;&lt;br /&gt;
	if not noDoc and page ~= docPage then&lt;br /&gt;
		local viewLink = &amp;#039;[[&amp;#039; .. docPage.fullText .. &amp;#039;|&amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:view}}}}&amp;#039;) .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		local editLink = &amp;#039;[[Special:EditPage/&amp;#039; .. docPage.fullText .. &amp;#039;|&amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:edit}}}}&amp;#039;) .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		local historyLink = &amp;#039;[[Special:PageHistory/&amp;#039; .. docPage.fullText .. &amp;#039;|&amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:history short}}}}&amp;#039;) .. &amp;#039;]]&amp;#039;&lt;br /&gt;
		links:wikitext(&amp;quot;&amp;amp;#91;&amp;quot; .. viewLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. editLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. historyLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;)&lt;br /&gt;
	else&lt;br /&gt;
		local createLink = &amp;#039;[&amp;#039; .. docPage:canonicalUrl{action = &amp;#039;edit&amp;#039;, preload = &amp;#039;Template:Documentation/preload&amp;#039; } .. &amp;#039; &amp;#039; .. f:preprocess(&amp;#039;{{lc:{{int:create}}}}&amp;#039;) .. &amp;#039;]&amp;#039;&lt;br /&gt;
		links:wikitext(&amp;quot;&amp;amp;#91;&amp;quot; .. createLink .. &amp;quot;&amp;amp;#93; &amp;amp;#91;&amp;quot; .. purgeLink .. &amp;quot;&amp;amp;#93;&amp;quot;)&lt;br /&gt;
	end&lt;br /&gt;
	&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( &amp;#039;Documentation&amp;#039; )&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( &amp;#039;[[#the-code|Jump to code ↴]]&amp;#039; )&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( &amp;#039;The above documentation is transcluded from [[&amp;#039;, docPage.fullText, &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 ~= &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 mw.getCurrentFrame():extensionTag(&amp;#039;templatestyles&amp;#039;, &amp;#039;&amp;#039;, {src=&amp;#039;Module:Documentation/styles.css&amp;#039;}) .. tostring( body ) .. tostring( anchor )&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>minecraft&gt;ItsPlantseed</name></author>
	</entry>
</feed>