summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-05-24 11:56:48 +0200
committerGeorg Brandl <georg@python.org>2010-05-24 11:56:48 +0200
commitbfc13ad26a4eacd0396942cf4b94bda8bffe2549 (patch)
treefbb77e5b442055d23e2b59f0657bc5c63d7a8e1f
parentf2b4c62a84a0b8e4fad7c271506d865d804bfdcc (diff)
parent1967a8fdae3b189d8a4fec00121e18732b818c97 (diff)
downloadsphinx-bfc13ad26a4eacd0396942cf4b94bda8bffe2549.tar.gz
null-merge rev d4fe9e7df03a from http://bitbucket.org/tpowers/sphinx/
-rw-r--r--AUTHORS1
-rw-r--r--CHANGES28
-rw-r--r--EXAMPLES6
-rw-r--r--doc/Makefile5
-rw-r--r--doc/_templates/index.html2
-rw-r--r--doc/config.rst10
-rw-r--r--doc/domains.rst4
-rw-r--r--doc/ext/intersphinx.rst67
-rw-r--r--doc/intro.rst3
-rw-r--r--setup.py9
-rw-r--r--sphinx/builders/html.py38
-rw-r--r--sphinx/builders/htmlhelp.py9
-rw-r--r--sphinx/builders/linkcheck.py4
-rw-r--r--sphinx/builders/qthelp.py82
-rw-r--r--sphinx/config.py2
-rw-r--r--sphinx/directives/code.py4
-rw-r--r--sphinx/domains/__init__.py18
-rw-r--r--sphinx/domains/c.py12
-rw-r--r--sphinx/domains/cpp.py13
-rw-r--r--sphinx/domains/javascript.py11
-rw-r--r--sphinx/domains/python.py7
-rw-r--r--sphinx/domains/rst.py6
-rw-r--r--sphinx/domains/std.py128
-rw-r--r--sphinx/environment.py107
-rw-r--r--sphinx/ext/intersphinx.py63
-rw-r--r--sphinx/ext/pngmath.py10
-rw-r--r--sphinx/locale/__init__.py3
-rw-r--r--sphinx/locale/ca/LC_MESSAGES/sphinx.mobin8114 -> 8114 bytes
-rw-r--r--sphinx/locale/cs/LC_MESSAGES/sphinx.mobin7926 -> 7926 bytes
-rw-r--r--sphinx/locale/de/LC_MESSAGES/sphinx.mobin8276 -> 8276 bytes
-rw-r--r--sphinx/locale/es/LC_MESSAGES/sphinx.mobin6919 -> 6919 bytes
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.mobin7599 -> 7644 bytes
-rw-r--r--sphinx/locale/fi/LC_MESSAGES/sphinx.po4
-rw-r--r--sphinx/locale/fr/LC_MESSAGES/sphinx.mobin7626 -> 7626 bytes
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.js1
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.mobin0 -> 8133 bytes
-rw-r--r--sphinx/locale/hr/LC_MESSAGES/sphinx.po606
-rw-r--r--sphinx/locale/it/LC_MESSAGES/sphinx.mobin8243 -> 8243 bytes
-rw-r--r--sphinx/locale/ja/LC_MESSAGES/sphinx.mobin7647 -> 7647 bytes
-rw-r--r--sphinx/locale/nl/LC_MESSAGES/sphinx.mobin8159 -> 8159 bytes
-rw-r--r--sphinx/locale/pl/LC_MESSAGES/sphinx.mobin8291 -> 8291 bytes
-rw-r--r--sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mobin7582 -> 7582 bytes
-rw-r--r--sphinx/locale/ru/LC_MESSAGES/sphinx.mobin10230 -> 10230 bytes
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.mobin8046 -> 8056 bytes
-rw-r--r--sphinx/locale/sl/LC_MESSAGES/sphinx.po54
-rw-r--r--sphinx/locale/tr/LC_MESSAGES/sphinx.mobin8333 -> 8333 bytes
-rw-r--r--sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mobin9911 -> 9911 bytes
-rw-r--r--sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mobin7657 -> 7657 bytes
-rw-r--r--sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mobin7732 -> 7732 bytes
-rw-r--r--sphinx/quickstart.py4
-rw-r--r--sphinx/roles.py31
-rw-r--r--sphinx/search.py7
-rw-r--r--sphinx/setup_command.py18
-rw-r--r--sphinx/texinputs/sphinxhowto.cls8
-rw-r--r--sphinx/texinputs/sphinxmanual.cls9
-rw-r--r--sphinx/themes/basic/static/basic.css22
-rw-r--r--sphinx/themes/basic/static/searchtools.js12
-rw-r--r--sphinx/writers/latex.py18
-rw-r--r--tests/root/conf.py2
-rw-r--r--tests/test_intersphinx.py18
60 files changed, 1115 insertions, 351 deletions
diff --git a/AUTHORS b/AUTHORS
index 135b931e..92deb791 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -27,6 +27,7 @@ Other contributors, listed alphabetically, are:
* Antonio Valentino -- qthelp builder
* Pauli Virtanen -- autodoc improvements, autosummary extension
* Stefan van der Walt -- autosummary extension
+* Barry Warsaw -- setup command improvements
* Sebastian Wiesner -- image handling, distutils support
Many thanks for all contributions!
diff --git a/CHANGES b/CHANGES
index abf8afdf..39ae924b 100644
--- a/CHANGES
+++ b/CHANGES
@@ -8,8 +8,15 @@ Release 1.0 (in development)
* Added a JavaScript domain.
+* Added a reStructuredText domain.
+
+* Added a way for intersphinx to refer to named labels in other
+ projects, and to specify the project you want to link to.
+
* Support for docutils 0.4 has been removed.
+* Added Croatian translation, thanks to Bojan Mihelač.
+
* Added a manual page builder.
* Added support for source ordering of members in autodoc, with
@@ -133,6 +140,27 @@ Release 1.0 (in development)
Release 0.6.6 (in development)
==============================
+* Fix a problem the Qt help project generated by the ``qthelp``
+ builder that would lead to no content being displayed in the Qt
+ Assistant.
+
+* #393: Fix the usage of Unicode characters in mathematic formulas
+ when using the ``pngmath`` extension.
+
+* #404: Make ``\and`` work properly in the author field of the
+ ``latex_documents`` setting.
+
+* #409: Make the ``highlight_language`` config value work properly
+ in the LaTeX builder.
+
+* #418: Allow relocation of the translation JavaScript files to
+ the system directory on Unix systems.
+
+* #414: Fix handling of Windows newlines in files included with
+ the ``literalinclude`` directive.
+
+* #377: Fix crash in linkcheck builder.
+
* #387: Fix the display of search results in ``dirhtml`` output.
* #376: In autodoc, fix display of parameter defaults containing
diff --git a/EXAMPLES b/EXAMPLES
index 0be237a5..764d0de0 100644
--- a/EXAMPLES
+++ b/EXAMPLES
@@ -14,7 +14,6 @@ Documentation using the default theme
* APSW: http://apsw.googlecode.com/svn/publish/index.html
* ASE: https://wiki.fysik.dtu.dk/ase/
-* Blender: http://www.blender.org/documentation/250PythonDoc/
* boostmpi: http://documen.tician.de/boostmpi/
* Calibre: http://calibre.kovidgoyal.net/user_manual/
* CodePy: http://documen.tician.de/codepy/
@@ -86,6 +85,7 @@ Documentation using the sphinxdoc theme
* Matplotlib: http://matplotlib.sourceforge.net/
* MyHDL: http://www.myhdl.org/doc/0.6/
* NetworkX: http://networkx.lanl.gov/
+* Pweave: http://mpastell.com/pweave/
* Pysparse: http://pysparse.sourceforge.net/
* PyTango:
http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html
@@ -113,8 +113,12 @@ Documentation using another builtin theme
Documentation using a custom theme/integrated in a site
-------------------------------------------------------
+* Blender: http://www.blender.org/documentation/250PythonDoc/
* Blinker: http://discorporate.us/projects/Blinker/docs/
+* Classy: classy: http://classy.pocoo.org/
* Django: http://docs.djangoproject.com/
+* Flask: http://flask.pocoo.org/docs/
+* Flask-OpenID: http://packages.python.org/Flask-OpenID/
* GeoServer: http://docs.geoserver.org/
* Glashammer: http://glashammer.org/
* MirrorBrain: http://mirrorbrain.org/docs/
diff --git a/doc/Makefile b/doc/Makefile
index 48a66ed1..d6a0cf72 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -18,6 +18,7 @@ help:
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files called index.html in directories"
@echo " pickle to make pickle files"
+ @echo " json to make json files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " epub to make an epub file"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@@ -56,6 +57,10 @@ man:
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) _build/pickle
+json:
+ mkdir -p _build/json _build/doctrees
+ $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) _build/json
+
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) _build/htmlhelp
@echo
diff --git a/doc/_templates/index.html b/doc/_templates/index.html
index 082a1f87..524b2ffb 100644
--- a/doc/_templates/index.html
+++ b/doc/_templates/index.html
@@ -83,7 +83,7 @@
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>
+ <p>There is a <a href="http://sphinx-users.jp/doc10/">Japanese translation</a>
of this documentation, thanks to Yoshiki Shibukawa.</p>
<h2>Get Sphinx</h2>
diff --git a/doc/config.rst b/doc/config.rst
index d00c55f1..126679d1 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -192,12 +192,17 @@ General configuration
.. versionadded:: 1.0
-.. confval:: default_domain
+.. confval:: primary_domain
.. index:: default; domain
+ primary; domain
The name of the default :ref:`domain <domains>`. Can also be ``None`` to
- disable a default domain. The default is ``'py'``.
+ disable a default domain. The default is ``'py'``. Those objects in other
+ domains (whether the domain name is given explicitly, or selected by a
+ :dir:`default-domain` directive) will have the domain name explicitly
+ prepended when named (e.g., when the default domain is C, Python functions
+ will be named "Python function", not just "function").
.. versionadded:: 1.0
@@ -285,6 +290,7 @@ Project information
* ``es`` -- Spanish
* ``fi`` -- Finnish
* ``fr`` -- French
+ * ``hr`` -- Croatian
* ``it`` -- Italian
* ``nl`` -- Dutch
* ``pl`` -- Polish
diff --git a/doc/domains.rst b/doc/domains.rst
index 0f62f176..161a81de 100644
--- a/doc/domains.rst
+++ b/doc/domains.rst
@@ -69,11 +69,11 @@ directive name.
To avoid having to writing the domain name all the time when you e.g. only
describe Python objects, a default domain can be selected with either the config
-value :confval:`default_domain` or this directive:
+value :confval:`primary_domain` or this directive:
.. rst:directive:: .. default-domain:: name
- Select a new default domain. While the :confval:`default_domain` selects a
+ Select a new default domain. While the :confval:`primary_domain` selects a
global default, this only has an effect within the same file.
If no other default is selected, the Python domain (named ``py``) is the default
diff --git a/doc/ext/intersphinx.rst b/doc/ext/intersphinx.rst
index b82a08f1..29b4057f 100644
--- a/doc/ext/intersphinx.rst
+++ b/doc/ext/intersphinx.rst
@@ -8,17 +8,16 @@
.. versionadded:: 0.5
-This extension can generate automatic links to the documentation of Python
-objects in other projects. This works as follows:
+This extension can generate automatic links to the documentation of objects in
+other projects. This works as follows:
-* Each Sphinx HTML build creates a file named :file:`objects.inv` that
- contains a mapping from Python identifiers to URIs relative to the HTML set's
- root.
+* Each Sphinx HTML build creates a file named :file:`objects.inv` that contains
+ a mapping from object names to URIs relative to the HTML set's root.
* Projects using the Intersphinx extension can specify the location of such
mapping files in the :confval:`intersphinx_mapping` config value. The mapping
- will then be used to resolve otherwise missing references to Python objects
- into links to the other documentation.
+ will then be used to resolve otherwise missing references to objects into
+ links to the other documentation.
* By default, the mapping file is assumed to be at the same location as the rest
of the documentation; however, the location of the mapping file can also be
@@ -31,37 +30,63 @@ linking:
.. confval:: intersphinx_mapping
+ This config value contains the locations and names of other projects that
+ should be linked to in this documentation.
+
+ Relative local paths for target locations are taken as relative to the base
+ of the built documentation, while relative local paths for inventory
+ locations are taken as relative to the source directory.
+
+ When fetching remote inventory files, proxy settings will be read from
+ the ``$HTTP_PROXY`` environment variable.
+
+ **Old format for this config value**
+
+ This is the format used before Sphinx 1.0. It is still recognized.
+
A dictionary mapping URIs to either ``None`` or an URI. The keys are the
base URI of the foreign Sphinx documentation sets and can be local paths or
HTTP URIs. The values indicate where the inventory file can be found: they
can be ``None`` (at the same location as the base URI) or another local or
HTTP URI.
- Relative local paths in the keys are taken as relative to the base of the
- built documentation, while relative local paths in the values are taken as
- relative to the source directory.
+ **New format for this config value**
- An example, to add links to modules and objects in the Python standard
- library documentation::
+ .. versionadded:: 1.0
- intersphinx_mapping = {'http://docs.python.org/dev': None}
+ A dictionary mapping unique identifiers to a tuple ``(target, inventory)``.
+ Each ``target`` is the base URI of a foreign Sphinx documentation set and can
+ be a local path or an HTTP URI. The ``inventory`` indicates where the
+ inventory file can be found: it can be ``None`` (at the same location as
+ the base URI) or another local or HTTP URI.
+
+ The unique identifier can be used to prefix cross-reference targets, so that
+ it is clear which intersphinx set the target belongs to. A link like
+ ``:ref:`comparison manual <python:comparisons>``` will link to the label
+ "comparisons" in the doc set "python", if it exists.
+
+ **Example**
+
+ To add links to modules and objects in the Python standard library
+ documentation, use::
+
+ intersphinx_mapping = {'python': ('http://docs.python.org/', None)}
This will download the corresponding :file:`objects.inv` file from the
Internet and generate links to the pages under the given URI. The downloaded
inventory is cached in the Sphinx environment, so it must be redownloaded
whenever you do a full rebuild.
- A second example, showing the meaning of a non-``None`` value::
+ A second example, showing the meaning of a non-``None`` value of the second
+ tuple item::
- intersphinx_mapping = {'http://docs.python.org/dev': 'python-inv.txt'}
+ intersphinx_mapping = {'python': ('http://docs.python.org/',
+ 'python-inv.txt')}
- This will read the inventory from :file:`python.inv` in the source
+ This will read the inventory from :file:`python-inv.txt` in the source
directory, but still generate links to the pages under
- ``http://docs.python.org/dev``. It is up to you to update the inventory file
- as new objects are added to the Python documentation.
-
- When fetching remote inventory files, proxy settings will be read from
- the ``$HTTP_PROXY`` environment variable.
+ ``http://docs.python.org/``. It is up to you to update the inventory file as
+ new objects are added to the Python documentation.
.. confval:: intersphinx_cache_limit
diff --git a/doc/intro.rst b/doc/intro.rst
index 600493c9..33f97a3f 100644
--- a/doc/intro.rst
+++ b/doc/intro.rst
@@ -8,7 +8,8 @@ you have a directory containing a bunch of reST-formatted documents (and
possibly subdirectories of docs in there as well), Sphinx can generate a
nicely-organized arrangement of HTML files (in some other directory) for easy
browsing and navigation. But from the same source, it can also generate a
-LaTeX file that you can compile into a PDF version of the documents.
+LaTeX file that you can compile into a PDF version of the documents, or a
+PDF file directly using `rst2pdf <http://rst2pdf.googlecode.com>`_.
The focus is on hand-written documentation, rather than auto-generated API docs.
Though there is support for that kind of docs as well (which is intended to be
diff --git a/setup.py b/setup.py
index b2c96f48..fbc622a9 100644
--- a/setup.py
+++ b/setup.py
@@ -1,10 +1,13 @@
# -*- coding: utf-8 -*-
-import ez_setup
-ez_setup.use_setuptools()
+try:
+ from setuptools import setup, find_packages
+except ImportError:
+ import ez_setup
+ ez_setup.use_setuptools()
+ from setuptools import setup, find_packages
import os
import sys
-from setuptools import setup, find_packages
from distutils import log
import sphinx
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 7d6a1f52..2dbca037 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -10,6 +10,7 @@
"""
import os
+import sys
import zlib
import codecs
import posixpath
@@ -107,10 +108,15 @@ class StandaloneHTMLBuilder(Builder):
self.link_suffix = self.out_suffix
if self.config.language is not None:
- jsfile = path.join(package_dir, 'locale', self.config.language,
- 'LC_MESSAGES', 'sphinx.js')
- if path.isfile(jsfile):
- self.script_files.append('_static/translations.js')
+ jsfile_list = [path.join(package_dir, 'locale',
+ self.config.language, 'LC_MESSAGES', 'sphinx.js'),
+ path.join(sys.prefix, 'share/sphinx/locale',
+ self.config.language, 'sphinx.js')]
+
+ for jsfile in jsfile_list:
+ if path.isfile(jsfile):
+ self.script_files.append('_static/translations.js')
+ break
def get_theme_config(self):
return self.config.html_theme, self.config.html_theme_options
@@ -526,11 +532,15 @@ class StandaloneHTMLBuilder(Builder):
f.close()
# then, copy translations JavaScript file
if self.config.language is not None:
- jsfile = path.join(package_dir, 'locale', self.config.language,
- 'LC_MESSAGES', 'sphinx.js')
- if path.isfile(jsfile):
- copyfile(jsfile, path.join(self.outdir, '_static',
- 'translations.js'))
+ jsfile_list = [path.join(package_dir, 'locale',
+ self.config.language, 'LC_MESSAGES', 'sphinx.js'),
+ path.join(sys.prefix, 'share/sphinx/locale',
+ self.config.language, 'sphinx.js')]
+ for jsfile in jsfile_list:
+ if path.isfile(jsfile):
+ copyfile(jsfile, path.join(self.outdir, '_static',
+ 'translations.js'))
+ break
# then, copy over theme-supplied static files
if self.theme:
themeentries = [path.join(themepath, 'static')
@@ -732,13 +742,17 @@ class StandaloneHTMLBuilder(Builder):
f.write('# The remainder of this file is compressed using zlib.\n')
compressor = zlib.compressobj(9)
for domainname, domain in self.env.domains.iteritems():
- for name, type, docname, anchor, prio in domain.get_objects():
+ for name, dispname, type, docname, anchor, prio in \
+ domain.get_objects():
if anchor.endswith(name):
# this can shorten the inventory by as much as 25%
anchor = anchor[:-len(name)] + '$'
+ uri = self.get_target_uri(docname) + '#' + anchor
+ if dispname == name:
+ dispname = '-'
f.write(compressor.compress(
- '%s %s:%s %s %s\n' % (name, domainname, type, prio,
- self.get_target_uri(docname) + '#' + anchor)))
+ '%s %s:%s %s %s %s\n' % (name, domainname, type, prio,
+ uri, dispname)))
f.write(compressor.flush())
finally:
f.close()
diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py
index 9bbe0a5d..538f4c84 100644
--- a/sphinx/builders/htmlhelp.py
+++ b/sphinx/builders/htmlhelp.py
@@ -18,7 +18,6 @@ from os import path
from docutils import nodes
from sphinx import addnodes
-from sphinx.locale import _
from sphinx.builders.html import StandaloneHTMLBuilder
@@ -58,7 +57,7 @@ from sphinx.builders.html import StandaloneHTMLBuilder
project_template = '''\
[OPTIONS]
-Binary TOC=Yes
+Binary TOC=No
Binary Index=No
Compiled file=%(outname)s.chm
Contents file=%(outname)s.hhc
@@ -217,9 +216,9 @@ class HTMLHelpBuilder(StandaloneHTMLBuilder):
# special books
f.write('<LI> ' + object_sitemap % (self.config.html_short_title,
'index.html'))
- for index in self.domain_indices:
- f.write('<LI> ' + object_sitemap % (index[2],
- '%s-%s.html' % index[0:2]))
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ f.write('<LI> ' + object_sitemap % (indexcls.localname,
+ '%s.html' % indexname))
# the TOC
tocdoc = self.env.get_and_resolve_doctree(
self.config.master_doc, self, prune_toctrees=False)
diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py
index 3f9f16d9..c9bc363d 100644
--- a/sphinx/builders/linkcheck.py
+++ b/sphinx/builders/linkcheck.py
@@ -65,8 +65,10 @@ class CheckExternalLinksBuilder(Builder):
return
lineno = None
- while lineno is None and node:
+ while lineno is None:
node = node.parent
+ if node is None:
+ break
lineno = node.line
if uri[0:5] == 'http:' or uri[0:6] == 'https:':
diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py
index 72708803..ffc52334 100644
--- a/sphinx/builders/qthelp.py
+++ b/sphinx/builders/qthelp.py
@@ -11,16 +11,17 @@
import os
import re
-import cgi
import codecs
+import posixpath
from os import path
+from cgi import escape
from docutils import nodes
from sphinx import addnodes
-from sphinx.locale import _
from sphinx.builders.html import StandaloneHTMLBuilder
+
_idpattern = re.compile(
r'(?P<title>.+) (\((?P<id>[\w\.]+)( (?P<descr>\w+))?\))$')
@@ -33,6 +34,11 @@ _idpattern = re.compile(
collection_template = u'''\
<?xml version="1.0" encoding="utf-8" ?>
<QHelpCollectionProject version="1.0">
+ <assistant>
+ <title>%(title)s</title>
+ <homePage>%(homepage)s</homePage>
+ <startPage>%(startpage)s</startPage>
+ </assistant>
<docFiles>
<generate>
<file>
@@ -53,9 +59,9 @@ collection_template = u'''\
# actual documentation files (*.html).
# In addition it defines a unique namespace for the documentation.
project_template = u'''\
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="utf-8" ?>
<QtHelpProject version="1.0">
- <namespace>%(outname)s.org.%(outname)s.%(nversion)s</namespace>
+ <namespace>%(namespace)s</namespace>
<virtualFolder>doc</virtualFolder>
<customFilter name="%(project)s %(version)s">
<filterAttribute>%(outname)s</filterAttribute>
@@ -106,17 +112,8 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
#self.config.html_style = 'traditional.css'
def handle_finish(self):
- self.build_qhcp(self.outdir, self.config.qthelp_basename)
self.build_qhp(self.outdir, self.config.qthelp_basename)
- def build_qhcp(self, outdir, outname):
- self.info('writing collection project file...')
- f = codecs.open(path.join(outdir, outname+'.qhcp'), 'w', 'utf-8')
- try:
- f.write(collection_template % {'outname': outname})
- finally:
- f.close()
-
def build_qhp(self, outdir, outname):
self.info('writing project file...')
@@ -130,9 +127,9 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
for node in tocdoc.traverse(istoctree):
sections.extend(self.write_toc(node))
- for index in self.domain_indices:
- item = section_template % {'title': index[2],
- 'ref': '%s-%s.html' % index[0:2]}
+ for indexname, indexcls, content, collapse in self.domain_indices:
+ item = section_template % {'title': indexcls.localname,
+ 'ref': '%s.html' % indexname}
sections.append(' '*4*4 + item)
sections = '\n'.join(sections)
@@ -158,24 +155,45 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
if (resourcedir and not fn.endswith('.js')) or \
fn.endswith('.html'):
filename = path.join(root, fn)[olen:]
- #filename = filename.replace(os.sep, '\\') # XXX
- projectfiles.append(file_template % {'filename': filename})
+ projectfiles.append(file_template %
+ {'filename': escape(filename)})
projectfiles = '\n'.join(projectfiles)
+ # it seems that the "namespace" may not contain non-alphanumeric
+ # characters, and more than one successive dot, or leading/trailing
+ # dots, are also forbidden
+ nspace = 'org.sphinx.%s.%s' % (outname, self.config.version)
+ nspace = re.sub('[^a-zA-Z0-9.]', '', nspace)
+ nspace = re.sub(r'\.+', '.', nspace).strip('.')
+
# write the project file
f = codecs.open(path.join(outdir, outname+'.qhp'), 'w', 'utf-8')
try:
- nversion = self.config.version.replace('.', '_')
- nversion = nversion.replace(' ', '_')
- f.write(project_template % {'outname': outname,
- 'title': self.config.html_title,
- 'version': self.config.version,
- 'project': self.config.project,
- 'nversion': nversion,
- 'masterdoc': self.config.master_doc,
- 'sections': sections,
- 'keywords': keywords,
- 'files': projectfiles})
+ f.write(project_template % {
+ 'outname': escape(outname),
+ 'title': escape(self.config.html_title),
+ 'version': escape(self.config.version),
+ 'project': escape(self.config.project),
+ 'namespace': escape(nspace),
+ 'masterdoc': escape(self.config.master_doc),
+ 'sections': sections,
+ 'keywords': keywords,
+ 'files': projectfiles})
+ finally:
+ f.close()
+
+ homepage = 'qthelp://' + posixpath.join(
+ nspace, 'doc', self.get_target_uri(self.config.master_doc))
+ startpage = 'qthelp://' + posixpath.join(nspace, 'doc', 'index.html')
+
+ self.info('writing collection project file...')
+ f = codecs.open(path.join(outdir, outname+'.qhcp'), 'w', 'utf-8')
+ try:
+ f.write(collection_template % {
+ 'outname': escape(outname),
+ 'title': escape(self.config.html_short_title),
+ 'homepage': escape(homepage),
+ 'startpage': escape(startpage)})
finally:
f.close()
@@ -197,7 +215,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
if self.isdocnode(node):
refnode = node.children[0][0]
link = refnode['refuri']
- title = cgi.escape(refnode.astext()).replace('"','&quot;')
+ title = escape(refnode.astext()).replace('"','&quot;')
item = '<section title="%(title)s" ref="%(ref)s">' % {
'title': title,
'ref': link}
@@ -210,7 +228,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
parts.extend(self.write_toc(subnode, indentlevel))
elif isinstance(node, nodes.reference):
link = node['refuri']
- title = cgi.escape(node.astext()).replace('"','&quot;')
+ title = escape(node.astext()).replace('"','&quot;')
item = section_template % {'title': title, 'ref': link}
item = ' '*4*indentlevel + item.encode('ascii', 'xmlcharrefreplace')
parts.append(item.encode('ascii', 'xmlcharrefreplace'))
@@ -247,7 +265,7 @@ class QtHelpBuilder(StandaloneHTMLBuilder):
def build_keywords(self, title, refs, subitems):
keywords = []
- title = cgi.escape(title)
+ title = escape(title)
# if len(refs) == 0: # XXX
# write_param('See Also', title)
if len(refs) == 1:
diff --git a/sphinx/config.py b/sphinx/config.py
index e9de2970..806025b9 100644
--- a/sphinx/config.py
+++ b/sphinx/config.py
@@ -61,7 +61,7 @@ class Config(object):
rst_epilog = (None, 'env'),
rst_prolog = (None, 'env'),
trim_doctest_flags = (True, 'env'),
- default_domain = ('py', 'env'),
+ primary_domain = ('py', 'env'),
needs_sphinx = (None, None),
nitpicky = (False, 'env'),
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index 5497a365..d82dd76d 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -117,8 +117,10 @@ class LiteralInclude(Directive):
line=self.lineno)]
encoding = self.options.get('encoding', env.config.source_encoding)
+ codec_info = codecs.lookup(encoding)
try:
- f = codecs.open(fn, 'rU', encoding)
+ f = codecs.StreamReaderWriter(open(fn, 'U'),
+ codec_info.streamreader, codec_info.streamwriter, 'strict')
lines = f.readlines()
f.close()
except (IOError, OSError):
diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py
index 64306b70..d133a812 100644
--- a/sphinx/domains/__init__.py
+++ b/sphinx/domains/__init__.py
@@ -11,6 +11,7 @@
"""
from sphinx.errors import SphinxError
+from sphinx.locale import _
class ObjType(object):
@@ -21,7 +22,7 @@ class ObjType(object):
Constructor arguments:
- - *lname*: localized name of the type
+ - *lname*: localized name of the type (do not include domain name)
- *roles*: all the roles that can refer to an object of this type
- *attrs*: object attributes -- currently only "searchprio" is known,
which defines the object's priority in the full-text search index,
@@ -199,6 +200,12 @@ class Domain(object):
"""
pass
+ def process_doc(self, env, docname, document):
+ """
+ Process a document after it is read by the environment.
+ """
+ pass
+
def resolve_xref(self, env, fromdocname, builder,
typ, target, node, contnode):
"""
@@ -223,6 +230,7 @@ class Domain(object):
five items:
* `name` -- fully qualified name
+ * `dispname` -- name to display when searching/linking
* `type` -- object type, a key in ``self.object_types``
* `docname` -- the document where it is to be found
* `anchor` -- the anchor name for the object
@@ -236,6 +244,14 @@ class Domain(object):
"""
return []
+ def get_type_name(self, type, primary=False):
+ """
+ Return full name for given ObjType.
+ """
+ if primary:
+ return type.lname
+ return _('%s %s') % (self.label, type.lname)
+
from sphinx.domains.c import CDomain
from sphinx.domains.cpp import CPPDomain
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
index 1edec525..c49dc284 100644
--- a/sphinx/domains/c.py
+++ b/sphinx/domains/c.py
@@ -168,11 +168,11 @@ class CDomain(Domain):
name = 'c'
label = 'C'
object_types = {
- 'function': ObjType(l_('C function'), 'func'),
- 'member': ObjType(l_('C member'), 'member'),
- 'macro': ObjType(l_('C macro'), 'macro'),
- 'type': ObjType(l_('C type'), 'type'),
- 'var': ObjType(l_('C variable'), 'data'),
+ 'function': ObjType(l_('function'), 'func'),
+ 'member': ObjType(l_('member'), 'member'),
+ 'macro': ObjType(l_('macro'), 'macro'),
+ 'type': ObjType(l_('type'), 'type'),
+ 'var': ObjType(l_('variable'), 'data'),
}
directives = {
@@ -210,4 +210,4 @@ class CDomain(Domain):
def get_objects(self):
for refname, (docname, type) in self.data['objects'].iteritems():
- yield (refname, type, docname, refname, 1)
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index 22b63953..62dec4ac 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -10,7 +10,6 @@
"""
import re
-import string
from copy import deepcopy
from docutils import nodes
@@ -22,7 +21,7 @@ from sphinx.domains import Domain, ObjType
from sphinx.directives import ObjectDescription
from sphinx.util.nodes import make_refnode
from sphinx.util.compat import Directive
-from sphinx.util.docfields import Field, TypedField
+from sphinx.util.docfields import TypedField
_identifier_re = re.compile(r'\b(~?[a-zA-Z_][a-zA-Z0-9_]*)\b')
@@ -1028,10 +1027,10 @@ class CPPDomain(Domain):
name = 'cpp'
label = 'C++'
object_types = {
- 'class': ObjType(l_('C++ class'), 'class'),
- 'function': ObjType(l_('C++ function'), 'func'),
- 'member': ObjType(l_('C++ member'), 'member'),
- 'type': ObjType(l_('C++ type'), 'type')
+ 'class': ObjType(l_('class'), 'class'),
+ 'function': ObjType(l_('function'), 'func'),
+ 'member': ObjType(l_('member'), 'member'),
+ 'type': ObjType(l_('type'), 'type')
}
directives = {
@@ -1094,4 +1093,4 @@ class CPPDomain(Domain):
def get_objects(self):
for refname, (docname, type) in self.data['objects'].iteritems():
- yield (refname, type, docname, refname, 1)
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/javascript.py b/sphinx/domains/javascript.py
index a3a4abec..31a76987 100644
--- a/sphinx/domains/javascript.py
+++ b/sphinx/domains/javascript.py
@@ -8,7 +8,6 @@
:copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
-import re
from sphinx import addnodes
from sphinx.domains import Domain, ObjType
@@ -93,7 +92,7 @@ class JSObject(ObjectDescription):
fullname = name_obj[0]
if fullname not in self.state.document.ids:
signode['names'].append(fullname)
- signode['ids'].append(fullname)
+ signode['ids'].append(fullname.replace('$', '_S_'))
signode['first'] = not self.names
self.state.document.note_explicit_target(signode)
objects = self.env.domaindata['js']['objects']
@@ -164,9 +163,9 @@ class JavaScriptDomain(Domain):
label = 'JavaScript'
# if you add a new object type make sure to edit JSObject.get_index_string
object_types = {
- 'function': ObjType(l_('JavaScript function'), 'func'),
- 'data': ObjType(l_('JavaScript data'), 'data'),
- 'attribute': ObjType(l_('JavaScript attribute'), 'attr'),
+ 'function': ObjType(l_('function'), 'func'),
+ 'data': ObjType(l_('data'), 'data'),
+ 'attribute': ObjType(l_('attribute'), 'attr'),
}
directives = {
'function': JSCallable,
@@ -215,4 +214,4 @@ class JavaScriptDomain(Domain):
def get_objects(self):
for refname, (docname, type) in self.data['objects'].iteritems():
- yield refname, type, docname, refname, 1
+ yield refname, refname, type, docname, refname, 1
diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py
index de1ab84c..b97b9b42 100644
--- a/sphinx/domains/python.py
+++ b/sphinx/domains/python.py
@@ -188,7 +188,8 @@ class PyObject(ObjectDescription):
self.env.docname,
'duplicate object description of %s, ' % fullname +
'other instance in ' +
- self.env.doc2path(objects[fullname][0]),
+ self.env.doc2path(objects[fullname][0]) +
+ ', use :noindex: for one of them',
self.lineno)
objects[fullname] = (self.env.docname, self.objtype)
@@ -616,6 +617,6 @@ class PythonDomain(Domain):
def get_objects(self):
for modname, info in self.data['modules'].iteritems():
- yield (modname, 'module', info[0], 'module-' + modname, 0)
+ yield (modname, modname, 'module', info[0], 'module-' + modname, 0)
for refname, (docname, type) in self.data['objects'].iteritems():
- yield (refname, type, docname, refname, 1)
+ yield (refname, refname, type, docname, refname, 1)
diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py
index 8578a84a..5c25e085 100644
--- a/sphinx/domains/rst.py
+++ b/sphinx/domains/rst.py
@@ -100,8 +100,8 @@ class ReSTDomain(Domain):
label = 'reStructuredText'
object_types = {
- 'directive': ObjType(l_('reStructuredText directive'), 'dir'),
- 'role': ObjType(l_('reStructuredText role'), 'role'),
+ 'directive': ObjType(l_('directive'), 'dir'),
+ 'role': ObjType(l_('role'), 'role'),
}
directives = {
'directive': ReSTDirective,
@@ -131,4 +131,4 @@ class ReSTDomain(Domain):
def get_objects(self):
for (typ, name), docname in self.data['objects'].iteritems():
- yield name, typ, docname, name, 1
+ yield name, name, typ, docname, name, 1
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 3d617e1d..3c8dff43 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -20,7 +20,7 @@ from sphinx.locale import l_, _
from sphinx.domains import Domain, ObjType
from sphinx.directives import ObjectDescription
from sphinx.util import ws_re
-from sphinx.util.nodes import make_refnode
+from sphinx.util.nodes import clean_astext, make_refnode
from sphinx.util.compat import Directive
@@ -327,6 +327,7 @@ class StandardDomain(Domain):
object_types = {
'term': ObjType(l_('glossary term'), 'term', searchprio=-1),
'token': ObjType(l_('grammar token'), 'token', searchprio=-1),
+ 'label': ObjType(l_('reference label'), 'ref', searchprio=-1),
'envvar': ObjType(l_('environment variable'), 'envvar'),
'cmdoption': ObjType(l_('program option'), 'option'),
}
@@ -340,15 +341,31 @@ class StandardDomain(Domain):
'productionlist': ProductionList,
}
roles = {
- 'option': OptionXRefRole(innernodeclass=addnodes.literal_emphasis),
- 'envvar': EnvVarXRefRole(),
- 'token': XRefRole(),
- 'term': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
+ 'option': OptionXRefRole(innernodeclass=addnodes.literal_emphasis),
+ 'envvar': EnvVarXRefRole(),
+ # links to tokens in grammar productions
+ 'token': XRefRole(),
+ # links to terms in glossary
+ 'term': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
+ # links to headings or arbitrary labels
+ 'ref': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
+ # links to labels, without a different title
+ 'keyword': XRefRole(),
}
initial_data = {
'progoptions': {}, # (program, name) -> docname, labelid
'objects': {}, # (type, name) -> docname, labelid
+ 'labels': { # labelname -> docname, labelid, sectionname
+ 'genindex': ('genindex', '', l_('Index')),
+ 'modindex': ('py-modindex', '', l_('Module Index')),
+ 'search': ('search', '', l_('Search Page')),
+ },
+ 'anonlabels': { # labelname -> docname, labelid
+ 'genindex': ('genindex', ''),
+ 'modindex': ('py-modindex', ''),
+ 'search': ('search', ''),
+ },
}
def clear_doc(self, docname):
@@ -358,10 +375,99 @@ class StandardDomain(Domain):
for key, (fn, _) in self.data['objects'].items():
if fn == docname:
del self.data['objects'][key]
+ for key, (fn, _, _) in self.data['labels'].items():
+ if fn == docname:
+ del self.data['labels'][key]
+ for key, (fn, _) in self.data['anonlabels'].items():
+ if fn == docname:
+ del self.data['anonlabels'][key]
+
+ def process_doc(self, env, docname, document):
+ labels, anonlabels = self.data['labels'], self.data['anonlabels']
+ for name, explicit in document.nametypes.iteritems():
+ if not explicit:
+ continue
+ labelid = document.nameids[name]
+ if labelid is None:
+ continue
+ node = document.ids[labelid]
+ if name.isdigit() or node.has_key('refuri') or \
+ node.tagname.startswith('desc_'):
+ # ignore footnote labels, labels automatically generated from a
+ # link and object descriptions
+ continue
+ if name in labels:
+ env.warn(docname, 'duplicate label %s, ' % name +
+ 'other instance in ' + env.doc2path(labels[name][0]),
+ node.line)
+ anonlabels[name] = docname, labelid
+ if node.tagname == 'section':
+ sectname = clean_astext(node[0]) # node[0] == title node
+ elif node.tagname == 'figure':
+ for n in node:
+ if n.tagname == 'caption':
+ sectname = clean_astext(n)
+ break
+ else:
+ continue
+ else:
+ # anonymous-only labels
+ continue
+ labels[name] = docname, labelid, sectname
def resolve_xref(self, env, fromdocname, builder,
typ, target, node, contnode):
- if typ == 'option':
+ if typ == 'ref':
+ #refdoc = node.get('refdoc', fromdocname)
+ if node['refexplicit']:
+ # reference to anonymous label; the reference uses
+ # the supplied link caption
+ docname, labelid = self.data['anonlabels'].get(target, ('',''))
+ sectname = node.astext()
+ # XXX warn somehow if not resolved by intersphinx
+ #if not docname:
+ # env.warn(refdoc, 'undefined label: %s' %
+ # target, node.line)
+ else:
+ # reference to named label; the final node will
+ # contain the section name after the label
+ docname, labelid, sectname = self.data['labels'].get(target,
+ ('','',''))
+ # XXX warn somehow if not resolved by intersphinx
+ #if not docname:
+ # env.warn(refdoc,
+ # 'undefined label: %s' % target + ' -- if you '
+ # 'don\'t give a link caption the label must '
+ # 'precede a section header.', node.line)
+ if not docname:
+ return None
+ newnode = nodes.reference('', '')
+ innernode = nodes.emphasis(sectname, sectname)
+ if docname == fromdocname:
+ newnode['refid'] = labelid
+ else:
+ # set more info in contnode; in case the
+ # get_relative_uri call raises NoUri,
+ # the builder will then have to resolve these
+ contnode = addnodes.pending_xref('')
+ contnode['refdocname'] = docname
+ contnode['refsectname'] = sectname
+ newnode['refuri'] = builder.get_relative_uri(
+ fromdocname, docname)
+ if labelid:
+ newnode['refuri'] += '#' + labelid
+ newnode.append(innernode)
+ return newnode
+ elif typ == 'keyword':
+ # keywords are oddballs: they are referenced by named labels
+ docname, labelid, _ = self.data['labels'].get(target, ('','',''))
+ if not docname:
+ #env.warn(refdoc, 'unknown keyword: %s' % target)
+ return None
+ else:
+ return make_refnode(builder, fromdocname, docname,
+ labelid, contnode)
+ elif typ == 'option':
progname = node['refprogram']
docname, labelid = self.data['progoptions'].get((progname, target),
('', ''))
@@ -383,7 +489,13 @@ class StandardDomain(Domain):
def get_objects(self):
for (prog, option), info in self.data['progoptions'].iteritems():
- yield (option, 'option', info[0], info[1], 1)
+ yield (option, option, 'option', info[0], info[1], 1)
for (type, name), info in self.data['objects'].iteritems():
- yield (name, type, info[0], info[1],
+ yield (name, name, type, info[0], info[1],
self.object_types[type].attrs['searchprio'])
+ for name, info in self.data['labels'].iteritems():
+ yield (name, info[2], 'label', info[0], info[1], -1)
+
+ def get_type_name(self, type, primary=False):
+ # never prepend "Default"
+ return type.lname
diff --git a/sphinx/environment.py b/sphinx/environment.py
index c4649ae8..00761624 100644
--- a/sphinx/environment.py
+++ b/sphinx/environment.py
@@ -61,7 +61,7 @@ default_settings = {
# This is increased every time an environment attribute is added
# or changed to properly invalidate pickle files.
-ENV_VERSION = 35
+ENV_VERSION = 36
default_substitutions = set([
@@ -304,12 +304,8 @@ class BuildEnvironment:
# domain-specific inventories, here to be pickled
self.domaindata = {} # domainname -> domain-specific dict
- # X-ref target inventory
- self.labels = {} # labelname -> docname, labelid, sectionname
- self.anonlabels = {} # labelname -> docname, labelid
- self.citations = {} # citation name -> docname, labelid
-
# Other inventories
+ self.citations = {} # citation name -> docname, labelid
self.indexentries = {} # docname -> list of
# (type, string, target, aliasname)
self.versionchanges = {} # version -> list of (type, docname,
@@ -322,16 +318,6 @@ class BuildEnvironment:
# temporary data storage while reading a document
self.temp_data = {}
- # Some magically present labels
- def add_magic_label(name, description, target=None):
- self.labels[name] = (target or name, '', description)
- self.anonlabels[name] = (target or name, '')
- add_magic_label('genindex', _('Index'))
- # XXX add per domain?
- # compatibility alias
- add_magic_label('modindex', _('Module Index'), 'py-modindex')
- add_magic_label('search', _('Search Page'))
-
def set_warnfunc(self, func):
self._warnfunc = func
self.settings['warning_stream'] = WarningStream(func)
@@ -366,9 +352,6 @@ class BuildEnvironment:
fnset.discard(docname)
if not fnset:
del self.files_to_rebuild[subfn]
- for labelname, (fn, _, _) in self.labels.items():
- if fn == docname:
- del self.labels[labelname]
for key, (fn, _) in self.citations.items():
if fn == docname:
del self.citations[key]
@@ -611,7 +594,7 @@ class BuildEnvironment:
self.temp_data['docname'] = docname
# defaults to the global default, but can be re-set in a document
self.temp_data['default_domain'] = \
- self.domains.get(self.config.default_domain)
+ self.domains.get(self.config.primary_domain)
self.settings['input_encoding'] = self.config.source_encoding
self.settings['trim_footnote_reference_space'] = \
@@ -669,10 +652,11 @@ class BuildEnvironment:
self.process_metadata(docname, doctree)
self.process_refonly_bullet_lists(docname, doctree)
self.create_title_from(docname, doctree)
- self.note_labels_from(docname, doctree)
self.note_indexentries_from(docname, doctree)
self.note_citations_from(docname, doctree)
self.build_toc_from(docname, doctree)
+ for domain in self.domains.itervalues():
+ domain.process_doc(self, docname, doctree)
# allow extension-specific post-processing
if app:
@@ -949,39 +933,6 @@ class BuildEnvironment:
self.titles[docname] = titlenode
self.longtitles[docname] = longtitlenode
- def note_labels_from(self, docname, document):
- for name, explicit in document.nametypes.iteritems():
- if not explicit:
- continue
- labelid = document.nameids[name]
- if labelid is None:
- continue
- node = document.ids[labelid]
- if name.isdigit() or node.has_key('refuri') or \
- node.tagname.startswith('desc_'):
- # ignore footnote labels, labels automatically generated from a
- # link and object descriptions
- continue
- if name in self.labels:
- self.warn(docname, 'duplicate label %s, ' % name +
- 'other instance in ' +
- self.doc2path(self.labels[name][0]),
- node.line)
- self.anonlabels[name] = docname, labelid
- if node.tagname == 'section':
- sectname = clean_astext(node[0]) # node[0] == title node
- elif node.tagname == 'figure':
- for n in node:
- if n.tagname == 'caption':
- sectname = clean_astext(n)
- break
- else:
- continue
- else:
- # anonymous-only labels
- continue
- self.labels[name] = docname, labelid, sectname
-
def note_indexentries_from(self, docname, document):
entries = self.indexentries[docname] = []
for node in document.traverse(addnodes.index):
@@ -1309,44 +1260,6 @@ class BuildEnvironment:
newnode = domain.resolve_xref(self, fromdocname, builder,
typ, target, node, contnode)
# really hardwired reference types
- elif typ == 'ref':
- if node['refexplicit']:
- # reference to anonymous label; the reference uses
- # the supplied link caption
- docname, labelid = self.anonlabels.get(target, ('',''))
- sectname = node.astext()
- if not docname:
- self.warn(refdoc, 'undefined label: %s' %
- target, node.line)
- warned = True
- else:
- # reference to named label; the final node will
- # contain the section name after the label
- docname, labelid, sectname = self.labels.get(target,
- ('','',''))
- if not docname:
- self.warn(refdoc,
- 'undefined label: %s' % target + ' -- if you '
- 'don\'t give a link caption the label must '
- 'precede a section header.', node.line)
- warned = True
- if docname:
- newnode = nodes.reference('', '')
- innernode = nodes.emphasis(sectname, sectname)
- if docname == fromdocname:
- newnode['refid'] = labelid
- else:
- # set more info in contnode; in case the
- # get_relative_uri call raises NoUri,
- # the builder will then have to resolve these
- contnode = addnodes.pending_xref('')
- contnode['refdocname'] = docname
- contnode['refsectname'] = sectname
- newnode['refuri'] = builder.get_relative_uri(
- fromdocname, docname)
- if labelid:
- newnode['refuri'] += '#' + labelid
- newnode.append(innernode)
elif typ == 'doc':
# directly reference to document by source name;
# can be absolute or relative
@@ -1375,16 +1288,6 @@ class BuildEnvironment:
else:
newnode = make_refnode(builder, fromdocname, docname,
labelid, contnode)
- elif typ == 'keyword':
- # keywords are oddballs: they are referenced by named labels
- docname, labelid, _ = self.labels.get(target, ('','',''))
- if not docname:
- #self.warn(refdoc, 'unknown keyword: %s' % target)
- pass
- else:
- newnode = make_refnode(builder, fromdocname, docname,
- labelid, contnode)
-
# no new node found? try the missing-reference event
if newnode is None:
newnode = builder.app.emit_firstresult(
diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py
index 3cf64980..67773009 100644
--- a/sphinx/ext/intersphinx.py
+++ b/sphinx/ext/intersphinx.py
@@ -58,7 +58,7 @@ def read_inventory_v1(f, uri, join):
else:
type = 'py:' + type
location += '#' + name
- invdata.setdefault(type, {})[name] = (projname, version, location)
+ invdata.setdefault(type, {})[name] = (projname, version, location, '-')
return invdata
@@ -90,11 +90,12 @@ def read_inventory_v2(f, uri, join, bufsize=16*1024):
assert not buf
for line in split_lines(read_chunks()):
- name, type, prio, location = line.rstrip().split(None, 3)
+ name, type, prio, location, dispname = line.rstrip().split(None, 4)
if location.endswith('$'):
location = location[:-1] + name
location = join(uri, location)
- invdata.setdefault(type, {})[name] = (projname, version, location)
+ invdata.setdefault(type, {})[name] = (projname, version,
+ location, dispname)
return invdata
@@ -142,7 +143,15 @@ def load_mappings(app):
env.intersphinx_cache = {}
cache = env.intersphinx_cache
update = False
- for uri, inv in app.config.intersphinx_mapping.iteritems():
+ for key, value in app.config.intersphinx_mapping.iteritems():
+ if isinstance(value, tuple):
+ # new format
+ name, (uri, inv) = key, value
+ if not name.isalnum():
+ env.warn('intersphinx identifier %r is not alphanumeric' % name)
+ else:
+ # old format, no name
+ name, uri, inv = None, key, value
# we can safely assume that the uri<->inv mapping is not changed
# during partial rebuilds since a changed intersphinx_mapping
# setting will cause a full environment reread
@@ -152,12 +161,19 @@ def load_mappings(app):
# files; remote ones only if the cache time is expired
if '://' not in inv or uri not in cache \
or cache[uri][0] < cache_time:
+ app.info('loading intersphinx inventory from %s...' % inv)
invdata = fetch_inventory(app, uri, inv)
- cache[uri] = (now, invdata)
+ if invdata:
+ cache[uri] = (name, now, invdata)
+ else:
+ cache.pop(uri, None)
update = True
if update:
env.intersphinx_inventory = {}
- for _, invdata in cache.itervalues():
+ env.intersphinx_named_inventory = {}
+ for name, _, invdata in cache.itervalues():
+ if name:
+ env.intersphinx_named_inventory[name] = invdata
for type, objects in invdata.iteritems():
env.intersphinx_inventory.setdefault(
type, {}).update(objects)
@@ -173,20 +189,27 @@ def missing_reference(app, env, node, contnode):
objtypes = env.domains[domain].objtypes_for_role(node['reftype'])
if not objtypes:
return
- for objtype in objtypes:
- fulltype = '%s:%s' % (domain, objtype)
- if fulltype in env.intersphinx_inventory and \
- target in env.intersphinx_inventory[fulltype]:
- break
- else:
- return
- proj, version, uri = env.intersphinx_inventory[fulltype][target]
- newnode = nodes.reference('', '')
- newnode['refuri'] = uri
- newnode['reftitle'] = '(in %s v%s)' % (proj, version)
- newnode['class'] = 'external-xref'
- newnode.append(contnode)
- return newnode
+ objtypes = ['%s:%s' % (domain, objtype) for objtype in objtypes]
+ to_try = [(env.intersphinx_inventory, target)]
+ if ':' in target:
+ # first part may be the foreign doc set name
+ setname, newtarget = target.split(':', 1)
+ if setname in env.intersphinx_named_inventory:
+ to_try.append((env.intersphinx_named_inventory[setname], newtarget))
+ for inventory, target in to_try:
+ for objtype in objtypes:
+ if objtype not in inventory or target not in inventory[objtype]:
+ continue
+ proj, version, uri, dispname = inventory[objtype][target]
+ newnode = nodes.reference('', '')
+ newnode['refuri'] = uri
+ newnode['reftitle'] = '(in %s v%s)' % (proj, version)
+ newnode['class'] = 'external-xref'
+ if dispname == '-':
+ newnode.append(contnode)
+ else:
+ newnode.append(contnode.__class__(dispname, dispname))
+ return newnode
def setup(app):
diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py
index 93fa301d..7f399754 100644
--- a/sphinx/ext/pngmath.py
+++ b/sphinx/ext/pngmath.py
@@ -10,6 +10,7 @@
"""
import re
+import codecs
import shutil
import tempfile
import posixpath
@@ -33,7 +34,7 @@ class MathExtError(SphinxError):
DOC_HEAD = r'''
\documentclass[12pt]{article}
-\usepackage[utf8]{inputenc}
+\usepackage[utf8x]{inputenc}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
@@ -89,8 +90,6 @@ def render_math(self, math):
latex = DOC_HEAD + self.builder.config.pngmath_latex_preamble
latex += (use_preview and DOC_BODY_PREVIEW or DOC_BODY) % math
- if isinstance(latex, unicode):
- latex = latex.encode('utf-8')
# use only one tempdir per build -- the use of a directory is cleaner
# than using temporary files, since we can clean up everything at once
@@ -100,7 +99,7 @@ def render_math(self, math):
else:
tempdir = self.builder._mathpng_tempdir
- tf = open(path.join(tempdir, 'math.tex'), 'w')
+ tf = codecs.open(path.join(tempdir, 'math.tex'), 'w', 'utf-8')
tf.write(latex)
tf.close()
@@ -183,7 +182,8 @@ def html_visit_math(self, node):
try:
fname, depth = render_math(self, '$'+node['latex']+'$')
except MathExtError, exc:
- sm = nodes.system_message(str(exc), type='WARNING', level=2,
+ msg = unicode(str(exc), 'utf-8', 'replace')
+ sm = nodes.system_message(msg, type='WARNING', level=2,
backrefs=[], source=node['latex'])
sm.walkabout(self)
self.builder.warn('display latex %r: ' % node['latex'] + str(exc))
diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py
index badcca1c..43e0942c 100644
--- a/sphinx/locale/__init__.py
+++ b/sphinx/locale/__init__.py
@@ -32,6 +32,9 @@ class _TranslationProxy(UserString.UserString, object):
return unicode(func)
return object.__new__(cls)
+ def __getnewargs__(self):
+ return (self._func,) + self._args
+
def __init__(self, func, *args):
self._func = func
self._args = args
diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.mo b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo
index d9cc44ce..d88717c0 100644
--- a/sphinx/locale/ca/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
index 93ec36d7..af8b4776 100644
--- a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
index 65932481..1fa7ae3d 100644
--- a/sphinx/locale/de/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/de/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.mo b/sphinx/locale/es/LC_MESSAGES/sphinx.mo
index c63cad23..eda70a31 100644
--- a/sphinx/locale/es/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/es/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
index 5e47dcba..61d8da8f 100644
--- a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.po b/sphinx/locale/fi/LC_MESSAGES/sphinx.po
index 97cdace1..5cad377e 100644
--- a/sphinx/locale/fi/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.po
@@ -589,10 +589,10 @@ msgstr ""
#: sphinx/writers/latex.py:651
#, fuzzy
msgid "Continued on next page"
-msgstr "Hakemisto yhtenä luettelona"
+msgstr ""
#: sphinx/writers/text.py:166
-#, fuzzy, python-format
+#, python-format
msgid "Platform: %s"
msgstr "Ympäristö: %s"
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
index d6c051de..704ddef0 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.js b/sphinx/locale/hr/LC_MESSAGES/sphinx.js
new file mode 100644
index 00000000..8db6b8f8
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.js
@@ -0,0 +1 @@
+Documentation.addTranslations({"locale": "hr", "plural_expr": "0", "messages": {"Search Results": "Rezultati pretrage", "Preparing search...": "Pripremam pretra\u017eivanje...", "Your search did not match any documents. Please make sure that all words are spelled correctly and that you've selected enough categories.": "Za va\u0161u pretragu nema rezultata. Molimo pregledajte da li so sve rije\u010di ispravno napisane i da li ste izbrali dovoljno kategorija.", "Search finished, found %s page(s) matching the search query.": "Pretra\u017eivanje je zaklju\u010deno, prona\u0111eno %s stranica, koje odgovaraju tra\u017eenom nizu.", ", in ": ", u ", "Permalink to this headline": "Link na taj naslov", "Searching": "Tra\u017eim", "Permalink to this definition": "Link na tu definiciju", "module, in ": "modul, u ", "Hide Search Matches": "Sakrij rezultate pretrage"}}); \ No newline at end of file
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.mo b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo
new file mode 100644
index 00000000..b314dbd6
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.po b/sphinx/locale/hr/LC_MESSAGES/sphinx.po
new file mode 100644
index 00000000..d4b1fa3c
--- /dev/null
+++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.po
@@ -0,0 +1,606 @@
+msgid ""
+msgstr ""
+"Project-Id-Version: Sphinx\n"
+"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
+"POT-Creation-Date: 2010-09-11 23:58+0200\n"
+"PO-Revision-Date: 2009-08-06 23:04+0200\n"
+"Last-Translator: Bojan Mihelač <bmihelac@mihelac.org>\n"
+"Language-Team: Bojan Mihelač <bmihelac@mihelac.org>\n"
+"Plural-Forms: nplurals=1; plural=0\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=utf-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"Generated-By: Babel 0.9.4\n"
+
+#: 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/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/writers/latex.py:190
+msgid "Index"
+msgstr "Abecedni popis"
+
+#: sphinx/environment.py:325 sphinx/writers/latex.py:189
+msgid "Module Index"
+msgstr "Popis modula"
+
+#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
+msgid "Search Page"
+msgstr "Tražilica"
+
+#: sphinx/roles.py:55 sphinx/directives/desc.py:747
+#, python-format
+msgid "environment variable; %s"
+msgstr "varijabla okruženja; %s"
+
+#: sphinx/roles.py:62
+#, python-format
+msgid "Python Enhancement Proposals!PEP %s"
+msgstr "Python Enhancement Proposals!PEP %s"
+
+#: sphinx/builders/changes.py:71
+msgid "Builtins"
+msgstr "Ugrađeni dijelovi"
+
+#: sphinx/builders/changes.py:73
+msgid "Module level"
+msgstr "Nivo modula"
+
+#: sphinx/builders/html.py:222
+#, python-format
+msgid "%b %d, %Y"
+msgstr "%d %b, %Y"
+
+#: sphinx/builders/html.py:241 sphinx/themes/basic/defindex.html:21
+msgid "General Index"
+msgstr "Opceniti abecedni indeks"
+
+#: sphinx/builders/html.py:241
+msgid "index"
+msgstr "abecedni indeks"
+
+#: 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 "Općeniti popis modula"
+
+#: sphinx/builders/html.py:244
+msgid "modules"
+msgstr "Moduli"
+
+#: sphinx/builders/html.py:300
+msgid "next"
+msgstr "naprijed"
+
+#: sphinx/builders/html.py:309
+msgid "previous"
+msgstr "nazad"
+
+#: sphinx/builders/latex.py:162
+msgid " (in "
+msgstr " (u "
+
+#: sphinx/directives/desc.py:97
+msgid "Raises"
+msgstr "Podiže"
+
+#: sphinx/directives/desc.py:101
+msgid "Variable"
+msgstr "Varijabla"
+
+#: sphinx/directives/desc.py:104
+msgid "Returns"
+msgstr "Vraća"
+
+#: sphinx/directives/desc.py:113
+msgid "Return type"
+msgstr "Vraća tip"
+
+#: sphinx/directives/desc.py:186
+msgid "Parameter"
+msgstr "Parametar"
+
+#: sphinx/directives/desc.py:190
+msgid "Parameters"
+msgstr "Parametri"
+
+#: sphinx/directives/desc.py:418
+#, python-format
+msgid "%s() (built-in function)"
+msgstr "%s() (ugrađene funkcije)"
+
+#: sphinx/directives/desc.py:419 sphinx/directives/desc.py:476
+#: sphinx/directives/desc.py:488
+#, python-format
+msgid "%s() (in module %s)"
+msgstr "%s() (u modulu %s)"
+
+#: sphinx/directives/desc.py:422
+#, python-format
+msgid "%s (built-in variable)"
+msgstr "%s (ugrađene variable)"
+
+#: sphinx/directives/desc.py:423 sphinx/directives/desc.py:514
+#, python-format
+msgid "%s (in module %s)"
+msgstr "%s (u modulu %s)"
+
+#: sphinx/directives/desc.py:439
+#, python-format
+msgid "%s (built-in class)"
+msgstr "%s (ugrađen razred)"
+
+#: sphinx/directives/desc.py:440
+#, python-format
+msgid "%s (class in %s)"
+msgstr "%s (razred u %s)"
+
+#: sphinx/directives/desc.py:480
+#, python-format
+msgid "%s() (%s.%s method)"
+msgstr "%s() (%s.%s metoda)"
+
+#: sphinx/directives/desc.py:482
+#, python-format
+msgid "%s() (%s method)"
+msgstr "%s() (%s metoda)"
+
+#: sphinx/directives/desc.py:492
+#, python-format
+msgid "%s() (%s.%s static method)"
+msgstr "%s() (%s.%s statična metoda)"
+
+#: sphinx/directives/desc.py:495
+#, python-format
+msgid "%s() (%s static method)"
+msgstr "%s() (%s statična metoda)"
+
+#: sphinx/directives/desc.py:518
+#, python-format
+msgid "%s (%s.%s attribute)"
+msgstr "%s (%s.%s atribut)"
+
+#: sphinx/directives/desc.py:520
+#, python-format
+msgid "%s (%s attribute)"
+msgstr "%s (%s atribut)"
+
+#: sphinx/directives/desc.py:609
+#, python-format
+msgid "%s (C function)"
+msgstr "%s (C funkcija)"
+
+#: sphinx/directives/desc.py:611
+#, python-format
+msgid "%s (C member)"
+msgstr "%s (C član)"
+
+#: sphinx/directives/desc.py:613
+#, python-format
+msgid "%s (C macro)"
+msgstr "%s (C makro)"
+
+#: sphinx/directives/desc.py:615
+#, python-format
+msgid "%s (C type)"
+msgstr "%s (C tip)"
+
+#: sphinx/directives/desc.py:617
+#, python-format
+msgid "%s (C variable)"
+msgstr "%s (C varijabla)"
+
+#: sphinx/directives/desc.py:665
+#, python-format
+msgid "%scommand line option; %s"
+msgstr "%scommand line parameter; %s"
+
+#: sphinx/directives/other.py:140
+msgid "Platforms: "
+msgstr "Platforme:"
+
+#: sphinx/directives/other.py:146
+#, python-format
+msgid "%s (module)"
+msgstr "%s (modul)"
+
+#: sphinx/directives/other.py:195
+msgid "Section author: "
+msgstr "Autor sekcije:"
+
+#: sphinx/directives/other.py:197
+msgid "Module author: "
+msgstr "Autor modula:"
+
+#: sphinx/directives/other.py:199
+msgid "Author: "
+msgstr "Autor:"
+
+#: sphinx/directives/other.py:319
+msgid "See also"
+msgstr "Pogledaj i"
+
+#: sphinx/ext/autodoc.py:889
+#, python-format
+msgid " Bases: %s"
+msgstr " Osnove: %s"
+
+#: sphinx/ext/autodoc.py:922
+#, python-format
+msgid "alias of :class:`%s`"
+msgstr "nadimak za :class:`%s`"
+
+#: sphinx/ext/todo.py:41
+msgid "Todo"
+msgstr "Todo"
+
+#: sphinx/ext/todo.py:99
+#, python-format
+msgid "(The original entry is located in %s, line %d and can be found "
+msgstr "(Originalan unos se nalazi u %s, u retku %d, i može biti pronađen "
+
+#: sphinx/ext/todo.py:105
+msgid "here"
+msgstr "ovdje"
+
+#: sphinx/locale/__init__.py:15
+msgid "Attention"
+msgstr "Pozor"
+
+#: sphinx/locale/__init__.py:16
+msgid "Caution"
+msgstr "Pažnja"
+
+#: sphinx/locale/__init__.py:17
+msgid "Danger"
+msgstr "Opasnost"
+
+#: sphinx/locale/__init__.py:18
+msgid "Error"
+msgstr "Greška"
+
+#: sphinx/locale/__init__.py:19
+msgid "Hint"
+msgstr "Savjet"
+
+#: sphinx/locale/__init__.py:20
+msgid "Important"
+msgstr "Važno"
+
+#: sphinx/locale/__init__.py:21
+msgid "Note"
+msgstr "Napomena"
+
+#: sphinx/locale/__init__.py:22
+msgid "See Also"
+msgstr "Pogledaj i"
+
+#: sphinx/locale/__init__.py:23
+msgid "Tip"
+msgstr "Savjet"
+
+#: sphinx/locale/__init__.py:24
+msgid "Warning"
+msgstr "Upozorenje"
+
+#: sphinx/locale/__init__.py:28
+#, python-format
+msgid "New in version %s"
+msgstr "Novo u verziji %s"
+
+#: sphinx/locale/__init__.py:29
+#, python-format
+msgid "Changed in version %s"
+msgstr "Promijenjeno u verziji %s"
+
+#: sphinx/locale/__init__.py:30
+#, python-format
+msgid "Deprecated since version %s"
+msgstr "Zastarijelo od verzije %s"
+
+#: sphinx/locale/__init__.py:34
+msgid "module"
+msgstr "modul"
+
+#: sphinx/locale/__init__.py:35
+msgid "keyword"
+msgstr "ključna riječ"
+
+#: sphinx/locale/__init__.py:36
+msgid "operator"
+msgstr "operator"
+
+#: sphinx/locale/__init__.py:37
+msgid "object"
+msgstr "objekt"
+
+#: sphinx/locale/__init__.py:38
+msgid "exception"
+msgstr "izuzetak"
+
+#: sphinx/locale/__init__.py:39
+msgid "statement"
+msgstr "izjava"
+
+#: sphinx/locale/__init__.py:40
+msgid "built-in function"
+msgstr "ugrađen funkcije"
+
+#: sphinx/themes/basic/defindex.html:2
+msgid "Overview"
+msgstr "Pregled"
+
+#: sphinx/themes/basic/defindex.html:11
+msgid "Indices and tables:"
+msgstr "Kazala i tabele:"
+
+#: sphinx/themes/basic/defindex.html:14
+msgid "Complete Table of Contents"
+msgstr "Potpuna tabela sadržaja"
+
+#: sphinx/themes/basic/defindex.html:15
+msgid "lists all sections and subsections"
+msgstr "prikaži sve sekcije i podsekcije"
+
+#: sphinx/themes/basic/defindex.html:17
+msgid "search this documentation"
+msgstr "traži po dokumentaciji"
+
+#: sphinx/themes/basic/defindex.html:20
+msgid "quick access to all modules"
+msgstr "brz dostup do svih modulov"
+
+#: sphinx/themes/basic/defindex.html:22
+msgid "all functions, classes, terms"
+msgstr "sve funkcije, razredi, izrazi"
+
+#: sphinx/themes/basic/genindex-single.html:5
+#, python-format
+msgid "Index &ndash; %(key)s"
+msgstr "Index &ndash; %(key)s"
+
+#: sphinx/themes/basic/genindex-single.html:44
+#: sphinx/themes/basic/genindex-split.html:14
+#: sphinx/themes/basic/genindex-split.html:27
+#: sphinx/themes/basic/genindex.html:54
+msgid "Full index on one page"
+msgstr "Potpun indeks na jednoj strani"
+
+#: sphinx/themes/basic/genindex-split.html:7
+msgid "Index pages by letter"
+msgstr "Indeksiraj stranice po slovu"
+
+#: sphinx/themes/basic/genindex-split.html:15
+msgid "can be huge"
+msgstr "može biti veliko"
+
+#: sphinx/themes/basic/layout.html:10
+msgid "Navigation"
+msgstr "Navigacija"
+
+#: sphinx/themes/basic/layout.html:42
+msgid "Table Of Contents"
+msgstr "Pregled sadržaja"
+
+#: sphinx/themes/basic/layout.html:48
+msgid "Previous topic"
+msgstr "Prijašnja tema"
+
+#: sphinx/themes/basic/layout.html:50
+msgid "previous chapter"
+msgstr "Prijašnje poglavje"
+
+#: sphinx/themes/basic/layout.html:53
+msgid "Next topic"
+msgstr "Slijedeća tema"
+
+#: sphinx/themes/basic/layout.html:55
+msgid "next chapter"
+msgstr "slijedeće poglavje"
+
+#: sphinx/themes/basic/layout.html:60
+msgid "This Page"
+msgstr "Trenutna stranica"
+
+#: sphinx/themes/basic/layout.html:63
+msgid "Show Source"
+msgstr "Prikaži izvorni kod"
+
+#: sphinx/themes/basic/layout.html:73
+msgid "Quick search"
+msgstr "Brzo pretraživanje"
+
+#: sphinx/themes/basic/layout.html:76
+msgid "Go"
+msgstr "Naprijed"
+
+#: sphinx/themes/basic/layout.html:81
+msgid "Enter search terms or a module, class or function name."
+msgstr "Unesi ime modula, razreda ili funkcije."
+
+#: sphinx/themes/basic/layout.html:122
+#, python-format
+msgid "Search within %(docstitle)s"
+msgstr "Traži između %(docstitle)s"
+
+#: sphinx/themes/basic/layout.html:131
+msgid "About these documents"
+msgstr "O ovim dokumentima"
+
+#: sphinx/themes/basic/layout.html:137 sphinx/themes/basic/search.html:2
+#: sphinx/themes/basic/search.html:5
+msgid "Search"
+msgstr "Traži"
+
+#: sphinx/themes/basic/layout.html:140
+msgid "Copyright"
+msgstr "Sva prava zadržana"
+
+#: sphinx/themes/basic/layout.html:187
+#, python-format
+msgid "&copy; <a href=\"%(path)s\">Copyright</a> %(copyright)s."
+msgstr "&copy; <a href=\"%(path)s\">Sva prava zadržana</a> %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:189
+#, python-format
+msgid "&copy; Copyright %(copyright)s."
+msgstr "&copy; Sva prava zadržana %(copyright)s."
+
+#: sphinx/themes/basic/layout.html:193
+#, python-format
+msgid "Last updated on %(last_updated)s."
+msgstr "Zadnji put ažurirano %(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 ""
+"Izrađeno sa <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> "
+"%(sphinx_version)s."
+
+#: sphinx/themes/basic/modindex.html:36
+msgid "Deprecated"
+msgstr "Zastarjelo"
+
+#: sphinx/themes/basic/opensearch.xml:4
+#, python-format
+msgid "Search %(docstitle)s"
+msgstr "Traži %(docstitle)s"
+
+#: sphinx/themes/basic/search.html:9
+msgid ""
+"Please activate JavaScript to enable the search\n"
+" functionality."
+msgstr ""
+"Molimo omogućite JavaScript\n"
+" za djelovanje tražilice."
+
+#: sphinx/themes/basic/search.html:14
+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"
+" function will automatically search for all of the words. Pages\n"
+" containing fewer words won't appear in the result list."
+msgstr ""
+"From here you can search these documents. Enter your search\n"
+" words into the box below and click \"search\". Note that the search\n"
+" function will automatically search for all of the words. Pages\n"
+" containing fewer words won't appear in the result list."
+
+#: sphinx/themes/basic/search.html:21
+msgid "search"
+msgstr "traži"
+
+#: sphinx/themes/basic/search.html:25
+#: sphinx/themes/basic/static/searchtools.js:462
+msgid "Search Results"
+msgstr "Rezultati pretrage"
+
+#: sphinx/themes/basic/search.html:27
+msgid "Your search did not match any results."
+msgstr "Your search did not match any results."
+
+#: sphinx/themes/basic/changes/frameset.html:5
+#: sphinx/themes/basic/changes/versionchanges.html:12
+#, python-format
+msgid "Changes in Version %(version)s &mdash; %(docstitle)s"
+msgstr "Changes in Version %(version)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/rstsource.html:5
+#, python-format
+msgid "%(filename)s &mdash; %(docstitle)s"
+msgstr "%(filename)s &mdash; %(docstitle)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:17
+#, python-format
+msgid "Automatically generated list of changes in version %(version)s"
+msgstr "Automatically generated list of changes in version %(version)s"
+
+#: sphinx/themes/basic/changes/versionchanges.html:18
+msgid "Library changes"
+msgstr "Library changes"
+
+#: sphinx/themes/basic/changes/versionchanges.html:23
+msgid "C API changes"
+msgstr "C API changes"
+
+#: sphinx/themes/basic/changes/versionchanges.html:25
+msgid "Other changes"
+msgstr "Ostale promjene"
+
+#: sphinx/themes/basic/static/doctools.js:139 sphinx/writers/html.py:473
+#: sphinx/writers/html.py:478
+msgid "Permalink to this headline"
+msgstr "Link na taj naslov"
+
+#: sphinx/themes/basic/static/doctools.js:145 sphinx/writers/html.py:80
+msgid "Permalink to this definition"
+msgstr "Link na tu definiciju"
+
+#: sphinx/themes/basic/static/doctools.js:174
+msgid "Hide Search Matches"
+msgstr "Sakrij rezultate pretrage"
+
+#: sphinx/themes/basic/static/searchtools.js:274
+msgid "Searching"
+msgstr "Tražim"
+
+#: sphinx/themes/basic/static/searchtools.js:279
+msgid "Preparing search..."
+msgstr "Pripremam pretraživanje..."
+
+#: sphinx/themes/basic/static/searchtools.js:347
+msgid "module, in "
+msgstr "modul, u "
+
+#: sphinx/themes/basic/static/searchtools.js:356
+msgid ", in "
+msgstr ", u "
+
+#: 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 ""
+"Za vašu pretragu nema rezultata. Molimo pregledajte da li so sve riječi "
+"ispravno napisane i da li ste izbrali dovoljno kategorija."
+
+#: sphinx/themes/basic/static/searchtools.js:466
+#, python-format
+msgid "Search finished, found %s page(s) matching the search query."
+msgstr "Pretraživanje je zaključeno, pronađeno %s stranica, koje odgovaraju traženom nizu."
+
+#: sphinx/writers/latex.py:187
+msgid "Release"
+msgstr "Distribucija"
+
+#: sphinx/writers/latex.py:578
+msgid "Footnotes"
+msgstr ""
+
+#: sphinx/writers/latex.py:646
+msgid "continued from previous page"
+msgstr "nastavak sa prethodne stranice"
+
+#: sphinx/writers/latex.py:651
+msgid "Continued on next page"
+msgstr "nastavak na slijedećoj stranici"
+
+#: sphinx/writers/text.py:166
+#, python-format
+msgid "Platform: %s"
+msgstr "Platforma: %s"
+
+#: sphinx/writers/text.py:428
+msgid "[image]"
+msgstr "[slika]"
+
diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.mo b/sphinx/locale/it/LC_MESSAGES/sphinx.mo
index 20e25ac7..0a79fafe 100644
--- a/sphinx/locale/it/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/it/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
index 28f8ee0c..c6a40e96 100644
--- a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
index 9d9dd4d4..09ea107c 100644
--- a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
index 1d6fc6ce..1abf2801 100644
--- a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
index 84bd4e28..472809ee 100644
--- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
index ea2cd656..63d91873 100644
--- a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
index 856c41e1..6d8fde06 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.po b/sphinx/locale/sl/LC_MESSAGES/sphinx.po
index 07fb84f1..47a807d7 100644
--- a/sphinx/locale/sl/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.po
@@ -1,11 +1,10 @@
-
msgid ""
msgstr ""
-"Project-Id-Version: Sphinx\n"
+"Project-Id-Version: Sphinx\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: Domen Kožar <domen@dev.si>\n"
+"PO-Revision-Date: 2010-04-20 09:19+0100\n"
+"Last-Translator: Luka Marinko <luka.marinko@simt.si>\n"
"Language-Team: Rok Garbas <rok.garbas@gmail.com>\n"
"Plural-Forms: nplurals=1; plural=0\n"
"MIME-Version: 1.0\n"
@@ -18,7 +17,8 @@ msgstr ""
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
@@ -31,11 +31,13 @@ msgstr "Abecedni seznam"
msgid "Module Index"
msgstr "Seznam modulov"
-#: sphinx/environment.py:326 sphinx/themes/basic/defindex.html:16
+#: sphinx/environment.py:326
+#: sphinx/themes/basic/defindex.html:16
msgid "Search Page"
msgstr "Iskalnik"
-#: 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 "okoljska spremenljivka; %s"
@@ -117,7 +119,8 @@ msgstr "Parametri"
msgid "%s() (built-in function)"
msgstr "%s() (vgrajene funkcije)"
-#: 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)"
@@ -128,7 +131,8 @@ msgstr "%s() (v modulu %s)"
msgid "%s (built-in variable)"
msgstr "%s (vgrajene spremenljivke)"
-#: 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 (v modulu %s)"
@@ -231,7 +235,7 @@ msgstr "Poglej Tudi"
#: sphinx/ext/autodoc.py:889
#, python-format
msgid " Bases: %s"
-msgstr " Osnove: %s"
+msgstr " Baza: %s"
#: sphinx/ext/autodoc.py:922
#, python-format
@@ -461,12 +465,8 @@ msgstr "Zadnjič posodobljeno %(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 ""
-"Narejeno s <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 "Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s."
#: sphinx/themes/basic/modindex.html:36
msgid "Deprecated"
@@ -482,8 +482,8 @@ msgid ""
"Please activate JavaScript to enable the search\n"
" functionality."
msgstr ""
-"Prosimo omogočite JavaScript\n"
-" za delovanje iskalnika."
+"Za pravilno delovanje Iskanja morete vklopiti\n"
+" JavaScript."
#: sphinx/themes/basic/search.html:14
msgid ""
@@ -538,12 +538,14 @@ msgstr "C API spremembe"
msgid "Other changes"
msgstr "Ostale spremembe"
-#: 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 "Povezava na naslov"
-#: 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 "Povezava na to definicijo"
@@ -568,12 +570,8 @@ msgid ", in "
msgstr ", v "
#: 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 ""
-"Za vaše iskanje ni rezultatov. Prosimo preglejte ali so vse besede "
-"pravilno črkovane in ali ste izbrali dovolj kategorij."
+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 "Za vaše iskanje ni rezultatov. Prosimo preglejte ali so vse besede pravilno črkovane in ali ste izbrali dovolj kategorij."
#: sphinx/themes/basic/static/searchtools.js:466
#, python-format
@@ -586,11 +584,11 @@ msgstr "Izdaja"
#: sphinx/writers/latex.py:578
msgid "Footnotes"
-msgstr ""
+msgstr "Opombe"
#: sphinx/writers/latex.py:646
msgid "continued from previous page"
-msgstr "nadaljevanje prejšnje strani"
+msgstr "nadaljevanje iz prejšnje strani"
#: sphinx/writers/latex.py:651
msgid "Continued on next page"
diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo
index c783e66b..186a2fe3 100644
--- a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
index c85724e4..c401ab26 100644
--- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
index 16c492ca..fc39d483 100644
--- a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
index 05f098b1..aa24573b 100644
--- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
+++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo
Binary files differ
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index 8479575a..97ddfc32 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -405,8 +405,8 @@ latex:
\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
\t@echo
\t@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
-\t@echo "Run \\`make all-pdf' or \\`make all-ps' in that directory to" \\
-\t "run these through (pdf)latex."
+\t@echo "Run \\`make' in that directory to run these through (pdf)latex" \\
+\t "(use \\`make latexpdf' here to do that automatically)."
latexpdf: latex
\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
diff --git a/sphinx/roles.py b/sphinx/roles.py
index 76ec311d..489d6ae8 100644
--- a/sphinx/roles.py
+++ b/sphinx/roles.py
@@ -22,10 +22,17 @@ from sphinx.util.nodes import split_explicit_title
generic_docroles = {
+ 'command' : nodes.strong,
+ 'dfn' : nodes.emphasis,
+ 'guilabel' : nodes.strong,
+ 'kbd' : nodes.literal,
'mailheader' : addnodes.literal_emphasis,
+ 'makevar' : nodes.strong,
'manpage' : addnodes.literal_emphasis,
'mimetype' : addnodes.literal_emphasis,
'newsgroup' : addnodes.literal_emphasis,
+ 'program' : nodes.strong, # XXX should be an x-ref
+ 'regexp' : nodes.literal,
}
for rolename, nodeclass in generic_docroles.iteritems():
@@ -33,26 +40,6 @@ for rolename, nodeclass in generic_docroles.iteritems():
role = roles.CustomRole(rolename, generic, {'classes': [rolename]})
roles.register_local_role(rolename, role)
-simple_docroles = [
- 'command',
- 'dfn',
- 'guilabel',
- 'kbd',
- 'makevar',
- 'program',
- 'regexp',
- ]
-
-def simple_docrole(typ, rawtext, text, lineno, inliner, options={}, content=[]):
- node = nodes.inline()
- textnode = nodes.Text(text, rawtext)
- node += textnode
- node["classes"].append(typ)
- return [node], []
-
-for rolename in simple_docroles:
- roles.register_local_role(rolename, simple_docrole)
-
# -- generic cross-reference role ----------------------------------------------
@@ -257,12 +244,8 @@ def abbr_role(typ, rawtext, text, lineno, inliner, options={}, content=[]):
specific_docroles = {
# links to download references
'download': XRefRole(nodeclass=addnodes.download_reference),
- # links to headings or arbitrary labels
- 'ref': XRefRole(lowercase=True, innernodeclass=nodes.emphasis),
# links to documents
'doc': XRefRole(),
- # links to labels, without a different title
- 'keyword': XRefRole(),
'pep': indexmarkup_role,
'rfc': indexmarkup_role,
diff --git a/sphinx/search.py b/sphinx/search.py
index 17a8354d..0d07fd72 100644
--- a/sphinx/search.py
+++ b/sphinx/search.py
@@ -153,7 +153,9 @@ class IndexBuilder(object):
otypes = self._objtypes
onames = self._objnames
for domainname, domain in self.env.domains.iteritems():
- for fullname, type, docname, anchor, prio in domain.get_objects():
+ for fullname, dispname, type, docname, anchor, prio in \
+ domain.get_objects():
+ # XXX use dispname?
if docname not in fn2index:
continue
if prio < 0:
@@ -168,7 +170,8 @@ class IndexBuilder(object):
otypes[domainname, type] = i
otype = domain.object_types.get(type)
if otype:
- onames[i] = str(otype.lname) # fire translation proxies
+ # use str() to fire translation proxies
+ onames[i] = str(domain.get_type_name(otype))
else:
onames[i] = type
pdict[name] = (fn2index[docname], i, prio)
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py
index d4f87348..e2d83bc6 100644
--- a/sphinx/setup_command.py
+++ b/sphinx/setup_command.py
@@ -64,14 +64,16 @@ class BuildDoc(Command):
('all-files', 'a', 'build all files'),
('source-dir=', 's', 'Source directory'),
('build-dir=', None, 'Build directory'),
+ ('config-dir=', 'c', 'Location of the configuration directory'),
('builder=', 'b', 'The builder to use. Defaults to "html"'),
('project=', None, 'The documented project\'s name'),
('version=', None, 'The short X.Y version'),
('release=', None, 'The full version, including alpha/beta/rc tags'),
('today=', None, 'How to format the current date, used as the '
'replacement for |today|'),
+ ('link-index', 'i', 'Link index.html to the master doc'),
]
- boolean_options = ['fresh-env', 'all-files']
+ boolean_options = ['fresh-env', 'all-files', 'link-index']
def initialize_options(self):
@@ -81,6 +83,8 @@ class BuildDoc(Command):
self.version = ''
self.release = ''
self.today = ''
+ self.config_dir = None
+ self.link_index = False
def _guess_source_dir(self):
for guess in ('doc', 'docs'):
@@ -89,13 +93,18 @@ class BuildDoc(Command):
for root, dirnames, filenames in os.walk(guess):
if 'conf.py' in filenames:
return root
+ return None
def finalize_options(self):
if self.source_dir is None:
self.source_dir = self._guess_source_dir()
self.announce('Using source directory %s' % self.source_dir)
self.ensure_dirname('source_dir')
+ if self.source_dir is None:
+ self.source_dir = os.curdir
self.source_dir = os.path.abspath(self.source_dir)
+ if self.config_dir is None:
+ self.config_dir = self.source_dir
if self.build_dir is None:
build = self.get_finalized_command('build')
@@ -122,7 +131,7 @@ class BuildDoc(Command):
confoverrides['release'] = self.release
if self.today:
confoverrides['today'] = self.today
- app = Sphinx(self.source_dir, self.source_dir,
+ app = Sphinx(self.source_dir, self.config_dir,
self.builder_target_dir, self.doctree_dir,
self.builder, confoverrides, status_stream,
freshenv=self.fresh_env)
@@ -140,3 +149,8 @@ class BuildDoc(Command):
'backslashreplace')
else:
raise
+
+ if self.link_index:
+ src = app.config.master_doc + app.builder.out_suffix
+ dst = app.builder.get_outfilename('index')
+ os.symlink(src, dst)
diff --git a/sphinx/texinputs/sphinxhowto.cls b/sphinx/texinputs/sphinxhowto.cls
index 204d7063..1ebdd434 100644
--- a/sphinx/texinputs/sphinxhowto.cls
+++ b/sphinx/texinputs/sphinxhowto.cls
@@ -33,10 +33,11 @@
\rule{\textwidth}{1pt}
\ifsphinxpdfoutput
\begingroup
- % This \def is required to deal with multi-line authors; it
+ % These \defs are required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
\def\\{, }
+ \def\and{and }
\pdfinfo{
/Author (\@author)
/Title (\@title)
@@ -48,7 +49,10 @@
{\rm\Huge\py@HeaderFamily \@title} \par
{\em\large\py@HeaderFamily \py@release\releaseinfo} \par
\vspace{25pt}
- {\Large\py@HeaderFamily \@author} \par
+ {\Large\py@HeaderFamily
+ \begin{tabular}[t]{c}
+ \@author
+ \end{tabular}} \par
\vspace{25pt}
\@date \par
\py@authoraddress \par
diff --git a/sphinx/texinputs/sphinxmanual.cls b/sphinx/texinputs/sphinxmanual.cls
index da805cdc..57517798 100644
--- a/sphinx/texinputs/sphinxmanual.cls
+++ b/sphinx/texinputs/sphinxmanual.cls
@@ -40,10 +40,11 @@
\rule{\textwidth}{1pt}%
\ifsphinxpdfoutput
\begingroup
- % This \def is required to deal with multi-line authors; it
+ % These \defs are required to deal with multi-line authors; it
% changes \\ to ', ' (comma-space), making it pass muster for
% generating document info in the PDF file.
\def\\{, }
+ \def\and{and }
\pdfinfo{
/Author (\@author)
/Title (\@title)
@@ -55,7 +56,11 @@
{\rm\Huge\py@HeaderFamily \@title \par}%
{\em\LARGE\py@HeaderFamily \py@release\releaseinfo \par}
\vfill
- {\LARGE\py@HeaderFamily \@author \par}
+ {\LARGE\py@HeaderFamily
+ \begin{tabular}[t]{c}
+ \@author
+ \end{tabular}
+ \par}
\vfill\vfill
{\large
\@date \par
diff --git a/sphinx/themes/basic/static/basic.css b/sphinx/themes/basic/static/basic.css
index 9cd07bb3..7cfacd5b 100644
--- a/sphinx/themes/basic/static/basic.css
+++ b/sphinx/themes/basic/static/basic.css
@@ -368,28 +368,6 @@ dl.glossary dt {
margin-left: 1.5em;
}
-.command,
-.guilabel,
-.makevar,
-.program
-{
- font-weight: bold;
-}
-
-.kbd,
-.regexp
-{
- font-family: monospace;
- white-space: pre-wrap;
- background-color: #ecf0f3;
- padding: 0 1px 0 1px;
- font-size: 0.95em;
-}
-
-.dfn {
- font-style: italic;
-}
-
/* -- code displays --------------------------------------------------------- */
pre {
diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js
index ec1f3e0f..b96ff3d2 100644
--- a/sphinx/themes/basic/static/searchtools.js
+++ b/sphinx/themes/basic/static/searchtools.js
@@ -467,11 +467,13 @@ var Search = {
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
item[0] + '.txt', function(data) {
- listItem.append($.makeSearchSummary(data, searchterms, hlterms));
- Search.output.append(listItem);
- listItem.slideDown(5, function() {
- displayNextItem();
- });
+ if (data != '') {
+ listItem.append($.makeSearchSummary(data, searchterms, hlterms));
+ Search.output.append(listItem);
+ listItem.slideDown(5, function() {
+ displayNextItem();
+ });
+ }
});
} else {
// no source available, just display title
diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py
index 12dd1640..d018c3f6 100644
--- a/sphinx/writers/latex.py
+++ b/sphinx/writers/latex.py
@@ -207,8 +207,12 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.bibitems = []
self.table = None
self.next_table_colspec = None
- self.highlightlang = builder.config.highlight_language
- self.highlightlinenothreshold = sys.maxint
+ # stack of [language, linenothreshold] settings per file
+ # the first item here is the default and must not be changed
+ # the second item is the default for the master file and can be changed
+ # by .. highlight:: directive in the master file
+ self.hlsettingstack = 2 * [[builder.config.highlight_language,
+ sys.maxint]]
self.footnotestack = []
self.curfilestack = []
self.handled_abbrs = set()
@@ -331,6 +335,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
# also add a document target
self.next_section_ids.add(':doc')
self.curfilestack.append(node['docname'])
+ # use default highlight settings for new file
+ self.hlsettingstack.append(self.hlsettingstack[0])
def collect_footnotes(self, node):
fnotes = {}
@@ -351,10 +357,10 @@ class LaTeXTranslator(nodes.NodeVisitor):
def depart_start_of_file(self, node):
self.footnotestack.pop()
self.curfilestack.pop()
+ self.hlsettingstack.pop()
def visit_highlightlang(self, node):
- self.highlightlang = node['lang']
- self.highlightlinenothreshold = node['linenothreshold']
+ self.hlsettingstack[-1] = [node['lang'], node['linenothreshold']]
raise nodes.SkipNode
def visit_section(self, node):
@@ -1148,8 +1154,8 @@ class LaTeXTranslator(nodes.NodeVisitor):
self.verbatim = ''
def depart_literal_block(self, node):
code = self.verbatim.rstrip('\n')
- lang = self.highlightlang
- linenos = code.count('\n') >= self.highlightlinenothreshold - 1
+ lang = self.hlsettingstack[-1][0]
+ linenos = code.count('\n') >= self.hlsettingstack[-1][1] - 1
if node.has_key('language'):
# code-block directives
lang = node['language']
diff --git a/tests/root/conf.py b/tests/root/conf.py
index 71f48ce6..9b1249ad 100644
--- a/tests/root/conf.py
+++ b/tests/root/conf.py
@@ -43,7 +43,7 @@ htmlhelp_basename = 'SphinxTestsdoc'
latex_documents = [
('contents', 'SphinxTests.tex', 'Sphinx Tests Documentation',
- 'Georg Brandl', 'manual'),
+ 'Georg Brandl \\and someone else', 'manual'),
]
latex_additional_files = ['svgimg.svg']
diff --git a/tests/test_intersphinx.py b/tests/test_intersphinx.py
index 5263d724..622243e6 100644
--- a/tests/test_intersphinx.py
+++ b/tests/test_intersphinx.py
@@ -36,10 +36,10 @@ inventory_v2 = '''\
# Version: 2.0
# The remainder of this file is compressed with zlib.
''' + zlib.compress('''\
-module1 py:module 0 foo.html#module-module1
-module2 py:module 0 foo.html#module-$
-module1.func py:function 1 sub/foo.html#$
-CFunc c:function 2 cfunc.html#CFunc
+module1 py:module 0 foo.html#module-module1 Long Module desc
+module2 py:module 0 foo.html#module-$ -
+module1.func py:function 1 sub/foo.html#$ -
+CFunc c:function 2 cfunc.html#CFunc -
''')
@@ -48,9 +48,9 @@ def test_read_inventory_v1():
f.readline()
invdata = read_inventory_v1(f, '/util', posixpath.join)
assert invdata['py:module']['module'] == \
- ('foo', '1.0', '/util/foo.html#module-module')
+ ('foo', '1.0', '/util/foo.html#module-module', '-')
assert invdata['py:class']['module.cls'] == \
- ('foo', '1.0', '/util/foo.html#module.cls')
+ ('foo', '1.0', '/util/foo.html#module.cls', '-')
def test_read_inventory_v2():
@@ -67,9 +67,9 @@ def test_read_inventory_v2():
assert len(invdata1['py:module']) == 2
assert invdata1['py:module']['module1'] == \
- ('foo', '2.0', '/util/foo.html#module-module1')
+ ('foo', '2.0', '/util/foo.html#module-module1', 'Long Module desc')
assert invdata1['py:module']['module2'] == \
- ('foo', '2.0', '/util/foo.html#module-module2')
+ ('foo', '2.0', '/util/foo.html#module-module2', '-')
assert invdata1['py:function']['module1.func'][2] == \
'/util/sub/foo.html#module1.func'
assert invdata1['c:function']['CFunc'][2] == '/util/cfunc.html#CFunc'
@@ -88,7 +88,7 @@ def test_missing_reference(tempdir, app):
inv = app.env.intersphinx_inventory
assert inv['py:module']['module2'] == \
- ('foo', '2.0', 'http://docs.python.org/foo.html#module-module2')
+ ('foo', '2.0', 'http://docs.python.org/foo.html#module-module2', '-')
# create fake nodes and check referencing
contnode = nodes.emphasis('foo')