Tweak cppcheck-htmlreport.

Move style to a class and tweak properties.
This commit is contained in:
XhmikosR 2013-10-17 15:49:48 +03:00
parent 11a0763b40
commit 31a0e35ef2
1 changed files with 39 additions and 28 deletions

View File

@ -21,79 +21,89 @@ with syntax highlighted source code.
STYLE_FILE = """ STYLE_FILE = """
body { body {
font: normal 13px/1 Arial, Verdana, Sans-Serif;
background-color: black; background-color: black;
padding: 0; font: 13px Arial, Verdana, Sans-Serif;
margin: 0; margin: 0;
padding: 0;
} }
.error { .error {
font-size: 13px;
background-color: #ffb7b7; background-color: #ffb7b7;
padding: 0;
margin: 0; margin: 0;
padding: 0;
} }
.error2 {
background-color: #faa;
border: 1px dotted black;
margin-left: 4px;
margin-top: 4px;
padding: 1px
}
#page { #page {
width: auto;
margin: 30px;
border: 2px solid #aaa;
background-color: white; background-color: white;
padding: 20px; border: 2px solid #aaa;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
margin: 30px;
overflow: auto; overflow: auto;
padding: 5px 20px;
width: auto;
} }
#header { #header {
width: 100%;
height: 70px;
border-bottom: thin solid #aaa; border-bottom: thin solid #aaa;
} }
#menu { #menu {
float: left;
margin-top: 5px; margin-top: 5px;
text-align: left; text-align: left;
float: left;
width: 100px; width: 100px;
height: auto; height: auto;
} }
#menu > a { #menu > a {
margin-left: 10px;
display: block; display: block;
margin-left: 10px;
} }
#content { #content {
border-left: thin solid #aaa;
float: left; float: left;
width: 80%;
margin: 5px; margin: 5px;
padding: 0 10px 10px 10px; padding: 0 10px 10px 10px;
border-left: thin solid #aaa; width: 80%;
} }
.linenos { .linenos {
border-right: thin solid #aaa;
color: #bbb; color: #bbb;
padding-right: 6px; padding-right: 6px;
border-right: thin solid #aaa;
} }
#footer { #footer {
padding-bottom: 5px;
padding-top: 5px;
border-top: thin solid #aaa; border-top: thin solid #aaa;
clear: both; clear: both;
font-size: 90%; font-size: 90%;
margin-top: 5px;
}
#footer ul {
list-style-type: none;
padding-left: 0;
} }
""" """
HTML_HEAD = """ HTML_HEAD = """
<!DOCTYPE HTML> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Cppcheck - HTML report - %s</title> <title>Cppcheck - HTML report - %s</title>
<link href="style.css" rel="stylesheet"> <link rel="stylesheet" href="style.css">
<style> <style>
%s %s
</style> </style>
@ -115,18 +125,18 @@ HTML_FOOTER = """
<p> <p>
Cppcheck - a tool for static C/C++ code analysis Cppcheck - a tool for static C/C++ code analysis
</p> </p>
<p> <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: #cppcheck at irc.freenode.net <li>IRC: #cppcheck at irc.freenode.net</li>
</p> </ul>
</div> </div>
</div> </div>
</body> </body>
</html> </html>
""" """
HTML_ERROR = "<span style=\"border-width: 1px;border-color: black;border-style: solid;background: #ffaaaa;padding: 1px;font-size: 11px;\">&lt;--- %s</span>\n" HTML_ERROR = "<span class=\"error2\">&lt;--- %s</span>\n"
class AnnotateCodeFormatter(HtmlFormatter): class AnnotateCodeFormatter(HtmlFormatter):
@ -145,6 +155,7 @@ class AnnotateCodeFormatter(HtmlFormatter):
class CppCheckHandler(XmlContentHandler): class CppCheckHandler(XmlContentHandler):
"""Parses the cppcheck xml file and produces a list of all its errors.""" """Parses the cppcheck xml file and produces a list of all its errors."""
def __init__(self): def __init__(self):