Commit f2336b61 authored by Stefan Behnel's avatar Stefan Behnel

reduce inline CSS class overhead a little and tighten C code specific selectors in the CSS template

parent 901d7f57
...@@ -65,30 +65,24 @@ class AnnotationCCodeWriter(CCodeWriter): ...@@ -65,30 +65,24 @@ class AnnotationCCodeWriter(CCodeWriter):
""" """
_css_template = """ _css_template = """
body.cython { font-family: courier; font-size: 12; }
body { font-family: courier; font-size: 12; }
.cython.code { font-size: 9; color: #444444; display: none; margin-left: 20px; }
.cython.py_c_api { color: red; }
.cython.py_macro_api { color: #FF7000; }
.cython.pyx_c_api { color: #FF3000; }
.cython.pyx_macro_api { color: #FF7000; }
.cython.refnanny { color: #FFA000; }
.cython.error_goto { color: #FFA000; }
.cython.tag { } .cython.tag { }
.cython.coerce { color: #008000; border: 1px dotted #008000 }
.cython.py_attr { color: #FF0000; font-weight: bold; }
.cython.c_attr { color: #0000FF; }
.cython.py_call { color: #FF0000; font-weight: bold; }
.cython.c_call { color: #0000FF; }
.cython.line { margin: 0em } .cython.line { margin: 0em }
.cython.code { font-size: 9; color: #444444; display: none; margin-left: 20px; }
.cython.code .py_c_api { color: red; }
.cython.code .py_macro_api { color: #FF7000; }
.cython.code .pyx_c_api { color: #FF3000; }
.cython.code .pyx_macro_api { color: #FF7000; }
.cython.code .refnanny { color: #FFA000; }
.cython.code .error_goto { color: #FFA000; }
.cython.code .coerce { color: #008000; border: 1px dotted #008000 }
.cython.code .py_attr { color: #FF0000; font-weight: bold; }
.cython.code .c_attr { color: #0000FF; }
.cython.code .py_call { color: #FF0000; font-weight: bold; }
.cython.code .c_call { color: #0000FF; }
""" """
def save_annotation(self, source_filename, target_filename): def save_annotation(self, source_filename, target_filename):
...@@ -114,7 +108,7 @@ body { font-family: courier; font-size: 12; } ...@@ -114,7 +108,7 @@ body { font-family: courier; font-size: 12; }
{js} {js}
</script> </script>
</head> </head>
<body> <body class="cython">
<p>Generated by Cython {watermark}</p>\n'''.format( <p>Generated by Cython {watermark}</p>\n'''.format(
css=self._css(), js=self._js, watermark=Version.watermark)] css=self._css(), js=self._js, watermark=Version.watermark)]
if c_file: if c_file:
...@@ -150,7 +144,7 @@ body { font-family: courier; font-size: 12; } ...@@ -150,7 +144,7 @@ body { font-family: courier; font-size: 12; }
def annotate(match): def annotate(match):
group_name = match.lastgroup group_name = match.lastgroup
calls[group_name] += 1 calls[group_name] += 1
return ur"<span class='cython %s'>%s</span>" % ( return ur"<span class='%s'>%s</span>" % (
group_name, match.group(group_name)) group_name, match.group(group_name))
for k, line in enumerate(lines, 1): for k, line in enumerate(lines, 1):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment