Editing Module:Variants
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 20: | Line 20: | ||
'?Profession Level B High', |
'?Profession Level B High', |
||
'?Variant name', |
'?Variant name', |
||
'?Version anchor', |
|||
'?-Has subobject #', |
|||
'?#-', |
|||
get_images and '?Image#64px;x64px = Image' or nil, |
get_images and '?Image#64px;x64px = Image' or nil, |
||
limit = args.limit or 500, |
limit = args.limit or 500, |
||
Line 38: | Line 35: | ||
local contents |
local contents |
||
if smw_data then |
if smw_data then |
||
local formatted |
local formatted = {} |
||
for _, entry in ipairs(smw_data) do |
for _, entry in ipairs(smw_data) do |
||
local variant_name = entry['Variant name'] |
local variant_name = entry['Variant name'] |
||
if variant_name then |
if variant_name then |
||
local page = |
local page = entry[1] |
||
local pipe = page:find('|') |
|||
if pipe then |
|||
page = page:sub(3, pipe-1) |
|||
⚫ | |||
page = page:sub(3, -3) |
|||
end |
|||
if page:sub(1, 1 + #variant_name + #' (grade ') == ':' .. variant_name .. ' (grade ' and page:sub(-1) == ')' then |
if page:sub(1, 1 + #variant_name + #' (grade ') == ':' .. variant_name .. ' (grade ' and page:sub(-1) == ')' then |
||
local grade_number = page:sub(2 + #variant_name + #' (grade ', -2) |
local grade_number = page:sub(2 + #variant_name + #' (grade ', -2) |
||
Line 49: | Line 53: | ||
end |
end |
||
⚫ | |||
if not pageList[page] then |
|||
⚫ | |||
pageList[page] = true |
|||
⚫ | |||
else |
else |
||
table.insert(formatted, |
table.insert(formatted, entry[1]) |
||
end |
end |
||
end |
end |
||
contents = table.concat(formatted, ' |
contents = table.concat(formatted, ' • ') |
||
else |
else |
||
contents = '[[Category:Empty variant list]]' |
contents = '[[Category:Empty variant list]]' |
||
Line 125: | Line 126: | ||
:tag('td') |
:tag('td') |
||
:css{ ['border-left'] = 'none' } |
:css{ ['border-left'] = 'none' } |
||
:wikitext |
:wikitext(entry[1]) |
||
:done() |
:done() |
||
:tag('td') |
:tag('td') |