Content deleted Content added
No edit summary |
mNo edit summary |
||
Line 2:
local WRAPPER_TEMPLATE = 'Template:Asbox'
local args, msgBox
local
Line 26:
end
function
local wikitext, missingCats, hasDoc = '', 0
stubCats = {}
for k, v in pairs(args) do
if type(k) == 'string' then
table.insert(
end
end
▲ table.sort(stubCatNum)
local key
for k, v in ipairs(
key = {
cat = 'category' .. v,
Line 45 ⟶ 44:
''
or category{args[key.cat]
.. (page and--True if
('|' .. (
args[key.ts]
Line 63 ⟶ 62:
hasDoc = mw.getCurrentFrame():callParserFunction{
name = '#ifexist',
args = {page.
}
wikitext = wikitext .. (hasDoc and '[[Category:Stub message templates with documentation subpages]]' or '')
Line 70 ⟶ 69:
wikitext = wikitext .. category('S', page.text)
end
end
▲ stubCatNum[k] = {args[key.cat], key.cat} -- replace with values to be used in population()
end
if missingCats > 0 then
Line 84 ⟶ 83:
function population()
local wikitext, base = '', '* [[:Category:%s]] (population: (%s)\n'
for k, v in
wikitext = wikitext .. string.format(base, v[1], mw.site.stats.pagesInCategory(v[1], 'all'))
end
Line 102 ⟶ 101:
'Exclude in print'
}
..
.. ((args.icon and
'[[Category:Stub message templates using icon parameter]]')
Line 137 ⟶ 136:
)
)
--
--
.. require('Module:Documentation').main{
content = (
Line 152 ⟶ 151:
or page.text
)
.. '}}</code> produces the message shown at the beginning, and adds the article to the following categor' .. (#
.. population()
.. '<!--\n\n*** Transclusion of /doc if it exists ***\n-->\n'
.. (mw.title.new(page.
frame:expandTemplate{title = page.
or ''
)
Line 162 ⟶ 161:
.. frame:expandTemplate{title = 'Stub documentation'} .. '\n\n'
),
['link box'] = frame:preprocess'This documentation is automatically generated by [[Template:Asbox/templatepage]]. <br/>The general information is transcluded from [[Template:Stub documentation]]. <span style="font-size: smaller; font-style: normal; line-height: 130%;">([{{fullurl:Template:Stub documentation|action=edit}} edit] | [{{fullurl:Template:Stub documentation|action=history}} history])</span>{{#ifeq:{{PROTECTIONLEVEL:edit}}|sysop\n |{{sp}}<br/>This template is
}
end
Line 209 ⟶ 208:
output
:wikitext'[[Category:All stub articles]]'
:wikitext(
elseif args.demo then
--not in original Template:Asbox, but shouldn't hurt
output:wikitext('<small>Demo categories: ' .. string.gsub(
elseif page.
--mw.title.new('') is always nil. This is intentional and matches the results of original {{FULLPAGENAME:{{{name|}}}}}
if mw.title.new(args.name or '') == page then
|