Sync with RS wiki
starcitizen>Alistair3149 (Hatnote styles are now loaded from dependencylist) |
starcitizen>Alistair3149 (Sync with RS wiki) |
||
| Рядок 9: | Рядок 9: | ||
local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' ) | local page = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' ) | ||
local addDependencyList = yn( args.DependencyList or true ) | local addDependencyList = yn( args.DependencyList or true ) | ||
local addModuleToc = yn( args.ModuleToc or true ) | |||
local isDataModule = yn( args.isData or false ) | |||
local ret, cats, ret1, ret2, ret3 | local ret, cats, ret1, ret2, ret3 | ||
local onModule = title.namespace == 828 | local onModule = title.namespace == 828 | ||
local opts = frame.args; | |||
local preamble = opts.preamble; | |||
-- subpage header | -- subpage header | ||
| Рядок 17: | Рядок 22: | ||
:tag( 'div' ) | :tag( 'div' ) | ||
:addClass( 'mbox mbox-low mbox-documentationsub' ) | :addClass( 'mbox mbox-low mbox-documentationsub' ) | ||
:attr( 'role', 'presentation') | :attr( 'role', 'presentation' ) | ||
:tag( 'span' ) | :tag( 'span' ) | ||
:addClass( 'mbox-title' ) | :addClass( 'mbox-title' ) | ||
| Рядок 45: | Рядок 50: | ||
cats = '[[Category:Module documentation|' .. title.baseText .. ']]' | cats = '[[Category:Module documentation|' .. title.baseText .. ']]' | ||
ret2 = addDependencyList and dependencyList._main() or '' | ret2 = addDependencyList and dependencyList._main() or '' | ||
ret2 = ret2 .. (addModuleToc and require('Module:Module toc').main() or '') | |||
else | else | ||
cats = '' | cats = '' | ||
ret2 = '' | ret2 = '' | ||
end | end | ||
if isDataModule and title.namespace == 828 then | |||
ret2 = ret2..'<div class="seealso"><code>mw.loadData</code> compatible</div>' | |||
end | |||
if (preamble and preamble ~= "") then | |||
ret2 = preamble .. ret2 | |||
end | |||
return tostring( ret ) .. ret2 .. cats | return tostring( ret ) .. ret2 .. cats | ||
| Рядок 84: | Рядок 98: | ||
:done() | :done() | ||
ret3 = addDependencyList and dependencyList._main() or '' | ret3 = addDependencyList and dependencyList._main(nil, args.category, args.isUsed) or '' | ||
if title.namespace == 828 then | |||
ret3 = ret3 .. (addModuleToc and require('Module:Module toc').main() or '') | |||
end | |||
if isDataModule and title.namespace == 828 then | |||
ret3 = ret3..'<div class="seealso"><code>mw.loadData</code> compatible</div>[[Category:Data modules]]' | |||
end | |||
if (preamble and preamble ~= "") then | |||
ret3 = preamble .. ret3 | |||
end | |||
return ret1 .. tostring( ret2 ) .. '<div class="documentation-content">' .. ret3 | return ret1 .. tostring( ret2 ) .. '<div class="documentation-content">' .. ret3 | ||