Module:Documentation: Difference between revisions

mNo edit summary
No edit summary
Line 34: Line 34:
pageNoDocCategory = '%ss with no documentation',
pageNoDocCategory = '%ss with no documentation',
pageNoDocCategoryDefault = 'Pages with no documentation',
pageNoDocCategoryDefault = 'Pages with no documentation',
pageBadDocPrompt = "'''This %s's documentation needs improving or additional information.'''\n",
pageBadDocCategory = '%ss with bad documentation',
pageBadDocCategoryDefault = 'Pages with bad documentation',
pageDocHeaderTitle = 'Documentation',
pageDocJumpToCode = 'Jump to code ↴',
pageDocHeaderBottom = 'The above documentation is transcluded from %s.',
}
}


Line 188: Line 194:
if not ( args.nocat or namespace == 'User' ) then
if not ( args.nocat or namespace == 'User' ) then
category = i18n.pageNoDocCategory:format( pageType )
category = i18n.pageNoDocCategory:format( pageType )
if not mw.title.new( 'Category:' .. category ).exists then
if not mw.title.new( i18n.commonCategory:format( category ) ).exists then
category = i18n.pageNoDocCategoryDefault
category = i18n.pageNoDocCategoryDefault
end
end
Line 194: Line 200:
elseif badDoc then
elseif badDoc then
docClass = 'documentation-badDoc'
docClass = 'documentation-badDoc'
message = "'''This " .. pageType .. "'s documentation needs improving or additional information.'''\n"
message = i18n.pageBadDocPrompt:format( pageType )
if not ( args.nocat or namespace == 'User' ) then
if not ( args.nocat or namespace == 'User' ) then
category = pageType .. 's with bad documentation'
category = i18n.pageBadDocCategory:format( pageType )
if not mw.title.new( 'Category:' .. category ).exists then
if not mw.title.new( i18n.commonCategory:format( category ) ).exists then
category = 'Pages with bad documentation'
category = i18n.pageBadDocCategoryDefault
end
end
end
end
Line 229: Line 235:
:tag( 'span' )
:tag( 'span' )
:addClass('documentation-header-title' )
:addClass('documentation-header-title' )
:wikitext( 'Documentation' )
:wikitext( i18n.pageDocHeaderTitle )


local codePages = {
local codePages = {
Line 240: Line 246:
:tag( 'span' )
:tag( 'span' )
:attr( 'id', 'documentation-jump-to-code' )
:attr( 'id', 'documentation-jump-to-code' )
:wikitext( '[[#the-code|Jump to code ↴]]' )
:wikitext( i18n.commonInternalLinkPipe:format( '#the-code', i18n.pageDocJumpToCode ) )
end
end


Line 253: Line 259:
:addClass( 'documentation-header-bottom' )
:addClass( 'documentation-header-bottom' )
:node( links )
:node( links )
:wikitext( 'The above documentation is transcluded from [[', docPage.fullText, ']].' )
:wikitext( i18n.pageDocHeaderBottom:format( i18n.commonInternalLink:format( docPage.fullText ) ) )
end
end