summaryrefslogtreecommitdiff
path: root/doc/build/builder
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2008-12-07 23:58:02 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2008-12-07 23:58:02 +0000
commit480436ff7cdfe8564e818d611cc0aff20b774754 (patch)
treed5c76c0d4efb81f99ad2a4f1e557efc584562c39 /doc/build/builder
parent058c2895be8e7d141d63c0561fb88f2b821238f5 (diff)
downloadsqlalchemy-480436ff7cdfe8564e818d611cc0aff20b774754.tar.gz
- moved index.rst around to have the API docs right there, no "Main Documentation" chapter which is fairly needless. this all allows PDF to have a decent TOC on the side with only two levels (can we change that ?)
- added LatexFormatter. - PDF wont work until issue with the docstirng in url.py/URL.translate_connect_args is fixed.
Diffstat (limited to 'doc/build/builder')
-rw-r--r--doc/build/builder/builders.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/doc/build/builder/builders.py b/doc/build/builder/builders.py
index f65678ce2..a7fb45998 100644
--- a/doc/build/builder/builders.py
+++ b/doc/build/builder/builders.py
@@ -122,10 +122,24 @@ class PopupSQLFormatter(HtmlFormatter):
for t, v in _strip_trailing_whitespace(HtmlFormatter._format_lines(self, iter(buf))):
yield t, v
+class PopupLatexFormatter(LatexFormatter):
+ def _filter_tokens(self, tokensource):
+ for ttype, value in apply_filters(tokensource, [StripDocTestFilter()]):
+ if ttype in Token.Sql:
+ if ttype is not Token.Sql.Link and ttype is not Token.Sql.Open:
+ yield Token.Literal, re.sub(r'(?:[{stop}|\n]*)$', '', value)
+ else:
+ continue
+ else:
+ yield ttype, value
+
+ def format(self, tokensource, outfile):
+ LatexFormatter.format(self, self._filter_tokens(tokensource), outfile)
+
def setup(app):
app.add_lexer('pycon+sql', PyConWithSQLLexer())
app.add_lexer('python+sql', PythonWithSQLLexer())
PygmentsBridge.html_formatter = PopupSQLFormatter
- #PygmentsBridge.latex_formatter = LatexFormatter
+ PygmentsBridge.latex_formatter = PopupLatexFormatter
\ No newline at end of file