Open main menu
Home
Random
Donate
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:WikiProjectBanner/autodocs
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local export = {} function export.render_docs(frame) local m_doc = require('Module:Documentation') local banner_name, is_templ = frame:getParent():getTitle():gsub("^Template:", "") banner_name = banner_name:match("^(.*)/sandbox$") or banner_name if is_templ == 0 then error("This module must be invoked from within a template") end if mw.title.getCurrentTitle().fullText ~= frame:getParent():getTitle() then error("This function must be invoked only on the banner page.") end local success, banner_config = pcall(require, "Module:WikiProjectBanner/config/" .. banner_name) if not success then return m_doc._main { content = ('<p class="plainlinks">The banner configuration at [[Module:WikiProjectBanner/config/%s]] does not exist. Please [%s create it].</p>'):format( banner_name, frame:callParserFunction('fullurl', 'Module:WikiProjectBanner/config/' .. banner_name, 'action=edit&editintro=Template:WikiProjectBanner-editintro&preload=Module:WikiProjectBanner/config-preload' ) ) } end local out = { root = mw.html.create('') } out.root:wikitext(":''The following documentation is generated automatically from [[Module:WikiProjectBanner/config/" .. banner_name .. "]].''\n") out.root:wikitext(":''The hooks page for this banner is [[Module:WikiProjectBanner/config/" .. banner_name .. "/hooks]].''\n") local template_data = { params = {}; sets = {}; } template_data.description = { en = "Banner template for " .. (banner_config.project_name or ("WikiProject " .. banner_config.project)) } -- collects categories needed for the template to operate normally local categories = {} -- TODO: assessment scale args for _, tf_info in ipairs(banner_config.task_forces or {}) do -- TODO: generate documentation for task force args end for _, nt_info in ipairs(banner_config.notices or {}) do -- TODO: generate documentation for notice args end for _, cat in ipairs(categories) do -- check if cat exists, show message if not end local m_json = require("Module:microJSON") return m_doc._main { content = tostring(out.root) .. "\n== [[mw:Extension:TemplateData|TemplateData]] documentation ==\n" .. frame:extensionTag("templatedata", m_json.encode_object(template_data, { description = { [true] = true }; params = { [true] = { label = { [true] = true }; description = { [true] = true }; aliases = { [0] = true }; }; }; sets = { [0] = { label = { [true] = true }; params = { [0] = true }; }; }; })) } end return export
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:WikiProjectBanner/autodocs/doc
(
edit
)