Module:Documentation

-- -- Template:Documentation --

local p = {}

function p.doc( frame ) local title = mw.title.getCurrentTitle local args = frame:getParent.args local template = args[1] or mw.text.gsub( title.fullText, '/doc$', '' ) local ret, cats, ret1, ret2, ret3 -- subpage header if title.subpageText == 'doc' then ret = mw.html.create( 'table' ) :addClass( 'messagebox' ) :addClass( 'info' ) :tag( 'tr' ) :tag( 'td' ) :wikitext( '' ) :done :tag( 'td' ) :tag( 'b' ) :wikitext( 'This is a documentation subpage for ' .. template .. '.' ) :done :tag( 'div' ) :css( 'font-size', '0.85em' ) :wikitext( 'It contains usage information, categories, and other content that is not part of the original template page.' ) :done :done :done :done cats = ''

if title.nsText == 'Template' then cats = '' end return tostring( ret ) .. cats end -- template header -- don't use mw.html as we aren't closing the main div tag -- @todo when  is merged, clean this up a bit ret1 = ' ' ret2 = mw.html.create( 'div' ) :css( {           ['padding-bottom'] = '1px',            ['border-bottom'] = '1px solid #898989',            ['margin-bottom'] = '1px'        } ) :tag( 'span' ) :css( {               ['font-weight'] = 'bold',                ['font-size'] = '125%'            } ) :wikitext( ' Template documentation' ) :done :tag( 'span' ) :addClass( 'editsection' ) :addClass( 'plainlinks' ) :attr( 'id', 'doc_editlinks' ) :tag( 'small' ) :wikitext(                    .. mw.uri.fullUrl( template .. '/doc', {action='edit'} ) .. ' edit ' ..                     .. mw.uri.fullUrl( title.fullText, {action=purge} ) .. ' purge' ) :done :done :done ret3 = mw.html.create( 'div' ) :css( {           ['margin-bottom'] = '25px',            ['clear'] = 'both'        } ) :wikitext( 'This documentation is transcluded from ' .. template .. '/doc.' ) :done return ret1 .. tostring( ret2 ) .. tostring( ret3 ) end

return p