![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/43/Test_Template_Info-Icon_-_Version_%282%29.svg/50px-Test_Template_Info-Icon_-_Version_%282%29.svg.png)
Implements {{Folger Shakespeare}}
-- Modules we needlocal getArgs = require('Module:Arguments').getArgslocal warn = require('Module:Warning')-- Configurationlocal cfg = mw.loadData('Module:Folger Shakespeare/config');local _plays = mw.loadData('Module:Folger Shakespeare/plays');-- Turn plays table inside out so we can look up by alias toolocal plays = {}for _, play in pairs(_plays) dofor _, key in pairs(play.keys) doplays[key] = {["title"] = play.title,["folgerid"] = play.folgerid,["wikilink"] = play.wikilink}endend-- This module's function lookup table, used by the calling contextlocal p = {}function p.sfd(args)local play = plays[args[1]]local act = tonumber(args[2])local scene = tonumber(args[3])local line = args[4]-- Check the play argumentif play == nil or play == "" thenwarn("No play argument provided, or the play provided was not recognised.")returnend-- Check the act argumentif act == nil or act == "" thenwarn("No act argument provided, or the act given was not numerical.")returnend-- Check the scene argumentif scene == nil or scene == "" thenwarn("No scene argument provided, or the scene given was not numerical.")returnend-- Check the line argumentif line == nil or line == "" thenwarn("No line argument provided.")returnendlocal display_line = lineif mw.ustring.match(line, '^%s*%d+[-–]%d+%s*$') thenline = mw.ustring.match(line, '^%s*(%d+)[-–]%d+%s*$')elseif mw.ustring.match(line, '^%s*%d+%s*$') thenline = mw.ustring.match(line, '^%s*(%d+)%s*$')elsewarn(("Could not coerce %s into a valid line specification."):format(line))returnendlocal location = mw.ustring.format('line-%d.%d.%d', act, scene, line)local url = mw.ustring.format(cfg.url_pattern, play.folgerid, act, scene, location)local id = play.title .. act .. '_' .. scene .. '_' .. display_linelocal name = 'FOOTNOTE' .. idlocal location_link = mw.ustring.format(cfg.location_format, url, act, scene, display_line)local cite = mw.ustring.format("''%s'', %s", play.title, location_link)local result = mw.getCurrentFrame():extensionTag{name = 'ref',args = {name = name},content = cite,}return resultendfunction p.main(frame)local args = getArgs(frame)return p.sfd(args)endreturn p
🔥 Top keywords: Main PageSpecial:SearchPage 3Wikipedia:Featured picturesHouse of the DragonUEFA Euro 2024Bryson DeChambeauJuneteenthInside Out 2Eid al-AdhaCleopatraDeaths in 2024Merrily We Roll Along (musical)Jonathan GroffJude Bellingham.xxx77th Tony AwardsBridgertonGary PlauchéKylian MbappéDaniel RadcliffeUEFA European Championship2024 ICC Men's T20 World CupUnit 731The Boys (TV series)Rory McIlroyN'Golo KantéUEFA Euro 2020YouTubeRomelu LukakuOpinion polling for the 2024 United Kingdom general electionThe Boys season 4Romania national football teamNicola CoughlanStereophonic (play)Gene WilderErin DarkeAntoine GriezmannProject 2025