词条 | Module:Infobox road/meta/mask/subtype1 |
释义 | local p = {} local subtypes = {["alt"] = "Alt", ["alternate"] = "Alt", ["bus"] = "Bus", ["business"] = "Bus", ["byp"] = "Byp", ["bypass"] = "Byp", ["by-pass"] = "Byp", ["conn"] = "Conn", ["connector"] = "Conn", ["emerg"] = "Emerg", ["emergency"] = "Emerg", ["loop"] = "Loop", ["old"] = "Old", ["opt"] = "Opt", ["optional"] = "Opt", ["scenic"] = "Scenic", ["spur"] = "Spur", ["temp"] = "Temp", ["temporary"] = "Temp", ["toll"] = "Toll", ["truck"] = "Truck", ["trk"] = "Truck"} function p._subtype(subtype, hyphenate) local subtypeLowercase = string.lower(subtype) local hyphen = hyphenate and '-' or '' return hyphen .. (subtypes[subtypeLowercase] or '') end function p.subtype(frame) local pframe = frame:getParent() local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself local args = pframe.args -- the arguments passed TO the template, in the wikitext that transcludes the template local subtype = args[1] if not(subtype) then return '' end local hyphenate = args[2] == 'yes' end return p |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。