Module:BionicleStoryWebsiteCitation
From BIONICLEsector01
Documentation for this module may be created at Module:BionicleStoryWebsiteCitation/doc
local websiteCitation = require("Module:WebsiteCitation")
local p = {}
-- The title of BIONICLEstory.com as it should appear in the desired citation.
local WEBSITE_TITLE = "[[BIONICLEstory.com]]"
-- Build and return the desired citation.
-- Asserts that mainLinkText is not nil,
-- and that at least one of archiveUrl or brokenUrl is not nil.
function p.getBionicleStoryWebsiteCitation(mainLinkText, archiveUrl, brokenUrl)
assert(mainLinkText ~= nil)
assert(archiveUrl ~= nil or brokenUrl ~= nil)
return websiteCitation.getWebsiteCitation(WEBSITE_TITLE, mainLinkText, nil, archiveUrl, brokenUrl)
end
-- Pull out the relevant args for use.
function p.bionicleStoryWebsiteCitation(frame)
local pageTitle = frame.args["pagetitle"]
local archiveUrl = frame.args["archiveurl"]
if archiveUrl == "" then
archiveUrl = nil
end
local brokenUrl = frame.args["brokenurl"]
if brokenUrl == "" then
brokenUrl = nil
end
assert(pageTitle ~= nil,
[[BionicleStoryWebsiteCitation received no page title;
all BionicleStoryWebsiteCitations must have a title specified
through the `pagetitle` parameter]])
assert(archiveUrl ~= nil or brokenUrl ~= nil,
[[BionicleStoryWebsiteCitation received no page URL;
all BionicleStoryWebsiteCitations must have a URL specified through
the `archiveurl` or `brokenurl` parameters]])
local mainLinkText = "\"" .. pageTitle .. "\""
return p.getBionicleStoryWebsiteCitation(mainLinkText, archiveUrl, brokenUrl)
end
return p