Module:Folger Shakespeare
Appearance
![]() | This module depends on the following other modules: |
Implements {{Folger Shakespeare}}
-- This module's function lookup table, used by the calling context
local p = {}
function p.sfd(frame)
local pframe = frame:getParent()
cfg = mw.loadData('Module:Folger Digital/Configuration');
local play = cfg.aliases[pframe.args[1]]
local act = pframe.args[2]
local scene = pframe.args[3]
local line = pframe.args[4]
local location
local ftln = pframe.args['ftln']
if ftln then
location = mw.ustring.format('ftln-%04d', ftln)
else
location = mw.ustring.format('line-%d.%d.%d', act, scene, line)
end
local url = mw.ustring.format(cfg.url_pattern, play, location)
local id = play .. act .. '_' .. scene .. '_' .. line
local name = 'FOOTNOTE' .. id
local play_name = cfg.names[play].title
local location_link = mw.ustring.format(
cfg.location_format, url, act, scene, line
)
local cite = '\'\'' .. play_name .. '\'\', ' .. location_link
local result = frame:extensionTag{
name = 'ref',
args = {name = name},
content = cite,
};
return result;
end
return p