From b423f9f280d4a3a68084201e1fdeb49f7db0f6ad Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 25 Jul 2009 14:58:58 +0200 Subject: [PATCH 01/13] Fix generation of the index when there are symbols with ASCII value larger than that of the lowercase letters. --- sphinx/environment.py | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/sphinx/environment.py b/sphinx/environment.py index 3f753acce..4319b1c01 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -21,7 +21,6 @@ import difflib import cPickle as pickle from os import path from glob import glob -from string import ascii_uppercase as uppercase from itertools import izip, groupby try: from hashlib import md5 @@ -1419,35 +1418,35 @@ class BuildEnvironment: for fn, entries in self.indexentries.iteritems(): # new entry types must be listed in directives/other.py! - for type, string, tid, alias in entries: + for type, value, tid, alias in entries: if type == 'single': try: - entry, subentry = string.split(';', 1) + entry, subentry = value.split(';', 1) except ValueError: - entry, subentry = string, '' + entry, subentry = value, '' if not entry: - self.warn(fn, 'invalid index entry %r' % string) + self.warn(fn, 'invalid index entry %r' % value) continue add_entry(entry.strip(), subentry.strip()) elif type == 'pair': try: first, second = map(lambda x: x.strip(), - string.split(';', 1)) + value.split(';', 1)) if not first or not second: raise ValueError except ValueError: - self.warn(fn, 'invalid pair index entry %r' % string) + self.warn(fn, 'invalid pair index entry %r' % value) continue add_entry(first, second) add_entry(second, first) elif type == 'triple': try: first, second, third = map(lambda x: x.strip(), - string.split(';', 2)) + value.split(';', 2)) if not first or not second or not third: raise ValueError except ValueError: - self.warn(fn, 'invalid triple index entry %r' % string) + self.warn(fn, 'invalid triple index entry %r' % value) continue add_entry(first, second+' '+third) add_entry(second, third+', '+first) @@ -1455,8 +1454,15 @@ class BuildEnvironment: else: self.warn(fn, 'unknown index entry type %r' % type) + # sort the index entries; put all symbols at the front, even those + # following the letters in ASCII, this is where the chr(127) comes from + def keyfunc(entry, lcletters=string.ascii_lowercase + '_'): + lckey = entry[0].lower() + if lckey[0:1] in lcletters: + return chr(127) + lckey + return lckey newlist = new.items() - newlist.sort(key=lambda t: t[0].lower()) + newlist.sort(key=keyfunc) # fixup entries: transform # func() (in module foo) @@ -1470,7 +1476,7 @@ class BuildEnvironment: i = 0 while i < len(newlist): key, (targets, subitems) = newlist[i] - # cannot move if it hassubitems; structure gets too complex + # cannot move if it has subitems; structure gets too complex if not subitems: m = _fixre.match(key) if m: @@ -1488,12 +1494,12 @@ class BuildEnvironment: i += 1 # group the entries by letter - def keyfunc((k, v), ltrs=uppercase+'_'): - # hack: mutate the subitems dicts to a list in the keyfunc + def keyfunc((k, v), letters=string.ascii_uppercase + '_'): + # hack: mutating the subitems dicts to a list in the keyfunc v[1] = sorted((si, se) for (si, (se, void)) in v[1].iteritems()) # now calculate the key letter = k[0].upper() - if letter in ltrs: + if letter in letters: return letter else: # get all other symbols under one heading From c9d5cd9e6f92bed736b08c210c0c2399f67e2d74 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 29 Jul 2009 15:57:20 +0000 Subject: [PATCH 02/13] Add sphinx and docutils versions to saved traceback file. --- sphinx/util/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 7d00964fb..40d4e323c 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -21,6 +21,9 @@ import posixpath import traceback from os import path +import docutils +import sphinx + # Generally useful regular expressions. ws_re = re.compile(r'\s+') @@ -206,6 +209,9 @@ def save_traceback(): """ exc = traceback.format_exc() fd, path = tempfile.mkstemp('.log', 'sphinx-err-') + os.write(fd, '# Sphinx version: %s\n' % sphinx.__version__) + os.write(fd, '# Docutils version: %s %s\n' % (docutils.__version__, + docutils.__version_details__)) os.write(fd, exc) os.close(fd) return path From 0516082799dddcd792a8014c8d3c1ce1a47c8a08 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 22:39:17 +0200 Subject: [PATCH 03/13] Add link to db2rst. --- doc/intro.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/doc/intro.rst b/doc/intro.rst index abf34a9a0..773bc74ed 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -31,6 +31,9 @@ to reStructuredText/Sphinx from other documentation systems. `_. It contains generic code to convert Python-doc-style LaTeX markup to Sphinx reST. +* Marcin Wojdyr has written a script to convert Docbook to reST with Sphinx + markup; it is at `Google Code `_. + Prerequisites ------------- From bb58c543188f8012837f0fd48574a48167591a85 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 22:44:52 +0200 Subject: [PATCH 04/13] Add OpenEXR. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index 11c6d06fb..c8a619823 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -33,6 +33,7 @@ included, please mail to `the Google group * NetworkX: http://networkx.lanl.gov/ * NumPy: http://docs.scipy.org/doc/numpy/reference/ * ObjectListView: http://objectlistview.sourceforge.net/python +* OpenEXR: http://excamera.com/articles/26/doc/index.html * OpenLayers: http://docs.openlayers.org/ * openWNS: http://docs.openwns.org/ * Paste: http://pythonpaste.org/script/ From 39a66f713f77caf1a0c00a3f7861f849dce8dbd3 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:06:31 +0200 Subject: [PATCH 05/13] Add MirrorBrain. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index c8a619823..7bb6e3190 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -27,6 +27,7 @@ included, please mail to `the Google group * Matplotlib: http://matplotlib.sourceforge.net/ * Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi * MeshPy: http://documen.tician.de/meshpy/ +* MirrorBrain: http://mirrorbrain.org/docs/ * Mixin.com: http://dev.mixin.com/ * mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html * MyHDL: http://www.myhdl.org/doc/0.6/ From df37a45a726e25d0e61f150ab299cdf704106eab Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:09:05 +0200 Subject: [PATCH 06/13] Add LEPL. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index 7bb6e3190..bedeff55a 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -23,6 +23,7 @@ included, please mail to `the Google group * Hedge: http://documen.tician.de/hedge/ * IFM: http://fluffybunny.memebot.com/ifm-docs/index.html * Jinja: http://jinja.pocoo.org/2/documentation/ +* LEPL: http://www.acooke.org/lepl/ * MapServer: http://mapserver.org/ * Matplotlib: http://matplotlib.sourceforge.net/ * Mayavi: http://code.enthought.com/projects/mayavi/docs/development/html/mayavi From ee9221d52d2a6af831936b0a70651f9819f3aa92 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:13:02 +0200 Subject: [PATCH 07/13] Remove $Revision$ keyword which is not expanded anymore with Hg. --- sphinx/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 730d61c82..a5f50766d 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -12,7 +12,6 @@ import sys from os import path -__revision__ = '$Revision$' __version__ = '0.6.2+' __released__ = '0.6.2' From 8e9682819a4f5aece4d2314eea575546f9de9204 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:29:05 +0200 Subject: [PATCH 08/13] Add the hg revision ID to __version__ when running a non-released version. --- sphinx/__init__.py | 17 ++++++++++++++++- sphinx/application.py | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index a5f50766d..17b37823d 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -13,10 +13,25 @@ import sys from os import path __version__ = '0.6.2+' -__released__ = '0.6.2' +__released__ = '0.6.2' # used when Sphinx builds its own docs package_dir = path.abspath(path.dirname(__file__)) +if '+' in __version__ or 'pre' in __version__: + # try to find out the changeset hash if checked out from hg, and append + # it to __version__ (since we use this value from setup.py, it gets + # automatically propagated to an installed copy as well) + try: + import subprocess + p = subprocess.Popen(['hg', 'id', '-i', '-R', + path.join(package_dir, '..')], + stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = p.communicate() + if out: + __version__ += '/' + out.strip() + except Exception: + pass + def main(argv=sys.argv): if sys.version_info[:3] < (2, 4, 0): diff --git a/sphinx/application.py b/sphinx/application.py index 9bcd9674d..972c427c0 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -84,7 +84,7 @@ class Sphinx(object): self._events = events.copy() # say hello to the world - self.info(bold('Running Sphinx v%s' % sphinx.__released__)) + self.info(bold('Running Sphinx v%s' % sphinx.__version__)) # status code for command-line application self.statuscode = 0 From 30a1c6b7d99213cb22a947e703ddb9559ae3677d Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:42:02 +0200 Subject: [PATCH 09/13] Add The Wine Cellar Book. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index bedeff55a..f48bd8081 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -69,6 +69,7 @@ included, please mail to `the Google group * Sqlkit: http://sqlkit.argolinux.org/ * SymPy: http://docs.sympy.org/ * tinyTiM: http://tinytim.sourceforge.net/docs/2.0/ +* The Wine Cellar Book: http://www.thewinecellarbook.com/doc/en/ * TurboGears: http://turbogears.org/2.0/docs/ * VOR: http://www.vor-cycling.be/ * WFront: http://discorporate.us/projects/WFront/ From 640fc0ac498101f72cb1802ea3af29bfdcf232fc Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:42:32 +0200 Subject: [PATCH 10/13] Section titles are now allowed inside ``only`` directives. --- CHANGES | 2 ++ sphinx/directives/other.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1a437a8ab..dc58148e7 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Release 0.6.3 (in development) ============================== +* Section titles are now allowed inside ``only`` directives. + * #201: Make ``centered`` directive work in LaTeX output. * #206: Refuse to overwrite an existing master document in diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index 4ca09ddc5..5eefa48e4 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -552,7 +552,8 @@ class Only(Directive): node.document = self.state.document node.line = self.lineno node['expr'] = self.arguments[0] - self.state.nested_parse(self.content, self.content_offset, node) + self.state.nested_parse(self.content, self.content_offset, node, + match_titles=1) return [node] From df7469b5dbfc0790b7881b53fb3f17b17eaeb160 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:48:36 +0200 Subject: [PATCH 11/13] Add Djagios. --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index f48bd8081..8df836b77 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -14,6 +14,7 @@ included, please mail to `the Google group * Cython: http://docs.cython.org/ * C\\C++ Python language binding project: http://language-binding.net/index.html * Director: http://packages.python.org/director/ +* Djagios: http://djagios.org/ * Django: http://docs.djangoproject.com/ * F2py: http://www.f2py.org/html/ * GeoDjango: http://geodjango.org/docs/ From 1bd5ec7259fc5eff21f90eae38e093517334c819 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:56:06 +0200 Subject: [PATCH 12/13] Properly format bullet lists nested in definition lists for LaTeX. --- CHANGES | 2 ++ sphinx/writers/latex.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index dc58148e7..ecfa27f6d 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Release 0.6.3 (in development) ============================== +* Properly format bullet lists nested in definition lists for LaTeX. + * Section titles are now allowed inside ``only`` directives. * #201: Make ``centered`` directive work in LaTeX output. diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index 6a12a2167..1719f22e7 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -744,7 +744,7 @@ class LaTeXTranslator(nodes.NodeVisitor): pass def visit_term(self, node): - ctx = ']' + ctx = '] \\leavevmode' if node.has_key('ids') and node['ids']: ctx += '\\hypertarget{%s}{}' % node['ids'][0] self.body.append('\\item[') From 3d062aa0421295b8f1f04edd75c838a2a182be02 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 4 Aug 2009 23:57:52 +0200 Subject: [PATCH 13/13] Whitespace cleanup. --- CHANGES | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index ecfa27f6d..820c06931 100644 --- a/CHANGES +++ b/CHANGES @@ -32,7 +32,7 @@ Release 0.6.2 (Jun 16, 2009) ``setup()`` function. * #158: Allow '..' in template names, and absolute template paths; - Jinja 2 by default disables both. + Jinja 2 by default disables both. * When highlighting Python code, ignore extra indentation before trying to parse it as Python. @@ -90,7 +90,7 @@ Release 0.6.2 (Jun 16, 2009) * #134: Fix pending_xref leftover nodes when using the todolist directive from the todo extension. - + Release 0.6.1 (Mar 26, 2009) ============================ @@ -235,7 +235,7 @@ New features added using the ``figwidth`` option and right/left alignment. * New translations: - + - Italian by Sandro Dentella. - Ukrainian by Petro Sasnyk. - Finnish by Jukka Inkeri.