diff options
author | Georg Brandl <georg@python.org> | 2009-03-16 00:04:40 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-03-16 00:04:40 +0100 |
commit | 5f6c38f47ac35e938299cb4094203e93c0184a7d (patch) | |
tree | daeea04511e81aeda838dfc9245b352db908690e | |
parent | 9a2bf336f7c242e9644b9e87da541fc62fc2f0bf (diff) | |
download | sphinx-git-5f6c38f47ac35e938299cb4094203e93c0184a7d.tar.gz |
Handle inline nodes in latex and text writers.
-rw-r--r-- | sphinx/latexwriter.py | 6 | ||||
-rw-r--r-- | sphinx/texinputs/sphinx.sty | 12 | ||||
-rw-r--r-- | sphinx/textwriter.py | 10 |
3 files changed, 28 insertions, 0 deletions
diff --git a/sphinx/latexwriter.py b/sphinx/latexwriter.py index 81099f173..88b1a50bb 100644 --- a/sphinx/latexwriter.py +++ b/sphinx/latexwriter.py @@ -1159,6 +1159,12 @@ class LaTeXTranslator(nodes.NodeVisitor): def visit_substitution_reference(self, node): raise nodes.SkipNode + def visit_inline(self, node): + classes = node.get('classes', []) + self.body.append(r'\DUspan{%s}{' %','.join(classes)) + def depart_inline(self, node): + self.body.append('}') + def visit_generated(self, node): pass def depart_generated(self, node): diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index f65bb170f..c799d6885 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -710,3 +710,15 @@ linkcolor=InnerLinkColor,filecolor=OuterLinkColor, menucolor=OuterLinkColor,pagecolor=OuterLinkColor, urlcolor=OuterLinkColor]{hyperref} + +% From docutils.writers.latex2e +\providecommand{\DUspan}[2]{% + {% group ("span") to limit the scope of styling commands + \@for\node@class@name:=#1\do{% + \ifcsname docutilsrole\node@class@name\endcsname% + \csname docutilsrole\node@class@name\endcsname% + \fi% + }% + {#2}% node content + }% close "span" +} diff --git a/sphinx/textwriter.py b/sphinx/textwriter.py index 383af7828..46bf697cf 100644 --- a/sphinx/textwriter.py +++ b/sphinx/textwriter.py @@ -657,6 +657,16 @@ class TextTranslator(nodes.NodeVisitor): def depart_Text(self, node): pass + def visit_generated(self, node): + pass + def depart_generated(self, node): + pass + + def visit_inline(self, node): + pass + def depart_inline(self, node): + pass + def visit_problematic(self, node): self.add_text('>>') def depart_problematic(self, node): |