merge with trunk

This commit is contained in:
Georg Brandl 2009-11-09 00:37:42 +01:00
commit 407b41536d
17 changed files with 130 additions and 76 deletions

View File

@ -43,12 +43,19 @@ Release 1.0 (in development)
* Added ``latexpdf`` target in quickstart Makefile.
* Added ``htmltitle`` block in layout template.
Release 0.6.4 (in development)
==============================
* #238: In autodoc, catch all errors that occur on module import,
not just ``ImportError``.
* Fix the handling of non-data, but non-method descriptors in autodoc.
* When copying file times, ignore OSErrors raised by ``os.utime()``.
Release 0.6.3 (Sep 03, 2009)
============================

View File

@ -6,7 +6,9 @@ experimenting with using it for their documentation. If you like to be
included, please mail to `the Google group
<http://groups.google.com/group/sphinx-dev>`_.
* Applied Mathematics at the Stellenbosch University: http://dip.sun.ac.za/
* APSW: http://apsw.googlecode.com/svn/publish/index.html
* ASE: https://wiki.fysik.dtu.dk/ase/
* boostmpi: http://documen.tician.de/boostmpi/
* Calibre: http://calibre.kovidgoyal.net/user_manual/
* Chaco: http://code.enthought.com/projects/chaco/docs/html/
@ -17,13 +19,17 @@ included, please mail to `the Google group
* Djagios: http://djagios.org/
* Django: http://docs.djangoproject.com/
* F2py: http://www.f2py.org/html/
* Fityk: http://www.unipress.waw.pl/fityk/
* GeoDjango: http://geodjango.org/docs/
* GeoServer: http://docs.geoserver.org/
* Glashammer: http://glashammer.org/
* GPAW: https://wiki.fysik.dtu.dk/gpaw/
* Grok: http://grok.zope.org/doc/current/
* GSL Shell: http://www.nongnu.org/gsl-shell/
* Hedge: http://documen.tician.de/hedge/
* IFM: http://fluffybunny.memebot.com/ifm-docs/index.html
* Jinja: http://jinja.pocoo.org/2/documentation/
* Kaa: http://doc.freevo.org/api/kaa/
* LEPL: http://www.acooke.org/lepl/
* MapServer: http://mapserver.org/
* Matplotlib: http://matplotlib.sourceforge.net/

View File

@ -58,6 +58,7 @@
</p>
<h2>Documentation</h2>
<table class="contentstable" align="center" style="margin-left: 30px"><tr>
<td width="50%">
<p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">Contents</a><br/>
@ -72,6 +73,14 @@
</td></tr>
</table>
<p>You may also be interested in the very nice
<a href="http://matplotlib.sourceforge.net/sampledoc/">tutorial</a> on how to
create a customized documentation using Sphinx written by the matplotlib
developers.</p>
<p>There is a <a href="http://sphinx.shibu.jp/">Japanese translation</a>
of this documentation, thanks to Yoshiki Shibukawa.</p>
<h2>Get Sphinx</h2>
<p>
Sphinx is available as an <a

View File

@ -84,6 +84,11 @@ The builder's "name" must be given to the **-b** command-line option of
Its name is ``latex``.
Note that a direct PDF builder using ReportLab is available in `rst2pdf
<http://rst2pdf.googlecode.com>`_ version 0.12 or greater. You need to add
``'rst2pdf.pdfbuilder'`` to your :confval:`extensions` to enable it, its name is
``pdf``.
.. module:: sphinx.builders.text
.. class:: TextBuilder

View File

@ -37,10 +37,20 @@ New config values are:
A dictionary of graphviz graph attributes for inheritance diagrams.
For example::
inheritance_graph_attrs = dict(rankdir="LR", size='"6.0, 8.0"',
fontsize=14, ratio='compress')
.. confval:: inheritance_node_attrs
A dictionary of graphviz node attributes for inheritance diagrams.
For example::
inheritance_node_attrs = dict(shape='ellipse', fontsize=14, height=0.75,
color='dodgerblue1', style='filled')
.. confval:: inheritance_edge_attrs
A dictionary of graphviz edge attributes for inheritance diagrams.

View File

@ -9,6 +9,11 @@ suggest new entries!
How do I...
-----------
... create PDF files without LaTeX?
You can use `rst2pdf <http://rst2pdf.googlecode.com>`_ version 0.12 or greater
which comes with built-in Sphinx integration. See the :ref:`builders`
section for details.
... get section numbers?
They are automatic in LaTeX output; for HTML, give a ``:numbered:`` option to
the :dir:`toctree` directive where you want to start numbering.

View File

@ -489,9 +489,6 @@ class PythonDomain(Domain):
self.data['modules'].get(target, ('','','', ''))
if not docname:
return None
elif docname == fromdocname:
# don't link to self
return contnode
else:
title = '%s%s%s' % ((platform and '(%s) ' % platform),
synopsis,

View File

@ -322,7 +322,9 @@ class Documenter(object):
obj = self.get_attr(obj, part)
self.object = obj
return True
except (SyntaxError, ImportError, AttributeError), err:
# this used to only catch SyntaxError, ImportError and AttributeError,
# but importing modules with side effects can raise all kinds of errors
except Exception, err:
self.directive.warn(
'autodoc can\'t import/find %s %r, it reported error: '
'"%s", please check your spelling and sys.path' %

View File

@ -13,7 +13,7 @@
from docutils import nodes
from sphinx.application import ExtensionError
from sphinx.ext.mathbase import setup as mathbase_setup
from sphinx.ext.mathbase import setup_math as mathbase_setup
def html_visit_math(self, node):

View File

@ -132,7 +132,7 @@ def number_equations(app, doctree, docname):
node[0] = nodes.Text(num, num)
def setup(app, htmlinlinevisitors, htmldisplayvisitors):
def setup_math(app, htmlinlinevisitors, htmldisplayvisitors):
app.add_node(math,
latex=(latex_visit_math, None),
text=(text_visit_math, None),

View File

@ -25,7 +25,7 @@ from docutils import nodes
from sphinx.errors import SphinxError
from sphinx.util import ensuredir
from sphinx.util.png import read_png_depth, write_png_depth
from sphinx.ext.mathbase import setup as mathbase_setup, wrap_displaymath
from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath
class MathExtError(SphinxError):
category = 'Math extension error'

View File

@ -12,9 +12,14 @@
import sys
import cgi
import re
import parser
import textwrap
try:
import parser
except ImportError:
# parser is not available on Jython
parser = None
from sphinx.util.texescape import tex_hl_escape_map
try:
@ -158,6 +163,9 @@ class PygmentsBridge(object):
# just replace all non-ASCII characters.
src = src.encode('ascii', 'replace')
if parser is None:
return True
try:
parser.suite(src)
except parsing_exceptions:

View File

@ -1 +1 @@
Documentation.addTranslations({"locale": "nl", "plural_expr": "(n != 1)", "messages": {"Search Results": "Zoekresultaten", "Preparing search...": "Het zoeken wordt voorbereid", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woordencorrect gespeld zijn en dat u genoeg categori\u00ebn hebt geselecteerd.", "Search finished, found %s page(s) matching the search query.": "Zoeken voltooid, %s pagina(s) gevonden.", ", in ": "", "Permalink to this headline": "Permanente link naar deze titel", "Searching": "Zoeken", "Permalink to this definition": "Permanente link naar deze definitie", "module, in ": "module", "Hide Search Matches": "Zoekresultaten verbergen"}});
Documentation.addTranslations({"locale": "nl", "plural_expr": "(n != 1)", "messages": {"Search Results": "Zoekresultaten", "Preparing search...": "Het zoeken wordt voorbereid...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden correct gespeld zijn en dat u genoeg categori\u00ebn hebt geselecteerd.", "Search finished, found %s page(s) matching the search query.": "Zoeken voltooid, %s pagina(s) gevonden.", ", in ": ", in ", "Permalink to this headline": "Permanente link naar deze titel", "Searching": "Zoeken", "Permalink to this definition": "Permanente link naar deze definitie", "module, in ": "module, in", "Hide Search Matches": "Zoekresultaten verbergen"}});

View File

@ -6,42 +6,49 @@ msgid ""
msgstr ""
"Project-Id-Version: Sphinx 0.5\n"
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
"POT-Creation-Date: 2008-09-11 23:58+0200\n"
"PO-Revision-Date: 2009-08-06 23:04+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2009-08-06 23:04+0200\n"
"PO-Revision-Date: 2009-11-03 15:55+0100\n"
"Last-Translator: Marijn van der Zee <marijn.vanderzee@gmail.com>\n"
"Language-Team: nl <LL@li.org>\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"Generated-By: Babel 0.9.4\n"
#: sphinx/environment.py:103 sphinx/writers/latex.py:184
#: sphinx/environment.py:103
#: sphinx/writers/latex.py:184
#, python-format
msgid "%B %d, %Y"
msgstr "%d. %B %Y"
#: sphinx/environment.py:324 sphinx/themes/basic/genindex-single.html:2
#: sphinx/environment.py:324
#: sphinx/themes/basic/genindex-single.html:2
#: sphinx/themes/basic/genindex-split.html:2
#: sphinx/themes/basic/genindex-split.html:5
#: sphinx/themes/basic/genindex.html:2 sphinx/themes/basic/genindex.html:5
#: sphinx/themes/basic/genindex.html:48 sphinx/themes/basic/layout.html:134
#: sphinx/themes/basic/genindex.html:2
#: sphinx/themes/basic/genindex.html:5
#: sphinx/themes/basic/genindex.html:48
#: sphinx/themes/basic/layout.html:134
#: sphinx/writers/latex.py:190
msgid "Index"
msgstr "Index"
#: sphinx/environment.py:325 sphinx/writers/latex.py:189
#: sphinx/environment.py:325
#: sphinx/writers/latex.py:189
msgid "Module Index"
msgstr "Module-index"
#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
#: sphinx/environment.py:326
#: sphinx/themes/basic/defindex.html:16
msgid "Search Page"
msgstr "Zoekpagina"
#: sphinx/roles.py:55 sphinx/directives/desc.py:747
#: sphinx/roles.py:55
#: sphinx/directives/desc.py:747
#, python-format
msgid "environment variable; %s"
msgstr "Omgevingsvariabele; %s"
msgstr "omgevingsvariabele; %s"
#: sphinx/roles.py:62
#, python-format
@ -61,7 +68,8 @@ msgstr "Moduleniveau"
msgid "%b %d, %Y"
msgstr "%d.%b.%Y"
#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
#: sphinx/builders/html.py:241
#: sphinx/themes/basic/defindex.html:21
msgid "General Index"
msgstr "Algemene index"
@ -69,9 +77,12 @@ msgstr "Algemene index"
msgid "index"
msgstr "Index"
#: sphinx/builders/html.py:243 sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133 sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2 sphinx/themes/basic/modindex.html:13
#: sphinx/builders/html.py:243
#: sphinx/builders/htmlhelp.py:219
#: sphinx/builders/qthelp.py:133
#: sphinx/themes/basic/defindex.html:19
#: sphinx/themes/basic/modindex.html:2
#: sphinx/themes/basic/modindex.html:13
msgid "Global Module Index"
msgstr "Globale Module-index"
@ -108,9 +119,8 @@ msgid "Return type"
msgstr "Return type"
#: sphinx/directives/desc.py:186
#, fuzzy
msgid "Parameter"
msgstr "Parameters"
msgstr "Parameter"
#: sphinx/directives/desc.py:190
msgid "Parameters"
@ -121,7 +131,8 @@ msgstr "Parameters"
msgid "%s() (built-in function)"
msgstr "%s() (geïntegreerde functie)"
#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
#: sphinx/directives/desc.py:419
#: sphinx/directives/desc.py:476
#: sphinx/directives/desc.py:488
#, python-format
msgid "%s() (in module %s)"
@ -132,15 +143,16 @@ msgstr "%s() (in module %s)"
msgid "%s (built-in variable)"
msgstr "%s (geïntegreerde variabele)"
#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
#: sphinx/directives/desc.py:423
#: sphinx/directives/desc.py:514
#, python-format
msgid "%s (in module %s)"
msgstr "%s (in module %s)"
#: sphinx/directives/desc.py:439
#, fuzzy, python-format
#, python-format
msgid "%s (built-in class)"
msgstr "%s (geïntegreerde variabele)"
msgstr "%s (geïntegreerde klasse)"
#: sphinx/directives/desc.py:440
#, python-format
@ -203,9 +215,9 @@ msgid "%s (C variable)"
msgstr "%s (C-variabele)"
#: sphinx/directives/desc.py:665
#, fuzzy, python-format
#, python-format
msgid "%scommand line option; %s"
msgstr "%scommandolijn optie; %s"
msgstr "%sopdrachtregel optie; %s"
#: sphinx/directives/other.py:140
msgid "Platforms: "
@ -244,16 +256,16 @@ msgstr ""
#: sphinx/ext/todo.py:41
msgid "Todo"
msgstr ""
msgstr "Te doen"
#: sphinx/ext/todo.py:99
#, python-format
msgid "(The original entry is located in %s, line %d and can be found "
msgstr ""
msgstr "(Het originele item is te vinden in %s, regel %d en kan gevonden worden hier"
#: sphinx/ext/todo.py:105
msgid "here"
msgstr ""
msgstr "hier"
#: sphinx/locale/__init__.py:15
msgid "Attention"
@ -285,7 +297,7 @@ msgstr "Notitie"
#: sphinx/locale/__init__.py:22
msgid "See Also"
msgstr "Zie Ook"
msgstr "Zie ook"
#: sphinx/locale/__init__.py:23
msgid "Tip"
@ -348,7 +360,7 @@ msgstr "Indices en tabellen:"
#: sphinx/themes/basic/defindex.html:14
msgid "Complete Table of Contents"
msgstr "Volledige inhoudstafel"
msgstr "Volledige inhoudsopgave"
#: sphinx/themes/basic/defindex.html:15
msgid "lists all sections and subsections"
@ -392,7 +404,7 @@ msgstr "Navigatie"
#: sphinx/themes/basic/layout.html:42
msgid "Table Of Contents"
msgstr "Inhoudstafel"
msgstr "Inhoudsopgave"
#: sphinx/themes/basic/layout.html:48
msgid "Previous topic"
@ -412,7 +424,7 @@ msgstr "volgend hoofdstuk"
#: sphinx/themes/basic/layout.html:60
msgid "This Page"
msgstr "Deze Pagina"
msgstr "Deze pagina"
#: sphinx/themes/basic/layout.html:63
msgid "Show Source"
@ -424,12 +436,11 @@ msgstr "Snel zoeken"
#: sphinx/themes/basic/layout.html:76
msgid "Go"
msgstr "Go"
msgstr "Ga"
#: sphinx/themes/basic/layout.html:81
#, fuzzy
msgid "Enter search terms or a module, class or function name."
msgstr "Geef de naam van een module, klasse of functie."
msgstr "Geef zoekterm of de naam van een module, klasse of functie."
#: sphinx/themes/basic/layout.html:122
#, python-format
@ -440,7 +451,8 @@ msgstr "Zoeken in %(docstitle)s"
msgid "About these documents"
msgstr "Over deze documenten"
#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/layout.html:137
#: sphinx/themes/basic/search.html:2
#: sphinx/themes/basic/search.html:5
msgid "Search"
msgstr "Zoeken"
@ -466,12 +478,8 @@ msgstr "Laatste aanpassing op %(last_updated)s."
#: sphinx/themes/basic/layout.html:196
#, python-format
msgid ""
"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
msgstr ""
"Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
"%(sphinx_version)s."
msgid "Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
msgstr "Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
#: sphinx/themes/basic/modindex.html:36
msgid "Deprecated"
@ -486,10 +494,9 @@ msgstr "Zoeken %(docstitle)s"
msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
msgstr "Activeer JavaSscript om de zoekfunctionaliteit in te schakelen."
#: sphinx/themes/basic/search.html:14
#, fuzzy
msgid ""
"From here you can search these documents. Enter your search\n"
" words into the box below and click \"search\". Note that the search\n"
@ -497,10 +504,8 @@ msgid ""
" containing fewer words won't appear in the result list."
msgstr ""
"Hier kan u de documenten doorzoeken. Geef enkele trefwoorden\n"
" in het veld hieronder en klik \"zoeken\". Merk op dat de zoekfunctie"
"\n"
" steeds naar alle woorden zoekt. Pagina's die minder woorden bevatten"
"\n"
" in het veld hieronder en klik \"zoeken\". Merk op dat de zoekfunctie\n"
" steeds naar alle woorden zoekt. Pagina's die minder woorden bevatten\n"
" zullen niet tussen de resultaten verschijnen."
#: sphinx/themes/basic/search.html:21
@ -544,12 +549,14 @@ msgstr "Veranderingen in de C-API"
msgid "Other changes"
msgstr "Andere veranderingen"
#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
#: sphinx/themes/basic/static/doctools.js:139
#: sphinx/writers/html.py:473
#: sphinx/writers/html.py:478
msgid "Permalink to this headline"
msgstr "Permanente link naar deze titel"
#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
#: sphinx/themes/basic/static/doctools.js:145
#: sphinx/writers/html.py:80
msgid "Permalink to this definition"
msgstr "Permanente link naar deze definitie"
@ -563,24 +570,19 @@ msgstr "Zoeken"
#: sphinx/themes/basic/static/searchtools.js:279
msgid "Preparing search..."
msgstr "Het zoeken wordt voorbereid"
msgstr "Het zoeken wordt voorbereid..."
#: sphinx/themes/basic/static/searchtools.js:347
#, fuzzy
msgid "module, in "
msgstr "module"
msgstr "module, in"
#: sphinx/themes/basic/static/searchtools.js:356
msgid ", in "
msgstr ""
msgstr ", in "
#: sphinx/themes/basic/static/searchtools.js:464
msgid ""
"Your search did not match any documents. Please make sure that all words "
"are spelled correctly and that you've selected enough categories."
msgstr ""
"Uw zoekopdracht leverde geen resultaten op. Controleer of alle "
"woordencorrect gespeld zijn en dat u genoeg categoriën hebt geselecteerd."
msgid "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories."
msgstr "Uw zoekopdracht leverde geen resultaten op. Controleer of alle woorden correct gespeld zijn en dat u genoeg categoriën hebt geselecteerd."
#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
@ -593,16 +595,15 @@ msgstr "Release"
#: sphinx/writers/latex.py:578
msgid "Footnotes"
msgstr ""
msgstr "Voetnoten"
#: sphinx/writers/latex.py:646
msgid "continued from previous page"
msgstr ""
msgstr "Vervolgd van vorige pagina"
#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
msgstr "Volledige index op een pagina"
msgstr "Vervolgd op volgende pagina"
#: sphinx/writers/text.py:166
#, python-format

View File

@ -93,12 +93,14 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" />
{{ metatags }}
{%- if not embedded %}
{%- if not embedded and docstitle %}
{%- set titlesuffix = " &mdash; "|safe + docstitle|e %}
{%- else %}
{%- set titlesuffix = "" %}
{%- endif %}
{%- block htmltitle %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
{%- endblock %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" />
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" />
{%- for cssfile in css_files %}

View File

@ -14,6 +14,7 @@ import re
import sys
import stat
import time
import errno
import types
import shutil
import fnmatch
@ -70,7 +71,8 @@ def ensuredir(path):
try:
os.makedirs(path)
except OSError, err:
if not err.errno == 17:
# 0 for Jython/Win32
if err.errno not in [0, getattr(errno, 'EEXIST', 0)]:
raise
@ -417,7 +419,7 @@ def copyfile(source, dest):
try:
# don't do full copystat because the source may be read-only
copytimes(source, dest)
except shutil.Error:
except OSError:
pass