[Checkins] SVN: Sandbox/ulif/grok-reference-with-rest3/doc/build/latex_hacks.py Get rid of monkey patches that were fixed in last sphinx version.

Uli Fouquet uli at gnufix.de
Wed Feb 27 08:39:45 EST 2008


Log message for revision 84334:
  Get rid of monkey patches that were fixed in last sphinx version.

Changed:
  U   Sandbox/ulif/grok-reference-with-rest3/doc/build/latex_hacks.py

-=-
Modified: Sandbox/ulif/grok-reference-with-rest3/doc/build/latex_hacks.py
===================================================================
--- Sandbox/ulif/grok-reference-with-rest3/doc/build/latex_hacks.py	2008-02-27 13:30:55 UTC (rev 84333)
+++ Sandbox/ulif/grok-reference-with-rest3/doc/build/latex_hacks.py	2008-02-27 13:39:45 UTC (rev 84334)
@@ -13,19 +13,16 @@
 #
 ##############################################################################
 """LaTeX hacks for sphinx problems.
+
+The sphinx latextranslator currently lacks a few features that are
+part of stock ``docutils`` translators. Some of the monkey patches in
+here were already applied to the stock sphinx package, but some are
+still missing. Therefore we 'inject' those changes here.
 """
 
 from docutils import nodes
 from sphinx.latexwriter import LaTeXTranslator
 
-# Inject a translator handler for raw text (sphinx lacks one by
-# default).
-def visit_raw(self, node):
-    if 'latex' in node.get('format', '').split():
-        self.body.append(r'%s' % node.astext())
-    raise nodes.SkipNode
-LaTeXTranslator.visit_raw = visit_raw
-
 # Inject a working pygments workaround.
 def depart_literal_block(self, node):
     hlcode = self.highlighter.highlight_block(self.verbatim.rstrip(
@@ -40,9 +37,8 @@
 LaTeXTranslator.depart_literal_block = depart_literal_block
 LaTeXTranslator.depart_doctest_block = depart_literal_block
 
-# Inject a more correct topic handler (sphinx default
-# handler fails to handle verbatim environments in
-# topics/sidebars.
+# Inject a topic handler that frames sidebars and topics with a
+# shadowbox instead of the normal fbox.
 def visit_topic(self, node):
     self.body.append('\\setbox0\\vbox{\n'
                      '\\begin{minipage}{0.75\\textwidth}\n')



More information about the Checkins mailing list