<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.shroudforge.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AModule_toc</id>
	<title>Module:Module toc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.shroudforge.net/index.php?action=history&amp;feed=atom&amp;title=Module%3AModule_toc"/>
	<link rel="alternate" type="text/html" href="https://wiki.shroudforge.net/index.php?title=Module:Module_toc&amp;action=history"/>
	<updated>2026-11-05T07:26:54Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.2</generator>
	<entry>
		<id>https://wiki.shroudforge.net/index.php?title=Module:Module_toc&amp;diff=96&amp;oldid=prev</id>
		<title>Bonsaibauer: 1 revision imported: Import Star Citizen Modules</title>
		<link rel="alternate" type="text/html" href="https://wiki.shroudforge.net/index.php?title=Module:Module_toc&amp;diff=96&amp;oldid=prev"/>
		<updated>2026-11-04T22:22:09Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported: Import Star Citizen Modules&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw-interface=&quot;&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 22:22, 4 November 2026&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;4&quot; class=&quot;diff-notice&quot; lang=&quot;en-GB&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key mediawiki-mediawiki:diff:1.41:old-95:rev-96 --&gt;
&lt;/table&gt;</summary>
		<author><name>Bonsaibauer</name></author>
	</entry>
	<entry>
		<id>https://wiki.shroudforge.net/index.php?title=Module:Module_toc&amp;diff=95&amp;oldid=prev</id>
		<title>starcitizen&gt;Alistar Bot: Sync from Git (dependencies-panel 0b773f3) (via update-page on MediaWiki MCP Server)</title>
		<link rel="alternate" type="text/html" href="https://wiki.shroudforge.net/index.php?title=Module:Module_toc&amp;diff=95&amp;oldid=prev"/>
		<updated>2026-09-28T15:44:40Z</updated>

		<summary type="html">&lt;p&gt;Sync from Git (dependencies-panel 0b773f3) (via update-page on MediaWiki MCP Server)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require(&amp;#039;strict&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
--- @module Module toc&lt;br /&gt;
--- The functions a Lua module defines and the line each starts on. Imported from&lt;br /&gt;
--- https://runescape.wiki/w/Module:Module_toc.&lt;br /&gt;
&lt;br /&gt;
-- &amp;lt;nowiki&amp;gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--- @class ModuleTocFunction&lt;br /&gt;
--- @field name string&lt;br /&gt;
--- @field line integer&lt;br /&gt;
&lt;br /&gt;
--- @param content string&lt;br /&gt;
--- @return integer[] byte positions of every newline, ascending&lt;br /&gt;
local function newlinePositions(content)&lt;br /&gt;
	local positions = {}&lt;br /&gt;
	local pos = string.find(content, &amp;#039;\n&amp;#039;, 1, true)&lt;br /&gt;
	while pos do&lt;br /&gt;
		positions[#positions + 1] = pos&lt;br /&gt;
		pos = string.find(content, &amp;#039;\n&amp;#039;, pos + 1, true)&lt;br /&gt;
	end&lt;br /&gt;
	return positions&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- The 1-based line holding byte `pos`: one more than the newlines before it.&lt;br /&gt;
--- @param pos integer&lt;br /&gt;
--- @param newlines integer[]&lt;br /&gt;
--- @return integer&lt;br /&gt;
local function lineAt(pos, newlines)&lt;br /&gt;
	local low, high = 0, #newlines&lt;br /&gt;
	while low &amp;lt; high do&lt;br /&gt;
		local mid = math.floor((low + high + 1) / 2)&lt;br /&gt;
		if newlines[mid] &amp;lt; pos then&lt;br /&gt;
			low = mid&lt;br /&gt;
		else&lt;br /&gt;
			high = mid - 1&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return low + 1&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- @param content string&lt;br /&gt;
--- @return ModuleTocFunction[]&lt;br /&gt;
local function findFunctions(content)&lt;br /&gt;
	local found = {}&lt;br /&gt;
	local newlines = newlinePositions(content)&lt;br /&gt;
	for _, pattern in ipairs({&lt;br /&gt;
		&amp;#039;%sfunction%s+([^%s%(]+)%s*%(()&amp;#039;,&lt;br /&gt;
		&amp;#039;%s([%w_%.]+)%s*=%s*function%s*%(()&amp;#039;,&lt;br /&gt;
	}) do&lt;br /&gt;
		for name, pos in string.gmatch(content, pattern) do&lt;br /&gt;
			found[#found + 1] = { name = name, line = lineAt(pos, newlines) }&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return found&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--- The functions `content` defines, in line order. Comments are blanked first,&lt;br /&gt;
--- keeping their newlines so later line numbers stay right.&lt;br /&gt;
--- @param content string Lua source&lt;br /&gt;
--- @return ModuleTocFunction[]&lt;br /&gt;
function p.functions(content)&lt;br /&gt;
	local function keepNewlines(comment)&lt;br /&gt;
		return string.rep(&amp;#039;\n&amp;#039;, #newlinePositions(comment))&lt;br /&gt;
	end&lt;br /&gt;
	local stripped = content:gsub(&amp;#039;(%-%-%[(=-)%[.-%]%2%])&amp;#039;, keepNewlines):gsub(&amp;#039;%-%-[^\n]*&amp;#039;, &amp;#039;&amp;#039;)&lt;br /&gt;
	local found = findFunctions(stripped)&lt;br /&gt;
	table.sort(found, function(a, b)&lt;br /&gt;
		return a.line &amp;lt; b.line&lt;br /&gt;
	end)&lt;br /&gt;
	return found&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;br /&gt;
-- &amp;lt;/nowiki&amp;gt;&lt;/div&gt;</summary>
		<author><name>starcitizen&gt;Alistar Bot</name></author>
	</entry>
</feed>