Home
Random
Recent changes
Special pages
Community portal
Preferences
About Stockhub
Disclaimers
Search
User menu
Talk
Contributions
Create account
Log in
Editing
Module:Folger Shakespeare
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
-- This module's function lookup table, used by the calling context local p = {} function p.main(frame) local pframe = frame:getParent() cfg = mw.loadData('Module:Folger Shakespeare/configuration'); 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 url = mw.ustring.format(cfg.url_pattern, play, location) local id = play .. act .. '_' .. scene .. '_' .. display_line local name = 'FOOTNOTE' .. id local play_name = cfg.names[play].title 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
Summary:
Please note that all contributions to Stockhub may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Stockhub:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Tl
(
edit
)
Module:Folger Shakespeare/doc
(
edit
)