summaryrefslogtreecommitdiff
path: root/doc/_ext/px_xlator.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-05-23 11:00:48 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-05-23 11:00:48 -0400
commit89d2561b52be9b4499535d70b659ead151d16c75 (patch)
tree770224bdcb21de747ff0fd01768d5aca10a09148 /doc/_ext/px_xlator.py
parent6e4c4886bf2e08d97546860aa23ea3fae1802dd4 (diff)
downloadpython-coveragepy-89d2561b52be9b4499535d70b659ead151d16c75.tar.gz
Sphinx experiments getting complicated...
Diffstat (limited to 'doc/_ext/px_xlator.py')
-rw-r--r--doc/_ext/px_xlator.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/_ext/px_xlator.py b/doc/_ext/px_xlator.py
new file mode 100644
index 0000000..5314f42
--- /dev/null
+++ b/doc/_ext/px_xlator.py
@@ -0,0 +1,18 @@
+from sphinx.writers.html import SmartyPantsHTMLTranslator
+from sphinx.builders.html import StandaloneHTMLBuilder
+
+class PxTranslator(SmartyPantsHTMLTranslator):
+ """Adjust the HTML translator into a .px translator.
+
+ """
+
+ def visit_section(self, node):
+ self.body.append("<!-- PX( -->")
+ SmartyPantsHTMLTranslator.visit_section(self, node)
+ self.body.append("<!-- ) -->")
+
+class PxBuilder(StandaloneHTMLBuilder):
+ def get_target_uri(self, docname, typ=None):
+ import pdb;pdb.set_trace()
+ return docname + self.link_suffix
+ \ No newline at end of file