Module:Param Parse: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
(Fix smw when variant has a different name than the page (e.g., for disambiguating parentheses)) |
(Allow overriding the variant name seperation logic) |
||
Line 478: | Line 478: | ||
return tostring(result) |
return tostring(result) |
||
end |
end |
||
function parse.name_with_variant_category_func(name, v, passive) |
function parse.name_with_variant_category_func(name, v, passive, name_override) |
||
return name_with_variant_category(name, v, passive, false) |
return name_override or name_with_variant_category(name, v, passive, false) |
||
end |
end |
||
function parse.name_with_variant_category_smw_func(name, v, passive) |
function parse.name_with_variant_category_smw_func(name, v, passive, name_override) |
||
return name_with_variant_category(name, v, passive, true) |
return name_override or name_with_variant_category(name, v, passive, true) |
||
end |
end |
||
function parse.name_without_variant_category_func(name, v) |
function parse.name_without_variant_category_func(name, v) |
||
Line 502: | Line 502: | ||
parse.name_with_variant_category = { |
parse.name_with_variant_category = { |
||
name = 'name', |
name = 'name', |
||
func = {name=parse.name_with_variant_category_func, params = {Infobox.raw_param('name'), Infobox.raw_param('variant'), Infobox.raw_param('passive')}}, |
func = {name=parse.name_with_variant_category_func, params = {Infobox.raw_param('name'), Infobox.raw_param('variant'), Infobox.raw_param('passive'), Infobox.raw_param('name_override')}}, |
||
smw_func = {name=parse.name_with_variant_category_smw_func, params = {Infobox.raw_param('name'), Infobox.raw_param('variant'), Infobox.raw_param('passive')}}, |
smw_func = {name=parse.name_with_variant_category_smw_func, params = {Infobox.raw_param('name'), Infobox.raw_param('variant'), Infobox.raw_param('passive'), Infobox.raw_param('name_override')}}, |
||
smw_property = 'Name', |
smw_property = 'Name', |
||
category_incomplete = 'Needs name' |
category_incomplete = 'Needs name' |