diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-22 18:28:51 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2015-08-22 18:28:51 -0400 |
commit | 41005832b16af1dc054429c78656259175f2f0ca (patch) | |
tree | ef5a2ad7531c0af1852f35b9421a3baced4e7790 | |
parent | 97658fc24b38aed0457b06033e58623c96c8bd21 (diff) | |
download | python-coveragepy-git-41005832b16af1dc054429c78656259175f2f0ca.tar.gz |
Don't need the .px doc toolchain any morecoverage-4.0b2
-rw-r--r-- | Makefile | 14 | ||||
-rw-r--r-- | TODO.txt | 10 | ||||
-rw-r--r-- | doc/_ext/px_cleaner.py | 19 | ||||
-rw-r--r-- | doc/_ext/px_xlator.py | 117 | ||||
-rw-r--r-- | doc/conf.py | 3 |
5 files changed, 7 insertions, 156 deletions
@@ -94,11 +94,6 @@ WEBHOME = ~/web/stellated/pages/code/coverage docreqs: pip install -r doc/requirements.txt -px: - $(SPHINXBUILD) -b px $(SPHINXOPTS) doc/_build/px - rm doc/_build/px/search.px - python doc/_ext/px_cleaner.py doc/_build/px/*.px - dochtml: $(SPHINXBUILD) -b html $(SPHINXOPTS) doc/_build/html @echo @@ -107,16 +102,11 @@ dochtml: docspell: $(SPHINXBUILD) -b spelling $(SPHINXOPTS) doc/_spell -publish: px - rm -f $(WEBHOME)/*.px - cp doc/_build/px/*.px $(WEBHOME) +publish: rm -f $(WEBHOME)/sample_html/*.* cp doc/sample_html/*.* $(WEBHOME)/sample_html -publishbeta: px - rm -f $(WEBHOME)/beta/*.px - mkdir -p $(WEBHOME)/beta - cp doc/_build/px/*.px $(WEBHOME)/beta +publishbeta: rm -f $(WEBHOME)/sample_html_beta/*.* mkdir -p $(WEBHOME)/sample_html_beta cp doc/sample_html_beta/*.* $(WEBHOME)/sample_html_beta @@ -28,20 +28,20 @@ Key: + we can use "except ExcClass as e:" - Plugins - - Clean up + + Clean up + implement plugin support in CTracer + remove plugin support from PyTracer - - add services: + x add services: - filelocator - warning - dynamic_source_filename: return should be a canonical path - update the omit test to use "quux*" instead of "*quux*" - - docs + + docs + Make reports use filenames, not module names - documentation - test helpers + cov.config["run:branch"] api (well, coverage.get_option etc) - - "added in 4.0" + + "added in 4.0" - tweaks to theme? - Plugins! Once per process @@ -52,7 +52,7 @@ Key: Once per line - build process - don't publish to nedbat.com any more (but still need the sample html reports) - - don't need .px tooling + + don't need .px tooling - write a new nedbat.com/code/coverage page. - all doc links should point to rtfd + Remove code only run on <2.6 diff --git a/doc/_ext/px_cleaner.py b/doc/_ext/px_cleaner.py deleted file mode 100644 index 24541207..00000000 --- a/doc/_ext/px_cleaner.py +++ /dev/null @@ -1,19 +0,0 @@ -"""Clean up .px files created by Sphinx.""" - -import sys - -def clean_px(fname): - """Clean a px file.""" - - with open(fname) as f: - text = f.read() - text = text.lstrip() - with open(fname, "w") as f: - f.write(text) - -def clean_px_files(fnames): - for fname in fnames: - clean_px(fname) - -if __name__ == '__main__': - clean_px_files(sys.argv[1:]) diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py deleted file mode 100644 index e4950d9a..00000000 --- a/doc/_ext/px_xlator.py +++ /dev/null @@ -1,117 +0,0 @@ -from docutils import nodes -from sphinx import addnodes -from sphinx.writers.html import SmartyPantsHTMLTranslator -from sphinx.builders.html import StandaloneHTMLBuilder -import os - -def setup(app): - app.add_builder(PxBuilder) - - -BaseHtmlXlator = SmartyPantsHTMLTranslator -class PxTranslator(BaseHtmlXlator): - """Adjust the HTML translator into a .px translator. - - """ - - def __init__(self, *args, **kwargs): - BaseHtmlXlator.__init__(self, *args, **kwargs) - #self.document.reporter.debug_flag = 1 - # To make the doc title be h0 (skipped), and the next h1. - self.initial_header_level = 0 - - def visit_section(self, node): - self.section_level += 1 - - def depart_section(self, node): - self.section_level -= 1 - - def visit_title(self, node): - if self.section_level == 1: - raise nodes.SkipNode - else: - # The id for the h2 tag is on the parent, move it - # down here so we'll get the right HTML. - if not node['ids'] and len(node.parent['ids']) > 1: - node['ids'] = [node.parent['ids'][1]] - BaseHtmlXlator.visit_title(self, node) - - def visit_field_list(self, node): - self.history = [] - - def depart_field_list(self, node): - if self.history: - self.body.append("<history>\n") - for hist in self.history: - when, what = hist.split(',', 1) - self.body.append("<what when='%s'>%s</what>\n" % (when, self.encode(what.strip()))) - self.body.append("</history>\n") - - prerel = None - if "b" in self.builder.config.release: - prerel = "a beta" - if "a" in self.builder.config.release: - prerel = "an ALPHA" - if prerel: - self.body.append(""" - <box> - These docs are for %s release, %s. - For the latest released version, see <a href='/code/coverage'>coverage.py</a>. - </box> - """ % (prerel, self.builder.config.release)) - - def visit_field(self, node): - if node.children[0].astext() == 'history': - self.history.append(node.children[1].astext()) - raise nodes.SkipChildren - - def depart_field(self, node): - pass - - def visit_literal_block(self, node): - if node.rawsource != node.astext(): - # most probably a parsed-literal block -- don't highlight - return BaseHtmlXlator.visit_literal_block(self, node) - lang = self.highlightlang - if node.has_key('language'): - # code-block directives - lang = node['language'] - self.body.append('<code lang="%s">' % lang) - self.body.append(self.encode(node.rawsource)) - self.body.append('</code>\n') - raise nodes.SkipNode - - def visit_desc_parameterlist(self, node): - # I'm overriding this method so that the base class doesn't write out - # <big>(</big>, but I also have to handle the logic from the base class, - # so most of this is just copied from sphinx/writers/html.py... - self.body.append('(') - self.first_param = 1 - self.optional_param_level = 0 - # How many required parameters are left. - self.required_params_left = sum([isinstance(c, addnodes.desc_parameter) - for c in node.children]) - self.param_separator = node.child_text_separator - def depart_desc_parameterlist(self, node): - self.body.append(')') - - -class PxBuilder(StandaloneHTMLBuilder): - name = 'px' - - def init(self): - self.config.html_theme = 'px' - self.config.html_translator_class = "px_xlator.PxTranslator" - - super(PxBuilder, self).init() - - self.out_suffix = '.px' - self.link_suffix = '.html' - - if max(self.config.release).isalpha(): - self.px_uri = "/code/coverage/beta/" - else: - self.px_uri = "/code/coverage/" - - def get_target_uri(self, docname, typ=None): - return self.px_uri + docname + self.link_suffix diff --git a/doc/conf.py b/doc/conf.py index 8b2bb24c..5417b8ac 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -20,8 +20,6 @@ import sys, os # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.append(os.path.abspath('.')) -# Copied from django docs: -sys.path.append(os.path.join(os.path.dirname(__file__), "_ext")) # on_rtd is whether we are on readthedocs.org on_rtd = os.environ.get('READTHEDOCS', None) == 'True' @@ -35,7 +33,6 @@ extensions = [ 'sphinx.ext.todo', 'sphinx.ext.ifconfig', 'sphinxcontrib.spelling', - 'px_xlator', ] # Add any paths that contain templates here, relative to this directory. |