From 3c239604f0315aaa17b0a3474133689847cdbe65 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 21 Aug 2010 11:54:16 -0400 Subject: Change how the beta docs are made, and make them more beta-y --- Makefile | 9 ++------- doc/_ext/px_xlator.py | 13 ++++++++++++- doc/_templates/px/layout.html | 2 +- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index d02fb990..56d4f9d3 100644 --- a/Makefile +++ b/Makefile @@ -67,15 +67,10 @@ uninstall: SPHINXBUILD = sphinx-build SPHINXOPTS = -a -E doc -SPHINXPXCMD = $(SPHINXBUILD) -b px $(SPHINXOPTS) doc/_build/px WEBHOME = c:/ned/web/stellated/pages/code/coverage px: - $(SPHINXPXCMD) - rm doc/_build/px/search.px - -pxbeta: - COVERAGE_DOC_ROOT=/code/coverage/beta/ $(SPHINXPXCMD) + $(SPHINXBUILD) -b px $(SPHINXOPTS) doc/_build/px rm doc/_build/px/search.px dochtml: @@ -89,6 +84,6 @@ publish: px rm -f $(WEBHOME)/sample_html/*.* cp doc/sample_html/*.* $(WEBHOME)/sample_html -publishbeta: pxbeta +publishbeta: px rm -f $(WEBHOME)/beta/*.px cp doc/_build/px/*.px $(WEBHOME)/beta diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py index dc61a3c2..9b57e458 100644 --- a/doc/_ext/px_xlator.py +++ b/doc/_ext/px_xlator.py @@ -42,6 +42,14 @@ class PxTranslator(BaseHtmlXlator): self.body.append("%s\n" % (when, self.encode(what.strip()))) self.body.append("\n") + if "beta" in self.builder.config.release: + self.body.append(""" + + These docs are for a beta release. + For the latest released version, see coverage.py. + + """) + def visit_field(self, node): if node.children[0].astext() == 'history': self.history.append(node.children[1].astext()) @@ -82,7 +90,10 @@ class PxBuilder(StandaloneHTMLBuilder): self.out_suffix = '.px' self.link_suffix = '.html' - self.px_uri = os.environ.get("COVERAGE_DOC_ROOT") or "/code/coverage/" + if "beta" in self.config.release: + 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/_templates/px/layout.html b/doc/_templates/px/layout.html index 19056897..02d36136 100644 --- a/doc/_templates/px/layout.html +++ b/doc/_templates/px/layout.html @@ -2,7 +2,7 @@ {%- endblock %} - + {% block document -%} {%- block body %} {% endblock -%} {%- endblock %} -- cgit v1.2.1