summaryrefslogtreecommitdiff
path: root/sphinx/ext/mathbase.py
diff options
context:
space:
mode:
authorJon Waltman <jonathan.waltman@gmail.com>2011-03-05 23:59:34 -0600
committerJon Waltman <jonathan.waltman@gmail.com>2011-03-05 23:59:34 -0600
commitc7c168e1baae584eb0738e212b0dd86802fe6468 (patch)
tree6d1ec8d99601f132294d562ca6476930fb7a1a59 /sphinx/ext/mathbase.py
parent288d7589bc90fa3ac312387f0e7a44ec6bc780db (diff)
downloadsphinx-c7c168e1baae584eb0738e212b0dd86802fe6468.tar.gz
Add Texinfo support in ext.graphviz, ext.inheritance_diagram and ext.mathbase.
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r--sphinx/ext/mathbase.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py
index d021c60b..b5473449 100644
--- a/sphinx/ext/mathbase.py
+++ b/sphinx/ext/mathbase.py
@@ -12,7 +12,6 @@
from docutils import nodes, utils
from docutils.parsers.rst import directives
-from sphinx.writers import texinfo
from sphinx.util.compat import Directive
@@ -127,16 +126,20 @@ def man_visit_eqref(self, node):
def texinfo_visit_math(self, node):
- self.body.append('@math{' + texinfo.escape_arg(node['latex']) + '}')
+ self.body.append('@math{' + self.escape_arg(node['latex']) + '}')
raise nodes.SkipNode
def texinfo_visit_displaymath(self, node):
- self.visit_paragraph(node)
+ if node.get('label'):
+ self.add_anchor(node['label'], node)
+ self.body.append('\n\n@example\n%s\n@end example\n\n' %
+ self.escape_arg(node['latex']))
def texinfo_depart_displaymath(self, node):
- self.depart_paragraph(node)
+ pass
def texinfo_visit_eqref(self, node):
- self.body.append(node['target'])
+ self.add_xref(node['docname'] + ':' + node['target'],
+ node['target'], node)
raise nodes.SkipNode