Content deleted Content added
return level |
no cat class |
||
(11 intermediate revisions by 3 users not shown) | |||
Line 15:
end
local data_page = 'Wikipedia:Vital articles/data/' .. subpage .. '.json'
local page2 = tostring(tonumber(page))==page and tonumber(page) or page --convert to number if page is numerical, otherwise loadJsonData does not work
local data = mw.loadJsonData(data_page)[
if data then
local level = tostring(data.level)
if level then
if trimmed_link then▼
▲ link = 'Wikipedia:Vital articles' .. trimmed_link
link =
▲ if (level=='4' or level=='5') and data.topic then
▲ link = link .. '/' .. data.topic
▲ end
▲ if data.sublist then
▲ end
▲ -- link = link .. '#' .. data.section
end
return link, level
Line 48 ⟶ 43:
p.isVital = function(frame)
local page = frame.args.page~='' and frame.args.page or mw.title.getCurrentTitle().subjectPageTitle.text
return level or ''
end
Line 99 ⟶ 95:
topic = cat:match('^Wikipedia vital articles in ([%a ]+)$')
if topic then -- Category:Wikipedia vital articles in TOPIC
return top(
.. '[[Category:Wikipedia vital articles by topic|' .. (topic=='an unknown topic' and 'Unknown' or topic) .. ']]'
end
Line 117 ⟶ 113:
class = class:match('(%a+)-Class') or class
return top(true, frame)
end
level, topic = cat:match('^Wikipedia level%-(%w+) vital articles in ([%a ]+)$')
|