нема опису редагування
starcitizen>Alistair3149 (Use table instead of string concat for ret3) |
starcitizen>Alistair3149 Немає опису редагування |
||
| Рядок 11: | Рядок 11: | ||
local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' ) | local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' ) | ||
local ret, cats, ret1, ret2, ret3 | local ret, cats, ret1, ret2, ret3 | ||
local | local pageType = title.namespace == 828 and 'module' or 'template' | ||
local opts = frame.args; | local opts = frame.args; | ||
| Рядок 21: | Рядок 21: | ||
string.format( | string.format( | ||
'It contains usage information, categories, and other content that is not part of the [[' .. page .. '|original %s page]].', | 'It contains usage information, categories, and other content that is not part of the [[' .. page .. '|original %s page]].', | ||
pageType | |||
), | ), | ||
{ icon = 'WikimediaUI-Notice.svg' } | { icon = 'WikimediaUI-Notice.svg' } | ||
| Рядок 50: | Рядок 50: | ||
:tag( 'span' ) | :tag( 'span' ) | ||
:addClass( 'documentation-title' ) | :addClass( 'documentation-title' ) | ||
:wikitext( string.format('%s documentation', | :wikitext( string.format('%s documentation', pageType) ) | ||
:done() | :done() | ||
:tag( 'span' ) | :tag( 'span' ) | ||
| Рядок 74: | Рядок 74: | ||
table.insert( ret3, dependencyList._main( nil, args.category, args.isUsed ) ) | table.insert( ret3, dependencyList._main( nil, args.category, args.isUsed ) ) | ||
if args.scwShared then | |||
table.insert( ret3, | |||
mbox( | |||
string.format( | |||
'This %s is shared across the Star Citizen Wikis.', | |||
pageType, | |||
page, | |||
page | |||
), | |||
string.format( | |||
'This %s is shared across the Star Citizen Wikis. Any changes should also be relayed to the [%s GitHub repository].', | |||
pageType, | |||
'https://github.com/The-Star-Citizen-Wikis/SharedModules' | |||
), | |||
{ icon = 'WikimediaUI-Notice.svg' } | |||
) | |||
) | |||
end | |||
if args.fromWikipedia then | if args.fromWikipedia then | ||
table.insert( ret3, | table.insert( ret3, | ||
| Рядок 79: | Рядок 98: | ||
string.format( | string.format( | ||
'This %s is imported from [https://en.wikipedia.org/wiki/%s %s] on Wikipedia.', | 'This %s is imported from [https://en.wikipedia.org/wiki/%s %s] on Wikipedia.', | ||
pageType, | |||
page, | page, | ||
page | page | ||
), | ), | ||
'This | string.format( | ||
'This %s is imported from the English Wikipedia. Although the visual appearance might be different, the functionality is identical. Please refer to the Wikipedia page for detailed documentation.', | |||
pageType | |||
), | |||
{ icon = 'WikimediaUI-Logo-Wikipedia.svg' } | { icon = 'WikimediaUI-Logo-Wikipedia.svg' } | ||
) | ) | ||