From e616185884ccade437bff4d75cc1c22958504878 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 24 May 2009 09:35:52 -0400 Subject: Make the Sphinx HTML output look like the eventual HTML. --- doc/_static/neds.css | 207 +++++++++++++++++++++++++++++++++++++++++++++++++++ doc/conf.py | 8 +- doc/index.rst | 42 +++++++++-- 3 files changed, 248 insertions(+), 9 deletions(-) create mode 100644 doc/_static/neds.css diff --git a/doc/_static/neds.css b/doc/_static/neds.css new file mode 100644 index 00000000..102de98b --- /dev/null +++ b/doc/_static/neds.css @@ -0,0 +1,207 @@ +/* neds.css: a copy of default.css, so that the HTML output looks kind of + like nedbatchelder.com. +*/ + +@import url("basic.css"); + +/* ---------------------------- */ + +/** + * Sphinx stylesheet -- default theme + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: verdana, sans-serif; + font-size: 10pt; + background-color: #11303d; + color: #000; + margin: 0; + padding: 0; +} + +div.document { + background-color: #1c4e63; +} + +div.body { + background-color: #ffffff; + color: #000000; + padding: 0 20px 30px 20px; +} + +div.footer { + color: #ffffff; + width: 100%; + padding: 9px 0 9px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #ffffff; + text-decoration: underline; +} + +div.related { + background-color: #133f52; + line-height: 30px; + color: #ffffff; +} + +div.related a { + color: #ffffff; +} + +div.sphinxsidebar { +} + +div.sphinxsidebar h3 { + color: #ffffff; + font-size: 1.4em; + font-weight: normal; + margin: 0; + padding: 0; +} + +div.sphinxsidebar h3 a { + color: #ffffff; +} + +div.sphinxsidebar h4 { + color: #ffffff; + font-size: 1.3em; + font-weight: normal; + margin: 5px 0 0 0; + padding: 0; +} + +div.sphinxsidebar p { + color: #ffffff; +} + +div.sphinxsidebar p.topless { + margin: 5px 10px 10px 10px; +} + +div.sphinxsidebar ul { + margin: 10px; + padding: 0; + color: #ffffff; +} + +div.sphinxsidebar a { + color: #98dbcc; +} + +div.sphinxsidebar input { + border: 1px solid #98dbcc; + font-family: sans-serif; + font-size: 1em; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #355f7c; + text-decoration: none; +} + +a:hover { + text-decoration: underline; +} + +div.body p, div.body dd, div.body li { + line-height: 130%; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-size: 1em; + border-bottom: 1px solid silver; + margin: 1em 0; +} + +div.body h1 { margin-top: 0; font-size: 100%; } +div.body h2 { font-size: 100%; } +/* H3's are run-in with the text. */ +div.body h3 { + font-size: 100%; display: inline; line-height: 1.35em; + float: left; + margin: 0 1.5em 0 0; +} + + +div.body h4 { font-size: 120%; } +div.body h5 { font-size: 110%; } +div.body h6 { font-size: 100%; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + line-height: 130%; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 5px; + background-color: #eeffcc; + color: #333333; + line-height: 120%; + border: 1px solid #ac9; + border-left: none; + border-right: none; +} + +tt { + background-color: #ecf0f3; + padding: 0 1px 0 1px; + font-size: 0.95em; +} diff --git a/doc/conf.py b/doc/conf.py index 98bc93f1..64e145bd 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -91,17 +91,19 @@ pygments_style = 'sphinx' # -- Options for HTML output --------------------------------------------------- -html_translator_class = "px_xlator.PxTranslator" +#html_translator_class = "px_xlator.PxTranslator" # The theme to use for HTML and HTML Help pages. Major themes that come with # Sphinx are currently 'default' and 'sphinxdoc'. -html_theme = 'px' +html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} +html_style = "neds.css" + html_add_permalinks = False # Add any paths that contain custom themes here, relative to this directory. @@ -161,7 +163,7 @@ html_show_sourcelink = False #html_use_opensearch = '' # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml"). -html_file_suffix = '.px' +#html_file_suffix = '.px' # Output file base name for HTML help builder. htmlhelp_basename = 'coveragepydoc' diff --git a/doc/index.rst b/doc/index.rst index 19ebb2d3..e3492d05 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -2,18 +2,48 @@ coverage.py =========== -Contents: - .. toctree:: - :maxdepth: 2 + :hidden: cmd api - + Coverage.py is a tool for measuring code coverage of Python programs. It monitors -execution of the program, noting lines that are executed. A later analysis -identifies lines that could have been executed but were not. +your program, noting which parts of the code have been executed, then analyzes the +source to identify code that could have been executed but was not. + + +Quick Start +----------- + +Install coverage.py from the cheeseshop. + +Run coverage.py to execute your program and gather data:: + + $ coverage -e -x my_program.py + blah blah your program's output blah blah + +Run coverage.py to report on the results:: + + $ coverage -r -m + Name Stmts Exec Cover Missing + ------------------------------------------------------- + my_program 20 16 80% 33-35, 39 + my_other_module 56 50 89% 517-523 + ------------------------------------------------------- + TOTAL 76 66 87% + +For a nicer presentation, run coverage.py to get annotated HTML listings +detailing missed lines:: + + coverage -b -d htmlcov + +Then visit htmlcov/index.html in your browser. + + +Using coverage.py +----------------- There are two supported interfaces to coverage: a :ref:`command line ` and an :ref:`API `. -- cgit v1.2.1