<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://culturality.museum/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASidebar</id>
	<title>Module:Sidebar - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://culturality.museum/wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3ASidebar"/>
	<link rel="alternate" type="text/html" href="https://culturality.museum/wiki/index.php?title=Module:Sidebar&amp;action=history"/>
	<updated>2026-04-04T03:43:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://culturality.museum/wiki/index.php?title=Module:Sidebar&amp;diff=88&amp;oldid=prev</id>
		<title>Iao: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://culturality.museum/wiki/index.php?title=Module:Sidebar&amp;diff=88&amp;oldid=prev"/>
		<updated>2024-04-09T09:57:05Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&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-GB&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 09:57, 9 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&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;/table&gt;</summary>
		<author><name>Iao</name></author>
	</entry>
	<entry>
		<id>https://culturality.museum/wiki/index.php?title=Module:Sidebar&amp;diff=87&amp;oldid=prev</id>
		<title>wikipedia&gt;Izno: move these items to config, discovered during work at meta</title>
		<link rel="alternate" type="text/html" href="https://culturality.museum/wiki/index.php?title=Module:Sidebar&amp;diff=87&amp;oldid=prev"/>
		<updated>2023-03-14T22:35:53Z</updated>

		<summary type="html">&lt;p&gt;move these items to config, discovered during work at meta&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;require('strict')&lt;br /&gt;
local cfg = mw.loadData('Module:Sidebar/configuration')&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local getArgs = require('Module:Arguments').getArgs&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Categorizes calling templates and modules with a 'style' parameter of any sort&lt;br /&gt;
for tracking to convert to TemplateStyles.&lt;br /&gt;
&lt;br /&gt;
TODO after a long cleanup: Catch sidebars in other namespaces than Template and Module.&lt;br /&gt;
TODO would probably want to remove /log and /archive as CS1 does&lt;br /&gt;
]]&lt;br /&gt;
local function categorizeTemplatesWithInlineStyles(args)&lt;br /&gt;
	local title = mw.title.getCurrentTitle()&lt;br /&gt;
	if title.namespace ~= 10 and title.namespace ~= 828 then return '' end&lt;br /&gt;
	for _, pattern in ipairs (cfg.i18n.pattern.uncategorized_conversion_titles) do&lt;br /&gt;
		if title.text:match(pattern) then return '' end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	for key, _ in pairs(args) do&lt;br /&gt;
		if mw.ustring.find(key, cfg.i18n.pattern.style_conversion) or key == 'width' then&lt;br /&gt;
			return cfg.i18n.category.conversion&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
For compatibility with the original {{sidebar with collapsible lists}}&lt;br /&gt;
implementation, which passed some parameters through {{#if}} to trim their&lt;br /&gt;
whitespace. This also triggered the automatic newline behavior.&lt;br /&gt;
]]&lt;br /&gt;
-- See ([[meta:Help:Newlines and spaces#Automatic newline]])&lt;br /&gt;
local function trimAndAddAutomaticNewline(s)&lt;br /&gt;
	s = mw.ustring.gsub(s, &amp;quot;^%s*(.-)%s*$&amp;quot;, &amp;quot;%1&amp;quot;)&lt;br /&gt;
	if mw.ustring.find(s, '^[#*:;]') or mw.ustring.find(s, '^{|') then&lt;br /&gt;
		return '\n' .. s&lt;br /&gt;
	else&lt;br /&gt;
		return s&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Finds whether a sidebar has a subgroup sidebar.&lt;br /&gt;
]]&lt;br /&gt;
local function hasSubgroup(s)&lt;br /&gt;
	if mw.ustring.find(s, cfg.i18n.pattern.subgroup) then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function has_navbar(navbar_mode, sidebar_name)&lt;br /&gt;
	return navbar_mode ~= cfg.i18n.navbar_none and&lt;br /&gt;
		navbar_mode ~= cfg.i18n.navbar_off and&lt;br /&gt;
		(&lt;br /&gt;
			sidebar_name or&lt;br /&gt;
			mw.getCurrentFrame():getParent():getTitle():gsub(cfg.i18n.pattern.sandbox, '') ~=&lt;br /&gt;
			cfg.i18n.title_not_to_add_navbar&lt;br /&gt;
		)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function has_list_class(args, htmlclass)&lt;br /&gt;
	local patterns = {&lt;br /&gt;
		'^' .. htmlclass .. '$',&lt;br /&gt;
		'%s' .. htmlclass .. '$',&lt;br /&gt;
		'^' .. htmlclass .. '%s',&lt;br /&gt;
		'%s' .. htmlclass .. '%s'&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	for arg, value in pairs(args) do&lt;br /&gt;
		if type(arg) == 'string' and mw.ustring.find(arg, 'class') then&lt;br /&gt;
			for _, pattern in ipairs(patterns) do&lt;br /&gt;
				if mw.ustring.find(args[arg] or '', pattern) then&lt;br /&gt;
					return true&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- there are a lot of list classes in the wild, so we add their TemplateStyles&lt;br /&gt;
local function add_list_styles(args)&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local function add_list_templatestyles(htmlclass, templatestyles)&lt;br /&gt;
		if has_list_class(args, htmlclass) then&lt;br /&gt;
			return frame:extensionTag{&lt;br /&gt;
				name = 'templatestyles', args = { src = templatestyles }&lt;br /&gt;
			}&lt;br /&gt;
		else&lt;br /&gt;
			return ''&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local plainlist_styles = add_list_templatestyles('plainlist', cfg.i18n.plainlist_templatestyles)&lt;br /&gt;
	local hlist_styles = add_list_templatestyles('hlist', cfg.i18n.hlist_templatestyles)&lt;br /&gt;
	&lt;br /&gt;
	-- a second workaround for [[phab:T303378]]&lt;br /&gt;
	-- when that issue is fixed, we can actually use has_navbar not to emit the&lt;br /&gt;
	-- tag here if we want&lt;br /&gt;
	if has_navbar(args.navbar, args.name) and hlist_styles == '' then&lt;br /&gt;
		hlist_styles = frame:extensionTag{&lt;br /&gt;
			name = 'templatestyles', args = { src = cfg.i18n.hlist_templatestyles}&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- hlist -&amp;gt; plainlist is best-effort to preserve old Common.css ordering. [hlist_note]&lt;br /&gt;
	return hlist_styles .. plainlist_styles&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- work around [[phab:T303378]]&lt;br /&gt;
-- for each arg: find all the templatestyles strip markers, insert them into a&lt;br /&gt;
-- table. then remove all templatestyles markers from the arg&lt;br /&gt;
local function move_hiding_templatestyles(args)&lt;br /&gt;
	local gfind = string.gfind&lt;br /&gt;
	local gsub = string.gsub&lt;br /&gt;
	local templatestyles_markers = {}&lt;br /&gt;
	local strip_marker_pattern = '(\127[^\127]*UNIQ%-%-templatestyles%-%x+%-QINU[^\127]*\127)'&lt;br /&gt;
	for k, arg in pairs(args) do&lt;br /&gt;
		for marker in gfind(arg, strip_marker_pattern) do&lt;br /&gt;
			table.insert(templatestyles_markers, marker)&lt;br /&gt;
		end&lt;br /&gt;
		args[k] = gsub(arg, strip_marker_pattern, '')&lt;br /&gt;
	end&lt;br /&gt;
	return templatestyles_markers&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Main sidebar function. Takes the frame, args, and an optional collapsibleClass.&lt;br /&gt;
The collapsibleClass is and should be used only for sidebars with collapsible&lt;br /&gt;
lists, as in p.collapsible.&lt;br /&gt;
]]&lt;br /&gt;
function p.sidebar(frame, args, collapsibleClass)&lt;br /&gt;
	if not args then&lt;br /&gt;
		args = getArgs(frame)&lt;br /&gt;
	end&lt;br /&gt;
	local hiding_templatestyles = table.concat(move_hiding_templatestyles(args))&lt;br /&gt;
	local root = mw.html.create()&lt;br /&gt;
	local child = args.child and mw.text.trim(args.child) == cfg.i18n.child_yes&lt;br /&gt;
&lt;br /&gt;
	root = root:tag('table')&lt;br /&gt;
	if not child then&lt;br /&gt;
		root &lt;br /&gt;
			:addClass(cfg.i18n.class.sidebar)&lt;br /&gt;
			-- force collapsibleclass to be sidebar-collapse otherwise output nothing&lt;br /&gt;
			:addClass(collapsibleClass == cfg.i18n.class.collapse and cfg.i18n.class.collapse or nil)&lt;br /&gt;
			:addClass('nomobile')&lt;br /&gt;
			:addClass(args.float == cfg.i18n.float_none and cfg.i18n.class.float_none or nil)&lt;br /&gt;
			:addClass(args.float == cfg.i18n.float_left and cfg.i18n.class.float_left or nil)&lt;br /&gt;
			:addClass(args.wraplinks ~= cfg.i18n.wrap_true and cfg.i18n.class.wraplinks or nil)&lt;br /&gt;
			:addClass(args.bodyclass or args.class)&lt;br /&gt;
			:css('width', args.width or nil)&lt;br /&gt;
			:cssText(args.bodystyle or args.style)&lt;br /&gt;
&lt;br /&gt;
		if args.outertitle then&lt;br /&gt;
			root&lt;br /&gt;
				:tag('caption')&lt;br /&gt;
					:addClass(cfg.i18n.class.outer_title)&lt;br /&gt;
					:addClass(args.outertitleclass)&lt;br /&gt;
					:cssText(args.outertitlestyle)&lt;br /&gt;
					:wikitext(args.outertitle)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if args.topimage then&lt;br /&gt;
			local imageCell = root:tag('tr'):tag('td')&lt;br /&gt;
&lt;br /&gt;
			imageCell&lt;br /&gt;
				:addClass(cfg.i18n.class.top_image)&lt;br /&gt;
				:addClass(args.topimageclass)&lt;br /&gt;
				:cssText(args.topimagestyle)&lt;br /&gt;
				:wikitext(args.topimage)&lt;br /&gt;
&lt;br /&gt;
			if args.topcaption then&lt;br /&gt;
				imageCell&lt;br /&gt;
					:tag('div')&lt;br /&gt;
						:addClass(cfg.i18n.class.top_caption)&lt;br /&gt;
						:cssText(args.topcaptionstyle)&lt;br /&gt;
						:wikitext(args.topcaption)&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if args.pretitle then&lt;br /&gt;
			root&lt;br /&gt;
				:tag('tr')&lt;br /&gt;
					:tag('td')&lt;br /&gt;
						:addClass(args.topimage and cfg.i18n.class.pretitle_with_top_image&lt;br /&gt;
							or cfg.i18n.class.pretitle)&lt;br /&gt;
						:addClass(args.pretitleclass)&lt;br /&gt;
						:cssText(args.basestyle)&lt;br /&gt;
						:cssText(args.pretitlestyle)&lt;br /&gt;
						:wikitext(args.pretitle)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		root&lt;br /&gt;
			:addClass(cfg.i18n.class.subgroup)&lt;br /&gt;
			:addClass(args.bodyclass or args.class)&lt;br /&gt;
			:cssText(args.bodystyle or args.style)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.title then&lt;br /&gt;
		if child then&lt;br /&gt;
			root&lt;br /&gt;
				:wikitext(args.title)&lt;br /&gt;
		else&lt;br /&gt;
			root&lt;br /&gt;
				:tag('tr')&lt;br /&gt;
					:tag('th')&lt;br /&gt;
						:addClass(args.pretitle and cfg.i18n.class.title_with_pretitle&lt;br /&gt;
							or cfg.i18n.class.title)&lt;br /&gt;
						:addClass(args.titleclass)&lt;br /&gt;
						:cssText(args.basestyle)&lt;br /&gt;
						:cssText(args.titlestyle)&lt;br /&gt;
						:wikitext(args.title)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.image then&lt;br /&gt;
		local imageCell = root:tag('tr'):tag('td')&lt;br /&gt;
&lt;br /&gt;
		imageCell&lt;br /&gt;
			:addClass(cfg.i18n.class.image)&lt;br /&gt;
			:addClass(args.imageclass)&lt;br /&gt;
			:cssText(args.imagestyle)&lt;br /&gt;
			:wikitext(args.image)&lt;br /&gt;
&lt;br /&gt;
		if args.caption then&lt;br /&gt;
			imageCell&lt;br /&gt;
				:tag('div')&lt;br /&gt;
					:addClass(cfg.i18n.class.caption)&lt;br /&gt;
					:cssText(args.captionstyle)&lt;br /&gt;
					:wikitext(args.caption)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.above then&lt;br /&gt;
		root&lt;br /&gt;
			:tag('tr')&lt;br /&gt;
				:tag('td')&lt;br /&gt;
					:addClass(cfg.i18n.class.above)&lt;br /&gt;
					:addClass(args.aboveclass)&lt;br /&gt;
					:cssText(args.abovestyle)&lt;br /&gt;
					:newline() -- newline required for bullet-points to work&lt;br /&gt;
					:wikitext(args.above)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local rowNums = {}&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		k = '' .. k&lt;br /&gt;
		local num = k:match('^heading(%d+)$') or k:match('^content(%d+)$')&lt;br /&gt;
		if num then table.insert(rowNums, tonumber(num)) end&lt;br /&gt;
	end&lt;br /&gt;
	table.sort(rowNums)&lt;br /&gt;
	-- remove duplicates from the list (e.g. 3 will be duplicated if both heading3&lt;br /&gt;
	-- and content3 are specified)&lt;br /&gt;
	for i = #rowNums, 1, -1 do&lt;br /&gt;
		if rowNums[i] == rowNums[i - 1] then&lt;br /&gt;
			table.remove(rowNums, i)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for i, num in ipairs(rowNums) do&lt;br /&gt;
		local heading = args['heading' .. num]&lt;br /&gt;
		if heading then&lt;br /&gt;
			root&lt;br /&gt;
				:tag('tr')&lt;br /&gt;
					:tag('th')&lt;br /&gt;
						:addClass(cfg.i18n.class.heading)&lt;br /&gt;
						:addClass(args.headingclass)&lt;br /&gt;
						:addClass(args['heading' .. num .. 'class'])&lt;br /&gt;
						:cssText(args.basestyle)&lt;br /&gt;
						:cssText(args.headingstyle)&lt;br /&gt;
						:cssText(args['heading' .. num .. 'style'])&lt;br /&gt;
						:newline()&lt;br /&gt;
						:wikitext(heading)&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		local content = args['content' .. num]&lt;br /&gt;
		if content then&lt;br /&gt;
			root&lt;br /&gt;
				:tag('tr')&lt;br /&gt;
					:tag('td')&lt;br /&gt;
						:addClass(hasSubgroup(content) and cfg.i18n.class.content_with_subgroup&lt;br /&gt;
							or cfg.i18n.class.content)&lt;br /&gt;
						:addClass(args.contentclass)&lt;br /&gt;
						:addClass(args['content' .. num .. 'class'])&lt;br /&gt;
						:cssText(args.contentstyle)&lt;br /&gt;
						:cssText(args['content' .. num .. 'style'])&lt;br /&gt;
						:newline()&lt;br /&gt;
						:wikitext(content)&lt;br /&gt;
						:done()&lt;br /&gt;
					 -- Without a linebreak after the &amp;lt;/td&amp;gt;, a nested list like&lt;br /&gt;
					 -- &amp;quot;* {{hlist| ...}}&amp;quot; doesn't parse correctly.&lt;br /&gt;
					:newline()&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if args.below then&lt;br /&gt;
		root&lt;br /&gt;
			:tag('tr')&lt;br /&gt;
				:tag('td')&lt;br /&gt;
					:addClass(cfg.i18n.class.below)&lt;br /&gt;
					:addClass(args.belowclass)&lt;br /&gt;
					:cssText(args.belowstyle)&lt;br /&gt;
					:newline()&lt;br /&gt;
					:wikitext(args.below)&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if not child and has_navbar(args.navbar, args.name) then&lt;br /&gt;
		root&lt;br /&gt;
			:tag('tr')&lt;br /&gt;
				:tag('td')&lt;br /&gt;
					:addClass(cfg.i18n.class.navbar)&lt;br /&gt;
					:cssText(args.navbarstyle)&lt;br /&gt;
					:wikitext(require('Module:Navbar')._navbar{&lt;br /&gt;
						args.name,&lt;br /&gt;
						mini = 1,&lt;br /&gt;
						fontstyle = args.navbarfontstyle&lt;br /&gt;
					})&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local base_templatestyles = frame:extensionTag{&lt;br /&gt;
		name = 'templatestyles', args = { src = cfg.i18n.templatestyles }&lt;br /&gt;
	}&lt;br /&gt;
	&lt;br /&gt;
	local templatestyles = ''&lt;br /&gt;
	if args['templatestyles'] and args['templatestyles'] ~= '' then&lt;br /&gt;
		templatestyles = frame:extensionTag{&lt;br /&gt;
			name = 'templatestyles', args = { src = args['templatestyles'] }&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local child_templatestyles = ''&lt;br /&gt;
	if args['child templatestyles'] and args['child templatestyles'] ~= '' then&lt;br /&gt;
		child_templatestyles = frame:extensionTag{&lt;br /&gt;
			name = 'templatestyles', args = { src = args['child templatestyles'] }&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	local grandchild_templatestyles = ''&lt;br /&gt;
	if args['grandchild templatestyles'] and args['grandchild templatestyles'] ~= '' then&lt;br /&gt;
		grandchild_templatestyles = frame:extensionTag{&lt;br /&gt;
			name = 'templatestyles', args = { src = args['grandchild templatestyles'] }&lt;br /&gt;
		}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat({&lt;br /&gt;
		add_list_styles(args), -- see [hlist_note] above about ordering&lt;br /&gt;
		base_templatestyles,&lt;br /&gt;
		templatestyles,&lt;br /&gt;
		child_templatestyles,&lt;br /&gt;
		grandchild_templatestyles,&lt;br /&gt;
		hiding_templatestyles,&lt;br /&gt;
		tostring(root),&lt;br /&gt;
		(child and cfg.i18n.category.child or ''),&lt;br /&gt;
		categorizeTemplatesWithInlineStyles(args)&lt;br /&gt;
	})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function list_title(args, is_centered_list_titles, num)&lt;br /&gt;
	&lt;br /&gt;
	local title_text = trimAndAddAutomaticNewline(args['list' .. num .. 'title']&lt;br /&gt;
		or cfg.i18n.default_list_title)&lt;br /&gt;
&lt;br /&gt;
	local title&lt;br /&gt;
	if is_centered_list_titles then&lt;br /&gt;
		-- collapsible can be finicky, so provide some CSS/HTML to support&lt;br /&gt;
		title = mw.html.create('div')&lt;br /&gt;
			:addClass(cfg.i18n.class.list_title_centered)&lt;br /&gt;
			:wikitext(title_text)&lt;br /&gt;
	else&lt;br /&gt;
		title = mw.html.create()&lt;br /&gt;
			:wikitext(title_text)&lt;br /&gt;
	end&lt;br /&gt;
		&lt;br /&gt;
	local title_container = mw.html.create('div')&lt;br /&gt;
		:addClass(cfg.i18n.class.list_title)&lt;br /&gt;
		-- don't /need/ a listnumtitleclass because you can do&lt;br /&gt;
		-- .templateclass .listnumclass .sidebar-list-title&lt;br /&gt;
		:addClass(args.listtitleclass)&lt;br /&gt;
		:cssText(args.basestyle)&lt;br /&gt;
		:cssText(args.listtitlestyle)&lt;br /&gt;
		:cssText(args['list' .. num .. 'titlestyle'])&lt;br /&gt;
		:node(title)&lt;br /&gt;
		:done()&lt;br /&gt;
	&lt;br /&gt;
	return title_container&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Main entry point for sidebar with collapsible lists.&lt;br /&gt;
Does the work of creating the collapsible lists themselves and including them&lt;br /&gt;
into the args.&lt;br /&gt;
]]&lt;br /&gt;
function p.collapsible(frame)&lt;br /&gt;
	local args = getArgs(frame)&lt;br /&gt;
	if not args.name and&lt;br /&gt;
		frame:getParent():getTitle():gsub(cfg.i18n.pattern.collapse_sandbox, '') ==&lt;br /&gt;
		cfg.i18n.collapse_title_not_to_add_navbar then&lt;br /&gt;
		args.navbar = cfg.i18n.navbar_none&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local contentArgs = {}&lt;br /&gt;
	&lt;br /&gt;
	local is_centered_list_titles = false&lt;br /&gt;
	if args['centered list titles'] and args['centered list titles'] ~= '' then&lt;br /&gt;
		is_centered_list_titles = true&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		local num = string.match(k, '^list(%d+)$')&lt;br /&gt;
		if num then&lt;br /&gt;
			local expand = args.expanded and&lt;br /&gt;
				(args.expanded == 'all' or args.expanded == args['list' .. num .. 'name'])&lt;br /&gt;
			local row = mw.html.create('div')&lt;br /&gt;
			row&lt;br /&gt;
				:addClass(cfg.i18n.class.list)&lt;br /&gt;
				:addClass('mw-collapsible')&lt;br /&gt;
				:addClass((not expand) and 'mw-collapsed' or nil)&lt;br /&gt;
				:addClass(args['list' .. num .. 'class'])&lt;br /&gt;
				:cssText(args.listframestyle)&lt;br /&gt;
				:cssText(args['list' .. num .. 'framestyle'])&lt;br /&gt;
				:node(list_title(args, is_centered_list_titles, num))&lt;br /&gt;
				:tag('div')&lt;br /&gt;
					:addClass(cfg.i18n.class.list_content)&lt;br /&gt;
					:addClass('mw-collapsible-content')&lt;br /&gt;
					-- don't /need/ a listnumstyleclass because you can do&lt;br /&gt;
					-- .templatename .listnumclass .sidebar-list&lt;br /&gt;
					:addClass(args.listclass)&lt;br /&gt;
					:cssText(args.liststyle)&lt;br /&gt;
					:cssText(args['list' .. num .. 'style'])&lt;br /&gt;
					:wikitext(trimAndAddAutomaticNewline(args['list' .. num]))&lt;br /&gt;
&lt;br /&gt;
			contentArgs['content' .. num] = tostring(row)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	for k, v in pairs(contentArgs) do&lt;br /&gt;
		args[k] = v&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return p.sidebar(frame, args, cfg.i18n.class.collapse)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Izno</name></author>
	</entry>
</feed>