<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.slipshine.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASection_link</id>
		<title>Module:Section link - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.slipshine.net/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASection_link"/>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Section_link&amp;action=history"/>
		<updated>2026-04-17T22:40:23Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.26.2</generator>

	<entry>
		<id>http://wiki.slipshine.net/w/index.php?title=Module:Section_link&amp;diff=146&amp;oldid=prev</id>
		<title>SuperHappy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Section_link&amp;diff=146&amp;oldid=prev"/>
				<updated>2016-01-30T14:00:45Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision imported&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;tr style='vertical-align: top;' lang='en'&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='1' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 14:00, 30 January 2016&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan='2' style='text-align: center;' lang='en'&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>SuperHappy</name></author>	</entry>

	<entry>
		<id>http://wiki.slipshine.net/w/index.php?title=Module:Section_link&amp;diff=145&amp;oldid=prev</id>
		<title>Mr. Stradivarius: Protected Module:Section link: High-risk Lua module ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))</title>
		<link rel="alternate" type="text/html" href="http://wiki.slipshine.net/w/index.php?title=Module:Section_link&amp;diff=145&amp;oldid=prev"/>
				<updated>2014-12-09T11:14:11Z</updated>
		
		<summary type="html">&lt;p&gt;Protected Module:Section link: &lt;a href=&quot;/w/index.php?title=WP:High-risk_templates&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:High-risk templates (page does not exist)&quot;&gt;High-risk Lua module&lt;/a&gt; ([Edit=Allow only template editors and admins] (indefinite) [Move=Allow only template editors and admins] (indefinite))&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements {{section link}}.&lt;br /&gt;
&lt;br /&gt;
local checkType = require('libraryUtil').checkType&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function makeSectionLink(page, section, display)&lt;br /&gt;
	display = display or section&lt;br /&gt;
	page = page or ''&lt;br /&gt;
	return string.format('[[%s#%s|%s]]', page, section, display)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(page, sections, options, title)&lt;br /&gt;
	-- Validate input.&lt;br /&gt;
	checkType('_main', 1, page, 'string', true)&lt;br /&gt;
	checkType('_main', 3, options, 'table', true)&lt;br /&gt;
	if sections == nil then&lt;br /&gt;
		sections = {}&lt;br /&gt;
	elseif type(sections) == 'string' then&lt;br /&gt;
		sections = {sections}&lt;br /&gt;
	elseif type(sections) ~= 'table' then&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&amp;quot;type error in argument #2 to '_main' &amp;quot; ..&lt;br /&gt;
			&amp;quot;(string, table or nil expected, got %s)&amp;quot;,&lt;br /&gt;
			type(sections)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
	options = options or {}&lt;br /&gt;
	title = title or mw.title.getCurrentTitle()&lt;br /&gt;
&lt;br /&gt;
	-- Deal with blank page names elegantly&lt;br /&gt;
	if page and not page:find('%S') then&lt;br /&gt;
		page = nil&lt;br /&gt;
		options.nopage = true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Make the link(s).&lt;br /&gt;
	local isShowingPage = not options.nopage&lt;br /&gt;
	if #sections &amp;lt;= 1 then&lt;br /&gt;
		local linkPage = page or ''&lt;br /&gt;
		local section = sections[1] or 'Notes'&lt;br /&gt;
		local display = '§&amp;amp;thinsp;' .. section&lt;br /&gt;
		if isShowingPage then&lt;br /&gt;
			page = page or title.prefixedText&lt;br /&gt;
			display = page .. ' ' .. display&lt;br /&gt;
		end&lt;br /&gt;
		return makeSectionLink(linkPage, section, display)&lt;br /&gt;
	else&lt;br /&gt;
		-- Multiple sections. First, make a list of the links to display.&lt;br /&gt;
		local ret = {}&lt;br /&gt;
		for i, section in ipairs(sections) do&lt;br /&gt;
			ret[i] = makeSectionLink(page, section)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		-- Assemble the list of links into a string with mw.text.listToText.&lt;br /&gt;
		-- We use the default separator for mw.text.listToText, but a custom&lt;br /&gt;
		-- conjunction. There is also a special case conjunction if we only&lt;br /&gt;
		-- have two links.&lt;br /&gt;
		local conjunction&lt;br /&gt;
		if #sections == 2 then&lt;br /&gt;
			conjunction = '&amp;amp;#8203; and '&lt;br /&gt;
		else&lt;br /&gt;
			conjunction = ', and '&lt;br /&gt;
		end&lt;br /&gt;
		ret = mw.text.listToText(ret, nil, conjunction)&lt;br /&gt;
&lt;br /&gt;
		-- Add the intro text.&lt;br /&gt;
		local intro = '§§&amp;amp;thinsp;'&lt;br /&gt;
		if isShowingPage then&lt;br /&gt;
			intro = (page or title.prefixedText) .. ' ' .. intro&lt;br /&gt;
		end&lt;br /&gt;
		ret = intro .. ret&lt;br /&gt;
&lt;br /&gt;
		return ret&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require('Module:Arguments').getArgs(frame, {&lt;br /&gt;
		wrappers = 'Template:Section link',&lt;br /&gt;
		valueFunc = function (key, value)&lt;br /&gt;
			value = value:match('^%s*(.-)%s*$') -- Trim whitespace&lt;br /&gt;
			-- Allow blank first parameters, as the wikitext template does this.&lt;br /&gt;
			if value ~= '' or key == 1 then&lt;br /&gt;
				return value&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	})&lt;br /&gt;
&lt;br /&gt;
	-- Sort the arguments.&lt;br /&gt;
	local page&lt;br /&gt;
	local sections, options = {}, {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if k == 1 then&lt;br /&gt;
			-- Doing this in the loop because of a bug in [[Module:Arguments]]&lt;br /&gt;
			-- when using pairs with deleted arguments.&lt;br /&gt;
			page = v&lt;br /&gt;
		elseif type(k) == 'number' then&lt;br /&gt;
			sections[k] = v&lt;br /&gt;
		else&lt;br /&gt;
			options[k] = v&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Compress the sections array.&lt;br /&gt;
	local function compressArray(t)&lt;br /&gt;
		local nums, ret = {}, {}&lt;br /&gt;
		for num in pairs(t) do&lt;br /&gt;
			nums[#nums + 1] = num&lt;br /&gt;
		end&lt;br /&gt;
		table.sort(nums)&lt;br /&gt;
		for i, num in ipairs(nums) do&lt;br /&gt;
			ret[i] = t[num]&lt;br /&gt;
		end&lt;br /&gt;
		return ret&lt;br /&gt;
	end&lt;br /&gt;
	sections = compressArray(sections)&lt;br /&gt;
&lt;br /&gt;
	return p._main(page, sections, options)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Mr. Stradivarius</name></author>	</entry>

	</feed>