Dungeons & Dragons Lore Wiki

Welcome to the Dungeons & Dragons Lore Wiki, an encyclopedia of official first-party D&D canon from 1974 to the current day.

We need editors! See the editing guidelines for ways to contribute.

READ MORE

Dungeons & Dragons Lore Wiki
No edit summary
No edit summary
Tag: Source edit
 
Line 1: Line 1:
 
local p = {}
 
local p = {}
  +
local dungeonData = mw.loadData( 'Module:Dungeon/data' )
   
 
function p.Dungeon( frame )
 
function p.Dungeon( frame )
Line 14: Line 15:
 
end
 
end
   
return ( article .. "[[Dungeon Magazine]] #" .. dungeonIssue .. page)
+
return ( article .. (dungeonData[dungeonIssue] or "'''Error: No such issue'''") .. page)
 
end
 
end
   

Latest revision as of 21:16, 20 September 2020

Documentation for this module may be created at Module:Dungeon/doc

local p = {}
local dungeonData = mw.loadData( 'Module:Dungeon/data' )

function p.Dungeon( frame )
  local dungeonIssue = frame.args.issue or "1"
  local page = frame.args.page or ""
  local article = frame.args.article or ""

  if not (page == "") then
    page = ", p." .. frame.args.page
  end

  if not (article == "") then
    article = "''" .. frame.args.article .. "'', "
  end

  return ( article .. (dungeonData[dungeonIssue] or "'''Error: No such issue'''") .. page)
end

function p.FirstPage ( frame )
  local pages = frame.args[1] or ""

  if not (pages == "") then
    pages = "-" .. string.gsub (frame.args[1], "%-.*", "")
  end

  return pages
end

return p