Editing Module:DocumentationGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 1: | Line 1: | ||
-- <nowiki> | -- <nowiki> | ||
-- [[Template:Documentation]] | |||
-- | |||
local p = {} | local p = {} | ||
| Line 7: | Line 8: | ||
local title = mw.title.getCurrentTitle() | local title = mw.title.getCurrentTitle() | ||
local args = frame:getParent().args | local args = frame:getParent().args | ||
local | local template = args[1] or mw.ustring.gsub( title.fullText, '/doc$', '' ) | ||
local ret, cats, ret1, ret2, ret3 | local ret, cats, ret1, ret2, ret3 | ||
-- subpage header | -- subpage header | ||
| Line 19: | Line 18: | ||
:tag( 'tr' ) | :tag( 'tr' ) | ||
:tag( 'td' ) | :tag( 'td' ) | ||
:wikitext( '[[File:Information icon-grey.svg|40px|Documentation]]' ) | |||
:wikitext( '[[File:Information icon-grey.svg| | |||
:done() | :done() | ||
:tag( 'td' ) | :tag( 'td' ) | ||
:tag( 'b' ) | :tag( 'b' ) | ||
:wikitext( 'This is a documentation subpage for [[' .. | :wikitext( 'This is a documentation subpage for [[' .. template .. ']].' ) | ||
:done() | :done() | ||
:tag( 'div' ) | :tag( 'div' ) | ||
:css( | :css( 'font-size', '0.85em' ) | ||
:wikitext( | :wikitext( 'It contains usage information, categories, and other content that is not part of the original template page.' ) | ||
:done() | :done() | ||
:done() | :done() | ||
:done() | :done() | ||
:done() | :done() | ||
cats = '' | |||
if title. | if title.nsText == 'Template' then | ||
cats = '[[Category:Template documentation|' .. title.baseText .. ']]' | cats = '[[Category:Template documentation|' .. title.baseText .. ']]' | ||
end | end | ||
return tostring( ret ) | return tostring( ret ) .. cats | ||
end | end | ||
-- template header | -- template header | ||
-- don't use mw.html as we aren't closing the main div tag | -- don't use mw.html as we aren't closing the main div tag | ||
ret1 = '<div class="documentation | -- @todo when <https://github.com/Wikia/app/pull/7475> is merged, clean this up a bit | ||
ret1 = '<div class="documentation">' | |||
ret2 = mw.html.create | |||
ret2 = mw.html.create( 'div' ) | |||
:addClass( 'doc-header' ) | |||
:tag( 'span' ) | |||
:addClass( 'doc-title' ) | |||
:wikitext( 'Template documentation' ) | |||
:done() | :done() | ||
:tag( ' | :tag( 'span' ) | ||
:addClass( 'doc- | :addClass( 'doc-editlinks' ) | ||
:addClass( 'plainlinks' ) | |||
:wikitext( | |||
'[[' .. tostring( mw.uri.fullUrl( template .. '/doc', {action='edit'} ) ) .. ' edit]] ' .. | |||
'[[' .. tostring( mw.uri.fullUrl( title.fullText, {action='purge'} ) ) .. ' purge]]' | |||
) | |||
:done() | :done() | ||
:done() | |||
ret3 = | |||
ret3 = mw.html.create( 'div' ) | |||
:addClass( 'doc-transclusion' ) | |||
:wikitext( 'This documentation is transcluded from [[' .. template .. '/doc]].' ) | |||
:done() | |||
return ret1 .. tostring( ret2 ) .. | return ret1 .. tostring( ret2 ) .. tostring( ret3 ) | ||
end | end | ||
return p | return p | ||