merge with 0.6

This commit is contained in:
Georg Brandl
2009-08-05 00:04:39 +02:00
9 changed files with 61 additions and 21 deletions

10
CHANGES
View File

@@ -42,6 +42,10 @@ Release 1.0 (in development)
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.
* #206: Refuse to overwrite an existing master document in
@@ -69,7 +73,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.
@@ -127,7 +131,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)
============================
@@ -272,7 +276,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.

View File

@@ -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/
@@ -23,10 +24,12 @@ 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
* 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/
@@ -35,6 +38,7 @@ included, please mail to `the Google group
* NumPy: http://docs.scipy.org/doc/numpy/reference/
* ObjectListView: http://objectlistview.sourceforge.net/python
* Open ERP: http://doc.openerp.com/
* OpenEXR: http://excamera.com/articles/26/doc/index.html
* OpenLayers: http://docs.openlayers.org/
* openWNS: http://docs.openwns.org/
* Paste: http://pythonpaste.org/script/
@@ -71,6 +75,7 @@ included, please mail to `the Google group
* sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html
* 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/
* Werkzeug: http://werkzeug.pocoo.org/documentation/dev/

View File

@@ -31,6 +31,9 @@ to reStructuredText/Sphinx from other documentation systems.
<http://svn.python.org/projects/doctools/converter>`_. 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 <http://code.google.com/p/db2rst/>`_.
Prerequisites
-------------

View File

@@ -13,10 +13,25 @@ import sys
from os import path
__version__ = '1.0pre'
__released__ = '1.0 (hg)'
__released__ = '1.0 (hg)' # 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):

View File

@@ -89,7 +89,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

View File

@@ -485,7 +485,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]

View File

@@ -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
@@ -1406,35 +1405,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)
@@ -1442,8 +1441,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)
@@ -1457,7 +1463,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:
@@ -1475,12 +1481,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

View File

@@ -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

View File

@@ -751,7 +751,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[')