local p =
function standardicon(modulename) index = -- Take modulename as input, returns corresponding icon filename -- Returns default icon if no icon is defined -- Grow the library! Add default icons as needed by adding this line below: -- index['MODULENAME'] = 'FILE NAME.ext' index['About'] = 'Information Noun 176431.svg' index['About us'] = 'Information Noun 176431.svg' index['Alerts'] = 'Bell icon.svg' index['Article alerts'] = 'Bell icon.svg' index['Article Alerts'] = 'Bell icon.svg' index['Partners'] = 'Handshake noun.svg' index['Partnerships'] = 'Handshake noun.svg' index['Discussions'] = 'Speechbubbles icon.svg' index['Events'] = 'Simpleicons Business calendar-with-a-clock-time-tools.svg' -- Is this PD-shapes? index['External Links'] = 'Link icon.svg' index['External links'] = 'Link icon.svg' index['Links'] = 'Link icon.svg' index['Maps'] = 'MapPin.svg' index['Metrics'] = 'ArticleCheck.svg' index['News'] = 'Calendar icon 2.svg' index['Offline App'] = 'Offline logo.svg' index['Press'] = 'Cite newspaper.svg' index['Recent changes'] = 'Clock icon.svg' index['Recent Changes'] = 'Clock icon.svg' index['Recognized content'] = 'RibbonPrize.svg' index['Recognized Content'] = 'RibbonPrize.svg' index['Related Projects'] = 'Contributions icon.svg' -- Not for use for the update bot, special use case, that expands the page index['Related WikiProjects'] = 'Contributions icon.svg' index['Requests'] = 'Quotes icon.svg' index['Research'] = 'Microscope icon (black OCL).svg' index['Resources'] = 'Cite book.svg' index['Showcase'] = 'RibbonPrize.svg' index['Tasks'] = 'ListBullet.svg' index['Tools'] = 'Octicons-tools-minor.svg' index['Translations'] = 'Translation icon.svg' index['Watchlist'] = 'OpenEye icon.svg' index['Worklists'] = 'ListBullet.svg' for t, fn in pairs(index) do if t
function editlinktest(modulename) no_edit_links = -- no edit link for these standard modules for _, l in pairs(no_edit_links) do if l
function p.build(frame) title = intro = image = color = '#6af' -- default value displaymode = 'normal' -- default value modules = for key, value in pairs(frame:getParent.args) do -- iterate through arguments, pick out values if key
'intro' then intro = value elseif key
'color' then color = value elseif key
-- Rendering table of contents and body toc_args = -- passed into Image Array module toc_args['font-size'] = '100%' toc_args['margin'] = 0 body = "" -- Load a Table of Contents entry, transclude module, for each named module counter = 0 for _, module in pairs(modules) do counter = counter + 1 toc_args['image' .. counter] = standardicon(module) toc_args['alt' .. counter] = module if displaymode
"Metrics" or module
"About us" or module
"Research" or module
"Related WikiProjects" then -- Load the appropriate subpage of moduletitle = 'Related WikiProjects' .. '/' .. title moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_') body = body .. "\n" .. frame:expandTemplate body = body .. "\n" .. frame:expandTemplate else if displaymode
"womeninred" and module ~= "Metrics" and module ~= "Showcase" and module ~= "About us" and module ~= "Press" and module ~= "Research" and module ~= "External links") then moduletitle = title .. '/' .. module moduletitle_encoded = string.gsub('Wikipedia:' .. moduletitle, ' ', '_') body = body .. "\n" .. frame:expandTemplate if mw.title.makeTitle('Wikipedia', moduletitle).exists
" else -- Is module in question a Standard Module? If so, load the template with corresponding editintro if mw.title.makeTitle('Template', 'WPX module/' .. module).exists
" .. frame:expandTemplate .. "
"
-- Adding header header = "\n
" -- top container if displaymode
" -- intro else header = header .. "
" -- intro end -- Adding project icon header = header .. "
" header = header .. image .. "
" -- Adding project title header = header .. "
" -- header header = header .. "
" if displaymode
" header = header .. intro .. "
" -- Adding announcement section if mw.title.makeTitle('Wikipedia', title .. "/" .. "Announcements").exists
" -- Adding member box header = header .. "
" header = header .. frame:expandTemplate header = header .. "
" -- Closing off header header = header .. "
"
-- Assembling parts if displaymode
return p