Module:Documentation: Difference between revisions

mNo edit summary
mNo edit summary
Line 50: Line 50:


-- strings used in p.docPage(): contents shown in documentation page
-- strings used in p.docPage(): contents shown in documentation page
docPagePrompt = 'This is the documentation page. It %s be transcluded into the main %s page. See [[Template:Documentation]] for more information.', -- message shown as documentation header in documentation pages. Params: word used when page is a module or not; code page's type
docPagePrompt = 'This is the documentation page. It %s be transcluded into %s. See [[Template:Documentation]] for more information.', -- message shown as documentation header in documentation pages. Params: word used when page is a module or not; code page's type
docPagePromptWill = 'will', -- word used when code page is a module page
docPagePromptWill = 'will', -- word used when code page is a module page
docPagePromptShould = 'should', -- word used when code is not a module page
docPagePromptShould = 'should', -- word used when code is not a module page
Line 154: Line 154:
:wikitext( i18n.linkBar:format( i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonSpecialPageSub:format( i18n.specialPurge, page.fullText ), i18n.linkTextPurge ) ) ) )
:wikitext( i18n.linkBar:format( i18n.linkFormat:format( i18n.commonInternalLinkPipe:format( i18n.commonSpecialPageSub:format( i18n.specialPurge, page.fullText ), i18n.linkTextPurge ) ) ) )
:done()
:done()
:wikitext( i18n.docPagePrompt:format( pageType == 'module' and i18n.docPagePromptWill or i18n.docPagePromptShould, pageTypeDisplay ) )
:wikitext( i18n.docPagePrompt:format( pageType == 'module' and i18n.docPagePromptWill or i18n.docPagePromptShould, i18n.commonInternalLink:format( namespace .. ':' .. page.baseText ) ) )
if badDoc then
if badDoc then
body:wikitext( i18n.docPageBadDocPrompt:format( pageTypeDisplay ) )
body:wikitext( i18n.docPageBadDocPrompt:format( pageTypeDisplay ) )
Line 235: Line 235:
end
end


-- Generates the [view][edit][history][refresh] or [create][refresh] links
-- Generates the link bar
local links = mw.html.create( 'span' )
local links = mw.html.create( 'span' )
:attr( 'id', 'documentation-header-tools' )
:attr( 'id', 'documentation-header-tools' )