Module:Documentation: Difference between revisions

m local
Use TemplateStyles
Line 78: Line 78:
body
body
:addClass( badDoc and 'documentation-badDoc' or '' )
:addClass( badDoc and 'documentation-badDoc' or '' )
:css{
:css('background-color', '#' .. ( badDoc and '888888' or '33333333' ))
['margin-bottom'] = '0.8em',
padding = '0.8em 1em 0.7em',
['background-color'] = '#' .. ( badDoc and '888888' or '33333333' ),
border = '1px solid #AAA'
}
:tag( 'div' )
:tag( 'div' )
:attr( 'id', 'documentation-header-tools' )
:attr( 'id', 'documentation-header-tools' )
Line 195: Line 190:
body
body
:addClass( docClass )
:addClass( docClass )
:css{
:css('background-color', '#' .. colour)
['background-color'] = '#' .. colour,
border = '1px solid #AAA',
padding = '0.8em 1em 0.7em',
['margin-top'] = '1em',
clear = 'both'
}
local header = mw.html.create( 'div' )
local header = mw.html.create( 'div' )
:addClass( 'documentation-header-top' )
:addClass( 'documentation-header-top' )
:css{
margin = '-0.8em -1em 0.8em',
padding = '0.8em 1em 0.7em',
['background-color'] = '#33333333',
['border-bottom'] = 'inherit'
}
header
header
:node( links )
:node( links )
:tag( 'span' )
:tag( 'span' )
:attr( 'id', 'documentation-header-title' )
:addClass('documentation-header-title' )
:css{
['font-weight'] = 'bold',
['font-size'] = '130%',
['margin-right'] = '1em',
['line-height'] = '1'
}
:wikitext( 'Documentation' )
:wikitext( 'Documentation' )
Line 246: Line 223:
:tag( 'div' )
:tag( 'div' )
:addClass( 'documentation-header-bottom' )
:addClass( 'documentation-header-bottom' )
:css{
margin = '0.7em -1em -0.7em',
['background-color'] = '#33333333',
['border-top'] = 'inherit',
padding = '0.8em 1em 0.7em',
clear = 'both'
}
:node( links )
:node( links )
:wikitext( 'The above documentation is transcluded from [[', docPage.fullText, ']].' )
:wikitext( 'The above documentation is transcluded from [[', docPage.fullText, ']].' )
Line 262: Line 232:
end
end
return tostring( body ) .. tostring( anchor )
return mw.getCurrentFrame():extensionTag('templatestyles', '', {src='Module:Documentation/styles.css'}) .. tostring( body ) .. tostring( anchor )
end
end


return p
return p