Module:Documentation: Difference between revisions

Jump to navigation Jump to search
remove unneeded return variables (if this breaks anything feel free to revert without discussing with me first)
m (1 revision imported)
death date and age/infobox music genre>DannyS712
(remove unneeded return variables (if this breaks anything feel free to revert without discussing with me first))
Line 363: Line 363:
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-notice-testcases-link-display' --> 'test cases'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'sandbox-category' --> 'Template sandboxes'
-- 'module-sandbox-category' --> 'Module sandboxes'
-- 'other-sandbox-category' --> 'Sandboxes outside of template or module namespace'
--]=]
--]=]
local title = env.title
local title = env.title
Line 378: Line 380:
-- "This is the template sandbox for [[Template:Foo]] (diff)."
-- "This is the template sandbox for [[Template:Foo]] (diff)."
local text = ''
local text = ''
local pagetype
local pagetype, sandboxCat
if subjectSpace == 10 then
if subjectSpace == 10 then
pagetype = message('sandbox-notice-pagetype-template')
pagetype = message('sandbox-notice-pagetype-template')
sandboxCat = message('sandbox-category')
elseif subjectSpace == 828 then
elseif subjectSpace == 828 then
pagetype = message('sandbox-notice-pagetype-module')
pagetype = message('sandbox-notice-pagetype-module')
sandboxCat = message('module-sandbox-category')
else
else
pagetype = message('sandbox-notice-pagetype-other')
pagetype = message('sandbox-notice-pagetype-other')
sandboxCat = message('other-sandbox-category')
end
end
local templateLink = makeWikilink(templateTitle.prefixedText)
local templateLink = makeWikilink(templateTitle.prefixedText)
Line 411: Line 416:
end
end
end
end
-- Add the sandbox to the sandbox category.
-- Add the sandbox to the sandbox category.
omargs.text = text .. makeCategoryLink(message('sandbox-category'))
omargs.text = text .. makeCategoryLink(sandboxCat)


-- 'documentation-clear'
-- 'documentation-clear'
Line 760: Line 766:
return nil
return nil
end
end
local ret
if docTitle.exists then
if docTitle.exists then
-- /doc exists; link to it.
-- /doc exists; link to it.
Line 768: Line 773:
local historyDisplay = message('history-link-display')
local historyDisplay = message('history-link-display')
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
local historyLink = makeWikilink("Special:PageHistory/" .. docTitle.prefixedText, historyDisplay)
ret = message('transcluded-from-blurb', {docLink})
return message('transcluded-from-blurb', {docLink})
.. ' '
.. ' '
.. makeToolbar(editLink, historyLink)
.. makeToolbar(editLink, historyLink)
Line 777: Line 782:
local createDisplay = message('create-link-display')
local createDisplay = message('create-link-display')
local createLink = makeUrlLink(createUrl, createDisplay)
local createLink = makeUrlLink(createUrl, createDisplay)
ret = message('create-module-doc-blurb', {createLink})
return message('create-module-doc-blurb', {createLink})
.. '<br />'
.. '<br />'
end
end
return ret
end
end


Line 963: Line 967:
end
end
local subpage = title.subpageText
local subpage = title.subpageText
local ret = ''
if message('display-strange-usage-category', nil, 'boolean')
if message('display-strange-usage-category', nil, 'boolean')
and (
and (
Line 970: Line 973:
)
)
then
then
ret = ret .. makeCategoryLink(message('strange-usage-category'))
return makeCategoryLink(message('strange-usage-category'))
end
end
return ret
return ''
end
end


return p
return p

Navigation menu