diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2012-12-10 10:18:32 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2012-12-10 10:18:32 +0900 |
| commit | d45dcfbd7e5add4495a7e31ee53e672ee180d534 (patch) | |
| tree | e3ccbee28f06bfccb66ab2c54cb3b1648409e704 | |
| parent | 207e12471f451fee53a95ca6918c93abfef3a632 (diff) | |
| parent | 5818df7941b73abecdb1b399fee7956ea283d698 (diff) | |
| download | sphinx-d45dcfbd7e5add4495a7e31ee53e672ee180d534.tar.gz | |
merge heads
156 files changed, 2257 insertions, 470 deletions
diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..54e27e20 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: + - "2.7" + - "3.3" +script: make test +install: + - python setup.py -q install @@ -1,6 +1,13 @@ Release 1.2 (in development) ============================ +* PR#25: In inheritance diagrams, the first line of the class docstring + is now the tooltip for the class. + +* PR#47: Added :mod:`sphinx.ext.linkcode` extension. + +* PR#75: Added ``--follow-links`` option to sphinx-apidoc. + * PR#45: The linkcheck builder now checks ``#anchor``\ s for existence. * PR#28: Added Hungarian translation. @@ -9,11 +16,49 @@ Release 1.2 (in development) * PR#54: Added Norwegian bokmaal translation. +* PR#52: ``special_members`` flag to autodoc now behaves like ``members``. + +* #955: Fix i18n transformation. + +* Handle duplicate domain indices in texinfo. + +* PR#74: Fix some Russian translation. + * Update to jQuery 1.7.1 and Underscore.js 1.3.1. +* #1015: Stop overriding jQuery contains() in the JavaScript. + +* #1028: Fix line block output in the text builder. + +* #1018: Fix "container" directive handling in the text builder. + +* #1012: Update Estonian translation. + +* #1010: Make pngmath images transparent by default; IE7+ should handle it. + +* #440: Fix coarse timestamp resolution in some filesystem generate wrong outdated file-list. + +* #1008: Fix test failures with Python 3.3. + +* #1029: Fix intersphinx_mapping values are not stable if mapping have plural key/value set with Python 3.3. + +* #920: Rescue PIL packaging issue that allow import Image without PIL namespace. Thanks to Marc Schlaich. + +* #1024: Improve Makefile/make.bat error message if Sphinx is not found. Thanks to anatoly techtonik. + +* #1037: Fix typos in Polish translation. Thanks to Jakub Wilk. + +* #1038: Fix cpp domain parser fails to parse C+11 "static constexpr" declarations. Thanks to Jakub Wilk. + +* #1043: Fix sphinx-quickstart asks again and again Y|N because input() return value with extra '\r' on Python-3.2.0 + Windows. Thanks to Régis Décamps. + +* #1041: Fix cpp domain parser fails to parse a const type with a modifier. + +* PR#88: Added the "Sphinx Developer's Guide" (:file:`doc/devguide.rst`) + which outlines the basic development process of the Sphinx project. -Release 1.1.4 (in development) -============================== +* Added the Docutils-native XML and pseudo-XML builders. See + :class:`XMLBuilder` and :class:`PseudoXMLBuilder`. Release 1.1.3 (Mar 10, 2012) @@ -4,7 +4,7 @@ Projects using Sphinx This is an (incomplete) alphabetic list of projects that use Sphinx or are 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>`_. +<http://groups.google.com/group/sphinx-users>`_. I've grouped the list into sections to make it easier to find interesting examples. @@ -70,6 +70,7 @@ Documentation using a customized version of the default theme * Chaco: http://code.enthought.com/projects/chaco/docs/html/ * Djagios: http://djagios.org/ * GetFEM++: http://home.gna.org/getfem/ +* Google or-tools: https://or-tools.googlecode.com/svn/trunk/documentation/user_manual/index.html * GPAW: https://wiki.fysik.dtu.dk/gpaw/ * Grok: http://grok.zope.org/doc/current/ * IFM: http://fluffybunny.memebot.com/ifm-docs/index.html @@ -105,10 +106,11 @@ Documentation using the sphinxdoc theme http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html * Reteisi: http://www.reteisi.org/contents.html * Satchmo: http://www.satchmoproject.com/docs/dev/ -* Sphinx: http://sphinx.pocoo.org/ +* Sphinx: http://sphinx-doc.org/ * Sqlkit: http://sqlkit.argolinux.org/ * Tau: http://www.tango-controls.org/static/tau/latest/doc/html/index.html * Total Open Station: http://tops.berlios.de/ +* Turbulenz: http://docs.turbulenz.com/ * WebFaction: http://docs.webfaction.com/ @@ -128,6 +130,7 @@ Documentation using another builtin theme (agogo) * Sylli: http://sylli.sourceforge.net/ (nature) * libLAS: http://liblas.org/ (nature) +* Valence: http://docs.valence.desire2learn.com/ (haiku) Documentation using a custom theme/integrated in a site @@ -135,7 +138,8 @@ 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/ +* Classy: http://classy.pocoo.org/ +* DEAP: http://deap.gel.ulaval.ca/doc/0.8/index.html * Django: http://docs.djangoproject.com/ * e-cidadania: http://e-cidadania.readthedocs.org/en/latest/ * Flask: http://flask.pocoo.org/docs/ @@ -143,13 +147,17 @@ Documentation using a custom theme/integrated in a site * Gameduino: http://excamera.com/sphinx/gameduino/ * GeoServer: http://docs.geoserver.org/ * Glashammer: http://glashammer.org/ +* Istihza (Turkish Python documentation project): http://www.istihza.com/py2/icindekiler_python.html +* MathJax: http://docs.mathjax.org/en/latest/ * MirrorBrain: http://mirrorbrain.org/docs/ * nose: http://somethingaboutorange.com/mrl/projects/nose/ * ObjectListView: http://objectlistview.sourceforge.net/python * Open ERP: http://doc.openerp.com/ +* OpenCV: http://docs.opencv.org/ * OpenLayers: http://docs.openlayers.org/ * PyEphem: http://rhodesmill.org/pyephem/ * German Plone 4.0 user manual: http://www.hasecke.com/plone-benutzerhandbuch/4.0/ +* PSI4: http://sirius.chem.vt.edu/psi4manual/latest/index.html * Pylons: http://pylonshq.com/docs/en/0.9.7/ * PyMOTW: http://www.doughellmann.com/PyMOTW/ * pypol: http://pypol.altervista.org/ (celery) @@ -161,6 +169,7 @@ Documentation using a custom theme/integrated in a site * SQLAlchemy: http://www.sqlalchemy.org/docs/ * tinyTiM: http://tinytim.sourceforge.net/docs/2.0/ * tipfy: http://www.tipfy.org/docs/ +* Ubuntu packaging guide: http://developer.ubuntu.com/packaging/html/ * Werkzeug: http://werkzeug.pocoo.org/docs/ * WFront: http://discorporate.us/projects/WFront/ @@ -21,7 +21,7 @@ After installing:: Then, direct your browser to ``_build/html/index.html``. -Or read them online at <http://sphinx.pocoo.org/>. +Or read them online at <http://sphinx-doc.org/>. Testing diff --git a/distribute_setup.py b/distribute_setup.py index 37117b34..cebd80b1 100644 --- a/distribute_setup.py +++ b/distribute_setup.py @@ -14,11 +14,14 @@ the appropriate options to ``use_setuptools()``. This file can also be run as a script to install or upgrade setuptools. """ import os +import shutil import sys import time import fnmatch import tempfile import tarfile +import optparse + from distutils import log try: @@ -46,7 +49,7 @@ except ImportError: args = [quote(arg) for arg in args] return os.spawnl(os.P_WAIT, sys.executable, *args) == 0 -DEFAULT_VERSION = "0.6.13" +DEFAULT_VERSION = "0.6.30" DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/" SETUPTOOLS_FAKED_VERSION = "0.6c11" @@ -63,7 +66,7 @@ Description: xxx """ % SETUPTOOLS_FAKED_VERSION -def _install(tarball): +def _install(tarball, install_args=()): # extracting the tarball tmpdir = tempfile.mkdtemp() log.warn('Extracting in %s', tmpdir) @@ -81,11 +84,14 @@ def _install(tarball): # installing log.warn('Installing Distribute') - if not _python_cmd('setup.py', 'install'): + if not _python_cmd('setup.py', 'install', *install_args): log.warn('Something went wrong during the installation.') log.warn('See the error message above.') + # exitcode will be 2 + return 2 finally: os.chdir(old_wd) + shutil.rmtree(tmpdir) def _build_egg(egg, tarball, to_dir): @@ -110,6 +116,7 @@ def _build_egg(egg, tarball, to_dir): finally: os.chdir(old_wd) + shutil.rmtree(tmpdir) # returning the result log.warn(egg) if not os.path.exists(egg): @@ -144,7 +151,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, except ImportError: return _do_download(version, download_base, to_dir, download_delay) try: - pkg_resources.require("distribute>="+version) + pkg_resources.require("distribute>=" + version) return except pkg_resources.VersionConflict: e = sys.exc_info()[1] @@ -167,6 +174,7 @@ def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, if not no_fake: _create_fake_setuptools_pkg_info(to_dir) + def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, to_dir=os.curdir, delay=15): """Download distribute from a specified location and return its filename @@ -203,6 +211,7 @@ def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL, dst.close() return os.path.realpath(saveto) + def _no_sandbox(function): def __no_sandbox(*args, **kw): try: @@ -227,6 +236,7 @@ def _no_sandbox(function): return __no_sandbox + def _patch_file(path, content): """Will backup the file then patch it""" existing_content = open(path).read() @@ -245,15 +255,18 @@ def _patch_file(path, content): _patch_file = _no_sandbox(_patch_file) + def _same_content(path, content): return open(path).read() == content + def _rename_path(path): new_name = path + '.OLD.%s' % time.time() - log.warn('Renaming %s into %s', path, new_name) + log.warn('Renaming %s to %s', path, new_name) os.rename(path, new_name) return new_name + def _remove_flat_installation(placeholder): if not os.path.isdir(placeholder): log.warn('Unkown installation at %s', placeholder) @@ -267,7 +280,7 @@ def _remove_flat_installation(placeholder): log.warn('Could not locate setuptools*.egg-info') return - log.warn('Removing elements out of the way...') + log.warn('Moving elements out of the way...') pkg_info = os.path.join(placeholder, file) if os.path.isdir(pkg_info): patched = _patch_egg_dir(pkg_info) @@ -289,11 +302,13 @@ def _remove_flat_installation(placeholder): _remove_flat_installation = _no_sandbox(_remove_flat_installation) + def _after_install(dist): log.warn('After install bootstrap.') placeholder = dist.get_command_obj('install').install_purelib _create_fake_setuptools_pkg_info(placeholder) + def _create_fake_setuptools_pkg_info(placeholder): if not placeholder or not os.path.exists(placeholder): log.warn('Could not find the install location') @@ -307,7 +322,11 @@ def _create_fake_setuptools_pkg_info(placeholder): return log.warn('Creating %s', pkg_info) - f = open(pkg_info, 'w') + try: + f = open(pkg_info, 'w') + except EnvironmentError: + log.warn("Don't have permissions to write %s, skipping", pkg_info) + return try: f.write(SETUPTOOLS_PKG_INFO) finally: @@ -321,7 +340,10 @@ def _create_fake_setuptools_pkg_info(placeholder): finally: f.close() -_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info) +_create_fake_setuptools_pkg_info = _no_sandbox( + _create_fake_setuptools_pkg_info +) + def _patch_egg_dir(path): # let's check if it's already patched @@ -343,6 +365,7 @@ def _patch_egg_dir(path): _patch_egg_dir = _no_sandbox(_patch_egg_dir) + def _before_install(): log.warn('Before install bootstrap.') _fake_setuptools() @@ -351,7 +374,7 @@ def _before_install(): def _under_prefix(location): if 'install' not in sys.argv: return True - args = sys.argv[sys.argv.index('install')+1:] + args = sys.argv[sys.argv.index('install') + 1:] for index, arg in enumerate(args): for option in ('--root', '--prefix'): if arg.startswith('%s=' % option): @@ -359,7 +382,7 @@ def _under_prefix(location): return location.startswith(top_dir) elif arg == option: if len(args) > index: - top_dir = args[index+1] + top_dir = args[index + 1] return location.startswith(top_dir) if arg == '--user' and USER_SITE is not None: return location.startswith(USER_SITE) @@ -376,11 +399,14 @@ def _fake_setuptools(): return ws = pkg_resources.working_set try: - setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools', - replacement=False)) + setuptools_dist = ws.find( + pkg_resources.Requirement.parse('setuptools', replacement=False) + ) except TypeError: # old distribute API - setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools')) + setuptools_dist = ws.find( + pkg_resources.Requirement.parse('setuptools') + ) if setuptools_dist is None: log.warn('No setuptools distribution found') @@ -414,7 +440,7 @@ def _fake_setuptools(): res = _patch_egg_dir(setuptools_location) if not res: return - log.warn('Patched done.') + log.warn('Patching complete.') _relaunch() @@ -422,7 +448,9 @@ def _relaunch(): log.warn('Relaunching...') # we have to relaunch the process # pip marker to avoid a relaunch bug - if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']: + _cmd1 = ['-c', 'install', '--single-version-externally-managed'] + _cmd2 = ['-c', 'install', '--record'] + if sys.argv[:3] == _cmd1 or sys.argv[:3] == _cmd2: sys.argv[0] = 'setup.py' args = [sys.executable] + sys.argv sys.exit(subprocess.call(args)) @@ -448,7 +476,7 @@ def _extractall(self, path=".", members=None): # Extract directories with a safe mode. directories.append(tarinfo) tarinfo = copy.copy(tarinfo) - tarinfo.mode = 448 # decimal for oct 0700 + tarinfo.mode = 448 # decimal for oct 0700 self.extract(tarinfo, path) # Reverse sort directories. @@ -475,11 +503,39 @@ def _extractall(self, path=".", members=None): self._dbg(1, "tarfile: %s" % e) -def main(argv, version=DEFAULT_VERSION): +def _build_install_args(options): + """ + Build the arguments to 'python setup.py install' on the distribute package + """ + install_args = [] + if options.user_install: + if sys.version_info < (2, 6): + log.warn("--user requires Python 2.6 or later") + raise SystemExit(1) + install_args.append('--user') + return install_args + +def _parse_args(): + """ + Parse the command line for options + """ + parser = optparse.OptionParser() + parser.add_option( + '--user', dest='user_install', action='store_true', default=False, + help='install in user site package (requires Python 2.6 or later)') + parser.add_option( + '--download-base', dest='download_base', metavar="URL", + default=DEFAULT_URL, + help='alternative URL from where to download the distribute package') + options, args = parser.parse_args() + # positional arguments are ignored + return options + +def main(version=DEFAULT_VERSION): """Install or upgrade setuptools and EasyInstall""" - tarball = download_setuptools() - _install(tarball) - + options = _parse_args() + tarball = download_setuptools(download_base=options.download_base) + return _install(tarball, _build_install_args(options)) if __name__ == '__main__': - main(sys.argv[1:]) + sys.exit(main()) diff --git a/doc/Makefile b/doc/Makefile index 47951316..a46b0227 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -13,7 +13,8 @@ ALLSPHINXOPTS = -d _build/doctrees $(PAPEROPT_$(PAPER)) \ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(O) . .PHONY: help clean html dirhtml singlehtml text man pickle json htmlhelp \ - qthelp devhelp epub latex latexpdf changes linkcheck doctest + qthelp devhelp epub latex latexpdf changes linkcheck doctest xml \ + pseudoxml help: @echo "Please use \`make <target>' where <target> is one of" @@ -147,3 +148,13 @@ info: @echo "Running Texinfo files through makeinfo..." make -C _build/texinfo info @echo "makeinfo finished; the Info files are in _build/texinfo." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) _build/xml + @echo + @echo "Build finished. The XML files are in _build/XML." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) _build/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in _build/pseudoxml." diff --git a/doc/_templates/index.html b/doc/_templates/index.html index 34dead7e..8db89ab5 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -62,9 +62,9 @@ <p> You can also download PDF versions of the Sphinx documentation: - a <a href="http://sphinx.pocoo.org/sphinx.pdf">version</a> generated from + a <a href="http://sphinx-doc.org/sphinx.pdf">version</a> generated from the LaTeX Sphinx produces, and - a <a href="http://sphinx.pocoo.org/sphinx-rst2pdf.pdf">version</a> generated + a <a href="http://sphinx-doc.org/sphinx-rst2pdf.pdf">version</a> generated by rst2pdf. </p> diff --git a/doc/_templates/indexsidebar.html b/doc/_templates/indexsidebar.html index feafd904..c479abcb 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -14,14 +14,14 @@ <p>Get Sphinx from the <a href="http://pypi.python.org/pypi/Sphinx">Python Package Index</a>, or install it with:</p> <pre>easy_install -U Sphinx</pre> -<p>Latest <a href="http://sphinx.pocoo.org/latest/">development version docs</a> +<p>Latest <a href="http://sphinx-doc.org/latest/">development version docs</a> are also available.</p> {% endif %} <h3>Questions? Suggestions?</h3> -<p>Join the <a href="http://groups.google.com/group/sphinx-dev">Google group</a>:</p> -<form action="http://groups.google.com/group/sphinx-dev/boxsubscribe" +<p>Join the <a href="http://groups.google.com/group/sphinx-users">Google group</a>:</p> +<form action="http://groups.google.com/group/sphinx-users/boxsubscribe" style="padding-left: 1em"> <input type="text" name="email" value="your@email"/> <input type="submit" name="sub" value="Subscribe" /> diff --git a/doc/builders.rst b/doc/builders.rst index 6600807d..0075ad81 100644 --- a/doc/builders.rst +++ b/doc/builders.rst @@ -272,6 +272,29 @@ Note that a direct PDF builder using ReportLab is available in `rst2pdf Its name is ``linkcheck``. +.. module:: sphinx.builders.xml +.. class:: XMLBuilder + + This builder produces Docutils-native XML files. The output can be + transformed with standard XML tools such as XSLT processors into arbitrary + final forms. + + Its name is ``xml``. + + .. versionadded:: 1.2 + +.. class:: PseudoXMLBuilder + + This builder is used for debugging the Sphinx/Docutils "Reader to Transform + to Writer" pipeline. It produces compact pretty-printed "pseudo-XML", files + where nesting is indicated by indentation (no end-tags). External + attributes for all elements are output, and internal attributes for any + leftover "pending" elements are also given. + + Its name is ``pseudoxml``. + + .. versionadded:: 1.2 + Built-in Sphinx extensions that offer more builders are: diff --git a/doc/conf.py b/doc/conf.py index 6b547edd..834b36cf 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -23,14 +23,14 @@ modindex_common_prefix = ['sphinx.'] html_static_path = ['_static'] html_sidebars = {'index': ['indexsidebar.html', 'searchbox.html']} html_additional_pages = {'index': 'index.html'} -html_use_opensearch = 'http://sphinx.pocoo.org' +html_use_opensearch = 'http://sphinx-doc.org' htmlhelp_basename = 'Sphinxdoc' epub_theme = 'epub' epub_basename = 'sphinx' epub_author = 'Georg Brandl' -epub_publisher = 'http://sphinx.pocoo.org/' +epub_publisher = 'http://sphinx-doc.org/' epub_scheme = 'url' epub_identifier = epub_publisher epub_pre_files = [('index.html', 'Welcome')] diff --git a/doc/config.rst b/doc/config.rst index 6178d459..0ff6d405 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -383,6 +383,7 @@ documentation on :ref:`intl` for details. * ``ko`` -- Korean * ``lt`` -- Lithuanian * ``lv`` -- Latvian + * ``nb_NO`` -- Norwegian Bokmal * ``ne`` -- Nepali * ``nl`` -- Dutch * ``pl`` -- Polish @@ -1341,6 +1342,16 @@ Options for the linkcheck builder .. versionadded:: 1.2 +Options for the XML builder +--------------------------- + +.. confval:: xml_pretty + + If True, pretty-print the XML. Default is ``True``. + + .. versionadded:: 1.2 + + .. rubric:: Footnotes .. [1] A note on available globbing syntax: you can use the standard shell diff --git a/doc/contents.rst b/doc/contents.rst index 3bbc2835..5e0ae6c1 100644 --- a/doc/contents.rst +++ b/doc/contents.rst @@ -22,6 +22,7 @@ Sphinx documentation contents faq glossary + devguide changes examples diff --git a/doc/devguide.rst b/doc/devguide.rst new file mode 100644 index 00000000..ab4bc740 --- /dev/null +++ b/doc/devguide.rst @@ -0,0 +1,214 @@ +Sphinx Developer's Guide +======================== + +.. topic:: Abstract + + This document describes the development process of Sphinx, a documentation + system used by developers to document systems used by other developers to + develop other systems that may also be documented using Sphinx. + +The Sphinx source code is managed using `Mercurial`_ and is hosted on +`BitBucket`_. + + hg clone https://bitbucket.org/birkenfeld/sphinx + +.. rubric:: Community + +sphinx-users <sphinx-users@googlegroups.com> + Mailing list for user support. + +sphinx-dev <sphinx-dev@googlegroups.com> + Mailing list for development related discussions. + +#pocoo on irc.freenode.net + IRC channel for development questions and user support. + + This channel is shared with other Pocoo projects. Archived logs are + available `here <http://dev.pocoo.org/irclogs/>`_. + +.. _`BitBucket`: http://bitbucket.org +.. _`Mercurial`: http://mercurial.selenic.com/ + + +Bug Reports and Feature Requests +-------------------------------- + +If you have encountered a problem with Sphinx or have an idea for a new +feature, please submit it to the `issue tracker`_ on BitBucket or discuss it +on the sphinx-dev mailing list. + +For bug reports, please include the output produced during the build process +and also the log file Sphinx creates after it encounters an un-handled +exception. The location of this file should be shown towards the end of the +error message. + +Including or providing a link to the source files involved may help us fix the +issue. If possible, try to create a minimal project that produces the error +and post that instead. + +.. _`issue tracker`: http://bitbucket.org/birkenfeld/sphinx/issues + + +Contributing to Sphinx +---------------------- + +The recommended way for new contributors to submit code to Sphinx is to fork +the Mercurial repository on BitBucket and then submit a pull request after +committing the changes. The pull request will then need to be approved by one +of the core developers before it is merged into the main repository. + + +Getting Started +~~~~~~~~~~~~~~~ + +These are the basic steps needed to start developing on Sphinx. + +#. Create an account on BitBucket. + +#. Fork the main Sphinx repository (`birkenfeld/sphinx + <https://bitbucket.org/birkenfeld/sphinx>`_) using the BitBucket interface. + +#. Clone the forked repository to your machine. :: + + hg clone https://bitbucket.org/USERNAME/sphinx-fork + cd sphinx-fork + +#. Checkout the appropriate branch. + + For changes that should be included in the next minor release (namely bug + fixes), use the ``stable`` branch. :: + + hg checkout stable + + For new features or other substantial changes that should wait until the + next major release, use the ``default`` branch. + +#. Setup your Python environment. :: + + virtualenv ~/sphinxenv + . ~/sphinxenv/bin/activate + pip install -e . + +#. Hack, hack, hack. + + For tips on working with the code, see the `Coding Guide`_. + +#. Test, test, test. + + Run the unit tests:: + + pip install nose + make test + + Build the documentation and check the output for different builders:: + + cd docs + make clean html text man info latexpdf + + Run the unit tests under different Python environments using + :program:`tox`:: + + pip install tox + tox -v + + Add a new unit test in the ``tests`` directory if you can. + + For bug fixes, first add a test that fails without your changes and passes + after they are applied. + +#. Commit your changes. :: + + hg commit -m 'Add useful new feature that does this.' + + BitBucket recognizes `certain phrases`__ that can be used to automatically + update the issue tracker. + + For example:: + + hg commit -m 'Closes #42: Fix invalid markup in docstring of Foo.bar.' + + would close issue #42. + + __ https://confluence.atlassian.com/display/BITBUCKET/Automatically+Resolving+Issues+when+Users+Push+Code + +#. Push changes to your forked repository on BitBucket. :: + + hg push + +#. Submit a pull request from your repository to ``birkenfeld/sphinx`` using + the BitBucket interface. + +#. Wait for a core developer to review your changes. + + +Core Developers +~~~~~~~~~~~~~~~ + +The core developers of Sphinx have write access to the main repository. They +can commit changes, accept/reject pull requests, and manage items on the issue +tracker. + +You do not need to be a core developer or have write access to be involved in +the development of Sphinx. You can submit patches or create pull requests +from forked repositories and have a core developer add the changes for you. + +The following are some general guidelines for core developers: + +* Questionable or extensive changes should be submitted as a pull request + instead of being committed directly to the main repository. The pull + request should be reviewed by another core developer before it is merged. + +* Trivial changes can be committed directly but be sure to keep the repository + in a good working state and that all tests pass before pushing your changes. + +* When committing code written by someone else, please attribute the original + author in the commit message and any relevant :file:`CHANGES` entry. + +* Using Mercurial named branches other than ``default`` and ``stable`` is not + encouraged. + + +Coding Guide +------------ + +* Try to use the same code style as used in the rest of the project. See the + `Pocoo Styleguide`__ for more information. + + __ http://flask.pocoo.org/docs/styleguide/ + +* For non-trivial changes, please update the :file:`CHANGES` file. If your + changes alter existing behavior, please document this. + +* New features should be documented. Include examples and use cases where + appropriate. If possible, include a sample that is displayed in the + generated output. + +* When adding a new configuration variable, be sure to document it and update + :file:`sphinx/quickstart.py`. + +* Use the included :program:`utils/check_sources.py` script to check for + common formatting issues (trailing whitespace, lengthy lines, etc). + +* Add appropriate unit tests. + + +Debugging Tips +~~~~~~~~~~~~~~ + +* Delete the build cache before building documents if you make changes in the + code by running the command ``make clean`` or using the + :option:`sphinx-build -E` option. + +* Use the :option:`sphinx-build -P` option to run Pdb on exceptions. + +* Use ``node.pformat()`` and ``node.asdom().toxml()`` to generate a printable + representation of the document structure. + +* Set the configuration variable :confval:`keep_warnings` to True so warnings + will be displayed in the generated output. + +* Set the configuration variable :confval:`nitpicky` to True so that Sphinx + will complain about references without a known target. + +* Set the debugging options in the `Docutils configuration file + <http://docutils.sourceforge.net/docs/user/config.html>`_. diff --git a/doc/domains.rst b/doc/domains.rst index 3d52db3f..bd99a4c5 100644 --- a/doc/domains.rst +++ b/doc/domains.rst @@ -812,7 +812,15 @@ More domains ------------ The sphinx-contrib_ repository contains more domains available as extensions; -currently Ada, Erlang, HTTP, PHP, and Ruby domains. +currently Ada, CoffeeScript_, Erlang_, HTTP_, Jinja_, PHP_, Ruby, and Scala_ +domains. .. _sphinx-contrib: https://bitbucket.org/birkenfeld/sphinx-contrib/ + +.. _CoffeeScript: http://pypi.python.org/pypi/sphinxcontrib-coffee +.. _Erlang: http://pypi.python.org/pypi/sphinxcontrib-erlangdomain +.. _HTTP: http://pypi.python.org/pypi/sphinxcontrib-httpdomain +.. _Jinja: http://pypi.python.org/pypi/sphinxcontrib-jinjadomain +.. _Scala: http://pypi.python.org/pypi/sphinxcontrib-scaladomain +.. _PHP: http://pypi.python.org/pypi/sphinxcontrib-phpdomain diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst index ab520f70..7f9a6c61 100644 --- a/doc/ext/autodoc.rst +++ b/doc/ext/autodoc.rst @@ -120,6 +120,9 @@ inserting them into the page source under a suitable :rst:dir:`py:module`, .. versionadded:: 1.1 + .. versionchanged:: 1.2 + The option can now take arguments, i.e. the special members to document. + * For classes and exceptions, members inherited from base classes will be left out when documenting all members, unless you give the ``inherited-members`` flag option, in addition to ``members``:: @@ -194,12 +197,13 @@ inserting them into the page source under a suitable :rst:dir:`py:module`, automethod autoattribute - These work exactly like :rst:dir:`autoclass` etc., but do not offer the options - used for automatic member documentation. + These work exactly like :rst:dir:`autoclass` etc., but do not offer the + options used for automatic member documentation. For module data members and class attributes, documentation can either be put - into a special-formatted comment, or in a docstring *after* the definition. - Comments need to be either on a line of their own *before* the definition, or + into a comment with special formatting (using a ``#:`` to start the comment + instead of just ``#``), or in a docstring *after* the definition. Comments + need to be either on a line of their own *before* the definition, or immediately after the assignment *on the same line*. The latter form is restricted to one line only. diff --git a/doc/ext/linkcode.rst b/doc/ext/linkcode.rst new file mode 100644 index 00000000..a69a5b1c --- /dev/null +++ b/doc/ext/linkcode.rst @@ -0,0 +1,46 @@ +:mod:`sphinx.ext.linkcode` -- Add external links to source code +=============================================================== + +.. module:: sphinx.ext.linkcode + :synopsis: Add external links to source code. +.. moduleauthor:: Pauli Virtanen + +.. versionadded:: 1.2 + +This extension looks at your object descriptions (``.. class::``, +``.. function::`` etc.) and adds external links to code hosted +somewhere on the web. The intent is similar to the +``sphinx.ext.viewcode`` extension, but assumes the source code can be +found somewhere on the Internet. + +In your configuration, you need to specify a :confval:`linkcode_resolve` +function that returns an URL based on the object. + +.. confval:: linkcode_resolve + + This is a function ``linkcode_resolve(domain, info)``, + which should return the URL to source code corresponding to + the object in given domain with given information. + + The function should return ``None`` if no link is to be added. + + The argument ``domain`` specifies the language domain the object is + in. ``info`` is a dictionary with the following keys guaranteed to + be present (dependent on the domain): + + - ``py``: ``module`` (name of the module), ``fullname`` (name of the object) + - ``c``: ``names`` (list of names for the object) + - ``cpp``: ``names`` (list of names for the object) + - ``javascript``: ``object`` (name of the object), ``fullname`` (name of the item) + + Example: + + .. code-block:: python + + def linkcode_resolve(domain, info): + if domain != 'py': + return None + if not info['module']: + return None + filename = info['module'].replace('.', '/') + return "http://somesite/sourcerepo/%s.py" % filename diff --git a/doc/ext/math.rst b/doc/ext/math.rst index 3652b55e..91376d15 100644 --- a/doc/ext/math.rst +++ b/doc/ext/math.rst @@ -148,19 +148,12 @@ built: .. confval:: pngmath_dvipng_args Additional arguments to give to dvipng, as a list. The default value is - ``['-gamma 1.5', '-D 110']`` which makes the image a bit darker and larger - then it is by default. + ``['-gamma', '1.5', '-D', '110', '-bg', 'Transparent']`` which makes the + image a bit darker and larger then it is by default, and produces PNGs with a + transparent background. - An arguments you might want to add here is e.g. ``'-bg Transparent'``, - which produces PNGs with a transparent background. This is not enabled by - default because some Internet Explorer versions don't like transparent PNGs. - - .. note:: - - When you "add" an argument, you need to reproduce the default arguments if - you want to keep them; that is, like this:: - - pngmath_dvipng_args = ['-gamma 1.5', '-D 110', '-bg Transparent'] + .. versionchanged:: 1.2 + Now includes ``-bg Transparent`` by default. .. confval:: pngmath_use_preview diff --git a/doc/extensions.rst b/doc/extensions.rst index b9397448..07bc7fe4 100644 --- a/doc/extensions.rst +++ b/doc/extensions.rst @@ -53,6 +53,7 @@ These extensions are built in and can be activated by respective entries in the ext/todo ext/extlinks ext/viewcode + ext/linkcode ext/oldcmarkup diff --git a/doc/intro.rst b/doc/intro.rst index 5d76dd29..4d052c81 100644 --- a/doc/intro.rst +++ b/doc/intro.rst @@ -50,19 +50,15 @@ See the :ref:`pertinent section in the FAQ list <usingwith>`. Prerequisites ------------- -Sphinx needs at least **Python 2.4** or **Python 3.1** to run, as well as the +Sphinx needs at least **Python 2.5** or **Python 3.1** to run, as well as the docutils_ and Jinja2_ libraries. Sphinx should work with docutils version 0.7 or some (not broken) SVN trunk snapshot. If you like to have source code highlighting support, you must also install the Pygments_ library. -If you use **Python 2.4** you also need uuid_. - .. _reStructuredText: http://docutils.sf.net/rst.html .. _docutils: http://docutils.sf.net/ .. _Jinja2: http://jinja.pocoo.org/ .. _Pygments: http://pygments.org/ -.. The given homepage is only a directory listing so I'm using the pypi site. -.. _uuid: http://pypi.python.org/pypi/uuid/ Usage diff --git a/doc/invocation.rst b/doc/invocation.rst index 2c69d32f..da052bdb 100644 --- a/doc/invocation.rst +++ b/doc/invocation.rst @@ -227,6 +227,17 @@ The :program:`sphinx-apidoc` script has several options: This sets the maximum depth of the table of contents, if one is generated. +.. option:: -l, --follow-links + + This option makes sphinx-apidoc follow symbolic links when recursing the + filesystem to discover packages and modules. You may need it if you want + to generate documentation from a source directory managed by + `collective.recipe.omelette + <http://pypi.python.org/pypi/collective.recipe.omelette/>`_. + By default, symbolic links are skipped. + + .. versionadded:: 1.2 + .. option:: -T, --no-toc This prevents the generation of a table-of-contents file ``modules.rst``. diff --git a/doc/markup/misc.rst b/doc/markup/misc.rst index 3a2ffa32..f5eaac9c 100644 --- a/doc/markup/misc.rst +++ b/doc/markup/misc.rst @@ -182,13 +182,6 @@ Including content based on tags The format of the current builder (``html``, ``latex`` or ``text``) is always set as a tag. - .. note:: - - Due to docutils' specifics of parsing of directive content, you cannot put - a section with the same level as the main document heading inside an - ``only`` directive. Such sections will appear to be ignored in the parsed - document. - .. versionadded:: 0.6 @@ -46,26 +46,20 @@ A development egg can be found `here requires = ['Pygments>=1.2', 'Jinja2>=2.3', 'docutils>=0.7'] -if sys.version_info < (2, 4): - print('ERROR: Sphinx requires at least Python 2.4 to run.') - sys.exit(1) +if sys.version_info[:3] >= (3, 3, 0): + requires[2] = 'docutils>=0.10' if sys.version_info < (2, 5): - # Python 2.4's distutils doesn't automatically install an egg-info, - # so an existing docutils install won't be detected -- in that case, - # remove the dependency from setup.py - try: - import docutils - if int(docutils.__version__[2]) < 4: - raise ValueError('docutils not recent enough') - except: - pass - else: - del requires[-1] - - # The uuid module is new in the stdlib in 2.5 - requires.append('uuid>=1.30') + print('ERROR: Sphinx requires at least Python 2.5 to run.') + sys.exit(1) +# tell distribute to use 2to3 with our own fixers +extra = {} +if sys.version_info >= (3, 0): + extra.update( + use_2to3=True, + use_2to3_fixers=['custom_fixers'] + ) # Provide a "compile_catalog" command that also creates the translated # JavaScript files if Babel is available. @@ -164,7 +158,7 @@ else: setup( name='Sphinx', version=sphinx.__version__, - url='http://sphinx.pocoo.org/', + url='http://sphinx-doc.org/', download_url='http://pypi.python.org/pypi/Sphinx', license='BSD', author='Georg Brandl', @@ -203,6 +197,5 @@ setup( }, install_requires=requires, cmdclass=cmdclass, - use_2to3=True, - use_2to3_fixers=['custom_fixers'], + **extra ) diff --git a/sphinx/__init__.py b/sphinx/__init__.py index e1ffc2ed..4538eb4c 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -38,11 +38,20 @@ if '+' in __version__ or 'pre' in __version__: def main(argv=sys.argv): """Sphinx build "main" command-line entry.""" - if sys.version_info[:3] < (2, 4, 0): + if sys.version_info[:3] < (2, 5, 0): sys.stderr.write('Error: Sphinx requires at least ' - 'Python 2.4 to run.\n') + 'Python 2.5 to run.\n') return 1 - + if sys.version_info[:3] >= (3, 3, 0): + try: + import docutils + x, y = docutils.__version__.split('.')[:2] + if (int(x), int(y)) < (0, 10): + sys.stderr.write('Error: Sphinx requires at least ' + 'Docutils 0.10 for Python 3.3 and above.\n') + return 1 + except Exception: + pass try: from sphinx import cmdline except ImportError: diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index ec1a8a33..78ba8877 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -157,7 +157,8 @@ def recurse_tree(rootpath, excludes, opts): root_package = None toplevels = [] - for root, subs, files in os.walk(rootpath): + followlinks = getattr(opts, 'followlinks', False) + for root, subs, files in os.walk(rootpath, followlinks=followlinks): if is_excluded(root, excludes): del subs[:] continue @@ -246,6 +247,10 @@ Note: By default this script will not overwrite already created files.""") '(default: 4)', type='int', default=4) parser.add_option('-f', '--force', action='store_true', dest='force', help='Overwrite all files') + parser.add_option('-l', '--follow-links', action='store_true', + dest='followlinks', default=False, + help='Follow symbolic links. Powerful when combined ' + 'with collective.recipe.omelette.') parser.add_option('-n', '--dry-run', action='store_true', dest='dryrun', help='Run the script without creating files') parser.add_option('-T', '--no-toc', action='store_true', dest='notoc', diff --git a/sphinx/application.py b/sphinx/application.py index bfb39a70..291b2931 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -409,7 +409,7 @@ class Sphinx(object): if domain.name not in self.domains: raise ExtensionError('domain %s not yet registered' % domain.name) if not issubclass(domain, self.domains[domain.name]): - raise ExtensionError('new domain not a subclass of registered ' + raise ExtensionError('new domain not a subclass of registered %s ' 'domain' % domain.name) self.domains[domain.name] = domain diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 5240a1c7..4355b801 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -334,4 +334,6 @@ BUILTIN_BUILDERS = { 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'), 'websupport': ('websupport', 'WebSupportBuilder'), 'gettext': ('gettext', 'MessageCatalogBuilder'), + 'xml': ('xml', 'XMLBuilder'), + 'pseudoxml': ('xml', 'PseudoXMLBuilder'), } diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 81840374..f5218673 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -610,7 +610,8 @@ class StandaloneHTMLBuilder(Builder): """ Builder.post_process_images(self, doctree) for node in doctree.traverse(nodes.image): - if not node.has_key('scale') or \ + scale_keys = ('scale', 'width', 'height') + if not any((key in node) for key in scale_keys) or \ isinstance(node.parent, nodes.reference): # docutils does unfortunately not preserve the # ``target`` attribute on images, so we need to check diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index a8adcdac..bcf42741 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -102,7 +102,8 @@ class CheckExternalLinksBuilder(Builder): def check(): # check for various conditions without bothering the network - if len(uri) == 0 or uri[0] == '#' or uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': + if len(uri) == 0 or uri[0] == '#' or \ + uri[0:7] == 'mailto:' or uri[0:4] == 'ftp:': return 'unchecked', '' elif not (uri[0:5] == 'http:' or uri[0:6] == 'https:'): return 'local', '' diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py new file mode 100644 index 00000000..74c1fc06 --- /dev/null +++ b/sphinx/builders/xml.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.xml + ~~~~~~~~~~~~~~~~~~~ + + Docutils-native XML and pseudo-XML builders. + + :copyright: Copyright 2007-2012 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +from docutils.io import StringOutput + +from sphinx.builders import Builder +from sphinx.util.osutil import ensuredir, os_path +from sphinx.writers.xml import XMLWriter, PseudoXMLWriter + +class XMLBuilder(Builder): + """ + Builds Docutils-native XML. + """ + name = 'xml' + format = 'xml' + out_suffix = '.xml' + + _writer_class = XMLWriter + + def init(self): + pass + + def get_outdated_docs(self): + for docname in self.env.found_docs: + if docname not in self.env.all_docs: + yield docname + continue + targetname = self.env.doc2path(docname, self.outdir, + self.out_suffix) + try: + targetmtime = path.getmtime(targetname) + except Exception: + targetmtime = 0 + try: + srcmtime = path.getmtime(self.env.doc2path(docname)) + if srcmtime > targetmtime: + yield docname + except EnvironmentError: + # source doesn't exist anymore + pass + + def get_target_uri(self, docname, typ=None): + return '' + + def prepare_writing(self, docnames): + self.writer = self._writer_class(self) + + def write_doc(self, docname, doctree): + destination = StringOutput(encoding='utf-8') + self.writer.write(doctree, destination) + outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix) + ensuredir(path.dirname(outfilename)) + try: + f = codecs.open(outfilename, 'w', 'utf-8') + try: + f.write(self.writer.output) + finally: + f.close() + except (IOError, OSError), err: + self.warn("error writing file %s: %s" % (outfilename, err)) + + def finish(self): + pass + + +class PseudoXMLBuilder(XMLBuilder): + """ + Builds pseudo-XML for display purposes. + """ + name = 'pseudoxml' + format = 'pseudoxml' + out_suffix = '.pseudoxml' + + _writer_class = PseudoXMLWriter diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index e9d70765..eb05d176 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -231,7 +231,7 @@ def main(argv): 'can be provided next time.') print >>error, ( 'Either send bugs to the mailing list at ' - '<http://groups.google.com/group/sphinx-dev/>,\n' + '<http://groups.google.com/group/sphinx-users/>,\n' 'or report them in the tracker at ' '<http://bitbucket.org/birkenfeld/sphinx/issues/>. Thanks!') return 1 diff --git a/sphinx/config.py b/sphinx/config.py index c020992b..3599ccfc 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -184,6 +184,9 @@ class Config(object): # gettext options gettext_compact = (True, 'gettext'), + + # XML options + xml_pretty = (True, 'env'), ) def __init__(self, dirname, filename, overrides, tags): diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index aa4142d6..506d4be9 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -338,9 +338,46 @@ class Only(Directive): node.document = self.state.document set_source_info(self, node) node['expr'] = self.arguments[0] - self.state.nested_parse(self.content, self.content_offset, node, - match_titles=1) - return [node] + + # Same as util.nested_parse_with_titles but try to handle nested + # sections which should be raised higher up the doctree. + surrounding_title_styles = self.state.memo.title_styles + surrounding_section_level = self.state.memo.section_level + self.state.memo.title_styles = [] + self.state.memo.section_level = 0 + try: + result = self.state.nested_parse(self.content, self.content_offset, + node, match_titles=1) + title_styles = self.state.memo.title_styles + if (not surrounding_title_styles + or not title_styles + or title_styles[0] not in surrounding_title_styles + or not self.state.parent): + # No nested sections so no special handling needed. + return [node] + # Calculate the depths of the current and nested sections. + current_depth = 0 + parent = self.state.parent + while parent: + current_depth += 1 + parent = parent.parent + current_depth -= 2 + title_style = title_styles[0] + nested_depth = len(surrounding_title_styles) + if title_style in surrounding_title_styles: + nested_depth = surrounding_title_styles.index(title_style) + # Use these depths to determine where the nested sections should + # be placed in the doctree. + n_sects_to_raise = current_depth - nested_depth + 1 + parent = self.state.parent + for i in xrange(n_sects_to_raise): + if parent.parent: + parent = parent.parent + parent.append(node) + return [] + finally: + self.state.memo.title_styles = surrounding_title_styles + self.state.memo.section_level = surrounding_section_level class Include(BaseInclude): diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index a6392c1c..e4204aab 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -672,8 +672,9 @@ class DefinitionParser(object): except ValueError: return False - def _parse_builtin(self, modifier): - path = [modifier] + def _parse_builtin(self, modifiers): + modifier = modifiers[-1] + path = modifiers following = self._modifiers[modifier] while 1: self.skip_ws() @@ -730,9 +731,10 @@ class DefinitionParser(object): # impossible for a template to follow, so what # we do is go to a different function that just # eats types - if following is not None: - return self._parse_builtin(modifier) modifiers.append(modifier) + if following is not None: + return self._parse_builtin(modifiers) + self.skip_ws() else: self.backout() break @@ -760,17 +762,33 @@ class DefinitionParser(object): self.skip_ws() if self.match(_string_re): return self.matched_text - idx1 = self.definition.find(',', self.pos) - idx2 = self.definition.find(')', self.pos) - if idx1 < 0: - idx = idx2 - elif idx2 < 0: - idx = idx1 - else: - idx = min(idx1, idx2) - if idx < 0: - self.fail('unexpected end in default expression') - rv = self.definition[self.pos:idx] + paren_stack_depth = 0 + max_pos = len(self.definition) + rv_start = self.pos + while 1: + idx0 = self.definition.find('(', self.pos) + idx1 = self.definition.find(',', self.pos) + idx2 = self.definition.find(')', self.pos) + if idx0 < 0: + idx0 = max_pos + if idx1 < 0: + idx1 = max_pos + if idx2 < 0: + idx2 = max_pos + idx = min(idx0, idx1, idx2) + if idx >= max_pos: + self.fail('unexpected end in default expression') + if idx == idx0: + paren_stack_depth += 1 + elif idx == idx2: + paren_stack_depth -= 1 + if paren_stack_depth < 0: + break + elif paren_stack_depth == 0: + break + self.pos = idx+1 + + rv = self.definition[rv_start:idx] self.pos = idx return rv @@ -836,7 +854,7 @@ class DefinitionParser(object): visibility = 'public' if self.match(_visibility_re): visibility = self.matched_text - static = self.skip_word('static') + static = self.skip_word_and_ws('static') return visibility, static def parse_type(self): diff --git a/sphinx/environment.py b/sphinx/environment.py index ec302390..cada082d 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -66,6 +66,7 @@ default_settings = { 'doctitle_xform': False, 'sectsubtitle_xform': False, 'halt_level': 5, + 'file_insertion_enabled': True, } # This is increased every time an environment attribute is added @@ -193,6 +194,7 @@ class Locale(Transform): Replace translatable nodes with their translated doctree. """ default_priority = 0 + def apply(self): env = self.document.settings.env settings, source = self.document.settings, self.document['source'] @@ -213,17 +215,63 @@ class Locale(Transform): parser = RSTParser() for node, msg in extract_messages(self.document): - patch = new_document(source, settings) msgstr = catalog.gettext(msg) # XXX add marker to untranslated parts if not msgstr or msgstr == msg: # as-of-yet untranslated continue + + patch = new_document(source, settings) parser.parse(msgstr, patch) patch = patch[0] # XXX doctest and other block markup if not isinstance(patch, nodes.paragraph): continue # skip for now - for child in patch.children: # update leaves + + # auto-numbered foot note reference should use original 'ids'. + is_autonumber_footnote_ref = lambda node: \ + isinstance(node, nodes.footnote_reference) \ + and node.get('auto') == 1 + old_foot_refs = node.traverse(is_autonumber_footnote_ref) + new_foot_refs = patch.traverse(is_autonumber_footnote_ref) + if len(old_foot_refs) != len(new_foot_refs): + env.warn_node('inconsistent footnote references in ' + 'translated message', node) + for old, new in zip(old_foot_refs, new_foot_refs): + new['ids'] = old['ids'] + self.document.autofootnote_refs.remove(old) + self.document.note_autofootnote_ref(new) + + # reference should use original 'refname'. + # * reference target ".. _Python: ..." is not translatable. + # * section refname is not translatable. + # * inline reference "`Python <...>`_" has no 'refname'. + is_refnamed_ref = lambda node: \ + isinstance(node, nodes.reference) \ + and 'refname' in node + old_refs = node.traverse(is_refnamed_ref) + new_refs = patch.traverse(is_refnamed_ref) + applied_refname_map = {} + if len(old_refs) != len(new_refs): + env.warn_node('inconsistent references in ' + 'translated message', node) + for new in new_refs: + if new['refname'] in applied_refname_map: + # 2nd appearance of the reference + new['refname'] = applied_refname_map[new['refname']] + elif old_refs: + # 1st appearance of the reference in old_refs + old = old_refs.pop(0) + refname = old['refname'] + new['refname'] = refname + applied_refname_map[new['refname']] = refname + else: + # the reference is not found in old_refs + applied_refname_map[new['refname']] = new['refname'] + + self.document.note_refname(new) + + # update leaves + for child in patch.children: child.parent = node node.children = patch.children @@ -782,7 +830,11 @@ class BuildEnvironment: app.emit('doctree-read', doctree) # store time of build, for outdated files detection - self.all_docs[docname] = time.time() + # (Some filesystems have coarse timestamp resolution; + # therefore time.time() can be older than filesystem's timestamp. + # For example, FAT32 has 2sec timestamp resolution.) + self.all_docs[docname] = max( + time.time(), path.getmtime(self.doc2path(docname))) if self.versioning_condition: # get old doctree @@ -1759,4 +1811,3 @@ class BuildEnvironment: if 'orphan' in self.metadata[docname]: continue self.warn(docname, 'document isn\'t included in any toctree') - diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 9c6575f5..691fef7a 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -489,20 +489,26 @@ class Documenter(object): If *want_all* is True, return all members. Else, only return those members given by *self.options.members* (which may also be none). """ + analyzed_member_names = set() + if self.analyzer: + attr_docs = self.analyzer.find_attr_docs() + namespace = '.'.join(self.objpath) + for item in attr_docs.iteritems(): + if item[0][0] == namespace: + analyzed_member_names.add(item[0][1]) if not want_all: if not self.options.members: return False, [] # specific members given - ret = [] + members = [] for mname in self.options.members: try: - ret.append((mname, self.get_attr(self.object, mname))) + members.append((mname, self.get_attr(self.object, mname))) except AttributeError: - self.directive.warn('missing attribute %s in object %s' - % (mname, self.fullname)) - return False, ret - - if self.options.inherited_members: + if mname not in analyzed_member_names: + self.directive.warn('missing attribute %s in object %s' + % (mname, self.fullname)) + elif self.options.inherited_members: # safe_getmembers() uses dir() which pulls in members from all # base classes members = safe_getmembers(self.object) @@ -521,13 +527,10 @@ class Documenter(object): for mname in obj_dict.keys()] membernames = set(m[0] for m in members) # add instance attributes from the analyzer - if self.analyzer: - attr_docs = self.analyzer.find_attr_docs() - namespace = '.'.join(self.objpath) - for item in attr_docs.iteritems(): - if item[0][0] == namespace: - if item[0][1] not in membernames: - members.append((item[0][1], INSTANCEATTR)) + for aname in analyzed_member_names: + if aname not in membernames and \ + (want_all or aname in self.options.members): + members.append((aname, INSTANCEATTR)) return False, sorted(members) def filter_members(self, members, want_all): @@ -573,7 +576,11 @@ class Documenter(object): if want_all and membername.startswith('__') and \ membername.endswith('__') and len(membername) > 4: # special __methods__ - if self.options.special_members and membername != '__doc__': + if self.options.special_members is ALL and \ + membername != '__doc__': + keep = has_doc or self.options.undoc_members + elif self.options.special_members and \ + membername in self.options.special_members: keep = has_doc or self.options.undoc_members elif want_all and membername.startswith('_'): # ignore members whose name starts with _ by default @@ -748,7 +755,7 @@ class ModuleDocumenter(Documenter): 'show-inheritance': bool_option, 'synopsis': identity, 'platform': identity, 'deprecated': bool_option, 'member-order': identity, 'exclude-members': members_set_option, - 'private-members': bool_option, 'special-members': bool_option, + 'private-members': bool_option, 'special-members': members_option, } @classmethod @@ -862,7 +869,7 @@ class DocstringSignatureMixin(object): """ def _find_signature(self, encoding=None): - docstrings = Documenter.get_doc(self, encoding, 2) + docstrings = Documenter.get_doc(self, encoding) if len(docstrings) != 1: return doclines = docstrings[0] @@ -877,6 +884,9 @@ class DocstringSignatureMixin(object): # the base name must match ours if not self.objpath or base != self.objpath[-1]: return + # re-prepare docstring to ignore indentation after signature + docstrings = Documenter.get_doc(self, encoding, 2) + doclines = docstrings[0] # ok, now jump over remaining empty lines and set the remaining # lines as the new doclines i = 1 @@ -949,7 +959,7 @@ class ClassDocumenter(ModuleLevelDocumenter): 'noindex': bool_option, 'inherited-members': bool_option, 'show-inheritance': bool_option, 'member-order': identity, 'exclude-members': members_set_option, - 'private-members': bool_option, 'special-members': bool_option, + 'private-members': bool_option, 'special-members': members_option, } @classmethod @@ -1098,7 +1108,7 @@ class MethodDocumenter(DocstringSignatureMixin, ClassLevelDocumenter): """ objtype = 'method' member_order = 50 - priority = 0 + priority = 1 # must be more than FunctionDocumenter @classmethod def can_document_member(cls, member, membername, isattr, parent): diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index 28938140..593c76e3 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -125,7 +125,7 @@ def render_dot(self, code, options, format, prefix='graphviz'): str(self.builder.config.graphviz_dot) + \ str(self.builder.config.graphviz_dot_args) ).encode('utf-8') - + fname = '%s-%s.%s' % (prefix, sha(hashkey).hexdigest(), format) if hasattr(self.builder, 'imgpath'): # HTML @@ -229,10 +229,10 @@ def render_dot_html(self, node, code, options, prefix='graphviz', (fname, alt, imgcss)) else: # has a map: get the name of the map and connect the parts - mapname = mapname_re.match(imgmap[0]).group(1) + mapname = mapname_re.match(imgmap[0].decode('utf-8')).group(1) self.body.append('<img src="%s" alt="%s" usemap="#%s" %s/>\n' % (fname, alt, mapname, imgcss)) - self.body.extend(imgmap) + self.body.extend([item.decode('utf-8') for item in imgmap]) if node.get('caption') and not inline: self.body.append('</p>\n<p class="caption">') self.body.append(self.encode(node['caption'])) diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index be7a6766..570a2103 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -168,7 +168,7 @@ class InheritanceGraph(object): for cls in classes: recurse(cls) - return all_classes.values() + return all_classes def class_name(self, cls, parts=0): """Given a class object, return a fully-qualified name. @@ -188,7 +188,7 @@ class InheritanceGraph(object): def get_all_class_names(self): """Get all of the class names involved in the graph.""" - return [fullname for (_, fullname, _) in self.class_info] + return [fullname for (_, fullname, _) in self.class_info.values()] # These are the default attrs for graphviz default_graph_attrs = { @@ -199,8 +199,8 @@ class InheritanceGraph(object): 'shape': 'box', 'fontsize': 10, 'height': 0.25, - 'fontname': 'Vera Sans, DejaVu Sans, Liberation Sans, ' - 'Arial, Helvetica, sans', + 'fontname': '"Vera Sans, DejaVu Sans, Liberation Sans, ' + 'Arial, Helvetica, sans"', 'style': '"setlinewidth(0.5)"', } default_edge_attrs = { @@ -241,12 +241,16 @@ class InheritanceGraph(object): res.append('digraph %s {\n' % name) res.append(self._format_graph_attrs(g_attrs)) - for name, fullname, bases in self.class_info: + for cls, (name, fullname, bases) in self.class_info.items(): # Write the node this_node_attrs = n_attrs.copy() - url = urls.get(fullname) - if url is not None: - this_node_attrs['URL'] = '"%s"' % url + if fullname in urls: + this_node_attrs['URL'] = '"%s"' % urls[fullname] + # Use first line of docstring as tooltip, if available + if cls.__doc__: + doc = cls.__doc__.strip().split("\n")[0] + if doc: + this_node_attrs['tooltip'] = '"%s"' % doc res.append(' "%s" [%s];\n' % (name, self._format_node_attrs(this_node_attrs))) diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index 9551e3cd..d0c812b3 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -188,7 +188,17 @@ def load_mappings(app): if update: env.intersphinx_inventory = {} env.intersphinx_named_inventory = {} - for name, _, invdata in cache.itervalues(): + # Duplicate values in different inventories will shadow each + # other; which one will override which can vary between builds + # since they are specified using an unordered dict. To make + # it more consistent, we sort the named inventories and then + # add the unnamed inventories last. This means that the + # unnamed inventories will shadow the named ones but the named + # ones can still be accessed when the name is specified. + cached_vals = list(cache.itervalues()) + named_vals = sorted(v for v in cached_vals if v[0]) + unnamed_vals = [v for v in cached_vals if not v[0]] + for name, _, invdata in named_vals + unnamed_vals: if name: env.intersphinx_named_inventory[name] = invdata for type, objects in invdata.iteritems(): diff --git a/sphinx/ext/linkcode.py b/sphinx/ext/linkcode.py new file mode 100644 index 00000000..be834001 --- /dev/null +++ b/sphinx/ext/linkcode.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +""" + sphinx.ext.linkcode + ~~~~~~~~~~~~~~~~~~~ + + Add external links to module code in Python object descriptions. + + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from docutils import nodes + +from sphinx import addnodes +from sphinx.locale import _ +from sphinx.errors import SphinxError + +class LinkcodeError(SphinxError): + category = "linkcode error" + +def doctree_read(app, doctree): + env = app.builder.env + + resolve_target = getattr(env.config, 'linkcode_resolve', None) + if not callable(env.config.linkcode_resolve): + raise LinkcodeError( + "Function `linkcode_resolve` is not given in conf.py") + + domain_keys = dict( + py=['module', 'fullname'], + c=['names'], + cpp=['names'], + js=['object', 'fullname'], + ) + + for objnode in doctree.traverse(addnodes.desc): + domain = objnode.get('domain') + uris = set() + for signode in objnode: + if not isinstance(signode, addnodes.desc_signature): + continue + + # Convert signode to a specified format + info = {} + for key in domain_keys.get(domain, []): + value = signode.get(key) + if not value: + value = '' + info[key] = value + if not info: + continue + + # Call user code to resolve the link + uri = resolve_target(domain, info) + if not uri: + # no source + continue + + if uri in uris or not uri: + # only one link per name, please + continue + uris.add(uri) + + onlynode = addnodes.only(expr='html') + onlynode += nodes.reference('', '', internal=False, refuri=uri) + onlynode[0] += nodes.inline('', _('[source]'), + classes=['viewcode-link']) + signode += onlynode + +def setup(app): + app.connect('doctree-read', doctree_read) + app.add_config_value('linkcode_resolve', None, '') diff --git a/sphinx/ext/oldcmarkup.py b/sphinx/ext/oldcmarkup.py index 9dad85f4..a6eeee32 100644 --- a/sphinx/ext/oldcmarkup.py +++ b/sphinx/ext/oldcmarkup.py @@ -16,7 +16,7 @@ from sphinx.util.compat import Directive _warned_oldcmarkup = False WARNING_MSG = 'using old C markup; please migrate to new-style markup ' \ '(e.g. c:function instead of cfunction), see ' \ - 'http://sphinx.pocoo.org/domains.html' + 'http://sphinx-doc.org/domains.html' class OldCDirective(Directive): diff --git a/sphinx/ext/pngmath.py b/sphinx/ext/pngmath.py index 78c331a6..549dfb83 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -237,7 +237,8 @@ def setup(app): app.add_config_value('pngmath_latex', 'latex', 'html') app.add_config_value('pngmath_use_preview', False, 'html') app.add_config_value('pngmath_dvipng_args', - ['-gamma 1.5', '-D 110'], 'html') + ['-gamma', '1.5', '-D', '110', '-bg', 'Transparent'], + 'html') app.add_config_value('pngmath_latex_args', [], 'html') app.add_config_value('pngmath_latex_preamble', '', 'html') app.add_config_value('pngmath_add_tooltips', True, 'html') diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 2f61c1ef..ec1eca92 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -143,6 +143,12 @@ class PygmentsBridge(object): # just replace all non-ASCII characters. src = src.encode('ascii', 'replace') + if (3, 0) <= sys.version_info < (3, 2): + # Python 3.1 can't process '\r' as linesep. + # `parser.suite("print('hello')\r\n")` cause error. + if '\r\n' in src: + src = src.replace('\r\n', '\n') + if parser is None: return True @@ -207,6 +213,8 @@ class PygmentsBridge(object): if self.dest == 'html': return hlsource else: + if not isinstance(hlsource, unicode): # Py2 / Pygments < 1.6 + hlsource = hlsource.decode() return hlsource.translate(tex_hl_escape_map_new) except ErrorToken: # this is most probably not the selected language, diff --git a/sphinx/locale/bn/LC_MESSAGES/sphinx.mo b/sphinx/locale/bn/LC_MESSAGES/sphinx.mo Binary files differindex cb06ba98..b5da72d2 100644 --- a/sphinx/locale/bn/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/bn/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/bn/LC_MESSAGES/sphinx.po b/sphinx/locale/bn/LC_MESSAGES/sphinx.po index 49549939..69bd75e5 100644 --- a/sphinx/locale/bn/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/bn/LC_MESSAGES/sphinx.po @@ -639,10 +639,10 @@ msgstr "%(last_updated)s সরà§à¦¬à¦¶à§‡à¦· পরিবরà§à¦¤à¦¨ করঠ#: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s দিয়ে " +"<a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s দিয়ে " "তৈরী।" #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.mo b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo Binary files differindex fc373e47..bdcc3aa4 100644 --- a/sphinx/locale/ca/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/ca/LC_MESSAGES/sphinx.po b/sphinx/locale/ca/LC_MESSAGES/sphinx.po index c876228e..c1d5a1b3 100644 --- a/sphinx/locale/ca/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ca/LC_MESSAGES/sphinx.po @@ -633,10 +633,10 @@ msgstr "Última actualització el %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Creat amb <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Creat amb <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo Binary files differindex ba0798db..58037693 100644 --- a/sphinx/locale/cs/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/cs/LC_MESSAGES/sphinx.po b/sphinx/locale/cs/LC_MESSAGES/sphinx.po index 9ed728ed..d42601bb 100644 --- a/sphinx/locale/cs/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/cs/LC_MESSAGES/sphinx.po @@ -636,10 +636,10 @@ msgstr "Aktualizováno dne %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"VytvoÅ™eno pomocà <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"VytvoÅ™eno pomocà <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/da/LC_MESSAGES/sphinx.mo b/sphinx/locale/da/LC_MESSAGES/sphinx.mo Binary files differindex d0006ee2..9c838221 100644 --- a/sphinx/locale/da/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/da/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/da/LC_MESSAGES/sphinx.po b/sphinx/locale/da/LC_MESSAGES/sphinx.po index df991aec..cf74a389 100644 --- a/sphinx/locale/da/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/da/LC_MESSAGES/sphinx.po @@ -628,10 +628,10 @@ msgstr "Sidst opdateret %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Bygget med <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Bygget med <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.mo b/sphinx/locale/de/LC_MESSAGES/sphinx.mo Binary files differindex ce12882d..07748898 100644 --- a/sphinx/locale/de/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/de/LC_MESSAGES/sphinx.po b/sphinx/locale/de/LC_MESSAGES/sphinx.po index 50ba7490..50db2fba 100644 --- a/sphinx/locale/de/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/de/LC_MESSAGES/sphinx.po @@ -629,10 +629,10 @@ msgstr "Zuletzt aktualisiert am %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Mit <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s " +"Mit <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s " "erstellt." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.mo b/sphinx/locale/es/LC_MESSAGES/sphinx.mo Binary files differindex 87b44fe6..825cfedb 100644 --- a/sphinx/locale/es/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/es/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/es/LC_MESSAGES/sphinx.po b/sphinx/locale/es/LC_MESSAGES/sphinx.po index fbcba7d9..fda55ec7 100644 --- a/sphinx/locale/es/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/es/LC_MESSAGES/sphinx.po @@ -642,10 +642,10 @@ msgstr "Actualizado por última vez en %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Creado con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Creado con <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/et/LC_MESSAGES/sphinx.js b/sphinx/locale/et/LC_MESSAGES/sphinx.js index 5f51a53a..abf00ee5 100644 --- a/sphinx/locale/et/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/et/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "et", "plural_expr": "(n != 1)", "messages": {"Hide Search Matches": "Varja otsingutulemused", "Permalink to this definition": "P\u00fcsilink sellele definitsioonile", "Expand sidebar": "N\u00e4ita k\u00fclgriba", "Permalink to this headline": "P\u00fcsilink sellele pealkirjale", "Collapse sidebar": "Varja k\u00fclgriba"}});
\ No newline at end of file +Documentation.addTranslations({"locale": "et", "plural_expr": "(n != 1)", "messages": {"Hide Search Matches": "Varja otsingutulemused", "Permalink to this definition": "P\u00fcsiviit sellele definitsioonile", "Expand sidebar": "N\u00e4ita k\u00fclgriba", "Permalink to this headline": "P\u00fcsiviit sellele pealkirjale", "Collapse sidebar": "Varja k\u00fclgriba"}});
\ No newline at end of file diff --git a/sphinx/locale/et/LC_MESSAGES/sphinx.mo b/sphinx/locale/et/LC_MESSAGES/sphinx.mo Binary files differindex 14b911c0..176d513e 100644 --- a/sphinx/locale/et/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/et/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/et/LC_MESSAGES/sphinx.po b/sphinx/locale/et/LC_MESSAGES/sphinx.po index a687f297..3d2e56f4 100644 --- a/sphinx/locale/et/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/et/LC_MESSAGES/sphinx.po @@ -1,15 +1,20 @@ # Estonian translations for Sphinx. -# Copyright (C) 2010 ORGANIZATION +# Sphinxi eesti keele tõlge. +# +# Copyright (C) 2011‒2012 Pocoo Team. +# # This file is distributed under the same license as the Sphinx project. -# FIRST AUTHOR <EMAIL@ADDRESS>, 2010. # +# Aivar Annamaa <aivar.annamaa@gmail.com>, 2011 +# Ivar Smolin <okul at linux ee>, 2012 + msgid "" msgstr "" -"Project-Id-Version: Sphinx 1.0pre/8b971dbc7d36\n" +"Project-Id-Version: Sphinx 1.1.3" "Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" "POT-Creation-Date: 2011-09-21 10:06+0200\n" -"PO-Revision-Date: 2011-09-18 11:40+0200\n" -"Last-Translator: Aivar Annamaa <aivar.annamaa@gmail.com>\n" +"PO-Revision-Date: 2012-09-15 12:56+0300\n" +"Last-Translator: Ivar Smolin <okul@linux.ee>\n" "Language-Team: \n" "Plural-Forms: nplurals=2; plural=(n != 1)\n" "MIME-Version: 1.0\n" @@ -18,7 +23,7 @@ msgstr "" "Generated-By: Babel 0.9.6\n" #: sphinx/config.py:81 -#, fuzzy, python-format +#, python-format msgid "%s %s documentation" msgstr "%s %s dokumentatsioon" @@ -26,22 +31,22 @@ msgstr "%s %s dokumentatsioon" #: sphinx/writers/manpage.py:67 sphinx/writers/texinfo.py:203 #, python-format msgid "%B %d, %Y" -msgstr "%B %d, %Y" +msgstr "%d. %B %Y" #: sphinx/environment.py:1625 #, python-format msgid "see %s" -msgstr "" +msgstr "vaata %s" #: sphinx/environment.py:1628 #, python-format msgid "see also %s" -msgstr "" +msgstr "vaata ka %s" #: sphinx/roles.py:175 -#, fuzzy, python-format +#, python-format msgid "Python Enhancement Proposals; PEP %s" -msgstr "Python Enhancement Proposals!PEP %s" +msgstr "Pythoni täiustusettepanekud, PEP %s" #: sphinx/builders/changes.py:73 msgid "Builtins" @@ -54,7 +59,7 @@ msgstr "Mooduli tase" #: sphinx/builders/html.py:274 #, python-format msgid "%b %d, %Y" -msgstr "%b %d, %Y" +msgstr "%d. %b %Y" #: sphinx/builders/html.py:293 sphinx/themes/basic/defindex.html:30 msgid "General Index" @@ -73,8 +78,11 @@ msgid "previous" msgstr "eelmine" #: sphinx/builders/latex.py:141 sphinx/builders/texinfo.py:196 +# paistab olevat ristviitamiseks. ei oska öelda, kas siia sobiks paremini +# 'Sektsioonis' või 'Teema' või midagi muud. sestap panin enamvähem lollikindla +# 'Pealkirjas'. (okul) msgid " (in " -msgstr " (in " +msgstr " (pealkirjas " #: sphinx/directives/other.py:136 msgid "Section author: " @@ -196,9 +204,9 @@ msgid "%s() (%s method)" msgstr "%s() (%s meetod)" #: sphinx/domains/javascript.py:109 -#, fuzzy, python-format +#, python-format msgid "%s() (class)" -msgstr "%s (C++ klass)" +msgstr "%s() (klass)" #: sphinx/domains/javascript.py:111 #, python-format @@ -216,7 +224,7 @@ msgstr "Argumendid" #: sphinx/domains/javascript.py:125 msgid "Throws" -msgstr "Throws" +msgstr "" #: sphinx/domains/javascript.py:164 sphinx/domains/python.py:560 msgid "data" @@ -232,7 +240,7 @@ msgstr "Muutujad" #: sphinx/domains/python.py:104 msgid "Raises" -msgstr "Raises" +msgstr "" #: sphinx/domains/python.py:255 sphinx/domains/python.py:312 #: sphinx/domains/python.py:324 sphinx/domains/python.py:337 @@ -278,12 +286,12 @@ msgstr "%s() (%s staatiline meetod)" #: sphinx/domains/python.py:341 #, python-format msgid "%s() (%s.%s class method)" -msgstr "%s() (%s.%s klassi meetod)" +msgstr "%s() (klassi %s.%s meetod)" #: sphinx/domains/python.py:344 #, python-format msgid "%s() (%s class method)" -msgstr "%s() (%s klassi meetod)" +msgstr "%s() (klassi %s meetod)" #: sphinx/domains/python.py:354 #, python-format @@ -305,7 +313,7 @@ msgstr "moodulid" #: sphinx/domains/python.py:537 msgid "Deprecated" -msgstr "Ebaasoovitav" +msgstr "Iganenud" #: sphinx/domains/python.py:562 sphinx/locale/__init__.py:179 msgid "exception" @@ -328,9 +336,8 @@ msgid "module" msgstr "moodul" #: sphinx/domains/python.py:695 -#, fuzzy msgid " (deprecated)" -msgstr "Ebaasoovitav" +msgstr " (iganenud)" #: sphinx/domains/rst.py:55 #, python-format @@ -362,11 +369,11 @@ msgstr "%s käsurea valik; %s" #: sphinx/domains/std.py:393 msgid "glossary term" -msgstr "termin" +msgstr "sõnastiku termin" #: sphinx/domains/std.py:394 msgid "grammar token" -msgstr "grammatika märgend" +msgstr "grammatika märk" #: sphinx/domains/std.py:395 msgid "reference label" @@ -378,7 +385,7 @@ msgstr "keskkonnamuutuja" #: sphinx/domains/std.py:397 msgid "program option" -msgstr "programmi seade" +msgstr "programmi valik" #: sphinx/domains/std.py:427 sphinx/themes/basic/genindex-single.html:32 #: sphinx/themes/basic/genindex-split.html:11 @@ -395,26 +402,26 @@ msgstr "Mooduli indeks" #: sphinx/domains/std.py:429 sphinx/themes/basic/defindex.html:25 msgid "Search Page" -msgstr "Otsingu lehekülg" +msgstr "Otsinguleht" #: sphinx/ext/autodoc.py:1002 #, python-format msgid " Bases: %s" -msgstr " Baasid: %s" +msgstr " Pärineb: %s" #: sphinx/ext/autodoc.py:1038 #, python-format msgid "alias of :class:`%s`" -msgstr "sünonüüm :class:`%s`" +msgstr "klassi :class:`%s` sünonüüm" #: sphinx/ext/todo.py:41 msgid "Todo" -msgstr "Tegemata" +msgstr "Teha" #: sphinx/ext/todo.py:109 #, python-format msgid "(The <<original entry>> is located in %s, line %d.)" -msgstr "(Algne kirje asub failis %s, real %d.)" +msgstr "(<<Algne kirje>> asub failis %s real %d.)" #: sphinx/ext/todo.py:117 msgid "original entry" @@ -498,7 +505,7 @@ msgstr "Muudetud versioonis %s" #: sphinx/locale/__init__.py:170 #, python-format msgid "Deprecated since version %s" -msgstr "Ebasoovitav alates versioonist %s" +msgstr "Iganenud alates versioonist %s" #: sphinx/locale/__init__.py:176 msgid "keyword" @@ -536,7 +543,7 @@ msgstr "Otsi" #: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20 msgid "Enter search terms or a module, class or function name." -msgstr "Sisesta otsingusõna" +msgstr "Sisesta otsingusõna või mooduli/klassi/funktsiooni nimi." #: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 msgid "Show Source" @@ -609,17 +616,17 @@ msgstr "Info selle dokumentatsiooni kohta" #: sphinx/themes/basic/layout.html:140 msgid "Copyright" -msgstr "Copyright" +msgstr "Autoriõigused" #: sphinx/themes/basic/layout.html:189 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Autoriõigused</a> %(copyright)s." #: sphinx/themes/basic/layout.html:191 #, python-format msgid "© Copyright %(copyright)s." -msgstr "© Copyright %(copyright)s." +msgstr "© Autoriõigused %(copyright)s." #: sphinx/themes/basic/layout.html:195 #, python-format @@ -629,10 +636,10 @@ msgstr "Viimati uuendatud %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Loodud <a href=\"http://sphinx.pocoo.org/\">Sphinx-iga</a> (versioon: " +"Loodud <a href=\"http://sphinx-doc.org/\">Sphinxiga</a> (versioon: " "%(sphinx_version)s)." #: sphinx/themes/basic/opensearch.xml:4 @@ -669,9 +676,9 @@ msgid "" " function will automatically search for all of the words. Pages\n" " containing fewer words won't appear in the result list." msgstr "" -"Siin saad otsida käesolevast dokumentatsioonist. Sisesta otsisõned " +"Siin saad otsida käesolevast dokumentatsioonist. Sisesta otsisõnad " "allolevasse lahtrisse ning klõpsa \"Otsi\". Tulemuseks antakse " -"leheküljed, mis sisaldavad kõiki otsisõnesid." +"leheküljed, mis sisaldavad kõiki otsisõnasid." #: sphinx/themes/basic/search.html:36 msgid "search" @@ -683,7 +690,7 @@ msgstr "Otsingutulemused" #: sphinx/themes/basic/search.html:42 msgid "Your search did not match any results." -msgstr "Otsing ei andnud tulemusi" +msgstr "Otsing ei andnud tulemusi." #: sphinx/themes/basic/searchbox.html:12 msgid "Quick search" @@ -691,13 +698,13 @@ msgstr "Kiirotsing" #: sphinx/themes/basic/sourcelink.html:11 msgid "This Page" -msgstr "Käesolev lehekülg" +msgstr "Käesolev leht" #: sphinx/themes/basic/changes/frameset.html:5 #: sphinx/themes/basic/changes/versionchanges.html:12 #, python-format msgid "Changes in Version %(version)s — %(docstitle)s" -msgstr "Muudatused versioonis %(version)s — %(docstitle)s" +msgstr "Muutused versioonis %(version)s — %(docstitle)s" #: sphinx/themes/basic/changes/rstsource.html:5 #, python-format @@ -707,28 +714,28 @@ msgstr "%(filename)s — %(docstitle)s" #: sphinx/themes/basic/changes/versionchanges.html:17 #, python-format msgid "Automatically generated list of changes in version %(version)s" -msgstr "Automaatselt genereeritud nimekiri versiooni %(version)s muudatustest" +msgstr "Automaatselt genereeritud nimekiri versiooni %(version)s muutustest" #: sphinx/themes/basic/changes/versionchanges.html:18 msgid "Library changes" -msgstr "Teegi muudatused" +msgstr "Teegi muutused" #: sphinx/themes/basic/changes/versionchanges.html:23 msgid "C API changes" -msgstr "C API muudatused" +msgstr "C API muutused" #: sphinx/themes/basic/changes/versionchanges.html:25 msgid "Other changes" -msgstr "Ülejäänud muudatused" +msgstr "Ülejäänud muutused" #: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:504 #: sphinx/writers/html.py:510 msgid "Permalink to this headline" -msgstr "Püsilink sellele pealkirjale" +msgstr "Püsiviit sellele pealkirjale" #: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:92 msgid "Permalink to this definition" -msgstr "Püsilink sellele definitsioonile" +msgstr "Püsiviit sellele definitsioonile" #: sphinx/themes/basic/static/doctools.js:189 msgid "Hide Search Matches" diff --git a/sphinx/locale/fa/LC_MESSAGES/sphinx.mo b/sphinx/locale/fa/LC_MESSAGES/sphinx.mo Binary files differindex fe705e76..a4900c71 100644 --- a/sphinx/locale/fa/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/fa/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/fa/LC_MESSAGES/sphinx.po b/sphinx/locale/fa/LC_MESSAGES/sphinx.po index 92caf31a..5a149d1c 100644 --- a/sphinx/locale/fa/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/fa/LC_MESSAGES/sphinx.po @@ -635,10 +635,10 @@ msgstr ". %(last_updated)s آخرین بروز رسانی در" #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -". <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s " +". <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s " "ایجاد شده با" #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo Binary files differindex 497088c8..992d6dc2 100644 --- a/sphinx/locale/fi/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/fi/LC_MESSAGES/sphinx.po b/sphinx/locale/fi/LC_MESSAGES/sphinx.po index 4a329546..a59dbade 100644 --- a/sphinx/locale/fi/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/fi/LC_MESSAGES/sphinx.po @@ -632,7 +632,7 @@ msgstr "" #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo Binary files differindex 1027a790..bc971703 100644 --- a/sphinx/locale/fr/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po index 7f51effd..3bae7632 100644 --- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po @@ -635,10 +635,10 @@ msgstr "Mis à jour le %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Créé avec <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Créé avec <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.mo b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo Binary files differindex a9bdb145..31dbb290 100644 --- a/sphinx/locale/hr/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/hr/LC_MESSAGES/sphinx.po b/sphinx/locale/hr/LC_MESSAGES/sphinx.po index 15e70346..e063212d 100644 --- a/sphinx/locale/hr/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/hr/LC_MESSAGES/sphinx.po @@ -630,10 +630,10 @@ msgstr "Zadnji put ažurirano %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"IzraÄ‘eno sa <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"IzraÄ‘eno sa <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/hu/LC_MESSAGES/sphinx.js b/sphinx/locale/hu/LC_MESSAGES/sphinx.js index 2d347242..856311d1 100644 --- a/sphinx/locale/hu/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/hu/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "hu", "plural_expr": "(n != 1)", "messages": {"Hide Search Matches": "Keresési találatok elrejtése", "Permalink to this definition": "Hivatkozás erre a definÃcióra", "Expand sidebar": "Oldalsáv kinyitása", "Permalink to this headline": "Hivatkozás erre a fejezetcÃmre", "Collapse sidebar": "Oldalsáv összezárása"}});
\ No newline at end of file +Documentation.addTranslations({"locale": "hu", "plural_expr": "0", "messages": {"Hide Search Matches": "Keres\u00e9si Tal\u00e1latok Elrejt\u00e9se", "Permalink to this definition": "Hivatkoz\u00e1s erre a defin\u00edci\u00f3ra", "Expand sidebar": "Oldals\u00e1v kinyit\u00e1sa", "Permalink to this headline": "Hivatkoz\u00e1s erre a fejezetc\u00edmre", "Collapse sidebar": "Oldals\u00e1v \u00f6sszez\u00e1r\u00e1sa"}});
\ No newline at end of file diff --git a/sphinx/locale/hu/LC_MESSAGES/sphinx.mo b/sphinx/locale/hu/LC_MESSAGES/sphinx.mo Binary files differindex 63c64bcb..6f79306c 100644 --- a/sphinx/locale/hu/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/hu/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/hu/LC_MESSAGES/sphinx.po b/sphinx/locale/hu/LC_MESSAGES/sphinx.po index 8f01bdce..1a51d3bf 100644 --- a/sphinx/locale/hu/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/hu/LC_MESSAGES/sphinx.po @@ -438,10 +438,10 @@ msgstr "Utolsó frissÃtés %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"<a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s használatával készült." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.mo b/sphinx/locale/it/LC_MESSAGES/sphinx.mo Binary files differindex a4213c8e..04dfdec2 100644 --- a/sphinx/locale/it/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.po b/sphinx/locale/it/LC_MESSAGES/sphinx.po index ccfab24e..1877c786 100644 --- a/sphinx/locale/it/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.po @@ -633,10 +633,10 @@ msgstr "Ultimo aggiornamento %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Creato con <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Creato con <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo Binary files differindex c2bf5ac2..aadbb401 100644 --- a/sphinx/locale/ja/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/ja/LC_MESSAGES/sphinx.po b/sphinx/locale/ja/LC_MESSAGES/sphinx.po index 1e3b1e76..a0b473ff 100644 --- a/sphinx/locale/ja/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ja/LC_MESSAGES/sphinx.po @@ -630,10 +630,10 @@ msgstr "最終更新: %(last_updated)s" #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"ã“ã®ãƒ‰ã‚ュメント㯠<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"ã“ã®ãƒ‰ã‚ュメント㯠<a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s ã§ç”Ÿæˆã—ã¾ã—ãŸã€‚" #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/ko/LC_MESSAGES/sphinx.po b/sphinx/locale/ko/LC_MESSAGES/sphinx.po index 8c0dd3d8..5bee2ab7 100644 --- a/sphinx/locale/ko/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ko/LC_MESSAGES/sphinx.po @@ -635,10 +635,10 @@ msgstr "최종 ì—…ë°ì´íЏ: %(last_updated)s" #: sphinx/themes/basic/layout.html:198 #, fuzzy, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"ì´ ë¬¸ì„œëŠ” <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>%(sphinx_version)s로 " +"ì´ ë¬¸ì„œëŠ” <a href=\"http://sphinx-doc.org/\">Sphinx</a>%(sphinx_version)s로 " "ì œê³µë©ë‹ˆë‹¤." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/lt/LC_MESSAGES/sphinx.mo b/sphinx/locale/lt/LC_MESSAGES/sphinx.mo Binary files differindex 9efc6d77..d9444da4 100644 --- a/sphinx/locale/lt/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/lt/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/lt/LC_MESSAGES/sphinx.po b/sphinx/locale/lt/LC_MESSAGES/sphinx.po index b331d52a..fdffdcad 100644 --- a/sphinx/locale/lt/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/lt/LC_MESSAGES/sphinx.po @@ -628,10 +628,10 @@ msgstr "Paskutinis atnaujinimas %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Sukurta naudojant <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Sukurta naudojant <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/lv/LC_MESSAGES/sphinx.mo b/sphinx/locale/lv/LC_MESSAGES/sphinx.mo Binary files differindex e6e713a5..c173f6f5 100644 --- a/sphinx/locale/lv/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/lv/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/lv/LC_MESSAGES/sphinx.po b/sphinx/locale/lv/LC_MESSAGES/sphinx.po index ec19bbee..381aa4b5 100644 --- a/sphinx/locale/lv/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/lv/LC_MESSAGES/sphinx.po @@ -628,10 +628,10 @@ msgstr "PÄ“dÄ“jas izmaiņas %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Sagatavots izmantojot <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Sagatavots izmantojot <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js new file mode 100644 index 00000000..9f309922 --- /dev/null +++ b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.js @@ -0,0 +1 @@ +Documentation.addTranslations({"locale": "nb_NO", "plural_expr": "(n != 1)", "messages": {"Hide Search Matches": "Skjul s\u00f8keresultat", "Permalink to this definition": "Permalink til denne definisjonen", "Expand sidebar": "Utvid sidepanelet", "Permalink to this headline": "Permalink til denne oversikten", "Collapse sidebar": "Skjul sidepanelet"}});
\ No newline at end of file diff --git a/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo Binary files differnew file mode 100644 index 00000000..88a53439 --- /dev/null +++ b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.po b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po index 2c7dd857..05893a88 100644 --- a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po @@ -624,10 +624,10 @@ msgstr "Sist oppdatert %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Lagd med <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Lagd med <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/ne/LC_MESSAGES/sphinx.mo b/sphinx/locale/ne/LC_MESSAGES/sphinx.mo Binary files differindex 05be753d..0e357663 100644 --- a/sphinx/locale/ne/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/ne/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/ne/LC_MESSAGES/sphinx.po b/sphinx/locale/ne/LC_MESSAGES/sphinx.po index 5cb11e20..3ded0ab0 100644 --- a/sphinx/locale/ne/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ne/LC_MESSAGES/sphinx.po @@ -600,7 +600,7 @@ msgstr "नेà¤à¤¿à¤—ेसन " #: sphinx/themes/basic/layout.html:122 #, python-format msgid "Search within %(docstitle)s" -msgstr "à¤à¤¿à¤¤à¥à¤°-à¤à¤¿à¤¤à¥à¤°à¥ˆ खोजà¥à¤¨à¥à¤¹à¥‹à¤¸à¥" +msgstr "" #: sphinx/themes/basic/layout.html:131 msgid "About these documents" @@ -628,14 +628,14 @@ msgstr "यो à¤à¤¨à¥à¤¦à¤¾ अगाडी %(last_updated)s मा अपड #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." -msgstr "<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> पà¥à¤°à¤¯à¥‹à¤— गरेर बनाइà¤à¤•ो" +msgstr "" #: sphinx/themes/basic/opensearch.xml:4 #, python-format msgid "Search %(docstitle)s" -msgstr "खोजà¥à¤¨à¥à¤¹à¥‹à¤¸à¥" +msgstr "" #: sphinx/themes/basic/relations.html:11 msgid "Previous topic" diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo Binary files differindex 05ee5662..4b43d500 100644 --- a/sphinx/locale/nl/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/nl/LC_MESSAGES/sphinx.po b/sphinx/locale/nl/LC_MESSAGES/sphinx.po index 473baadc..77de479d 100644 --- a/sphinx/locale/nl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/nl/LC_MESSAGES/sphinx.po @@ -632,10 +632,10 @@ msgstr "Laatste aanpassing op %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Aangemaakt met <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Aangemaakt met <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.js b/sphinx/locale/no_NB/LC_MESSAGES/sphinx.js deleted file mode 100644 index d00991b2..00000000 --- a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.js +++ /dev/null @@ -1 +0,0 @@ -Documentation.addTranslations({"locale": "no_NB", "plural_expr": "(n != 1)", "messages": {"Hide Search Matches": "Skjul S\u00f6kresultater", "Permalink to this definition": "Permalink til denne definisjonen", "Expand sidebar": "Utvid sidepanelet", "Permalink to this headline": "Permalink til denne overskriften", "Collapse sidebar": "Kollaps sidepanelet"}});
\ No newline at end of file diff --git a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.mo b/sphinx/locale/no_NB/LC_MESSAGES/sphinx.mo Binary files differdeleted file mode 100644 index eba1f773..00000000 --- a/sphinx/locale/no_NB/LC_MESSAGES/sphinx.mo +++ /dev/null diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo Binary files differindex bdceda43..505c59e1 100644 --- a/sphinx/locale/pl/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/pl/LC_MESSAGES/sphinx.po b/sphinx/locale/pl/LC_MESSAGES/sphinx.po index 957d23e9..f6379d34 100644 --- a/sphinx/locale/pl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/pl/LC_MESSAGES/sphinx.po @@ -556,7 +556,7 @@ msgstr "wszystkie rozdziaÅ‚y i podrozdziaÅ‚y" #: sphinx/themes/basic/defindex.html:26 msgid "search this documentation" -msgstr "przyszukaj tÄ™ dokumentacjÄ™" +msgstr "przeszukaj tÄ™ dokumentacjÄ™" #: sphinx/themes/basic/defindex.html:28 msgid "Global Module Index" @@ -625,10 +625,10 @@ msgstr "Ostatnia modyfikacja %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Utworzone przy pomocy <a href=\"http://sphinx.pocoo.org/\">Sphinx</a>'a " +"Utworzone przy pomocy <a href=\"http://sphinx-doc.org/\">Sphinx</a>'a " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 @@ -656,7 +656,7 @@ msgstr "nastÄ™pny rozdziaÅ‚" msgid "" "Please activate JavaScript to enable the search\n" " functionality." -msgstr "Aby umożliwić wuszukiwanie, proszÄ™ włączyć JavaScript." +msgstr "Aby umożliwić wyszukiwanie, proszÄ™ włączyć JavaScript." #: sphinx/themes/basic/search.html:29 msgid "" @@ -696,7 +696,7 @@ msgstr "Ta strona" #: sphinx/themes/basic/changes/versionchanges.html:12 #, python-format msgid "Changes in Version %(version)s — %(docstitle)s" -msgstr "Zmiany w wesji %(version)s — %(docstitle)s" +msgstr "Zmiany w wersji %(version)s — %(docstitle)s" #: sphinx/themes/basic/changes/rstsource.html:5 #, python-format diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo Binary files differindex 3016d5ef..824ba048 100644 --- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po index b41b5ad1..bb483766 100644 --- a/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/pt_BR/LC_MESSAGES/sphinx.po @@ -628,10 +628,10 @@ msgstr "Última atualização em %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Criado com <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Criado com <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.js b/sphinx/locale/ru/LC_MESSAGES/sphinx.js index ca0376ac..294b82f9 100644 --- a/sphinx/locale/ru/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "ru", "plural_expr": "n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2", "messages": {"Hide Search Matches": "\u0421\u043d\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Permalink to this definition": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Expand sidebar": "", "Permalink to this headline": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Collapse sidebar": ""}});
\ No newline at end of file +Documentation.addTranslations({"locale": "ru", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Hide Search Matches": "\u0421\u043d\u044f\u0442\u044c \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Permalink to this definition": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435", "Expand sidebar": "\u0420\u0430\u0437\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0431\u043e\u043a\u043e\u0432\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c", "Permalink to this headline": "\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u044d\u0442\u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a", "Collapse sidebar": "\u0421\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0431\u043e\u043a\u043e\u0432\u0443\u044e \u043f\u0430\u043d\u0435\u043b\u044c"}});
\ No newline at end of file diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo Binary files differindex 593350d3..04fcf36f 100644 --- a/sphinx/locale/ru/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/ru/LC_MESSAGES/sphinx.po b/sphinx/locale/ru/LC_MESSAGES/sphinx.po index b6374d81..2e10a31f 100644 --- a/sphinx/locale/ru/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ru/LC_MESSAGES/sphinx.po @@ -1,21 +1,20 @@ -# Russian translations for Sphinx. -# Copyright (C) 2008 ORGANIZATION -# This file is distributed under the same license as the Sphinx project. +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. # msgid "" msgstr "" -"Project-Id-Version: Sphinx 0.6b1\n" -"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" -"POT-Creation-Date: 2011-09-21 10:06+0200\n" -"PO-Revision-Date: 2011-09-21 10:14+0200\n" -"Last-Translator: alexander smishlajev <alex@tycobka.lv>\n" -"Language-Team: ru <LL@li.org>\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && " -"n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2\n" +"Project-Id-Version: PACKAGE VERSION\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-08-12 21:48+0700\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"Language: \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" -"Generated-By: Babel 0.9.6\n" #: sphinx/config.py:81 #, python-format @@ -24,21 +23,22 @@ msgstr "" #: sphinx/environment.py:119 sphinx/writers/latex.py:190 #: sphinx/writers/manpage.py:67 sphinx/writers/texinfo.py:203 +#: sphinx/writers/latex.py:191 sphinx/environment.py:113 #, python-format msgid "%B %d, %Y" msgstr "%d %B %Y" -#: sphinx/environment.py:1625 +#: sphinx/environment.py:1625 sphinx/environment.py:1638 #, python-format msgid "see %s" msgstr "" -#: sphinx/environment.py:1628 +#: sphinx/environment.py:1628 sphinx/environment.py:1641 #, python-format msgid "see also %s" msgstr "" -#: sphinx/roles.py:175 +#: sphinx/roles.py:175 sphinx/roles.py:176 #, fuzzy, python-format msgid "Python Enhancement Proposals; PEP %s" msgstr "Python Enhancement Proposals; PEP %s" @@ -51,24 +51,25 @@ msgstr "Ð’Ñтроенные функции" msgid "Module level" msgstr "Модуль" -#: sphinx/builders/html.py:274 +#: sphinx/builders/html.py:274 sphinx/builders/html.py:276 #, python-format msgid "%b %d, %Y" msgstr "%d %b %Y" #: sphinx/builders/html.py:293 sphinx/themes/basic/defindex.html:30 +#: sphinx/builders/html.py:295 msgid "General Index" -msgstr "Словарь-указатель" +msgstr "Ðлфавитный указатель" -#: sphinx/builders/html.py:293 +#: sphinx/builders/html.py:293 sphinx/builders/html.py:295 msgid "index" -msgstr "Ñловарь" +msgstr "указатель" -#: sphinx/builders/html.py:353 +#: sphinx/builders/html.py:353 sphinx/builders/html.py:355 msgid "next" msgstr "Ñледующий" -#: sphinx/builders/html.py:362 +#: sphinx/builders/html.py:362 sphinx/builders/html.py:364 msgid "previous" msgstr "предыдущий" @@ -76,24 +77,24 @@ msgstr "предыдущий" msgid " (in " msgstr " (в " -#: sphinx/directives/other.py:136 +#: sphinx/directives/other.py:136 sphinx/directives/other.py:138 msgid "Section author: " -msgstr "Ðвтор Ñекции: " +msgstr "Ðвтор раздела: " -#: sphinx/directives/other.py:138 +#: sphinx/directives/other.py:138 sphinx/directives/other.py:140 msgid "Module author: " msgstr "Ðвтор модулÑ: " -#: sphinx/directives/other.py:140 +#: sphinx/directives/other.py:140 sphinx/directives/other.py:142 #, fuzzy msgid "Code author: " msgstr "Ðвтор модулÑ: " -#: sphinx/directives/other.py:142 +#: sphinx/directives/other.py:142 sphinx/directives/other.py:144 msgid "Author: " msgstr "Ðвтор: " -#: sphinx/directives/other.py:215 +#: sphinx/directives/other.py:215 sphinx/directives/other.py:219 msgid "See also" msgstr "См.также" @@ -162,22 +163,22 @@ msgstr "тип" msgid "variable" msgstr "ПеременнаÑ" -#: sphinx/domains/cpp.py:904 +#: sphinx/domains/cpp.py:904 sphinx/domains/cpp.py:1020 #, python-format msgid "%s (C++ class)" msgstr "%s (клаÑÑ C++)" -#: sphinx/domains/cpp.py:919 +#: sphinx/domains/cpp.py:919 sphinx/domains/cpp.py:1043 #, python-format msgid "%s (C++ type)" msgstr "%s (тип C++)" -#: sphinx/domains/cpp.py:938 +#: sphinx/domains/cpp.py:938 sphinx/domains/cpp.py:1063 #, python-format msgid "%s (C++ member)" msgstr "%s (поле C++)" -#: sphinx/domains/cpp.py:990 +#: sphinx/domains/cpp.py:990 sphinx/domains/cpp.py:1119 #, python-format msgid "%s (C++ function)" msgstr "%s (Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ C++)" @@ -188,11 +189,13 @@ msgid "class" msgstr "клаÑÑ" #: sphinx/domains/javascript.py:106 sphinx/domains/python.py:254 +#: sphinx/domains/python.py:253 #, python-format msgid "%s() (built-in function)" msgstr "%s() (вÑÑ‚Ñ€Ð¾ÐµÐ½Ð½Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ)" #: sphinx/domains/javascript.py:107 sphinx/domains/python.py:318 +#: sphinx/domains/python.py:317 #, python-format msgid "%s() (%s method)" msgstr "%s() (метод %s)" @@ -208,6 +211,7 @@ msgid "%s (global variable or constant)" msgstr "" #: sphinx/domains/javascript.py:113 sphinx/domains/python.py:356 +#: sphinx/domains/python.py:355 #, python-format msgid "%s (%s attribute)" msgstr "%s (атрибут %s)" @@ -240,56 +244,59 @@ msgstr "ИÑключение" #: sphinx/domains/python.py:255 sphinx/domains/python.py:312 #: sphinx/domains/python.py:324 sphinx/domains/python.py:337 +#: sphinx/domains/python.py:254 sphinx/domains/python.py:311 +#: sphinx/domains/python.py:323 sphinx/domains/python.py:336 #, python-format msgid "%s() (in module %s)" msgstr "%s() (в модуле %s)" -#: sphinx/domains/python.py:258 +#: sphinx/domains/python.py:258 sphinx/domains/python.py:257 #, python-format msgid "%s (built-in variable)" msgstr "%s (вÑÑ‚Ñ€Ð¾ÐµÐ½Ð½Ð°Ñ Ð¿ÐµÑ€ÐµÐ¼ÐµÐ½Ð½Ð°Ñ)" #: sphinx/domains/python.py:259 sphinx/domains/python.py:350 +#: sphinx/domains/python.py:258 sphinx/domains/python.py:349 #, python-format msgid "%s (in module %s)" msgstr "%s (в модуле %s)" -#: sphinx/domains/python.py:275 +#: sphinx/domains/python.py:275 sphinx/domains/python.py:274 #, python-format msgid "%s (built-in class)" msgstr "%s (вÑтроенный клаÑÑ)" -#: sphinx/domains/python.py:276 +#: sphinx/domains/python.py:276 sphinx/domains/python.py:275 #, python-format msgid "%s (class in %s)" msgstr "%s (клаÑÑ Ð² %s)" -#: sphinx/domains/python.py:316 +#: sphinx/domains/python.py:316 sphinx/domains/python.py:315 #, python-format msgid "%s() (%s.%s method)" msgstr "%s() (метод %s.%s)" -#: sphinx/domains/python.py:328 +#: sphinx/domains/python.py:328 sphinx/domains/python.py:327 #, python-format msgid "%s() (%s.%s static method)" msgstr "%s() (ÑтатичеÑкий метод %s.%s)" -#: sphinx/domains/python.py:331 +#: sphinx/domains/python.py:331 sphinx/domains/python.py:330 #, python-format msgid "%s() (%s static method)" msgstr "%s() (ÑтатичеÑкий метод %s)" -#: sphinx/domains/python.py:341 +#: sphinx/domains/python.py:341 sphinx/domains/python.py:340 #, fuzzy, python-format msgid "%s() (%s.%s class method)" msgstr "%s() (метод %s.%s)" -#: sphinx/domains/python.py:344 +#: sphinx/domains/python.py:344 sphinx/domains/python.py:343 #, fuzzy, python-format msgid "%s() (%s class method)" msgstr "%s() (метод %s)" -#: sphinx/domains/python.py:354 +#: sphinx/domains/python.py:354 sphinx/domains/python.py:353 #, python-format msgid "%s (%s.%s attribute)" msgstr "%s (атрибут %s.%s)" @@ -308,7 +315,7 @@ msgstr "СоÑтав модулÑ" msgid "modules" msgstr "модули" -#: sphinx/domains/python.py:537 +#: sphinx/domains/python.py:537 sphinx/domains/python.py:538 msgid "Deprecated" msgstr "Ðе рекомендуетÑÑ" @@ -332,17 +339,17 @@ msgstr "ÑтатичеÑкий метод" msgid "module" msgstr "модуль" -#: sphinx/domains/python.py:695 +#: sphinx/domains/python.py:695 sphinx/domains/python.py:696 #, fuzzy msgid " (deprecated)" msgstr " (не рекомендуетÑÑ)" -#: sphinx/domains/rst.py:55 +#: sphinx/domains/rst.py:55 sphinx/domains/rst.py:53 #, python-format msgid "%s (directive)" msgstr "" -#: sphinx/domains/rst.py:57 +#: sphinx/domains/rst.py:57 sphinx/domains/rst.py:55 #, python-format msgid "%s (role)" msgstr "" @@ -391,6 +398,7 @@ msgstr "" #: sphinx/themes/basic/genindex.html:32 sphinx/themes/basic/genindex.html:35 #: sphinx/themes/basic/genindex.html:68 sphinx/themes/basic/layout.html:134 #: sphinx/writers/latex.py:179 sphinx/writers/texinfo.py:456 +#: sphinx/writers/latex.py:180 msgid "Index" msgstr "Ðлфавитный указатель" @@ -402,36 +410,36 @@ msgstr "СоÑтав модулÑ" msgid "Search Page" msgstr "ПоиÑк" -#: sphinx/ext/autodoc.py:1002 +#: sphinx/ext/autodoc.py:1002 sphinx/ext/autodoc.py:1010 #, python-format msgid " Bases: %s" msgstr " Базовые клаÑÑÑ‹: %s" -#: sphinx/ext/autodoc.py:1038 +#: sphinx/ext/autodoc.py:1038 sphinx/ext/autodoc.py:1046 #, python-format msgid "alias of :class:`%s`" msgstr "пÑевдоним клаÑÑа :class:`%s`" -#: sphinx/ext/todo.py:41 +#: sphinx/ext/todo.py:41 sphinx/ext/todo.py:42 msgid "Todo" msgstr "План" -#: sphinx/ext/todo.py:109 +#: sphinx/ext/todo.py:109 sphinx/ext/todo.py:110 #, fuzzy, python-format msgid "(The <<original entry>> is located in %s, line %d.)" msgstr "(ИÑходный Ñлемент находитÑÑ Ð² %s, в Ñтроке %d.)" -#: sphinx/ext/todo.py:117 +#: sphinx/ext/todo.py:117 sphinx/ext/todo.py:119 msgid "original entry" msgstr "" #: sphinx/ext/viewcode.py:70 msgid "[source]" -msgstr "" +msgstr "[иÑходный код]" #: sphinx/ext/viewcode.py:117 msgid "[docs]" -msgstr "" +msgstr "[документациÑ]" #: sphinx/ext/viewcode.py:131 #, fuzzy @@ -441,15 +449,15 @@ msgstr "модуль" #: sphinx/ext/viewcode.py:137 #, python-format msgid "<h1>Source code for %s</h1>" -msgstr "" +msgstr "<h1>ИÑходный код %s</h1>" #: sphinx/ext/viewcode.py:164 msgid "Overview: module code" -msgstr "" +msgstr "Обзор: иÑходный код модулÑ" #: sphinx/ext/viewcode.py:165 msgid "<h1>All modules for which code is available</h1>" -msgstr "" +msgstr "<h1>Ð’Ñе модули, в которых еÑть код</h1>" #: sphinx/locale/__init__.py:155 msgid "Attention" @@ -481,7 +489,7 @@ msgstr "Примечание" #: sphinx/locale/__init__.py:162 msgid "See Also" -msgstr "См.также" +msgstr "См. также" #: sphinx/locale/__init__.py:163 msgid "Tip" @@ -529,7 +537,7 @@ msgstr "Ð±Ð°Ð·Ð¾Ð²Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ" #: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 #: sphinx/themes/basic/localtoc.html:11 msgid "Table Of Contents" -msgstr "Содержание" +msgstr "Оглавление" #: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:137 #: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:20 @@ -546,7 +554,7 @@ msgstr "Введите Ñлова Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка или Ð¸Ð¼Ñ Ð¼Ð¾Ð´ÑƒÐ»Ñ #: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 msgid "Show Source" -msgstr "Показать иÑходный текÑÑ‚" +msgstr "ИÑходный текÑÑ‚" #: sphinx/themes/basic/defindex.html:11 msgid "Overview" @@ -558,7 +566,7 @@ msgstr "Таблицы и указатели:" #: sphinx/themes/basic/defindex.html:23 msgid "Complete Table of Contents" -msgstr "Подробное оглавление" +msgstr "Полное оглавление" #: sphinx/themes/basic/defindex.html:24 msgid "lists all sections and subsections" @@ -566,7 +574,7 @@ msgstr "ÑпиÑок вÑех разделов и подразделов" #: sphinx/themes/basic/defindex.html:26 msgid "search this documentation" -msgstr "поиÑк во вÑем документе" +msgstr "поиÑк в документации" #: sphinx/themes/basic/defindex.html:28 msgid "Global Module Index" @@ -611,16 +619,16 @@ msgstr "ПоиÑк в документе «%(docstitle)s»" #: sphinx/themes/basic/layout.html:131 msgid "About these documents" -msgstr "Об Ñтих документах…" +msgstr "Об Ñтих документах" #: sphinx/themes/basic/layout.html:140 msgid "Copyright" -msgstr "Copyright" +msgstr "ÐвторÑкие права" #: sphinx/themes/basic/layout.html:189 #, python-format msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." -msgstr "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">ÐвторÑкие права</a> %(copyright)s." #: sphinx/themes/basic/layout.html:191 #, python-format @@ -630,15 +638,15 @@ msgstr "© Copyright %(copyright)s." #: sphinx/themes/basic/layout.html:195 #, python-format msgid "Last updated on %(last_updated)s." -msgstr "Дата поÑледнего обновлениÑ: %(last_updated)s." +msgstr "Обновлено: %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"При Ñоздании иÑпользован <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Создано Ñ Ð¿Ð¾Ð¼Ð¾Ñ‰ÑŒÑŽ <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 @@ -666,7 +674,7 @@ msgstr "ÑÐ»ÐµÐ´ÑƒÑŽÑ‰Ð°Ñ Ð³Ð»Ð°Ð²Ð°" msgid "" "Please activate JavaScript to enable the search\n" " functionality." -msgstr "Ð”Ð»Ñ Ð²Ñ‹Ð¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð¿Ð¾Ð¸Ñка необходима поддержка JavaScript в браузере." +msgstr "Ð”Ð»Ñ Ñ€Ð°Ð±Ð¾Ñ‚Ñ‹ поиÑка включите JavaScript в браузере." #: sphinx/themes/basic/search.html:29 msgid "" @@ -675,11 +683,10 @@ msgid "" " function will automatically search for all of the words. Pages\n" " containing fewer words won't appear in the result list." msgstr "" -"Ðта форма предназначена Ð´Ð»Ñ Ð¿Ð¾Ð¸Ñка по вÑем разделам наÑтоÑщей " -"документации. Введите иÑкомые Ñлова в текÑтовое поле и нажмите кнопку " -"«иÑкать». Обратите внимание: найдены будут только те Ñтраницы, в которых " -"упомÑнуты вÑе указанные Ñлова. Страницы, в которых вÑтречаетÑÑ Ñ‚Ð¾Ð»ÑŒÐºÐ¾ " -"чаÑть Ñтих Ñлов, отобраны не будут." +"ЗдеÑÑŒ можно делать поиÑк по вÑем разделам Ñтой документации. Введите " +" ключевые Ñлова в текÑтовое поле и нажмите кнопку «иÑкать». Внимание: будут " +" найдены только те Ñтраницы, в которых еÑть вÑе указанные Ñлова. Страницы, " +" где еÑть только чаÑть Ñтих Ñлов, отобраны не будут." #: sphinx/themes/basic/search.html:36 msgid "search" @@ -691,7 +698,7 @@ msgstr "Результаты поиÑка" #: sphinx/themes/basic/search.html:42 msgid "Your search did not match any results." -msgstr "Результатов по вашему запроÑу не найдено." +msgstr "Страниц по вашему запроÑу не найдено." #: sphinx/themes/basic/searchbox.html:12 msgid "Quick search" @@ -723,18 +730,19 @@ msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² библиотеке" #: sphinx/themes/basic/changes/versionchanges.html:23 msgid "C API changes" -msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² C API" +msgstr "Ð˜Ð·Ð¼ÐµÐ½ÐµÐ½Ð¸Ñ Ð² API C" #: sphinx/themes/basic/changes/versionchanges.html:25 msgid "Other changes" msgstr "Другие изменениÑ" #: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:504 -#: sphinx/writers/html.py:510 +#: sphinx/writers/html.py:510 sphinx/writers/html.py:516 msgid "Permalink to this headline" msgstr "СÑылка на Ñтот заголовок" #: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:92 +#: sphinx/writers/html.py:94 msgid "Permalink to this definition" msgstr "СÑылка на Ñто определение" @@ -744,36 +752,55 @@ msgstr "СнÑть выделение" #: sphinx/themes/default/static/sidebar.js:69 msgid "Expand sidebar" -msgstr "" +msgstr "Развернуть боковую панель" #: sphinx/themes/default/static/sidebar.js:82 #: sphinx/themes/default/static/sidebar.js:110 msgid "Collapse sidebar" -msgstr "" +msgstr "Свернуть боковую панель" #: sphinx/themes/haiku/layout.html:26 msgid "Contents" -msgstr "" +msgstr "Содержание" -#: sphinx/writers/latex.py:177 +#: sphinx/writers/latex.py:177 sphinx/writers/latex.py:178 msgid "Release" msgstr "ВыпуÑк" #: sphinx/writers/latex.py:594 sphinx/writers/manpage.py:182 -#: sphinx/writers/texinfo.py:589 +#: sphinx/writers/texinfo.py:589 sphinx/writers/latex.py:601 msgid "Footnotes" -msgstr "" +msgstr "СноÑки" -#: sphinx/writers/latex.py:676 +#: sphinx/writers/latex.py:676 sphinx/writers/latex.py:685 msgid "continued from previous page" -msgstr "" +msgstr "продолжение Ñ Ð¿Ñ€ÐµÐ´Ñ‹Ð´ÑƒÑ‰ÐµÐ¹ Ñтраницы" -#: sphinx/writers/latex.py:681 +#: sphinx/writers/latex.py:681 sphinx/writers/latex.py:691 #, fuzzy msgid "Continued on next page" -msgstr "Полный алфавитный указатель на одной Ñтранице" +msgstr "ПродолжаетÑÑ Ð½Ð° Ñледующей Ñтранице" -#: sphinx/writers/text.py:437 +#: sphinx/writers/text.py:437 sphinx/writers/manpage.py:234 +#: sphinx/writers/text.py:439 msgid "[image]" msgstr "[риÑунок]" +#: sphinx/writers/manpage.py:233 sphinx/writers/text.py:438 +#, python-format +msgid "[image: %s]" +msgstr "[риÑунок: %s]" + +#: sphinx/ext/graphviz.py:302 sphinx/ext/graphviz.py:310 +#, python-format +msgid "[graph: %s]" +msgstr "[иллюÑтрациÑ: %s]" + +#: sphinx/ext/graphviz.py:304 sphinx/ext/graphviz.py:312 +msgid "[graph]" +msgstr "[иллюÑтрациÑ]" + +#: sphinx/ext/intersphinx.py:224 +#, python-format +msgid "(in %s v%s)" +msgstr "" diff --git a/sphinx/locale/sk/LC_MESSAGES/sphinx.js b/sphinx/locale/sk/LC_MESSAGES/sphinx.js index 2d210b54..9c2d6a75 100644 --- a/sphinx/locale/sk/LC_MESSAGES/sphinx.js +++ b/sphinx/locale/sk/LC_MESSAGES/sphinx.js @@ -1 +1 @@ -Documentation.addTranslations({"locale": "sk", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Hide Search Matches": "Skr\u00fdt v\u00fdsledky vyhled\u00e1v\u00e1n\u00ed", "Permalink to this definition": "Trval\u00fd odkaz na tuto definici", "Expand sidebar": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Collapse sidebar": ""}}); +Documentation.addTranslations({"locale": "sk", "plural_expr": "(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2)", "messages": {"Hide Search Matches": "Skry\u0165 v\u00fdsledky vyh\u013ead\u00e1vania", "Permalink to this definition": "Trval\u00fd odkaz na t\u00fato defin\u00edciu", "Expand sidebar": "", "Permalink to this headline": "Trval\u00fd odkaz na tento nadpis", "Collapse sidebar": ""}});
\ No newline at end of file diff --git a/sphinx/locale/sk/LC_MESSAGES/sphinx.mo b/sphinx/locale/sk/LC_MESSAGES/sphinx.mo Binary files differindex 8a4ac3a8..375159dc 100644 --- a/sphinx/locale/sk/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/sk/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/sk/LC_MESSAGES/sphinx.po b/sphinx/locale/sk/LC_MESSAGES/sphinx.po index 77f12023..fdc5e137 100644 --- a/sphinx/locale/sk/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/sk/LC_MESSAGES/sphinx.po @@ -635,10 +635,10 @@ msgstr "Aktualizované dňa %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Vytvorené pomocou <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Vytvorené pomocou <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo Binary files differindex 79f7f4eb..a4fe3d63 100644 --- a/sphinx/locale/sl/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/sl/LC_MESSAGES/sphinx.po b/sphinx/locale/sl/LC_MESSAGES/sphinx.po index 6f6e49ac..297d1cdb 100644 --- a/sphinx/locale/sl/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/sl/LC_MESSAGES/sphinx.po @@ -630,10 +630,10 @@ msgstr "ZadnjiÄ posodobljeno %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Narejeno s <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Narejeno s <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/sphinx.pot b/sphinx/locale/sphinx.pot index 9ddde4c2..b1d816f7 100644 --- a/sphinx/locale/sphinx.pot +++ b/sphinx/locale/sphinx.pot @@ -628,7 +628,7 @@ msgstr "" #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" diff --git a/sphinx/locale/sv/LC_MESSAGES/sphinx.mo b/sphinx/locale/sv/LC_MESSAGES/sphinx.mo Binary files differindex 11b18023..40280d85 100644 --- a/sphinx/locale/sv/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/sv/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/sv/LC_MESSAGES/sphinx.po b/sphinx/locale/sv/LC_MESSAGES/sphinx.po index 9967bdd7..6d0ed166 100644 --- a/sphinx/locale/sv/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/sv/LC_MESSAGES/sphinx.po @@ -625,10 +625,10 @@ msgstr "Senast uppdaterad %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Skapad med <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Skapad med <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo Binary files differindex 812b7cd9..2bf9e7a3 100644 --- a/sphinx/locale/tr/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/tr/LC_MESSAGES/sphinx.po b/sphinx/locale/tr/LC_MESSAGES/sphinx.po index bf5fd568..cd8d7395 100644 --- a/sphinx/locale/tr/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/tr/LC_MESSAGES/sphinx.po @@ -628,10 +628,10 @@ msgstr "Son güncelleme: %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"<a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s ile " +"<a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s ile " "oluÅŸturulmuÅŸtur." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo Binary files differindex 4bc58ee1..5fa633d3 100644 --- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po index 32ce1dc4..a5141fad 100644 --- a/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/uk_UA/LC_MESSAGES/sphinx.po @@ -635,10 +635,10 @@ msgstr "ВоÑтаннє оновлено %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" -"Створено з викориÑтаннÑм <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Створено з викориÑтаннÑм <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo Binary files differindex 3d9dac2b..eb5b0763 100644 --- a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po index cb7b3e6f..079bab5e 100644 --- a/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/zh_CN/LC_MESSAGES/sphinx.po @@ -636,9 +636,9 @@ msgstr "æœ€åŽæ›´æ–°æ—¥æœŸæ˜¯ %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." -msgstr "使用 <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> %(sphinx_version)s." +msgstr "使用 <a href=\"http://sphinx-doc.org/\">Sphinx</a> %(sphinx_version)s." #: sphinx/themes/basic/opensearch.xml:4 #, python-format diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo Binary files differindex 9dd86da5..98c5d6e8 100644 --- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo +++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.mo diff --git a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po index 2a4fbef0..5d178af1 100644 --- a/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/zh_TW/LC_MESSAGES/sphinx.po @@ -638,7 +638,7 @@ msgstr "最後更新日期是 %(last_updated)s." #: sphinx/themes/basic/layout.html:198 #, python-format msgid "" -"Created using <a href=\"http://sphinx.pocoo.org/\">Sphinx</a> " +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " "%(sphinx_version)s." msgstr "" diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index c8dd2579..dd2df0df 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -377,6 +377,21 @@ SPHINXBUILD = sphinx-build PAPER = BUILDDIR = %(rbuilddir)s +ifeq ($(shell $(SPHINXBUILD) 2> /dev/null; echo $$?), 127) +define MSG + + +The 'sphinx-build' command was not found. Make sure you have Sphinx +installed, then set the SPHINXBUILD environment variable to point +to the full path of the 'sphinx-build' executable. Alternatively you +may add the Sphinx directory to PATH. + +If you don't have Sphinx installed, grab it from +http://sphinx-doc.org/ +endef +$(error $(MSG)) +endif + # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter @@ -401,12 +416,15 @@ help: \t@echo " epub to make an epub" \t@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" \t@echo " latexpdf to make LaTeX files and run them through pdflatex" +\t@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" \t@echo " text to make text files" \t@echo " man to make manual pages" \t@echo " texinfo to make Texinfo files" \t@echo " info to make Texinfo files and run them through makeinfo" \t@echo " gettext to make PO message catalogs" \t@echo " changes to make an overview of all changed/added/deprecated items" +\t@echo " xml to make Docutils-native XML files" +\t@echo " pseudoxml to make pseudoxml-XML files for display purposes" \t@echo " linkcheck to check all external links for integrity" \t@echo " doctest to run all doctests embedded in the documentation \ (if enabled)" @@ -482,6 +500,12 @@ latexpdf: \t$(MAKE) -C $(BUILDDIR)/latex all-pdf \t@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." +latexpdfja: +\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex +\t@echo "Running LaTeX files through platex and dvipdfmx..." +\t$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja +\t@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + text: \t$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text \t@echo @@ -525,6 +549,16 @@ doctest: \t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest \t@echo "Testing of doctests in the sources finished, look at the " \\ \t "results in $(BUILDDIR)/doctest/output.txt." + +xml: +\t$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml +\t@echo +\t@echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: +\t$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml +\t@echo +\t@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." ''' BATCHFILE = '''\ @@ -563,6 +597,8 @@ if "%%1" == "help" ( \techo. texinfo to make Texinfo files \techo. gettext to make PO message catalogs \techo. changes to make an overview over all changed/added/deprecated items +\techo. xml to make Docutils-native XML files +\techo. pseudoxml to make pseudoxml-XML files for display purposes \techo. linkcheck to check all external links for integrity \techo. doctest to run all doctests embedded in the documentation if enabled \tgoto end @@ -574,6 +610,20 @@ if "%%1" == "clean" ( \tgoto end ) + +%%SPHINXBUILD%% 2> nul +if errorlevel 9009 ( +\techo. +\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx +\techo.installed, then set the SPHINXBUILD environment variable to point +\techo.to the full path of the 'sphinx-build' executable. Alternatively you +\techo.may add the Sphinx directory to PATH. +\techo. +\techo.If you don't have Sphinx installed, grab it from +\techo.http://sphinx-doc.org/ +\texit /b 1 +) + if "%%1" == "html" ( \t%%SPHINXBUILD%% -b html %%ALLSPHINXOPTS%% %%BUILDDIR%%/html \tif errorlevel 1 exit /b 1 @@ -659,6 +709,26 @@ if "%%1" == "latex" ( \tgoto end ) +if "%%1" == "latexpdf" ( +\t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %%BUILDDIR%%/latex +\tcd %%BUILDDIR%%/latex +\tmake all-pdf +\tcd %%BUILDDIR%%/.. +\techo. +\techo.Build finished; the PDF files are in %%BUILDDIR%%/latex. +\tgoto end +) + +if "%%1" == "latexpdfja" ( +\t%%SPHINXBUILD%% -b latex %%ALLSPHINXOPTS%% %%BUILDDIR%%/latex +\tcd %%BUILDDIR%%/latex +\tmake all-pdf-ja +\tcd %%BUILDDIR%%/.. +\techo. +\techo.Build finished; the PDF files are in %%BUILDDIR%%/latex. +\tgoto end +) + if "%%1" == "text" ( \t%%SPHINXBUILD%% -b text %%ALLSPHINXOPTS%% %%BUILDDIR%%/text \tif errorlevel 1 exit /b 1 @@ -717,6 +787,22 @@ results in %%BUILDDIR%%/doctest/output.txt. \tgoto end ) +if "%%1" == "xml" ( +\t%%SPHINXBUILD%% -b xml %%ALLSPHINXOPTS%% %%BUILDDIR%%/xml +\tif errorlevel 1 exit /b 1 +\techo. +\techo.Build finished. The XML files are in %%BUILDDIR%%/xml. +\tgoto end +) + +if "%%1" == "pseudoxml" ( +\t%%SPHINXBUILD%% -b pseudoxml %%ALLSPHINXOPTS%% %%BUILDDIR%%/pseudoxml +\tif errorlevel 1 exit /b 1 +\techo. +\techo.Build finished. The pseudo-XML files are in %%BUILDDIR%%/pseudoxml. +\tgoto end +) + :end ''' @@ -768,7 +854,7 @@ def do_prompt(d, key, text, default=None, validator=nonempty): prompt = purple(PROMPT_PREFIX + '%s [%s]: ' % (text, default)) else: prompt = purple(PROMPT_PREFIX + text + ': ') - x = term_input(prompt) + x = term_input(prompt).strip() if default and not x: x = default if not isinstance(x, unicode): diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index 6e9610a4..a3ff4bb4 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -283,5 +283,5 @@ class IndexBuilder(object): def context_for_searchtool(self): return dict( search_language_stemming_code = self.lang.js_stemmer_code, - search_language_stop_words = jsdump.dumps(self.lang.stopwords), + search_language_stop_words = jsdump.dumps(sorted(self.lang.stopwords)), ) diff --git a/sphinx/texinputs/Makefile b/sphinx/texinputs/Makefile index 76e7c3e2..6b87ad88 100644 --- a/sphinx/texinputs/Makefile +++ b/sphinx/texinputs/Makefile @@ -16,11 +16,11 @@ all-ps: all-dvi for f in *.dvi; do dvips $$f; done all-pdf-ja: - for f in *.pdf *.png *.gif *.jpg *.jpeg; do ebb $$f; done + for f in *.pdf *.png *.gif *.jpg *.jpeg; do extractbb $$f; done for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done - for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done + -for f in *.idx; do mendex -U -f -d "`basename $$f .idx`.dic" -s python.ist $$f; done for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done for f in *.tex; do platex -kanji=utf8 $(LATEXOPTS) $$f; done for f in *.dvi; do dvipdfmx $$f; done diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty index 08adec9e..c9d3e100 100644 --- a/sphinx/texinputs/sphinx.sty +++ b/sphinx/texinputs/sphinx.sty @@ -8,8 +8,9 @@ \NeedsTeXFormat{LaTeX2e}[1995/12/01] \ProvidesPackage{sphinx}[2010/01/15 LaTeX package (Sphinx markup)] +\@ifclassloaded{memoir}{}{\RequirePackage{fancyhdr}} + \RequirePackage{textcomp} -\RequirePackage{fancyhdr} \RequirePackage{fancybox} \RequirePackage{titlesec} \RequirePackage{tabulary} @@ -45,6 +46,13 @@ %\renewcommand{\paperwidth}{8.5in} % typical squarish manual %\renewcommand{\paperwidth}{7in} % O'Reilly ``Programmming Python'' +% use pdfoutput for pTeX and dvipdfmx +\ifx\kanjiskip\undefined\else + \ifx\Gin@driver{dvipdfmx.def}\undefined\else + \newcount\pdfoutput\pdfoutput=0 + \fi +\fi + % For graphicx, check if we are compiling under latex or pdflatex. \ifx\pdftexversion\undefined \usepackage{graphicx} @@ -111,6 +119,10 @@ \fancyhead[LE,RO]{{\py@HeaderFamily \@title, \py@release}} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\footrulewidth}{0.4pt} + % define chaptermark with \@chappos when \@chappos is available for Japanese + \ifx\@chappos\undefined\else + \def\chaptermark##1{\markboth{\@chapapp\space\thechapter\space\@chappos\space ##1}{}} + \fi } % Update the plain style so we get the page number & footer line, % but not a chapter or section title. This is to keep the first @@ -243,7 +255,7 @@ \addtolength{\py@noticelength}{-2\fboxsep} \addtolength{\py@noticelength}{-2\fboxrule} %\setlength{\shadowsize}{3pt} - \Sbox + \noindent\Sbox \minipage{\py@noticelength} } \newcommand{\py@endheavybox}{ @@ -254,12 +266,12 @@ \newcommand{\py@lightbox}{{% \setlength\parskip{0pt}\par - \rule[0ex]{\linewidth}{0.5pt}% - \par\vspace{-0.5ex}% + \noindent\rule[0ex]{\linewidth}{0.5pt}% + \par\noindent\vspace{-0.5ex}% }} \newcommand{\py@endlightbox}{{% \setlength{\parskip}{0pt}% - \par\rule[0.5ex]{\linewidth}{0.5pt}% + \par\noindent\rule[0.5ex]{\linewidth}{0.5pt}% \par\vspace{-0.5ex}% }} @@ -405,20 +417,38 @@ % Fix the index environment to add an entry to the Table of % Contents; this is much nicer than just having to jump to the end of the book % and flip around, especially with multiple indexes. +% The memoir class already does this, so we don't duplicate it in that case. % % A similiar fix must be done to the bibliography environment, although % dependant on document class. In particular, the '\addcontentsline' command % should use 'chapter' for a report and 'section' for an article. % See sphinxmanual.cls and sphinxhowto.cls for specific fixes. % -\let\py@OldTheindex=\theindex -\renewcommand{\theindex}{ - \cleardoublepage - \phantomsection - \py@OldTheindex - \addcontentsline{toc}{chapter}{\indexname} +\@ifclassloaded{memoir}{}{ + \let\py@OldTheindex=\theindex + \renewcommand{\theindex}{ + \cleardoublepage + \phantomsection + \py@OldTheindex + \addcontentsline{toc}{chapter}{\indexname} + } } +% to make pdf with correct encoded bookmarks in Japanese +% this should precede the hyperref package +\ifx\kanjiskip\undefined\else + \usepackage{atbegshi} + \ifx\ucs\undefined + \ifnum 42146=\euc"A4A2 + \AtBeginShipoutFirst{\special{pdf:tounicode EUC-UCS2}} + \else + \AtBeginShipoutFirst{\special{pdf:tounicode 90ms-RKSJ-UCS2}} + \fi + \else + \AtBeginShipoutFirst{\special{pdf:tounicode UTF8-UCS2}} + \fi +\fi + % Include hyperref last. \RequirePackage[colorlinks,breaklinks, linkcolor=InnerLinkColor,filecolor=OuterLinkColor, @@ -476,3 +506,37 @@ \@gobble } \def\FN@sf@gobble@twobracket[#1]#2{} + +% adjust the margins for footer, +% this works with the jsclasses only (Japanese standard document classes) +\ifx\@jsc@uplatextrue\undefined\else + \hypersetup{setpagesize=false} + \setlength\footskip{2\baselineskip} + \addtolength{\textheight}{-2\baselineskip} +\fi + +% fix the double index and bibliography on the table of contents +% in jsclasses (Japanese standard document classes) +\ifx\@jsc@uplatextrue\undefined\else + \renewcommand{\theindex}{ + \cleardoublepage + \phantomsection + \py@OldTheindex + } + \renewcommand{\thebibliography}[1]{ + \cleardoublepage + \phantomsection + \py@OldThebibliography{1} + } +\fi + +% do not use \@chappos in Appendix in pTeX +\ifx\kanjiskip\undefined\else + \renewcommand{\appendix}{\par + \setcounter{chapter}{0} + \setcounter{section}{0} + \gdef\@chapapp{\appendixname} + \gdef\@chappos{} + \gdef\thechapter{\@Alph\c@chapter} + } +\fi diff --git a/sphinx/texinputs/sphinxhowto.cls b/sphinx/texinputs/sphinxhowto.cls index f4e3d2f4..9625870e 100644 --- a/sphinx/texinputs/sphinxhowto.cls +++ b/sphinx/texinputs/sphinxhowto.cls @@ -1,5 +1,5 @@ % -% sphinxhowto.cls for Sphinx (http://sphinx.pocoo.org/) +% sphinxhowto.cls for Sphinx (http://sphinx-doc.org/) % \NeedsTeXFormat{LaTeX2e}[1995/12/01] diff --git a/sphinx/texinputs/sphinxmanual.cls b/sphinx/texinputs/sphinxmanual.cls index 57fad1a9..a04cea5b 100644 --- a/sphinx/texinputs/sphinxmanual.cls +++ b/sphinx/texinputs/sphinxmanual.cls @@ -1,5 +1,5 @@ % -% sphinxmanual.cls for Sphinx (http://sphinx.pocoo.org/) +% sphinxmanual.cls for Sphinx (http://sphinx-doc.org/) % \NeedsTeXFormat{LaTeX2e}[1995/12/01] diff --git a/sphinx/themes/agogo/theme.conf b/sphinx/themes/agogo/theme.conf index 3fc88580..3052aca3 100644 --- a/sphinx/themes/agogo/theme.conf +++ b/sphinx/themes/agogo/theme.conf @@ -10,7 +10,7 @@ pagewidth = 70em documentwidth = 50em sidebarwidth = 20em bgcolor = #eeeeec -headerbg = url(bgtop.png) top left repeat-x +headerbg = #555573 url(bgtop.png) top left repeat-x footerbg = url(bgfooter.png) top left repeat-x linkcolor = #ce5c00 headercolor1 = #204a87 diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 9fb989cb..612dc38f 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -195,7 +195,7 @@ {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} {%- endif %} {%- if show_sphinx %} - {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} + {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx-doc.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} {%- endif %} </div> {%- endblock %} diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index d4619fdf..38feb6c5 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -62,18 +62,6 @@ jQuery.getQueryParameters = function(s) { }; /** - * small function to check if an array contains - * a given item. - */ -jQuery.contains = function(arr, item) { - for (var i = 0; i < arr.length; i++) { - if (arr[i] == item) - return true; - } - return false; -}; - -/** * highlight a given string on a jquery object by wrapping it in * span elements with the given class name. */ diff --git a/sphinx/themes/basic/static/searchtools.js_t b/sphinx/themes/basic/static/searchtools.js_t index 45989c6a..8e8acb8e 100644 --- a/sphinx/themes/basic/static/searchtools.js_t +++ b/sphinx/themes/basic/static/searchtools.js_t @@ -150,7 +150,7 @@ var Search = { hlterms.push(tmp[i].toLowerCase()); } // only add if not already in the list - if (!$.contains(toAppend, word)) + if (!$u.contains(toAppend, word)) toAppend.push(word); }; var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" ")); @@ -217,7 +217,7 @@ var Search = { // search result. for (var i = 0; i < excluded.length; i++) { if (terms[excluded[i]] == file || - $.contains(terms[excluded[i]] || [], file)) { + $u.contains(terms[excluded[i]] || [], file)) { valid = false; break; } diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 6cb83aec..5d0c2811 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -197,13 +197,18 @@ def get_module_source(modname): except Exception, err: raise PycodeError('error importing %r' % modname, err) mod = sys.modules[modname] - if hasattr(mod, '__loader__'): + filename = getattr(mod, '__file__', None) + loader = getattr(mod, '__loader__', None) + if loader and getattr(loader, 'get_filename', None): + try: + filename = loader.get_filename(modname) + except Exception, err: + raise PycodeError('error getting filename for %r' % filename, err) + if filename is None and loader: try: - source = mod.__loader__.get_source(modname) + return 'string', loader.get_source(modname) except Exception, err: raise PycodeError('error getting source for %r' % modname, err) - return 'string', source - filename = getattr(mod, '__file__', None) if filename is None: raise PycodeError('no source found for module %r' % modname) filename = path.normpath(path.abspath(filename)) diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index b5c3db59..ba3fa968 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -45,7 +45,10 @@ if sys.version_info >= (2, 5): del func_defaults[i] except IndexError: pass - return inspect.ArgSpec(args, varargs, varkw, func_defaults) + if sys.version_info >= (2, 6): + return inspect.ArgSpec(args, varargs, varkw, func_defaults) + else: + return (args, varargs, varkw, func_defaults) else: getargspec = inspect.getargspec diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index dbedb7f2..62796bec 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -43,6 +43,15 @@ IGNORED_NODES = ( def extract_messages(doctree): """Extract translatable messages from a document tree.""" for node in doctree.traverse(nodes.TextElement): + # workaround: nodes.term doesn't have source, line and rawsource + # (fixed in Docutils r7495) + if isinstance(node, nodes.term) and not node.source: + definition_list_item = node.parent + if definition_list_item.line is not None: + node.source = definition_list_item.source + node.line = definition_list_item.line - 1 + node.rawsource = definition_list_item.\ + rawsource.split("\n", 2)[0] if not node.source: continue # built-in message if isinstance(node, IGNORED_NODES): diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 8dc3b9d3..17619ee1 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -40,12 +40,20 @@ def relative_uri(base, to): return to b2 = base.split(SEP) t2 = to.split(SEP) - # remove common segments - for x, y in zip(b2, t2): + # remove common segments (except the last segment) + for x, y in zip(b2[:-1], t2[:-1]): if x != y: break b2.pop(0) t2.pop(0) + if b2 == t2: + # Special case: relative_uri('f/index.html','f/index.html') + # returns '', not 'index.html' + return '' + if len(b2) == 1 and t2 == ['']: + # Special case: relative_uri('f/index.html','f/') should + # return './', not '' + return '.' + SEP return ('..' + SEP) * (len(b2)-1) + SEP.join(t2) @@ -136,8 +144,9 @@ else: def safe_relpath(path, start=None): + from sphinx.util.pycompat import relpath try: - return os.path.relpath(path, start) + return relpath(path, start) except ValueError: return path diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 9e081b02..c2c6fe8b 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -82,6 +82,10 @@ if sys.version_info >= (2, 6): except ImportError: from itertools import izip_longest as zip_longest + import os + relpath = os.path.relpath + del os + else: # Python < 2.6 from itertools import izip, repeat, chain @@ -114,6 +118,26 @@ else: except IndexError: pass + from os.path import curdir + def relpath(path, start=curdir): + """Return a relative version of a path""" + from os.path import sep, abspath, commonprefix, join, pardir + + if not path: + raise ValueError("no path specified") + + start_list = abspath(start).split(sep) + path_list = abspath(path).split(sep) + + # Work out how much of the filepath is shared by start and path. + i = len(commonprefix([start_list, path_list])) + + rel_list = [pardir] * (len(start_list)-i) + path_list[i:] + if not rel_list: + return curdir + return join(*rel_list) + del curdir + # ------------------------------------------------------------------------------ # Missing builtins and codecs in Python < 2.5 diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 2051e38e..d714ed4f 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -23,7 +23,10 @@ from sphinx.util.smartypants import sphinx_smarty_pants try: from PIL import Image # check for the Python Imaging Library except ImportError: - Image = None + try: + import Image + except ImportError: + Image = None class HTMLWriter(Writer): diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index f2ebad36..aadf4401 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -100,7 +100,9 @@ class LaTeXWriter(writers.Writer): class ExtBabel(Babel): def get_shorthandoff(self): shortlang = self.language.split('_')[0] - if shortlang in ('de', 'sl', 'pt', 'es', 'nl', 'pl', 'it'): + if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', + 'es', 'spanish', 'nl', 'dutch', 'pl', 'polish', 'it', + 'italian'): return '\\shorthandoff{"}' return '' @@ -133,6 +135,7 @@ class LaTeXTranslator(nodes.NodeVisitor): 'papersize': 'letterpaper', 'pointsize': '10pt', 'classoptions': '', + 'extraclassoptions': '', 'inputenc': '\\usepackage[utf8]{inputenc}', 'utf8extra': '\\DeclareUnicodeCharacter{00A0}{\\nobreakspace}', 'fontenc': '\\usepackage[T1]{fontenc}', @@ -204,17 +207,19 @@ class LaTeXTranslator(nodes.NodeVisitor): # pTeX (Japanese TeX) for support if builder.config.language == 'ja': - self.elements['classoptions'] = ',dvipdfm' - # found elements of babel, but this should be above sphinx.sty. - # because pTeX (Japanese TeX) cannot handle this count. - self.elements['babel'] = r'\newcount\pdfoutput\pdfoutput=0' - # to make the pdf with correct encoded hyperref bookmarks - self.elements['preamble'] += \ - r'\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}' + # use dvipdfmx as default class option in Japanese + self.elements['classoptions'] = ',dvipdfmx' + # disable babel which has not publishing quality in Japanese + self.elements['babel'] = '' + # disable fncychap in Japanese documents + self.elements['fncychap'] = '' else: self.elements['classoptions'] += ',english' # allow the user to override them all self.elements.update(builder.config.latex_elements) + if self.elements['extraclassoptions']: + self.elements['classoptions'] += ',' + \ + self.elements['extraclassoptions'] self.highlighter = highlighting.PygmentsBridge('latex', builder.config.pygments_style, builder.config.trim_doctest_flags) diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py index 81f2988b..e074691e 100644 --- a/sphinx/writers/manpage.py +++ b/sphinx/writers/manpage.py @@ -72,6 +72,11 @@ class ManualPageTranslator(BaseTranslator): # since self.append_header() is never called, need to do this here self.body.append(MACRO_DEF) + # Overwrite admonition label translations with our own + for label, translation in admonitionlabels.items(): + self.language.labels[label] = self.deunicode(translation) + + # overwritten -- added quotes around all .TH arguments def header(self): tmpl = (".TH \"%(title_upper)s\" \"%(manual_section)s\"" @@ -193,12 +198,6 @@ class ManualPageTranslator(BaseTranslator): def depart_seealso(self, node): self.depart_admonition(node) - # overwritten -- use our own label translations - def visit_admonition(self, node, name=None): - if name: - self.body.append('.IP %s\n' % - self.deunicode(admonitionlabels.get(name, name))) - def visit_productionlist(self, node): self.ensure_eol() names = [] diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 5799e023..198d1e06 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -233,30 +233,31 @@ class TexinfoTranslator(nodes.NodeVisitor): """Generates a unique id for each section. Assigns the attribute ``node_name`` to each section.""" + + def add_node_name(name): + node_id = self.escape_id(name) + nth, suffix = 1, '' + while node_id + suffix in self.written_ids or \ + node_id + suffix in self.node_names: + nth += 1 + suffix = '<%s>' % nth + node_id += suffix + self.written_ids.add(node_id) + self.node_names[node_id] = name + return node_id + # must have a "Top" node self.document['node_name'] = 'Top' - self.node_names['Top'] = 'Top' - self.written_ids.update(('Top', 'top')) + add_node_name('Top') + add_node_name('top') # each index is a node - for name, content in self.indices: - self.node_names[name] = name - self.written_ids.add(name) + self.indices = [(add_node_name(name), content) + for name, content in self.indices] # each section is also a node for section in self.document.traverse(nodes.section): title = section.next_node(nodes.Titular) name = (title and title.astext()) or '<untitled>' - node_id = self.escape_id(name) or '<untitled>' - assert node_id and name - nth, suffix = 1, '' - while node_id + suffix in self.written_ids: - nth += 1 - suffix = '<%s>' % nth - node_id += suffix - assert node_id not in self.node_names - assert node_id not in self.written_ids - section['node_name'] = node_id - self.node_names[node_id] = name - self.written_ids.add(node_id) + section['node_name'] = add_node_name(name) def collect_node_menus(self): """Collect the menu entries for each "node" section.""" @@ -371,7 +372,11 @@ class TexinfoTranslator(nodes.NodeVisitor): for entry in entries: name = self.node_names[entry] # special formatting for entries that are divided by an em-dash - parts = reg.split(name, 1) + try: + parts = reg.split(name, 1) + except TypeError: + # could be a gettext proxy + parts = [name] if len(parts) == 2: name, desc = parts else: @@ -450,8 +455,7 @@ class TexinfoTranslator(nodes.NodeVisitor): self.builder.docnames) if not content: continue - node_name = self.escape_id(indexcls.localname) - self.indices.append((node_name, + self.indices.append((indexcls.localname, generate(content, collapsed))) self.indices.append((_('Index'), '\n@printindex ge\n')) diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index e5ab070c..e62c05f4 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -71,6 +71,7 @@ class TextTranslator(nodes.NodeVisitor): self.stateindent = [0] self.list_counter = [] self.sectionlevel = 0 + self.lineblocklevel = 0 self.table = None def add_text(self, text): @@ -593,14 +594,18 @@ class TextTranslator(nodes.NodeVisitor): self.end_state(wrap=False) def visit_line_block(self, node): - self.new_state(0) + self.new_state() + self.lineblocklevel += 1 def depart_line_block(self, node): - self.end_state(wrap=False) + self.lineblocklevel -= 1 + self.end_state(wrap=False, end=None) + if not self.lineblocklevel: + self.add_text('\n') def visit_line(self, node): pass def depart_line(self, node): - pass + self.add_text('\n') def visit_block_quote(self, node): self.new_state() @@ -709,6 +714,11 @@ class TextTranslator(nodes.NodeVisitor): def depart_inline(self, node): pass + def visit_container(self, node): + pass + def depart_container(self, node): + pass + def visit_problematic(self, node): self.add_text('>>') def depart_problematic(self, node): diff --git a/sphinx/writers/xml.py b/sphinx/writers/xml.py new file mode 100644 index 00000000..02becb73 --- /dev/null +++ b/sphinx/writers/xml.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers.xml + ~~~~~~~~~~~~~~~~~~ + + Docutils-native XML and pseudo-XML writers. + + :copyright: Copyright 2007-2012 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +from docutils import writers +from docutils.writers.docutils_xml import Writer as BaseXMLWriter +from docutils.writers.docutils_xml import XMLTranslator as BaseXMLTranslator + + +class XMLWriter(BaseXMLWriter): + + def __init__(self, builder): + BaseXMLWriter.__init__(self) + self.builder = builder + + def translate(self, *args, **kwargs): + self.document.settings.newlines = \ + self.document.settings.indents = \ + self.builder.env.config.xml_pretty + self.document.settings.xml_declaration = True + self.document.settings.doctype_declaration = True + return BaseXMLWriter.translate(self) + + +class XMLTranslator(BaseXMLTranslator): + def __init__(self, builder, doc): + BaseXMLTranslator.__init__(self, doc) + self.builder = builder + + +class PseudoXMLWriter(writers.Writer): + + supported = ('pprint', 'pformat', 'pseudoxml') + """Formats this writer supports.""" + + config_section = 'pseudoxml writer' + config_section_dependencies = ('writers',) + + output = None + """Final translated form of `document`.""" + + def __init__(self, builder): + writers.Writer.__init__(self) + self.builder = builder + + def translate(self): + self.output = self.document.pformat() + + def supports(self, format): + """This writer supports all format-specific elements.""" + return True diff --git a/tests/root/autodoc.txt b/tests/root/autodoc.txt index 5c03f947..d4b3404c 100644 --- a/tests/root/autodoc.txt +++ b/tests/root/autodoc.txt @@ -32,3 +32,16 @@ Just testing a few autodoc possibilities... :noindex: .. autoclass:: MarkupError + + +.. currentmodule:: test_autodoc + +.. autoclass:: InstAttCls + :members: + + All members (5 total) + +.. autoclass:: InstAttCls + :members: ca1, ia1 + + Specific members (2 total) diff --git a/tests/root/conf.py b/tests/root/conf.py index b97ddfcc..a3ebeec7 100644 --- a/tests/root/conf.py +++ b/tests/root/conf.py @@ -3,6 +3,7 @@ import sys, os sys.path.append(os.path.abspath('.')) +sys.path.append(os.path.abspath('..')) extensions = ['sphinx.ext.autodoc', 'sphinx.ext.jsmath', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.autosummary', @@ -67,6 +68,28 @@ extlinks = {'issue': ('http://bugs.python.org/issue%s', 'issue '), # modify tags from conf.py tags.add('confpytag') +# -- linkcode + +if 'test_linkcode' in tags: + import glob + + extensions.remove('sphinx.ext.viewcode') + extensions.append('sphinx.ext.linkcode') + + exclude_patterns.extend(glob.glob('*.txt') + glob.glob('*/*.txt')) + exclude_patterns.remove('contents.txt') + exclude_patterns.remove('objects.txt') + + def linkcode_resolve(domain, info): + if domain == 'py': + fn = info['module'].replace('.', '/') + return "http://foobar/source/%s.py" % fn + elif domain == "js": + return "http://foobar/js/" + info['fullname'] + elif domain in ("c", "cpp"): + return "http://foobar/%s/%s" % (domain, "".join(info['names'])) + else: + raise AssertionError() # -- extension API diff --git a/tests/root/contents.txt b/tests/root/contents.txt index 280953b4..0a8ca00e 100644 --- a/tests/root/contents.txt +++ b/tests/root/contents.txt @@ -27,6 +27,8 @@ Contents: doctest extensions versioning/index + only + i18n/index Python <http://python.org/> diff --git a/tests/root/i18n/external_links.po b/tests/root/i18n/external_links.po new file mode 100644 index 00000000..4cd19dda --- /dev/null +++ b/tests/root/i18n/external_links.po @@ -0,0 +1,32 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2012, foof +# This file is distributed under the same license as the foo package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: sphinx 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-11-22 08:28\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "i18n with external links" +msgstr "EXTERNAL LINKS" + +msgid "External link to Python_." +msgstr "EXTERNAL LINK TO Python_." + +msgid "Internal link to `i18n with external links`_." +msgstr "`EXTERNAL LINKS`_ IS INTERNAL LINK." + +msgid "Inline link by `Sphinx <http://sphinx-doc.org>`_." +msgstr "INLINE LINK BY `SPHINX <http://sphinx-doc.org>`_." + +msgid "Unnamed link__." +msgstr "UNNAMED LINK__." diff --git a/tests/root/i18n/external_links.txt b/tests/root/i18n/external_links.txt new file mode 100644 index 00000000..7ac1db02 --- /dev/null +++ b/tests/root/i18n/external_links.txt @@ -0,0 +1,13 @@ +:tocdepth: 2 + +i18n with external links +======================== +.. #1044 external-links-dont-work-in-localized-html + +* External link to Python_. +* Internal link to `i18n with external links`_. +* Inline link by `Sphinx <http://sphinx-doc.org>`_. +* Unnamed link__. + +.. _Python: http://python.org +.. __: http://google.com diff --git a/tests/root/i18n/footnote.po b/tests/root/i18n/footnote.po new file mode 100644 index 00000000..47f8d3db --- /dev/null +++ b/tests/root/i18n/footnote.po @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2012, foof +# This file is distributed under the same license as the foo package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: sphinx 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-11-22 08:28\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "i18n with Footnote" +msgstr "I18N WITH FOOTNOTE" + +msgid "[100]_ Contents [#]_ for `i18n with Footnote`_ [ref]_" +msgstr "`I18N WITH FOOTNOTE`_ INCLUDE THIS CONTENTS [ref]_ [#]_ [100]_" + +msgid "This is a auto numbered footnote." +msgstr "THIS IS A AUTO NUMBERED FOOTNOTE." + +msgid "This is a named footnote." +msgstr "THIS IS A NAMED FOOTNOTE." + +msgid "This is a numbered footnote." +msgstr "THIS IS A NUMBERED FOOTNOTE." + diff --git a/tests/root/i18n/footnote.txt b/tests/root/i18n/footnote.txt new file mode 100644 index 00000000..3ef76bba --- /dev/null +++ b/tests/root/i18n/footnote.txt @@ -0,0 +1,11 @@ +:tocdepth: 2 + +i18n with Footnote +================== +.. #955 cant-build-html-with-footnotes-when-using + +[100]_ Contents [#]_ for `i18n with Footnote`_ [ref]_ + +.. [#] This is a auto numbered footnote. +.. [ref] This is a named footnote. +.. [100] This is a numbered footnote. diff --git a/tests/root/i18n/index.txt b/tests/root/i18n/index.txt new file mode 100644 index 00000000..f35e2766 --- /dev/null +++ b/tests/root/i18n/index.txt @@ -0,0 +1,7 @@ +.. toctree:: + :maxdepth: 2 + :numbered: + + footnote + external_links + refs_inconsistency diff --git a/tests/root/i18n/refs_inconsistency.po b/tests/root/i18n/refs_inconsistency.po new file mode 100644 index 00000000..9cab687f --- /dev/null +++ b/tests/root/i18n/refs_inconsistency.po @@ -0,0 +1,39 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2012, foof +# This file is distributed under the same license as the foo package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: sphinx 1.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-05 08:28\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <LL@li.org>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "i18n with refs inconsistency" +msgstr "I18N WITH REFS INCONSISTENCY" + +msgid "[100]_ for [#]_ footnote [ref2]_." +msgstr "FOR FOOTNOTE [ref2]_." + +msgid "for reference_." +msgstr "reference_ FOR reference_." + +msgid "normal text." +msgstr "ORPHAN REFERENCE: `I18N WITH REFS INCONSISTENCY`_." + +msgid "This is a auto numbered footnote." +msgstr "THIS IS A AUTO NUMBERED FOOTNOTE." + +msgid "This is a named footnote." +msgstr "THIS IS A NAMED FOOTNOTE." + +msgid "This is a numbered footnote." +msgstr "THIS IS A NUMBERED FOOTNOTE." + diff --git a/tests/root/i18n/refs_inconsistency.txt b/tests/root/i18n/refs_inconsistency.txt new file mode 100644 index 00000000..c65c5b45 --- /dev/null +++ b/tests/root/i18n/refs_inconsistency.txt @@ -0,0 +1,13 @@ +:tocdepth: 2 + +i18n with refs inconsistency +============================= + +* [100]_ for [#]_ footnote [ref2]_. +* for reference_. +* normal text. + +.. [#] This is a auto numbered footnote. +.. [ref2] This is a named footnote. +.. [100] This is a numbered footnote. +.. _reference: http://www.example.com diff --git a/tests/root/only.txt b/tests/root/only.txt new file mode 100644 index 00000000..4a3eb48a --- /dev/null +++ b/tests/root/only.txt @@ -0,0 +1,203 @@ + +1. Sections in only directives +============================== + +Testing sections in only directives. + +.. only:: nonexisting_tag + + Skipped Section + --------------- + Should not be here. + +.. only:: not nonexisting_tag + + 1.1. Section + ------------ + Should be here. + +1.2. Section +------------ + +.. only:: not nonexisting_tag + + 1.2.1. Subsection + ~~~~~~~~~~~~~~~~~ + Should be here. + +.. only:: nonexisting_tag + + Skipped Subsection + ~~~~~~~~~~~~~~~~~~ + Should not be here. + +1.3. Section +------------ + +1.3.1. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +1.4. Section +------------ + +.. only:: not nonexisting_tag + + 1.4.1. Subsection + ~~~~~~~~~~~~~~~~~ + Should be here. + +1.5. Section +------------ + +.. only:: not nonexisting_tag + + 1.5.1. Subsection + ~~~~~~~~~~~~~~~~~ + Should be here. + +1.5.2. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +1.6. Section +------------ + +1.6.1. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +.. only:: not nonexisting_tag + + 1.6.2. Subsection + ~~~~~~~~~~~~~~~~~ + Should be here. + +1.6.3. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +1.7. Section +------------ + +1.7.1. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +.. only:: not nonexisting_tag + + 1.7.1.1. Subsubsection + ...................... + Should be here. + +1.8. Section +------------ + +1.8.1. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +1.8.1.1. Subsubsection +...................... +Should be here. + +.. only:: not nonexisting_tag + + 1.8.1.2. Subsubsection + ...................... + Should be here. + +1.9. Section +------------ + +.. only:: nonexisting_tag + + Skipped Subsection + ~~~~~~~~~~~~~~~~~~ + +1.9.1. Subsection +~~~~~~~~~~~~~~~~~ +Should be here. + +1.9.1.1. Subsubsection +...................... +Should be here. + +.. only:: not nonexisting_tag + + 1.10. Section + ------------- + Should be here. + +1.11. Section +------------- + +Text before subsection 11.1. + +.. only:: not nonexisting_tag + + More text before subsection 11.1. + + 1.11.1. Subsection + ~~~~~~~~~~~~~~~~~~ + Should be here. + +Text after subsection 11.1. + +.. only:: not nonexisting_tag + + 1.12. Section + ------------- + Should be here. + + 1.12.1. Subsection + ~~~~~~~~~~~~~~~~~~ + Should be here. + + 1.13. Section + ------------- + Should be here. + +.. only:: not nonexisting_tag + + 1.14. Section + ------------- + Should be here. + + .. only:: not nonexisting_tag + + 1.14.1. Subsection + ~~~~~~~~~~~~~~~~~~ + Should be here. + + 1.15. Section + ------------- + Should be here. + +.. only:: nonexisting_tag + + Skipped document level heading + ============================== + Should not be here. + +.. only:: not nonexisting_tag + + 2. Included document level heading + ================================== + Should be here. + +3. Document level heading +========================= +Should be here. + +.. only:: nonexisting_tag + + Skipped document level heading + ============================== + Should not be here. + +.. only:: not nonexisting_tag + + 4. Another included document level heading + ========================================== + Should be here. diff --git a/tests/run.py b/tests/run.py index ee63fa3f..4cd4a766 100755 --- a/tests/run.py +++ b/tests/run.py @@ -11,19 +11,24 @@ """ import sys -from os import path, chdir, listdir +from os import path, chdir, listdir, environ if sys.version_info >= (3, 0): print('Copying and converting sources to build/lib/tests...') from distutils.util import copydir_run_2to3 testroot = path.dirname(__file__) or '.' - newroot = path.join(testroot, path.pardir, 'build') - newroot = path.join(newroot, listdir(newroot)[0], 'tests') + if 'BUILD_TEST_PATH' in environ: + # for tox testing + newroot = environ['BUILD_TEST_PATH'] + # tox installs the sphinx package, no need for sys.path.insert + else: + newroot = path.join(testroot, path.pardir, 'build') + newroot = path.join(newroot, listdir(newroot)[0], 'tests') + # always test the sphinx package from build/lib/ + sys.path.insert(0, path.abspath(path.join(newroot, path.pardir))) copydir_run_2to3(testroot, newroot) # switch to the converted dir so nose tests the right tests chdir(newroot) - # always test the sphinx package from build/lib/ - sys.path.insert(0, path.pardir) else: # always test the sphinx package from this directory sys.path.insert(0, path.join(path.dirname(__file__), path.pardir)) diff --git a/tests/test_application.py b/tests/test_application.py index 4baabcec..a6e798c2 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -12,6 +12,7 @@ from StringIO import StringIO from sphinx.application import ExtensionError +from sphinx.domains import Domain from util import * @@ -69,3 +70,23 @@ def test_extensions(): assert warnings.getvalue().startswith("WARNING: extension 'shutil'") finally: app.cleanup() + +def test_domain_override(): + class A(Domain): + name = 'foo' + class B(A): + name = 'foo' + class C(Domain): + name = 'foo' + status, warnings = StringIO(), StringIO() + app = TestApp(status=status, warning=warnings) + try: + # No domain know named foo. + raises_msg(ExtensionError, 'domain foo not yet registered', + app.override_domain, A) + assert app.add_domain(A) is None + assert app.override_domain(B) is None + raises_msg(ExtensionError, 'new domain not a subclass of registered ' + 'foo domain', app.override_domain, C) + finally: + app.cleanup() diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index 965064c3..642b9141 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -519,6 +519,12 @@ def test_generate(): assert_result_contains( ' rest of docstring', 'method', 'test_autodoc.DocstringSig.meth') assert_result_contains( + '.. py:method:: DocstringSig.meth2()', 'method', + 'test_autodoc.DocstringSig.meth2') + assert_result_contains( + ' indented line', 'method', + 'test_autodoc.DocstringSig.meth2') + assert_result_contains( '.. py:classmethod:: Class.moore(a, e, f) -> happiness', 'method', 'test_autodoc.Class.moore') @@ -534,6 +540,32 @@ def test_generate(): assert_result_contains( ' :annotation: = None', 'attribute', 'AttCls.a2') + # test explicit members with instance attributes + del directive.env.temp_data['autodoc:class'] + del directive.env.temp_data['autodoc:module'] + directive.env.temp_data['py:module'] = 'test_autodoc' + options.inherited_members = False + options.undoc_members = False + options.members = ALL + assert_processes([ + ('class', 'test_autodoc.InstAttCls'), + ('attribute', 'test_autodoc.InstAttCls.ca1'), + ('attribute', 'test_autodoc.InstAttCls.ca2'), + ('attribute', 'test_autodoc.InstAttCls.ca3'), + ('attribute', 'test_autodoc.InstAttCls.ia1'), + ('attribute', 'test_autodoc.InstAttCls.ia2'), + ], 'class', 'InstAttCls') + del directive.env.temp_data['autodoc:class'] + del directive.env.temp_data['autodoc:module'] + options.members = ['ca1', 'ia1'] + assert_processes([ + ('class', 'test_autodoc.InstAttCls'), + ('attribute', 'test_autodoc.InstAttCls.ca1'), + ('attribute', 'test_autodoc.InstAttCls.ia1'), + ], 'class', 'InstAttCls') + del directive.env.temp_data['autodoc:class'] + del directive.env.temp_data['autodoc:module'] + del directive.env.temp_data['py:module'] # --- generate fodder ------------ @@ -660,6 +692,13 @@ First line of docstring rest of docstring """ + def meth2(self): + """First line, no signature + Second line followed by indentation:: + + indented line + """ + class StrRepr(str): def __repr__(self): return self @@ -667,3 +706,22 @@ class StrRepr(str): class AttCls(object): a1 = StrRepr('hello\nworld') a2 = None + +class InstAttCls(object): + """Class with documented class and instance attributes.""" + + #: Doc comment for class attribute InstAttCls.ca1. + #: It can have multiple lines. + ca1 = 'a' + + ca2 = 'b' #: Doc comment for InstAttCls.ca2. One line only. + + ca3 = 'c' + """Docstring for class attribute InstAttCls.ca3.""" + + def __init__(self): + #: Doc comment for instance attribute InstAttCls.ia1 + self.ia1 = 'd' + + self.ia2 = 'e' + """Docstring for instance attribute InstAttCls.ia2.""" diff --git a/tests/test_build.py b/tests/test_build.py index ae3f2921..02b3c868 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -63,6 +63,14 @@ else: def test_singlehtml(app): app.builder.build_all() +@with_app(buildername='xml') +def test_xml(app): + app.builder.build_all() + +@with_app(buildername='pseudoxml') +def test_pseudoxml(app): + app.builder.build_all() + @with_app(buildername='html', srcdir='(temp)') def test_multibyte_path(app): srcdir = path(app.srcdir) diff --git a/tests/test_build_html.py b/tests/test_build_html.py index a38806a8..a693e6c0 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -44,7 +44,7 @@ reading included file u'.*?wrongenc.inc' seems to be wrong, try giving an \ %(root)s/includes.txt:4: WARNING: download file not readable: .*?nonexisting.png %(root)s/objects.txt:\\d*: WARNING: using old C markup; please migrate to \ new-style markup \(e.g. c:function instead of cfunction\), see \ -http://sphinx.pocoo.org/domains.html +http://sphinx-doc.org/domains.html """ HTML_WARNINGS = ENV_WARNINGS + """\ @@ -319,7 +319,8 @@ def check_static_entries(outdir): def test_html(app): app.builder.build_all() html_warnings = html_warnfile.getvalue().replace(os.sep, '/') - html_warnings_exp = HTML_WARNINGS % {'root': re.escape(app.srcdir)} + html_warnings_exp = HTML_WARNINGS % { + 'root': re.escape(app.srcdir.replace(os.sep, '/'))} assert re.match(html_warnings_exp + '$', html_warnings), \ 'Warnings don\'t match:\n' + \ '--- Expected (regex):\n' + html_warnings_exp + \ @@ -328,7 +329,7 @@ def test_html(app): for fname, paths in HTML_XPATH.iteritems(): parser = NslessParser() parser.entity.update(htmlentitydefs.entitydefs) - fp = open(os.path.join(app.outdir, fname)) + fp = open(os.path.join(app.outdir, fname), 'rb') try: etree = ET.parse(fp, parser) finally: diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index 4e1e9f70..2fa0698b 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -42,7 +42,8 @@ def test_latex(app): LaTeXTranslator.ignore_missing_images = True app.builder.build_all() latex_warnings = latex_warnfile.getvalue().replace(os.sep, '/') - latex_warnings_exp = LATEX_WARNINGS % {'root': re.escape(app.srcdir)} + latex_warnings_exp = LATEX_WARNINGS % { + 'root': re.escape(app.srcdir.replace(os.sep, '/'))} assert re.match(latex_warnings_exp + '$', latex_warnings), \ 'Warnings don\'t match:\n' + \ '--- Expected (regex):\n' + latex_warnings_exp + \ diff --git a/tests/test_build_texinfo.py b/tests/test_build_texinfo.py index c626c976..59d03e03 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -41,7 +41,8 @@ def test_texinfo(app): TexinfoTranslator.ignore_missing_images = True app.builder.build_all() texinfo_warnings = texinfo_warnfile.getvalue().replace(os.sep, '/') - texinfo_warnings_exp = TEXINFO_WARNINGS % {'root': re.escape(app.srcdir)} + texinfo_warnings_exp = TEXINFO_WARNINGS % { + 'root': re.escape(app.srcdir.replace(os.sep, '/'))} assert re.match(texinfo_warnings_exp + '$', texinfo_warnings), \ 'Warnings don\'t match:\n' + \ '--- Expected (regex):\n' + texinfo_warnings_exp + \ diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py index 3ab8ece4..c8466e37 100644 --- a/tests/test_cpp_domain.py +++ b/tests/test_cpp_domain.py @@ -11,7 +11,7 @@ from util import * -from sphinx.domains.cpp import DefinitionParser +from sphinx.domains.cpp import DefinitionParser, DefinitionError def parse(name, string): @@ -43,6 +43,15 @@ def test_type_definitions(): x = 'int printf(const char* fmt, ...)' assert unicode(parse('function', x)) == x + x = 'int foo(const unsigned int j)' + assert unicode(parse('function', x)) == x + + x = 'int foo(const unsigned int const j)' + assert unicode(parse('function', x)) == x + + x = 'int foo(const int* const ptr)' + assert unicode(parse('function', x)) == x + x = 'std::vector<std::pair<std::string, long long>> module::blah' assert unicode(parse('type_object', x)) == x @@ -60,6 +69,9 @@ def test_type_definitions(): x = 'constexpr int get_value()' assert unicode(parse('function', x)) == x + x = 'static constexpr int get_value()' + assert unicode(parse('function', x)) == x + x = 'int get_value() const noexcept' assert unicode(parse('function', x)) == x @@ -73,6 +85,21 @@ def test_type_definitions(): x = 'module::myclass foo[n]' assert unicode(parse('member_object', x)) == x + x = 'int foo(Foo f=Foo(double(), std::make_pair(int(2), double(3.4))))' + assert unicode(parse('function', x)) == x + + x = 'int foo(A a=x(a))' + assert unicode(parse('function', x)) == x + + x = 'int foo(B b=x(a)' + raises(DefinitionError, parse, 'function', x) + + x = 'int foo)C c=x(a))' + raises(DefinitionError, parse, 'function', x) + + x = 'int foo(D d=x(a' + raises(DefinitionError, parse, 'function', x) + def test_bases(): x = 'A' diff --git a/tests/test_env.py b/tests/test_env.py index e62db33b..2f75187f 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -54,6 +54,7 @@ def test_images(): tree = env.get_doctree('images') app._warning.reset() htmlbuilder = StandaloneHTMLBuilder(app) + htmlbuilder.imgpath = 'dummy' htmlbuilder.post_process_images(tree) image_uri_message = "no matching candidate for image URI u'foo.*'" if sys.version_info >= (3, 0): diff --git a/tests/test_intl.py b/tests/test_intl.py index d1e28002..94b21e8d 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -11,34 +11,45 @@ """ from subprocess import Popen, PIPE +import re +import os +from StringIO import StringIO from util import * from util import SkipTest +warnfile = StringIO() + + def setup_module(): (test_root / 'xx' / 'LC_MESSAGES').makedirs() # Compile all required catalogs into binary format (*.mo). - for catalog in 'bom', 'subdir': - try: - p = Popen(['msgfmt', test_root / '%s.po' % catalog, '-o', - test_root / 'xx' / 'LC_MESSAGES' / '%s.mo' % catalog], - stdout=PIPE, stderr=PIPE) - except OSError: - # The test will fail the second time it's run if we don't - # tear down here. Not sure if there's a more idiomatic way - # of ensuring that teardown gets run in the event of an - # exception from the setup function. - teardown_module() - raise SkipTest # most likely msgfmt was not found - else: - stdout, stderr = p.communicate() - if p.returncode != 0: - print stdout - print stderr - assert False, 'msgfmt exited with return code %s' % p.returncode - assert (test_root / 'xx' / 'LC_MESSAGES' / ('%s.mo' % catalog) - ).isfile(), 'msgfmt failed' + for dirpath, dirs, files in os.walk(test_root): + dirpath = path(dirpath) + for f in [f for f in files if f.endswith('.po')]: + po = dirpath / f + mo = test_root / 'xx' / 'LC_MESSAGES' / ( + os.path.relpath(po[:-3], test_root) + '.mo') + if not mo.parent.exists(): + mo.parent.makedirs() + try: + p = Popen(['msgfmt', po, '-o', mo], + stdout=PIPE, stderr=PIPE) + except OSError: + # The test will fail the second time it's run if we don't + # tear down here. Not sure if there's a more idiomatic way + # of ensuring that teardown gets run in the event of an + # exception from the setup function. + teardown_module() + raise SkipTest # most likely msgfmt was not found + else: + stdout, stderr = p.communicate() + if p.returncode != 0: + print stdout + print stderr + assert False, 'msgfmt exited with return code %s' % p.returncode + assert mo.isfile(), 'msgfmt failed' def teardown_module(): @@ -63,3 +74,114 @@ def test_subdir(app): app.builder.build(['subdir/includes']) result = (app.outdir / 'subdir' / 'includes.txt').text(encoding='utf-8') assert result.startswith(u"\ntranslation\n***********\n\n") + + +@with_app(buildername='html', cleanenv=True, + confoverrides={'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False}) +def test_i18n_footnote_break_refid(app): + """test for #955 cant-build-html-with-footnotes-when-using""" + app.builder.build(['i18n/footnote']) + result = (app.outdir / 'i18n' / 'footnote.html').text(encoding='utf-8') + # expect no error by build + + +@with_app(buildername='text', cleanenv=True, + confoverrides={'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False}) +def test_i18n_footnote_regression(app): + """regression test for fix #955""" + app.builder.build(['i18n/footnote']) + result = (app.outdir / 'i18n' / 'footnote.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH FOOTNOTE" + u"\n******************\n" # underline matches new translation + u"\nI18N WITH FOOTNOTE INCLUDE THIS CONTENTS [ref] [1] [100]\n" + u"\n[1] THIS IS A AUTO NUMBERED FOOTNOTE.\n" + u"\n[ref] THIS IS A NAMED FOOTNOTE.\n" + u"\n[100] THIS IS A NUMBERED FOOTNOTE.\n") + assert result == expect + + +@with_app(buildername='text', warning=warnfile, cleanenv=True, + confoverrides={'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False}) +def test_i18n_warn_for_number_of_references_inconsistency(app): + app.builddir.rmtree(True) + app.builder.build(['i18n/refs_inconsistency']) + result = (app.outdir / 'i18n' / 'refs_inconsistency.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH REFS INCONSISTENCY" + u"\n****************************\n" + u"\n* FOR FOOTNOTE [ref2].\n" + u"\n* reference FOR reference.\n" + u"\n* ORPHAN REFERENCE: I18N WITH REFS INCONSISTENCY.\n" + u"\n[1] THIS IS A AUTO NUMBERED FOOTNOTE.\n" + u"\n[ref2] THIS IS A NAMED FOOTNOTE.\n" + u"\n[100] THIS IS A NUMBERED FOOTNOTE.\n") + assert result == expect + + warnings = warnfile.getvalue().replace(os.sep, '/') + warning_fmt = u'.*/i18n/refs_inconsistency.txt:\\d+: ' \ + u'WARNING: inconsistent %s in translated message\n' + expected_warning_expr = ( + warning_fmt % 'footnote references' + + warning_fmt % 'references' + + warning_fmt % 'references') + assert re.search(expected_warning_expr, warnings) + + +@with_app(buildername='html', cleanenv=True, + confoverrides={'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False}) +def test_i18n_link_to_undefined_reference(app): + app.builder.build(['i18n/refs_inconsistency']) + result = (app.outdir / 'i18n' / 'refs_inconsistency.html').text(encoding='utf-8') + + expected_expr = """<a class="reference external" href="http://www.example.com">reference</a>""" + assert len(re.findall(expected_expr, result)) == 2 + + expected_expr = """<a class="reference internal" href="#reference">reference</a>""" + assert len(re.findall(expected_expr, result)) == 0 + + expected_expr = """<a class="reference internal" href="#i18n-with-refs-inconsistency">I18N WITH REFS INCONSISTENCY</a>""" + assert len(re.findall(expected_expr, result)) == 1 + + +@with_app(buildername='html', cleanenv=True, + confoverrides={'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False}) +def test_i18n_keep_external_links(app): + """regression test for #1044""" + app.builder.build(['i18n/external_links']) + result = (app.outdir / 'i18n' / 'external_links.html').text(encoding='utf-8') + + # external link check + expect_line = u"""<li>EXTERNAL LINK TO <a class="reference external" href="http://python.org">Python</a>.</li>""" + matched = re.search('^<li>EXTERNAL LINK TO .*$', result, re.M) + matched_line = '' + if matched: + matched_line = matched.group() + assert expect_line == matched_line + + # internal link check + expect_line = u"""<li><a class="reference internal" href="#i18n-with-external-links">EXTERNAL LINKS</a> IS INTERNAL LINK.</li>""" + matched = re.search('^<li><a .* IS INTERNAL LINK.</li>$', result, re.M) + matched_line = '' + if matched: + matched_line = matched.group() + assert expect_line == matched_line + + # inline link check + expect_line = u"""<li>INLINE LINK BY <a class="reference external" href="http://sphinx-doc.org">SPHINX</a>.</li>""" + matched = re.search('^<li>INLINE LINK BY .*$', result, re.M) + matched_line = '' + if matched: + matched_line = matched.group() + assert expect_line == matched_line + + # unnamed link check + expect_line = u"""<li>UNNAMED <a class="reference external" href="http://google.com">LINK</a>.</li>""" + matched = re.search('^<li>UNNAMED .*$', result, re.M) + matched_line = '' + if matched: + matched_line = matched.group() + assert expect_line == matched_line diff --git a/tests/test_linkcode.py b/tests/test_linkcode.py new file mode 100644 index 00000000..365e826f --- /dev/null +++ b/tests/test_linkcode.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +""" + test_linkcode + ~~~~~~~~~~~~~ + + Test the sphinx.ext.linkcode extension. + + :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import os +from util import * + +@with_app(srcdir='(temp)', buildername='html', tags=['test_linkcode']) +def test_html(app): + app.builder.build_all() + + fp = open(os.path.join(app.outdir, 'objects.html'), 'r') + try: + stuff = fp.read() + finally: + fp.close() + + assert 'http://foobar/source/foolib.py' in stuff + assert 'http://foobar/js/' in stuff + assert 'http://foobar/c/' in stuff + assert 'http://foobar/cpp/' in stuff diff --git a/tests/test_only_directive.py b/tests/test_only_directive.py new file mode 100644 index 00000000..2396046e --- /dev/null +++ b/tests/test_only_directive.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +""" + test_only_directive + ~~~~~~~~~~~~~~~~~~~ + + Test the only directive with the test root. + + :copyright: Copyright 2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from docutils import nodes + +from util import * + + +def teardown_module(): + (test_root / '_build').rmtree(True) + + +@with_app(buildername='text') +def test_sectioning(app): + + def getsects(section): + if not isinstance(section, nodes.section): + return [getsects(n) for n in section.children] + title = section.next_node(nodes.title).astext().strip() + subsects = [] + children = section.children[:] + while children: + node = children.pop(0) + if isinstance(node, nodes.section): + subsects.append(node) + continue + children = list(node.children) + children + return [title, [getsects(subsect) for subsect in subsects]] + + def testsects(prefix, sects, indent=0): + title = sects[0] + parent_num = title.split()[0] + assert prefix == parent_num, \ + 'Section out of place: %r' % title + for i, subsect in enumerate(sects[1]): + num = subsect[0].split()[0] + assert re.match('[0-9]+[.0-9]*[.]', num), \ + 'Unnumbered section: %r' % subsect[0] + testsects(prefix + str(i+1) + '.', subsect, indent+4) + + app.builder.build(['only']) + doctree = app.env.get_doctree('only') + app.env.process_only_nodes(doctree, app.builder) + + parts = [getsects(n) + for n in filter(lambda n: isinstance(n, nodes.section), + doctree.children)] + for i, s in enumerate(parts): + testsects(str(i+1) + '.', s, 4) + assert len(parts) == 4, 'Expected 4 document level headings, got:\n%s' % \ + '\n'.join([p[0] for p in parts]) diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index dba888dd..c054f858 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -46,6 +46,25 @@ def teardown_module(): coloron() +def test_quickstart_inputstrip(): + d = {} + answers = { + 'Q1': 'Y\r', # input() return with '\r' on Python-3.2.0 for Windows + 'Q2': ' Yes \r', + 'Q3': 'N', + 'Q4': 'N ', + } + qs.term_input = mock_raw_input(answers) + qs.do_prompt(d, 'k1', 'Q1') + assert d['k1'] == 'Y' + qs.do_prompt(d, 'k2', 'Q2') + assert d['k2'] == 'Yes' + qs.do_prompt(d, 'k3', 'Q3') + assert d['k3'] == 'N' + qs.do_prompt(d, 'k4', 'Q4') + assert d['k4'] == 'N' + + def test_do_prompt(): d = {} answers = { diff --git a/tests/util.py b/tests/util.py index bd50bec0..32e94a7f 100644 --- a/tests/util.py +++ b/tests/util.py @@ -21,6 +21,7 @@ except ImportError: wraps = lambda f: (lambda w: w) from sphinx import application +from sphinx.theming import Theme from sphinx.ext.autodoc import AutoDirective from path import path @@ -170,6 +171,7 @@ class TestApp(application.Sphinx): freshenv, warningiserror, tags) def cleanup(self, doctrees=False): + Theme.themes.clear() AutoDirective._registry.clear() for tree in self.cleanup_trees: shutil.rmtree(tree, True) @@ -1,32 +1,30 @@ [tox] -envlist=py24,py25,py26,py27,py31,py32,pypy,du08,du07,du06,du05 +envlist=py25,py26,py27,py31,py32,py33,pypy,du09,du08,du07 [testenv] deps= nose +setenv = + BUILD_TEST_PATH = {envdir}/tests commands= - nosetests + {envpython} tests/run.py {posargs} sphinx-build -W -b html -d {envtmpdir}/doctrees doc {envtmpdir}/html -[testenv:py24] +[testenv:py25] deps= nose - simplejson - -[testenv:pypy] -deps= - nose - simplejson + simplejson==2.5.0 -[testenv:du05] +[testenv:py33] deps= nose - docutils==0.5 + #svn+http://docutils.svn.sourceforge.net/svnroot/docutils/trunk/docutils + docutils>=0.10.0 -[testenv:du06] +[testenv:pypy] deps= nose - docutils==0.6 + simplejson [testenv:du07] deps= @@ -37,3 +35,8 @@ deps= deps= nose docutils==0.8.1 + +[testenv:du09] +deps= + nose + docutils==0.9.1 |
