Module:Infobox AFDO: Difference between revisions
ArrowHead294 (talk | contribs) m Alphabetise dependencies |
ArrowHead294 (talk | contribs) mNo edit summary |
||
| Line 5: | Line 5: | ||
function p.infobox_AFDO(frame) | function p.infobox_AFDO(frame) | ||
local args = getArgs(frame) | |||
-- debug mode will disable the categories | -- debug mode will disable the categories | ||
local debug_mode = yesno(frame.args["debug"]) | local debug_mode = yesno(frame.args["debug"] or args["debug"], false) | ||
local wtext = yesno(frame.args["wtext"] or args["wtext"]) | |||
local categories = "" | local categories = "" | ||
| Line 32: | Line 35: | ||
}) | }) | ||
if(dualfifth) then | if (dualfifth) then | ||
table.insert(infobox_data, { | table.insert(infobox_data, { | ||
"Dual sharp fifth", | "Dual sharp fifth", | ||
| Line 54: | Line 57: | ||
local result = infobox.build( | local result = infobox.build( | ||
"[[ | string.format("[[%safdo]]", steps), | ||
infobox_data, | infobox_data, | ||
"[[ | string.format("[[%safdo|← %safdo]]", steps - 1, steps - 1), | ||
"[[ | string.format("[[%safdo|%safdo →]]", steps + 1, steps + 1) | ||
) | ) | ||
if not debug_mode then | if not debug_mode then | ||
result = result .. categories | result = result .. categories | ||
end | |||
if wtext then | |||
result = "<syntaxhighlight lang=\"wikitext\">" .. result .. "</syntaxhighlight>" | |||
end | end | ||