diff options
author | Raymond Hettinger <python@rcn.com> | 2012-07-01 05:19:04 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2012-07-01 05:19:04 (GMT) |
commit | fd490cc0523479de87f3894f91074d8c876f7491 (patch) | |
tree | 1b6c9135ad9a79502d29f94b70963fe2c066904b /Tools/scripts/pycolorize.py | |
parent | 410afbc5d8d11624bdb71650c4c79ed54318dd00 (diff) | |
download | cpython-fd490cc0523479de87f3894f91074d8c876f7491.zip cpython-fd490cc0523479de87f3894f91074d8c876f7491.tar.gz cpython-fd490cc0523479de87f3894f91074d8c876f7491.tar.bz2 |
Small cleanups
Diffstat (limited to 'Tools/scripts/pycolorize.py')
-rwxr-xr-x | Tools/scripts/pycolorize.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Tools/scripts/pycolorize.py b/Tools/scripts/pycolorize.py index 6edd223..c5c9611 100755 --- a/Tools/scripts/pycolorize.py +++ b/Tools/scripts/pycolorize.py @@ -66,17 +66,25 @@ default_css = { } default_html = '''\ -<html><head><style type="text/css"> +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" + "http://www.w3.org/TR/html4/strict.dtd"> +<html> +<head> +<meta http-equiv="Content-type" content="text/html;charset=UTF-8"> +<title> Python Code </title> +<style type="text/css"> %s -</style></head> +</style> +</head> <body> %s -</body></html> +</body> +</html> ''' def build_page(source, html=default_html, css=default_css): 'Create a complete HTML page with colorized Python source code' - css_str = ''.join(['%s %s\n' % item for item in css.items()]) + css_str = '\n'.join(['%s %s' % item for item in css.items()]) result = colorize(source) return html % (css_str, result) |