词条 | Module:Folger Digital |
释义 | -- This module's function lookup table, used by the calling context local p = {} function p.sfd(frame) local play = cfg.aliases[pframe.args[1]] or '' local act = pframe.args[2] or '' local scene = pframe.args[3] or '' local line = '' local line_given = false local ftln_given = false if pframe.args['ftln'] then line = pframe.args['ftln'] ftln_given = true elseif pframe.args[4] then line = pframe.args[4] line_given = true else -- Both line_given and ftln_given will be false. end local display_line = line if mw.ustring.match(line, '^%s*%d+[-–]%d+%s*$') then line = mw.ustring.match(line, '^%s*(%d+)[-–]%d+%s*$') elseif mw.ustring.match(line, '^%s*%d+%s*$') then line = mw.ustring.match(line, '^%s*(%d+)%s*$') else -- Gotta figure out how to signal an error to the user. end local location if ftln_given then location = mw.ustring.format('ftln-%04d', line) elseif line_given then location = mw.ustring.format('line-%d.%d.%d', act, scene, line) else location = mw.ustring.format('line-%d.%d.%d', act, scene, 0) end local id = play .. act .. '_' .. scene .. '_' .. display_line local name = 'FOOTNOTE' .. id local location_link = '' if ftln_given then location_link = mw.ustring.format(cfg.ftln_format, url, display_line) else location_link = mw.ustring.format(cfg.location_format, url, act, scene, display_line) end local cite = '\\'\\'' .. play_name .. '\\'\\', ' .. location_link local result = frame:extensionTag{ name = 'ref', args = {name = name}, content = cite, }; return result; end return p |
随便看 |
|
开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。