summaryrefslogtreecommitdiff
path: root/docs/conf.py
diff options
context:
space:
mode:
authorChris McDonough <chrism@agendaless.com>2009-12-28 23:17:55 +0000
committerChris McDonough <chrism@agendaless.com>2009-12-28 23:17:55 +0000
commit016a1fcd164a7389c072b9ef5c247039355bc6ec (patch)
treed17f789549fde69a29677500302804bdf85ecdeb /docs/conf.py
parent44f1df7b7cec671fec92ead513804e52e63eb76d (diff)
downloadpyramid-016a1fcd164a7389c072b9ef5c247039355bc6ec.tar.gz
pyramid-016a1fcd164a7389c072b9ef5c247039355bc6ec.tar.bz2
pyramid-016a1fcd164a7389c072b9ef5c247039355bc6ec.zip
Fix margin overruns.
Diffstat (limited to 'docs/conf.py')
-rw-r--r--docs/conf.py23
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/conf.py b/docs/conf.py
index e3f2b00b6..afc471fe6 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -252,3 +252,26 @@ def setup(app):
app.add_directive('frontmatter', frontmatter, 1, (0, 0, 0))
app.add_directive('mainmatter', mainmatter, 1, (0, 0, 0))
app.add_directive('backmatter', backmatter, 1, (0, 0, 0))
+
+# ugh
+
+from sphinx.writers.latex import LaTeXTranslator
+
+def visit_literal(self, node):
+ self.no_contractions += 1
+ content = self.encode(node.astext().strip())
+ self.no_contractions -= 1
+ if self.in_title:
+ self.body.append(r'\texttt{%s}' % content)
+ elif node.has_key('role') and node['role'] == 'samp':
+ self.body.append(r'\samp{%s}' % content)
+ else:
+ # XXX special treatment of overlong ``repoze.bfg.foo``
+ # literals.
+ if 'repoze.bfg.' in content:
+ content = content.replace('repoze.bfg.', '')
+ self.body.append(r'\code{%s}' % content)
+ raise nodes.SkipNode
+
+LaTeXTranslator.visit_literal = visit_literal
+