Module:Documentation: Difference between revisions

No edit summary
No edit summary
Line 6: Line 6:
-- default settings, change when necessary
-- default settings, change when necessary
defaultDocPage = 'doc', -- documentation page suffix
defaultDocPage = 'doc', -- documentation page suffix
defaultSandboxPage = 'sandbox', -- sandbox page suffix
defaultTestCasePage = 'testcases', -- testcases page suffix
defaultPreload = 'Template:Documentation/preload', -- page that stores qualified documentation page contents
defaultPreload = 'Template:Documentation/preload', -- page that stores qualified documentation page contents
defaultStyles = 'Module:Documentation/styles.css', -- stylesheet for this module when using TemplateStyles, remove or set to nil if your wiki not use this
defaultStyles = 'Module:Documentation/styles.css', -- stylesheet for this module when using TemplateStyles, remove or set to nil if your wiki not use this
Line 142: Line 144:


local subpage = page.subpageText
local subpage = page.subpageText
if subpage == 'sandbox' or subpage == 'testcases' then
if subpage == i18n.defaultSandboxPage or i18n.defaultTestCasePage then
page = page.basePageTitle
page = page.basePageTitle
end
end
Line 185: Line 187:
local page = mw.title.getCurrentTitle()
local page = mw.title.getCurrentTitle()
local subpage = page.subpageText
local subpage = page.subpageText
if subpage == 'sandbox' or subpage == 'testcases' then
if subpage == i18n.defaultSandboxPage or i18n.defaultTestCasePage then
page = page.basePageTitle
page = page.basePageTitle
end
end