Module:WikiProject banner/templatepage and Module:WikiProject banner/templatepage/sandbox: Difference between pages
Appearance
(Difference between pages)
Content deleted Content added
Rvt edits that caused Wikipedia:Village pump (technical)#Template-generated redlinked categories |
sync |
||
Line 13: | Line 13: | ||
-- Initialise variables --- |
-- Initialise variables --- |
||
--------------------------- |
--------------------------- |
||
local sandbox |
local sandbox = '/sandbox' |
||
local cfg = mw.loadData('Module:WikiProject banner/config' .. (sandbox or '')) |
local cfg = mw.loadData('Module:WikiProject banner/config' .. (sandbox or '')) |
||
local cfg_tp = cfg.template_page -- convenient shortcut for template_page configuration settings |
local cfg_tp = cfg.template_page -- convenient shortcut for template_page configuration settings |
||
Line 364: | Line 364: | ||
local category = mw.title.new('Category:' .. (cat_name or '')) |
local category = mw.title.new('Category:' .. (cat_name or '')) |
||
if category and not category.exists then |
if category and not category.exists then |
||
local pages_in_category = mw.site.stats.pagesInCategory(cat_name, 'pages') |
local pages_in_category = mw.site.stats.pagesInCategory(cat_name, 'pages') |
||
if pages_in_category>0 then |
if pages_in_category>0 then |
||
red_other_cats_in_use = true |
red_other_cats_in_use = true |
||
Line 425: | Line 425: | ||
if (args.PROJECT_NAME=='WikiProject '..project or not args.PROJECT_NAME) and current_page.rootPageTitle.prefixedText~='Template:WikiProject ' .. project then |
if (args.PROJECT_NAME=='WikiProject '..project or not args.PROJECT_NAME) and current_page.rootPageTitle.prefixedText~='Template:WikiProject ' .. project then |
||
add_tracking(cfg_tp.template_categories.non_standard) |
add_tracking(cfg_tp.template_categories.non_standard) |
||
⚫ | |||
local template_category = mw.title.new('Category:' .. project_name .. ' templates') |
|||
if template_category.exists then |
|||
table.insert(tracking_cats, wikilink(template_category.fullText, '*')) |
|||
⚫ | |||
table.insert(tracking_cats, wikilink('Category:' .. project_name)) |
|||
end |
end |
||
end |
end |
||
Line 550: | Line 556: | ||
table.insert(_table, tostring(mw.html.create(hl):wikitext(title)) .. '\n') |
table.insert(_table, tostring(mw.html.create(hl):wikitext(title)) .. '\n') |
||
end |
end |
||
--if raw_args.importance then |
|||
-- show_param('importance', true) |
|||
⚫ | |||
-- show_param('priority', true) |
|||
⚫ | |||
local showSection = function(list, title) |
local showSection = function(list, title) |
||
if param[list] then |
if param[list] then |
||
Line 842: | Line 843: | ||
addTitle('Basic usage', 3) |
addTitle('Basic usage', 3) |
||
table.insert(auto_doc, 'Place this on the talk page of relevant articles:' |
table.insert(auto_doc, 'Place this on the talk page of relevant articles:' |
||
.. frame:extensionTag{ |
|||
.. '<br><code>{{' .. banner_name.text .. ' ' |
|||
name = 'syntaxhighlight', |
|||
.. table.concat(basic) |
|||
content = '{{' .. banner_name.text .. ' ' .. table.concat(basic) .. '}}', |
|||
.. '}}</code>') |
|||
args = {lang = 'wikitext'} |
|||
} |
|||
) |
|||
addTitle('Full usage', 3) |
addTitle('Full usage', 3) |
||
table.insert(auto_doc, 'It is usual to remove any unused parameters from the template call.' |
table.insert(auto_doc, 'It is usual to remove any unused parameters from the template call.' |
||
.. frame:extensionTag{ |
|||
.. '<br><code>{{' .. banner_name.text .. ' ' |
|||
name = 'syntaxhighlight', |
|||
.. table.concat(full) |
|||
content = '{{' .. banner_name.text .. ' ' .. table.concat(full) .. '}}', |
|||
.. '}}</code>') |
|||
args = {lang = 'wikitext'} |
|||
} |
|||
) |
|||
addTitle('Parameters') |
addTitle('Parameters') |
||
showSection('general') |
showSection('general') |