Changes
finish moving end box code into sub-functions
function p._endBox(args, env)
local subjectSpace = env.subjectSpace
end
return nil
end
text = text .. p.makeEndBoxExperimentBlurb(args, env)
text = text .. '<br />'
-- Show the categories text, but not if "content" fed or "docname fed" -- since then it is unclear where to add the categories.
if not content and not docnameFed then
end
-- Show the "subpages" link.
if subjectSpace ~= 6 then -- Don't show the link in file space.
end
-- Show the "print" link if it exists.
local printPage printBlurb = templatePage .. '/' .p. messagemakePrintBlurb('printSubpage'args, 'string') local printTitle = mw.title.new(printPageenv) if printTitle.exists printBlurb then local printLink = makeWikilink(printPage, message('printLinkDisplay', 'string')) text = text .. '<br />' .. message('printBlurb', 'string', {printLink}) .. (message('displayPrintCategory', 'boolean') and makeCategoryLink(message('printCategory', 'string')) or '')
end
end
-- Return the fmbox output.
return messageBox.main('fmbox', fmargs)
end
function p.makePrintBlurb(args, env)
-- Get the /Print title object
local success, printTitle = env:grab('printTitle')
if not success then
return printTitle -- Error message
end
-- Make the print blurb.
local ret
if printTitle.exists then
local printLink = makeWikilink(printTitle.prefixedText, message('printLinkDisplay', 'string'))
ret = message('printBlurb', 'string', {printLink})
local displayPrintCategory = message('displayPrintCategory', 'boolean')
if displayPrintCategory then
ret = ret .. makeCategoryLink(message('printCategory', 'string'))
end
end
return ret
end
function p.makeSubpagesBlurb(args, env)
-- Get the template title object
local success, templateTitle = env:grab('templateTitle')
if not success then
return templateTitle -- Error message.
end
-- Make the subpages blurb.
local pagetype
if subjectSpace == 10 then
pagetype = message('templatePagetype', 'string')
elseif subjectSpace == 828 then
pagetype = message('modulePagetype', 'string')
else
pagetype = message('defaultPagetype', 'string')
end
return makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpagesLinkDisplay', 'string', {pagetype})
)
end