Changes
reorder end box functions
function p._endBox(args, env)
--[=[
-- This function generates the end box (also known as the link box).
-- @args - a table of arguments passed by the user
-- 'fmbox-style' --> 'background-color: #ecfcf4'
-- 'fmbox-textstyle' --> 'font-style: italic'
-- -- The HTML is generated by the {{fmbox}} template, courtesy of [[Module:Message box]]. --]=]
-- Get environment data.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
-- Show the "subpages" linkif we are not in the File namespace. if subjectSpace ~= 6 then -- Don't show the link in file space.
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '')
end
fmargs.text = text
return messageBox.main('fmbox', fmargs)
end
end
return message(messageName, {sandboxLinks, testcasesLinks})
end
function p.makeCategoriesBlurb(args, env)
-- Get the title object.
local docTitle = env.docTitle
if not docTitle then
return nil
end
-- Make the blurb.
local docPathLink = makeWikilink(docTitle.prefixedText, message('doc-link-display'))
return message('add-categories-blurb', {docPathLink})
end
function p.makeSubpagesBlurb(args, env)
-- Get the template title object
local subjectSpace = env.subjectSpace
local templateTitle = env.templateTitle
if not subjectSpace or not templateTitle then
return nil
end
-- Make the subpages blurb.
local pagetype
if subjectSpace == 10 then
pagetype = message('template-pagetype')
elseif subjectSpace == 828 then
pagetype = message('module-pagetype')
else
pagetype = message('default-pagetype')
end
return makeWikilink(
'Special:PrefixIndex/' .. templateTitle.prefixedText .. '/',
message('subpages-link-display', {pagetype})
)
end
function p.makePrintBlurb(args, env)
-- Get the /Print title object
local printTitle = env.printTitle
if not printTitle then
return nil
end
-- Make the print blurb.
local ret
if printTitle.exists then
local printLink = makeWikilink(printTitle.prefixedText, message('print-link-display'))
ret = message('print-blurb', {printLink})
local displayPrintCategory = message('display-print-category', nil, 'boolean')
if displayPrintCategory then
ret = ret .. makeCategoryLink(message('print-category'))
end
end
return ret
end