<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALoad_WikiProject_Modules</id>
	<title>Module:Load WikiProject Modules - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mywikibiz.com/index.php?action=history&amp;feed=atom&amp;title=Module%3ALoad_WikiProject_Modules"/>
	<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Load_WikiProject_Modules&amp;action=history"/>
	<updated>2026-07-28T01:14:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.3</generator>
	<entry>
		<id>https://mywikibiz.com/index.php?title=Module:Load_WikiProject_Modules&amp;diff=472476&amp;oldid=prev</id>
		<title>Zoran: Pywikibot 6.4.0</title>
		<link rel="alternate" type="text/html" href="https://mywikibiz.com/index.php?title=Module:Load_WikiProject_Modules&amp;diff=472476&amp;oldid=prev"/>
		<updated>2021-07-15T23:33:15Z</updated>

		<summary type="html">&lt;p&gt;Pywikibot 6.4.0&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;
&lt;br /&gt;
function standardicon(modulename)&lt;br /&gt;
	index = {}&lt;br /&gt;
	-- Take modulename as input, returns corresponding icon filename&lt;br /&gt;
	-- Returns default icon if no icon is defined&lt;br /&gt;
	-- Grow the library! Add default icons as needed by adding this line below:&lt;br /&gt;
	-- index['MODULENAME'] = 'FILE NAME.ext'&lt;br /&gt;
	index['About'] = 'Information Noun 176431.svg'&lt;br /&gt;
	index['About us'] = 'Information Noun 176431.svg'&lt;br /&gt;
	index['Alerts'] = 'Bell icon.svg'&lt;br /&gt;
	index['Article alerts'] = 'Bell icon.svg'&lt;br /&gt;
	index['Article Alerts'] = 'Bell icon.svg'&lt;br /&gt;
	index['Partners'] = 'Handshake noun.svg'&lt;br /&gt;
	index['Partnerships'] = 'Handshake noun.svg'&lt;br /&gt;
	index['Discussions'] = 'Speechbubbles icon.svg'&lt;br /&gt;
	index['Events'] = 'Simpleicons Business calendar-with-a-clock-time-tools.svg' -- Is this PD-shapes?&lt;br /&gt;
	index['External Links'] = 'Link icon.svg'&lt;br /&gt;
	index['External links'] = 'Link icon.svg'&lt;br /&gt;
	index['Links'] = 'Link icon.svg'&lt;br /&gt;
	index['Maps'] = 'MapPin.svg'&lt;br /&gt;
	index['Metrics'] = 'ArticleCheck.svg'&lt;br /&gt;
	index['News'] = 'Calendar icon 2.svg'&lt;br /&gt;
	index['Offline App'] = 'Offline logo.svg'&lt;br /&gt;
	index['Press'] = 'Cite newspaper.svg'&lt;br /&gt;
	index['Recent changes'] = 'Clock icon.svg'&lt;br /&gt;
	index['Recent Changes'] = 'Clock icon.svg'&lt;br /&gt;
	index['Recognized content'] = 'RibbonPrize.svg'&lt;br /&gt;
	index['Recognized Content'] = 'RibbonPrize.svg'&lt;br /&gt;
	index['Related Projects'] = 'Contributions icon.svg' -- Not for use for the update bot, special use case, that expands the page	&lt;br /&gt;
	index['Related WikiProjects'] = 'Contributions icon.svg'&lt;br /&gt;
	index['Requests'] = 'Quotes icon.svg'&lt;br /&gt;
	index['Research'] = 'Microscope icon (black OCL).svg'&lt;br /&gt;
	index['Resources'] = 'Cite book.svg'&lt;br /&gt;
	index['Showcase'] = 'RibbonPrize.svg'&lt;br /&gt;
	index['Tasks'] = 'ListBullet.svg'&lt;br /&gt;
	index['Tools'] = 'Octicons-tools-minor.svg'&lt;br /&gt;
	index['Translations'] = 'Translation icon.svg'&lt;br /&gt;
	index['Watchlist'] = 'OpenEye icon.svg'&lt;br /&gt;
	index['Worklists'] = 'ListBullet.svg'&lt;br /&gt;
	for t, fn in pairs(index) do&lt;br /&gt;
		if t == modulename then&lt;br /&gt;
			return fn&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return 'Beta icon.svg' -- default if nothing matches&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function editlinktest(modulename)&lt;br /&gt;
	no_edit_links = {'Discussions', 'Alerts', 'Showcase', 'Related WikiProjects'} -- no edit link for these standard modules&lt;br /&gt;
	&lt;br /&gt;
	for _, l in pairs(no_edit_links) do&lt;br /&gt;
		if l == modulename then&lt;br /&gt;
			return 'no'&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return 'yes'&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.build(frame)&lt;br /&gt;
	title = ''&lt;br /&gt;
	intro = ''&lt;br /&gt;
	image = ''&lt;br /&gt;
	color = '#6af' -- default value&lt;br /&gt;
	displaymode = 'normal' -- default value&lt;br /&gt;
	modules = {}&lt;br /&gt;
	for key, value in pairs(frame:getParent().args) do  -- iterate through arguments, pick out values&lt;br /&gt;
		if key == 'title' then&lt;br /&gt;
			title = value&lt;br /&gt;
		elseif key == 'intro' then&lt;br /&gt;
			intro = value&lt;br /&gt;
		elseif key == 'image' then&lt;br /&gt;
			image = value&lt;br /&gt;
		elseif key == 'color' then&lt;br /&gt;
			color = value&lt;br /&gt;
		elseif key == 'displaymode' then&lt;br /&gt;
			displaymode = value&lt;br /&gt;
    	elseif string.find(key, 'module') ~= nil then  -- matches module1, module2, etc.&lt;br /&gt;
    		id = string.gsub(key, 'module', '')&lt;br /&gt;
    		id = tonumber(id)&lt;br /&gt;
    		modules[id] = value&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- Rendering table of contents and body&lt;br /&gt;
	toc_args = {width = 80, height = 55} -- passed into Image Array module&lt;br /&gt;
	toc_args['font-size'] = '100%'&lt;br /&gt;
	toc_args['margin'] = 0&lt;br /&gt;
	body = &amp;quot;&amp;quot;&lt;br /&gt;
	&lt;br /&gt;
	-- Load a Table of Contents entry, transclude module, for each named module&lt;br /&gt;
	counter = 0&lt;br /&gt;
	for _, module in pairs(modules) do&lt;br /&gt;
		counter = counter + 1&lt;br /&gt;
		toc_args['image' .. counter] = standardicon(module)&lt;br /&gt;
		toc_args['alt' .. counter] = module&lt;br /&gt;
		if displaymode == &amp;quot;womeninred&amp;quot; then&lt;br /&gt;
			if module == &amp;quot;Metrics&amp;quot; or module == &amp;quot;Showcase&amp;quot; or module == &amp;quot;About us&amp;quot; or module == &amp;quot;Press&amp;quot; or module == &amp;quot;Research&amp;quot; or module == &amp;quot;External links&amp;quot; then&lt;br /&gt;
				toc_args['link' .. counter] = &amp;quot;Wikipedia:WikiProject Women in Red/&amp;quot; .. module&lt;br /&gt;
			else&lt;br /&gt;
				toc_args['link' .. counter] = &amp;quot;#&amp;quot; .. module&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			toc_args['link' .. counter] = &amp;quot;#&amp;quot; .. module&lt;br /&gt;
		end&lt;br /&gt;
		toc_args['caption' .. counter] = &amp;quot;[[&amp;quot; .. toc_args['link' .. counter] .. &amp;quot;|&amp;quot; .. module .. &amp;quot;]]&amp;quot;&lt;br /&gt;
		if module == &amp;quot;Related WikiProjects&amp;quot; then&lt;br /&gt;
			-- Load the appropriate subpage of [[Wikipedia:Related WikiProjects]]&lt;br /&gt;
			moduletitle = 'Related WikiProjects' .. '/' .. title&lt;br /&gt;
			moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_')&lt;br /&gt;
			body = body .. &amp;quot;\n&amp;quot; .. frame:expandTemplate{ title = 'WPX header', args = { module, color = color, modulename = moduletitle_encoded, editlink = editlinktest(module) } }&lt;br /&gt;
			body = body .. &amp;quot;\n&amp;quot; .. frame:expandTemplate{ title = &amp;quot;Wikipedia:Related WikiProjects/&amp;quot; .. title, args = {color} }&lt;br /&gt;
		else&lt;br /&gt;
			if displaymode == &amp;quot;normal&amp;quot; or ( displaymode == &amp;quot;womeninred&amp;quot; and module ~= &amp;quot;Metrics&amp;quot; and module ~= &amp;quot;Showcase&amp;quot; and module ~= &amp;quot;About us&amp;quot; and module ~= &amp;quot;Press&amp;quot; and module ~= &amp;quot;Research&amp;quot; and module ~= &amp;quot;External links&amp;quot; ) then&lt;br /&gt;
				moduletitle = title .. '/' .. module&lt;br /&gt;
				moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_')&lt;br /&gt;
				body = body .. &amp;quot;\n&amp;quot; .. frame:expandTemplate{ title = 'WPX header', args = { module, color = color, modulename = moduletitle_encoded, editlink = editlinktest(module) } }&lt;br /&gt;
				if mw.title.makeTitle('Wikipedia', moduletitle).exists == true then&lt;br /&gt;
					body = body .. &amp;quot;\n&amp;quot; .. frame:expandTemplate{ title = 'Wikipedia:' .. moduletitle, args = {color} } .. &amp;quot;\n&amp;lt;div style='clear:both;'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
				else&lt;br /&gt;
					-- Is module in question a Standard Module? If so, load the template with corresponding editintro&lt;br /&gt;
					if mw.title.makeTitle('Template', 'WPX module/' .. module).exists == true then&lt;br /&gt;
						preload = '&amp;amp;preload=Template:WPX_module/' .. string.gsub(module, ' ', '_')&lt;br /&gt;
						editintro = '&amp;amp;editintro=Template:WPX_editintro/' .. string.gsub(module, ' ', '_')&lt;br /&gt;
					else&lt;br /&gt;
						preload = '' -- no preload&lt;br /&gt;
						editintro = '&amp;amp;editintro=Template:WPX_editintro/Generic' -- generic editintro&lt;br /&gt;
					end&lt;br /&gt;
					-- Create notice&lt;br /&gt;
					create_url = '//en.wikipedia.org/wiki/Wikipedia:' .. string.gsub(moduletitle, ' ', '_') .. '?action=edit' .. preload .. editintro&lt;br /&gt;
					create_button = frame:expandTemplate{ title = 'Template:Clickable button 2', args = {'Create Module', url = create_url, class = 'mw-ui-progressive' } }&lt;br /&gt;
					body = body .. '[[Wikipedia:' .. moduletitle .. ']] does not exist. ' .. create_button&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	toc_args['perrow'] = counter -- sets length of image array to the number of icons&lt;br /&gt;
	toc = &amp;quot;&amp;lt;div style='margin-bottom:4em;'&amp;gt;&amp;quot; .. frame:expandTemplate{ title='Image_array', args = toc_args } .. &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;div style='clear:both;'&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	-- Adding header&lt;br /&gt;
	header = &amp;quot;__NOTOC__\n&amp;lt;div style='display: flex; display: -webkit-flex; flex-flow: row wrap; -webkit-flex-flow: row wrap;'&amp;gt;&amp;quot; -- top container&lt;br /&gt;
	if displaymode == &amp;quot;womeninred&amp;quot; then&lt;br /&gt;
		header = header .. &amp;quot;&amp;lt;div style='flex: 1 0; -webkit-flex: 1 0; border-top: solid .7em &amp;quot; .. color .. &amp;quot;;'&amp;gt;&amp;quot; -- intro&lt;br /&gt;
	else&lt;br /&gt;
		header = header .. &amp;quot;&amp;lt;div style='flex: 1 0; -webkit-flex: 1 0; padding-bottom: 3em; border-top: solid .7em &amp;quot; .. color .. &amp;quot;;'&amp;gt;&amp;quot; -- intro&lt;br /&gt;
	end&lt;br /&gt;
	-- Adding project icon&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;div class='nomobile' style='float:left; margin-top: 1em; margin-right: 2em; margin-bottom: 1em; text-align: center;'&amp;gt;&amp;quot;&lt;br /&gt;
	header = header .. image .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
	-- Adding project title&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;div style='font-size: 120%; padding: 0;'&amp;gt;&amp;quot; -- header&lt;br /&gt;
    header = header .. &amp;quot;&amp;lt;h1 style='font-weight: bold; border-bottom: none; margin:0; padding-top:0.5em;'&amp;gt;&amp;quot; .. title .. &amp;quot;&amp;lt;/h1&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
    if displaymode == &amp;quot;womeninred&amp;quot; then&lt;br /&gt;
    	header = header .. toc&lt;br /&gt;
    end&lt;br /&gt;
	-- Adding intro blurb&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;div style='margin-top: 1em; font-size: 110%;'&amp;gt;&amp;quot;&lt;br /&gt;
	header = header .. intro .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
	-- Adding announcement section&lt;br /&gt;
	if mw.title.makeTitle('Wikipedia', title .. &amp;quot;/&amp;quot; .. &amp;quot;Announcements&amp;quot;).exists == true then&lt;br /&gt;
		header = header .. frame:expandTemplate{ title = 'Wikipedia:' .. title .. &amp;quot;/&amp;quot; .. &amp;quot;Announcements&amp;quot;, args = { } }&lt;br /&gt;
	end&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
	-- Adding member box&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;div style='flex: 0 1; -webkit-flex: 0 20em;'&amp;gt;&amp;quot;&lt;br /&gt;
	header = header .. frame:expandTemplate{ title = 'WPX participants box', args = { } }&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
	-- Closing off header&lt;br /&gt;
	header = header .. &amp;quot;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
	-- Assembling parts&lt;br /&gt;
	if displaymode == &amp;quot;womeninred&amp;quot; then&lt;br /&gt;
		contents = header .. body&lt;br /&gt;
	else&lt;br /&gt;
		contents = header .. toc .. body&lt;br /&gt;
	end&lt;br /&gt;
	return contents&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Zoran</name></author>
	</entry>
</feed>