diff options
311 files changed, 6140 insertions, 1228 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 @@ -13,6 +13,7 @@ Other contributors, listed alphabetically, are: * Charles Duffy -- original graphviz extension * Kevin Dunn -- MathJax extension * Josip Dzolonga -- coverage builder +* Hernan Grecco -- search improvements * Horst Gutmann -- internationalization support * Martin Hans -- autodoc improvements * Doug Hellmann -- graphviz improvements @@ -1,5 +1,122 @@ -Release 1.1.4 (in development) -============================== +Release 1.2 (in development) +============================ + +* #1070: Avoid un-pickling issues when running Python 3 and the saved + environment was created under Python 2. + +* #1069: Fixed error caused when autodoc would try to format signatures of + "partial" functions without keyword arguments (patch by Artur Gaspar). + +* The :confval:`latex_documents`, :confval:`texinfo_documents`, and + :confval:`man_pages` configuration values will be set to default values based + on the :confval:`master_doc` if not explicitly set in :file:`conf.py`. + Previously, if these values were not set, no output would be genereted by + their respective builders. + +* The :rst:dir:`toctree` directive and the ``toctree()`` template function now + have an ``includehidden`` option that includes hidden toctree entries (bugs + #790 and #1047). A bug in the ``maxdepth`` option for the ``toctree()`` + template function has been fixed (bug #1046). + +* PR#99: Strip down seealso directives to normal admonitions. This removes + their unusual CSS classes (admonition-see-also), inconsistent LaTeX + admonition title ("See Also" instead of "See also"), and spurious indentation + in the text builder. + +* sphinx-build now has a verbose option :option:`-v` which can be + repeated for greater effect. A single occurrance provides a + slightly more verbose output than normal. Two or more occurrences + of this option provides more detailed output which may be useful for + debugging. + +* sphinx-build now provides more specific error messages when called with + invalid options or arguments. + +* sphinx-build now supports the standard :option:`--help` and + :option:`--version` options. + +* #869: sphinx-build now has the option :option:`-T` for printing the full + traceback after an unhandled exception. + +* #976: Fix gettext does not extract index entries. + +* #940: Fix gettext does not extract figure caption. + +* #1067: Improve the ordering of the JavaScript search results: matches in titles + come before matches in full text, and object results are better categorized. + Also implement a pluggable search scorer. + +* Fix text writer can not handle visit_legend for figure directive contents. + +* PR#72: #975: Fix gettext does not extract definition terms before docutils 0.10.0 + +* 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. + +* PR#35: Added Slovak translation. + +* 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. + +* PR#97: Fix footnote handling in translated documents. + +* Update to jQuery 1.7.1 and Underscore.js 1.3.1. + +* #1055: Fix web support with relative path to source directory. + +* #1053: The "rightsidebar" and "collapsiblesidebar" HTML theme options now work together. + +* #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. + +* #958: Do not preserve ``environment.pickle`` after a failed build. + +* PR#88: Added the "Sphinx Developer's Guide" (:file:`doc/devguide.rst`) + which outlines the basic development process of the Sphinx project. + +* 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/ @@ -1,7 +1,7 @@ License for Sphinx ================== -Copyright (c) 2007-2011 by the Sphinx team (see AUTHORS file). +Copyright (c) 2007-2013 by the Sphinx team (see AUTHORS file). All rights reserved. Redistribution and use in source and binary forms, with or without @@ -1,5 +1,3 @@ -.. -*- restructuredtext -*- - ================= README for Sphinx ================= @@ -23,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..831c12c5 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" @@ -37,7 +38,7 @@ help: @echo " linkcheck to check all external links for integrity" clean: - -rm -rf _build/* + rm -rf _build/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) _build/html @@ -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 cd6c535c..9b57be2a 100644 --- a/doc/_templates/index.html +++ b/doc/_templates/index.html @@ -60,9 +60,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 ee8ff018..f9aa2abf 100644 --- a/doc/_templates/indexsidebar.html +++ b/doc/_templates/indexsidebar.html @@ -14,7 +14,7 @@ <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 %} diff --git a/doc/builders.rst b/doc/builders.rst index 71600137..0075ad81 100644 --- a/doc/builders.rst +++ b/doc/builders.rst @@ -81,7 +81,8 @@ The builder's "name" must be given to the **-b** command-line option of This builder produces the same output as the standalone HTML builder, but also generates an *epub* file for ebook readers. See :ref:`epub-faq` for details about it. For definition of the epub format, have a look at - `<http://www.idpf.org/specs.htm>`_ or `<http://en.wikipedia.org/wiki/EPUB>`_. + `<http://idpf.org/epub>`_ or `<http://en.wikipedia.org/wiki/EPUB>`_. + The builder creates *EPUB 2* files. Some ebook readers do not show the link targets of references. Therefore this builder adds the targets after the link when necessary. The display @@ -271,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 f978f315..8a0e4696 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,7 +13,7 @@ templates_path = ['_templates'] exclude_patterns = ['_build'] project = 'Sphinx' -copyright = '2007-2011, Georg Brandl' +copyright = '2007-2013, Georg Brandl' version = sphinx.__released__ release = version show_authors = True @@ -24,20 +24,22 @@ 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')] epub_exclude_files = ['_static/opensearch.xml', '_static/doctools.js', '_static/jquery.js', '_static/searchtools.js', '_static/underscore.js', - '_static/basic.css', 'search.html'] + '_static/basic.css', 'search.html', '_static/websupport.js'] +epub_fix_images = False +epub_max_image_width = 0 latex_documents = [('contents', 'sphinx.tex', 'Sphinx Documentation', 'Georg Brandl', 'manual', 1)] diff --git a/doc/config.rst b/doc/config.rst index 5d188c61..6174d487 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -277,7 +277,7 @@ Project information the format given in :confval:`today_fmt`. The default is no :confval:`today` and a :confval:`today_fmt` of ``'%B %d, - %Y'`` (or, if translation is enabled with :confval:`language`, am equivalent + %Y'`` (or, if translation is enabled with :confval:`language`, an equivalent %format for the selected locale). .. confval:: highlight_language @@ -377,16 +377,19 @@ documentation on :ref:`intl` for details. * ``fi`` -- Finnish * ``fr`` -- French * ``hr`` -- Croatian + * ``hu`` -- Hungarian * ``it`` -- Italian * ``ja`` -- Japanese * ``ko`` -- Korean * ``lt`` -- Lithuanian * ``lv`` -- Latvian + * ``nb_NO`` -- Norwegian Bokmal * ``ne`` -- Nepali * ``nl`` -- Dutch * ``pl`` -- Polish * ``pt_BR`` -- Brazilian Portuguese * ``ru`` -- Russian + * ``sk`` -- Slovak * ``sl`` -- Slovenian * ``sv`` -- Swedish * ``tr`` -- Turkish @@ -757,6 +760,15 @@ that use Sphinx' HTMLWriter class. .. versionadded:: 1.1 +.. confval:: html_search_scorer + + The name of a javascript file (relative to the configuration directory) that + implements a search results scorer. If empty, the default will be used. + + .. XXX describe interface for scorer here + + .. versionadded:: 1.2 + .. confval:: htmlhelp_basename Output file base name for HTML help builder. Default is ``'pydoc'``. @@ -783,6 +795,14 @@ the `Dublin Core metadata <http://dublincore.org/>`_. output is usually not wise. This defaults to ``'epub'``, a theme designed to save visual space. +.. confval:: epub_theme_options + + A dictionary of options that influence the look and feel of the selected + theme. These are theme-specific. For the options understood by the builtin + themes, see :ref:`this section <builtin-themes>`. + + .. versionadded:: 1.2 + .. confval:: epub_title The title of the document. It defaults to the :confval:`html_title` option @@ -844,6 +864,20 @@ the `Dublin Core metadata <http://dublincore.org/>`_. .. versionadded:: 1.1 +.. confval:: epub_guide + + Meta data for the guide element of :file:`content.opf`. This is a + sequence of tuples containing the *type*, the *uri* and the *title* of + the optional guide information. See the OPF documentation + at `<http://idpf.org/epub>`_ for details. If possible, default entries + for the *cover* and *toc* types are automatically inserted. However, + the types can be explicitely overwritten if the default entries are not + appropriate. Example:: + + epub_guide = (('cover', 'cover.html', u'Cover Page'),) + + The default value is ``()``. + .. confval:: epub_pre_files Additional files that should be inserted before the text generated by @@ -882,6 +916,27 @@ the `Dublin Core metadata <http://dublincore.org/>`_. depth in one list. The default value is ``True``. +.. confval:: epub_fix_images + + This flag determines if sphinx should try to fix image formats that are not + supported by some epub readers. At the moment palette images with a small + color table are upgraded. You need the Python Image Library (PIL) installed + to use this option. The default value is ``False`` because the automatic + conversion may lose information. + + .. versionadded:: 1.2 + +.. confval:: epub_max_image_width + + This option specifies the maximum width of images. If it is set to a value + greater than zero, images with a width larger than the given value are + scaled accordingly. If it is zero, no scaling is performed. The default + value is ``0``. You need the Python Image Library (PIL) installed to use + this option. + + .. versionadded:: 1.2 + + .. _latex-options: Options for LaTeX output @@ -1287,6 +1342,24 @@ Options for the linkcheck builder .. versionadded:: 1.1 +.. confval:: linkcheck_anchors + + True or false, whether to check the validity of ``#anchor``\ s in links. + Since this requires downloading the whole document, it's considerably slower + when enabled. Default is ``True``. + + .. 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 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/develop.rst b/doc/develop.rst index a3c4d93e..4181cde8 100644 --- a/doc/develop.rst +++ b/doc/develop.rst @@ -12,6 +12,7 @@ Sphinx is a maintained by a group of volunteers. We value every contribution! * The mailing list for development is at `Google Groups <http://groups.google.com/group/sphinx-dev/>`_. +For more about our development process and methods, see the :doc:`devguide`. Extensions ========== 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 9894caab..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 a Ruby and an Erlang domain. +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 859ca6fc..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``:: 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/faq.rst b/doc/faq.rst index bf2327d7..1d948737 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -36,6 +36,13 @@ How do I... still need to mark up classes and such, but the headings and code examples come through cleanly. +... create HTML slides from Sphinx documents? + See the "Hieroglyph" package at http://github.com/nyergler/hieroglyph. + +For many more extensions and other contributed stuff, see the sphinx-contrib_ +repository. + +.. _sphinx-contrib: https://bitbucket.org/birkenfeld/sphinx-contrib/ .. _usingwith: 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..4cfa4843 100644 --- a/doc/invocation.rst +++ b/doc/invocation.rst @@ -59,6 +59,13 @@ The :program:`sphinx-build` script has several options: **linkcheck** Check the integrity of all external links. + **xml** + Build Docutils-native XML files. + + **pseudoxml** + Build compact pretty-printed "pseudo-XML" files displaying the + internal structure of the intermediate document trees. + See :ref:`builders` for a list of all builders shipped with Sphinx. Extensions can add their own builders. @@ -131,6 +138,13 @@ The :program:`sphinx-build` script has several options: Do not emit colored output. (On Windows, colored output is disabled in any case.) +.. option:: -v + + Increase verbosity. This option can be given up to three times to get more + debug output. It implies :option:`-T`. + + .. versionadded:: 1.2 + .. option:: -q Do not output anything on standard output, only write warnings and errors to @@ -150,11 +164,24 @@ The :program:`sphinx-build` script has several options: Turn warnings into errors. This means that the build stops at the first warning and ``sphinx-build`` exits with exit status 1. +.. option:: -T + + Display the full traceback when an unhandled exception occurs. Otherwise, + only a summary is displayed and the traceback information is saved to a file + for further analysis. + + .. versionadded:: 1.2 + .. option:: -P (Useful for debugging only.) Run the Python debugger, :mod:`pdb`, if an unhandled exception occurs while building. +.. option:: -h, --help, --version + + Display usage summary or Sphinx version. + + .. versionadded:: 1.2 You can also give one or more filenames on the command line after the source and build directories. Sphinx will then try to build only these output files (and @@ -227,6 +254,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/man/sphinx-build.rst b/doc/man/sphinx-build.rst index b7212a84..0a5d4abb 100644 --- a/doc/man/sphinx-build.rst +++ b/doc/man/sphinx-build.rst @@ -64,6 +64,13 @@ linkcheck pickle / json Generates serialized HTML files for use in web applications. +xml + Generates Docutils-native XML files. + +pseudoxml + Generates compact pretty-printed "pseudo-XML" files displaying the + internal structure of the intermediate document trees. + Options ------- diff --git a/doc/markup/toctree.rst b/doc/markup/toctree.rst index 625fbb61..fe27e019 100644 --- a/doc/markup/toctree.rst +++ b/doc/markup/toctree.rst @@ -126,6 +126,18 @@ tables of contents. The ``toctree`` directive is the central element. intend to insert these links yourself, in a different style, or in the HTML sidebar. + In cases where you want to have only one top-level toctree and hide all other + lower level toctrees you can add the "includehidden" option to the top-level + toctree entry:: + + .. toctree:: + :includehidden: + + doc_1 + doc_2 + + All other toctree entries can then be eliminated by the "hidden" option. + In the end, all documents in the :term:`source directory` (or subdirectories) must occur in some ``toctree`` directive; Sphinx will emit a warning if it finds a file that is not included, because that means that this file will not @@ -150,6 +162,8 @@ tables of contents. The ``toctree`` directive is the central element. .. versionchanged:: 1.1 Added numeric argument to "numbered". + .. versionchanged:: 1.2 + Added "includehidden" option. Special names ------------- diff --git a/doc/rest.rst b/doc/rest.rst index db832ed8..ccf51c66 100644 --- a/doc/rest.rst +++ b/doc/rest.rst @@ -265,8 +265,9 @@ Docutils supports the following directives: * Admonitions: :dudir:`attention`, :dudir:`caution`, :dudir:`danger`, :dudir:`error`, :dudir:`hint`, :dudir:`important`, :dudir:`note`, - :dudir:`tip`, :dudir:`warning` and the generic :dudir:`admonition`. - (Most themes style only "note" and "warning" specially.) + :dudir:`tip`, :dudir:`warning` and the generic + :dudir:`admonition <admonitions>`. (Most themes style only "note" and + "warning" specially.) * Images: @@ -285,7 +286,7 @@ Docutils supports the following directives: - :dudir:`epigraph` (a block quote with optional attribution line) - :dudir:`highlights`, :dudir:`pull-quote` (block quotes with their own class attribute) - - :dudir:`compound` (a compound paragraph) + - :dudir:`compound <compound-paragraph>` (a compound paragraph) * Special tables: @@ -295,7 +296,7 @@ Docutils supports the following directives: * Special directives: - - :dudir:`raw` (include raw target-format markup) + - :dudir:`raw <raw-data-pass-through>` (include raw target-format markup) - :dudir:`include` (include reStructuredText from another file) -- in Sphinx, when given an absolute include file path, this directive takes it as relative to the source directory @@ -304,7 +305,7 @@ Docutils supports the following directives: * HTML specifics: - :dudir:`meta` (generation of HTML ``<meta>`` tags) - - :dudir:`title` (override document title) + - :dudir:`title <metadata-document-title>` (override document title) * Influencing markup: @@ -472,9 +473,8 @@ There are some problems one commonly runs into while authoring reST documents: * **Separation of inline markup:** As said above, inline markup spans must be separated from the surrounding text by non-word characters, you have to use a - backslash-escaped space to get around that. See `the reference - <http://docutils.sf.net/docs/ref/rst/restructuredtext.html#inline-markup>`_ - for the details. + backslash-escaped space to get around that. See + :duref:`the reference <substitution-definitions>` for the details. * **No nested inline markup:** Something like ``*see :func:`foo`*`` is not possible. diff --git a/doc/templating.rst b/doc/templating.rst index 05a1346c..b9dfc683 100644 --- a/doc/templating.rst +++ b/doc/templating.rst @@ -391,3 +391,6 @@ are in HTML form), these variables are also available: * ``titles_only`` (false by default): if true, put only toplevel document titles in the tree + + * ``includehidden`` (false by default): if true, the TOC tree will also + contain hidden entries. diff --git a/doc/theming.rst b/doc/theming.rst index 802b211f..0375bc71 100644 --- a/doc/theming.rst +++ b/doc/theming.rst @@ -111,8 +111,7 @@ These themes are: - **collapsiblesidebar** (true or false): Add an *experimental* JavaScript snippet that makes the sidebar collapsible via a button on its side. - *Doesn't work together with "rightsidebar" or "stickysidebar".* Defaults to - false. + *Doesn't work with "stickysidebar".* Defaults to false. - **externalrefs** (true or false): Display external links differently from internal links. Defaults to false. @@ -200,10 +199,14 @@ These themes are: * **traditional** -- A theme resembling the old Python documentation. There are currently no options beyond *nosidebar* and *sidebarwidth*. -* **epub** -- A theme for the epub builder. There are currently no options. - This theme tries to save visual space which is a sparse resource on ebook - readers. +* **epub** -- A theme for the epub builder. This theme tries to save visual + space which is a sparse resource on ebook readers. The following options + are supported: + - **relbar1** (true or false, default true): If this is true, the + `relbar1` block is inserted in the epub output, otherwise it is omitted. + - **footer** (true or false, default true): If this is true, the + `footer` block is inserted in the epub output, otherwise it is ommitted. Creating themes --------------- diff --git a/doc/tutorial.rst b/doc/tutorial.rst index b0e1d486..9fea11db 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -13,10 +13,10 @@ the described task. Setting up the documentation sources ------------------------------------ -The root directory of a documentation collection is called the :term:`source -directory`. This directory also contains the Sphinx configuration file -:file:`conf.py`, where you can configure all aspects of how Sphinx reads your -sources and builds your documentation. [#]_ +The root directory of a Sphinx collection of reStructuredText document sources +is called the :term:`source directory`. This directory also contains the Sphinx +configuration file :file:`conf.py`, where you can configure all aspects of how +Sphinx reads your sources and builds your documentation. [#]_ Sphinx comes with a script called :program:`sphinx-quickstart` that sets up a source directory and creates a default :file:`conf.py` with the most useful @@ -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-apidoc.py b/sphinx-apidoc.py index 9cafb497..31e57487 100755 --- a/sphinx-apidoc.py +++ b/sphinx-apidoc.py @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx-autogen.py b/sphinx-autogen.py index b1e467e7..baf3ed65 100755 --- a/sphinx-autogen.py +++ b/sphinx-autogen.py @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx-build.py b/sphinx-build.py index 70822d73..6737d072 100755 --- a/sphinx-build.py +++ b/sphinx-build.py @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx-quickstart.py b/sphinx-quickstart.py index 5d7c1544..0ae67adf 100755 --- a/sphinx-quickstart.py +++ b/sphinx-quickstart.py @@ -4,7 +4,7 @@ Sphinx - Python documentation toolchain ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/__init__.py b/sphinx/__init__.py index 91b960e6..0c68ad32 100644 --- a/sphinx/__init__.py +++ b/sphinx/__init__.py @@ -5,7 +5,7 @@ The Sphinx documentation toolchain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -15,8 +15,8 @@ import sys from os import path -__version__ = '1.1.3+' -__released__ = '1.1.3' # used when Sphinx builds its own docs +__version__ = '1.2pre' +__released__ = '1.2 (hg)' # used when Sphinx builds its own docs package_dir = path.abspath(path.dirname(__file__)) @@ -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/addnodes.py b/sphinx/addnodes.py index 94f1d615..d8dca2ce 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -5,7 +5,7 @@ Additional docutils nodes. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/apidoc.py b/sphinx/apidoc.py index ec1a8a33..15160828 100644 --- a/sphinx/apidoc.py +++ b/sphinx/apidoc.py @@ -11,7 +11,7 @@ Copyright 2008 Société des arts technologiques (SAT), http://www.sat.qc.ca/ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os @@ -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..02f0ff82 100644 --- a/sphinx/application.py +++ b/sphinx/application.py @@ -7,10 +7,11 @@ Gracefully adapted from the TextPress system by Armin. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ +import os import sys import types import posixpath @@ -34,7 +35,7 @@ from sphinx.environment import BuildEnvironment, SphinxStandaloneReader from sphinx.util import pycompat # imported for side-effects from sphinx.util.tags import Tags from sphinx.util.osutil import ENOENT -from sphinx.util.console import bold +from sphinx.util.console import bold, lightgray, darkgray # List of all known core events. Maps name to arguments description. @@ -60,7 +61,8 @@ class Sphinx(object): def __init__(self, srcdir, confdir, outdir, doctreedir, buildername, confoverrides=None, status=sys.stdout, warning=sys.stderr, - freshenv=False, warningiserror=False, tags=None): + freshenv=False, warningiserror=False, tags=None, verbosity=0): + self.verbosity = verbosity self.next_listener_id = 0 self._extensions = {} self._listeners = {} @@ -194,6 +196,8 @@ class Sphinx(object): self.builder = builderclass(self) self.emit('builder-inited') + # ---- main "build" method ------------------------------------------------- + def build(self, force_all=False, filenames=None): try: if force_all: @@ -203,12 +207,29 @@ class Sphinx(object): else: self.builder.build_update() except Exception, err: + # delete the saved env to force a fresh build next time + envfile = path.join(self.doctreedir, ENV_PICKLE_FILENAME) + if path.isfile(envfile): + os.unlink(envfile) self.emit('build-finished', err) raise else: self.emit('build-finished', None) self.builder.cleanup() + # ---- logging handling ---------------------------------------------------- + + def _log(self, message, wfile, nonl=False): + try: + wfile.write(message) + except UnicodeEncodeError: + encoding = getattr(wfile, 'encoding', 'ascii') or 'ascii' + wfile.write(message.encode(encoding, 'replace')) + if not nonl: + wfile.write('\n') + if hasattr(wfile, 'flush'): + wfile.flush() + def warn(self, message, location=None, prefix='WARNING: '): if isinstance(location, tuple): docname, lineno = location @@ -221,26 +242,37 @@ class Sphinx(object): if self.warningiserror: raise SphinxWarning(warntext) self._warncount += 1 - try: - self._warning.write(warntext) - except UnicodeEncodeError: - encoding = getattr(self._warning, 'encoding', 'ascii') or 'ascii' - self._warning.write(warntext.encode(encoding, 'replace')) + self._log(warntext, self._warning, True) def info(self, message='', nonl=False): - try: - self._status.write(message) - except UnicodeEncodeError: - encoding = getattr(self._status, 'encoding', 'ascii') or 'ascii' - self._status.write(message.encode(encoding, 'replace')) - if not nonl: - self._status.write('\n') - self._status.flush() + self._log(message, self._status, nonl) + + def verbose(self, message, *args, **kwargs): + if self.verbosity < 1: + return + if args or kwargs: + message = message % (args or kwargs) + self._log(message, self._status) + + def debug(self, message, *args, **kwargs): + if self.verbosity < 2: + return + if args or kwargs: + message = message % (args or kwargs) + self._log(darkgray(message), self._status) + + def debug2(self, message, *args, **kwargs): + if self.verbosity < 3: + return + if args or kwargs: + message = message % (args or kwargs) + self._log(lightgray(message), self._status) - # general extensibility interface + # ---- general extensibility interface ------------------------------------- def setup_extension(self, extension): """Import and setup a Sphinx extension module. No-op if called twice.""" + self.debug('[app] setting up extension: %r', extension) if extension in self._extensions: return try: @@ -301,13 +333,17 @@ class Sphinx(object): else: self._listeners[event][listener_id] = callback self.next_listener_id += 1 + self.debug('[app] connecting event %r: %r [id=%s]', + event, callback, listener_id) return listener_id def disconnect(self, listener_id): + self.debug('[app] disconnecting event: [id=%s]', listener_id) for event in self._listeners.itervalues(): event.pop(listener_id, None) def emit(self, event, *args): + self.debug2('[app] emitting event: %r%s', event, str(args)[:100]) results = [] if event in self._listeners: for _, callback in self._listeners[event].iteritems(): @@ -323,6 +359,7 @@ class Sphinx(object): # registering addon parts def add_builder(self, builder): + self.debug('[app] adding builder: %r', builder) if not hasattr(builder, 'name'): raise ExtensionError('Builder class %s has no "name" attribute' % builder) @@ -337,6 +374,7 @@ class Sphinx(object): self.builderclasses[builder.name] = builder def add_config_value(self, name, default, rebuild): + self.debug('[app] adding config value: %r', (name, default, rebuild)) if name in self.config.values: raise ExtensionError('Config value %r already present' % name) if rebuild in (False, True): @@ -344,11 +382,13 @@ class Sphinx(object): self.config.values[name] = (default, rebuild) def add_event(self, name): + self.debug('[app] adding event: %r', name) if name in self._events: raise ExtensionError('Event %r already present' % name) self._events[name] = '' def add_node(self, node, **kwds): + self.debug('[app] adding node: %r', (node, kwds)) nodes._add_node_class_names([node.__name__]) for key, val in kwds.iteritems(): try: @@ -388,44 +428,54 @@ class Sphinx(object): return obj def add_directive(self, name, obj, content=None, arguments=None, **options): + self.debug('[app] adding directive: %r', + (name, obj, content, arguments, options)) directives.register_directive( name, self._directive_helper(obj, content, arguments, **options)) def add_role(self, name, role): + self.debug('[app] adding role: %r', (name, role)) roles.register_local_role(name, role) def add_generic_role(self, name, nodeclass): # don't use roles.register_generic_role because it uses # register_canonical_role + self.debug('[app] adding generic role: %r', (name, nodeclass)) role = roles.GenericRole(name, nodeclass) roles.register_local_role(name, role) def add_domain(self, domain): + self.debug('[app] adding domain: %r', domain) if domain.name in self.domains: raise ExtensionError('domain %s already registered' % domain.name) self.domains[domain.name] = domain def override_domain(self, domain): + self.debug('[app] overriding domain: %r', domain) 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 def add_directive_to_domain(self, domain, name, obj, content=None, arguments=None, **options): + self.debug('[app] adding directive to domain: %r', + (domain, name, obj, content, arguments, options)) if domain not in self.domains: raise ExtensionError('domain %s not yet registered' % domain) self.domains[domain].directives[name] = \ self._directive_helper(obj, content, arguments, **options) def add_role_to_domain(self, domain, name, role): + self.debug('[app] adding role to domain: %r', (domain, name, role)) if domain not in self.domains: raise ExtensionError('domain %s not yet registered' % domain) self.domains[domain].roles[name] = role def add_index_to_domain(self, domain, index): + self.debug('[app] adding index to domain: %r', (domain, index)) if domain not in self.domains: raise ExtensionError('domain %s not yet registered' % domain) self.domains[domain].indices.append(index) @@ -433,6 +483,9 @@ class Sphinx(object): def add_object_type(self, directivename, rolename, indextemplate='', parse_node=None, ref_nodeclass=None, objname='', doc_field_types=[]): + self.debug('[app] adding object type: %r', + (directivename, rolename, indextemplate, parse_node, + ref_nodeclass, objname, doc_field_types)) StandardDomain.object_types[directivename] = \ ObjType(objname or directivename, rolename) # create a subclass of GenericObject as the new directive @@ -449,6 +502,9 @@ class Sphinx(object): def add_crossref_type(self, directivename, rolename, indextemplate='', ref_nodeclass=None, objname=''): + self.debug('[app] adding crossref type: %r', + (directivename, rolename, indextemplate, ref_nodeclass, + objname)) StandardDomain.object_types[directivename] = \ ObjType(objname or directivename, rolename) # create a subclass of Target as the new directive @@ -459,9 +515,11 @@ class Sphinx(object): StandardDomain.roles[rolename] = XRefRole(innernodeclass=ref_nodeclass) def add_transform(self, transform): + self.debug('[app] adding transform: %r', transform) SphinxStandaloneReader.transforms.append(transform) def add_javascript(self, filename): + self.debug('[app] adding javascript: %r', filename) from sphinx.builders.html import StandaloneHTMLBuilder if '://' in filename: StandaloneHTMLBuilder.script_files.append(filename) @@ -470,6 +528,7 @@ class Sphinx(object): posixpath.join('_static', filename)) def add_stylesheet(self, filename): + self.debug('[app] adding stylesheet: %r', filename) from sphinx.builders.html import StandaloneHTMLBuilder if '://' in filename: StandaloneHTMLBuilder.css_files.append(filename) @@ -478,21 +537,25 @@ class Sphinx(object): posixpath.join('_static', filename)) def add_lexer(self, alias, lexer): + self.debug('[app] adding lexer: %r', (alias, lexer)) from sphinx.highlighting import lexers if lexers is None: return lexers[alias] = lexer def add_autodocumenter(self, cls): + self.debug('[app] adding autodocumenter: %r', cls) from sphinx.ext import autodoc autodoc.add_documenter(cls) self.add_directive('auto' + cls.objtype, autodoc.AutoDirective) def add_autodoc_attrgetter(self, type, getter): + self.debug('[app] adding autodoc attrgetter: %r', (type, getter)) from sphinx.ext import autodoc autodoc.AutoDirective._special_attrgetters[type] = getter def add_search_language(self, cls): + self.debug('[app] adding search language: %r', cls) from sphinx.search import languages, SearchLanguage assert isinstance(cls, SearchLanguage) languages[cls.lang] = cls diff --git a/sphinx/builders/__init__.py b/sphinx/builders/__init__.py index 5240a1c7..97932c4c 100644 --- a/sphinx/builders/__init__.py +++ b/sphinx/builders/__init__.py @@ -5,7 +5,7 @@ Builder superclass for all builders. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -119,9 +119,13 @@ class Builder(object): summary = bold(summary) for item in iterable: l += 1 - self.info(term_width_line('%s[%3d%%] %s' % - (summary, 100*l/length, - colorfunc(item))), nonl=1) + s = '%s[%3d%%] %s' % (summary, 100*l/length, + colorfunc(item)) + if self.app.verbosity: + s += '\n' + else: + s = term_width_line(s) + self.info(s, nonl=1) yield item if l > 0: self.info() @@ -334,4 +338,6 @@ BUILTIN_BUILDERS = { 'linkcheck': ('linkcheck', 'CheckExternalLinksBuilder'), 'websupport': ('websupport', 'WebSupportBuilder'), 'gettext': ('gettext', 'MessageCatalogBuilder'), + 'xml': ('xml', 'XMLBuilder'), + 'pseudoxml': ('xml', 'PseudoXMLBuilder'), } diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index 22fcab86..05e7166e 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -5,7 +5,7 @@ Changelog builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/devhelp.py b/sphinx/builders/devhelp.py index 62bd2237..28be94ca 100644 --- a/sphinx/builders/devhelp.py +++ b/sphinx/builders/devhelp.py @@ -7,7 +7,7 @@ .. _Devhelp: http://live.gnome.org/devhelp - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/epub.py b/sphinx/builders/epub.py index e946e0d3..fbde5697 100644 --- a/sphinx/builders/epub.py +++ b/sphinx/builders/epub.py @@ -6,7 +6,7 @@ Build epub files. Originally derived from qthelp.py. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -18,12 +18,21 @@ import codecs import zipfile from os import path +try: + from PIL import Image +except ImportError: + try: + import Image + except ImportError: + Image = None + from docutils import nodes from sphinx import addnodes from sphinx.builders.html import StandaloneHTMLBuilder -from sphinx.util.osutil import EEXIST +from sphinx.util.osutil import ensuredir, copyfile, EEXIST from sphinx.util.smartypants import sphinx_smarty_pants as ssp +from sphinx.util.console import brown # (Fragment) templates from which the metainfo files content.opf, toc.ncx, @@ -95,6 +104,9 @@ _content_template = u'''\ <spine toc="ncx"> %(spine)s </spine> + <guide> +%(guide)s + </guide> </package> ''' @@ -112,12 +124,21 @@ _file_template = u'''\ _spine_template = u'''\ <itemref idref="%(idref)s" />''' +_guide_template = u'''\ + <reference type="%(type)s" title="%(title)s" href="%(uri)s" />''' + _toctree_template = u'toctree-l%d' _link_target_template = u' [%(uri)s]' _css_link_target_class = u'link-target' +# XXX These strings should be localized according to epub_language +_guide_titles = { + 'toc': u'Table of Contents', + 'cover': u'Cover Page' +} + _media_types = { '.html': 'application/xhtml+xml', '.css': 'text/css', @@ -165,7 +186,7 @@ class EpubBuilder(StandaloneHTMLBuilder): self.playorder = 0 def get_theme_config(self): - return self.config.epub_theme, {} + return self.config.epub_theme, self.config.epub_theme_options # generic support functions def make_id(self, name): @@ -206,11 +227,11 @@ class EpubBuilder(StandaloneHTMLBuilder): return result def get_toc(self): - """Get the total table of contents, containg the master_doc + """Get the total table of contents, containing the master_doc and pre and post files not managed by sphinx. """ doctree = self.env.get_and_resolve_doctree(self.config.master_doc, - self, prune_toctrees=False) + self, prune_toctrees=False, includehidden=True) self.refnodes = self.get_refnodes(doctree, []) master_dir = os.path.dirname(self.config.master_doc) if master_dir: @@ -301,6 +322,57 @@ class EpubBuilder(StandaloneHTMLBuilder): subentrylinks[i] = (ismain, self.fix_fragment(m.group(1), m.group(2))) + def copy_image_files_pil(self): + """Copy images using the PIL. + The method tries to read and write the files with the PIL, + converting the format and resizing the image if necessary/possible. + """ + ensuredir(path.join(self.outdir, '_images')) + for src in self.status_iterator(self.images, 'copying images... ', + brown, len(self.images)): + dest = self.images[src] + try: + img = Image.open(path.join(self.srcdir, src)) + except IOError: + self.warn('cannot read image file %r: copying it instead' % + (path.join(self.srcdir, src), )) + try: + copyfile(path.join(self.srcdir, src), + path.join(self.outdir, '_images', dest)) + except Exception, err: + self.warn('cannot copy image file %r: %s' % + (path.join(self.srcdir, src), err)) + continue + if self.config.epub_fix_images: + if img.mode in ('P',): + # See PIL documentation for Image.convert() + img = img.convert() + if self.config.epub_max_image_width > 0: + (width, height) = img.size + nw = self.config.epub_max_image_width + if width > nw: + nh = (height * nw) / width + img = img.resize((nw, nh), Image.BICUBIC) + try: + img.save(path.join(self.outdir, '_images', dest)) + except IOError, err: + self.warn('cannot write image file %r: %s' % + (path.join(self.srcdir, src), err)) + + def copy_image_files(self): + """Copy image files to destination directory. + This overwritten method can use the PIL to convert image files. + """ + if self.images: + if self.config.epub_fix_images or self.config.epub_max_image_width: + if not Image: + self.warn('PIL not found - copying image files') + super(EpubBuilder, self).copy_image_files() + else: + self.copy_image_files_pil() + else: + super(EpubBuilder, self).copy_image_files() + def handle_page(self, pagename, addctx, templatename='page.html', outfilename=None, event_arg=None): """Create a rendered page. @@ -348,7 +420,7 @@ class EpubBuilder(StandaloneHTMLBuilder): finally: f.close() - def content_metadata(self, files, spine): + def content_metadata(self, files, spine, guide): """Create a dictionary with all metadata for the content.opf file properly escaped. """ @@ -364,6 +436,7 @@ class EpubBuilder(StandaloneHTMLBuilder): metadata['date'] = self.esc(time.strftime('%Y-%m-%d')) metadata['files'] = files metadata['spine'] = spine + metadata['guide'] = guide return metadata def build_content(self, outdir, outname): @@ -419,14 +492,15 @@ class EpubBuilder(StandaloneHTMLBuilder): # add the optional cover content_tmpl = _content_template + html_tmpl = None if self.config.epub_cover: - image, tmpl = self.config.epub_cover + image, html_tmpl = self.config.epub_cover mpos = content_tmpl.rfind('</metadata>') cpos = content_tmpl.rfind('\n', 0 , mpos) + 1 content_tmpl = content_tmpl[:cpos] + \ _cover_template % {'cover': self.esc(self.make_id(image))} + \ content_tmpl[cpos:] - if tmpl: + if html_tmpl: spine.insert(0, _spine_template % { 'idref': self.esc(self.make_id(_coverpage_name))}) if _coverpage_name not in self.files: @@ -439,16 +513,46 @@ class EpubBuilder(StandaloneHTMLBuilder): }) ctx = {'image': self.esc(image), 'title': self.config.project} self.handle_page( - os.path.splitext(_coverpage_name)[0], ctx, tmpl) - + os.path.splitext(_coverpage_name)[0], ctx, html_tmpl) + + guide = [] + auto_add_cover = True + auto_add_toc = True + if self.config.epub_guide: + for type, uri, title in self.config.epub_guide: + file = uri.split('#')[0] + if file not in self.files: + self.files.append(file) + if type == 'cover': + auto_add_cover = False + if type == 'toc': + auto_add_toc = False + guide.append(_guide_template % { + 'type': self.esc(type), + 'title': self.esc(title), + 'uri': self.esc(uri) + }) + if auto_add_cover and html_tmpl: + guide.append(_guide_template % { + 'type': 'cover', + 'title': _guide_titles['cover'], + 'uri': self.esc(_coverpage_name) + }) + if auto_add_toc and self.refnodes: + guide.append(_guide_template % { + 'type': 'toc', + 'title': _guide_titles['toc'], + 'uri': self.esc(self.refnodes[0]['refuri']) + }) projectfiles = '\n'.join(projectfiles) spine = '\n'.join(spine) + guide = '\n'.join(guide) # write the project file f = codecs.open(path.join(outdir, outname), 'w', 'utf-8') try: f.write(content_tmpl % \ - self.content_metadata(projectfiles, spine)) + self.content_metadata(projectfiles, spine, guide)) finally: f.close() @@ -529,7 +633,12 @@ class EpubBuilder(StandaloneHTMLBuilder): """Write the metainfo file toc.ncx.""" self.info('writing %s file...' % outname) - navpoints = self.build_navpoints(self.refnodes) + doctree = self.env.get_and_resolve_doctree(self.config.master_doc, + self, prune_toctrees=False, includehidden=False) + refnodes = self.get_refnodes(doctree, []) + if not refnodes: + refnodes = self.refnodes + navpoints = self.build_navpoints(refnodes) level = max(item['level'] for item in self.refnodes) level = min(level, self.config.epub_tocdepth) f = codecs.open(path.join(outdir, outname), 'w', 'utf-8') @@ -553,7 +662,12 @@ class EpubBuilder(StandaloneHTMLBuilder): zipfile.ZIP_STORED) for file in projectfiles: fp = path.join(outdir, file) - if isinstance(fp, unicode): - fp = fp.encode(sys.getfilesystemencoding()) + if sys.version_info < (2, 6): + # When zipile.ZipFile.write call with unicode filename, ZipFile + # encode filename to 'utf-8' (only after Python-2.6). + if isinstance(file, unicode): + # OEBPS Container Format (OCF) 2.0.1 specification require + # "File Names MUST be UTF-8 encoded". + file = file.encode('utf-8') epub.write(fp, file, zipfile.ZIP_DEFLATED) epub.close() diff --git a/sphinx/builders/gettext.py b/sphinx/builders/gettext.py index a5f71a5f..7a6e1abe 100644 --- a/sphinx/builders/gettext.py +++ b/sphinx/builders/gettext.py @@ -5,7 +5,7 @@ The MessageCatalogBuilder class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -15,9 +15,11 @@ from datetime import datetime from collections import defaultdict from sphinx.builders import Builder -from sphinx.util.nodes import extract_messages -from sphinx.util.osutil import SEP, safe_relpath, ensuredir, find_catalog +from sphinx.util import split_index_msg +from sphinx.util.nodes import extract_messages, traverse_translatable_index +from sphinx.util.osutil import safe_relpath, ensuredir, find_catalog from sphinx.util.console import darkgreen +from sphinx.locale import pairindextypes POHEADER = ur""" # SOME DESCRIPTIVE TITLE. @@ -82,6 +84,16 @@ class I18nBuilder(Builder): for node, msg in extract_messages(doctree): catalog.add(msg, node) + # Extract translatable messages from index entries. + for node, entries in traverse_translatable_index(doctree): + for typ, msg, tid, main in entries: + for m in split_index_msg(typ, msg): + if typ == 'pair' and m in pairindextypes.values(): + # avoid built-in translated message was incorporated + # in 'sphinx.util.nodes.process_index_entry' + continue + catalog.add(m, node) + class MessageCatalogBuilder(I18nBuilder): """ diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index f5218673..573bb9b2 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -5,7 +5,7 @@ Several HTML builders. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -240,7 +240,8 @@ class StandaloneHTMLBuilder(Builder): if not lang or lang not in languages: lang = 'en' self.indexer = IndexBuilder(self.env, lang, - self.config.html_search_options) + self.config.html_search_options, + self.config.html_search_scorer) self.load_indexer(docnames) self.docwriter = HTMLWriter(self) @@ -653,6 +654,8 @@ class StandaloneHTMLBuilder(Builder): self.indexer.feed(pagename, title, doctree) def _get_local_toctree(self, docname, collapse=True, **kwds): + if 'includehidden' not in kwds: + kwds['includehidden'] = False return self.render_partial(self.env.get_toctree_for( docname, self, collapse, **kwds))['fragment'] diff --git a/sphinx/builders/htmlhelp.py b/sphinx/builders/htmlhelp.py index fdf25cc8..605012f8 100644 --- a/sphinx/builders/htmlhelp.py +++ b/sphinx/builders/htmlhelp.py @@ -6,7 +6,7 @@ Build HTML help support files. Parts adapted from Python's Doc/tools/prechm.py. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -142,6 +142,7 @@ chm_locales = { 'lt': (0x427, 'cp1257'), 'lv': (0x426, 'cp1257'), 'nl': (0x413, 'cp1252'), + 'no_NB': (0x414, 'cp1252'), 'pl': (0x415, 'cp1250'), 'pt_BR': (0x416, 'cp1252'), 'ru': (0x419, 'cp1251'), diff --git a/sphinx/builders/latex.py b/sphinx/builders/latex.py index 3369338c..dcc3b360 100644 --- a/sphinx/builders/latex.py +++ b/sphinx/builders/latex.py @@ -5,7 +5,7 @@ LaTeX builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/linkcheck.py b/sphinx/builders/linkcheck.py index ad15b55d..c567401c 100644 --- a/sphinx/builders/linkcheck.py +++ b/sphinx/builders/linkcheck.py @@ -5,7 +5,7 @@ The CheckExternalLinksBuilder class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -15,7 +15,8 @@ import Queue import socket import threading from os import path -from urllib2 import build_opener, Request +from urllib2 import build_opener, unquote, Request +from HTMLParser import HTMLParser, HTMLParseError from docutils import nodes @@ -33,6 +34,41 @@ class HeadRequest(Request): return 'HEAD' +class AnchorCheckParser(HTMLParser): + """Specialized HTML parser that looks for a specific anchor.""" + + def __init__(self, search_anchor): + HTMLParser.__init__(self) + + self.search_anchor = search_anchor + self.found = False + + def handle_starttag(self, tag, attrs): + for key, value in attrs: + if key in ('id', 'name') and value == self.search_anchor: + self.found = True + + +def check_anchor(f, hash): + """Reads HTML data from a filelike object 'f' searching for anchor 'hash'. + Returns True if anchor was found, False otherwise. + """ + parser = AnchorCheckParser(hash) + try: + # Read file in chunks of 8192 bytes. If we find a matching anchor, we + # break the loop early in hopes not to have to download the whole thing. + chunk = f.read(8192) + while chunk and not parser.found: + parser.feed(chunk) + chunk = f.read(8192) + parser.close() + except HTMLParseError: + # HTMLParser is usually pretty good with sloppy HTML, but it tends to + # choke on EOF. But we're done then anyway. + pass + return parser.found + + class CheckExternalLinksBuilder(Builder): """ Checks for broken external links. @@ -66,7 +102,8 @@ class CheckExternalLinksBuilder(Builder): def check(): # check for various conditions without bothering the network - if len(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', '' @@ -80,19 +117,39 @@ class CheckExternalLinksBuilder(Builder): if rex.match(uri): return 'ignored', '' + if '#' in uri: + req_url, hash = uri.split('#', 1) + else: + req_url = uri + hash = None + # need to actually check the URI try: - f = opener.open(HeadRequest(uri), **kwargs) - f.close() + if hash and self.app.config.linkcheck_anchors: + # Read the whole document and see if #hash exists + f = opener.open(Request(req_url), **kwargs) + found = check_anchor(f, unquote(hash)) + f.close() + + if not found: + raise Exception("Anchor '%s' not found" % hash) + else: + f = opener.open(HeadRequest(req_url), **kwargs) + f.close() + except Exception, err: self.broken[uri] = str(err) return 'broken', str(err) - if f.url.rstrip('/') == uri.rstrip('/'): + if f.url.rstrip('/') == req_url.rstrip('/'): self.good.add(uri) return 'working', 'new' else: - self.redirected[uri] = f.url - return 'redirected', f.url + new_url = f.url + if hash: + new_url += '#' + hash + + self.redirected[uri] = new_url + return 'redirected', new_url while True: uri, docname, lineno = self.wqueue.get() @@ -142,8 +199,6 @@ class CheckExternalLinksBuilder(Builder): if 'refuri' not in node: continue uri = node['refuri'] - if '#' in uri: - uri = uri.split('#')[0] lineno = None while lineno is None: node = node.parent diff --git a/sphinx/builders/manpage.py b/sphinx/builders/manpage.py index 93b56a01..32a09757 100644 --- a/sphinx/builders/manpage.py +++ b/sphinx/builders/manpage.py @@ -5,7 +5,7 @@ Manual pages builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/qthelp.py b/sphinx/builders/qthelp.py index 5e5deaf1..ce07315d 100644 --- a/sphinx/builders/qthelp.py +++ b/sphinx/builders/qthelp.py @@ -5,7 +5,7 @@ Build input files for the Qt collection generator. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/texinfo.py b/sphinx/builders/texinfo.py index 535c527e..a606fc6c 100644 --- a/sphinx/builders/texinfo.py +++ b/sphinx/builders/texinfo.py @@ -5,7 +5,7 @@ Texinfo builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -72,9 +72,9 @@ uninstall-info: info \t-$(TEXI2PDF) '$<' clean: -\t-rm -f *.info *.pdf *.txt *.html -\t-rm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ky *.pg -\t-rm -f *.vr *.tp *.fn *.fns *.def *.defs *.cp *.cps *.ge *.ges *.mo +\trm -f *.info *.pdf *.txt *.html +\trm -f *.log *.ind *.aux *.toc *.syn *.idx *.out *.ilg *.pla *.ky *.pg +\trm -f *.vr *.tp *.fn *.fns *.def *.defs *.cp *.cps *.ge *.ges *.mo .PHONY: all info plaintext html pdf install-info uninstall-info clean ''' diff --git a/sphinx/builders/text.py b/sphinx/builders/text.py index 40fd3d79..98148a8c 100644 --- a/sphinx/builders/text.py +++ b/sphinx/builders/text.py @@ -5,7 +5,7 @@ Plain-text Sphinx builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/websupport.py b/sphinx/builders/websupport.py index b7757309..d8238bb4 100644 --- a/sphinx/builders/websupport.py +++ b/sphinx/builders/websupport.py @@ -5,7 +5,7 @@ Builder for the web support package. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py new file mode 100644 index 00000000..ec411a79 --- /dev/null +++ b/sphinx/builders/xml.py @@ -0,0 +1,98 @@ +# -*- coding: utf-8 -*- +""" + sphinx.builders.xml + ~~~~~~~~~~~~~~~~~~~ + + Docutils-native XML and pseudo-XML builders. + + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import codecs +from os import path + +from docutils import nodes +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): + # work around multiple string % tuple issues in docutils; + # replace tuples in attribute values with lists + doctree = doctree.deepcopy() + for node in doctree.traverse(nodes.Element): + for att, value in node.attributes.items(): + if isinstance(value, tuple): + node.attributes[att] = list(value) + value = node.attributes[att] + if isinstance(value, list): + for i, val in enumerate(value): + if isinstance(val, tuple): + value[i] = list(val) + 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 67d721f4..13bd2e9f 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -5,7 +5,7 @@ sphinx-build command-line handling. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -22,9 +22,17 @@ from sphinx.errors import SphinxError from sphinx.application import Sphinx from sphinx.util import Tee, format_exception_cut_frames, save_traceback from sphinx.util.console import red, nocolor, color_terminal +from sphinx.util.osutil import fs_encoding from sphinx.util.pycompat import terminal_safe, bytes +def abspath(pathdir): + pathdir = path.abspath(pathdir) + if isinstance(pathdir, bytes): + pathdir = pathdir.decode(fs_encoding) + return pathdir + + def usage(argv, msg=None): if msg: print >>sys.stderr, msg @@ -32,29 +40,47 @@ def usage(argv, msg=None): print >>sys.stderr, """\ Sphinx v%s Usage: %s [options] sourcedir outdir [filenames...] -Options: -b <builder> -- builder to use; default is html - -a -- write all files; default is to only write \ -new and changed files - -E -- don't use a saved environment, always read all files - -t <tag> -- include "only" blocks with <tag> - -d <path> -- path for the cached environment and doctree files - (default: outdir/.doctrees) - -c <path> -- path where configuration file (conf.py) is located + +General options +^^^^^^^^^^^^^^^ +-b <builder> builder to use; default is html +-a write all files; default is to only write new and changed files +-E don't use a saved environment, always read all files +-d <path> path for the cached environment and doctree files + (default: outdir/.doctrees) + +Build configuration options +^^^^^^^^^^^^^^^^^^^^^^^^^^^ +-c <path> path where configuration file (conf.py) is located (default: same as sourcedir) - -C -- use no config file at all, only -D options - -D <setting=value> -- override a setting in configuration - -A <name=value> -- pass a value into the templates, for HTML builder - -n -- nit-picky mode, warn about all missing references - -N -- do not do colored output - -q -- no output on stdout, just warnings on stderr - -Q -- no output at all, not even warnings - -w <file> -- write warnings (and errors) to given file - -W -- turn warnings into errors - -P -- run Pdb on exception -Modi: +-C use no config file at all, only -D options +-D <setting=value> override a setting in configuration file +-t <tag> define tag: include "only" blocks with <tag> +-A <name=value> pass a value into the templates, for HTML builder +-n nit-picky mode, warn about all missing references + +Console output options +^^^^^^^^^^^^^^^^^^^^^^ +-v increase verbosity (can be repeated) +-q no output on stdout, just warnings on stderr +-Q no output at all, not even warnings +-w <file> write warnings (and errors) to given file +-W turn warnings into errors +-T show full traceback on exception +-N do not emit colored output +-P run Pdb on exception + +Filename arguments +^^^^^^^^^^^^^^^^^^ * without -a and without filenames, write new and changed files. * with -a, write all files. -* with filenames, write these.""" % (__version__, argv[0]) +* with filenames, write these. + +Standard options +^^^^^^^^^^^^^^^^ +-h, --help show this help and exit +--version show version information and exit +""" % (__version__, argv[0]) def main(argv): @@ -63,30 +89,41 @@ def main(argv): nocolor() try: - opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:ng:NEqQWw:P') + opts, args = getopt.getopt(argv[1:], 'ab:t:d:c:CD:A:nNEqQWw:PThv', + ['help', 'version']) allopts = set(opt[0] for opt in opts) - srcdir = confdir = path.abspath(args[0]) + if '-h' in allopts or '--help' in allopts: + usage(argv) + print >>sys.stderr + print >>sys.stderr, 'For more information, see '\ + '<http://sphinx-doc.org/>.' + return 0 + if '--version' in allopts: + print 'Sphinx (sphinx-build) %s' % __version__ + return 0 + srcdir = confdir = abspath(args[0]) if not path.isdir(srcdir): - print >>sys.stderr, 'Error: Cannot find source directory.' + print >>sys.stderr, 'Error: Cannot find source directory `%s\'.' % ( + srcdir,) return 1 if not path.isfile(path.join(srcdir, 'conf.py')) and \ '-c' not in allopts and '-C' not in allopts: print >>sys.stderr, ('Error: Source directory doesn\'t ' 'contain conf.py file.') return 1 - outdir = path.abspath(args[1]) - if not path.isdir(outdir): - print >>sys.stderr, 'Making output directory...' - os.makedirs(outdir) - except (IndexError, getopt.error): - usage(argv) + outdir = abspath(args[1]) + except getopt.error, err: + usage(argv, 'Error: %s' % err) + return 1 + except IndexError: + usage(argv, 'Error: Insufficient arguments.') return 1 filenames = args[2:] err = 0 for filename in filenames: if not path.isfile(filename): - print >>sys.stderr, 'Cannot find file %r.' % filename + print >>sys.stderr, 'Error: Cannot find file %r.' % filename err = 1 if err: return 1 @@ -100,6 +137,8 @@ def main(argv): buildername = None force_all = freshenv = warningiserror = use_pdb = False + show_traceback = False + verbosity = 0 status = sys.stdout warning = sys.stderr error = sys.stderr @@ -112,15 +151,15 @@ def main(argv): buildername = val elif opt == '-a': if filenames: - usage(argv, 'Cannot combine -a option and filenames.') + usage(argv, 'Error: Cannot combine -a option and filenames.') return 1 force_all = True elif opt == '-t': tags.append(val) elif opt == '-d': - doctreedir = path.abspath(val) + doctreedir = abspath(val) elif opt == '-c': - confdir = path.abspath(val) + confdir = abspath(val) if not path.isfile(path.join(confdir, 'conf.py')): print >>sys.stderr, ('Error: Configuration directory ' 'doesn\'t contain conf.py file.') @@ -176,26 +215,29 @@ def main(argv): warnfile = val elif opt == '-P': use_pdb = True + elif opt == '-T': + show_traceback = True + elif opt == '-v': + verbosity += 1 + show_traceback = True if warning and warnfile: warnfp = open(warnfile, 'w') warning = Tee(warning, warnfp) error = warning + if not path.isdir(outdir): + if status: + print >>status, 'Making output directory...' + os.makedirs(outdir) + try: app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername, confoverrides, status, warning, freshenv, - warningiserror, tags) + warningiserror, tags, verbosity) app.build(force_all, filenames) return app.statuscode - except KeyboardInterrupt: - if use_pdb: - import pdb - print >>error, red('Interrupted while building, starting debugger:') - traceback.print_exc() - pdb.post_mortem(sys.exc_info()[2]) - return 1 - except Exception, err: + except (Exception, KeyboardInterrupt), err: if use_pdb: import pdb print >>error, red('Exception occurred while building, ' @@ -204,7 +246,12 @@ def main(argv): pdb.post_mortem(sys.exc_info()[2]) else: print >>error - if isinstance(err, SystemMessage): + if show_traceback: + traceback.print_exc(None, error) + print >>error + if isinstance(err, KeyboardInterrupt): + print >>error, 'interrupted!' + elif isinstance(err, SystemMessage): print >>error, red('reST markup error:') print >>error, terminal_safe(err.args[0]) elif isinstance(err, SphinxError): @@ -222,7 +269,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 f119ab00..45105f26 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -5,7 +5,7 @@ Build configuration file handling. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -16,7 +16,7 @@ from os import path from sphinx.errors import ConfigError from sphinx.locale import l_ -from sphinx.util.osutil import make_filename +from sphinx.util.osutil import make_filename, fs_encoding from sphinx.util.pycompat import bytes, b, convert_with_2to3 nonascii_re = re.compile(b(r'[\x80-\xff]')) @@ -110,6 +110,7 @@ class Config(object): html_secnumber_suffix = ('. ', 'html'), html_search_language = (None, 'html'), html_search_options = ({}, 'html'), + html_search_scorer = ('', None), # HTML help only options htmlhelp_basename = (lambda self: make_filename(self.project), None), @@ -123,6 +124,7 @@ class Config(object): # Epub options epub_basename = (lambda self: make_filename(self.project), None), epub_theme = ('epub', 'html'), + epub_theme_options = ({}, 'html'), epub_title = (lambda self: self.html_title, 'html'), epub_author = ('unknown', 'html'), epub_language = (lambda self: self.language or 'en', 'html'), @@ -132,14 +134,21 @@ class Config(object): epub_scheme = ('unknown', 'html'), epub_uid = ('unknown', 'env'), epub_cover = ((), 'env'), + epub_guide = ((), 'env'), epub_pre_files = ([], 'env'), epub_post_files = ([], 'env'), epub_exclude_files = ([], 'env'), epub_tocdepth = (3, 'env'), epub_tocdup = (True, 'env'), + epub_fix_images = (False, 'env'), + epub_max_image_width = (0, 'env'), # LaTeX options - latex_documents = ([], None), + latex_documents = (lambda self: [(self.master_doc, + make_filename(self.project) + '.tex', + self.project, + '', 'manual')], + None), latex_logo = (None, None), latex_appendices = ([], None), latex_use_parts = (False, None), @@ -162,11 +171,22 @@ class Config(object): text_newlines = ('unix', 'env'), # manpage options - man_pages = ([], None), + man_pages = (lambda self: [(self.master_doc, + make_filename(self.project).lower(), + '%s %s' % (self.project, self.release), + [], 1)], + None), man_show_urls = (False, None), # Texinfo options - texinfo_documents = ([], None), + texinfo_documents = (lambda self: [(self.master_doc, + make_filename(self.project).lower(), + self.project, '', + make_filename(self.project), + 'The %s reference manual.' % + make_filename(self.project), + 'Python')], + None), texinfo_appendices = ([], None), texinfo_elements = ({}, None), texinfo_domain_indices = (True, None), @@ -176,9 +196,13 @@ class Config(object): linkcheck_ignore = ([], None), linkcheck_timeout = (None, None), linkcheck_workers = (5, None), + linkcheck_anchors = (True, None), # gettext options gettext_compact = (True, 'gettext'), + + # XML options + xml_pretty = (True, 'env'), ) def __init__(self, dirname, filename, overrides, tags): @@ -196,21 +220,22 @@ class Config(object): os.chdir(dirname) # get config source -- 'b' is a no-op under 2.x, while 'U' is # ignored under 3.x (but 3.x compile() accepts \r\n newlines) - f = open(config_file, 'rbU') + f = open(filename, 'rbU') try: source = f.read() finally: f.close() try: # compile to a code object, handle syntax errors + config_file_enc = config_file.encode(fs_encoding) try: - code = compile(source, config_file, 'exec') + code = compile(source, config_file_enc, 'exec') except SyntaxError: if convert_with_2to3: # maybe the file uses 2.x syntax; try to refactor to # 3.x syntax using 2to3 source = convert_with_2to3(config_file) - code = compile(source, config_file, 'exec') + code = compile(source, config_file_enc, 'exec') else: raise exec code in config diff --git a/sphinx/directives/__init__.py b/sphinx/directives/__init__.py index 6e0300ab..388522dc 100644 --- a/sphinx/directives/__init__.py +++ b/sphinx/directives/__init__.py @@ -5,7 +5,7 @@ Handlers for additional ReST directives. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index c45e1b36..6fb21d14 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -3,7 +3,7 @@ sphinx.directives.code ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/directives/other.py b/sphinx/directives/other.py index 506d4be9..59931a55 100644 --- a/sphinx/directives/other.py +++ b/sphinx/directives/other.py @@ -3,14 +3,13 @@ sphinx.directives.other ~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ -import os - from docutils import nodes from docutils.parsers.rst import Directive, directives +from docutils.parsers.rst.directives.admonitions import BaseAdmonition from docutils.parsers.rst.directives.misc import Class from docutils.parsers.rst.directives.misc import Include as BaseInclude @@ -19,7 +18,6 @@ from sphinx.locale import _ from sphinx.util import url_re, docname_join from sphinx.util.nodes import explicit_title_re, set_source_info, \ process_index_entry -from sphinx.util.compat import make_admonition from sphinx.util.matching import patfilter @@ -42,6 +40,7 @@ class TocTree(Directive): 'maxdepth': int, 'glob': directives.flag, 'hidden': directives.flag, + 'includehidden': directives.flag, 'numbered': int_or_nothing, 'titlesonly': directives.flag, } @@ -107,6 +106,7 @@ class TocTree(Directive): subnode['maxdepth'] = self.options.get('maxdepth', -1) subnode['glob'] = glob subnode['hidden'] = 'hidden' in self.options + subnode['includehidden'] = 'includehidden' in self.options subnode['numbered'] = self.options.get('numbered', 0) subnode['titlesonly'] = 'titlesonly' in self.options set_source_info(self, subnode) @@ -168,6 +168,7 @@ class Index(Directive): indexnode = addnodes.index() indexnode['entries'] = ne = [] indexnode['inline'] = False + set_source_info(self, indexnode) for entry in arguments: ne.extend(process_index_entry(entry, targetid)) return [indexnode, targetnode] @@ -204,29 +205,11 @@ class VersionChange(Directive): return ret -class SeeAlso(Directive): +class SeeAlso(BaseAdmonition): """ An admonition mentioning things to look at as reference. """ - has_content = True - required_arguments = 0 - optional_arguments = 1 - final_argument_whitespace = True - option_spec = {} - - def run(self): - ret = make_admonition( - addnodes.seealso, self.name, [_('See also')], self.options, - self.content, self.lineno, self.content_offset, self.block_text, - self.state, self.state_machine) - if self.arguments: - argnodes, msgs = self.state.inline_text(self.arguments[0], - self.lineno) - para = nodes.paragraph() - para += argnodes - para += msgs - ret[0].insert(1, para) - return ret + node_class = addnodes.seealso class TabularColumns(Directive): @@ -346,8 +329,8 @@ class Only(Directive): 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) + 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 diff --git a/sphinx/domains/__init__.py b/sphinx/domains/__init__.py index c48568eb..2a0e985f 100644 --- a/sphinx/domains/__init__.py +++ b/sphinx/domains/__init__.py @@ -6,7 +6,7 @@ Support for domains, which are groupings of description directives and roles describing e.g. constructs of one programming language. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py index f1848dbd..f9f2e664 100644 --- a/sphinx/domains/c.py +++ b/sphinx/domains/c.py @@ -5,7 +5,7 @@ The C language domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index a6392c1c..9307d3a4 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -5,7 +5,7 @@ The C++ language domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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/domains/javascript.py b/sphinx/domains/javascript.py index a6f4e87c..862077b5 100644 --- a/sphinx/domains/javascript.py +++ b/sphinx/domains/javascript.py @@ -5,7 +5,7 @@ The JavaScript domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/domains/python.py b/sphinx/domains/python.py index 38f521dc..89b7fded 100644 --- a/sphinx/domains/python.py +++ b/sphinx/domains/python.py @@ -5,7 +5,7 @@ The Python domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/domains/rst.py b/sphinx/domains/rst.py index 9a40b05f..73e7e48e 100644 --- a/sphinx/domains/rst.py +++ b/sphinx/domains/rst.py @@ -5,7 +5,7 @@ The reStructuredText domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 9148131a..56b7015a 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -5,7 +5,7 @@ The standard domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/environment.py b/sphinx/environment.py index 824d9c18..0ddb4bfb 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -5,7 +5,7 @@ Global creation environment. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -38,10 +38,10 @@ from docutils.transforms.parts import ContentsFilter from sphinx import addnodes from sphinx.util import url_re, get_matching_docs, docname_join, split_into, \ - FilenameUniqDict + split_index_msg, FilenameUniqDict from sphinx.util.nodes import clean_astext, make_refnode, extract_messages, \ - WarningStream -from sphinx.util.osutil import movefile, SEP, ustrftime, find_catalog + traverse_translatable_index, WarningStream +from sphinx.util.osutil import SEP, ustrftime, find_catalog, fs_encoding from sphinx.util.matching import compile_matchers from sphinx.util.pycompat import all, class_types from sphinx.util.websupport import is_commentable @@ -49,7 +49,6 @@ from sphinx.errors import SphinxError, ExtensionError from sphinx.locale import _, init as init_locale from sphinx.versioning import add_uids, merge_doctrees -fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() orig_role_function = roles.role orig_directive_function = directives.directive @@ -71,7 +70,7 @@ default_settings = { # This is increased every time an environment attribute is added # or changed to properly invalidate pickle files. -ENV_VERSION = 41 +ENV_VERSION = 42 + (sys.version_info[0] - 2) default_substitutions = set([ @@ -183,7 +182,8 @@ class CitationReferences(Transform): for citnode in self.document.traverse(nodes.citation_reference): cittext = citnode.astext() refnode = addnodes.pending_xref(cittext, reftype='citation', - reftarget=cittext, refwarn=True) + reftarget=cittext, refwarn=True, + ids=citnode["ids"]) refnode.line = citnode.line or citnode.parent.line refnode += nodes.Text('[' + cittext + ']') citnode.parent.replace(citnode, refnode) @@ -194,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'] @@ -214,20 +215,110 @@ 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 + + # Avoid "Literal block expected; none found." warnings. + # If msgstr ends with '::' then it cause warning message at + # parser.parse() processing. + # literal-block-warning is only appear in avobe case. + if msgstr.strip().endswith('::'): + msgstr += '\n\n dummy literal' + # dummy literal node will discard by 'patch = patch[0]' + + 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'. + def is_autonumber_footnote_ref(node): + return 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'. + def is_refnamed_ref(node): + return 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) + + # refnamed footnote and citation should use original 'ids'. + def is_refnamed_footnote_ref(node): + footnote_ref_classes = (nodes.footnote_reference, + nodes.citation_reference) + return isinstance(node, footnote_ref_classes) and \ + 'refname' in node + old_refs = node.traverse(is_refnamed_footnote_ref) + new_refs = patch.traverse(is_refnamed_footnote_ref) + refname_ids_map = {} + if len(old_refs) != len(new_refs): + env.warn_node('inconsistent references in ' + 'translated message', node) + for old in old_refs: + refname_ids_map[old["refname"]] = old["ids"] + for new in new_refs: + refname = new["refname"] + if refname in refname_ids_map: + new["ids"] = refname_ids_map[refname] + + # update leaves + for child in patch.children: child.parent = node node.children = patch.children + # Extract and translate messages for index entries. + for node, entries in traverse_translatable_index(self.document): + new_entries = [] + for type, msg, tid, main in entries: + msg_parts = split_index_msg(type, msg) + msgstr_parts = [] + for part in msg_parts: + msgstr = catalog.gettext(part) + if not msgstr: + msgstr = part + msgstr_parts.append(msgstr) + + new_entries.append((type, ';'.join(msgstr_parts), tid, main)) + + node['raw_entries'] = entries + node['entries'] = new_entries + class SphinxStandaloneReader(standalone.Reader): """ @@ -290,9 +381,7 @@ class BuildEnvironment: del self.config.values domains = self.domains del self.domains - # first write to a temporary file, so that if dumping fails, - # the existing environment won't be overwritten - picklefile = open(filename + '.tmp', 'wb') + picklefile = open(filename, 'wb') # remove potentially pickling-problematic values from config for key, val in vars(self.config).items(): if key.startswith('_') or \ @@ -304,7 +393,6 @@ class BuildEnvironment: pickle.dump(self, picklefile, pickle.HIGHEST_PROTOCOL) finally: picklefile.close() - movefile(filename + '.tmp', filename) # reset attributes self.domains = domains self.config.values = values @@ -783,7 +871,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 @@ -875,6 +967,7 @@ class BuildEnvironment: filterlevel = self.config.keep_warnings and 2 or 5 for node in doctree.traverse(nodes.system_message): if node['level'] < filterlevel: + self.app.debug('%s [filtered system message]', node.astext()) node.parent.remove(node) @@ -1150,8 +1243,9 @@ class BuildEnvironment: anchorname=anchorname, *nodetext) para = addnodes.compact_paragraph('', '', reference) item = nodes.list_item('', para) + sub_item = build_toc(sectionnode, depth + 1) if maxdepth == 0 or depth < maxdepth: - item += build_toc(sectionnode, depth+1) + item += sub_item entries.append(item) if entries: return nodes.bullet_list('', *entries) @@ -1223,7 +1317,7 @@ class BuildEnvironment: def get_and_resolve_doctree(self, docname, builder, doctree=None, - prune_toctrees=True): + prune_toctrees=True, includehidden=False): """Read the doctree from the pickle, resolve cross-references and toctrees and return it. """ @@ -1236,7 +1330,7 @@ class BuildEnvironment: # now, resolve all toctree nodes for toctreenode in doctree.traverse(addnodes.toctree): result = self.resolve_toctree(docname, builder, toctreenode, - prune=prune_toctrees) + prune=prune_toctrees, includehidden=includehidden) if result is None: toctreenode.replace_self([]) else: @@ -1260,46 +1354,56 @@ class BuildEnvironment: if toctree.get('hidden', False) and not includehidden: return None - def _walk_depth(node, depth, maxdepth): + # For reading the following two helper function, it is useful to keep + # in mind the node structure of a toctree (using HTML-like node names + # for brevity): + # + # <ul> + # <li> + # <p><a></p> + # <p><a></p> + # ... + # <ul> + # ... + # </ul> + # </li> + # </ul> + # + # The transformation is made in two passes in order to avoid + # interactions between marking and pruning the tree (see bug #1046). + + def _toctree_prune(node, depth, maxdepth): """Utility: Cut a TOC at a specified depth.""" - - # For reading this function, it is useful to keep in mind the node - # structure of a toctree (using HTML-like node names for brevity): - # - # <ul> - # <li> - # <p><a></p> - # <p><a></p> - # ... - # <ul> - # ... - # </ul> - # </li> - # </ul> - for subnode in node.children[:]: if isinstance(subnode, (addnodes.compact_paragraph, nodes.list_item)): - # for <p> and <li>, just indicate the depth level and - # recurse to children - subnode['classes'].append('toctree-l%d' % (depth-1)) - _walk_depth(subnode, depth, maxdepth) - + # for <p> and <li>, just recurse + _toctree_prune(subnode, depth, maxdepth) elif isinstance(subnode, nodes.bullet_list): # for <ul>, determine if the depth is too large or if the # entry is to be collapsed if maxdepth > 0 and depth > maxdepth: subnode.parent.replace(subnode, []) else: - # to find out what to collapse, *first* walk subitems, - # since that determines which children point to the - # current page - _walk_depth(subnode, depth+1, maxdepth) # cull sub-entries whose parents aren't 'current' if (collapse and depth > 1 and 'iscurrent' not in subnode.parent): subnode.parent.remove(subnode) + else: + # recurse on visible children + _toctree_prune(subnode, depth+1, maxdepth) + def _toctree_add_classes(node, depth): + """Add 'toctree-l%d' and 'current' classes to the toctree.""" + for subnode in node.children: + if isinstance(subnode, (addnodes.compact_paragraph, + nodes.list_item)): + # for <p> and <li>, indicate the depth level and recurse + subnode['classes'].append('toctree-l%d' % (depth-1)) + _toctree_add_classes(subnode, depth) + elif isinstance(subnode, nodes.bullet_list): + # for <ul>, just recurse + _toctree_add_classes(subnode, depth+1) elif isinstance(subnode, nodes.reference): # for <a>, identify which entries point to the current # document and therefore may not be collapsed @@ -1322,7 +1426,7 @@ class BuildEnvironment: def _entries_from_toctree(toctreenode, parents, separate=False, subtree=False): """Return TOC entries for a toctree node.""" - refs = [(e[0], str(e[1])) for e in toctreenode['entries']] + refs = [(e[0], e[1]) for e in toctreenode['entries']] entries = [] for (title, ref) in refs: try: @@ -1409,6 +1513,8 @@ class BuildEnvironment: maxdepth = maxdepth or toctree.get('maxdepth', -1) if not titles_only and toctree.get('titlesonly', False): titles_only = True + if not includehidden and toctree.get('includehidden', False): + includehidden = True # NOTE: previously, this was separate=True, but that leads to artificial # separation when two or more toctree entries form a logical unit, so @@ -1420,8 +1526,9 @@ class BuildEnvironment: newnode = addnodes.compact_paragraph('', '', *tocentries) newnode['toctree'] = True - # prune the tree to maxdepth and replace titles, also set level classes - _walk_depth(newnode, 1, prune and maxdepth or 0) + # prune the tree to maxdepth, also set toc depth and current classes + _toctree_add_classes(newnode, 1) + _toctree_prune(newnode, 1, prune and maxdepth or 0) # set the target paths in the toctrees (they are not known at TOC # generation time) @@ -1469,8 +1576,16 @@ class BuildEnvironment: elif typ == 'citation': docname, labelid = self.citations.get(target, ('', '')) if docname: - newnode = make_refnode(builder, fromdocname, docname, - labelid, contnode) + try: + newnode = make_refnode(builder, fromdocname, + docname, labelid, contnode) + except NoUri: + # remove the ids we added in the CitationReferences + # transform since they can't be transfered to + # the contnode (if it's a Text node) + if not isinstance(contnode, nodes.Element): + del node['ids'][:] + raise # no new node found? try the missing-reference event if newnode is None: newnode = builder.app.emit_firstresult( @@ -1760,4 +1875,3 @@ class BuildEnvironment: if 'orphan' in self.metadata[docname]: continue self.warn(docname, 'document isn\'t included in any toctree') - diff --git a/sphinx/errors.py b/sphinx/errors.py index bfc2be37..aee21218 100644 --- a/sphinx/errors.py +++ b/sphinx/errors.py @@ -6,7 +6,7 @@ Contains SphinxError and a few subclasses (in an extra module to avoid circular import problems). - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/__init__.py b/sphinx/ext/__init__.py index 07269dc0..fcdf6c7d 100644 --- a/sphinx/ext/__init__.py +++ b/sphinx/ext/__init__.py @@ -5,6 +5,6 @@ Contains Sphinx features not activated by default. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index c15726b4..45dbdcdb 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -7,7 +7,7 @@ the doctree, thus avoiding duplication between docstrings and documentation for those who like elaborate docstrings. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -317,26 +317,38 @@ class Documenter(object): Returns True if successful, False if an error occurred. """ + dbg = self.env.app.debug + if self.objpath: + dbg('[autodoc] from %s import %s', + self.modname, '.'.join(self.objpath)) try: + dbg('[autodoc] import %s', self.modname) __import__(self.modname) parent = None obj = self.module = sys.modules[self.modname] + dbg('[autodoc] => %r', obj) for part in self.objpath: parent = obj + dbg('[autodoc] getattr(_, %r)', part) obj = self.get_attr(obj, part) + dbg('[autodoc] => %r', obj) self.object_name = part self.parent = parent self.object = obj return True # this used to only catch SyntaxError, ImportError and AttributeError, # but importing modules with side effects can raise all kinds of errors - except Exception, err: - if self.env.app and not self.env.app.quiet: - self.env.app.info(traceback.format_exc().rstrip()) - self.directive.warn( - 'autodoc can\'t import/find %s %r, it reported error: ' - '"%s", please check your spelling and sys.path' % - (self.objtype, str(self.fullname), err)) + except Exception: + if self.objpath: + errmsg = 'autodoc: failed to import %s %r from module %r' % \ + (self.objtype, '.'.join(self.objpath), self.modname) + else: + errmsg = 'autodoc: failed to import %s %r' % \ + (self.objtype, self.fullname) + errmsg += '; the following exception was raised:\n%s' % \ + traceback.format_exc() + dbg(errmsg) + self.directive.warn(errmsg) self.env.note_reread() return False @@ -489,20 +501,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 +539,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 +588,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 @@ -698,7 +717,8 @@ class Documenter(object): # parse right now, to get PycodeErrors on parsing (results will # be cached anyway) self.analyzer.find_attr_docs() - except PycodeError: + except PycodeError, err: + self.env.app.debug('[autodoc] module analyzer failed: %s', err) # no source file -- e.g. for builtin and C modules self.analyzer = None # at least add the module.__file__ as a dependency @@ -748,7 +768,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 @@ -952,7 +972,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 @@ -1101,7 +1121,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): @@ -1172,7 +1192,7 @@ class AttributeDocumenter(ClassLevelDocumenter): def can_document_member(cls, member, membername, isattr, parent): isdatadesc = isdescriptor(member) and not \ isinstance(member, cls.method_types) and not \ - type(member).__name__ == "method_descriptor" + type(member).__name__ in ("type", "method_descriptor") return isdatadesc or (not isinstance(parent, ModuleDocumenter) and not inspect.isroutine(member) and not isinstance(member, class_types)) @@ -1287,6 +1307,13 @@ class AutoDirective(Directive): self.warnings = [] self.result = ViewList() + try: + source, lineno = self.reporter.get_source_and_line(self.lineno) + except AttributeError: + source = lineno = None + self.env.app.debug('[autodoc] %s:%s: input:\n%s', + source, lineno, self.block_text) + # find out what documenter to call objtype = self.name[4:] doc_class = self._registry[objtype] @@ -1307,6 +1334,8 @@ class AutoDirective(Directive): if not self.result: return self.warnings + self.env.app.debug2('[autodoc] output:\n%s', '\n'.join(self.result)) + # record all filenames as dependencies -- this will at least # partially make automatic invalidation possible for fn in self.filename_set: diff --git a/sphinx/ext/autosummary/__init__.py b/sphinx/ext/autosummary/__init__.py index 0f5c2640..f5c5a884 100644 --- a/sphinx/ext/autosummary/__init__.py +++ b/sphinx/ext/autosummary/__init__.py @@ -49,7 +49,7 @@ resolved to a Python object, and otherwise it becomes simple emphasis. This can be used as the default role to make links 'smart'. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index faba1160..0640a332 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -14,7 +14,7 @@ generate: sphinx-autogen -o source/generated source/*.rst - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/coverage.py b/sphinx/ext/coverage.py index 5abbee09..0e8bc4b2 100644 --- a/sphinx/ext/coverage.py +++ b/sphinx/ext/coverage.py @@ -6,7 +6,7 @@ Check Python modules and C API for coverage. Mostly written by Josip Dzolonga for the Google Highly Open Participation contest. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index 1263c411..cd6cbf22 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -6,7 +6,7 @@ Mimic doctest by automatically executing code snippets and checking their results. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/extlinks.py b/sphinx/ext/extlinks.py index 9f60cded..aea1de17 100644 --- a/sphinx/ext/extlinks.py +++ b/sphinx/ext/extlinks.py @@ -20,7 +20,7 @@ You can also give an explicit caption, e.g. :exmpl:`Foo <foo>`. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index bacd7248..a26e34fd 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -6,7 +6,7 @@ Allow graphviz-formatted graphs to be included in Sphinx-generated documents inline. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -14,7 +14,6 @@ import re import codecs import posixpath from os import path -from math import ceil from subprocess import Popen, PIPE try: from hashlib import sha1 as sha @@ -125,7 +124,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 @@ -300,13 +299,16 @@ def texinfo_visit_graphviz(self, node): def text_visit_graphviz(self, node): if 'alt' in node.attributes: self.add_text(_('[graph: %s]') % node['alt']) - self.add_text(_('[graph]')) + else: + self.add_text(_('[graph]')) + raise nodes.SkipNode def man_visit_graphviz(self, node): if 'alt' in node.attributes: - self.body.append(_('[graph: %s]') % node['alt'] + '\n') - self.body.append(_('[graph]')) + self.body.append(_('[graph: %s]') % node['alt']) + else: + self.body.append(_('[graph]')) raise nodes.SkipNode diff --git a/sphinx/ext/ifconfig.py b/sphinx/ext/ifconfig.py index 50c7bbef..2e219614 100644 --- a/sphinx/ext/ifconfig.py +++ b/sphinx/ext/ifconfig.py @@ -16,7 +16,7 @@ namespace of the project configuration (that is, all variables from ``conf.py`` are available.) - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/inheritance_diagram.py b/sphinx/ext/inheritance_diagram.py index be7a6766..6499e078 100644 --- a/sphinx/ext/inheritance_diagram.py +++ b/sphinx/ext/inheritance_diagram.py @@ -32,7 +32,7 @@ r""" The graph is inserted as a PNG+image map into HTML and a PDF in LaTeX. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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..2d8b9d1f 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -20,7 +20,7 @@ also be specified individually, e.g. if the docs should be buildable without Internet access. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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/jsmath.py b/sphinx/ext/jsmath.py index bad8225b..2b9d5d28 100644 --- a/sphinx/ext/jsmath.py +++ b/sphinx/ext/jsmath.py @@ -6,7 +6,7 @@ Set up everything for use of JSMath to display math in HTML via JavaScript. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/linkcode.py b/sphinx/ext/linkcode.py new file mode 100644 index 00000000..ee7a603d --- /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-2013 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/mathbase.py b/sphinx/ext/mathbase.py index 6d080b4b..3955e4bc 100644 --- a/sphinx/ext/mathbase.py +++ b/sphinx/ext/mathbase.py @@ -5,7 +5,7 @@ Set up math support in source files and LaTeX/text output. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/mathjax.py b/sphinx/ext/mathjax.py index 7a552364..abcbe491 100644 --- a/sphinx/ext/mathjax.py +++ b/sphinx/ext/mathjax.py @@ -7,7 +7,7 @@ Sphinx's HTML writer -- requires the MathJax JavaScript library on your webserver/computer. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/ext/oldcmarkup.py b/sphinx/ext/oldcmarkup.py index 9dad85f4..aa10246b 100644 --- a/sphinx/ext/oldcmarkup.py +++ b/sphinx/ext/oldcmarkup.py @@ -5,7 +5,7 @@ Extension for compatibility with old C markup (directives and roles). - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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..3938dab1 100644 --- a/sphinx/ext/pngmath.py +++ b/sphinx/ext/pngmath.py @@ -5,7 +5,7 @@ Render math in HTML via dvipng. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -32,6 +32,13 @@ from sphinx.ext.mathbase import setup_math as mathbase_setup, wrap_displaymath class MathExtError(SphinxError): category = 'Math extension error' + def __init__(self, msg, stderr=None, stdout=None): + if stderr: + msg += '\n[stderr]\n' + stderr + if stdout: + msg += '\n[stdout]\n' + stdout + SphinxError.__init__(self, msg) + DOC_HEAD = r''' \documentclass[12pt]{article} @@ -130,8 +137,7 @@ def render_math(self, math): stdout, stderr = p.communicate() if p.returncode != 0: - raise MathExtError('latex exited with error:\n[stderr]\n%s\n' - '[stdout]\n%s' % (stderr, stdout)) + raise MathExtError('latex exited with error', stderr, stdout) ensuredir(path.dirname(outfn)) # use some standard dvipng arguments @@ -155,8 +161,7 @@ def render_math(self, math): return None, None stdout, stderr = p.communicate() if p.returncode != 0: - raise MathExtError('dvipng exited with error:\n[stderr]\n%s\n' - '[stdout]\n%s' % (stderr, stdout)) + raise MathExtError('dvipng exited with error', stderr, stdout) depth = None if use_preview: for line in stdout.splitlines(): @@ -237,7 +242,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/ext/refcounting.py b/sphinx/ext/refcounting.py index a8dc721d..918e64f3 100644 --- a/sphinx/ext/refcounting.py +++ b/sphinx/ext/refcounting.py @@ -9,7 +9,7 @@ Usage: Set the `refcount_file` config value to the path to the reference count data file. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -17,6 +17,7 @@ from os import path from docutils import nodes from sphinx import addnodes +from sphinx.locale import _ # refcount annotation @@ -78,12 +79,12 @@ class Refcounts(dict): continue elif entry.result_type not in ("PyObject*", "PyVarObject*"): continue - rc = 'Return value: ' if entry.result_refs is None: - rc += "Always NULL." + rc = _('Return value: Always NULL.') + elif entry.result_refs: + rc = _('Return value: New reference.') else: - rc += (entry.result_refs and "New" or "Borrowed") + \ - " reference." + rc = _('Return value: Borrowed reference.') node.insert(0, refcount(rc, rc)) diff --git a/sphinx/ext/todo.py b/sphinx/ext/todo.py index 4116a2d5..32108b1e 100644 --- a/sphinx/ext/todo.py +++ b/sphinx/ext/todo.py @@ -8,7 +8,7 @@ all todos of your project and lists them along with a backlink to the original location. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -154,7 +154,7 @@ def depart_todo_node(self, node): self.depart_admonition(node) def setup(app): - app.add_config_value('todo_include_todos', False, False) + app.add_config_value('todo_include_todos', False, 'html') app.add_node(todolist) app.add_node(todo_node, diff --git a/sphinx/ext/viewcode.py b/sphinx/ext/viewcode.py index 32840f30..962b543b 100644 --- a/sphinx/ext/viewcode.py +++ b/sphinx/ext/viewcode.py @@ -5,7 +5,7 @@ Add links to module code in Python object descriptions. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 63464914..df422321 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -5,7 +5,7 @@ Highlight code blocks using Pygments. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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 diff --git a/sphinx/jinja2glue.py b/sphinx/jinja2glue.py index ffe3a0b3..20d92a32 100644 --- a/sphinx/jinja2glue.py +++ b/sphinx/jinja2glue.py @@ -5,7 +5,7 @@ Glue code for the jinja2 templating engine. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index 3aca780c..96da67d6 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -5,7 +5,7 @@ Locale utilities. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -159,7 +159,7 @@ admonitionlabels = { 'hint': l_('Hint'), 'important': l_('Important'), 'note': l_('Note'), - 'seealso': l_('See Also'), + 'seealso': l_('See also'), 'tip': l_('Tip'), 'warning': l_('Warning'), } 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 new file mode 100644 index 00000000..856311d1 --- /dev/null +++ b/sphinx/locale/hu/LC_MESSAGES/sphinx.js @@ -0,0 +1 @@ +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 differnew file mode 100644 index 00000000..6f79306c --- /dev/null +++ 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 new file mode 100644 index 00000000..1a51d3bf --- /dev/null +++ b/sphinx/locale/hu/LC_MESSAGES/sphinx.po @@ -0,0 +1,592 @@ +# Translations template for PROJECT. +# Copyright (C) 2011 ORGANIZATION +# This file is distributed under the same license as the PROJECT project. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2011. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 1.0\n" +"Report-Msgid-Bugs-To: szunyog@gmail.com\n" +"POT-Creation-Date: 2011-09-25 20:04+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: Tibor Toth <szunyog@gmail.com>\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" +"Generated-By: Babel 0.9.6\n" + +#: sphinx/environment.py:113 sphinx/writers/latex.py:190 +#: sphinx/writers/manpage.py:67 sphinx/writers/texinfo.py:203 +#, python-format +msgid "%B %d, %Y" +msgstr "%Y. %m. %d." + +#: sphinx/environment.py:1619 +#, python-format +msgid "see %s" +msgstr "lásd %s" + +#: sphinx/environment.py:1622 +#, python-format +msgid "see also %s" +msgstr "lásd még %s" + +#: sphinx/roles.py:176 +#, python-format +msgid "Python Enhancement Proposals; PEP %s" +msgstr "Python Fejlesztési Javaslatok; PEP %s" + +#: sphinx/builders/changes.py:73 +msgid "Builtins" +msgstr "BeépÃtett" + +#: sphinx/builders/changes.py:75 +msgid "Module level" +msgstr "Modul szint" + +#: sphinx/builders/html.py:276 +#, python-format +msgid "%b %d, %Y" +msgstr "%b %d, %Y" + +#: sphinx/builders/html.py:295 sphinx/themes/basic/defindex.html:30 +msgid "General Index" +msgstr "Ãltalános tárgymutató" + +#: sphinx/builders/html.py:295 +msgid "index" +msgstr "nyitóoldal" + +#: sphinx/builders/html.py:355 +msgid "next" +msgstr "következÅ‘" + +#: sphinx/builders/html.py:364 +msgid "previous" +msgstr "elÅ‘zÅ‘" + +#: sphinx/builders/latex.py:141 sphinx/builders/texinfo.py:196 +msgid " (in " +msgstr " (" + +#: sphinx/directives/other.py:138 +msgid "Section author: " +msgstr "Fejezet szerzÅ‘: " + +#: sphinx/directives/other.py:140 +msgid "Module author: " +msgstr "Modul szerzÅ‘: " + +#: sphinx/directives/other.py:142 +msgid "Code author: " +msgstr "Kód szerzÅ‘: " + +#: sphinx/directives/other.py:144 +msgid "Author: " +msgstr "SzerzÅ‘: " + +#: sphinx/directives/other.py:219 +msgid "See also" +msgstr "Lásd még" + +#: sphinx/domains/__init__.py:244 +#, python-format +msgid "%s %s" +msgstr "%s %s" + +#: sphinx/domains/c.py:141 +#, python-format +msgid "%s (C function)" +msgstr "%s (C függvény)" + +#: sphinx/domains/c.py:143 +#, python-format +msgid "%s (C member)" +msgstr "%s (C tagváltozó)" + +#: sphinx/domains/c.py:145 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C makró)" + +#: sphinx/domains/c.py:147 +#, python-format +msgid "%s (C type)" +msgstr "%s (C tÃpus)" + +#: sphinx/domains/c.py:149 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C változó)" + +#: sphinx/domains/cpp.py:999 +#, python-format +msgid "%s (C++ class)" +msgstr "%s (C++ osztály)" + +#: sphinx/domains/cpp.py:1014 +#, python-format +msgid "%s (C++ type)" +msgstr "%s (C++ tÃpus)" + +#: sphinx/domains/cpp.py:1034 +#, python-format +msgid "%s (C++ member)" +msgstr "%s (C++ tagváltozó)" + +#: sphinx/domains/cpp.py:1090 +#, python-format +msgid "%s (C++ function)" +msgstr "%s (C++ függvény)" + +#: sphinx/domains/javascript.py:106 sphinx/domains/python.py:253 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (beépÃtett függvény)" + +#: sphinx/domains/javascript.py:107 sphinx/domains/python.py:317 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metódus)" + +#: sphinx/domains/javascript.py:109 +#, python-format +msgid "%s() (class)" +msgstr "%s() (osztály)" + +#: sphinx/domains/javascript.py:111 +#, python-format +msgid "%s (global variable or constant)" +msgstr "%s (globális változó vagy konstans)" + +#: sphinx/domains/javascript.py:113 sphinx/domains/python.py:355 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s attribútum)" + +#: 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 modulban)" + +#: sphinx/domains/python.py:257 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (beépÃtett változó)" + +#: sphinx/domains/python.py:258 sphinx/domains/python.py:349 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (%s modulban)" + +#: sphinx/domains/python.py:274 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (beépÃtett osztály)" + +#: sphinx/domains/python.py:275 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (osztály %s)" + +#: sphinx/domains/python.py:315 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metódus)" + +#: sphinx/domains/python.py:327 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s statikus metódus)" + +#: sphinx/domains/python.py:330 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s statikus metódus)" + +#: sphinx/domains/python.py:340 +#, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (%s.%s osztály metódus)" + +#: sphinx/domains/python.py:343 +#, python-format +msgid "%s() (%s class method)" +msgstr "%s() (%s osztály metódus)" + +#: sphinx/domains/python.py:353 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s attribútum)" + +#: sphinx/domains/python.py:433 +#, python-format +msgid "%s (module)" +msgstr "%s (modul)" + +#: sphinx/domains/python.py:536 +msgid "Deprecated" +msgstr "Elavult" + +#: sphinx/domains/python.py:693 +msgid " (deprecated)" +msgstr " (elavult)" + +#: sphinx/domains/rst.py:53 +#, python-format +msgid "%s (directive)" +msgstr "%s (direktÃva)" + +#: sphinx/domains/rst.py:55 +#, python-format +msgid "%s (role)" +msgstr "%s (szerepkör)" + +#: sphinx/domains/std.py:86 +#, python-format +msgid "environment variable; %s" +msgstr "környezeti változó; %s" + +#: sphinx/domains/std.py:162 +#, python-format +msgid "%scommand line option; %s" +msgstr "%sparancssor opció; %s" + +#: sphinx/ext/autodoc.py:1002 +#, python-format +msgid " Bases: %s" +msgstr " Alapul: %s" + +#: sphinx/ext/autodoc.py:1038 +#, python-format +msgid "alias of :class:`%s`" +msgstr "álneve :class:`%s`" + +#: sphinx/ext/graphviz.py:300 sphinx/ext/graphviz.py:306 +#, python-format +msgid "[graph: %s]" +msgstr "[graph: %s]" + +#: sphinx/ext/graphviz.py:301 sphinx/ext/graphviz.py:307 +msgid "[graph]" +msgstr "[graph]" + +#: sphinx/ext/intersphinx.py:218 +#, python-format +msgid "(in %s v%s)" +msgstr "(%s v%s)" + +#: sphinx/ext/todo.py:42 +msgid "Todo" +msgstr "Tennivaló" + +#: sphinx/ext/todo.py:110 +#, python-format +msgid "(The <<original entry>> is located in %s, line %d.)" +msgstr "(Az <<eredeti bejegyzés>> megtalálható a(z) %s, %d sor.)" + +#: sphinx/ext/todo.py:119 +msgid "original entry" +msgstr "eredeti bejegyzés" + +#: sphinx/ext/viewcode.py:70 +msgid "[source]" +msgstr "[source]" + +#: sphinx/ext/viewcode.py:117 +msgid "[docs]" +msgstr "[docs]" + +#: sphinx/ext/viewcode.py:131 +msgid "Module code" +msgstr "Modul forráskód" + +#: sphinx/ext/viewcode.py:137 +#, python-format +msgid "<h1>Source code for %s</h1>" +msgstr "<h1>%s forráskódja</h1>" + +#: sphinx/ext/viewcode.py:164 +msgid "Overview: module code" +msgstr "Ãttekintés: modul forráskód" + +#: sphinx/ext/viewcode.py:165 +msgid "<h1>All modules for which code is available</h1>" +msgstr "<h1>Az összes modul, melynek forrása elérhetÅ‘</h1>" + +#: sphinx/themes/agogo/layout.html:46 sphinx/themes/basic/globaltoc.html:10 +#: sphinx/themes/basic/localtoc.html:11 +msgid "Table Of Contents" +msgstr "Tartalomjegyzék" + +#: sphinx/themes/agogo/layout.html:50 sphinx/themes/basic/layout.html:137 +#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:20 +msgid "Search" +msgstr "Keresés" + +#: sphinx/themes/agogo/layout.html:53 sphinx/themes/basic/searchbox.html:15 +msgid "Go" +msgstr "Ok" + +#: sphinx/themes/agogo/layout.html:58 sphinx/themes/basic/searchbox.html:20 +msgid "Enter search terms or a module, class or function name." +msgstr "Adjon meg egy keresendÅ‘ kifejezést, modul, osztály vagy funkció nevet." + +#: sphinx/themes/agogo/layout.html:79 sphinx/themes/basic/sourcelink.html:14 +msgid "Show Source" +msgstr "Forrás megtekintése" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Overview" +msgstr "Ãttekintés" + +#: sphinx/themes/basic/defindex.html:20 +msgid "Indices and tables:" +msgstr "Tárgymutató és táblázatok" + +#: sphinx/themes/basic/defindex.html:23 +msgid "Complete Table of Contents" +msgstr "Teljes tartalomjegyzék" + +#: sphinx/themes/basic/defindex.html:24 +msgid "lists all sections and subsections" +msgstr "kilistázza az összes fejezetet és alfejezetet" + +#: sphinx/themes/basic/defindex.html:25 +msgid "Search Page" +msgstr "Keresés" + +#: sphinx/themes/basic/defindex.html:26 +msgid "search this documentation" +msgstr "keresés ebben a dokumentációban" + +#: sphinx/themes/basic/defindex.html:28 +msgid "Global Module Index" +msgstr "Teljes modul tárgymutató" + +#: sphinx/themes/basic/defindex.html:29 +msgid "quick access to all modules" +msgstr "gyors hozzáférés az összes modulhoz" + +#: sphinx/themes/basic/defindex.html:31 +msgid "all functions, classes, terms" +msgstr "összes funkció, osztály és kifejezés" + +#: sphinx/themes/basic/genindex-single.html:32 +#: sphinx/themes/basic/genindex-split.html:11 +#: sphinx/themes/basic/genindex-split.html:14 +#: 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 +msgid "Index" +msgstr "Tárgymutató" + +#: sphinx/themes/basic/genindex-single.html:35 +#, python-format +msgid "Index – %(key)s" +msgstr "Tárgymutató – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:63 +#: sphinx/themes/basic/genindex-split.html:24 +#: sphinx/themes/basic/genindex-split.html:38 +#: sphinx/themes/basic/genindex.html:74 +msgid "Full index on one page" +msgstr "Teljes tárgymutató egy oldalon" + +#: sphinx/themes/basic/genindex-split.html:16 +msgid "Index pages by letter" +msgstr "Oldalak ABC sorrendben" + +#: sphinx/themes/basic/genindex-split.html:25 +msgid "can be huge" +msgstr "nagy lehet" + +#: sphinx/themes/basic/layout.html:29 +msgid "Navigation" +msgstr "Navigáció" + +#: sphinx/themes/basic/layout.html:122 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Keresés köztük: %(docstitle)s" + +#: sphinx/themes/basic/layout.html:131 +msgid "About these documents" +msgstr "Névjegy ezekrÅ‘l a dokumentumokról" + +#: sphinx/themes/basic/layout.html:140 +msgid "Copyright" +msgstr "Minden jog fenntartva" + +#: sphinx/themes/basic/layout.html:189 +#, python-format +msgid "© <a href=\"%(path)s\">Copyright</a> %(copyright)s." +msgstr "© <a href=\"%(path)s\">Minden jog fenntartva</a> %(copyright)s." + +#: sphinx/themes/basic/layout.html:191 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Minden jog fenntartva %(copyright)s." + +#: sphinx/themes/basic/layout.html:195 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Utolsó frissÃtés %(last_updated)s." + +#: sphinx/themes/basic/layout.html:198 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "" +"<a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s használatával készült." + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Keresés %(docstitle)s" + +#: sphinx/themes/basic/relations.html:11 +msgid "Previous topic" +msgstr "ElÅ‘zÅ‘ témakör" + +#: sphinx/themes/basic/relations.html:13 +msgid "previous chapter" +msgstr "elÅ‘zÅ‘ fejezet" + +#: sphinx/themes/basic/relations.html:16 +msgid "Next topic" +msgstr "KövetkezÅ‘ témakör" + +#: sphinx/themes/basic/relations.html:18 +msgid "next chapter" +msgstr "következÅ‘ fejezet" + +#: sphinx/themes/basic/search.html:24 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" +"Kérem engedélyezze a JavaScriptet a keresÅ‘ funkció\n" +" használatához." + +#: sphinx/themes/basic/search.html:29 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"ErrÅ‘l az oldalról indÃthatja kereséseit. Ãrja be a kulcsszavakat\n" +" az alábbi szövegdobozba, majd kattintson a \"keresés\" gombra.\n" +" Ãœgyeljen arra, hogy a keresés megadott kulcsszavak mindegyikét\n" +" figyelembe veszi, Ãgy azok az oldalak, melyek nem tartalmazzák az\n" +" összes kifejezést, nem jelennek meg a találati listában." + +#: sphinx/themes/basic/search.html:36 +msgid "search" +msgstr "keresés" + +#: sphinx/themes/basic/search.html:40 +msgid "Search Results" +msgstr "Keresési Eredmények" + +#: sphinx/themes/basic/search.html:42 +msgid "Your search did not match any results." +msgstr "Nincs találat." + +#: sphinx/themes/basic/searchbox.html:12 +msgid "Quick search" +msgstr "Gyorskeresés" + +#: sphinx/themes/basic/sourcelink.html:11 +msgid "This Page" +msgstr "Ez az Oldal" + +#: 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 "Változások a(z) %(version)s változatban — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +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 "Automatikusan generált változáslista a(z) %(version)s változathoz" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Könyvtár változások" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "C API változások" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Egyéb változások" + +#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:504 +#: sphinx/writers/html.py:510 +msgid "Permalink to this headline" +msgstr "Hivatkozás erre a fejezetcÃmre" + +#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:92 +msgid "Permalink to this definition" +msgstr "Hivatkozás erre a definÃcióra" + +#: sphinx/themes/basic/static/doctools.js:189 +msgid "Hide Search Matches" +msgstr "Keresési Találatok Elrejtése" + +#: sphinx/themes/default/static/sidebar.js:69 +msgid "Expand sidebar" +msgstr "Oldalsáv kinyitása" + +#: sphinx/themes/default/static/sidebar.js:82 +#: sphinx/themes/default/static/sidebar.js:110 +msgid "Collapse sidebar" +msgstr "Oldalsáv összezárása" + +#: sphinx/themes/haiku/layout.html:26 +msgid "Contents" +msgstr "Tartalom" + +#: sphinx/writers/latex.py:177 +msgid "Release" +msgstr "Kiadás" + +#: sphinx/writers/latex.py:599 sphinx/writers/manpage.py:182 +#: sphinx/writers/texinfo.py:589 +msgid "Footnotes" +msgstr "Lábjegyzetek" + +#: sphinx/writers/latex.py:683 +msgid "continued from previous page" +msgstr "folytatás az elÅ‘zÅ‘ oldalról" + +#: sphinx/writers/latex.py:689 +msgid "Continued on next page" +msgstr "A következÅ‘ oldalon folytatódik" + +#: sphinx/writers/manpage.py:233 sphinx/writers/text.py:438 +#, python-format +msgid "[image: %s]" +msgstr "[image: %s]" + +#: sphinx/writers/manpage.py:234 sphinx/writers/text.py:439 +msgid "[image]" +msgstr "[image]" + +#: tests/test_build_gettext.py:81 +msgid "Testing various markup" +msgstr "Különféte leÃró tesztelése" + 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/nb_NO/LC_MESSAGES/sphinx.po b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po new file mode 100644 index 00000000..05893a88 --- /dev/null +++ b/sphinx/locale/nb_NO/LC_MESSAGES/sphinx.po @@ -0,0 +1,764 @@ + +msgid "" +msgstr "" +"Project-Id-Version: \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: Espen Høgbakk <espen@hogbakk.no>\n" +"Language-Team: \n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\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 +msgid "%s %s documentation" +msgstr "" + +#: sphinx/environment.py:119 sphinx/writers/latex.py:190 +#: sphinx/writers/manpage.py:67 sphinx/writers/texinfo.py:203 +#, python-format +msgid "%B %d, %Y" +msgstr "%B %d, %Y" + +#: sphinx/environment.py:1625 +#, python-format +msgid "see %s" +msgstr "se %s" + +#: sphinx/environment.py:1628 +#, python-format +msgid "see also %s" +msgstr "se ogsÃ¥ %s" + +#: sphinx/roles.py:175 +#, python-format +msgid "Python Enhancement Proposals; PEP %s" +msgstr "Python Enhancement Proposals; PEP %s" + +#: sphinx/builders/changes.py:73 +msgid "Builtins" +msgstr "Innebygde" + +#: sphinx/builders/changes.py:75 +msgid "Module level" +msgstr "ModulnivÃ¥" + +#: sphinx/builders/html.py:274 +#, python-format +msgid "%b %d, %Y" +msgstr "%b %d, %Y" + +#: sphinx/builders/html.py:293 sphinx/themes/basic/defindex.html:30 +msgid "General Index" +msgstr "Hovedindex" + +#: sphinx/builders/html.py:293 +msgid "index" +msgstr "index" + +#: sphinx/builders/html.py:353 +msgid "next" +msgstr "neste" + +#: sphinx/builders/html.py:362 +msgid "previous" +msgstr "forrige" + +#: sphinx/builders/latex.py:141 sphinx/builders/texinfo.py:196 +msgid " (in " +msgstr "(i " + +#: sphinx/directives/other.py:136 +msgid "Section author: " +msgstr "Seksjon forfatter: " + +#: sphinx/directives/other.py:138 +msgid "Module author: " +msgstr "Modul forfattar: " + +#: sphinx/directives/other.py:140 +msgid "Code author: " +msgstr "Kildekode forfatter: " + +#: sphinx/directives/other.py:142 +msgid "Author: " +msgstr "Forfatter: " + +#: sphinx/directives/other.py:215 +msgid "See also" +msgstr "Se ogsÃ¥" + +#: sphinx/domains/__init__.py:244 +#, python-format +msgid "%s %s" +msgstr "%s %s" + +#: sphinx/domains/c.py:51 sphinx/domains/python.py:95 +msgid "Parameters" +msgstr "Parametere" + +#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:128 +#: sphinx/domains/python.py:107 +msgid "Returns" +msgstr "Returnere" + +#: sphinx/domains/c.py:56 sphinx/domains/python.py:109 +msgid "Return type" +msgstr "Retur type" + +#: sphinx/domains/c.py:141 +#, python-format +msgid "%s (C function)" +msgstr "%s (C-funktion)" + +#: sphinx/domains/c.py:143 +#, python-format +msgid "%s (C member)" +msgstr "%s (C-medlem)" + +#: sphinx/domains/c.py:145 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C-makro)" + +#: sphinx/domains/c.py:147 +#, python-format +msgid "%s (C type)" +msgstr "%s (C-type)" + +#: sphinx/domains/c.py:149 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C-variabel)" + +#: sphinx/domains/c.py:204 sphinx/domains/cpp.py:1060 +#: sphinx/domains/javascript.py:162 sphinx/domains/python.py:559 +msgid "function" +msgstr "funksjon" + +#: sphinx/domains/c.py:205 sphinx/domains/cpp.py:1061 +msgid "member" +msgstr "medlem" + +#: sphinx/domains/c.py:206 +msgid "macro" +msgstr "makro" + +#: sphinx/domains/c.py:207 sphinx/domains/cpp.py:1062 +msgid "type" +msgstr "type" + +#: sphinx/domains/c.py:208 +msgid "variable" +msgstr "variabel" + +#: sphinx/domains/cpp.py:904 +#, python-format +msgid "%s (C++ class)" +msgstr "%s (C++ klasse)" + +#: sphinx/domains/cpp.py:919 +#, python-format +msgid "%s (C++ type)" +msgstr "%s (C++ type)" + +#: sphinx/domains/cpp.py:938 +#, python-format +msgid "%s (C++ member)" +msgstr "%s (C++ medlem)" + +#: sphinx/domains/cpp.py:990 +#, python-format +msgid "%s (C++ function)" +msgstr "%s (C++ funksjon)" + +#: sphinx/domains/cpp.py:1059 sphinx/domains/javascript.py:163 +#: sphinx/domains/python.py:561 +msgid "class" +msgstr "klasse" + +#: sphinx/domains/javascript.py:106 sphinx/domains/python.py:254 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (innebygd funksjon)" + +#: sphinx/domains/javascript.py:107 sphinx/domains/python.py:318 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (%s metode)" + +#: sphinx/domains/javascript.py:109 +#, python-format +msgid "%s() (class)" +msgstr "%s() (klasse)" + +#: sphinx/domains/javascript.py:111 +#, python-format +msgid "%s (global variable or constant)" +msgstr "%s (global variabel eller konstant)" + +#: sphinx/domains/javascript.py:113 sphinx/domains/python.py:356 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s (%s attribut)" + +#: sphinx/domains/javascript.py:122 +msgid "Arguments" +msgstr "Argument" + +#: sphinx/domains/javascript.py:125 +msgid "Throws" +msgstr "Kaster" + +#: sphinx/domains/javascript.py:164 sphinx/domains/python.py:560 +msgid "data" +msgstr "data" + +#: sphinx/domains/javascript.py:165 sphinx/domains/python.py:566 +msgid "attribute" +msgstr "attributt" + +#: sphinx/domains/python.py:100 +msgid "Variables" +msgstr "Variabler" + +#: sphinx/domains/python.py:104 +msgid "Raises" +msgstr "Hever" + +#: sphinx/domains/python.py:255 sphinx/domains/python.py:312 +#: sphinx/domains/python.py:324 sphinx/domains/python.py:337 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (i modul %s)" + +#: sphinx/domains/python.py:258 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s (innebygd variabel)" + +#: sphinx/domains/python.py:259 sphinx/domains/python.py:350 +#, python-format +msgid "%s (in module %s)" +msgstr "%s (i modul %s)" + +#: sphinx/domains/python.py:275 +#, python-format +msgid "%s (built-in class)" +msgstr "%s (innebygd klasse)" + +#: sphinx/domains/python.py:276 +#, python-format +msgid "%s (class in %s)" +msgstr "%s (klasse i %s)" + +#: sphinx/domains/python.py:316 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (%s.%s metode)" + +#: sphinx/domains/python.py:328 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (%s.%s statisk metode)" + +#: sphinx/domains/python.py:331 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (%s statisk metode)" + +#: sphinx/domains/python.py:341 +#, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (%s.%s klassemetode)" + +#: sphinx/domains/python.py:344 +#, python-format +msgid "%s() (%s class method)" +msgstr "%s() (%s klassemetode)" + +#: sphinx/domains/python.py:354 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s (%s.%s attributt)" + +#: sphinx/domains/python.py:434 +#, python-format +msgid "%s (module)" +msgstr "%s (modul)" + +#: sphinx/domains/python.py:491 +msgid "Python Module Index" +msgstr "Python Modulindex" + +#: sphinx/domains/python.py:492 +msgid "modules" +msgstr "moduler" + +#: sphinx/domains/python.py:537 +msgid "Deprecated" +msgstr "Foreldet" + +#: sphinx/domains/python.py:562 sphinx/locale/__init__.py:179 +msgid "exception" +msgstr "untak" + +#: sphinx/domains/python.py:563 +msgid "method" +msgstr "metode" + +#: sphinx/domains/python.py:564 +msgid "class method" +msgstr "klassemetode" + +#: sphinx/domains/python.py:565 +msgid "static method" +msgstr "statisk metode" + +#: sphinx/domains/python.py:567 sphinx/locale/__init__.py:175 +msgid "module" +msgstr "modul" + +#: sphinx/domains/python.py:695 +msgid " (deprecated)" +msgstr " (foreldet)" + +#: sphinx/domains/rst.py:55 +#, python-format +msgid "%s (directive)" +msgstr "%s (direktiv)" + +#: sphinx/domains/rst.py:57 +#, python-format +msgid "%s (role)" +msgstr "%s (rolle)" + +#: sphinx/domains/rst.py:106 +msgid "directive" +msgstr "direktiv" + +#: sphinx/domains/rst.py:107 +msgid "role" +msgstr "rolle" + +#: sphinx/domains/std.py:70 sphinx/domains/std.py:86 +#, python-format +msgid "environment variable; %s" +msgstr "miljøvariabel; %s" + +#: sphinx/domains/std.py:162 +#, python-format +msgid "%scommand line option; %s" +msgstr "%skommandolinje valg; %s" + +#: sphinx/domains/std.py:393 +msgid "glossary term" +msgstr "ordliste" + +#: sphinx/domains/std.py:394 +msgid "grammar token" +msgstr "grammatikk token" + +#: sphinx/domains/std.py:395 +msgid "reference label" +msgstr "referanse-etikett" + +#: sphinx/domains/std.py:396 +msgid "environment variable" +msgstr "miljøvariabel" + +#: sphinx/domains/std.py:397 +msgid "program option" +msgstr "programvalg" + +#: sphinx/domains/std.py:427 sphinx/themes/basic/genindex-single.html:32 +#: sphinx/themes/basic/genindex-split.html:11 +#: sphinx/themes/basic/genindex-split.html:14 +#: 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 +msgid "Index" +msgstr "Index" + +#: sphinx/domains/std.py:428 +msgid "Module Index" +msgstr "Modulindex" + +#: sphinx/domains/std.py:429 sphinx/themes/basic/defindex.html:25 +msgid "Search Page" +msgstr "Søkeside" + +#: sphinx/ext/autodoc.py:1002 +#, python-format +msgid " Bases: %s" +msgstr " Baser: %s" + +#: sphinx/ext/autodoc.py:1038 +#, python-format +msgid "alias of :class:`%s`" +msgstr "alias for :class:`%s`" + +#: sphinx/ext/todo.py:41 +msgid "Todo" +msgstr "Todo" + +#: sphinx/ext/todo.py:109 +#, python-format +msgid "(The <<original entry>> is located in %s, line %d.)" +msgstr "(Den <<opprinnelige oppføringen>> finnes i %s, pÃ¥ linje %d.)" + +#: sphinx/ext/todo.py:117 +msgid "original entry" +msgstr "opprinnelig oppføring" + +#: sphinx/ext/viewcode.py:70 +msgid "[source]" +msgstr "[kilde]" + +#: sphinx/ext/viewcode.py:117 +msgid "[docs]" +msgstr "[dokumentasjon]" + +#: sphinx/ext/viewcode.py:131 +msgid "Module code" +msgstr "Modul kildekode" + +#: sphinx/ext/viewcode.py:137 +#, python-format +msgid "<h1>Source code for %s</h1>" +msgstr "<h1>Kildekode for %s</h1>" + +#: sphinx/ext/viewcode.py:164 +msgid "Overview: module code" +msgstr "Oversikt: modulkildekode" + +#: sphinx/ext/viewcode.py:165 +msgid "<h1>All modules for which code is available</h1>" +msgstr "<h1>Alla moduler hvor kildekode finnes</h1>" + +#: sphinx/locale/__init__.py:155 +msgid "Attention" +msgstr "Obs" + +#: sphinx/locale/__init__.py:156 +msgid "Caution" +msgstr "Advarsel" + +#: sphinx/locale/__init__.py:157 +msgid "Danger" +msgstr "Fare" + +#: sphinx/locale/__init__.py:158 +msgid "Error" +msgstr "Feil" + +#: sphinx/locale/__init__.py:159 +msgid "Hint" +msgstr "Hint" + +#: sphinx/locale/__init__.py:160 +msgid "Important" +msgstr "Viktig" + +#: sphinx/locale/__init__.py:161 +msgid "Note" +msgstr "Obs" + +#: sphinx/locale/__init__.py:162 +msgid "See Also" +msgstr "Se ogsÃ¥" + +#: sphinx/locale/__init__.py:163 +msgid "Tip" +msgstr "Tips" + +#: sphinx/locale/__init__.py:164 +msgid "Warning" +msgstr "Advarsel" + +#: sphinx/locale/__init__.py:168 +#, python-format +msgid "New in version %s" +msgstr "Nytt i version %s" + +#: sphinx/locale/__init__.py:169 +#, python-format +msgid "Changed in version %s" +msgstr "Endret i version %s" + +#: sphinx/locale/__init__.py:170 +#, python-format +msgid "Deprecated since version %s" +msgstr "Foreldet siden version %s" + +#: sphinx/locale/__init__.py:176 +msgid "keyword" +msgstr "nøkkelord" + +#: sphinx/locale/__init__.py:177 +msgid "operator" +msgstr "operator" + +#: sphinx/locale/__init__.py:178 +msgid "object" +msgstr "objekt" + +#: sphinx/locale/__init__.py:180 +msgid "statement" +msgstr "uttrykk" + +#: sphinx/locale/__init__.py:181 +msgid "built-in function" +msgstr "innebygde funksjoner" + +#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 +#: sphinx/themes/basic/localtoc.html:11 +msgid "Table Of Contents" +msgstr "Innholdsfortegnelse" + +#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:137 +#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:20 +msgid "Search" +msgstr "Søk" + +#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15 +msgid "Go" +msgstr "GÃ¥" + +#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20 +msgid "Enter search terms or a module, class or function name." +msgstr "Angi søkeord eller modul-, klasse- eller funksjonsnavn." + +#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 +msgid "Show Source" +msgstr "Vis kildekode" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Overview" +msgstr "Oversikt" + +#: sphinx/themes/basic/defindex.html:20 +msgid "Indices and tables:" +msgstr "Index og tabeller" + +#: sphinx/themes/basic/defindex.html:23 +msgid "Complete Table of Contents" +msgstr "Komplett Innholdsfortegnelse" + +#: sphinx/themes/basic/defindex.html:24 +msgid "lists all sections and subsections" +msgstr "liste over alle paragrafer og underparagrafer" + +#: sphinx/themes/basic/defindex.html:26 +msgid "search this documentation" +msgstr "søk i dette dokumentet" + +#: sphinx/themes/basic/defindex.html:28 +msgid "Global Module Index" +msgstr "Global Modulindex" + +#: sphinx/themes/basic/defindex.html:29 +msgid "quick access to all modules" +msgstr "snarvei til alle moduler" + +#: sphinx/themes/basic/defindex.html:31 +msgid "all functions, classes, terms" +msgstr "alla funksjoner, klasser, vilkÃ¥r" + +#: sphinx/themes/basic/genindex-single.html:35 +#, python-format +msgid "Index – %(key)s" +msgstr "Index – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:63 +#: sphinx/themes/basic/genindex-split.html:24 +#: sphinx/themes/basic/genindex-split.html:38 +#: sphinx/themes/basic/genindex.html:74 +msgid "Full index on one page" +msgstr "Hele innholdsfortegnelsen pÃ¥ en side" + +#: sphinx/themes/basic/genindex-split.html:16 +msgid "Index pages by letter" +msgstr "Innholdsfortegnelse per bokstav" + +#: sphinx/themes/basic/genindex-split.html:25 +msgid "can be huge" +msgstr "kan bli stor" + +#: sphinx/themes/basic/layout.html:29 +msgid "Navigation" +msgstr "Navigering" + +#: sphinx/themes/basic/layout.html:122 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Søk blant %(docstitle)s" + +#: sphinx/themes/basic/layout.html:131 +msgid "About these documents" +msgstr "Om disse dokumenter" + +#: sphinx/themes/basic/layout.html:140 +msgid "Copyright" +msgstr "Copyright" + +#: 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." + +#: sphinx/themes/basic/layout.html:191 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/themes/basic/layout.html:195 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Sist oppdatert %(last_updated)s." + +#: sphinx/themes/basic/layout.html:198 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "" +"Lagd med <a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s." + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "Søk %(docstitle)s" + +#: sphinx/themes/basic/relations.html:11 +msgid "Previous topic" +msgstr "Forrige tittel" + +#: sphinx/themes/basic/relations.html:13 +msgid "previous chapter" +msgstr "Forrige kapittel" + +#: sphinx/themes/basic/relations.html:16 +msgid "Next topic" +msgstr "Neste emne" + +#: sphinx/themes/basic/relations.html:18 +msgid "next chapter" +msgstr "neste kapittel" + +#: sphinx/themes/basic/search.html:24 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "Vennligst aktiver JavaScript for Ã¥ aktivere søk." + +#: sphinx/themes/basic/search.html:29 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"her kan du søke blant disse dokumentene. Angi søkeord nedfor og " +"klikk \"søk\".\n" +" Søket mÃ¥ treffe pÃ¥ samtlige søkeord." + +#: sphinx/themes/basic/search.html:36 +msgid "search" +msgstr "søk" + +#: sphinx/themes/basic/search.html:40 +msgid "Search Results" +msgstr "Søkeresultat" + +#: sphinx/themes/basic/search.html:42 +msgid "Your search did not match any results." +msgstr "Ditt søk ga ingen resultater." + +#: sphinx/themes/basic/searchbox.html:12 +msgid "Quick search" +msgstr "Hurtigsøk" + +#: sphinx/themes/basic/sourcelink.html:11 +msgid "This Page" +msgstr "Denne siden" + +#: 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 "Endringer i version %(version)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +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 "Automatisk generert liste over endringer i versjon %(version)s" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Endringer i biblioteket" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Endringer i C API" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Andre endringer" + +#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:504 +#: sphinx/writers/html.py:510 +msgid "Permalink to this headline" +msgstr "Permalink til denne oversikten" + +#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:92 +msgid "Permalink to this definition" +msgstr "Permalink til denne definisjonen" + +#: sphinx/themes/basic/static/doctools.js:189 +msgid "Hide Search Matches" +msgstr "Skjul søkeresultat" + +#: sphinx/themes/default/static/sidebar.js:69 +msgid "Expand sidebar" +msgstr "Utvid sidepanelet" + +#: sphinx/themes/default/static/sidebar.js:82 +#: sphinx/themes/default/static/sidebar.js:110 +msgid "Collapse sidebar" +msgstr "Skjul sidepanelet" + +#: sphinx/themes/haiku/layout.html:26 +msgid "Contents" +msgstr "Innhold" + +#: sphinx/writers/latex.py:177 +msgid "Release" +msgstr "Utgivelse" + +#: sphinx/writers/latex.py:594 sphinx/writers/manpage.py:182 +#: sphinx/writers/texinfo.py:589 +msgid "Footnotes" +msgstr "Fotnoter" + +#: sphinx/writers/latex.py:676 +msgid "continued from previous page" +msgstr "fortsettelse fra forrige side" + +#: sphinx/writers/latex.py:681 +msgid "Continued on next page" +msgstr "Fortsetter pÃ¥ neste side" + +#: sphinx/writers/text.py:437 +msgid "[image]" +msgstr "[bilde]" 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 9dc24c83..3ded0ab0 100644 --- a/sphinx/locale/ne/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/ne/LC_MESSAGES/sphinx.po @@ -628,7 +628,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/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/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 new file mode 100644 index 00000000..9c2d6a75 --- /dev/null +++ b/sphinx/locale/sk/LC_MESSAGES/sphinx.js @@ -0,0 +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": "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 differnew file mode 100644 index 00000000..375159dc --- /dev/null +++ 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 new file mode 100644 index 00000000..fdc5e137 --- /dev/null +++ b/sphinx/locale/sk/LC_MESSAGES/sphinx.po @@ -0,0 +1,778 @@ +# Slovak translations for Sphinx. +# Copyright (C) 2008 ORGANIZATION +# This file is distributed under the same license as the Sphinx project. +# FIRST AUTHOR <EMAIL@ADDRESS>, 2008. +# +msgid "" +msgstr "" +"Project-Id-Version: Sphinx 0.5\n" +"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n" +"POT-Creation-Date: 2011-11-26 13:53+0200\n" +"PO-Revision-Date: 2011-11-26 14:00+0100\n" +"Last-Translator: Jozef Sevcik <sevcik@codescale.net>\n" +"Language-Team: Jozef Sevcik <sevcik@codescale.net>\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" +"MIME-Version: 1.0\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 +msgid "%s %s documentation" +msgstr "%s %s dokumentácia" + +#: sphinx/environment.py:119 sphinx/writers/latex.py:190 +#: sphinx/writers/manpage.py:67 sphinx/writers/texinfo.py:203 +#, python-format +msgid "%B %d, %Y" +msgstr "%d.%m.%Y" + +#: sphinx/environment.py:1625 +#, fuzzy, python-format +msgid "see %s" +msgstr "viz %s" + +#: sphinx/environment.py:1628 +#, fuzzy, python-format +msgid "see also %s" +msgstr "viz tiež %s" + +#: sphinx/roles.py:175 +#, python-format +msgid "Python Enhancement Proposals; PEP %s" +msgstr "Python Enhancement Proposals; PEP %s" + +#: sphinx/builders/changes.py:73 +msgid "Builtins" +msgstr "Zabudované funkcie" + +#: sphinx/builders/changes.py:75 +msgid "Module level" +msgstr "Úroveň modulov" + +#: sphinx/builders/html.py:274 +#, python-format +msgid "%b %d, %Y" +msgstr "%d.%m.%Y" + +#: sphinx/builders/html.py:293 sphinx/themes/basic/defindex.html:30 +msgid "General Index" +msgstr "Register indexov" + +#: sphinx/builders/html.py:293 +msgid "index" +msgstr "index" + +#: sphinx/builders/html.py:353 +msgid "next" +msgstr "ÄalÅ¡Ã" + +#: sphinx/builders/html.py:362 +msgid "previous" +msgstr "predchádzajúci" + +#: sphinx/builders/latex.py:141 sphinx/builders/texinfo.py:196 +msgid " (in " +msgstr "(v" + +#: sphinx/directives/other.py:136 +msgid "Section author: " +msgstr "Autor sekcie: " + +#: sphinx/directives/other.py:138 +msgid "Module author: " +msgstr "Autor modulu: " + +#: sphinx/directives/other.py:140 +#, fuzzy +msgid "Code author: " +msgstr "Autor modulu: " + +#: sphinx/directives/other.py:142 +msgid "Author: " +msgstr "Autor: " + +#: sphinx/directives/other.py:215 +msgid "See also" +msgstr "Viz tiež" + +#: sphinx/domains/__init__.py:244 +#, python-format +msgid "%s %s" +msgstr "" + +#: sphinx/domains/c.py:51 sphinx/domains/python.py:95 +msgid "Parameters" +msgstr "Parametre" + +#: sphinx/domains/c.py:54 sphinx/domains/javascript.py:128 +#: sphinx/domains/python.py:107 +msgid "Returns" +msgstr "Vracia" + +#: sphinx/domains/c.py:56 sphinx/domains/python.py:109 +msgid "Return type" +msgstr "Typ návratovej hodnoty" + +#: sphinx/domains/c.py:141 +#, python-format +msgid "%s (C function)" +msgstr "%s (C funkcia)" + +#: sphinx/domains/c.py:143 +#, python-format +msgid "%s (C member)" +msgstr "%s (Älen C)" + +#: sphinx/domains/c.py:145 +#, python-format +msgid "%s (C macro)" +msgstr "%s (C makro)" + +#: sphinx/domains/c.py:147 +#, python-format +msgid "%s (C type)" +msgstr "%s (C typ)" + +#: sphinx/domains/c.py:149 +#, python-format +msgid "%s (C variable)" +msgstr "%s (C premenná)" + +#: sphinx/domains/c.py:204 sphinx/domains/cpp.py:1060 +#: sphinx/domains/javascript.py:162 sphinx/domains/python.py:559 +msgid "function" +msgstr "funkcia" + +#: sphinx/domains/c.py:205 sphinx/domains/cpp.py:1061 +msgid "member" +msgstr "Älen" + +#: sphinx/domains/c.py:206 +msgid "macro" +msgstr "" + +#: sphinx/domains/c.py:207 sphinx/domains/cpp.py:1062 +msgid "type" +msgstr "typ" + +#: sphinx/domains/c.py:208 +#, fuzzy +msgid "variable" +msgstr "Premenná" + +#: sphinx/domains/cpp.py:904 +#, python-format +msgid "%s (C++ class)" +msgstr "%s (C++ trieda)" + +#: sphinx/domains/cpp.py:919 +#, python-format +msgid "%s (C++ type)" +msgstr "%s (C++ typ)" + +#: sphinx/domains/cpp.py:938 +#, python-format +msgid "%s (C++ member)" +msgstr "%s (Älen C++)" + +#: sphinx/domains/cpp.py:990 +#, python-format +msgid "%s (C++ function)" +msgstr "%s (C++ funkcia)" + +#: sphinx/domains/cpp.py:1059 sphinx/domains/javascript.py:163 +#: sphinx/domains/python.py:561 +msgid "class" +msgstr "trieda" + +#: sphinx/domains/javascript.py:106 sphinx/domains/python.py:254 +#, python-format +msgid "%s() (built-in function)" +msgstr "%s() (zabudovaná funkcia)" + +#: sphinx/domains/javascript.py:107 sphinx/domains/python.py:318 +#, python-format +msgid "%s() (%s method)" +msgstr "%s() (metóda %s)" + +#: sphinx/domains/javascript.py:109 +#, python-format +msgid "%s() (class)" +msgstr "%s() (trieda)" + +#: sphinx/domains/javascript.py:111 +#, python-format +msgid "%s (global variable or constant)" +msgstr "" + +#: sphinx/domains/javascript.py:113 sphinx/domains/python.py:356 +#, python-format +msgid "%s (%s attribute)" +msgstr "%s() (atribút %s)" + +#: sphinx/domains/javascript.py:122 +#, fuzzy +msgid "Arguments" +msgstr "Parametre" + +#: sphinx/domains/javascript.py:125 +msgid "Throws" +msgstr "" + +#: sphinx/domains/javascript.py:164 sphinx/domains/python.py:560 +msgid "data" +msgstr "" + +#: sphinx/domains/javascript.py:165 sphinx/domains/python.py:566 +msgid "attribute" +msgstr "atribút" + +#: sphinx/domains/python.py:100 +#, fuzzy +msgid "Variables" +msgstr "Premenná" + +#: sphinx/domains/python.py:104 +msgid "Raises" +msgstr "Vyvolá" + +#: sphinx/domains/python.py:255 sphinx/domains/python.py:312 +#: sphinx/domains/python.py:324 sphinx/domains/python.py:337 +#, python-format +msgid "%s() (in module %s)" +msgstr "%s() (v module %s)" + +#: sphinx/domains/python.py:258 +#, python-format +msgid "%s (built-in variable)" +msgstr "%s() (zabudovaná premenná)" + +#: sphinx/domains/python.py:259 sphinx/domains/python.py:350 +#, python-format +msgid "%s (in module %s)" +msgstr "%s() (v module %s)" + +#: sphinx/domains/python.py:275 +#, python-format +msgid "%s (built-in class)" +msgstr "%s () (zabudovaná premenná)" + +#: sphinx/domains/python.py:276 +#, python-format +msgid "%s (class in %s)" +msgstr "%s() (trieda v %s)" + +#: sphinx/domains/python.py:316 +#, python-format +msgid "%s() (%s.%s method)" +msgstr "%s() (metoda %s.%s)" + +#: sphinx/domains/python.py:328 +#, python-format +msgid "%s() (%s.%s static method)" +msgstr "%s() (statická metóda %s.%s)" + +#: sphinx/domains/python.py:331 +#, python-format +msgid "%s() (%s static method)" +msgstr "%s() (statická metóda %s)" + +#: sphinx/domains/python.py:341 +#, fuzzy, python-format +msgid "%s() (%s.%s class method)" +msgstr "%s() (metóda %s.%s)" + +#: sphinx/domains/python.py:344 +#, fuzzy, python-format +msgid "%s() (%s class method)" +msgstr "%s() (metóda %s)" + +#: sphinx/domains/python.py:354 +#, python-format +msgid "%s (%s.%s attribute)" +msgstr "%s() (atribút %s.%s)" + +#: sphinx/domains/python.py:434 +#, python-format +msgid "%s (module)" +msgstr "%s (module)" + +#: sphinx/domains/python.py:491 +#, fuzzy +msgid "Python Module Index" +msgstr "Register modulov" + +#: sphinx/domains/python.py:492 +msgid "modules" +msgstr "moduly" + +#: sphinx/domains/python.py:537 +msgid "Deprecated" +msgstr "Zastaralé" + +#: sphinx/domains/python.py:562 sphinx/locale/__init__.py:179 +msgid "exception" +msgstr "výnimka" + +#: sphinx/domains/python.py:563 +msgid "method" +msgstr "" + +#: sphinx/domains/python.py:564 +msgid "class method" +msgstr "" + +#: sphinx/domains/python.py:565 +msgid "static method" +msgstr "statická metóda" + +#: sphinx/domains/python.py:567 sphinx/locale/__init__.py:175 +msgid "module" +msgstr "modul" + +#: sphinx/domains/python.py:695 +msgid " (deprecated)" +msgstr " (zastaralé)" + +#: sphinx/domains/rst.py:55 +#, python-format +msgid "%s (directive)" +msgstr "" + +#: sphinx/domains/rst.py:57 +#, python-format +msgid "%s (role)" +msgstr "" + +#: sphinx/domains/rst.py:106 +msgid "directive" +msgstr "" + +#: sphinx/domains/rst.py:107 +msgid "role" +msgstr "" + +#: sphinx/domains/std.py:70 sphinx/domains/std.py:86 +#, python-format +msgid "environment variable; %s" +msgstr "premenná prostredia, %s" + +#: sphinx/domains/std.py:162 +#, python-format +msgid "%scommand line option; %s" +msgstr "%s parametre prÃkazového riadku; %s" + +#: sphinx/domains/std.py:393 +msgid "glossary term" +msgstr "" + +#: sphinx/domains/std.py:394 +msgid "grammar token" +msgstr "" + +#: sphinx/domains/std.py:395 +msgid "reference label" +msgstr "" + +#: sphinx/domains/std.py:396 +msgid "environment variable" +msgstr "premenná prostredia" + +#: sphinx/domains/std.py:397 +msgid "program option" +msgstr "" + +#: sphinx/domains/std.py:427 sphinx/themes/basic/genindex-single.html:32 +#: sphinx/themes/basic/genindex-split.html:11 +#: sphinx/themes/basic/genindex-split.html:14 +#: 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 +msgid "Index" +msgstr "Index" + +#: sphinx/domains/std.py:428 +msgid "Module Index" +msgstr "Register modulov" + +#: sphinx/domains/std.py:429 sphinx/themes/basic/defindex.html:25 +msgid "Search Page" +msgstr "Vyhľadávacia stránka" + +#: sphinx/ext/autodoc.py:1002 +#, python-format +msgid " Bases: %s" +msgstr "" + +#: sphinx/ext/autodoc.py:1038 +#, python-format +msgid "alias of :class:`%s`" +msgstr "" + +#: sphinx/ext/todo.py:41 +msgid "Todo" +msgstr "Todo" + +#: sphinx/ext/todo.py:109 +#, fuzzy, python-format +msgid "(The <<original entry>> is located in %s, line %d.)" +msgstr "(Pôvodný záznam je v %s, riadok %d.)" + +#: sphinx/ext/todo.py:117 +msgid "original entry" +msgstr "" + +#: sphinx/ext/viewcode.py:70 +msgid "[source]" +msgstr "" + +#: sphinx/ext/viewcode.py:117 +msgid "[docs]" +msgstr "" + +#: sphinx/ext/viewcode.py:131 +#, fuzzy +msgid "Module code" +msgstr "modul" + +#: sphinx/ext/viewcode.py:137 +#, python-format +msgid "<h1>Source code for %s</h1>" +msgstr "" + +#: sphinx/ext/viewcode.py:164 +msgid "Overview: module code" +msgstr "" + +#: sphinx/ext/viewcode.py:165 +msgid "<h1>All modules for which code is available</h1>" +msgstr "" + +#: sphinx/locale/__init__.py:155 +msgid "Attention" +msgstr "Výstraha" + +#: sphinx/locale/__init__.py:156 +msgid "Caution" +msgstr "Upozornenie" + +#: sphinx/locale/__init__.py:157 +msgid "Danger" +msgstr "NebezpeÄenstvo" + +#: sphinx/locale/__init__.py:158 +msgid "Error" +msgstr "Chyba" + +#: sphinx/locale/__init__.py:159 +msgid "Hint" +msgstr "Rada" + +#: sphinx/locale/__init__.py:160 +msgid "Important" +msgstr "Dôležité" + +#: sphinx/locale/__init__.py:161 +msgid "Note" +msgstr "Poznámka" + +#: sphinx/locale/__init__.py:162 +msgid "See Also" +msgstr "Viz tiež" + +#: sphinx/locale/__init__.py:163 +msgid "Tip" +msgstr "Tip" + +#: sphinx/locale/__init__.py:164 +msgid "Warning" +msgstr "Varovanie" + +#: sphinx/locale/__init__.py:168 +#, python-format +msgid "New in version %s" +msgstr "Nové vo verzii %s" + +#: sphinx/locale/__init__.py:169 +#, python-format +msgid "Changed in version %s" +msgstr "Zmenené vo verzii %s" + +#: sphinx/locale/__init__.py:170 +#, python-format +msgid "Deprecated since version %s" +msgstr "Zastaralé od verzie %s" + +#: sphinx/locale/__init__.py:176 +msgid "keyword" +msgstr "klúÄové slovo" + +#: sphinx/locale/__init__.py:177 +msgid "operator" +msgstr "operátor" + +#: sphinx/locale/__init__.py:178 +msgid "object" +msgstr "objekt" + +#: sphinx/locale/__init__.py:180 +msgid "statement" +msgstr "prÃkaz" + +#: sphinx/locale/__init__.py:181 +msgid "built-in function" +msgstr "zabudovaná funkcia" + +#: sphinx/themes/agogo/layout.html:45 sphinx/themes/basic/globaltoc.html:10 +#: sphinx/themes/basic/localtoc.html:11 +msgid "Table Of Contents" +msgstr "Obsah" + +#: sphinx/themes/agogo/layout.html:49 sphinx/themes/basic/layout.html:137 +#: sphinx/themes/basic/search.html:11 sphinx/themes/basic/search.html:20 +msgid "Search" +msgstr "Hľadanie" + +#: sphinx/themes/agogo/layout.html:52 sphinx/themes/basic/searchbox.html:15 +msgid "Go" +msgstr "OK" + +#: sphinx/themes/agogo/layout.html:57 sphinx/themes/basic/searchbox.html:20 +msgid "Enter search terms or a module, class or function name." +msgstr "Zadaj názov modulu, triedy alebo funkcie." + +#: sphinx/themes/agogo/layout.html:78 sphinx/themes/basic/sourcelink.html:14 +msgid "Show Source" +msgstr "UkázaÅ¥ zdroj" + +#: sphinx/themes/basic/defindex.html:11 +msgid "Overview" +msgstr "Prehľad" + +#: sphinx/themes/basic/defindex.html:20 +msgid "Indices and tables:" +msgstr "Register a tabuľky:" + +#: sphinx/themes/basic/defindex.html:23 +msgid "Complete Table of Contents" +msgstr "Celkový obsah" + +#: sphinx/themes/basic/defindex.html:24 +msgid "lists all sections and subsections" +msgstr "zoznam vÅ¡etkých sekcià a podsekciÃ" + +#: sphinx/themes/basic/defindex.html:26 +msgid "search this documentation" +msgstr "prehľadaj túto dokumentáciu" + +#: sphinx/themes/basic/defindex.html:28 +msgid "Global Module Index" +msgstr "Celkový register modulov" + +#: sphinx/themes/basic/defindex.html:29 +msgid "quick access to all modules" +msgstr "rýchly prÃstup ku vÅ¡etkým modulom" + +#: sphinx/themes/basic/defindex.html:31 +msgid "all functions, classes, terms" +msgstr "vÅ¡etky funkcie, triedy, termÃny" + +#: sphinx/themes/basic/genindex-single.html:35 +#, python-format +msgid "Index – %(key)s" +msgstr "Index – %(key)s" + +#: sphinx/themes/basic/genindex-single.html:63 +#: sphinx/themes/basic/genindex-split.html:24 +#: sphinx/themes/basic/genindex-split.html:38 +#: sphinx/themes/basic/genindex.html:74 +msgid "Full index on one page" +msgstr "Celý index na jednej stránke" + +#: sphinx/themes/basic/genindex-split.html:16 +msgid "Index pages by letter" +msgstr "Index podľa pÃsmena" + +#: sphinx/themes/basic/genindex-split.html:25 +msgid "can be huge" +msgstr "môže byÅ¥ obrovský" + +#: sphinx/themes/basic/layout.html:29 +msgid "Navigation" +msgstr "Navigácia" + +#: sphinx/themes/basic/layout.html:122 +#, python-format +msgid "Search within %(docstitle)s" +msgstr "Hľadanie v %(docstitle)s" + +#: sphinx/themes/basic/layout.html:131 +msgid "About these documents" +msgstr "O týchto dokumentoch" + +#: sphinx/themes/basic/layout.html:140 +msgid "Copyright" +msgstr "VÅ¡etky práva vyhradené" + +#: 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." + +#: sphinx/themes/basic/layout.html:191 +#, python-format +msgid "© Copyright %(copyright)s." +msgstr "© Copyright %(copyright)s." + +#: sphinx/themes/basic/layout.html:195 +#, python-format +msgid "Last updated on %(last_updated)s." +msgstr "Aktualizované dňa %(last_updated)s." + +#: sphinx/themes/basic/layout.html:198 +#, python-format +msgid "" +"Created using <a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s." +msgstr "" +"Vytvorené pomocou <a href=\"http://sphinx-doc.org/\">Sphinx</a> " +"%(sphinx_version)s." + +#: sphinx/themes/basic/opensearch.xml:4 +#, python-format +msgid "Search %(docstitle)s" +msgstr "PrehľadaÅ¥ %(docstitle)s" + +#: sphinx/themes/basic/relations.html:11 +msgid "Previous topic" +msgstr "Predchádzajúca téma" + +#: sphinx/themes/basic/relations.html:13 +msgid "previous chapter" +msgstr "predchádzajúca kapitola" + +#: sphinx/themes/basic/relations.html:16 +msgid "Next topic" +msgstr "ÄŽalÅ¡ia téma" + +#: sphinx/themes/basic/relations.html:18 +msgid "next chapter" +msgstr "dalÅ¡ia kapitola" + +#: sphinx/themes/basic/search.html:24 +msgid "" +"Please activate JavaScript to enable the search\n" +" functionality." +msgstr "" + +#: sphinx/themes/basic/search.html:29 +msgid "" +"From here you can search these documents. Enter your search\n" +" words into the box below and click \"search\". Note that the search\n" +" function will automatically search for all of the words. Pages\n" +" containing fewer words won't appear in the result list." +msgstr "" +"Toto je vyhľadávacia stránka. Zadajte kľúÄové slová a kliknete na " +"\"hľadaj\". \n" +"Vyhľadávanie hľadá automaticky vÅ¡etky slová. Nebudú teda nájdené " +"stránky obsahujúce menej slov." + +#: sphinx/themes/basic/search.html:36 +msgid "search" +msgstr "hľadaj" + +#: sphinx/themes/basic/search.html:40 +msgid "Search Results" +msgstr "Výsledky vyhľadávania" + +#: sphinx/themes/basic/search.html:42 +msgid "Your search did not match any results." +msgstr "NiÄ nebolo nájdené." + +#: sphinx/themes/basic/searchbox.html:12 +msgid "Quick search" +msgstr "Rýchle vyhľadávanie" + +#: sphinx/themes/basic/sourcelink.html:11 +msgid "This Page" +msgstr "Táto stránka" + +#: 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 "Zmeny vo verzii %(version)s — %(docstitle)s" + +#: sphinx/themes/basic/changes/rstsource.html:5 +#, python-format +msgid "%(filename)s — %(docstitle)s" +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 "Automaticky generovaný zoznam zmien vo verzii %(version)s" + +#: sphinx/themes/basic/changes/versionchanges.html:18 +msgid "Library changes" +msgstr "Zmeny v knižniciach" + +#: sphinx/themes/basic/changes/versionchanges.html:23 +msgid "C API changes" +msgstr "Zmeny API" + +#: sphinx/themes/basic/changes/versionchanges.html:25 +msgid "Other changes" +msgstr "Ostatné zmeny" + +#: sphinx/themes/basic/static/doctools.js:154 sphinx/writers/html.py:504 +#: sphinx/writers/html.py:510 +msgid "Permalink to this headline" +msgstr "Trvalý odkaz na tento nadpis" + +#: sphinx/themes/basic/static/doctools.js:160 sphinx/writers/html.py:92 +msgid "Permalink to this definition" +msgstr "Trvalý odkaz na túto definÃciu" + +#: sphinx/themes/basic/static/doctools.js:189 +msgid "Hide Search Matches" +msgstr "SkryÅ¥ výsledky vyhľadávania" + +#: sphinx/themes/default/static/sidebar.js:69 +msgid "Expand sidebar" +msgstr "" + +#: sphinx/themes/default/static/sidebar.js:82 +#: sphinx/themes/default/static/sidebar.js:110 +msgid "Collapse sidebar" +msgstr "" + +#: sphinx/themes/haiku/layout.html:26 +msgid "Contents" +msgstr "" + +#: sphinx/writers/latex.py:177 +msgid "Release" +msgstr "Vydanie" + +#: sphinx/writers/latex.py:594 sphinx/writers/manpage.py:182 +#: sphinx/writers/texinfo.py:589 +msgid "Footnotes" +msgstr "" + +#: sphinx/writers/latex.py:676 +msgid "continued from previous page" +msgstr "" + +#: sphinx/writers/latex.py:681 +#, fuzzy +msgid "Continued on next page" +msgstr "Celý index na jednej stránke" + +#: sphinx/writers/text.py:437 +msgid "[image]" +msgstr "[obrázok]" + 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/pycode/__init__.py b/sphinx/pycode/__init__.py index ef626f6d..073c1560 100644 --- a/sphinx/pycode/__init__.py +++ b/sphinx/pycode/__init__.py @@ -5,7 +5,7 @@ Utilities parsing and analyzing Python code. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/pycode/nodes.py b/sphinx/pycode/nodes.py index 7adacc1d..c1feb5b1 100644 --- a/sphinx/pycode/nodes.py +++ b/sphinx/pycode/nodes.py @@ -5,7 +5,7 @@ Parse tree node implementations. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/pygments_styles.py b/sphinx/pygments_styles.py index 44740b31..a8b0f123 100644 --- a/sphinx/pygments_styles.py +++ b/sphinx/pygments_styles.py @@ -5,7 +5,7 @@ Sphinx theme specific highlighting styles. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 86dc0476..8ac943a2 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -5,7 +5,7 @@ Quickly setup documentation source to work with Sphinx. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -309,6 +309,9 @@ epub_copyright = u'%(copyright_str)s' # A tuple containing the cover image and cover page html template filenames. #epub_cover = () +# A sequence of (type, uri, title) tuples for the guide element of content.opf. +#epub_guide = () + # HTML files that should be inserted before the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_pre_files = [] @@ -325,6 +328,12 @@ epub_copyright = u'%(copyright_str)s' # Allow duplicate toc entries. #epub_tocdup = True + +# Fix unsupported image types using the PIL. +#epub_fix_images = False + +# Scale large images. +#epub_max_image_width = 0 ''' INTERSPHINX_CONFIG = ''' @@ -368,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 @@ -392,18 +416,21 @@ 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)" clean: -\t-rm -rf $(BUILDDIR)/* +\trm -rf $(BUILDDIR)/* html: \t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @@ -473,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 @@ -516,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 = '''\ @@ -554,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 @@ -565,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 @@ -650,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 @@ -708,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 ''' @@ -759,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): @@ -786,14 +881,13 @@ def do_prompt(d, key, text, default=None, validator=nonempty): if sys.version_info >= (3, 0): # remove Unicode literal prefixes - _unicode_string_re = re.compile(r"[uU]('.*?')") - def _convert_python_source(source): - return _unicode_string_re.sub('\\1', source) + def _convert_python_source(source, rex=re.compile(r"[uU]('.*?')")): + return rex.sub('\\1', source) for f in ['QUICKSTART_CONF', 'EPUB_CONFIG', 'INTERSPHINX_CONFIG']: globals()[f] = _convert_python_source(globals()[f]) - del _unicode_string_re, _convert_python_source + del _convert_python_source def ask_user(d): diff --git a/sphinx/roles.py b/sphinx/roles.py index 312eec3f..02c5ad8f 100644 --- a/sphinx/roles.py +++ b/sphinx/roles.py @@ -5,7 +5,7 @@ Handlers for additional ReST roles. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -293,6 +293,7 @@ def index_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): entries = [('single', target, targetid, main)] indexnode = addnodes.index() indexnode['entries'] = entries + set_role_source_info(inliner, lineno, indexnode) textnode = nodes.Text(title, title) return [indexnode, targetnode, textnode], [] diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py index 6e9610a4..764c9208 100644 --- a/sphinx/search/__init__.py +++ b/sphinx/search/__init__.py @@ -5,13 +5,15 @@ Create a full-text search index for offline search. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ +from __future__ import with_statement import re +import itertools import cPickle as pickle -from docutils.nodes import comment, Text, NodeVisitor, SkipNode +from docutils.nodes import comment, title, Text, NodeVisitor, SkipNode from sphinx.util import jsdump, rpartition @@ -92,6 +94,7 @@ var Stemmer = function() { (ord(word[0]) < 256 and (len(word) < 3 or word in self.stopwords or word.isdigit()))) + from sphinx.search import en, ja languages = { @@ -137,13 +140,16 @@ class WordCollector(NodeVisitor): def __init__(self, document, lang): NodeVisitor.__init__(self, document) self.found_words = [] + self.found_title_words = [] self.lang = lang def dispatch_visit(self, node): if node.__class__ is comment: raise SkipNode - if node.__class__ is Text: + elif node.__class__ is Text: self.found_words.extend(self.lang.split(node.astext())) + elif node.__class__ is title: + self.found_title_words.extend(self.lang.split(node.astext())) class IndexBuilder(object): @@ -156,12 +162,14 @@ class IndexBuilder(object): 'pickle': pickle } - def __init__(self, env, lang, options): + def __init__(self, env, lang, options, scoring): self.env = env # filename -> title self._titles = {} # stemmed word -> set(filenames) self._mapping = {} + # stemmed words in titles -> set(filenames) + self._title_mapping = {} # objtype -> index self._objtypes = {} # objtype index -> (domain, type, objname (localized)) @@ -169,6 +177,12 @@ class IndexBuilder(object): # add language-specific SearchLanguage instance self.lang = languages[lang](options) + if scoring: + with open(scoring, 'rb') as fp: + self.js_scorer_code = fp.read().decode('utf-8') + else: + self.js_scorer_code = u'' + def load(self, stream, format): """Reconstruct from frozen data.""" if isinstance(format, basestring): @@ -179,12 +193,18 @@ class IndexBuilder(object): raise ValueError('old format') index2fn = frozen['filenames'] self._titles = dict(zip(index2fn, frozen['titles'])) - self._mapping = {} - for k, v in frozen['terms'].iteritems(): - if isinstance(v, int): - self._mapping[k] = set([index2fn[v]]) - else: - self._mapping[k] = set(index2fn[i] for i in v) + + def load_terms(mapping): + rv = {} + for k, v in mapping.iteritems(): + if isinstance(v, int): + rv[k] = set([index2fn[v]]) + else: + rv[k] = set(index2fn[i] for i in v) + return rv + + self._mapping = load_terms(frozen['terms']) + self._title_mapping = load_terms(frozen['titleterms']) # no need to load keywords/objtypes def dump(self, stream, format): @@ -229,28 +249,31 @@ class IndexBuilder(object): return rv def get_terms(self, fn2index): - rv = {} - for k, v in self._mapping.iteritems(): - if len(v) == 1: - fn, = v - if fn in fn2index: - rv[k] = fn2index[fn] - else: - rv[k] = [fn2index[fn] for fn in v if fn in fn2index] - return rv + rvs = {}, {} + for rv, mapping in zip(rvs, (self._mapping, self._title_mapping)): + for k, v in mapping.iteritems(): + if len(v) == 1: + fn, = v + if fn in fn2index: + rv[k] = fn2index[fn] + else: + rv[k] = [fn2index[fn] for fn in v if fn in fn2index] + return rvs def freeze(self): """Create a usable data structure for serializing.""" filenames = self._titles.keys() titles = self._titles.values() fn2index = dict((f, i) for (i, f) in enumerate(filenames)) - terms = self.get_terms(fn2index) + terms, title_terms = self.get_terms(fn2index) + objects = self.get_objects(fn2index) # populates _objtypes objtypes = dict((v, k[0] + ':' + k[1]) for (k, v) in self._objtypes.iteritems()) objnames = self._objnames return dict(filenames=filenames, titles=titles, terms=terms, - objects=objects, objtypes=objtypes, objnames=objnames) + objects=objects, objtypes=objtypes, objnames=objnames, + titleterms=title_terms) def prune(self, filenames): """Remove data for all filenames not in the list.""" @@ -261,6 +284,8 @@ class IndexBuilder(object): self._titles = new_titles for wordnames in self._mapping.itervalues(): wordnames.intersection_update(filenames) + for wordnames in self._title_mapping.itervalues(): + wordnames.intersection_update(filenames) def feed(self, filename, title, doctree): """Feed a doctree to the index.""" @@ -269,19 +294,24 @@ class IndexBuilder(object): visitor = WordCollector(doctree, self.lang) doctree.walk(visitor) - def add_term(word, stem=self.lang.stem): - word = stem(word) - if self.lang.word_filter(word): - self._mapping.setdefault(word, set()).add(filename) + stem = self.lang.stem + _filter = self.lang.word_filter - for word in self.lang.split(title): - add_term(word) + for word in itertools.chain(visitor.found_title_words, + self.lang.split(title)): + word = stem(word) + if _filter(word): + self._title_mapping.setdefault(word, set()).add(filename) for word in visitor.found_words: - add_term(word) + word = stem(word) + if word not in self._title_mapping and _filter(word): + self._mapping.setdefault(word, set()).add(filename) 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)), + search_scorer_tool = self.js_scorer_code, ) diff --git a/sphinx/search/en.py b/sphinx/search/en.py index 1f3c3731..9f3a9bf7 100644 --- a/sphinx/search/en.py +++ b/sphinx/search/en.py @@ -5,7 +5,7 @@ English search language: includes the JS porter stemmer. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/search/ja.py b/sphinx/search/ja.py index 0a7d83a1..c83c52ef 100644 --- a/sphinx/search/ja.py +++ b/sphinx/search/ja.py @@ -5,7 +5,7 @@ Japanese search language: includes routine to split words. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py index 2a8b2ed2..70358bbb 100644 --- a/sphinx/setup_command.py +++ b/sphinx/setup_command.py @@ -8,7 +8,7 @@ :author: Sebastian Wiesner :contact: basti.wiesner@gmx.net - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ 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..ce15591a 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 @@ -125,7 +137,7 @@ % Some custom font markup commands. % -\newcommand{\strong}[1]{{\bf #1}} +\newcommand{\strong}[1]{{\textbf{#1}}} \newcommand{\code}[1]{\texttt{#1}} \newcommand{\bfcode}[1]{\code{\bfseries#1}} \newcommand{\email}[1]{\textsf{#1}} @@ -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}% }} @@ -321,7 +333,7 @@ \@ifundefined{ChTitleVar}{}{ \ChNameVar{\raggedleft\normalsize\py@HeaderFamily} \ChNumVar{\raggedleft \bfseries\Large\py@HeaderFamily} - \ChTitleVar{\raggedleft \rm\Huge\py@HeaderFamily} + \ChTitleVar{\raggedleft \textrm{\Huge\py@HeaderFamily}} % This creates chapter heads without the leading \vspace*{}: \def\@makechapterhead#1{% {\parindent \z@ \raggedright \normalfont @@ -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/layout.html b/sphinx/themes/agogo/layout.html index d063194a..fde19dbc 100644 --- a/sphinx/themes/agogo/layout.html +++ b/sphinx/themes/agogo/layout.html @@ -5,10 +5,10 @@ Sphinx layout template for the agogo theme, originally written by Andi Albrecht. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {% block header %} <div class="header-wrapper"> diff --git a/sphinx/themes/agogo/static/agogo.css_t b/sphinx/themes/agogo/static/agogo.css_t index b069bd22..3fb81178 100644 --- a/sphinx/themes/agogo/static/agogo.css_t +++ b/sphinx/themes/agogo/static/agogo.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- agogo theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ 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/defindex.html b/sphinx/themes/basic/defindex.html index ce8d3af6..1ae9630d 100644 --- a/sphinx/themes/basic/defindex.html +++ b/sphinx/themes/basic/defindex.html @@ -4,10 +4,10 @@ Default template for the "index" page. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = _('Overview') %} {% block body %} <h1>{{ docstitle|e }}</h1> diff --git a/sphinx/themes/basic/domainindex.html b/sphinx/themes/basic/domainindex.html index 947a01ea..7f99da61 100644 --- a/sphinx/themes/basic/domainindex.html +++ b/sphinx/themes/basic/domainindex.html @@ -4,10 +4,10 @@ Template for domain indices (module index, ...). - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = indextitle %} {% block extrahead %} {{ super() }} diff --git a/sphinx/themes/basic/genindex-single.html b/sphinx/themes/basic/genindex-single.html index eff8c1ce..e7921251 100644 --- a/sphinx/themes/basic/genindex-single.html +++ b/sphinx/themes/basic/genindex-single.html @@ -4,7 +4,7 @@ Template for a "single" page of a split index. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% macro indexentries(firstname, links) %} @@ -28,7 +28,7 @@ </dt> {% endmacro %} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = _('Index') %} {% block body %} diff --git a/sphinx/themes/basic/genindex-split.html b/sphinx/themes/basic/genindex-split.html index 6da88a17..20c18068 100644 --- a/sphinx/themes/basic/genindex-split.html +++ b/sphinx/themes/basic/genindex-split.html @@ -4,10 +4,10 @@ Template for a "split" index overview page. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = _('Index') %} {% block body %} diff --git a/sphinx/themes/basic/genindex.html b/sphinx/themes/basic/genindex.html index 7bc002b6..dd2c96d8 100644 --- a/sphinx/themes/basic/genindex.html +++ b/sphinx/themes/basic/genindex.html @@ -4,7 +4,7 @@ Template for an "all-in-one" index. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {% macro indexentries(firstname, links) %} @@ -28,7 +28,7 @@ </dt> {% endmacro %} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = _('Index') %} {% block body %} diff --git a/sphinx/themes/basic/globaltoc.html b/sphinx/themes/basic/globaltoc.html index ee191faf..6d117f29 100644 --- a/sphinx/themes/basic/globaltoc.html +++ b/sphinx/themes/basic/globaltoc.html @@ -4,7 +4,7 @@ Sphinx sidebar template: global table of contents. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index 9fb989cb..9e4e39a1 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -4,7 +4,7 @@ Master layout template for Sphinx themes. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- block doctype -%} @@ -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/localtoc.html b/sphinx/themes/basic/localtoc.html index aa612ebf..23a31256 100644 --- a/sphinx/themes/basic/localtoc.html +++ b/sphinx/themes/basic/localtoc.html @@ -4,7 +4,7 @@ Sphinx sidebar template: local table of contents. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if display_toc %} diff --git a/sphinx/themes/basic/page.html b/sphinx/themes/basic/page.html index f6e7a688..185c6c85 100644 --- a/sphinx/themes/basic/page.html +++ b/sphinx/themes/basic/page.html @@ -4,10 +4,10 @@ Master template for simple pages. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% block body %} {{ body }} {% endblock %} diff --git a/sphinx/themes/basic/relations.html b/sphinx/themes/basic/relations.html index 82abbeaa..d7c5fa58 100644 --- a/sphinx/themes/basic/relations.html +++ b/sphinx/themes/basic/relations.html @@ -4,7 +4,7 @@ Sphinx sidebar template: relation links. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if prev %} diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html index 4cdc6935..011c2392 100644 --- a/sphinx/themes/basic/search.html +++ b/sphinx/themes/basic/search.html @@ -4,10 +4,10 @@ Template for the search page. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {% set title = _('Search') %} {% set script_files = script_files + ['_static/searchtools.js'] %} {% block extrahead %} diff --git a/sphinx/themes/basic/searchbox.html b/sphinx/themes/basic/searchbox.html index 13b453c4..609aac83 100644 --- a/sphinx/themes/basic/searchbox.html +++ b/sphinx/themes/basic/searchbox.html @@ -4,7 +4,7 @@ Sphinx sidebar template: quick search box. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if pagename != "search" %} diff --git a/sphinx/themes/basic/searchresults.html b/sphinx/themes/basic/searchresults.html index 667abffd..5c42fbae 100644 --- a/sphinx/themes/basic/searchresults.html +++ b/sphinx/themes/basic/searchresults.html @@ -4,7 +4,7 @@ Template for the body of the search results page. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} <h1 id="search-documentation">Search</h1> diff --git a/sphinx/themes/basic/sourcelink.html b/sphinx/themes/basic/sourcelink.html index 53f2f6b1..08232efc 100644 --- a/sphinx/themes/basic/sourcelink.html +++ b/sphinx/themes/basic/sourcelink.html @@ -4,7 +4,7 @@ Sphinx sidebar template: "show source" link. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} {%- if show_source and has_source and sourcename %} diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t index 2937fa49..b3e36db7 100644 --- a/sphinx/themes/basic/static/basic.css_t +++ b/sphinx/themes/basic/static/basic.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index d4619fdf..8614442e 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -32,7 +32,7 @@ if (!window.console || !console.firebug) { */ jQuery.urldecode = function(x) { return decodeURIComponent(x).replace(/\+/g, ' '); -} +}; /** * small helper function to urlencode strings @@ -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/jquery.js b/sphinx/themes/basic/static/jquery.js index 7c243080..198b3ff0 100644 --- a/sphinx/themes/basic/static/jquery.js +++ b/sphinx/themes/basic/static/jquery.js @@ -1,154 +1,4 @@ -/*! - * jQuery JavaScript Library v1.4.2 - * http://jquery.com/ - * - * Copyright 2010, John Resig - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * Includes Sizzle.js - * http://sizzlejs.com/ - * Copyright 2010, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * - * Date: Sat Feb 13 22:33:48 2010 -0500 - */ -(function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i? -e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r= -j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g, -"&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e= -true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/, -Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&& -(d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this, -a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b=== -"find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this, -function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)|| -c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded", -L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype, -"isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+ -a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f], -d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]=== -a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&& -!c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari= -true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; -var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected, -parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent= -false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n= -s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true, -applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando]; -else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this, -a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b=== -w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i, -cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ", -i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ", -" ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className= -this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i= -e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected= -c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed"); -a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g, -function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split("."); -k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a), -C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!= -null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type= -e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&& -f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive; -if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), -fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop|| -d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this, -"events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent= -a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y, -isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit= -{setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}}; -if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data", -e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a, -"_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a, -d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&& -!a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}}, -toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector, -u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "), -function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q]; -if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, -e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift(); -t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D|| -g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[]; -for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length- -1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/, -CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}}, -relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]= -l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[]; -h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()}, -CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m, -g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)}, -text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}}, -setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h= -h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m= -m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m=== -"="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g, -h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition|| -!h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m= -h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&& -q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>"; -if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}(); -(function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}: -function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/, -gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length; -c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j= -{},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a=== -"string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode", -d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")? -a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType=== -1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)? -a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= -c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, -wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, -prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, -this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); -return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja, -""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&& -this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]|| -u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length=== -1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]); -return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["", -""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e= -c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]? -c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja= -function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter= -Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a, -"border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f= -a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b= -a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!== -"string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this}, -serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), -function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href, -global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&& -e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)? -"&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache=== -false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B= -false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since", -c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E|| -d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x); -g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status=== -1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b=== -"json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional; -if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay"); -this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a], -"olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)}, -animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing= -j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]); -this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration=== -"number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]|| -c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start; -this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now= -this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem, -e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length|| -c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement? -function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b= -this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle; -k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&& -f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>"; -a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b); -c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a, -d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top- -f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset": -"pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in -e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window); +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"<!doctype html>":"")+"<html><body>"),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g<i;g++){if(g===1)for(h in a.converters)typeof h=="string"&&(e[h.toLowerCase()]=a.converters[h]);l=k,k=d[g];if(k==="*")k=l;else if(l!=="*"&&l!==k){m=l+" "+k,n=e[m]||e["* "+k];if(!n){p=b;for(o in e){j=o.split(" ");if(j[0]===l||j[0]==="*"){p=e[j[1]+" "+k];if(p){o=e[o],o===!0?n=p:p===!0&&(n=o);break}}}}!n&&!p&&f.error("No conversion from "+m.replace(" "," to ")),n!==!0&&(c=n?n(c):p(o(c)))}}return c}function cb(a,c,d){var e=a.contents,f=a.dataTypes,g=a.responseFields,h,i,j,k;for(i in g)i in d&&(c[g[i]]=d[i]);while(f[0]==="*")f.shift(),h===b&&(h=a.mimeType||c.getResponseHeader("content-type"));if(h)for(i in e)if(e[i]&&e[i].test(h)){f.unshift(i);break}if(f[0]in d)j=f[0];else{for(i in d){if(!f[0]||a.converters[i+" "+f[0]]){j=i;break}k||(k=i)}j=j||k}if(j){j!==f[0]&&f.unshift(j);return d[j]}}function ca(a,b,c,d){if(f.isArray(b))f.each(b,function(b,e){c||bE.test(a)?d(a,e):ca(a+"["+(typeof e=="object"||f.isArray(e)?b:"")+"]",e,c,d)});else if(!c&&b!=null&&typeof b=="object")for(var e in b)ca(a+"["+e+"]",b[e],c,d);else d(a,b)}function b_(a,c){var d,e,g=f.ajaxSettings.flatOptions||{};for(d in c)c[d]!==b&&((g[d]?a:e||(e={}))[d]=c[d]);e&&f.extend(!0,a,e)}function b$(a,c,d,e,f,g){f=f||c.dataTypes[0],g=g||{},g[f]=!0;var h=a[f],i=0,j=h?h.length:0,k=a===bT,l;for(;i<j&&(k||!l);i++)l=h[i](c,d,e),typeof l=="string"&&(!k||g[l]?l=b:(c.dataTypes.unshift(l),l=b$(a,c,d,e,l,g)));(k||!l)&&!g["*"]&&(l=b$(a,c,d,e,"*",g));return l}function bZ(a){return function(b,c){typeof b!="string"&&(c=b,b="*");if(f.isFunction(c)){var d=b.toLowerCase().split(bP),e=0,g=d.length,h,i,j;for(;e<g;e++)h=d[e],j=/^\+/.test(h),j&&(h=h.substr(1)||"*"),i=a[h]=a[h]||[],i[j?"unshift":"push"](c)}}}function bC(a,b,c){var d=b==="width"?a.offsetWidth:a.offsetHeight,e=b==="width"?bx:by,g=0,h=e.length;if(d>0){if(c!=="border")for(;g<h;g++)c||(d-=parseFloat(f.css(a,"padding"+e[g]))||0),c==="margin"?d+=parseFloat(f.css(a,c+e[g]))||0:d-=parseFloat(f.css(a,"border"+e[g]+"Width"))||0;return d+"px"}d=bz(a,b,b);if(d<0||d==null)d=a.style[b]||0;d=parseFloat(d)||0;if(c)for(;g<h;g++)d+=parseFloat(f.css(a,"padding"+e[g]))||0,c!=="padding"&&(d+=parseFloat(f.css(a,"border"+e[g]+"Width"))||0),c==="margin"&&(d+=parseFloat(f.css(a,c+e[g]))||0);return d+"px"}function bp(a,b){b.src?f.ajax({url:b.src,async:!1,dataType:"script"}):f.globalEval((b.text||b.textContent||b.innerHTML||"").replace(bf,"/*$0*/")),b.parentNode&&b.parentNode.removeChild(b)}function bo(a){var b=c.createElement("div");bh.appendChild(b),b.innerHTML=a.outerHTML;return b.firstChild}function bn(a){var b=(a.nodeName||"").toLowerCase();b==="input"?bm(a):b!=="script"&&typeof a.getElementsByTagName!="undefined"&&f.grep(a.getElementsByTagName("input"),bm)}function bm(a){if(a.type==="checkbox"||a.type==="radio")a.defaultChecked=a.checked}function bl(a){return typeof a.getElementsByTagName!="undefined"?a.getElementsByTagName("*"):typeof a.querySelectorAll!="undefined"?a.querySelectorAll("*"):[]}function bk(a,b){var c;if(b.nodeType===1){b.clearAttributes&&b.clearAttributes(),b.mergeAttributes&&b.mergeAttributes(a),c=b.nodeName.toLowerCase();if(c==="object")b.outerHTML=a.outerHTML;else if(c!=="input"||a.type!=="checkbox"&&a.type!=="radio"){if(c==="option")b.selected=a.defaultSelected;else if(c==="input"||c==="textarea")b.defaultValue=a.defaultValue}else a.checked&&(b.defaultChecked=b.checked=a.checked),b.value!==a.value&&(b.value=a.value);b.removeAttribute(f.expando)}}function bj(a,b){if(b.nodeType===1&&!!f.hasData(a)){var c,d,e,g=f._data(a),h=f._data(b,g),i=g.events;if(i){delete h.handle,h.events={};for(c in i)for(d=0,e=i[c].length;d<e;d++)f.event.add(b,c+(i[c][d].namespace?".":"")+i[c][d].namespace,i[c][d],i[c][d].data)}h.data&&(h.data=f.extend({},h.data))}}function bi(a,b){return f.nodeName(a,"table")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function U(a){var b=V.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function T(a,b,c){b=b||0;if(f.isFunction(b))return f.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return f.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=f.grep(a,function(a){return a.nodeType===1});if(O.test(b))return f.filter(b,d,!c);b=f.filter(b,d)}return f.grep(a,function(a,d){return f.inArray(a,b)>=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c<d;c++)b[a[c]]=!0;return b}var c=a.document,d=a.navigator,e=a.location,f=function(){function J(){if(!e.isReady){try{c.documentElement.doScroll("left")}catch(a){setTimeout(J,1);return}e.ready()}}var e=function(a,b){return new e.fn.init(a,b,h)},f=a.jQuery,g=a.$,h,i=/^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j<k;j++)if((a=arguments[j])!=null)for(c in a){d=i[c],f=a[c];if(i===f)continue;l&&f&&(e.isPlainObject(f)||(g=e.isArray(f)))?(g?(g=!1,h=d&&e.isArray(d)?d:[]):h=d&&e.isPlainObject(d)?d:{},i[c]=e.extend(l,h,f)):f!==b&&(i[c]=f)}return i},e.extend({noConflict:function(b){a.$===e&&(a.$=g),b&&a.jQuery===e&&(a.jQuery=f);return e},isReady:!1,readyWait:1,holdReady:function(a){a?e.readyWait++:e.ready(!0)},ready:function(a){if(a===!0&&!--e.readyWait||a!==!0&&!e.isReady){if(!c.body)return setTimeout(e.ready,1);e.isReady=!0;if(a!==!0&&--e.readyWait>0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g<h;)if(c.apply(a[g++],d)===!1)break}else if(i){for(f in a)if(c.call(a[f],f,a[f])===!1)break}else for(;g<h;)if(c.call(a[g],g,a[g++])===!1)break;return a},trim:G?function(a){return a==null?"":G.call(a)}:function(a){return a==null?"":(a+"").replace(k,"").replace(l,"")},makeArray:function(a,b){var c=b||[];if(a!=null){var d=e.type(a);a.length==null||d==="string"||d==="function"||d==="regexp"||e.isWindow(a)?E.call(c,a):e.merge(c,a)}return c},inArray:function(a,b,c){var d;if(b){if(H)return H.call(b,a,c);d=b.length,c=c?c<0?Math.max(0,d+c):c:0;for(;c<d;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,c){var d=a.length,e=0;if(typeof c.length=="number")for(var f=c.length;e<f;e++)a[d++]=c[e];else while(c[e]!==b)a[d++]=c[e++];a.length=d;return a},grep:function(a,b,c){var d=[],e;c=!!c;for(var f=0,g=a.length;f<g;f++)e=!!b(a[f],f),c!==e&&d.push(a[f]);return d},map:function(a,c,d){var f,g,h=[],i=0,j=a.length,k=a instanceof e||j!==b&&typeof j=="number"&&(j>0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i<j;i++)f=c(a[i],i,d),f!=null&&(h[h.length]=f);else for(g in a)f=c(a[g],g,d),f!=null&&(h[h.length]=f);return h.concat.apply([],h)},guid:1,proxy:function(a,c){if(typeof c=="string"){var d=a[c];c=a,a=d}if(!e.isFunction(a))return b;var f=F.call(arguments,2),g=function(){return a.apply(c,f.concat(F.call(arguments)))};g.guid=a.guid=a.guid||g.guid||e.guid++;return g},access:function(a,c,d,f,g,h){var i=a.length;if(typeof c=="object"){for(var j in c)e.access(a,j,c[j],f,g,d);return a}if(d!==b){f=!h&&f&&e.isFunction(d);for(var k=0;k<i;k++)g(a[k],c,f?d.call(a[k],k,g(a[k],c)):d,h);return a}return i?g(a[0],c):b},now:function(){return(new Date).getTime()},uaMatch:function(a){a=a.toLowerCase();var b=r.exec(a)||s.exec(a)||t.exec(a)||a.indexOf("compatible")<0&&u.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},sub:function(){function a(b,c){return new a.fn.init(b,c)}e.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function(d,f){f&&f instanceof e&&!(f instanceof a)&&(f=a(f));return e.fn.init.call(this,d,f,b)},a.fn.init.prototype=a.fn;var b=a(c);return a},browser:{}}),e.each("Boolean Number String Function Array Date RegExp Object".split(" "),function(a,b){I["[object "+b+"]"]=b.toLowerCase()}),z=e.uaMatch(y),z.browser&&(e.browser[z.browser]=!0,e.browser.version=z.version),e.browser.webkit&&(e.browser.safari=!0),j.test(" ")&&(k=/^[\s\xA0]+/,l=/[\s\xA0]+$/),h=e(c),c.addEventListener?B=function(){c.removeEventListener("DOMContentLoaded",B,!1),e.ready()}:c.attachEvent&&(B=function(){c.readyState==="complete"&&(c.detachEvent("onreadystatechange",B),e.ready())});return e}(),g={};f.Callbacks=function(a){a=a?g[a]||h(a):{};var c=[],d=[],e,i,j,k,l,m=function(b){var d,e,g,h,i;for(d=0,e=b.length;d<e;d++)g=b[d],h=f.type(g),h==="array"?m(g):h==="function"&&(!a.unique||!o.has(g))&&c.push(g)},n=function(b,f){f=f||[],e=!a.memory||[b,f],i=!0,l=j||0,j=0,k=c.length;for(;c&&l<k;l++)if(c[l].apply(b,f)===!1&&a.stopOnFalse){e=!0;break}i=!1,c&&(a.once?e===!0?o.disable():c=[]:d&&d.length&&(e=d.shift(),o.fireWith(e[0],e[1])))},o={add:function(){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this},remove:function(){if(c){var b=arguments,d=0,e=b.length;for(;d<e;d++)for(var f=0;f<c.length;f++)if(b[d]===c[f]){i&&f<=k&&(k--,f<=l&&l--),c.splice(f--,1);if(a.unique)break}}return this},has:function(a){if(c){var b=0,d=c.length;for(;b<d;b++)if(a===c[b])return!0}return!1},empty:function(){c=[];return this},disable:function(){c=d=e=b;return this},disabled:function(){return!c},lock:function(){d=b,(!e||e===!0)&&o.disable();return this},locked:function(){return!d},fireWith:function(b,c){d&&(i?a.once||d.push([b,c]):(!a.once||!e)&&n(b,c));return this},fire:function(){o.fireWith(this,arguments);return this},fired:function(){return!!e}};return o};var i=[].slice;f.extend({Deferred:function(a){var b=f.Callbacks("once memory"),c=f.Callbacks("once memory"),d=f.Callbacks("memory"),e="pending",g={resolve:b,reject:c,notify:d},h={done:b.add,fail:c.add,progress:d.add,state:function(){return e},isResolved:b.fired,isRejected:c.fired,then:function(a,b,c){i.done(a).fail(b).progress(c);return this},always:function(){i.done.apply(i,arguments).fail.apply(i,arguments);return this},pipe:function(a,b,c){return f.Deferred(function(d){f.each({done:[a,"resolve"],fail:[b,"reject"],progress:[c,"notify"]},function(a,b){var c=b[0],e=b[1],g;f.isFunction(c)?i[a](function(){g=c.apply(this,arguments),g&&f.isFunction(g.promise)?g.promise().then(d.resolve,d.reject,d.notify):d[e+"With"](this===i?d:this,[g])}):i[a](d[e])})}).promise()},promise:function(a){if(a==null)a=h;else for(var b in h)a[b]=h[b];return a}},i=h.promise({}),j;for(j in g)i[j]=g[j].fire,i[j+"With"]=g[j].fireWith;i.done(function(){e="resolved"},c.disable,d.lock).fail(function(){e="rejected"},b.disable,d.lock),a&&a.call(i,i);return i},when:function(a){function m(a){return function(b){e[a]=arguments.length>1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c<d;c++)b[c]&&b[c].promise&&f.isFunction(b[c].promise)?b[c].promise().then(l(c),j.reject,m(c)):--g;g||j.resolveWith(j,b)}else j!==a&&j.resolveWith(j,d?[a]:[]);return k}}),f.support=function(){var b,d,e,g,h,i,j,k,l,m,n,o,p,q=c.createElement("div"),r=c.documentElement;q.setAttribute("className","t"),q.innerHTML=" <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav></:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="<div "+n+"><div></div></div>"+"<table "+n+" cellpadding='0' cellspacing='0'>"+"<tr><td></td></tr></table>",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="<div style='width:4px;'></div>",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e<g;e++)delete d[b[e]];if(!(c?m:f.isEmptyObject)(d))return}}if(!c){delete j[k].data;if(!m(j[k]))return}f.support.deleteExpando||!j.setInterval?delete j[k]:j[k]=null,i&&(f.support.deleteExpando?delete a[h]:a.removeAttribute?a.removeAttribute(h):a[h]=null)}},_data:function(a,b,c){return f.data(a,b,c,!0)},acceptData:function(a){if(a.nodeName){var b=f.noData[a.nodeName.toLowerCase()];if(b)return b!==!0&&a.getAttribute("classid")===b}return!0}}),f.fn.extend({data:function(a,c){var d,e,g,h=null;if(typeof a=="undefined"){if(this.length){h=f.data(this[0]);if(this[0].nodeType===1&&!f._data(this[0],"parsedAttrs")){e=this[0].attributes;for(var i=0,j=e.length;i<j;i++)g=e[i].name,g.indexOf("data-")===0&&(g=f.camelCase(g.substring(5)),l(this[0],g,h[g]));f._data(this[0],"parsedAttrs",!0)}}return h}if(typeof a=="object")return this.each(function(){f.data(this,a)});d=a.split("."),d[1]=d[1]?"."+d[1]:"";if(c===b){h=this.triggerHandler("getData"+d[1]+"!",[d[0]]),h===b&&this.length&&(h=f.data(this[0],a),h=l(this[0],a,h));return h===b&&d[1]?this.data(d[0]):h}return this.each(function(){var b=f(this),e=[d[0],c];b.triggerHandler("setData"+d[1]+"!",e),f.data(this,a,c),b.triggerHandler("changeData"+d[1]+"!",e)})},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){typeof a!="string"&&(c=a,a="fx");if(c===b)return f.queue(this[0],a);return this.each(function(){var b=f.queue(this,a,c);a==="fx"&&b[0]!=="inprogress"&&f.dequeue(this,a)})},dequeue:function(a){return this.each(function(){f.dequeue(this,a)})},delay:function(a,b){a=f.fx?f.fx.speeds[a]||a:a,b=b||"fx";return this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,c){function m(){--h||d.resolveWith(e,[e])}typeof a!="string"&&(c=a,a=b),a=a||"fx";var d=f.Deferred(),e=this,g=e.length,h=1,i=a+"defer",j=a+"queue",k=a+"mark",l;while(g--)if(l=f.data(e[g],i,b,!0)||(f.data(e[g],j,b,!0)||f.data(e[g],k,b,!0))&&f.data(e[g],i,f.Callbacks("once memory"),!0))h++,l.add(m);m();return d.promise()}});var o=/[\n\t\r]/g,p=/\s+/,q=/\r/g,r=/^(?:button|input)$/i,s=/^(?:button|input|object|select|textarea)$/i,t=/^a(?:rea)?$/i,u=/^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,v=f.support.getSetAttribute,w,x,y;f.fn.extend({attr:function(a,b){return f.access(this,a,b,!0,f.attr)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,a,b,!0,f.prop)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c<d;c++){e=this[c];if(e.nodeType===1)if(!e.className&&b.length===1)e.className=a;else{g=" "+e.className+" ";for(h=0,i=b.length;h<i;h++)~g.indexOf(" "+b[h]+" ")||(g+=b[h]+" ");e.className=f.trim(g)}}}return this},removeClass:function(a){var c,d,e,g,h,i,j;if(f.isFunction(a))return this.each(function(b){f(this).removeClass(a.call(this,b,this.className))});if(a&&typeof a=="string"||a===b){c=(a||"").split(p);for(d=0,e=this.length;d<e;d++){g=this[d];if(g.nodeType===1&&g.className)if(a){h=(" "+g.className+" ").replace(o," ");for(i=0,j=c.length;i<j;i++)h=h.replace(" "+c[i]+" "," ");g.className=f.trim(h)}else g.className=""}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";if(f.isFunction(a))return this.each(function(c){f(this).toggleClass(a.call(this,c,this.className,b),b)});return this.each(function(){if(c==="string"){var e,g=0,h=f(this),i=b,j=a.split(p);while(e=j[g++])i=d?i:!h.hasClass(e),h[i?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&f._data(this,"__className__",this.className),this.className=this.className||a===!1?"":f._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c<d;c++)if(this[c].nodeType===1&&(" "+this[c].className+" ").replace(o," ").indexOf(b)>-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c<d;c++){e=i[c];if(e.selected&&(f.support.optDisabled?!e.disabled:e.getAttribute("disabled")===null)&&(!e.parentNode.disabled||!f.nodeName(e.parentNode,"optgroup"))){b=f(e).val();if(j)return b;h.push(b)}}if(j&&!h.length&&i.length)return f(i[g]).val();return h},set:function(a,b){var c=f.makeArray(b);f(a).find("option").each(function(){this.selected=f.inArray(f(this).val(),c)>=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h<g;h++)e=d[h],e&&(c=f.propFix[e]||e,f.attr(a,e,""),a.removeAttribute(v?e:c),u.test(e)&&c in a&&(a[c]=!1))}},attrHooks:{type:{set:function(a,b){if(r.test(a.nodeName)&&a.parentNode)f.error("type property can't be changed");else if(!f.support.radioValue&&b==="radio"&&f.nodeName(a,"input")){var c=a.value;a.setAttribute("type",b),c&&(a.value=c);return b}}},value:{get:function(a,b){if(w&&f.nodeName(a,"button"))return w.get(a,b);return b in a?a.value:null},set:function(a,b,c){if(w&&f.nodeName(a,"button"))return w.set(a,b,c);a.value=b}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(a,c,d){var e,g,h,i=a.nodeType;if(!!a&&i!==3&&i!==8&&i!==2){h=i!==1||!f.isXMLDoc(a),h&&(c=f.propFix[c]||c,g=f.propHooks[c]);return d!==b?g&&"set"in g&&(e=g.set(a,d,c))!==b?e:a[c]=d:g&&"get"in g&&(e=g.get(a,c))!==null?e:a[c]}},propHooks:{tabIndex:{get:function(a){var c=a.getAttributeNode("tabindex");return c&&c.specified?parseInt(c.value,10):s.test(a.nodeName)||t.test(a.nodeName)&&a.href?0:b}}}}),f.attrHooks.tabindex=f.propHooks.tabIndex,x={get:function(a,c){var d,e=f.prop(a,c);return e===!0||typeof e!="boolean"&&(d=a.getAttributeNode(c))&&d.nodeValue!==!1?c.toLowerCase():b},set:function(a,b,c){var d;b===!1?f.removeAttr(a,c):(d=f.propFix[c]||c,d in a&&(a[d]=!0),a.setAttribute(c,c.toLowerCase()));return c}},v||(y={name:!0,id:!0},w=f.valHooks.button={get:function(a,c){var d;d=a.getAttributeNode(c);return d&&(y[c]?d.nodeValue!=="":d.specified)?d.nodeValue:b},set:function(a,b,d){var e=a.getAttributeNode(d);e||(e=c.createAttribute(d),a.setAttributeNode(e));return e.nodeValue=b+""}},f.attrHooks.tabindex.set=w.set,f.each(["width","height"],function(a,b){f.attrHooks[b]=f.extend(f.attrHooks[b],{set:function(a,c){if(c===""){a.setAttribute(b,"auto");return c}}})}),f.attrHooks.contenteditable={get:w.get,set:function(a,b,c){b===""&&(b="false"),w.set(a,b,c)}}),f.support.hrefNormalized||f.each(["href","src","width","height"],function(a,c){f.attrHooks[c]=f.extend(f.attrHooks[c],{get:function(a){var d=a.getAttribute(c,2);return d===null?b:d}})}),f.support.style||(f.attrHooks.style={get:function(a){return a.style.cssText.toLowerCase()||b},set:function(a,b){return a.style.cssText=""+b}}),f.support.optSelected||(f.propHooks.selected=f.extend(f.propHooks.selected,{get:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex);return null}})),f.support.enctype||(f.propFix.enctype="encoding"),f.support.checkOn||f.each(["radio","checkbox"],function(){f.valHooks[this]={get:function(a){return a.getAttribute("value")===null?"on":a.value}}}),f.each(["radio","checkbox"],function(){f.valHooks[this]=f.extend(f.valHooks[this],{set:function(a,b){if(f.isArray(b))return a.checked=f.inArray(f(a).val(),b)>=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k<c.length;k++){l=A.exec(c[k])||[],m=l[1],n=(l[2]||"").split(".").sort(),s=f.event.special[m]||{},m=(g?s.delegateType:s.bindType)||m,s=f.event.special[m]||{},o=f.extend({type:m,origType:l[1],data:e,handler:d,guid:d.guid,selector:g,quick:G(g),namespace:n.join(".")},p),r=j[m];if(!r){r=j[m]=[],r.delegateCount=0;if(!s.setup||s.setup.call(a,e,n,i)===!1)a.addEventListener?a.addEventListener(m,i,!1):a.attachEvent&&a.attachEvent("on"+m,i)}s.add&&(s.add.call(a,o),o.handler.guid||(o.handler.guid=d.guid)),g?r.splice(r.delegateCount++,0,o):r.push(o),f.event.global[m]=!0}a=null}},global:{},remove:function(a,b,c,d,e){var g=f.hasData(a)&&f._data(a),h,i,j,k,l,m,n,o,p,q,r,s;if(!!g&&!!(o=g.events)){b=f.trim(I(b||"")).split(" ");for(h=0;h<b.length;h++){i=A.exec(b[h])||[],j=k=i[1],l=i[2];if(!j){for(j in o)f.event.remove(a,j+b[h],c,d,!0);continue}p=f.event.special[j]||{},j=(d?p.delegateType:p.bindType)||j,r=o[j]||[],m=r.length,l=l?new RegExp("(^|\\.)"+l.split(".").sort().join("\\.(?:.*\\.)?")+"(\\.|$)"):null;for(n=0;n<r.length;n++)s=r[n],(e||k===s.origType)&&(!c||c.guid===s.guid)&&(!l||l.test(s.namespace))&&(!d||d===s.selector||d==="**"&&s.selector)&&(r.splice(n--,1),s.selector&&r.delegateCount--,p.remove&&p.remove.call(a,s));r.length===0&&m!==r.length&&((!p.teardown||p.teardown.call(a,l)===!1)&&f.removeEvent(a,j,g.handle),delete o[j])}f.isEmptyObject(o)&&(q=g.handle,q&&(q.elem=null),f.removeData(a,["events","handle"],!0))}},customEvent:{getData:!0,setData:!0,changeData:!0},trigger:function(c,d,e,g){if(!e||e.nodeType!==3&&e.nodeType!==8){var h=c.type||c,i=[],j,k,l,m,n,o,p,q,r,s;if(E.test(h+f.event.triggered))return;h.indexOf("!")>=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;l<r.length&&!c.isPropagationStopped();l++)m=r[l][0],c.type=r[l][1],q=(f._data(m,"events")||{})[c.type]&&f._data(m,"handle"),q&&q.apply(m,d),q=o&&m[o],q&&f.acceptData(m)&&q.apply(m,d)===!1&&c.preventDefault();c.type=h,!g&&!c.isDefaultPrevented()&&(!p._default||p._default.apply(e.ownerDocument,d)===!1)&&(h!=="click"||!f.nodeName(e,"a"))&&f.acceptData(e)&&o&&e[h]&&(h!=="focus"&&h!=="blur"||c.target.offsetWidth!==0)&&!f.isWindow(e)&&(n=e[o],n&&(e[o]=null),f.event.triggered=h,e[h](),f.event.triggered=b,n&&(e[o]=n));return c.result}},dispatch:function(c){c=f.event.fix(c||a.event);var d=(f._data(this,"events")||{})[c.type]||[],e=d.delegateCount,g=[].slice.call(arguments,0),h=!c.exclusive&&!c.namespace,i=[],j,k,l,m,n,o,p,q,r,s,t;g[0]=c,c.delegateTarget=this;if(e&&!c.target.disabled&&(!c.button||c.type!=="click")){m=f(this),m.context=this.ownerDocument||this;for(l=c.target;l!=this;l=l.parentNode||this){o={},q=[],m[0]=l;for(j=0;j<e;j++)r=d[j],s=r.selector,o[s]===b&&(o[s]=r.quick?H(l,r.quick):m.is(s)),o[s]&&q.push(r);q.length&&i.push({elem:l,matches:q})}}d.length>e&&i.push({elem:this,matches:d.slice(e)});for(j=0;j<i.length&&!c.isPropagationStopped();j++){p=i[j],c.currentTarget=p.elem;for(k=0;k<p.matches.length&&!c.isImmediatePropagationStopped();k++){r=p.matches[k];if(h||!c.namespace&&!r.namespace||c.namespace_re&&c.namespace_re.test(r.namespace))c.data=r.data,c.handleObj=r,n=((f.event.special[r.origType]||{}).handle||r.handler).apply(p.elem,g),n!==b&&(c.result=n,n===!1&&(c.preventDefault(),c.stopPropagation()))}}return c.result},props:"attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){a.which==null&&(a.which=b.charCode!=null?b.charCode:b.keyCode);return a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,d){var e,f,g,h=d.button,i=d.fromElement;a.pageX==null&&d.clientX!=null&&(e=a.target.ownerDocument||c,f=e.documentElement,g=e.body,a.pageX=d.clientX+(f&&f.scrollLeft||g&&g.scrollLeft||0)-(f&&f.clientLeft||g&&g.clientLeft||0),a.pageY=d.clientY+(f&&f.scrollTop||g&&g.scrollTop||0)-(f&&f.clientTop||g&&g.clientTop||0)),!a.relatedTarget&&i&&(a.relatedTarget=i===a.target?d.toElement:i),!a.which&&h!==b&&(a.which=h&1?1:h&2?3:h&4?2:0);return a}},fix:function(a){if(a[f.expando])return a;var d,e,g=a,h=f.event.fixHooks[a.type]||{},i=h.props?this.props.concat(h.props):this.props;a=f.Event(g);for(d=i.length;d;)e=i[--d],a[e]=g[e];a.target||(a.target=g.srcElement||c),a.target.nodeType===3&&(a.target=a.target.parentNode),a.metaKey===b&&(a.metaKey=a.ctrlKey);return h.filter?h.filter(a,g):a},special:{ready:{setup:f.bindReady},load:{noBubble:!0},focus:{delegateType:"focusin"},blur:{delegateType:"focusout"},beforeunload:{setup:function(a,b,c){f.isWindow(this)&&(this.onbeforeunload=c)},teardown:function(a,b){this.onbeforeunload===b&&(this.onbeforeunload=null)}}},simulate:function(a,b,c,d){var e=f.extend(new f.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?f.event.trigger(e,null,b):f.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},f.event.handle=f.event.dispatch,f.removeEvent=c.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){a.detachEvent&&a.detachEvent("on"+b,c)},f.Event=function(a,b){if(!(this instanceof f.Event))return new f.Event(a,b);a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||a.returnValue===!1||a.getPreventDefault&&a.getPreventDefault()?K:J):this.type=a,b&&f.extend(this,b),this.timeStamp=a&&a.timeStamp||f.now(),this[f.expando]=!0},f.Event.prototype={preventDefault:function(){this.isDefaultPrevented=K;var a=this.originalEvent;!a||(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){this.isPropagationStopped=K;var a=this.originalEvent;!a||(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=K,this.stopPropagation()},isDefaultPrevented:J,isPropagationStopped:J,isImmediatePropagationStopped:J},f.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){f.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c=this,d=a.relatedTarget,e=a.handleObj,g=e.selector,h;if(!d||d!==c&&!f.contains(c,d))a.type=e.origType,h=e.handler.apply(this,arguments),a.type=b;return h}}}),f.support.submitBubbles||(f.event.special.submit={setup:function(){if(f.nodeName(this,"form"))return!1;f.event.add(this,"click._submit keypress._submit",function(a){var c=a.target,d=f.nodeName(c,"input")||f.nodeName(c,"button")?c.form:b;d&&!d._submit_attached&&(f.event.add(d,"submit._submit",function(a){this.parentNode&&!a.isTrigger&&f.event.simulate("submit",this.parentNode,a,!0)}),d._submit_attached=!0)})},teardown:function(){if(f.nodeName(this,"form"))return!1;f.event.remove(this,"._submit")}}),f.support.changeBubbles||(f.event.special.change={setup:function(){if(z.test(this.nodeName)){if(this.type==="checkbox"||this.type==="radio")f.event.add(this,"propertychange._change",function(a){a.originalEvent.propertyName==="checked"&&(this._just_changed=!0)}),f.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1,f.event.simulate("change",this,a,!0))});return!1}f.event.add(this,"beforeactivate._change",function(a){var b=a.target;z.test(b.nodeName)&&!b._change_attached&&(f.event.add(b,"change._change",function(a){this.parentNode&&!a.isSimulated&&!a.isTrigger&&f.event.simulate("change",this.parentNode,a,!0)}),b._change_attached=!0)})},handle:function(a){var b=a.target;if(this!==b||a.isSimulated||a.isTrigger||b.type!=="radio"&&b.type!=="checkbox")return a.handleObj.handler.apply(this,arguments)},teardown:function(){f.event.remove(this,"._change");return z.test(this.nodeName)}}),f.support.focusinBubbles||f.each({focus:"focusin",blur:"focusout"},function(a,b){var d=0,e=function(a){f.event.simulate(b,a.target,f.event.fix(a),!0)};f.event.special[b]={setup:function(){d++===0&&c.addEventListener(a,e,!0)},teardown:function(){--d===0&&c.removeEventListener(a,e,!0)}}}),f.fn.extend({on:function(a,c,d,e,g){var h,i;if(typeof a=="object"){typeof c!="string"&&(d=c,c=b);for(i in a)this.on(i,c,d,a[i],g);return this}d==null&&e==null?(e=c,d=c=b):e==null&&(typeof c=="string"?(e=d,d=b):(e=d,d=c,c=b));if(e===!1)e=J;else if(!e)return this;g===1&&(h=e,e=function(a){f().off(a);return h.apply(this,arguments)},e.guid=h.guid||(h.guid=f.guid++));return this.each(function(){f.event.add(this,a,e,d,c)})},one:function(a,b,c,d){return this.on.call(this,a,b,c,d,1)},off:function(a,c,d){if(a&&a.preventDefault&&a.handleObj){var e=a.handleObj;f(a.delegateTarget).off(e.namespace?e.type+"."+e.namespace:e.type,e.selector,e.handler);return this}if(typeof a=="object"){for(var g in a)this.off(g,c,a[g]);return this}if(c===!1||typeof c=="function")d=c,c=b;d===!1&&(d=J);return this.each(function(){f.event.remove(this,a,d,c)})},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},live:function(a,b,c){f(this.context).on(a,this.selector,b,c);return this},die:function(a,b){f(this.context).off(a,this.selector||"**",b);return this},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return arguments.length==1?this.off(a,"**"):this.off(b,a,c)},trigger:function(a,b){return this.each(function(){f.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0])return f.event.trigger(a,b,this[0],!0)},toggle:function(a){var b=arguments,c=a.guid||f.guid++,d=0,e=function(c){var e=(f._data(this,"lastToggle"+a.guid)||0)%d;f._data(this,"lastToggle"+a.guid,e+1),c.preventDefault();return b[e].apply(this,arguments)||!1};e.guid=c;while(d<b.length)b[d++].guid=c;return this.click(e)},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),f.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){f.fn[b]=function(a,c){c==null&&(c=a,a=null);return arguments.length>0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}if(j.nodeType===1){g||(j[d]=c,j.sizset=h);if(typeof b!="string"){if(j===b){k=!0;break}}else if(m.filter(b,[j]).length>0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h<i;h++){var j=e[h];if(j){var k=!1;j=j[a];while(j){if(j[d]===c){k=e[j.sizset];break}j.nodeType===1&&!g&&(j[d]=c,j.sizset=h);if(j.nodeName.toLowerCase()===b){k=j;break}j=j[a]}e[h]=k}}}var a=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b<a.length;b++)a[b]===a[b-1]&&a.splice(b--,1)}return a},m.matches=function(a,b){return m(a,null,null,b)},m.matchesSelector=function(a,b){return m(b,null,null,[a]).length>0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e<f;e++){h=o.order[e];if(g=o.leftMatch[h].exec(a)){i=g[1],g.splice(1,1);if(i.substr(i.length-1)!=="\\"){g[1]=(g[1]||"").replace(j,""),d=o.find[h](g,b,c);if(d!=null){a=a.replace(o.match[h],"");break}}}}d||(d=typeof b.getElementsByTagName!="undefined"?b.getElementsByTagName("*"):[]);return{set:d,expr:a}},m.filter=function(a,c,d,e){var f,g,h,i,j,k,l,n,p,q=a,r=[],s=c,t=c&&c[0]&&m.isXML(c[0]);while(a&&c.length){for(h in o.filter)if((f=o.leftMatch[h].exec(a))!=null&&f[2]){k=o.filter[h],l=f[1],g=!1,f.splice(1,1);if(l.substr(l.length-1)==="\\")continue;s===r&&(r=[]);if(o.preFilter[h]){f=o.preFilter[h](f,s,d,r,e,t);if(!f)g=i=!0;else if(f===!0)continue}if(f)for(n=0;(j=s[n])!=null;n++)j&&(i=k(j,f,n,s),p=e^i,d&&i!=null?p?g=!0:s[n]=!1:p&&(r.push(j),g=!0));if(i!==b){d||(s=r),a=a.replace(o.match[h],"");if(!g)return[];break}}if(a===q)if(g==null)m.error(a);else break;q=a}return s},m.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)};var n=m.getText=function(a){var b,c,d=a.nodeType,e="";if(d){if(d===1||d===9){if(typeof a.textContent=="string")return a.textContent;if(typeof a.innerText=="string")return a.innerText.replace(k,"");for(a=a.firstChild;a;a=a.nextSibling)e+=n(a)}else if(d===3||d===4)return a.nodeValue}else for(b=0;c=a[b];b++)c.nodeType!==8&&(e+=n(c));return e},o=m.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(a){return a.getAttribute("href")},type:function(a){return a.getAttribute("type")}},relative:{"+":function(a,b){var c=typeof b=="string",d=c&&!l.test(b),e=c&&!d;d&&(b=b.toLowerCase());for(var f=0,g=a.length,h;f<g;f++)if(h=a[f]){while((h=h.previousSibling)&&h.nodeType!==1);a[f]=e||h&&h.nodeName.toLowerCase()===b?h||!1:h===b}e&&m.filter(b,a,!0)},">":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e<f;e++){c=a[e];if(c){var g=c.parentNode;a[e]=g.nodeName.toLowerCase()===b?g:!1}}}else{for(;e<f;e++)c=a[e],c&&(a[e]=d?c.parentNode:c.parentNode===b);d&&m.filter(b,a,!0)}},"":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("parentNode",b,f,a,d,c)},"~":function(a,b,c){var d,f=e++,g=x;typeof b=="string"&&!l.test(b)&&(b=b.toLowerCase(),d=b,g=w),g("previousSibling",b,f,a,d,c)}},find:{ID:function(a,b,c){if(typeof b.getElementById!="undefined"&&!c){var d=b.getElementById(a[1]);return d&&d.parentNode?[d]:[]}},NAME:function(a,b){if(typeof b.getElementsByName!="undefined"){var c=[],d=b.getElementsByName(a[1]);for(var e=0,f=d.length;e<f;e++)d[e].getAttribute("name")===a[1]&&c.push(d[e]);return c.length===0?null:c}},TAG:function(a,b){if(typeof b.getElementsByTagName!="undefined")return b.getElementsByTagName(a[1])}},preFilter:{CLASS:function(a,b,c,d,e,f){a=" "+a[1].replace(j,"")+" ";if(f)return a;for(var g=0,h;(h=b[g])!=null;g++)h&&(e^(h.className&&(" "+h.className+" ").replace(/[\t\n\r]/g," ").indexOf(a)>=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return b<c[3]-0},gt:function(a,b,c){return b>c[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h<i;h++)if(g[h]===a)return!1;return!0}m.error(e)},CHILD:function(a,b){var c,e,f,g,h,i,j,k=b[1],l=a;switch(k){case"only":case"first":while(l=l.previousSibling)if(l.nodeType===1)return!1;if(k==="first")return!0;l=a;case"last":while(l=l.nextSibling)if(l.nodeType===1)return!1;return!0;case"nth":c=b[2],e=b[3];if(c===1&&e===0)return!0;f=b[0],g=a.parentNode;if(g&&(g[d]!==f||!a.nodeIndex)){i=0;for(l=g.firstChild;l;l=l.nextSibling)l.nodeType===1&&(l.nodeIndex=++i);g[d]=f}j=a.nodeIndex-e;return c===0?j===0:j%c===0&&j/c>=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c<e;c++)d.push(a[c]);else for(;a[c];c++)d.push(a[c]);return d}}var u,v;c.documentElement.compareDocumentPosition?u=function(a,b){if(a===b){h=!0;return 0}if(!a.compareDocumentPosition||!b.compareDocumentPosition)return a.compareDocumentPosition?-1:1;return a.compareDocumentPosition(b)&4?-1:1}:(u=function(a,b){if(a===b){h=!0;return 0}if(a.sourceIndex&&b.sourceIndex)return a.sourceIndex-b.sourceIndex;var c,d,e=[],f=[],g=a.parentNode,i=b.parentNode,j=g;if(g===i)return v(a,b);if(!g)return-1;if(!i)return 1;while(j)e.unshift(j),j=j.parentNode;j=i;while(j)f.unshift(j),j=j.parentNode;c=e.length,d=f.length;for(var k=0;k<c&&k<d;k++)if(e[k]!==f[k])return v(e[k],f[k]);return k===c?v(a,f[k],-1):v(e[k],b,1)},v=function(a,b,c){if(a===b)return c;var d=a.nextSibling;while(d){if(d===b)return-1;d=d.nextSibling}return 1}),function(){var a=c.createElement("div"),d="script"+(new Date).getTime(),e=c.documentElement;a.innerHTML="<a name='"+d+"'/>",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="<a href='#'></a>",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="<p class='TEST'></p>";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="<div class='test e'></div><div class='test'></div>";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h<i;h++)m(a,g[h],e,c);return m.filter(f,e)};m.attr=f.attr,m.selectors.attrMap={},f.find=m,f.expr=m.selectors,f.expr[":"]=f.expr.filters,f.unique=m.uniqueSort,f.text=m.getText,f.isXMLDoc=m.isXML,f.contains=m.contains}();var L=/Until$/,M=/^(?:parents|prevUntil|prevAll)/,N=/,/,O=/^.[^:#\[\.,]*$/,P=Array.prototype.slice,Q=f.expr.match.POS,R={children:!0,contents:!0,next:!0,prev:!0};f.fn.extend({find:function(a){var b=this,c,d;if(typeof a!="string")return f(a).filter(function(){for(c=0,d=b.length;c<d;c++)if(f.contains(b[c],this))return!0});var e=this.pushStack("","find",a),g,h,i;for(c=0,d=this.length;c<d;c++){g=e.length,f.find(a,this[c],e);if(c>0)for(h=g;h<e.length;h++)for(i=0;i<g;i++)if(e[i]===e[h]){e.splice(h--,1);break}}return e},has:function(a){var b=f(a);return this.filter(function(){for(var a=0,c=b.length;a<c;a++)if(f.contains(this,b[a]))return!0})},not:function(a){return this.pushStack(T(this,a,!1),"not",a)},filter:function(a){return this.pushStack(T(this,a,!0),"filter",a)},is:function(a){return!!a&&(typeof a=="string"?Q.test(a)?f(a,this.context).index(this[0])>=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d<a.length;d++)f(g).is(a[d])&&c.push({selector:a[d],elem:g,level:h});g=g.parentNode,h++}return c}var i=Q.test(a)||typeof a!="string"?f(a,b||this.context):0;for(d=0,e=this.length;d<e;d++){g=this[d];while(g){if(i?i.index(g)>-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/<tbody/i,_=/<|&#?\w+;/,ba=/<(?:script|style)/i,bb=/<(?:script|object|embed|option|style)/i,bc=new RegExp("<(?:"+V+")","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*<!(?:\[CDATA\[|\-\-)/,bg={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div<div>","</div>"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1></$2>");try{for(var c=0,d=this.length;c<d;c++)this[c].nodeType===1&&(f.cleanData(this[c].getElementsByTagName("*")),this[c].innerHTML=a)}catch(e){this.empty().append(a)}}else f.isFunction(a)?this.each(function(b){var c=f(this);c.html(a.call(this,b,c.html()))}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&this[0].parentNode){if(f.isFunction(a))return this.each(function(b){var c=f(this),d=c.html();c.replaceWith(a.call(this,b,d))});typeof a!="string"&&(a=f(a).detach());return this.each(function(){var b=this.nextSibling,c=this.parentNode;f(this).remove(),b?f(b).before(a):f(c).append(a)})}return this.length?this.pushStack(f(f.isFunction(a)?a():a),"replaceWith",a):this},detach:function(a){return this.remove(a,!0)},domManip:function(a,c,d){var e,g,h,i,j=a[0],k=[];if(!f.support.checkClone&&arguments.length===3&&typeof j=="string"&&bd.test(j))return this.each(function(){f(this).domManip(a,c,d,!0)});if(f.isFunction(j))return this.each(function(e){var g=f(this);a[0]=j.call(this,e,c?g.html():b),g.domManip(a,c,d)});if(this[0]){i=j&&j.parentNode,f.support.parentNode&&i&&i.nodeType===11&&i.childNodes.length===this.length?e={fragment:i}:e=f.buildFragment(a,this,k),h=e.fragment,h.childNodes.length===1?g=h=h.firstChild:g=h.firstChild;if(g){c=c&&f.nodeName(g,"tr");for(var l=0,m=this.length,n=m-1;l<m;l++)d.call(c?bi(this[l],g):this[l],e.cacheable||m>1&&l<n?f.clone(h,!0,!0):h)}k.length&&f.each(k,bp)}return this}}),f.buildFragment=function(a,b,d){var e,g,h,i,j=a[0];b&&b[0]&&(i=b[0].ownerDocument||b[0]),i.createDocumentFragment||(i=c),a.length===1&&typeof j=="string"&&j.length<512&&i===c&&j.charAt(0)==="<"&&!bb.test(j)&&(f.support.checkClone||!bd.test(j))&&(f.support.html5Clone||!bc.test(j))&&(g=!0,h=f.fragments[j],h&&h!==1&&(e=h)),e||(e=i.createDocumentFragment(),f.clean(a,i,e,d)),g&&(f.fragments[j]=h?e:1);return{fragment:e,cacheable:g}},f.fragments={},f.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){f.fn[a]=function(c){var d=[],e=f(c),g=this.length===1&&this[0].parentNode;if(g&&g.nodeType===11&&g.childNodes.length===1&&e.length===1){e[b](this[0]);return this}for(var h=0,i=e.length;h<i;h++){var j=(h>0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1></$2>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]==="<table>"&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i<r;i++)bn(k[i]);else bn(k);k.nodeType?h.push(k):h=f.merge(h,k)}if(d){g=function(a){return!a.type||be.test(a.type)};for(j=0;h[j];j++)if(e&&f.nodeName(h[j],"script")&&(!h[j].type||h[j].type.toLowerCase()==="text/javascript"))e.push(h[j].parentNode?h[j].parentNode.removeChild(h[j]):h[j]);else{if(h[j].nodeType===1){var s=f.grep(h[j].getElementsByTagName("script"),g);h.splice.apply(h,[j+1,0].concat(s))}d.appendChild(h[j])}}return h},cleanData:function(a){var b,c,d=f.cache,e=f.event.special,g=f.support.deleteExpando;for(var h=0,i;(i=a[h])!=null;h++){if(i.nodeName&&f.noData[i.nodeName.toLowerCase()])continue;c=i[f.expando];if(c){b=d[c];if(b&&b.events){for(var j in b.events)e[j]?f.event.remove(i,j):f.removeEvent(i,j,b.handle);b.handle&&(b.handle.elem=null)}g?delete i[f.expando]:i.removeAttribute&&i.removeAttribute(f.expando),delete d[c]}}}});var bq=/alpha\([^)]*\)/i,br=/opacity=([^)]*)/,bs=/([A-Z]|^ms)/g,bt=/^-?\d+(?:px)?$/i,bu=/^-?\d/,bv=/^([\-+])=([\-+.\de]+)/,bw={position:"absolute",visibility:"hidden",display:"block"},bx=["Left","Right"],by=["Top","Bottom"],bz,bA,bB;f.fn.css=function(a,c){if(arguments.length===2&&c===b)return this;return f.access(this,a,c,!0,function(a,c,d){return d!==b?f.style(a,c,d):f.css(a,c)})},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bz(a,"opacity","opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bv.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(bz)return bz(a,c)},swap:function(a,b,c){var d={};for(var e in b)d[e]=a.style[e],a.style[e]=b[e];c.call(a);for(e in b)a.style[e]=d[e]}}),f.curCSS=f.css,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){var e;if(c){if(a.offsetWidth!==0)return bC(a,b,d);f.swap(a,bw,function(){e=bC(a,b,d)});return e}},set:function(a,b){if(!bt.test(b))return b;b=parseFloat(b);if(b>=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("<div>").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g<h;g++)d=this[g],d.style&&(e=d.style.display,!f._data(d,"olddisplay")&&e==="none"&&(e=d.style.display=""),e===""&&f.css(d,"display")==="none"&&f._data(d,"olddisplay",cv(d.nodeName)));for(g=0;g<h;g++){d=this[g];if(d.style){e=d.style.display;if(e===""||e==="none")d.style.display=f._data(d,"olddisplay")||""}}return this},hide:function(a,b,c){if(a||a===0)return this.animate(cu("hide",3),a,b,c);var d,e,g=0,h=this.length;for(;g<h;g++)d=this[g],d.style&&(e=f.css(d,"display"),e!=="none"&&!f._data(d,"olddisplay")&&f._data(d,"olddisplay",e));for(g=0;g<h;g++)this[g].style&&(this[g].style.display="none");return this},_toggle:f.fn.toggle,toggle:function(a,b,c){var d=typeof a=="boolean";f.isFunction(a)&&f.isFunction(b)?this._toggle.apply(this,arguments):a==null||d?this.each(function(){var b=d?a:f(this).is(":hidden");f(this)[b?"show":"hide"]()}):this.animate(cu("toggle",3),a,b,c);return this},fadeTo:function(a,b,c,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){function g(){e.queue===!1&&f._mark(this);var b=f.extend({},e),c=this.nodeType===1,d=c&&f(this).is(":hidden"),g,h,i,j,k,l,m,n,o;b.animatedProperties={};for(i in a){g=f.camelCase(i),i!==g&&(a[g]=a[i],delete a[i]),h=a[g],f.isArray(h)?(b.animatedProperties[g]=h[1],h=a[g]=h[0]):b.animatedProperties[g]=b.specialEasing&&b.specialEasing[g]||b.easing||"swing";if(h==="hide"&&d||h==="show"&&!d)return b.complete.call(this);c&&(g==="height"||g==="width")&&(b.overflow=[this.style.overflow,this.style.overflowX,this.style.overflowY],f.css(this,"display")==="inline"&&f.css(this,"float")==="none"&&(!f.support.inlineBlockNeedsLayout||cv(this.nodeName)==="inline"?this.style.display="inline-block":this.style.zoom=1))}b.overflow!=null&&(this.style.overflow="hidden");for(i in a)j=new f.fx(this,b,i),h=a[i],cn.test(h)?(o=f._data(this,"toggle"+i)||(h==="toggle"?d?"show":"hide":0),o?(f._data(this,"toggle"+i,o==="show"?"hide":"show"),j[o]()):j[h]()):(k=co.exec(h),l=j.cur(),k?(m=parseFloat(k[2]),n=k[3]||(f.cssNumber[i]?"":"px"),n!=="px"&&(f.style(this,i,(m||1)+n),l=(m||1)/j.cur()*l,f.style(this,i,l+n)),k[1]&&(m=(k[1]==="-="?-1:1)*m+l),j.custom(l,m,n)):j.custom(l,h,""));return!0}var e=f.speed(b,c,d);if(f.isEmptyObject(a))return this.each(e.complete,[!1]);a=f.extend({},a);return e.queue===!1?this.each(g):this.queue(e.queue,g)},stop:function(a,c,d){typeof a!="string"&&(d=c,c=a,a=b),c&&a!==!1&&this.queue(a||"fx",[]);return this.each(function(){function h(a,b,c){var e=b[c];f.removeData(a,c,!0),e.stop(d)}var b,c=!1,e=f.timers,g=f._data(this);d||f._unmark(!0,this);if(a==null)for(b in g)g[b]&&g[b].stop&&b.indexOf(".run")===b.length-4&&h(this,g,b);else g[b=a+".run"]&&g[b].stop&&h(this,g,b);for(b=e.length;b--;)e[b].elem===this&&(a==null||e[b].queue===a)&&(d?e[b](!0):e[b].saveState(),c=!0,e.splice(b,1));(!d||!c)&&f.dequeue(this,a)})}}),f.each({slideDown:cu("show",1),slideUp:cu("hide",1),slideToggle:cu("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){f.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),f.extend({speed:function(a,b,c){var d=a&&typeof a=="object"?f.extend({},a):{complete:c||!c&&b||f.isFunction(a)&&a,duration:a,easing:c&&b||b&&!f.isFunction(b)&&b};d.duration=f.fx.off?0:typeof d.duration=="number"?d.duration:d.duration in f.fx.speeds?f.fx.speeds[d.duration]:f.fx.speeds._default;if(d.queue==null||d.queue===!0)d.queue="fx";d.old=d.complete,d.complete=function(a){f.isFunction(d.old)&&d.old.call(this),d.queue?f.dequeue(this,d.queue):a!==!1&&f._unmark(this)};return d},easing:{linear:function(a,b,c,d){return c+d*a},swing:function(a,b,c,d){return(-Math.cos(a*Math.PI)/2+.5)*d+c}},timers:[],fx:function(a,b,c){this.options=b,this.elem=a,this.prop=c,b.orig=b.orig||{}}}),f.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this),(f.fx.step[this.prop]||f.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a,b=f.css(this.elem,this.prop);return isNaN(a=parseFloat(b))?!b||b==="auto"?0:b:a},custom:function(a,c,d){function h(a){return e.step(a)}var e=this,g=f.fx;this.startTime=cr||cs(),this.end=c,this.now=this.start=a,this.pos=this.state=0,this.unit=d||this.unit||(f.cssNumber[this.prop]?"":"px"),h.queue=this.options.queue,h.elem=this.elem,h.saveState=function(){e.options.hide&&f._data(e.elem,"fxshow"+e.prop)===b&&f._data(e.elem,"fxshow"+e.prop,e.start)},h()&&f.timers.push(h)&&!cp&&(cp=setInterval(g.tick,g.interval))},show:function(){var a=f._data(this.elem,"fxshow"+this.prop);this.options.orig[this.prop]=a||f.style(this.elem,this.prop),this.options.show=!0,a!==b?this.custom(this.cur(),a):this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur()),f(this.elem).show()},hide:function(){this.options.orig[this.prop]=f._data(this.elem,"fxshow"+this.prop)||f.style(this.elem,this.prop),this.options.hide=!0,this.custom(this.cur(),0)},step:function(a){var b,c,d,e=cr||cs(),g=!0,h=this.elem,i=this.options;if(a||e>=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c<b.length;c++)a=b[c],!a()&&b[c]===a&&b.splice(c--,1);b.length||f.fx.stop()},interval:13,stop:function(){clearInterval(cp),cp=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){f.style(a.elem,"opacity",a.now)},_default:function(a){a.elem.style&&a.elem.style[a.prop]!=null?a.elem.style[a.prop]=a.now+a.unit:a.elem[a.prop]=a.now}}}),f.each(["width","height"],function(a,b){f.fx.step[b]=function(a){f.style(a.elem,b,Math.max(0,a.now)+a.unit)}}),f.expr&&f.expr.filters&&(f.expr.filters.animated=function(a){return f.grep(f.timers,function(b){return a===b.elem}).length});var cw=/^t(?:able|d|h)$/i,cx=/^(?:body|html)$/i;"getBoundingClientRect"in c.documentElement?f.fn.offset=function(a){var b=this[0],c;if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);try{c=b.getBoundingClientRect()}catch(d){}var e=b.ownerDocument,g=e.documentElement;if(!c||!f.contains(g,b))return c?{top:c.top,left:c.left}:{top:0,left:0};var h=e.body,i=cy(e),j=g.clientTop||h.clientTop||0,k=g.clientLeft||h.clientLeft||0,l=i.pageYOffset||f.support.boxModel&&g.scrollTop||h.scrollTop,m=i.pageXOffset||f.support.boxModel&&g.scrollLeft||h.scrollLeft,n=c.top+l-j,o=c.left+m-k;return{top:n,left:o}}:f.fn.offset=function(a){var b=this[0];if(a)return this.each(function(b){f.offset.setOffset(this,a,b)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return f.offset.bodyOffset(b);var c,d=b.offsetParent,e=b,g=b.ownerDocument,h=g.documentElement,i=g.body,j=g.defaultView,k=j?j.getComputedStyle(b,null):b.currentStyle,l=b.offsetTop,m=b.offsetLeft;while((b=b.parentNode)&&b!==i&&b!==h){if(f.support.fixedPosition&&k.position==="fixed")break;c=j?j.getComputedStyle(b,null):b.currentStyle,l-=b.scrollTop,m-=b.scrollLeft,b===d&&(l+=b.offsetTop,m+=b.offsetLeft,f.support.doesNotAddBorder&&(!f.support.doesAddBorderForTableAndCells||!cw.test(b.nodeName))&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),e=d,d=b.offsetParent),f.support.subtractsBorderForOverflowNotVisible&&c.overflow!=="visible"&&(l+=parseFloat(c.borderTopWidth)||0,m+=parseFloat(c.borderLeftWidth)||0),k=c}if(k.position==="relative"||k.position==="static")l+=i.offsetTop,m+=i.offsetLeft;f.support.fixedPosition&&k.position==="fixed"&&(l+=Math.max(h.scrollTop,i.scrollTop),m+=Math.max(h.scrollLeft,i.scrollLeft));return{top:l,left:m}},f.offset={bodyOffset:function(a){var b=a.offsetTop,c=a.offsetLeft;f.support.doesNotIncludeMarginInBodyOffset&&(b+=parseFloat(f.css(a,"marginTop"))||0,c+=parseFloat(f.css(a,"marginLeft"))||0);return{top:b,left:c}},setOffset:function(a,b,c){var d=f.css(a,"position");d==="static"&&(a.style.position="relative");var e=f(a),g=e.offset(),h=f.css(a,"top"),i=f.css(a,"left"),j=(d==="absolute"||d==="fixed")&&f.inArray("auto",[h,i])>-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window);
\ No newline at end of file diff --git a/sphinx/themes/basic/static/searchtools.js_t b/sphinx/themes/basic/static/searchtools.js_t index 45989c6a..f96953b4 100644 --- a/sphinx/themes/basic/static/searchtools.js_t +++ b/sphinx/themes/basic/static/searchtools.js_t @@ -4,39 +4,46 @@ * * Sphinx JavaScript utilties for the full-text search. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ +{{ search_language_stemming_code|safe }} + +{% if search_scorer_tool %} +{{ search_scorer_tool|safe }} +{% else %} /** - * helper function to return a node containing the - * search summary for a given text. keywords is a list - * of stemmed words, hlwords is the list of normal, unstemmed - * words. the first one is used to find the occurance, the - * latter for highlighting it. + * Simple result scoring code. */ - -jQuery.makeSearchSummary = function(text, keywords, hlwords) { - var textLower = text.toLowerCase(); - var start = 0; - $.each(keywords, function() { - var i = textLower.indexOf(this.toLowerCase()); - if (i > -1) - start = i; - }); - start = Math.max(start - 120, 0); - var excerpt = ((start > 0) ? '...' : '') + - $.trim(text.substr(start, 240)) + - ((start + 240 - text.length) ? '...' : ''); - var rv = $('<div class="context"></div>').text(excerpt); - $.each(hlwords, function() { - rv = rv.highlightText(this, 'highlighted'); - }); - return rv; -} - -{{ search_language_stemming_code|safe }} +var Scorer = { + // Implement the following function to further tweak the score for each result + // The function takes a result array [filename, title, anchor, descr, score] + // and returns the new score. + /* + score: function(result) { + return result[4]; + }, + */ + + // query matches the full name of an object + objNameMatch: 11, + // or matches in the last dotted part of the object name + objPartialMatch: 6, + // Additive scores depending on the priority of the object + objPrio: {0: 15, // used to be importantResults + 1: 5, // used to be objectResults + 2: -5}, // used to be unimportantResults + // Used when the priority is not in the mapping. + objPrioDefault: 0, + + // query found in title + title: 15, + // query found in terms + term: 5 +}; +{% endif %} /** * Search Module @@ -86,19 +93,20 @@ var Search = { if (this._pulse_status >= 0) return; function pulse() { + var i; Search._pulse_status = (Search._pulse_status + 1) % 4; var dotString = ''; - for (var i = 0; i < Search._pulse_status; i++) + for (i = 0; i < Search._pulse_status; i++) dotString += '.'; Search.dots.text(dotString); if (Search._pulse_status > -1) window.setTimeout(pulse, 500); - }; + } pulse(); }, /** - * perform a search for something + * perform a search for something (or wait until index is loaded) */ performSearch : function(query) { // create the required interface elements @@ -118,41 +126,46 @@ var Search = { this.deferQuery(query); }, + /** + * execute search (requires search index to be loaded) + */ query : function(query) { + var i; var stopwords = {{ search_language_stop_words }}; - // Stem the searchterms and add them to the correct list + // stem the searchterms and add them to the correct list var stemmer = new Stemmer(); var searchterms = []; var excluded = []; var hlterms = []; var tmp = query.split(/\s+/); var objectterms = []; - for (var i = 0; i < tmp.length; i++) { - if (tmp[i] != "") { + for (i = 0; i < tmp.length; i++) { + if (tmp[i] !== "") { objectterms.push(tmp[i].toLowerCase()); } if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) || - tmp[i] == "") { + tmp[i] === "") { // skip this "word" continue; } // stem the word var word = stemmer.stemWord(tmp[i]).toLowerCase(); + var toAppend; // select the correct list if (word[0] == '-') { - var toAppend = excluded; + toAppend = excluded; word = word.substr(1); } else { - var toAppend = searchterms; + toAppend = searchterms; 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(" ")); // console.debug('SEARCH: searching for:'); @@ -160,89 +173,51 @@ var Search = { // console.info('excluded: ', excluded); // prepare search - var filenames = this._index.filenames; - var titles = this._index.titles; var terms = this._index.terms; - var fileMap = {}; - var files = null; - // different result priorities - var importantResults = []; - var objectResults = []; - var regularResults = []; - var unimportantResults = []; + var titleterms = this._index.titleterms; + + // array of [filename, title, anchor, descr, score] + var results = []; $('#search-progress').empty(); // lookup as object - for (var i = 0; i < objectterms.length; i++) { - var others = [].concat(objectterms.slice(0,i), - objectterms.slice(i+1, objectterms.length)) - var results = this.performObjectSearch(objectterms[i], others); - // Assume first word is most likely to be the object, - // other words more likely to be in description. - // Therefore put matches for earlier words first. - // (Results are eventually used in reverse order). - objectResults = results[0].concat(objectResults); - importantResults = results[1].concat(importantResults); - unimportantResults = results[2].concat(unimportantResults); + for (i = 0; i < objectterms.length; i++) { + var others = [].concat(objectterms.slice(0, i), + objectterms.slice(i+1, objectterms.length)); + results = results.concat(this.performObjectSearch(objectterms[i], others)); } - // perform the search on the required terms - for (var i = 0; i < searchterms.length; i++) { - var word = searchterms[i]; - // no match but word was a required one - if ((files = terms[word]) == null) - break; - if (files.length == undefined) { - files = [files]; - } - // create the mapping - for (var j = 0; j < files.length; j++) { - var file = files[j]; - if (file in fileMap) - fileMap[file].push(word); - else - fileMap[file] = [word]; - } - } - - // now check if the files don't contain excluded terms - for (var file in fileMap) { - var valid = true; - - // check if all requirements are matched - if (fileMap[file].length != searchterms.length) - continue; + // lookup as search terms in fulltext + results = results.concat(this.performTermsSearch(searchterms, excluded, terms, Scorer.term)) + .concat(this.performTermsSearch(searchterms, excluded, titleterms, Scorer.title)); - // ensure that none of the excluded terms is in the - // search result. - for (var i = 0; i < excluded.length; i++) { - if (terms[excluded[i]] == file || - $.contains(terms[excluded[i]] || [], file)) { - valid = false; - break; - } - } - - // if we have still a valid result we can add it - // to the result list - if (valid) - regularResults.push([filenames[file], titles[file], '', null]); + // let the scorer override scores with a custom scoring function + if (Scorer.score) { + for (i = 0; i < results.length; i++) + results[i][4] = Scorer.score(results[i]); } - // delete unused variables in order to not waste - // memory until list is retrieved completely - delete filenames, titles, terms; - - // now sort the regular results descending by title - regularResults.sort(function(a, b) { - var left = a[1].toLowerCase(); - var right = b[1].toLowerCase(); - return (left > right) ? -1 : ((left < right) ? 1 : 0); + // now sort the results by score (in opposite order of appearance, since the + // display function below uses pop() to retrieve items) and then + // alphabetically + results.sort(function(a, b) { + var left = a[4]; + var right = b[4]; + if (left > right) { + return 1; + } else if (left < right) { + return -1; + } else { + // same score: sort alphabetically + left = a[1].toLowerCase(); + right = b[1].toLowerCase(); + return (left > right) ? -1 : ((left < right) ? 1 : 0); + } }); - // combine all results - var results = unimportantResults.concat(regularResults) - .concat(objectResults).concat(importantResults); + // for debugging + //Search.lastresults = results.slice(); // a copy + //console.info('search results:', Search.lastresults); // print the results var resultCount = results.length; @@ -251,7 +226,7 @@ var Search = { if (results.length) { var item = results.pop(); var listItem = $('<li style="display:none"></li>'); - if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') { + if (DOCUMENTATION_OPTIONS.FILE_SUFFIX === '') { // dirhtml builder var dirname = item[0] + '/'; if (dirname.match(/\/index\/$/)) { @@ -277,8 +252,8 @@ var Search = { } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) { $.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[0] + '.txt', function(data) { - if (data != '') { - listItem.append($.makeSearchSummary(data, searchterms, hlterms)); + if (data !== '') { + listItem.append(Search.makeSearchSummary(data, searchterms, hlterms)); Search.output.append(listItem); } listItem.slideDown(5, function() { @@ -307,20 +282,32 @@ var Search = { displayNextItem(); }, + /** + * search for object names + */ performObjectSearch : function(object, otherterms) { var filenames = this._index.filenames; var objects = this._index.objects; var objnames = this._index.objnames; var titles = this._index.titles; - var importantResults = []; - var objectResults = []; - var unimportantResults = []; + var i; + var results = []; for (var prefix in objects) { for (var name in objects[prefix]) { var fullname = (prefix ? prefix + '.' : '') + name; if (fullname.toLowerCase().indexOf(object) > -1) { + var score = 0; + var parts = fullname.split('.'); + // check for different match types: exact matches of full name or + // "last name" (i.e. last dotted part) + if (fullname == object || parts[parts.length - 1] == object) { + score += Scorer.objNameMatch; + // matches in last name + } else if (parts[parts.length - 1].indexOf(object) > -1) { + score += Scorer.objPartialMatch; + } var match = objects[prefix][name]; var objname = objnames[match[1]][2]; var title = titles[match[0]]; @@ -330,7 +317,7 @@ var Search = { var haystack = (prefix + ' ' + name + ' ' + objname + ' ' + title).toLowerCase(); var allfound = true; - for (var i = 0; i < otherterms.length; i++) { + for (i = 0; i < otherterms.length; i++) { if (haystack.indexOf(otherterms[i]) == -1) { allfound = false; break; @@ -341,37 +328,107 @@ var Search = { } } var descr = objname + _(', in ') + title; - anchor = match[3]; - if (anchor == '') + + var anchor = match[3]; + if (anchor === '') anchor = fullname; else if (anchor == '-') anchor = objnames[match[1]][1] + '-' + fullname; - result = [filenames[match[0]], fullname, '#'+anchor, descr]; - switch (match[2]) { - case 1: objectResults.push(result); break; - case 0: importantResults.push(result); break; - case 2: unimportantResults.push(result); break; + // add custom score for some objects according to scorer + if (Scorer.objPrio.hasOwnProperty(match[2])) { + score += Scorer.objPrio[match[2]]; + } else { + score += Scorer.objPrioDefault; } + results.push([filenames[match[0]], fullname, '#'+anchor, descr, score]); } } } - // sort results descending - objectResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); + return results; + }, - importantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); + /** + * search for full-text terms in the index + */ + performTermsSearch : function(searchterms, excluded, terms, score) { + var filenames = this._index.filenames; + var titles = this._index.titles; - unimportantResults.sort(function(a, b) { - return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0); - }); + var i, j, file, files; + var fileMap = {}; + var results = []; + + // perform the search on the required terms + for (i = 0; i < searchterms.length; i++) { + var word = searchterms[i]; + // no match but word was a required one + if (!(files = terms[word])) + break; + if (files.length === undefined) { + files = [files]; + } + // create the mapping + for (j = 0; j < files.length; j++) { + file = files[j]; + if (file in fileMap) + fileMap[file].push(word); + else + fileMap[file] = [word]; + } + } + + // now check if the files don't contain excluded terms + for (file in fileMap) { + var valid = true; + + // check if all requirements are matched + if (fileMap[file].length != searchterms.length) + continue; + + // ensure that none of the excluded terms is in the search result + for (i = 0; i < excluded.length; i++) { + if (terms[excluded[i]] == file || + $u.contains(terms[excluded[i]] || [], file)) { + valid = false; + break; + } + } - return [importantResults, objectResults, unimportantResults] + // if we have still a valid result we can add it to the result list + if (valid) { + results.push([filenames[file], titles[file], '', null, score]); + } + } + return results; + }, + + /** + * helper function to return a node containing the + * search summary for a given text. keywords is a list + * of stemmed words, hlwords is the list of normal, unstemmed + * words. the first one is used to find the occurance, the + * latter for highlighting it. + */ + makeSearchSummary : function(text, keywords, hlwords) { + var textLower = text.toLowerCase(); + var start = 0; + $.each(keywords, function() { + var i = textLower.indexOf(this.toLowerCase()); + if (i > -1) + start = i; + }); + start = Math.max(start - 120, 0); + var excerpt = ((start > 0) ? '...' : '') + + $.trim(text.substr(start, 240)) + + ((start + 240 - text.length) ? '...' : ''); + var rv = $('<div class="context"></div>').text(excerpt); + $.each(hlwords, function() { + rv = rv.highlightText(this, 'highlighted'); + }); + return rv; } -} +}; $(document).ready(function() { Search.init(); diff --git a/sphinx/themes/basic/static/underscore.js b/sphinx/themes/basic/static/underscore.js index 5d899143..5b55f32b 100644 --- a/sphinx/themes/basic/static/underscore.js +++ b/sphinx/themes/basic/static/underscore.js @@ -1,23 +1,31 @@ -// Underscore.js 0.5.5 -// (c) 2009 Jeremy Ashkenas, DocumentCloud Inc. -// Underscore is freely distributable under the terms of the MIT license. -// Portions of Underscore are inspired by or borrowed from Prototype.js, +// Underscore.js 1.3.1 +// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc. +// Underscore is freely distributable under the MIT license. +// Portions of Underscore are inspired or borrowed from Prototype, // Oliver Steele's Functional, and John Resig's Micro-Templating. // For all details and documentation: -// http://documentcloud.github.com/underscore/ -(function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d, -a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c); -var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c, -d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck= -function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a, -function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a, -0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d, -e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d= -a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)}); -return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length); -var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false; -if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length== -0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&& -a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g, -" ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments); -o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})(); +// http://documentcloud.github.com/underscore +(function(){function q(a,c,d){if(a===c)return a!==0||1/a==1/c;if(a==null||c==null)return a===c;if(a._chain)a=a._wrapped;if(c._chain)c=c._wrapped;if(a.isEqual&&b.isFunction(a.isEqual))return a.isEqual(c);if(c.isEqual&&b.isFunction(c.isEqual))return c.isEqual(a);var e=l.call(a);if(e!=l.call(c))return false;switch(e){case "[object String]":return a==String(c);case "[object Number]":return a!=+a?c!=+c:a==0?1/a==1/c:a==+c;case "[object Date]":case "[object Boolean]":return+a==+c;case "[object RegExp]":return a.source== +c.source&&a.global==c.global&&a.multiline==c.multiline&&a.ignoreCase==c.ignoreCase}if(typeof a!="object"||typeof c!="object")return false;for(var f=d.length;f--;)if(d[f]==a)return true;d.push(a);var f=0,g=true;if(e=="[object Array]"){if(f=a.length,g=f==c.length)for(;f--;)if(!(g=f in a==f in c&&q(a[f],c[f],d)))break}else{if("constructor"in a!="constructor"in c||a.constructor!=c.constructor)return false;for(var h in a)if(b.has(a,h)&&(f++,!(g=b.has(c,h)&&q(a[h],c[h],d))))break;if(g){for(h in c)if(b.has(c, +h)&&!f--)break;g=!f}}d.pop();return g}var r=this,G=r._,n={},k=Array.prototype,o=Object.prototype,i=k.slice,H=k.unshift,l=o.toString,I=o.hasOwnProperty,w=k.forEach,x=k.map,y=k.reduce,z=k.reduceRight,A=k.filter,B=k.every,C=k.some,p=k.indexOf,D=k.lastIndexOf,o=Array.isArray,J=Object.keys,s=Function.prototype.bind,b=function(a){return new m(a)};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=b;exports._=b}else r._=b;b.VERSION="1.3.1";var j=b.each= +b.forEach=function(a,c,d){if(a!=null)if(w&&a.forEach===w)a.forEach(c,d);else if(a.length===+a.length)for(var e=0,f=a.length;e<f;e++){if(e in a&&c.call(d,a[e],e,a)===n)break}else for(e in a)if(b.has(a,e)&&c.call(d,a[e],e,a)===n)break};b.map=b.collect=function(a,c,b){var e=[];if(a==null)return e;if(x&&a.map===x)return a.map(c,b);j(a,function(a,g,h){e[e.length]=c.call(b,a,g,h)});if(a.length===+a.length)e.length=a.length;return e};b.reduce=b.foldl=b.inject=function(a,c,d,e){var f=arguments.length>2;a== +null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect= +function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e= +e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck= +function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b<e.computed&&(e={value:a,computed:b})}); +return e.value};b.shuffle=function(a){var b=[],d;j(a,function(a,f){f==0?b[0]=a:(d=Math.floor(Math.random()*(f+1)),b[f]=b[d],b[d]=a)});return b};b.sortBy=function(a,c,d){return b.pluck(b.map(a,function(a,b,g){return{value:a,criteria:c.call(d,a,b,g)}}).sort(function(a,b){var c=a.criteria,d=b.criteria;return c<d?-1:c>d?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a, +c,d){d||(d=b.identity);for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?e=g+1:f=g}return e};b.toArray=function(a){return!a?[]:a.toArray?a.toArray():b.isArray(a)?i.call(a):b.isArguments(a)?i.call(a):b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=b.head=function(a,b,d){return b!=null&&!d?i.call(a,0,b):a[0]};b.initial=function(a,b,d){return i.call(a,0,a.length-(b==null||d?1:b))};b.last=function(a,b,d){return b!=null&&!d?i.call(a,Math.max(a.length-b,0)):a[a.length-1]};b.rest= +b.tail=function(a,b,d){return i.call(a,b==null||d?1:b)};b.compact=function(a){return b.filter(a,function(a){return!!a})};b.flatten=function(a,c){return b.reduce(a,function(a,e){if(b.isArray(e))return a.concat(c?e:b.flatten(e));a[a.length]=e;return a},[])};b.without=function(a){return b.difference(a,i.call(arguments,1))};b.uniq=b.unique=function(a,c,d){var d=d?b.map(a,d):a,e=[];b.reduce(d,function(d,g,h){if(0==h||(c===true?b.last(d)!=g:!b.include(d,g)))d[d.length]=g,e[e.length]=a[h];return d},[]); +return e};b.union=function(){return b.uniq(b.flatten(arguments,true))};b.intersection=b.intersect=function(a){var c=i.call(arguments,1);return b.filter(b.uniq(a),function(a){return b.every(c,function(c){return b.indexOf(c,a)>=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e<c;e++)d[e]=b.pluck(a,""+e);return d};b.indexOf=function(a,c, +d){if(a==null)return-1;var e;if(d)return d=b.sortedIndex(a,c),a[d]===c?d:-1;if(p&&a.indexOf===p)return a.indexOf(c);for(d=0,e=a.length;d<e;d++)if(d in a&&a[d]===c)return d;return-1};b.lastIndexOf=function(a,b){if(a==null)return-1;if(D&&a.lastIndexOf===D)return a.lastIndexOf(b);for(var d=a.length;d--;)if(d in a&&a[d]===b)return d;return-1};b.range=function(a,b,d){arguments.length<=1&&(b=a||0,a=0);for(var d=arguments[2]||1,e=Math.max(Math.ceil((b-a)/d),0),f=0,g=Array(e);f<e;)g[f++]=a,a+=d;return g}; +var F=function(){};b.bind=function(a,c){var d,e;if(a.bind===s&&s)return s.apply(a,i.call(arguments,1));if(!b.isFunction(a))throw new TypeError;e=i.call(arguments,2);return d=function(){if(!(this instanceof d))return a.apply(c,e.concat(i.call(arguments)));F.prototype=a.prototype;var b=new F,g=a.apply(b,e.concat(i.call(arguments)));return Object(g)===g?g:b}};b.bindAll=function(a){var c=i.call(arguments,1);c.length==0&&(c=b.functions(a));j(c,function(c){a[c]=b.bind(a[c],a)});return a};b.memoize=function(a, +c){var d={};c||(c=b.identity);return function(){var e=c.apply(this,arguments);return b.has(d,e)?d[e]:d[e]=a.apply(this,arguments)}};b.delay=function(a,b){var d=i.call(arguments,2);return setTimeout(function(){return a.apply(a,d)},b)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(i.call(arguments,1)))};b.throttle=function(a,c){var d,e,f,g,h,i=b.debounce(function(){h=g=false},c);return function(){d=this;e=arguments;var b;f||(f=setTimeout(function(){f=null;h&&a.apply(d,e);i()},c));g?h=true: +a.apply(d,e);i();g=true}};b.debounce=function(a,b){var d;return function(){var e=this,f=arguments;clearTimeout(d);d=setTimeout(function(){d=null;a.apply(e,f)},b)}};b.once=function(a){var b=false,d;return function(){if(b)return d;b=true;return d=a.apply(this,arguments)}};b.wrap=function(a,b){return function(){var d=[a].concat(i.call(arguments,0));return b.apply(this,d)}};b.compose=function(){var a=arguments;return function(){for(var b=arguments,d=a.length-1;d>=0;d--)b=[a[d].apply(this,b)];return b[0]}}; +b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments, +1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)}; +b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"}; +b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e<a;e++)b.call(d,e)};b.escape=function(a){return(""+a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a), +function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+ +u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]= +function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain= +true;return this};m.prototype.value=function(){return this._wrapped}}).call(this); diff --git a/sphinx/themes/basic/static/websupport.js b/sphinx/themes/basic/static/websupport.js index e9bd1b85..19fcda56 100644 --- a/sphinx/themes/basic/static/websupport.js +++ b/sphinx/themes/basic/static/websupport.js @@ -4,7 +4,7 @@ * * sphinx.websupport utilties for all documentation. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/default/layout.html b/sphinx/themes/default/layout.html index d91a5655..d237f5ed 100644 --- a/sphinx/themes/default/layout.html +++ b/sphinx/themes/default/layout.html @@ -4,10 +4,10 @@ Sphinx layout template for the default theme. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {% if theme_collapsiblesidebar|tobool %} {% set script_files = script_files + ['_static/sidebar.js'] %} diff --git a/sphinx/themes/default/static/default.css_t b/sphinx/themes/default/static/default.css_t index 85c9436a..5db77108 100644 --- a/sphinx/themes/default/static/default.css_t +++ b/sphinx/themes/default/static/default.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- default theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/default/static/sidebar.js b/sphinx/themes/default/static/sidebar.js_t index a45e1926..24200525 100644 --- a/sphinx/themes/default/static/sidebar.js +++ b/sphinx/themes/default/static/sidebar.js_t @@ -16,12 +16,26 @@ * Once the browser is closed the cookie is deleted and the position * reset to the default (expanded). * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ $(function() { + {% if theme_rightsidebar|tobool %} + {% set side = 'right' %} + {% set opposite = 'left' %} + {% set initial_label = '»' %} + {% set expand_label = '«' %} + {% set collapse_label = '»' %} + {% else %} + {% set side = 'left' %} + {% set opposite = 'right' %} + {% set initial_label = '«' %} + {% set expand_label = '»' %} + {% set collapse_label = '«' %} + {% endif %} + // global elements used by the functions. // the 'sidebarbutton' element is defined as global after its // creation, in the add_sidebar_button function @@ -34,7 +48,7 @@ $(function() { // original margin-left of the bodywrapper and width of the sidebar // with the sidebar expanded - var bw_margin_expanded = bodywrapper.css('margin-left'); + var bw_margin_expanded = bodywrapper.css('margin-{{side}}'); var ssb_width_expanded = sidebar.width(); // margin-left of the bodywrapper and width of the sidebar @@ -60,38 +74,38 @@ $(function() { function collapse_sidebar() { sidebarwrapper.hide(); sidebar.css('width', ssb_width_collapsed); - bodywrapper.css('margin-left', bw_margin_collapsed); + bodywrapper.css('margin-{{side}}', bw_margin_collapsed); sidebarbutton.css({ - 'margin-left': '0', + 'margin-{{side}}': '0', 'height': bodywrapper.height() }); - sidebarbutton.find('span').text('»'); + sidebarbutton.find('span').text('{{expand_label}}'); sidebarbutton.attr('title', _('Expand sidebar')); document.cookie = 'sidebar=collapsed'; } function expand_sidebar() { - bodywrapper.css('margin-left', bw_margin_expanded); + bodywrapper.css('margin-{{side}}', bw_margin_expanded); sidebar.css('width', ssb_width_expanded); sidebarwrapper.show(); sidebarbutton.css({ - 'margin-left': ssb_width_expanded-12, + 'margin-{{side}}': ssb_width_expanded-12, 'height': bodywrapper.height() }); - sidebarbutton.find('span').text('«'); + sidebarbutton.find('span').text('{{collapse_label}}'); sidebarbutton.attr('title', _('Collapse sidebar')); document.cookie = 'sidebar=expanded'; } function add_sidebar_button() { sidebarwrapper.css({ - 'float': 'left', - 'margin-right': '0', + 'float': '{{side}}', + 'margin-{{opposite}}': '0', 'width': ssb_width_expanded - 28 }); // create the button sidebar.append( - '<div id="sidebarbutton"><span>«</span></div>' + '<div id="sidebarbutton"><span>{{initial_label}}</span></div>' ); var sidebarbutton = $('#sidebarbutton'); light_color = sidebarbutton.css('background-color'); @@ -110,12 +124,12 @@ $(function() { sidebarbutton.attr('title', _('Collapse sidebar')); sidebarbutton.css({ 'color': '#FFFFFF', - 'border-left': '1px solid ' + dark_color, + 'border-{{side}}': '1px solid ' + dark_color, 'font-size': '1.2em', 'cursor': 'pointer', 'height': bodywrapper.height(), 'padding-top': '1px', - 'margin-left': ssb_width_expanded - 12 + 'margin-{{side}}': ssb_width_expanded - 12 }); sidebarbutton.hover( diff --git a/sphinx/themes/epub/epub-cover.html b/sphinx/themes/epub/epub-cover.html index b3202a33..5872fb7f 100644 --- a/sphinx/themes/epub/epub-cover.html +++ b/sphinx/themes/epub/epub-cover.html @@ -4,10 +4,10 @@ Sample template for the html cover page. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "layout.html" %} +{%- extends "layout.html" %} {%- block header %}{% endblock %} {%- block rootrellink %}{% endblock %} {%- block relbaritems %}{% endblock %} diff --git a/sphinx/themes/epub/layout.html b/sphinx/themes/epub/layout.html index 24395a66..c2e2e0fd 100644 --- a/sphinx/themes/epub/layout.html +++ b/sphinx/themes/epub/layout.html @@ -4,13 +4,22 @@ Sphinx layout template for the epub theme. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {# add only basic navigation links #} {% block sidebar1 %}{% endblock %} {% block sidebar2 %}{% endblock %} {% block relbar2 %}{% endblock %} {% block linktags %}{% endblock %} + +{# redefine relbar1 and footer to only call super if options are true #} +{%- block relbar1 %} +{% if theme_relbar1|tobool %}{{ super() }}{% endif %} +{%- endblock %} +{%- block footer %} +{% if theme_footer|tobool %}{{ super() }}{% endif %} +{%- endblock %} + diff --git a/sphinx/themes/epub/static/epub.css b/sphinx/themes/epub/static/epub.css index d2c51751..9ce90fae 100644 --- a/sphinx/themes/epub/static/epub.css +++ b/sphinx/themes/epub/static/epub.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- epub theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/epub/theme.conf b/sphinx/themes/epub/theme.conf index d5806ec5..11f098ec 100644 --- a/sphinx/themes/epub/theme.conf +++ b/sphinx/themes/epub/theme.conf @@ -2,3 +2,7 @@ inherit = basic stylesheet = epub.css pygments_style = none + +[options] +relbar1 = true +footer = true diff --git a/sphinx/themes/haiku/layout.html b/sphinx/themes/haiku/layout.html index 719dba77..edbda50b 100644 --- a/sphinx/themes/haiku/layout.html +++ b/sphinx/themes/haiku/layout.html @@ -4,10 +4,10 @@ Sphinx layout template for the haiku theme. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {% set script_files = script_files + ['_static/theme_extras.js'] %} {% set css_files = css_files + ['_static/print.css'] %} diff --git a/sphinx/themes/haiku/static/haiku.css_t b/sphinx/themes/haiku/static/haiku.css_t index 19f4e0bf..87b116ae 100644 --- a/sphinx/themes/haiku/static/haiku.css_t +++ b/sphinx/themes/haiku/static/haiku.css_t @@ -16,7 +16,7 @@ * Braden Ewing <brewin@gmail.com> * Humdinger <humdingerb@gmail.com> * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t index a98bd420..3c492034 100644 --- a/sphinx/themes/nature/static/nature.css_t +++ b/sphinx/themes/nature/static/nature.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- nature theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/pyramid/layout.html b/sphinx/themes/pyramid/layout.html index 1887361e..8780ceae 100644 --- a/sphinx/themes/pyramid/layout.html +++ b/sphinx/themes/pyramid/layout.html @@ -1,4 +1,4 @@ -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {%- block extrahead %} <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Neuton&subset=latin" type="text/css" media="screen" charset="utf-8" /> diff --git a/sphinx/themes/pyramid/static/dialog-todo.png b/sphinx/themes/pyramid/static/dialog-todo.png Binary files differnew file mode 100644 index 00000000..babc4b6c --- /dev/null +++ b/sphinx/themes/pyramid/static/dialog-todo.png diff --git a/sphinx/themes/pyramid/static/pyramid.css_t b/sphinx/themes/pyramid/static/pyramid.css_t index 442cbec0..e3b2ae1e 100644 --- a/sphinx/themes/pyramid/static/pyramid.css_t +++ b/sphinx/themes/pyramid/static/pyramid.css_t @@ -1,5 +1,5 @@ /* - * pylons.css_t + * pyramid.css_t * ~~~~~~~~~~~~ * * Sphinx stylesheet -- pylons theme. @@ -220,6 +220,14 @@ div.admonition p.admonition-title + p { display: inline; } +div.admonition { + background: #eeeeec; + border: 2px solid #babdb6; + border-right-style: none; + border-left-style: none; + padding: 10px 20px 10px 60px; +} + div.highlight{ background-color: white; } @@ -255,8 +263,19 @@ div.warning { border-left-style: none; padding: 10px 20px 10px 60px; } + +div.admonition-todo { + background: #f2d9b4 url(dialog-todo.png) no-repeat 10px 8px; + border: 2px solid #e9b96e; + border-right-style: none; + border-left-style: none; + padding: 10px 20px 10px 60px; +} -p.admonition-title { +div.note p.admonition-title, +div.warning p.admonition-title, +div.seealso p.admonition-title, +div.admonition-todo p.admonition-title { display: none; } diff --git a/sphinx/themes/scrolls/layout.html b/sphinx/themes/scrolls/layout.html index 92cb694d..97f7ca1d 100644 --- a/sphinx/themes/scrolls/layout.html +++ b/sphinx/themes/scrolls/layout.html @@ -5,10 +5,10 @@ Sphinx layout template for the scrolls theme, originally written by Armin Ronacher. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {% set script_files = script_files + ['_static/theme_extras.js'] %} {% set css_files = css_files + ['_static/print.css'] %} {# do not display relbars #} diff --git a/sphinx/themes/scrolls/static/scrolls.css_t b/sphinx/themes/scrolls/static/scrolls.css_t index e3d26ea3..c335f167 100644 --- a/sphinx/themes/scrolls/static/scrolls.css_t +++ b/sphinx/themes/scrolls/static/scrolls.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- scrolls theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/sphinxdoc/layout.html b/sphinx/themes/sphinxdoc/layout.html index c9319185..4ffeb6ed 100644 --- a/sphinx/themes/sphinxdoc/layout.html +++ b/sphinx/themes/sphinxdoc/layout.html @@ -4,10 +4,10 @@ Sphinx layout template for the sphinxdoc theme. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. #} -{% extends "basic/layout.html" %} +{%- extends "basic/layout.html" %} {# put the sidebar before the body #} {% block sidebar1 %}{{ sidebar() }}{% endblock %} diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t index f535696b..af498257 100644 --- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t +++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css_t @@ -5,7 +5,7 @@ * Sphinx stylesheet -- sphinxdoc theme. Originally created by * Armin Ronacher for Werkzeug. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/themes/traditional/static/traditional.css_t b/sphinx/themes/traditional/static/traditional.css_t index 51567255..6c6bd5f5 100644 --- a/sphinx/themes/traditional/static/traditional.css_t +++ b/sphinx/themes/traditional/static/traditional.css_t @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- traditional docs.python.org theme. * - * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ diff --git a/sphinx/theming.py b/sphinx/theming.py index 68d11a49..dd20aa2b 100644 --- a/sphinx/theming.py +++ b/sphinx/theming.py @@ -5,7 +5,7 @@ Theming support for HTML builders. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 6cb83aec..8bedda12 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -5,7 +5,7 @@ Utility functions for Sphinx. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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)) @@ -286,6 +291,12 @@ class Tee(object): self.stream1.write(text) self.stream2.write(text) + def flush(self): + if hasattr(self.stream1, 'flush'): + self.stream1.flush() + if hasattr(self.stream2, 'flush'): + self.stream2.flush() + def parselinenos(spec, total): """Parse a line number spec (such as "1,2,4-6") and return a list of @@ -349,6 +360,29 @@ def split_into(n, type, value): return parts +def split_index_msg(type, value): + # new entry types must be listed in directives/other.py! + result = [] + try: + if type == 'single': + try: + result = split_into(2, 'single', value) + except ValueError: + result = split_into(1, 'single', value) + elif type == 'pair': + result = split_into(2, 'pair', value) + elif type == 'triple': + result = split_into(3, 'triple', value) + elif type == 'see': + result = split_into(2, 'see', value) + elif type == 'seealso': + result = split_into(2, 'see', value) + except ValueError: + pass + + return result + + def format_exception_cut_frames(x=1): """Format an exception with traceback, but only the last x frames.""" typ, val, tb = sys.exc_info() diff --git a/sphinx/util/compat.py b/sphinx/util/compat.py index bdb00845..916f6fa3 100644 --- a/sphinx/util/compat.py +++ b/sphinx/util/compat.py @@ -5,7 +5,7 @@ Stuff for docutils compatibility. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/console.py b/sphinx/util/console.py index ac85034d..b3b27a48 100644 --- a/sphinx/util/console.py +++ b/sphinx/util/console.py @@ -5,7 +5,7 @@ Format colored console output. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/docfields.py b/sphinx/util/docfields.py index 896319f5..961b09a7 100644 --- a/sphinx/util/docfields.py +++ b/sphinx/util/docfields.py @@ -6,7 +6,7 @@ "Doc fields" are reST field lists in object descriptions that will be domain-specifically transformed to a more appealing presentation. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/docstrings.py b/sphinx/util/docstrings.py index ba81bf00..d45b938d 100644 --- a/sphinx/util/docstrings.py +++ b/sphinx/util/docstrings.py @@ -5,7 +5,7 @@ Utilities for docstring processing. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/inspect.py b/sphinx/util/inspect.py index b5c3db59..8cd93eaf 100644 --- a/sphinx/util/inspect.py +++ b/sphinx/util/inspect.py @@ -5,7 +5,7 @@ Helpers for inspecting Python modules. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -27,13 +27,18 @@ if sys.version_info >= (2, 5): func = func.im_func parts = 0, () if type(func) is partial: - parts = len(func.args), func.keywords.keys() + keywords = func.keywords + if keywords is None: + keywords = {} + parts = len(func.args), keywords.keys() func = func.func if not inspect.isfunction(func): raise TypeError('%r is not a Python function' % func) args, varargs, varkw = inspect.getargs(func.func_code) func_defaults = func.func_defaults - if func_defaults: + if func_defaults is None: + func_defaults = [] + else: func_defaults = list(func_defaults) if parts[0]: args = args[parts[0]:] @@ -45,7 +50,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/jsdump.py b/sphinx/util/jsdump.py index 191e2419..51fe7338 100644 --- a/sphinx/util/jsdump.py +++ b/sphinx/util/jsdump.py @@ -6,7 +6,7 @@ This module implements a simple JavaScript serializer. Uses the basestring encode function from simplejson by Bob Ippolito. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/jsonimpl.py b/sphinx/util/jsonimpl.py index cf5ddb42..aa0ea825 100644 --- a/sphinx/util/jsonimpl.py +++ b/sphinx/util/jsonimpl.py @@ -5,7 +5,7 @@ JSON serializer implementation wrapper. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/matching.py b/sphinx/util/matching.py index fa6cb7e0..b4c71076 100644 --- a/sphinx/util/matching.py +++ b/sphinx/util/matching.py @@ -5,7 +5,7 @@ Pattern-matching utility functions for Sphinx. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/nodes.py b/sphinx/util/nodes.py index dbedb7f2..90e674b6 100644 --- a/sphinx/util/nodes.py +++ b/sphinx/util/nodes.py @@ -5,7 +5,7 @@ Docutils node-related utility functions for Sphinx. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -43,6 +43,22 @@ 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] + # workaround: nodes.caption doesn't have source, line. + # this issue was filed to Docutils tracker: + # sf.net/tracker/?func=detail&aid=3599485&group_id=38414&atid=422032 + if isinstance(node, nodes.caption) and not node.source: + node.source = node.parent.source + node.line = 0 #need fix docutils to get `node.line` + if not node.source: continue # built-in message if isinstance(node, IGNORED_NODES): @@ -58,6 +74,19 @@ def extract_messages(doctree): yield node, msg +def traverse_translatable_index(doctree): + """Traverse translatable index node from a document tree.""" + def is_block_index(node): + return isinstance(node, addnodes.index) and \ + node.get('inline') == False + for node in doctree.traverse(is_block_index): + if 'raw_entries' in node: + entries = node['raw_entries'] + else: + entries = node['entries'] + yield node, entries + + def nested_parse_with_titles(state, content, node): """Version of state.nested_parse() that allows titles and does not require titles to have the same decoration as the calling document. diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py index 131c6b9c..7322289e 100644 --- a/sphinx/util/osutil.py +++ b/sphinx/util/osutil.py @@ -5,7 +5,7 @@ Operating system-related utility functions for Sphinx. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -51,7 +51,7 @@ def relative_uri(base, to): # returns '', not 'index.html' return '' if len(b2) == 1 and t2 == ['']: - # Special case: relative_uri('f/index.html','f/') should + # Special case: relative_uri('f/index.html','f/') should # return './', not '' return '.' + SEP return ('..' + SEP) * (len(b2)-1) + SEP.join(t2) @@ -144,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 @@ -156,3 +157,6 @@ def find_catalog(docname, compaction): ret = docname return ret + +fs_encoding = sys.getfilesystemencoding() or sys.getdefaultencoding() + diff --git a/sphinx/util/png.py b/sphinx/util/png.py index 50c72efd..3adabadf 100644 --- a/sphinx/util/png.py +++ b/sphinx/util/png.py @@ -5,7 +5,7 @@ PNG image manipulation helpers. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py index 9e081b02..b373c504 100644 --- a/sphinx/util/pycompat.py +++ b/sphinx/util/pycompat.py @@ -5,7 +5,7 @@ Stuff for Python version compatibility. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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 start + return join(*rel_list) + del curdir + # ------------------------------------------------------------------------------ # Missing builtins and codecs in Python < 2.5 diff --git a/sphinx/util/tags.py b/sphinx/util/tags.py index 7499634d..a6e62140 100644 --- a/sphinx/util/tags.py +++ b/sphinx/util/tags.py @@ -3,7 +3,7 @@ sphinx.util.tags ~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/texescape.py b/sphinx/util/texescape.py index 1f6f76e6..926208a0 100644 --- a/sphinx/util/texescape.py +++ b/sphinx/util/texescape.py @@ -5,7 +5,7 @@ TeX escaping helper. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/util/websupport.py b/sphinx/util/websupport.py index d9b47213..a20947a8 100644 --- a/sphinx/util/websupport.py +++ b/sphinx/util/websupport.py @@ -3,7 +3,7 @@ sphinx.util.websupport ~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/versioning.py b/sphinx/versioning.py index d45ed1d3..a16751bb 100644 --- a/sphinx/versioning.py +++ b/sphinx/versioning.py @@ -6,7 +6,7 @@ Implements the low-level algorithms Sphinx uses for the versioning of doctrees. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from uuid import uuid4 diff --git a/sphinx/websupport/__init__.py b/sphinx/websupport/__init__.py index 72864a17..55d56fa0 100644 --- a/sphinx/websupport/__init__.py +++ b/sphinx/websupport/__init__.py @@ -5,7 +5,7 @@ Base Module for web support functions. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/errors.py b/sphinx/websupport/errors.py index 225b10c8..a0bc0737 100644 --- a/sphinx/websupport/errors.py +++ b/sphinx/websupport/errors.py @@ -5,7 +5,7 @@ Contains Error classes for the web support package. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/search/__init__.py b/sphinx/websupport/search/__init__.py index 385c3fa9..a5b40117 100644 --- a/sphinx/websupport/search/__init__.py +++ b/sphinx/websupport/search/__init__.py @@ -5,7 +5,7 @@ Server side search support for the web support package. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -102,7 +102,7 @@ class BaseSearch(object): res = self.context_re.search(text) if res is None: return '' - context_start = max(res.start() - length/2, 0) + context_start = max(res.start() - int(length/2), 0) context_end = context_start + length context = ''.join([context_start > 0 and '...' or '', text[context_start:context_end], diff --git a/sphinx/websupport/search/nullsearch.py b/sphinx/websupport/search/nullsearch.py index 61f2d2fb..bfa78ce7 100644 --- a/sphinx/websupport/search/nullsearch.py +++ b/sphinx/websupport/search/nullsearch.py @@ -5,7 +5,7 @@ The default search adapter, does nothing. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/search/whooshsearch.py b/sphinx/websupport/search/whooshsearch.py index 1ed3d714..f6343e7e 100644 --- a/sphinx/websupport/search/whooshsearch.py +++ b/sphinx/websupport/search/whooshsearch.py @@ -5,7 +5,7 @@ Whoosh search adapter. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/search/xapiansearch.py b/sphinx/websupport/search/xapiansearch.py index 0615be84..6476a71d 100644 --- a/sphinx/websupport/search/xapiansearch.py +++ b/sphinx/websupport/search/xapiansearch.py @@ -5,7 +5,7 @@ Xapian search adapter. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/storage/__init__.py b/sphinx/websupport/storage/__init__.py index 77292812..871aa03b 100644 --- a/sphinx/websupport/storage/__init__.py +++ b/sphinx/websupport/storage/__init__.py @@ -5,7 +5,7 @@ Storage for the websupport package. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/storage/differ.py b/sphinx/websupport/storage/differ.py index fb3b8dc9..e088f982 100644 --- a/sphinx/websupport/storage/differ.py +++ b/sphinx/websupport/storage/differ.py @@ -5,7 +5,7 @@ A differ for creating an HTML representations of proposal diffs - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/storage/sqlalchemy_db.py b/sphinx/websupport/storage/sqlalchemy_db.py index 67136d1a..587b2741 100644 --- a/sphinx/websupport/storage/sqlalchemy_db.py +++ b/sphinx/websupport/storage/sqlalchemy_db.py @@ -6,7 +6,7 @@ SQLAlchemy table and mapper definitions used by the :class:`sphinx.websupport.storage.sqlalchemystorage.SQLAlchemyStorage`. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/websupport/storage/sqlalchemystorage.py b/sphinx/websupport/storage/sqlalchemystorage.py index e6eccfe9..56528f4b 100644 --- a/sphinx/websupport/storage/sqlalchemystorage.py +++ b/sphinx/websupport/storage/sqlalchemystorage.py @@ -5,7 +5,7 @@ An SQLAlchemy storage backend. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -116,7 +116,7 @@ class SQLAlchemyStorage(StorageBackend): def get_metadata(self, docname, moderator): session = Session() subquery = session.query( - Comment.id, Comment.node_id, + Comment.node_id, func.count('*').label('comment_count')).group_by( Comment.node_id).subquery() nodes = session.query(Node.id, subquery.c.comment_count).outerjoin( diff --git a/sphinx/writers/__init__.py b/sphinx/writers/__init__.py index 880e4fdb..40db0d69 100644 --- a/sphinx/writers/__init__.py +++ b/sphinx/writers/__init__.py @@ -5,6 +5,6 @@ Custom docutils writers. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/writers/html.py b/sphinx/writers/html.py index 2051e38e..252cedc4 100644 --- a/sphinx/writers/html.py +++ b/sphinx/writers/html.py @@ -5,7 +5,7 @@ docutils writers handling Sphinx' custom nodes. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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): @@ -200,7 +203,7 @@ class HTMLTranslator(BaseTranslator): def visit_admonition(self, node, name=''): self.body.append(self.starttag( node, 'div', CLASS=('admonition ' + name))) - if name and name != 'seealso': + if name: node.insert(0, nodes.title(name, admonitionlabels[name])) self.set_first_last(node) diff --git a/sphinx/writers/latex.py b/sphinx/writers/latex.py index e5ef3a61..fc5da416 100644 --- a/sphinx/writers/latex.py +++ b/sphinx/writers/latex.py @@ -8,7 +8,7 @@ Much of this code is adapted from Dave Kuhlman's "docpy" writer from his docutils sandbox. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -100,8 +100,9 @@ class LaTeXWriter(writers.Writer): class ExtBabel(Babel): def get_shorthandoff(self): shortlang = self.language.split('_')[0] - if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', 'es', 'spanish', - 'nl', 'dutch', 'pl', 'polish', 'it', 'italian'): + if shortlang in ('de', 'ngerman', 'sl', 'slovene', 'pt', 'portuges', + 'es', 'spanish', 'nl', 'dutch', 'pl', 'polish', 'it', + 'italian'): return '\\shorthandoff{"}' return '' @@ -134,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}', @@ -205,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) @@ -293,7 +297,7 @@ class LaTeXTranslator(nodes.NodeVisitor): if i > 0: ret.append('\\indexspace\n') ret.append('\\bigletter{%s}\n' % - letter.translate(tex_escape_map)) + unicode(letter).translate(tex_escape_map)) for entry in entries: if not entry[3]: continue diff --git a/sphinx/writers/manpage.py b/sphinx/writers/manpage.py index 81f2988b..cca2d074 100644 --- a/sphinx/writers/manpage.py +++ b/sphinx/writers/manpage.py @@ -5,7 +5,7 @@ Manual page writer, extended for Sphinx custom nodes. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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 = [] @@ -341,5 +340,13 @@ class ManualPageTranslator(BaseTranslator): self.body.append(node.astext()) raise nodes.SkipNode + def visit_meta(self, node): + raise nodes.SkipNode + + def visit_inline(self, node): + pass + def depart_inline(self, node): + pass + def unknown_visit(self, node): raise NotImplementedError('Unknown node: ' + node.__class__.__name__) diff --git a/sphinx/writers/texinfo.py b/sphinx/writers/texinfo.py index 5799e023..a8306c11 100644 --- a/sphinx/writers/texinfo.py +++ b/sphinx/writers/texinfo.py @@ -5,7 +5,7 @@ Custom docutils writer for Texinfo. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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')) @@ -1175,7 +1179,7 @@ class TexinfoTranslator(nodes.NodeVisitor): for id in production.get('ids'): self.add_anchor(id, production) s = production['tokenname'].ljust(maxlen) + ' ::=' - lastname = production['tokenname'] + ##lastname = production['tokenname'] else: s = '%s ' % (' '*maxlen) self.body.append(self.escape(s)) diff --git a/sphinx/writers/text.py b/sphinx/writers/text.py index e5ab070c..81c785ee 100644 --- a/sphinx/writers/text.py +++ b/sphinx/writers/text.py @@ -5,7 +5,7 @@ Custom docutils writer for plain text. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import os @@ -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): @@ -270,11 +271,6 @@ class TextTranslator(nodes.NodeVisitor): self.end_state(wrap=False) raise nodes.SkipNode - def visit_seealso(self, node): - self.new_state() - def depart_seealso(self, node): - self.end_state(first='') - def visit_footnote(self, node): self._footnote = node.children[0].astext().strip() self.new_state(len(self._footnote) + 3) @@ -293,6 +289,11 @@ class TextTranslator(nodes.NodeVisitor): def visit_label(self, node): raise nodes.SkipNode + def visit_legend(self, node): + pass + def depart_legend(self, node): + pass + # XXX: option list could use some better styling def visit_option_list(self, node): @@ -572,6 +573,8 @@ class TextTranslator(nodes.NodeVisitor): depart_tip = _make_depart_admonition('tip') visit_warning = _visit_admonition depart_warning = _make_depart_admonition('warning') + visit_seealso = _visit_admonition + depart_seealso = _make_depart_admonition('seealso') def visit_versionmodified(self, node): self.new_state(0) @@ -593,14 +596,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 +716,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/websupport.py b/sphinx/writers/websupport.py index f75cd47b..71a9ba00 100644 --- a/sphinx/writers/websupport.py +++ b/sphinx/writers/websupport.py @@ -5,7 +5,7 @@ sphinx.websupport writer that adds comment-related annotations. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/sphinx/writers/xml.py b/sphinx/writers/xml.py new file mode 100644 index 00000000..9f1fc762 --- /dev/null +++ b/sphinx/writers/xml.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +""" + sphinx.writers.xml + ~~~~~~~~~~~~~~~~~~ + + Docutils-native XML and pseudo-XML writers. + + :copyright: Copyright 2007-2013 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 + + +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 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/path.py b/tests/path.py index 8e9afeaa..bd0552d7 100644 --- a/tests/path.py +++ b/tests/path.py @@ -16,16 +16,16 @@ from codecs import open FILESYSTEMENCODING = sys.getfilesystemencoding() or sys.getdefaultencoding() -class path(str): +class path(unicode): """ Represents a path which behaves like a string. """ if sys.version_info < (3, 0): def __new__(cls, s, encoding=FILESYSTEMENCODING, errors='strict'): - if isinstance(s, unicode): - s = s.encode(encoding, errors=errors) - return str.__new__(cls, s) - return str.__new__(cls, s) + if isinstance(s, str): + s = s.decode(encoding, errors) + return unicode.__new__(cls, s) + return unicode.__new__(cls, s) @property def parent(self): @@ -193,4 +193,4 @@ class path(str): __div__ = __truediv__ = joinpath def __repr__(self): - return '%s(%s)' % (self.__class__.__name__, str.__repr__(self)) + return '%s(%s)' % (self.__class__.__name__, unicode.__repr__(self)) diff --git a/tests/root/Makefile b/tests/root/Makefile index e9c11d06..7954bc7c 100644 --- a/tests/root/Makefile +++ b/tests/root/Makefile @@ -23,7 +23,7 @@ help: @echo " linkcheck to check all external links for integrity" clean: - -rm -rf _build/* + rm -rf _build/* html: mkdir -p _build/html _build/doctrees 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..37b9127e 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', @@ -54,6 +55,11 @@ texinfo_documents = [ 'Georg Brandl \\and someone else', 'Sphinx Testing', 'Miscellaneous'), ] +man_pages = [ + ('contents', 'SphinxTests', 'Sphinx Tests Documentation', + 'Georg Brandl and someone else', 1), +] + value_from_conf_py = 84 coverage_c_path = ['special/*.h'] @@ -67,6 +73,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 ad246cb7..de60ec6d 100644 --- a/tests/root/contents.txt +++ b/tests/root/contents.txt @@ -27,7 +27,7 @@ Contents: doctest extensions versioning/index - only + footnote Python <http://python.org/> diff --git a/tests/root/footnote.txt b/tests/root/footnote.txt new file mode 100644 index 00000000..c1359dfe --- /dev/null +++ b/tests/root/footnote.txt @@ -0,0 +1,40 @@ +:tocdepth: 2 + +Testing footnote and citation +================================ +.. #1058 footnote-backlinks-do-not-work + +numbered footnote +-------------------- + +[1]_ + +auto-numbered footnote +------------------------------ + +[#]_ + +named footnote +-------------------- + +[#foo]_ + +citation +-------------------- + +[bar]_ + +footenotes +-------------------- + +.. rubric:: Footnotes + +.. [1] numbered + +.. [#] auto numbered + +.. [#foo] named + +.. rubric:: Citations + +.. [bar] cite diff --git a/tests/root/markup.txt b/tests/root/markup.txt index dde13a6b..cbfbbbe3 100644 --- a/tests/root/markup.txt +++ b/tests/root/markup.txt @@ -191,6 +191,10 @@ Figures My caption of the figure + My description paragraph of the figure. + + Description paragraph is wraped with legend node. + Version markup -------------- diff --git a/tests/roots/test-intl/bom.po b/tests/roots/test-intl/bom.po new file mode 100644 index 00000000..c6025eb1 --- /dev/null +++ b/tests/roots/test-intl/bom.po @@ -0,0 +1,12 @@ +#, fuzzy +msgid "" +msgstr "" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "File with UTF-8 BOM" +msgstr "Datei mit UTF-8" + +msgid "This file has a UTF-8 \"BOM\"." +msgstr "This file has umlauts: äöü." diff --git a/tests/roots/test-intl/bom.txt b/tests/roots/test-intl/bom.txt new file mode 100644 index 00000000..3fea824f --- /dev/null +++ b/tests/roots/test-intl/bom.txt @@ -0,0 +1,5 @@ +File with UTF-8 BOM +=================== + +This file has a UTF-8 "BOM". + diff --git a/tests/roots/test-intl/conf.py b/tests/roots/test-intl/conf.py new file mode 100644 index 00000000..457c5056 --- /dev/null +++ b/tests/roots/test-intl/conf.py @@ -0,0 +1,7 @@ +# -*- coding: utf-8 -*- + +import sys, os + +project = 'Sphinx intl <Tests>' +source_suffix = '.txt' +keep_warnings = True diff --git a/tests/roots/test-intl/contents.txt b/tests/roots/test-intl/contents.txt new file mode 100644 index 00000000..4ece2621 --- /dev/null +++ b/tests/roots/test-intl/contents.txt @@ -0,0 +1,14 @@ +.. toctree:: + :maxdepth: 2 + :numbered: + + subdir/contents + bom + footnote + external_links + refs_inconsistency + literalblock + seealso + definition_terms + figure_caption + index_entries diff --git a/tests/roots/test-intl/definition_terms.po b/tests/roots/test-intl/definition_terms.po new file mode 100644 index 00000000..2c3a3bca --- /dev/null +++ b/tests/roots/test-intl/definition_terms.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: 2013-01-01 05:00\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 definition terms"
+msgstr "I18N WITH DEFINITION TERMS"
+
+msgid "Some term"
+msgstr "SOME TERM"
+
+msgid "The corresponding definition"
+msgstr "THE CORRESPONDING DEFINITION"
+
+msgid "Some other term"
+msgstr "SOME OTHER TERM"
+
+msgid "The corresponding definition #2"
+msgstr "THE CORRESPONDING DEFINITION #2"
diff --git a/tests/roots/test-intl/definition_terms.txt b/tests/roots/test-intl/definition_terms.txt new file mode 100644 index 00000000..9891401d --- /dev/null +++ b/tests/roots/test-intl/definition_terms.txt @@ -0,0 +1,11 @@ +:tocdepth: 2 + +i18n with definition terms +========================== + +Some term + The corresponding definition + +Some other term + The corresponding definition #2 + diff --git a/tests/roots/test-intl/external_links.po b/tests/roots/test-intl/external_links.po new file mode 100644 index 00000000..4cd19dda --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/external_links.txt b/tests/roots/test-intl/external_links.txt new file mode 100644 index 00000000..7ac1db02 --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/figure_caption.po b/tests/roots/test-intl/figure_caption.po new file mode 100644 index 00000000..01b4c041 --- /dev/null +++ b/tests/roots/test-intl/figure_caption.po @@ -0,0 +1,29 @@ +# 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: 2013-01-04 7:00\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 figure caption"
+msgstr "I18N WITH FIGURE CAPTION"
+
+msgid "My caption of the figure"
+msgstr "MY CAPTION OF THE FIGURE"
+
+msgid "My description paragraph1 of the figure."
+msgstr "MY DESCRIPTION PARAGRAPH1 OF THE FIGURE."
+
+msgid "My description paragraph2 of the figure."
+msgstr "MY DESCRIPTION PARAGRAPH2 OF THE FIGURE."
diff --git a/tests/roots/test-intl/figure_caption.txt b/tests/roots/test-intl/figure_caption.txt new file mode 100644 index 00000000..75567b3a --- /dev/null +++ b/tests/roots/test-intl/figure_caption.txt @@ -0,0 +1,12 @@ +:tocdepth: 2 + +i18n with figure caption +======================== + +.. figure:: i18n.png + + My caption of the figure + + My description paragraph1 of the figure. + + My description paragraph2 of the figure. diff --git a/tests/roots/test-intl/footnote.po b/tests/roots/test-intl/footnote.po new file mode 100644 index 00000000..47f8d3db --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/footnote.txt b/tests/roots/test-intl/footnote.txt new file mode 100644 index 00000000..3ef76bba --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/i18n.png b/tests/roots/test-intl/i18n.png Binary files differnew file mode 100644 index 00000000..72c12d13 --- /dev/null +++ b/tests/roots/test-intl/i18n.png diff --git a/tests/roots/test-intl/index_entries.po b/tests/roots/test-intl/index_entries.po new file mode 100644 index 00000000..6da9a813 --- /dev/null +++ b/tests/roots/test-intl/index_entries.po @@ -0,0 +1,77 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2013, foo +# This file is distributed under the same license as the foo package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: foo foo\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2013-01-05 18:10\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 index entries" +msgstr "" + +msgid "index target section" +msgstr "" + +msgid "this is :index:`Newsletter` target paragraph." +msgstr "THIS IS :index:`NEWSLETTER` TARGET PARAGRAPH." + +msgid "various index entries" +msgstr "" + +msgid "That's all." +msgstr "" + +msgid "Mailing List" +msgstr "MAILING LIST" + +msgid "Newsletter" +msgstr "NEWSLETTER" + +msgid "Recipients List" +msgstr "RECIPIENTS LIST" + +msgid "First" +msgstr "FIRST" + +msgid "Second" +msgstr "SECOND" + +msgid "Third" +msgstr "THIRD" + +msgid "Entry" +msgstr "ENTRY" + +msgid "See" +msgstr "SEE" + +msgid "Module" +msgstr "MODULE" + +msgid "Keyword" +msgstr "KEYWORD" + +msgid "Operator" +msgstr "OPERATOR" + +msgid "Object" +msgstr "OBJECT" + +msgid "Exception" +msgstr "EXCEPTION" + +msgid "Statement" +msgstr "STATEMENT" + +msgid "Builtin" +msgstr "BUILTIN" diff --git a/tests/roots/test-intl/index_entries.txt b/tests/roots/test-intl/index_entries.txt new file mode 100644 index 00000000..c914a4b4 --- /dev/null +++ b/tests/roots/test-intl/index_entries.txt @@ -0,0 +1,31 @@ +:tocdepth: 2 + +i18n with index entries +======================= + +.. index:: + single: Mailing List + pair: Newsletter; Recipients List + +index target section +-------------------- + +this is :index:`Newsletter` target paragraph. + + +various index entries +--------------------- + +.. index:: + triple: First; Second; Third + see: Entry; Mailing List + seealso: See; Newsletter + module: Module + keyword: Keyword + operator: Operator + object: Object + exception: Exception + statement: Statement + builtin: Builtin + +That's all. diff --git a/tests/roots/test-intl/literalblock.po b/tests/roots/test-intl/literalblock.po new file mode 100644 index 00000000..8ea83b3b --- /dev/null +++ b/tests/roots/test-intl/literalblock.po @@ -0,0 +1,30 @@ +# 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 literal block" +msgstr "I18N WITH LITERAL BLOCK" + +msgid "Correct literal block::" +msgstr "CORRECT LITERAL BLOCK::" + +msgid "Missing literal block::" +msgstr "MISSING LITERAL BLOCK::" + +msgid "That's all." +msgstr "THAT'S ALL." + diff --git a/tests/roots/test-intl/literalblock.txt b/tests/roots/test-intl/literalblock.txt new file mode 100644 index 00000000..c9c71099 --- /dev/null +++ b/tests/roots/test-intl/literalblock.txt @@ -0,0 +1,13 @@ +:tocdepth: 2 + +i18n with literal block +========================= + +Correct literal block:: + + this is + literal block + +Missing literal block:: + +That's all. diff --git a/tests/roots/test-intl/refs_inconsistency.po b/tests/roots/test-intl/refs_inconsistency.po new file mode 100644 index 00000000..9cab687f --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/refs_inconsistency.txt b/tests/roots/test-intl/refs_inconsistency.txt new file mode 100644 index 00000000..c65c5b45 --- /dev/null +++ b/tests/roots/test-intl/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/roots/test-intl/seealso.po b/tests/roots/test-intl/seealso.po new file mode 100644 index 00000000..d3b27e51 --- /dev/null +++ b/tests/roots/test-intl/seealso.po @@ -0,0 +1,33 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2010, Georg Brandl & Team +# This file is distributed under the same license as the Sphinx <Tests> package. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Sphinx <Tests> 0.6\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2012-12-16 06:06\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 seealso" +msgstr "I18N WITH SEEALSO" + +msgid "short text 1" +msgstr "SHORT TEXT 1" + +msgid "long text 1" +msgstr "LONG TEXT 1" + +msgid "short text 2" +msgstr "SHORT TEXT 2" + +msgid "long text 2" +msgstr "LONG TEXT 2" + diff --git a/tests/roots/test-intl/seealso.txt b/tests/roots/test-intl/seealso.txt new file mode 100644 index 00000000..ed885997 --- /dev/null +++ b/tests/roots/test-intl/seealso.txt @@ -0,0 +1,15 @@ +:tocdepth: 2 + +i18n with seealso +============================ +.. #960 directive-seelaso-ignored-in-the-gettext + +.. seealso:: short text 1 + +.. seealso:: + + long text 1 + +.. seealso:: short text 2 + + long text 2 diff --git a/tests/roots/test-intl/subdir/contents.txt b/tests/roots/test-intl/subdir/contents.txt new file mode 100644 index 00000000..b6509baf --- /dev/null +++ b/tests/roots/test-intl/subdir/contents.txt @@ -0,0 +1,2 @@ +subdir contents
+===============
diff --git a/tests/roots/test-only-directive/conf.py b/tests/roots/test-only-directive/conf.py new file mode 100644 index 00000000..bcb4305d --- /dev/null +++ b/tests/roots/test-only-directive/conf.py @@ -0,0 +1,2 @@ + +project = 'test-only-directive' diff --git a/tests/roots/test-only-directive/contents.rst b/tests/roots/test-only-directive/contents.rst new file mode 100644 index 00000000..9a93be9e --- /dev/null +++ b/tests/roots/test-only-directive/contents.rst @@ -0,0 +1,6 @@ +test-only-directive +=================== + +.. toctree:: + + only diff --git a/tests/root/only.txt b/tests/roots/test-only-directive/only.rst index 4a3eb48a..4a3eb48a 100644 --- a/tests/root/only.txt +++ b/tests/roots/test-only-directive/only.rst diff --git a/tests/run.py b/tests/run.py index ee63fa3f..c0ae0d23 100755 --- a/tests/run.py +++ b/tests/run.py @@ -6,24 +6,29 @@ This script runs the Sphinx unit test suite. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ 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..6495dc2c 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -5,13 +5,14 @@ Test the Sphinx class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ 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 6dedaad8..be6c4ec9 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -6,7 +6,7 @@ Test the autodoc extension. This tests mainly the Documenters; the auto directives are tested in a test source file translated by test_build. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -182,6 +182,20 @@ def test_format_signature(): # test processing by event handler assert formatsig('method', 'bar', H.foo1, None, None) == '42' + # test functions created via functools.partial + from functools import partial + curried1 = partial(lambda a, b, c: None, 'A') + assert formatsig('function', 'curried1', curried1, None, None) == \ + '(b, c)' + curried2 = partial(lambda a, b, c=42: None, 'A') + assert formatsig('function', 'curried2', curried2, None, None) == \ + '(b, c=42)' + curried3 = partial(lambda a, b, *c: None, 'A') + assert formatsig('function', 'curried3', curried3, None, None) == \ + '(b, *c)' + curried4 = partial(lambda a, b, c=42, *d, **e: None, 'A') + assert formatsig('function', 'curried4', curried4, None, None) == \ + '(b, c=42, *d, **e)' def test_get_doc(): def getdocl(objtype, obj, encoding=None): @@ -386,10 +400,10 @@ def test_generate(): assert_warns("import for autodocumenting 'foobar'", 'function', 'foobar', more_content=None) # importing - assert_warns("import/find module 'test_foobar'", + assert_warns("failed to import module 'test_foobar'", 'module', 'test_foobar', more_content=None) # attributes missing - assert_warns("import/find function 'util.foobar'", + assert_warns("failed to import function 'foobar' from module 'util'", 'function', 'util.foobar', more_content=None) # test auto and given content mixing @@ -540,6 +554,39 @@ 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'] + + # test descriptor class documentation + options.members = ['CustomDataDescriptor'] + assert_result_contains('.. py:class:: CustomDataDescriptor(doc)', + 'module', 'test_autodoc') + assert_result_contains(' .. py:method:: CustomDataDescriptor.meth()', + 'module', 'test_autodoc') # --- generate fodder ------------ @@ -565,6 +612,10 @@ class CustomDataDescriptor(object): return self return 42 + def meth(self): + """Function.""" + return "The Answer" + def _funky_classmethod(name, b, c, d, docstring=None): """Generates a classmethod for a class from a template by filling out some arguments.""" @@ -680,3 +731,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_autosummary.py b/tests/test_autosummary.py index 048940d0..dab72c1e 100644 --- a/tests/test_autosummary.py +++ b/tests/test_autosummary.py @@ -5,7 +5,7 @@ Test the autosummary extension. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_build.py b/tests/test_build.py index 5f24f89a..c2f0b38d 100644 --- a/tests/test_build.py +++ b/tests/test_build.py @@ -5,11 +5,12 @@ Test all builders that have no special checks. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ from util import * +from textwrap import dedent def teardown_module(): @@ -57,7 +58,35 @@ else: @with_app(buildername='man') def test_man(app): app.builder.build_all() + assert (app.outdir / 'SphinxTests.1').exists() @with_app(buildername='singlehtml', cleanenv=True) 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) + mb_name = u'\u65e5\u672c\u8a9e' + (srcdir / mb_name).makedirs() + (srcdir / mb_name / (mb_name + '.txt')).write_text(dedent(""" + multi byte file name page + ========================== + """)) + + master_doc = srcdir / 'contents.txt' + master_doc.write_bytes((master_doc.text() + dedent(""" + .. toctree:: + + %(mb_name)s/%(mb_name)s + """ % locals()) + ).encode('utf-8')) + app.builder.build_all() diff --git a/tests/test_build_gettext.py b/tests/test_build_gettext.py index ab68289e..f6cb4b8e 100644 --- a/tests/test_build_gettext.py +++ b/tests/test_build_gettext.py @@ -11,6 +11,7 @@ import gettext import os +import re from subprocess import Popen, PIPE from util import * @@ -19,6 +20,7 @@ from util import SkipTest def teardown_module(): (test_root / '_build').rmtree(True) + (test_roots / 'test-intl' / '_build').rmtree(True), @with_app(buildername='gettext') @@ -38,6 +40,14 @@ def test_build(app): @with_app(buildername='gettext') +def test_seealso(app): + # regression test for issue #960 + app.builder.build(['markup']) + catalog = (app.outdir / 'markup.pot').text(encoding='utf-8') + assert 'msgid "something, something else, something more"' in catalog + + +@with_app(buildername='gettext') def test_gettext(app): app.builder.build(['markup']) @@ -79,3 +89,51 @@ def test_gettext(app): _ = gettext.translation('test_root', app.outdir, languages=['en']).gettext assert _("Testing various markup") == u"Testing various markup" + + +@with_app(buildername='gettext', + srcdir=(test_roots / 'test-intl'), + doctreedir=(test_roots / 'test-intl' / '_build' / 'doctree'), + confoverrides={'gettext_compact': False}) +def test_gettext_index_entries(app): + # regression test for #976 + app.builder.build(['index_entries']) + + _msgid_getter = re.compile(r'msgid "(.*)"').search + def msgid_getter(msgid): + m = _msgid_getter(msgid) + if m: + return m.groups()[0] + return None + + pot = (app.outdir / 'index_entries.pot').text(encoding='utf-8') + msgids = filter(None, map(msgid_getter, pot.splitlines())) + + expected_msgids = [ + "i18n with index entries", + "index target section", + "this is :index:`Newsletter` target paragraph.", + "various index entries", + "That's all.", + "Mailing List", + "Newsletter", + "Recipients List", + "First", + "Second", + "Third", + "Entry", + "See", + "Module", + "Keyword", + "Operator", + "Object", + "Exception", + "Statement", + "Builtin", + ] + for expect in expected_msgids: + assert expect in msgids + msgids.remove(expect) + + # unexpected msgid existent + assert msgids == [] diff --git a/tests/test_build_html.py b/tests/test_build_html.py index a38806a8..abd60bbb 100644 --- a/tests/test_build_html.py +++ b/tests/test_build_html.py @@ -5,7 +5,7 @@ Test the HTML builder and check output against XPath. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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..721b3a2d 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -5,7 +5,7 @@ Test the build process with LaTeX builder with the test root. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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..37ad0582 100644 --- a/tests/test_build_texinfo.py +++ b/tests/test_build_texinfo.py @@ -5,7 +5,7 @@ Test the build process with Texinfo builder with the test root. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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_config.py b/tests/test_config.py index b07a71bf..69858a20 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -6,7 +6,7 @@ Test the sphinx.config.Config class and its handling in the Application class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys diff --git a/tests/test_coverage.py b/tests/test_coverage.py index c554c52c..88c66140 100644 --- a/tests/test_coverage.py +++ b/tests/test_coverage.py @@ -5,7 +5,7 @@ Test the coverage builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_cpp_domain.py b/tests/test_cpp_domain.py index 3ab8ece4..db2589d5 100644 --- a/tests/test_cpp_domain.py +++ b/tests/test_cpp_domain.py @@ -5,13 +5,13 @@ Tests the C++ Domain - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ 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_doctest.py b/tests/test_doctest.py index 577fcb00..4934e716 100644 --- a/tests/test_doctest.py +++ b/tests/test_doctest.py @@ -5,7 +5,7 @@ Test the doctest extension. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_env.py b/tests/test_env.py index 2f75187f..12e0719d 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -5,7 +5,7 @@ Test the BuildEnvironment class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import sys diff --git a/tests/test_footnote.py b/tests/test_footnote.py new file mode 100644 index 00000000..3a3d5967 --- /dev/null +++ b/tests/test_footnote.py @@ -0,0 +1,37 @@ +# -*- coding: utf-8 -*- +""" + test_footnote + ~~~~~~~~~~~~~ + + Test for footnote and citation. + + :copyright: Copyright 2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" + +import re + +from util import * + + +def teardown_module(): + (test_root / '_build').rmtree(True) + + +@with_app(buildername='html') +def test_html(app): + app.builder.build(['footnote']) + result = (app.outdir / 'footnote.html').text(encoding='utf-8') + expects = [ + '<a class="footnote-reference" href="#id5" id="id1">[1]</a>', + '<a class="footnote-reference" href="#id6" id="id2">[2]</a>', + '<a class="footnote-reference" href="#foo" id="id3">[3]</a>', + '<a class="reference internal" href="#bar" id="id4">[bar]</a>', + '<a class="fn-backref" href="#id1">[1]</a>', + '<a class="fn-backref" href="#id2">[2]</a>', + '<a class="fn-backref" href="#id3">[3]</a>', + '<a class="fn-backref" href="#id4">[bar]</a>', + ] + for expect in expects: + matches = re.findall(re.escape(expect), result) + assert len(matches) == 1 diff --git a/tests/test_highlighting.py b/tests/test_highlighting.py index 949552c1..b392193d 100644 --- a/tests/test_highlighting.py +++ b/tests/test_highlighting.py @@ -5,7 +5,7 @@ Test the Pygments highlighting bridge. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_i18n.py b/tests/test_i18n.py index 930108e9..210243e7 100644 --- a/tests/test_i18n.py +++ b/tests/test_i18n.py @@ -5,7 +5,7 @@ Test locale features. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_intersphinx.py b/tests/test_intersphinx.py index 55320eae..0171ae03 100644 --- a/tests/test_intersphinx.py +++ b/tests/test_intersphinx.py @@ -5,7 +5,7 @@ Test the intersphinx extension. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_intl.py b/tests/test_intl.py index d1e28002..b5cd1c96 100644 --- a/tests/test_intl.py +++ b/tests/test_intl.py @@ -11,43 +11,68 @@ """ from subprocess import Popen, PIPE +import re +import os +from StringIO import StringIO + +from sphinx.util.pycompat import relpath from util import * from util import SkipTest +warnfile = StringIO() +root = test_roots / 'test-intl' +doctreedir = root / '_build' / 'doctree' + + +def with_intl_app(*args, **kw): + default_kw = { + 'srcdir': root, + 'doctreedir': doctreedir, + 'confoverrides': { + 'language': 'xx', 'locale_dirs': ['.'], + 'gettext_compact': False, + }, + } + default_kw.update(kw) + return with_app(*args, **default_kw) + + def setup_module(): - (test_root / 'xx' / 'LC_MESSAGES').makedirs() + # Delete remnants left over after failed build + (root / 'xx').rmtree(True) + (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(root): + dirpath = path(dirpath) + for f in [f for f in files if f.endswith('.po')]: + po = dirpath / f + mo = root / 'xx' / 'LC_MESSAGES' / ( + relpath(po[:-3], root) + '.mo') + if not mo.parent.exists(): + mo.parent.makedirs() + try: + p = Popen(['msgfmt', po, '-o', mo], + stdout=PIPE, stderr=PIPE) + except OSError: + 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(): - (test_root / '_build').rmtree(True) - (test_root / 'xx').rmtree(True) + (root / '_build').rmtree(True) + (root / 'xx').rmtree(True) -@with_app(buildername='text', - confoverrides={'language': 'xx', 'locale_dirs': ['.']}) +@with_intl_app(buildername='text') def test_simple(app): app.builder.build(['bom']) result = (app.outdir / 'bom.txt').text(encoding='utf-8') @@ -57,9 +82,230 @@ def test_simple(app): assert result == expect -@with_app(buildername='text', - confoverrides={'language': 'xx', 'locale_dirs': ['.']}) +@with_intl_app(buildername='text') 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") + app.builder.build(['subdir/contents']) + result = (app.outdir / 'subdir' / 'contents.txt').text(encoding='utf-8') + assert result.startswith(u"\nsubdir contents\n***************\n") + + +@with_intl_app(buildername='html', cleanenv=True) +def test_i18n_footnote_break_refid(app): + """test for #955 cant-build-html-with-footnotes-when-using""" + app.builder.build(['footnote']) + result = (app.outdir / 'footnote.html').text(encoding='utf-8') + # expect no error by build + + +@with_intl_app(buildername='text', cleanenv=True) +def test_i18n_footnote_regression(app): + """regression test for fix #955""" + app.builder.build(['footnote']) + result = (app.outdir / '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_intl_app(buildername='html', cleanenv=True) +def test_i18n_footnote_backlink(app): + """i18n test for #1058""" + app.builder.build(['footnote']) + result = (app.outdir / 'footnote.html').text(encoding='utf-8') + expects = [ + '<a class="footnote-reference" href="#id5" id="id1">[100]</a>', + '<a class="footnote-reference" href="#id4" id="id2">[1]</a>', + '<a class="reference internal" href="#ref" id="id3">[ref]</a>', + '<a class="fn-backref" href="#id2">[1]</a>', + '<a class="fn-backref" href="#id3">[ref]</a>', + '<a class="fn-backref" href="#id1">[100]</a>', + ] + for expect in expects: + matches = re.findall(re.escape(expect), result) + assert len(matches) == 1 + + +@with_intl_app(buildername='text', warning=warnfile, cleanenv=True) +def test_i18n_warn_for_number_of_references_inconsistency(app): + app.builddir.rmtree(True) + app.builder.build(['refs_inconsistency']) + result = (app.outdir / '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'.*/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_intl_app(buildername='html', cleanenv=True) +def test_i18n_link_to_undefined_reference(app): + app.builder.build(['refs_inconsistency']) + result = (app.outdir / '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_intl_app(buildername='html', cleanenv=True) +def test_i18n_keep_external_links(app): + """regression test for #1044""" + app.builder.build(['external_links']) + result = (app.outdir / 'external_links.html').text(encoding='utf-8') + + # external link check + expect_line = (u'<li>EXTERNAL LINK TO <a class="reference external" ' + u'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" ' + u'href="#i18n-with-external-links">EXTERNAL ' + u'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" ' + u'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" ' + u'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 + + +@with_intl_app(buildername='text', warning=warnfile, cleanenv=True) +def test_i18n_literalblock_warning(app): + app.builddir.rmtree(True) #for warnings acceleration + app.builder.build(['literalblock']) + result = (app.outdir / 'literalblock.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH LITERAL BLOCK" + u"\n***********************\n" + u"\nCORRECT LITERAL BLOCK:\n" + u"\n this is" + u"\n literal block\n" + u"\nMISSING LITERAL BLOCK:\n" + u"\n<SYSTEM MESSAGE:") + assert result.startswith(expect) + + warnings = warnfile.getvalue().replace(os.sep, '/') + expected_warning_expr = u'.*/literalblock.txt:\\d+: ' \ + u'WARNING: Literal block expected; none found.' + assert re.search(expected_warning_expr, warnings) + + +@with_intl_app(buildername='text') +def test_i18n_definition_terms(app): + # regression test for #975 + app.builder.build(['definition_terms']) + result = (app.outdir / 'definition_terms.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH DEFINITION TERMS" + u"\n**************************\n" + u"\nSOME TERM" + u"\n THE CORRESPONDING DEFINITION\n" + u"\nSOME OTHER TERM" + u"\n THE CORRESPONDING DEFINITION #2\n") + + assert result == expect + + +@with_intl_app(buildername='text') +def test_seealso(app): + app.builder.build(['seealso']) + result = (app.outdir / 'seealso.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH SEEALSO" + u"\n*****************\n" + u"\nSee also: SHORT TEXT 1\n" + u"\nSee also: LONG TEXT 1\n" + u"\nSee also: SHORT TEXT 2\n" + u"\n LONG TEXT 2\n") + assert result == expect + + +@with_intl_app(buildername='text') +def test_i18n_figure_caption(app): + # regression test for #940 + app.builder.build(['figure_caption']) + result = (app.outdir / 'figure_caption.txt').text(encoding='utf-8') + expect = (u"\nI18N WITH FIGURE CAPTION" + u"\n************************\n" + u"\n [image]MY CAPTION OF THE FIGURE\n" + u"\n MY DESCRIPTION PARAGRAPH1 OF THE FIGURE.\n" + u"\n MY DESCRIPTION PARAGRAPH2 OF THE FIGURE.\n") + + assert result == expect + + +@with_intl_app(buildername='html') +def test_i18n_index_entries(app): + # regression test for #976 + app.builder.build(['index_entries']) + result = (app.outdir / 'genindex.html').text(encoding='utf-8') + + def wrap(tag, keyword): + start_tag = "<%s[^>]*>" % tag + end_tag = "</%s>" % tag + return r"%s\s*%s\s*%s" % (start_tag, keyword, end_tag) + + expected_exprs = [ + wrap('a', 'NEWSLETTER'), + wrap('a', 'MAILING LIST'), + wrap('a', 'RECIPIENTS LIST'), + wrap('a', 'FIRST SECOND'), + wrap('a', 'SECOND THIRD'), + wrap('a', 'THIRD, FIRST'), + wrap('dt', 'ENTRY'), + wrap('dt', 'SEE'), + wrap('a', 'MODULE'), + wrap('a', 'KEYWORD'), + wrap('a', 'OPERATOR'), + wrap('a', 'OBJECT'), + wrap('a', 'EXCEPTION'), + wrap('a', 'STATEMENT'), + wrap('a', 'BUILTIN'), + ] + for expr in expected_exprs: + assert re.search(expr, result, re.M) diff --git a/tests/test_linkcode.py b/tests/test_linkcode.py new file mode 100644 index 00000000..6e9bd6f8 --- /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-2013 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_markup.py b/tests/test_markup.py index 4c8e7264..c72b6b91 100644 --- a/tests/test_markup.py +++ b/tests/test_markup.py @@ -5,7 +5,7 @@ Test various Sphinx-specific markup extensions. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_metadata.py b/tests/test_metadata.py index 1652b49b..b4a064ba 100644 --- a/tests/test_metadata.py +++ b/tests/test_metadata.py @@ -5,7 +5,7 @@ Test our handling of metadata in files with bibliographic metadata. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_only_directive.py b/tests/test_only_directive.py index 2396046e..af1462c0 100644 --- a/tests/test_only_directive.py +++ b/tests/test_only_directive.py @@ -17,10 +17,10 @@ from util import * def teardown_module(): - (test_root / '_build').rmtree(True) + (test_roots / 'test-only-directive' / '_build').rmtree(True) -@with_app(buildername='text') +@with_app(buildername='text', srcdir=(test_roots / 'test-only-directive')) def test_sectioning(app): def getsects(section): diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index dba888dd..ff1f7568 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -5,7 +5,7 @@ Test the sphinx.quickstart module. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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/test_rst_domain.py b/tests/test_rst_domain.py index db5c5c07..8642f68f 100644 --- a/tests/test_rst_domain.py +++ b/tests/test_rst_domain.py @@ -5,7 +5,7 @@ Tests the reStructuredText domain. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_search.py b/tests/test_search.py index d9dcfb81..e5ae71e9 100644 --- a/tests/test_search.py +++ b/tests/test_search.py @@ -5,7 +5,7 @@ Test the search index builder. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -36,7 +36,7 @@ def test_wordcollector(): doc['file'] = 'dummy' parser.parse(FILE_CONTENTS, doc) - ix = IndexBuilder(None, 'en', {}) + ix = IndexBuilder(None, 'en', {}, None) ix.feed('filename', 'title', doc) assert 'boson' not in ix._mapping assert 'fermion' in ix._mapping diff --git a/tests/test_searchadapters.py b/tests/test_searchadapters.py index c20a74e3..551eefb9 100644 --- a/tests/test_searchadapters.py +++ b/tests/test_searchadapters.py @@ -5,7 +5,7 @@ Test the Web Support Package search adapters. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_theming.py b/tests/test_theming.py index c924223c..141aa088 100644 --- a/tests/test_theming.py +++ b/tests/test_theming.py @@ -5,7 +5,7 @@ Test the Theme class. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/test_versioning.py b/tests/test_versioning.py index 018c7093..08238f4a 100644 --- a/tests/test_versioning.py +++ b/tests/test_versioning.py @@ -5,7 +5,7 @@ Test the versioning implementation. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ import pickle diff --git a/tests/test_websupport.py b/tests/test_websupport.py index d7b5fb32..ff9fb1ec 100644 --- a/tests/test_websupport.py +++ b/tests/test_websupport.py @@ -5,7 +5,7 @@ Test the Web Support Package - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ diff --git a/tests/util.py b/tests/util.py index bd50bec0..3e17d362 100644 --- a/tests/util.py +++ b/tests/util.py @@ -3,7 +3,7 @@ Sphinx test suite utilities ~~~~~~~~~~~~~~~~~~~~~~~~~~~ - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ @@ -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 @@ -29,7 +30,7 @@ from nose import tools, SkipTest __all__ = [ - 'test_root', 'raises', 'raises_msg', + 'test_root', 'test_roots', 'raises', 'raises_msg', 'skip_if', 'skip_unless', 'skip_unless_importable', 'Struct', 'ListOutput', 'TestApp', 'with_app', 'gen_with_app', 'path', 'with_tempdir', 'write_file', @@ -38,6 +39,7 @@ __all__ = [ test_root = path(__file__).parent.joinpath('root').abspath() +test_roots = path(__file__).parent.joinpath('roots').abspath() def _excstr(exc): @@ -152,6 +154,8 @@ class TestApp(application.Sphinx): self.cleanup_trees.insert(0, outdir) if doctreedir is None: doctreedir = srcdir.joinpath(srcdir, self.builddir, 'doctrees') + if not doctreedir.isdir(): + doctreedir.makedirs() if cleanenv: self.cleanup_trees.insert(0, doctreedir) if confoverrides is None: @@ -170,6 +174,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,39 +1,48 @@ [tox] -envlist=py24,py25,py26,py27,py31,py32,pypy,du08,du07,du06,du05 +envlist=py25,py26,py27,py31,py32,py33,pypy,du10,du09,du08,du07 [testenv] deps= nose + sqlalchemy + whoosh +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 + simplejson==2.5.0 + {[testenv]deps} -[testenv:pypy] +[testenv:py33] deps= - nose - simplejson + docutils>=0.10.0 + {[testenv]deps} -[testenv:du05] -deps= - nose - docutils==0.5 - -[testenv:du06] +[testenv:pypy] deps= - nose - docutils==0.6 + simplejson + {[testenv]deps} [testenv:du07] deps= - nose docutils==0.7 + {[testenv]deps} [testenv:du08] deps= - nose docutils==0.8.1 + {[testenv]deps} + +[testenv:du09] +deps= + docutils==0.9.1 + {[testenv]deps} + +[testenv:du10] +deps= + docutils==0.10.0 + {[testenv]deps} diff --git a/utils/check_sources.py b/utils/check_sources.py index 6b030d5d..5512420a 100755 --- a/utils/check_sources.py +++ b/utils/check_sources.py @@ -7,7 +7,7 @@ Make sure each Python file has a correct file header including copyright and license information. - :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS. + :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. :license: BSD, see LICENSE for details. """ |