Merge pull request #333 from matthiaskrgr/htmlreport_fix_colors

htmlreport: fix syntax highlighting broken in ca4a0af840
This commit is contained in:
Daniel Marjamäki 2014-06-06 14:13:52 +02:00
commit 0ec59f5630
1 changed files with 20 additions and 25 deletions

View File

@ -21,10 +21,17 @@ with syntax highlighted source code.
STYLE_FILE = """ STYLE_FILE = """
body { body {
background-color: black;
font: 13px Arial, Verdana, Sans-Serif; font: 13px Arial, Verdana, Sans-Serif;
margin: 0; margin: 0;
padding: 0; width: auto;
}
h1 {
margin: 10px;
}
#footer > p {
margin: 4px;
} }
.error { .error {
@ -42,18 +49,6 @@ body {
padding: 1px; padding: 1px;
} }
#page {
background-color: white;
border: 2px solid #aaa;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
margin: 10px;
overflow: auto;
padding: 5px 10px;
width: auto;
}
#header { #header {
border-bottom: thin solid #aaa; border-bottom: thin solid #aaa;
} }
@ -122,9 +117,11 @@ HTML_HEAD = """
<meta charset="utf-8"> <meta charset="utf-8">
<title>Cppcheck - HTML report - %s</title> <title>Cppcheck - HTML report - %s</title>
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="style.css">
<style>
%s
</style>
</head> </head>
<body> <body>
<div id="page">
<div id="header"> <div id="header">
<h1>Cppcheck report - %s: %s </h1> <h1>Cppcheck report - %s: %s </h1>
</div> </div>
@ -142,15 +139,13 @@ HTML_FOOTER = """
</div> </div>
<div id="footer"> <div id="footer">
<p> <p>
Cppcheck %s - a tool for static C/C++ code analysis Cppcheck %s - a tool for static C/C++ code analysis</br>
</p> </br>
<ul> Internet: <a href="http://cppcheck.sourceforge.net">http://cppcheck.sourceforge.net</a></br>
<li>Internet: <a href="http://cppcheck.sourceforge.net">http://cppcheck.sourceforge.net</a></li> Forum: <a href="http://apps.sourceforge.net/phpbb/cppcheck/">http://apps.sourceforge.net/phpbb/cppcheck/</a></br>
<li>Forum: <a href="http://apps.sourceforge.net/phpbb/cppcheck/">http://apps.sourceforge.net/phpbb/cppcheck/</a></li> IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></br>
<li>IRC: <a href="irc://irc.freenode.net/cppcheck">irc://irc.freenode.net/cppcheck</a></li> <p>
</ul>
</div> </div>
</div>
</body> </body>
</html> </html>
""" """
@ -318,7 +313,7 @@ if __name__ == '__main__':
'w') as output_file: 'w') as output_file:
output_file.write(HTML_HEAD % output_file.write(HTML_HEAD %
(options.title, (options.title,
#htmlFormatter.get_style_defs('.highlight'), htmlFormatter.get_style_defs('.highlight'),
options.title, options.title,
filename)) filename))
@ -343,7 +338,7 @@ if __name__ == '__main__':
print('Creating index.html') print('Creating index.html')
with io.open(os.path.join(options.report_dir, 'index.html'), with io.open(os.path.join(options.report_dir, 'index.html'),
'w') as output_file: 'w') as output_file:
output_file.write(HTML_HEAD % (options.title, options.title, '')) output_file.write(HTML_HEAD % (options.title, '', options.title, ''))
output_file.write(HTML_HEAD_END) output_file.write(HTML_HEAD_END)
output_file.write(' <table>\n') output_file.write(' <table>\n')
output_file.write( output_file.write(