Module:Documentation: Difference between revisions

Jump to navigation Jump to search
m>Mr. Stradivarius
don't check that we are not in the file namespace before adding the subpage blurb, as we already know we're either in the user, template or module namespace
m>Mr. Stradivarius
tweak comments
Line 662: Line 662:
local text = ''
local text = ''
if linkBox then
if linkBox then
-- Use custom link box content if it is defined.
text = text .. linkBox
text = text .. linkBox
else
else
text = text .. (p.makeDocPageBlurb(args, env) or '')
text = text .. (p.makeDocPageBlurb(args, env) or '') -- "This documentation is transcluded from [[Foo]]."
-- Add links to /sandbox and /testcases when appropriate.
if subjectSpace == 2 or subjectSpace == 10 or subjectSpace == 828 then
if subjectSpace == 2 or subjectSpace == 828 or subjectSpace == 10 then
-- We are in the user, template or module namespaces.
-- We are in the user, module or template namespaces.  
-- Add sandbox and testcases links.
-- "Editors can experiment in this template's sandbox and testcases pages."
text = text .. p.makeExperimentBlurb(args, env)
text = text .. p.makeExperimentBlurb(args, env)
text = text .. '<br />'
text = text .. '<br />'
if not args.content and not args[1] then
if not args.content and not args[1] then
-- Show the categories text, but not if we have the content on the template page itself,
-- "Please add categories to the /doc subpage."
-- or if the documentation page has been specified explicitly, since then it is unclear
-- Don't show this message with inline docs or with an explicitly specified doc page,
-- where to add the categories.
-- as then it is unclear where to add the categories.
text = text .. (p.makeCategoriesBlurb(args, env) or '')
text = text .. (p.makeCategoriesBlurb(args, env) or '')
end
end
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '')
text = text .. ' ' .. (p.makeSubpagesBlurb(args, env) or '') --"Subpages of this template"
local printBlurb = p.makePrintBlurb(args, env)
local printBlurb = p.makePrintBlurb(args, env) -- Two-line blurb about print versions of templates.
if printBlurb then
if printBlurb then
text = text .. '<br />' .. printBlurb
text = text .. '<br />' .. printBlurb