Commits

Ned Batchelder committed c5d7b64

Change how the beta docs are made, and make them more beta-y

  • Participants
  • Parent commits 2ebb465

Comments (0)

Files changed (3)

 
 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:
 	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

doc/_ext/px_xlator.py

                 self.body.append("<what when='%s'>%s</what>\n" % (when, self.encode(what.strip())))
             self.body.append("</history>\n")
             
+        if "beta" in self.builder.config.release:
+            self.body.append("""
+                <box>
+                These docs are for a beta release. 
+                For the latest released version, see <a href='/code/coverage'>coverage.py</a>.
+                </box>
+                """)
+
     def visit_field(self, node):
         if node.children[0].astext() == 'history':
             self.history.append(node.children[1].astext())
         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

doc/_templates/px/layout.html

 <?xml version="1.0" encoding="utf-8" ?>
 {%- endblock %}
 
-<page title='{{ title|striptags }}'>
+<page title='{{ title|striptags }}' {% if "beta" in release %}index='no'{% endif %}>
 {% block document -%}
   {%- block body %} {% endblock -%}
 {%- endblock %}