Module:Documentation: Difference between revisions

Jump to navigation Jump to search
m>Mr. Stradivarius
try and keep the line length down a bit
m>Mr. Stradivarius
more efficient code for the subpages link
Line 326: Line 326:
end
end
-- Show the "subpages" link.
-- Show the "subpages" link.
if subjectSpace == 828 then -- Module space.
if subjectSpace ~= 6 then -- Don't show the link in file space.
text = text .. ' ' .. makeWikilink('Special:PrefixIndex/' .. templatePage .. '/', 'Subpages of this module')
local pagetype
elseif subjectSpace == 10 then -- Template space.
if subjectSpace == 10 then
text = text .. ' ' .. makeWikilink('Special:PrefixIndex/' .. templatePage .. '/', 'Subpages of this template')
pagetype = 'template'
elseif subjectSpace ~= 6 then -- Don't show the link in file space.
elseif subjectSpace == 828 then
text = text .. ' ' .. makeWikilink('Special:PrefixIndex/' .. templatePage .. '/', 'Subpages of this page')
pagetype = 'module'
else
pagetype = 'page'
end
text = text .. ' ' .. makeWikilink('Special:PrefixIndex/' .. templatePage .. '/', 'Subpages of this ' .. pagetype)
end
end
-- Show the "print" link if it exists.
-- Show the "print" link if it exists.