summaryrefslogtreecommitdiff
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
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.
-rw-r--r--doc/build/builder/builders.py16
-rw-r--r--doc/build/index.rst19
-rw-r--r--doc/build/reference/sqlalchemy/connections.rst2
-rw-r--r--lib/sqlalchemy/engine/url.py11
4 files changed, 34 insertions, 14 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
diff --git a/doc/build/index.rst b/doc/build/index.rst
index ed33dfbe5..f576324cd 100644
--- a/doc/build/index.rst
+++ b/doc/build/index.rst
@@ -1,11 +1,7 @@
Table of Contents
=================
-Main Documentation
-------------------
-
.. toctree::
- :glob:
intro
ormtutorial
@@ -14,8 +10,19 @@ Main Documentation
session
dbengine
metadata
- reference/index
-
+
+API Documentation
+-----------------
+
+.. toctree::
+ :glob:
+ :maxdepth: 3
+
+ reference/sqlalchemy/index
+ reference/orm/index
+ reference/ext/index
+ reference/dialects/index
+
Indices and tables
------------------
diff --git a/doc/build/reference/sqlalchemy/connections.rst b/doc/build/reference/sqlalchemy/connections.rst
index 877b73231..2f861816c 100644
--- a/doc/build/reference/sqlalchemy/connections.rst
+++ b/doc/build/reference/sqlalchemy/connections.rst
@@ -10,7 +10,7 @@ Creating Engines
.. autoclass:: sqlalchemy.engine.url.URL
:members:
-
+
Connectables
------------
diff --git a/lib/sqlalchemy/engine/url.py b/lib/sqlalchemy/engine/url.py
index e00efd6c0..5d5ce0bd0 100644
--- a/lib/sqlalchemy/engine/url.py
+++ b/lib/sqlalchemy/engine/url.py
@@ -102,14 +102,13 @@ class URL(object):
used as the keys by default. Unset or false attributes are omitted
from the final dictionary.
- :param \**kw: Optional, alternate key names for url
- attributes::
+ :param \**kw: Optional, alternate key names for url attributes::
- # return 'username' as 'user'
- username='user'
+ # return 'username' as 'user'
+ username='user'
- # omit 'database'
- database=None
+ # omit 'database'
+ database=None
:param names: Deprecated. Same purpose as the keyword-based alternate names,
but correlates the name to the original positionally.