Hello community, here is the log from the commit of package python-Sphinx for openSUSE:Factory checked in at 2016-03-07 13:26:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Sphinx (Old) and /work/SRC/openSUSE:Factory/.python-Sphinx.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "python-Sphinx" Changes: -------- --- /work/SRC/openSUSE:Factory/python-Sphinx/python-Sphinx.changes 2016-02-22 08:56:49.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-Sphinx.new/python-Sphinx.changes 2016-03-07 13:26:12.000000000 +0100 @@ -1,0 +2,20 @@ +Mon Feb 29 16:07:44 UTC 2016 - michael@stroeder.com + +- Removed obsolete fix_some_testcase_error_with_pygments-2.1.1.patch +- update to version 1.3.6: + * #1873, #1876, #2278: Add ``page_source_suffix`` html context variable. This should be + introduced with :confval:`source_parsers` feature. Thanks for Eric Holscher. + * #2265: Fix babel is used in spite of disabling it on ``latex_elements`` + * #2295: Avoid mutating dictionary errors while enumerating members in autodoc + with Python 3 + * #2291: Fix pdflatex "Counter too large" error from footnotes inside tables of contents + * #2292: Fix some footnotes disappear from LaTeX output + * #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should + support parsers that specified source_parsers. + * #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts + * #2324: Print a hint how to increase the recursion limit when it is hit. + * #1565, #2229: Revert new warning; the new warning will be triggered from version 1.4 on. + * #2329: Refresh environment forcely if source directory has changed. + * #2019: Fix the domain objects in search result are not escaped + +------------------------------------------------------------------- Old: ---- Sphinx-1.3.5.tar.gz fix_some_testcase_error_with_pygments-2.1.1.patch New: ---- Sphinx-1.3.6.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Sphinx.spec ++++++ --- /var/tmp/diff_new_pack.vNbJIG/_old 2016-03-07 13:26:13.000000000 +0100 +++ /var/tmp/diff_new_pack.vNbJIG/_new 2016-03-07 13:26:13.000000000 +0100 @@ -17,16 +17,13 @@ Name: python-Sphinx -Version: 1.3.5 +Version: 1.3.6 Release: 0 Url: http://sphinx-doc.org Summary: Python documentation generator License: BSD-2-Clause Group: Development/Languages/Python Source: http://pypi.python.org/packages/source/S/Sphinx/Sphinx-%{version}.tar.gz -# PATCH-FIX-UPSTREAM fix_some_testcase_error_with_pygments-2.1.1.patch - fix tests with python-Pygments 2.1.1 -# See https://github.com/sphinx-doc/sphinx/commit/50f4862b069d58ade556aad90bd17920... -Patch0: fix_some_testcase_error_with_pygments-2.1.1.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRequires: python-devel BuildRequires: python-setuptools @@ -175,7 +172,6 @@ %prep %setup -q -n Sphinx-%{version} -%patch0 -p1 sed -i '/#!/d' sphinx/pycode/pgen2/token.py # Fix non-excutable-script warning # Add Interpreter version suffix to entrypoints (and thus /usr/bin binaries) to ++++++ Sphinx-1.3.5.tar.gz -> Sphinx-1.3.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/CHANGES new/Sphinx-1.3.6/CHANGES --- old/Sphinx-1.3.5/CHANGES 2016-01-24 04:56:27.000000000 +0100 +++ new/Sphinx-1.3.6/CHANGES 2016-02-29 14:49:21.000000000 +0100 @@ -1,3 +1,29 @@ +Release 1.3.6 (released Feb 29, 2016) +===================================== + +Features added +-------------- + +* #1873, #1876, #2278: Add ``page_source_suffix`` html context variable. This should be + introduced with :confval:`source_parsers` feature. Thanks for Eric Holscher. + + +Bugs fixed +---------- + +* #2265: Fix babel is used in spite of disabling it on ``latex_elements`` +* #2295: Avoid mutating dictionary errors while enumerating members in autodoc + with Python 3 +* #2291: Fix pdflatex "Counter too large" error from footnotes inside tables of contents +* #2292: Fix some footnotes disappear from LaTeX output +* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should + support parsers that specified source_parsers. +* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts +* #2324: Print a hint how to increase the recursion limit when it is hit. +* #1565, #2229: Revert new warning; the new warning will be triggered from version 1.4 on. +* #2329: Refresh environment forcely if source directory has changed. +* #2019: Fix the domain objects in search result are not escaped + Release 1.3.5 (released Jan 24, 2016) ===================================== @@ -7,12 +33,13 @@ * Fix line numbers was not shown on warnings in LaTeX and texinfo builders * Fix filenames were not shown on warnings of citations * Fix line numbers was not shown on warnings in LaTeX and texinfo builders -* Fix line numbers was not shown on warnings of indecies -* #2026: Fix LaTeX builder rais error if parsed-literal includes links +* Fix line numbers was not shown on warnings of indices +* #2026: Fix LaTeX builder raises error if parsed-literal includes links * #2243: Ignore strange docstring types for classes, do not crash * #2247: Fix #2205 breaks make html for definition list with classifiers that contains regular-expression like string -* #1565: Show warning if Pygments throws an ErrorToken +* #1565: Sphinx will now emit a warning that highlighting was skipped if the syntax + is incorrect for `code-block`, `literalinclude` and so on. * #2211: Fix paragraphs in table cell doesn't work in Latex output * #2253: ``:pyobject:`` option of ``literalinclude`` directive can't detect indented body block when the block starts with blank or comment lines. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/PKG-INFO new/Sphinx-1.3.6/PKG-INFO --- old/Sphinx-1.3.5/PKG-INFO 2016-01-24 05:13:12.000000000 +0100 +++ new/Sphinx-1.3.6/PKG-INFO 2016-02-29 14:49:33.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Sphinx -Version: 1.3.5 +Version: 1.3.6 Summary: Python documentation generator Home-page: http://sphinx-doc.org/ Author: Georg Brandl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/Sphinx.egg-info/PKG-INFO new/Sphinx-1.3.6/Sphinx.egg-info/PKG-INFO --- old/Sphinx-1.3.5/Sphinx.egg-info/PKG-INFO 2016-01-24 05:13:11.000000000 +0100 +++ new/Sphinx-1.3.6/Sphinx.egg-info/PKG-INFO 2016-02-29 14:49:31.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.1 Name: Sphinx -Version: 1.3.5 +Version: 1.3.6 Summary: Python documentation generator Home-page: http://sphinx-doc.org/ Author: Georg Brandl diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/Sphinx.egg-info/SOURCES.txt new/Sphinx-1.3.6/Sphinx.egg-info/SOURCES.txt --- old/Sphinx-1.3.5/Sphinx.egg-info/SOURCES.txt 2016-01-24 05:13:12.000000000 +0100 +++ new/Sphinx-1.3.6/Sphinx.egg-info/SOURCES.txt 2016-02-29 14:49:32.000000000 +0100 @@ -133,6 +133,7 @@ sphinx/environment.py sphinx/errors.py sphinx/highlighting.py +sphinx/io.py sphinx/jinja2glue.py sphinx/make_mode.py sphinx/pygments_styles.py @@ -675,6 +676,8 @@ tests/roots/test-ext-viewcode/spam/__init__.py tests/roots/test-ext-viewcode/spam/mod1.py tests/roots/test-ext-viewcode/spam/mod2.py +tests/roots/test-footnotes/bar.rst +tests/roots/test-footnotes/baz.rst tests/roots/test-footnotes/conf.py tests/roots/test-footnotes/index.rst tests/roots/test-footnotes/rimg.png diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/doc/intl.rst new/Sphinx-1.3.6/doc/intl.rst --- old/Sphinx-1.3.5/doc/intl.rst 2016-01-12 15:41:20.000000000 +0100 +++ new/Sphinx-1.3.6/doc/intl.rst 2016-02-29 14:40:15.000000000 +0100 @@ -106,17 +106,23 @@ #. Translate your po files under `./locale/<lang>/LC_MESSAGES/`. -#. Build mo files and make translated document. +#. make translated document. You need a :confval:`language` parameter in ``conf.py`` or you may also specify the parameter on the command line:: - $ sphinx-intl build $ make -e SPHINXOPTS="-D language='de'" html Congratulations! You got the translated documentation in the ``_build/html`` directory. +.. versionadded:: 1.3 + + sphinx-build that is invoked by make command will build po files into mo files. + + If you are using 1.2.x or earlier, please invoke ``sphinx-intl build`` command + before make command. + Translating ^^^^^^^^^^^ @@ -251,9 +257,8 @@ ... Done. - Build po files into mo and make html:: + Invoke make html:: - $ sphinx-intl build $ make -e SPHINXOPTS="-D language='de'" html diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/doc/templating.rst new/Sphinx-1.3.6/doc/templating.rst --- old/Sphinx-1.3.5/doc/templating.rst 2015-03-10 22:52:53.000000000 +0100 +++ new/Sphinx-1.3.6/doc/templating.rst 2016-02-29 14:40:15.000000000 +0100 @@ -399,3 +399,8 @@ * ``includehidden`` (``False`` by default): if true, the TOC tree will also contain hidden entries. + +.. data:: page_source_suffix + + The suffix of the file that was rendered. Since we support a list of :confval:`source_suffix`, + this will allow you to properly link to the original source file. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/__init__.py new/Sphinx-1.3.6/sphinx/__init__.py --- old/Sphinx-1.3.5/sphinx/__init__.py 2016-01-24 04:56:27.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/__init__.py 2016-02-29 14:49:21.000000000 +0100 @@ -15,13 +15,13 @@ import sys from os import path -__version__ = '1.3.5' -__released__ = '1.3.5' # used when Sphinx builds its own docs +__version__ = '1.3.6' +__released__ = '1.3.6' # used when Sphinx builds its own docs # version info for better programmatic use # possible values for 3rd element: 'alpha', 'beta', 'rc', 'final' # 'final' has 0 as the last element -version_info = (1, 3, 5, 'final', 0) +version_info = (1, 3, 6, 'final', 0) package_dir = path.abspath(path.dirname(__file__)) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/application.py new/Sphinx-1.3.6/sphinx/application.py --- old/Sphinx-1.3.5/sphinx/application.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/application.py 2016-02-29 14:40:15.000000000 +0100 @@ -35,7 +35,8 @@ from sphinx.domains import ObjType, BUILTIN_DOMAINS from sphinx.domains.std import GenericObject, Target, StandardDomain from sphinx.builders import BUILTIN_BUILDERS -from sphinx.environment import BuildEnvironment, SphinxStandaloneReader +from sphinx.environment import BuildEnvironment +from sphinx.io import SphinxStandaloneReader from sphinx.util import pycompat # noqa: imported for side-effects from sphinx.util import import_object from sphinx.util.tags import Tags @@ -220,7 +221,7 @@ try: self.info(bold('loading pickled environment... '), nonl=True) self.env = BuildEnvironment.frompickle( - self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME)) + self.srcdir, self.config, path.join(self.doctreedir, ENV_PICKLE_FILENAME)) self.env.domains = {} for domain in self.domains.keys(): # this can raise if the data version doesn't fit diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/builders/html.py new/Sphinx-1.3.6/sphinx/builders/html.py --- old/Sphinx-1.3.5/sphinx/builders/html.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/builders/html.py 2016-02-29 14:40:15.000000000 +0100 @@ -408,6 +408,9 @@ # metadata for the document meta = self.env.metadata.get(docname) + # Suffix for the document + source_suffix = '.' + self.env.doc2path(docname).split('.')[-1] + # local TOC and global TOC tree self_toc = self.env.get_toc_for(docname, self) toc = self.render_partial(self_toc)['fragment'] @@ -425,6 +428,7 @@ toc = toc, # only display a TOC if there's more than one item to show display_toc = (self.env.toc_num_entries[docname] > 1), + page_source_suffix = source_suffix, ) def write_doc(self, docname, doctree): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/cmdline.py new/Sphinx-1.3.6/sphinx/cmdline.py --- old/Sphinx-1.3.5/sphinx/cmdline.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/cmdline.py 2016-02-29 14:40:15.000000000 +0100 @@ -270,6 +270,14 @@ print(red('The full traceback has been saved in %s, if you want ' 'to report the issue to the developers.' % tbpath), file=error) + elif isinstance(err, RuntimeError) and 'recursion depth' in str(err): + print(red('Recursion error:'), file=error) + print(terminal_safe(text_type(err)), file=error) + print(file=error) + print('This can happen with very large or deeply nested source ' + 'files. You can carefully increase the default Python ' + 'recursion limit of 1000 in conf.py with e.g.:', file=error) + print(' import sys; sys.setrecursionlimit(1500)', file=error) else: print(red('Exception occurred:'), file=error) print(format_exception_cut_frames().rstrip(), file=error) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/domains/std.py new/Sphinx-1.3.6/sphinx/domains/std.py --- old/Sphinx-1.3.5/sphinx/domains/std.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/domains/std.py 2016-02-29 14:40:15.000000000 +0100 @@ -453,7 +453,7 @@ 'productionlist': ProductionList, } roles = { - 'option': OptionXRefRole(warn_dangling=True), + 'option': OptionXRefRole(), 'envvar': EnvVarXRefRole(), # links to tokens in grammar productions 'token': XRefRole(), @@ -491,7 +491,6 @@ 'the label must precede a section header)', 'numref': 'undefined label: %(target)s', 'keyword': 'unknown keyword: %(target)s', - 'option': 'unknown option: %(target)s', } def clear_doc(self, docname): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/environment.py new/Sphinx-1.3.6/sphinx/environment.py --- old/Sphinx-1.3.5/sphinx/environment.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/environment.py 2016-02-29 14:40:15.000000000 +0100 @@ -23,24 +23,23 @@ from glob import glob from itertools import groupby -from six import iteritems, itervalues, text_type, class_types, string_types, next +from six import iteritems, itervalues, text_type, class_types, next from six.moves import cPickle as pickle from docutils import nodes -from docutils.io import FileInput, NullOutput +from docutils.io import NullOutput from docutils.core import Publisher from docutils.utils import Reporter, relative_path, get_source_line -from docutils.readers import standalone from docutils.parsers.rst import roles, directives from docutils.parsers.rst.languages import en as english from docutils.parsers.rst.directives.html import MetaBody -from docutils.writers import UnfilteredWriter from docutils.frontend import OptionParser from sphinx import addnodes +from sphinx.io import SphinxStandaloneReader, SphinxDummyWriter, SphinxFileInput from sphinx.util import url_re, get_matching_docs, docname_join, split_into, \ - FilenameUniqDict, get_figtype, import_object, split_index_msg + FilenameUniqDict, get_figtype, split_index_msg from sphinx.util.nodes import clean_astext, make_refnode, WarningStream, is_translatable -from sphinx.util.osutil import SEP, getcwd, fs_encoding +from sphinx.util.osutil import SEP, getcwd, fs_encoding, ensuredir from sphinx.util.i18n import find_catalog_files from sphinx.util.console import bold, purple from sphinx.util.matching import compile_matchers @@ -49,12 +48,7 @@ from sphinx.errors import SphinxError, ExtensionError from sphinx.locale import _ from sphinx.versioning import add_uids, merge_doctrees -from sphinx.transforms import ( - DefaultSubstitutions, MoveModuleTargets, ApplySourceWorkaround, - HandleCodeBlocks, AutoNumbering, SortIds, CitationReferences, Locale, - RemoveTranslatableInline, SphinxContentsFilter, ExtraTranslatableNodes, -) - +from sphinx.transforms import SphinxContentsFilter orig_role_function = roles.role orig_directive_function = directives.directive @@ -97,73 +91,6 @@ pass -class SphinxStandaloneReader(standalone.Reader): - """ - Add our own transforms. - """ - transforms = [ApplySourceWorkaround, ExtraTranslatableNodes, Locale, CitationReferences, - DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, - AutoNumbering, SortIds, RemoveTranslatableInline] - - def __init__(self, parsers={}, *args, **kwargs): - standalone.Reader.__init__(self, *args, **kwargs) - self.parser_map = {} - for suffix, parser_class in parsers.items(): - if isinstance(parser_class, string_types): - parser_class = import_object(parser_class, 'source parser') - self.parser_map[suffix] = parser_class() - - def read(self, source, parser, settings): - self.source = source - - for suffix in self.parser_map: - if source.source_path.endswith(suffix): - self.parser = self.parser_map[suffix] - break - - if not self.parser: - self.parser = parser - self.settings = settings - self.input = self.source.read() - self.parse() - return self.document - - def get_transforms(self): - return standalone.Reader.get_transforms(self) + self.transforms - - -class SphinxDummyWriter(UnfilteredWriter): - supported = ('html',) # needed to keep "meta" nodes - - def translate(self): - pass - - -class SphinxFileInput(FileInput): - def __init__(self, app, env, *args, **kwds): - self.app = app - self.env = env - kwds['error_handler'] = 'sphinx' # py3: handle error on open. - FileInput.__init__(self, *args, **kwds) - - def decode(self, data): - if isinstance(data, text_type): # py3: `data` already decoded. - return data - return data.decode(self.encoding, 'sphinx') # py2: decoding - - def read(self): - data = FileInput.read(self) - if self.app: - arg = [data] - self.app.emit('source-read', self.env.docname, arg) - data = arg[0] - if self.env.config.rst_epilog: - data = data + '\n' + self.env.config.rst_epilog + '\n' - if self.env.config.rst_prolog: - data = self.env.config.rst_prolog + '\n' + data - return data - - class BuildEnvironment: """ The environment in which the ReST files are translated. @@ -174,7 +101,7 @@ # --------- ENVIRONMENT PERSISTENCE ---------------------------------------- @staticmethod - def frompickle(config, filename): + def frompickle(srcdir, config, filename): picklefile = open(filename, 'rb') try: env = pickle.load(picklefile) @@ -182,6 +109,8 @@ picklefile.close() if env.version != ENV_VERSION: raise IOError('build environment version not current') + if env.srcdir != srcdir: + raise IOError('source directory has changed') env.config.values = config.values return env @@ -855,9 +784,7 @@ # save the parsed doctree doctree_filename = self.doc2path(docname, self.doctreedir, '.doctree') - dirname = path.dirname(doctree_filename) - if not path.isdir(dirname): - os.makedirs(dirname) + ensuredir(path.dirname(doctree_filename)) f = open(doctree_filename, 'wb') try: pickle.dump(doctree, f, pickle.HIGHEST_PROTOCOL) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/ext/autodoc.py new/Sphinx-1.3.6/sphinx/ext/autodoc.py --- old/Sphinx-1.3.5/sphinx/ext/autodoc.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/ext/autodoc.py 2016-02-29 14:40:15.000000000 +0100 @@ -17,7 +17,8 @@ import traceback from types import FunctionType, BuiltinFunctionType, MethodType -from six import iteritems, itervalues, text_type, class_types, string_types +from six import PY2, iterkeys, iteritems, itervalues, text_type, class_types, \ + string_types from docutils import nodes from docutils.utils import assemble_option_dict from docutils.statemachine import ViewList @@ -410,6 +411,8 @@ else: errmsg += '; the following exception was raised:\n%s' % \ traceback.format_exc() + if PY2: + errmsg = errmsg.decode('utf-8') dbg(errmsg) self.directive.warn(errmsg) self.env.note_reread() @@ -598,7 +601,7 @@ # __dict__ contains only the members directly defined in # the class (but get them via getattr anyway, to e.g. get # unbound method objects instead of function objects); - # using keys() because apparently there are objects for which + # using list(iterkeys()) because apparently there are objects for which # __dict__ changes while getting attributes try: obj_dict = self.get_attr(self.object, '__dict__') @@ -606,7 +609,7 @@ members = [] else: members = [(mname, self.get_attr(self.object, mname, None)) - for mname in obj_dict.keys()] + for mname in list(iterkeys(obj_dict))] membernames = set(m[0] for m in members) # add instance attributes from the analyzer for aname in analyzed_member_names: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/ext/mathbase.py new/Sphinx-1.3.6/sphinx/ext/mathbase.py --- old/Sphinx-1.3.5/sphinx/ext/mathbase.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/ext/mathbase.py 2016-02-29 14:40:15.000000000 +0100 @@ -207,6 +207,11 @@ node[0] = nodes.Text(num, num) +def setup_amsfont(app): + # use amsfonts if users do not configure latex_elements['amsfonts'] + app.config.latex_elements.setdefault('amsfonts', r'\usepackage{amsfonts}') + + def setup_math(app, htmlinlinevisitors, htmldisplayvisitors): app.add_node(math, latex=(latex_visit_math, None), @@ -230,4 +235,4 @@ app.add_role('eq', eq_role) app.add_directive('math', MathDirective) app.connect('doctree-resolved', number_equations) - app.add_latex_package('amsfonts') + app.connect('builder-inited', setup_amsfont) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/highlighting.py new/Sphinx-1.3.6/sphinx/highlighting.py --- old/Sphinx-1.3.5/sphinx/highlighting.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/highlighting.py 2016-02-29 14:40:15.000000000 +0100 @@ -186,9 +186,7 @@ except ErrorToken as exc: # this is most probably not the selected language, # so let it pass unhighlighted - if warn: - warn('Could not parse literal_block as "%s". highlighting skipped.' % lang) - else: + if not warn: raise exc hlsource = highlight(source, lexers['none'], formatter) if self.dest == 'html': diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/io.py new/Sphinx-1.3.6/sphinx/io.py --- old/Sphinx-1.3.5/sphinx/io.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/io.py 2016-02-29 14:44:41.000000000 +0100 @@ -0,0 +1,121 @@ +# -*- coding: utf-8 -*- +""" + sphinx.io + ~~~~~~~~~ + + Input/Output files + + :copyright: Copyright 2007-2016 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +""" +from docutils.io import FileInput +from docutils.readers import standalone +from docutils.writers import UnfilteredWriter +from six import string_types, text_type + +from sphinx.transforms import ApplySourceWorkaround, ExtraTranslatableNodes, Locale, \ + CitationReferences, DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, \ + AutoNumbering, SortIds, RemoveTranslatableInline +from sphinx.util import import_object + + +class SphinxBaseReader(standalone.Reader): + """ + Add our source parsers + """ + def __init__(self, parsers={}, *args, **kwargs): + standalone.Reader.__init__(self, *args, **kwargs) + self.parser_map = {} + for suffix, parser_class in parsers.items(): + if isinstance(parser_class, string_types): + parser_class = import_object(parser_class, 'source parser') + self.parser_map[suffix] = parser_class() + + def read(self, source, parser, settings): + self.source = source + + for suffix in self.parser_map: + if source.source_path.endswith(suffix): + self.parser = self.parser_map[suffix] + break + + if not self.parser: + self.parser = parser + self.settings = settings + self.input = self.source.read() + self.parse() + return self.document + + def get_transforms(self): + return standalone.Reader.get_transforms(self) + self.transforms + + +class SphinxStandaloneReader(SphinxBaseReader): + """ + Add our own transforms. + """ + transforms = [ApplySourceWorkaround, ExtraTranslatableNodes, Locale, CitationReferences, + DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, + AutoNumbering, SortIds, RemoveTranslatableInline] + + +class SphinxI18nReader(SphinxBaseReader): + """ + Replacer for document.reporter.get_source_and_line method. + + reST text lines for translation do not have the original source line number. + This class provides the correct line numbers when reporting. + """ + + transforms = [ApplySourceWorkaround, ExtraTranslatableNodes, CitationReferences, + DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, + AutoNumbering, SortIds, RemoveTranslatableInline] + + def __init__(self, *args, **kwargs): + SphinxBaseReader.__init__(self, *args, **kwargs) + self.lineno = None + + def set_lineno_for_reporter(self, lineno): + self.lineno = lineno + + def new_document(self): + document = SphinxBaseReader.new_document(self) + reporter = document.reporter + + def get_source_and_line(lineno=None): + return reporter.source, self.lineno + + reporter.get_source_and_line = get_source_and_line + return document + + +class SphinxDummyWriter(UnfilteredWriter): + supported = ('html',) # needed to keep "meta" nodes + + def translate(self): + pass + + +class SphinxFileInput(FileInput): + def __init__(self, app, env, *args, **kwds): + self.app = app + self.env = env + kwds['error_handler'] = 'sphinx' # py3: handle error on open. + FileInput.__init__(self, *args, **kwds) + + def decode(self, data): + if isinstance(data, text_type): # py3: `data` already decoded. + return data + return data.decode(self.encoding, 'sphinx') # py2: decoding + + def read(self): + data = FileInput.read(self) + if self.app: + arg = [data] + self.app.emit('source-read', self.env.docname, arg) + data = arg[0] + if self.env.config.rst_epilog: + data = data + '\n' + self.env.config.rst_epilog + '\n' + if self.env.config.rst_prolog: + data = self.env.config.rst_prolog + '\n' + data + return data diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/quickstart.py new/Sphinx-1.3.6/sphinx/quickstart.py --- old/Sphinx-1.3.5/sphinx/quickstart.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/quickstart.py 2016-02-29 14:40:15.000000000 +0100 @@ -9,6 +9,7 @@ :license: BSD, see LICENSE for details. """ from __future__ import print_function +from __future__ import absolute_import import re import os @@ -201,8 +202,8 @@ # of the sidebar. #html_logo = None -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 +# The name of an image file (relative to this directory) to use as a favicon of +# the docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/search/__init__.py new/Sphinx-1.3.6/sphinx/search/__init__.py --- old/Sphinx-1.3.5/sphinx/search/__init__.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/search/__init__.py 2016-02-29 14:40:15.000000000 +0100 @@ -16,6 +16,7 @@ from os import path from sphinx.util import jsdump, rpartition +from sphinx.util.pycompat import htmlescape class SearchLanguage(object): @@ -283,6 +284,7 @@ continue if prio < 0: continue + fullname = htmlescape(fullname) prefix, name = rpartition(fullname, '.') pdict = rv.setdefault(prefix, {}) try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/themes/agogo/static/agogo.css_t new/Sphinx-1.3.6/sphinx/themes/agogo/static/agogo.css_t --- old/Sphinx-1.3.5/sphinx/themes/agogo/static/agogo.css_t 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/themes/agogo/static/agogo.css_t 2016-02-29 14:40:15.000000000 +0100 @@ -507,3 +507,13 @@ padding: 2px 5px; font-size: small; } + +/* -- math display ---------------------------------------------------------- */ + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/themes/haiku/static/haiku.css_t new/Sphinx-1.3.6/sphinx/themes/haiku/static/haiku.css_t --- old/Sphinx-1.3.5/sphinx/themes/haiku/static/haiku.css_t 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/themes/haiku/static/haiku.css_t 2016-02-29 14:40:15.000000000 +0100 @@ -369,3 +369,8 @@ margin: -1px -10px; padding: 0 12px; } + +/* math display */ +div.math p { + text-align: center; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/themes/scrolls/static/scrolls.css_t new/Sphinx-1.3.6/sphinx/themes/scrolls/static/scrolls.css_t --- old/Sphinx-1.3.5/sphinx/themes/scrolls/static/scrolls.css_t 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/themes/scrolls/static/scrolls.css_t 2016-02-29 14:40:15.000000000 +0100 @@ -471,3 +471,13 @@ div.figure p.caption span.caption-text { } + +/* math display */ + +div.math p { + text-align: center; +} + +span.eqno { + float: right; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/themes/traditional/static/traditional.css_t new/Sphinx-1.3.6/sphinx/themes/traditional/static/traditional.css_t --- old/Sphinx-1.3.5/sphinx/themes/traditional/static/traditional.css_t 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/themes/traditional/static/traditional.css_t 2016-02-29 14:40:15.000000000 +0100 @@ -736,3 +736,13 @@ div.figure p.caption span.caption-text { } + +/* :::: MATH DISPLAY :::: */ + +div.body div.math p { + text-align: center; +} + +span.eqno { + float: right; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/transforms.py new/Sphinx-1.3.6/sphinx/transforms.py --- old/Sphinx-1.3.5/sphinx/transforms.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/transforms.py 2016-02-29 14:40:15.000000000 +0100 @@ -12,8 +12,8 @@ from os import path from docutils import nodes -from docutils.utils import new_document, relative_path -from docutils.parsers.rst import Parser as RSTParser +from docutils.io import StringInput +from docutils.utils import relative_path from docutils.transforms import Transform from docutils.transforms.parts import ContentsFilter @@ -202,21 +202,33 @@ node['translatable'] = True -class CustomLocaleReporter(object): - """ - Replacer for document.reporter.get_source_and_line method. - - reST text lines for translation do not have the original source line number. - This class provides the correct line numbers when reporting. - """ - def __init__(self, source, line): - self.source, self.line = source, line +def publish_msgstr(source, source_path, source_line, config, settings): + """Publish msgstr (single line) into docutils document - def set_reporter(self, document): - document.reporter.get_source_and_line = self.get_source_and_line - - def get_source_and_line(self, lineno=None): - return self.source, self.line + :param unicode source: source text + :param unicode source_path: source path for warning indication + :param source_line: source line for warning indication + :param sphinx.config.Config config: sphinx config + :param docutils.frontend.Values settings: docutils settings + :return: document + :rtype: docutils.nodes.document + """ + from sphinx.io import SphinxI18nReader + reader = SphinxI18nReader( + parsers=config.source_parsers, + parser_name='restructuredtext', # default parser + ) + reader.set_lineno_for_reporter(source_line) + doc = reader.read( + source=StringInput(source=source, source_path=source_path), + parser=reader.parser, + settings=settings, + ) + try: + doc = doc[0] + except IndexError: # empty node + pass + return doc class Locale(Transform): @@ -244,8 +256,6 @@ if not has_catalog: return - parser = RSTParser() - # phase1: replace reference ids with translated names for node, msg in extract_messages(self.document): msgstr = catalog.gettext(msg) @@ -267,13 +277,7 @@ if isinstance(node, LITERAL_TYPE_NODES): msgstr = '::\n\n' + indent(msgstr, ' '*3) - patch = new_document(source, settings) - CustomLocaleReporter(node.source, node.line).set_reporter(patch) - parser.parse(msgstr, patch) - try: - patch = patch[0] - except IndexError: # empty node - pass + patch = publish_msgstr(msgstr, source, node.line, env.config, settings) # XXX doctest and other block markup if not isinstance(patch, nodes.paragraph): continue # skip for now @@ -390,13 +394,7 @@ if isinstance(node, LITERAL_TYPE_NODES): msgstr = '::\n\n' + indent(msgstr, ' '*3) - patch = new_document(source, settings) - CustomLocaleReporter(node.source, node.line).set_reporter(patch) - parser.parse(msgstr, patch) - try: - patch = patch[0] - except IndexError: # empty node - pass + patch = publish_msgstr(msgstr, source, node.line, env.config, settings) # XXX doctest and other block markup if not isinstance( patch, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/util/nodes.py new/Sphinx-1.3.6/sphinx/util/nodes.py --- old/Sphinx-1.3.5/sphinx/util/nodes.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/util/nodes.py 2016-02-29 14:40:15.000000000 +0100 @@ -141,9 +141,10 @@ return pnode.source -def traverse_parent(node): +def traverse_parent(node, cls=None): while node: - yield node + if cls is None or isinstance(node, cls): + yield node node = node.parent diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/writers/html.py new/Sphinx-1.3.6/sphinx/writers/html.py --- old/Sphinx-1.3.5/sphinx/writers/html.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/writers/html.py 2016-02-29 14:40:15.000000000 +0100 @@ -442,7 +442,7 @@ def visit_download_reference(self, node): if node.hasattr('filename'): self.body.append( - '<a class="reference download internal" href="%s">' % + '<a class="reference download internal" href="%s" download="">' % posixpath.join(self.builder.dlpath, node['filename'])) self.context.append('</a>') else: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/sphinx/writers/latex.py new/Sphinx-1.3.6/sphinx/writers/latex.py --- old/Sphinx-1.3.5/sphinx/writers/latex.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/sphinx/writers/latex.py 2016-02-29 14:40:15.000000000 +0100 @@ -25,7 +25,7 @@ from sphinx.errors import SphinxError from sphinx.locale import admonitionlabels, _ from sphinx.util import split_into -from sphinx.util.nodes import clean_astext +from sphinx.util.nodes import clean_astext, traverse_parent from sphinx.util.osutil import ustrftime from sphinx.util.texescape import tex_escape_map, tex_replace_map from sphinx.util.smartypants import educate_quotes_latex @@ -37,6 +37,7 @@ %(utf8extra)s %(cmappkg)s %(fontenc)s +%(amsfonts)s %(babel)s %(fontpkg)s %(fncychap)s @@ -159,11 +160,15 @@ if node.astext() != uri: index = node.parent.index(node) if show_urls == 'footnote': - footnote_nodes = self.create_footnote(uri) - for i, fn in enumerate(footnote_nodes): - node.parent.insert(index + i + 1, fn) + if list(traverse_parent(node, nodes.topic)): + # should not expand references in topics + pass + else: + footnote_nodes = self.create_footnote(uri) + for i, fn in enumerate(footnote_nodes): + node.parent.insert(index + i + 1, fn) - self.expanded = True + self.expanded = True else: # all other true values (b/w compat) textnode = nodes.Text(" (%s)" % uri) node.parent.insert(index + 1, textnode) @@ -195,9 +200,14 @@ def is_auto_footnote(node): return isinstance(node, nodes.footnote) and node.get('auto') - def footnote_ref_by(ids): + def footnote_ref_by(node): + ids = node['ids'] + parent = list(traverse_parent(node, (nodes.document, addnodes.start_of_file)))[0] + def is_footnote_ref(node): - return isinstance(node, nodes.footnote_reference) and ids[0] == node['refid'] + return (isinstance(node, nodes.footnote_reference) and + ids[0] == node['refid'] and + parent in list(traverse_parent(node))) return is_footnote_ref @@ -216,7 +226,7 @@ footnote['names'].remove(old_label) footnote['names'].append(label) - for footnote_ref in self.document.traverse(footnote_ref_by(footnote['ids'])): + for footnote_ref in self.document.traverse(footnote_ref_by(footnote)): footnote_ref.remove(footnote_ref[0]) footnote_ref += nodes.Text(label) @@ -249,6 +259,7 @@ 'utf8extra': '\DeclareUnicodeCharacter{00A0}{\nobreakspace}', 'cmappkg': '\usepackage{cmap}', 'fontenc': '\usepackage[T1]{fontenc}', + 'amsfonts': '', 'babel': '\usepackage{babel}', 'fontpkg': '\usepackage{times}', 'fncychap': '\usepackage[Bjarne]{fncychap}', @@ -346,11 +357,6 @@ return '\usepackage{%s}' % (packagename,) usepackages = (declare_package(*p) for p in builder.usepackages) self.elements['usepackages'] += "\n".join(usepackages) - if getattr(document.settings, 'contentsname', None): - self.elements['contentsname'] = \ - self.babel_renewcommand(builder, '\contentsname', - document.settings.contentsname) - self.elements['numfig_format'] = self.generate_numfig_format(builder) # allow the user to override them all self.elements.update(builder.config.latex_elements) if self.elements['extraclassoptions']: @@ -363,6 +369,11 @@ else: self.elements['tocdepth'] = ('\setcounter{tocdepth}{%d}' % (document['tocdepth'] - 1)) + if getattr(document.settings, 'contentsname', None): + self.elements['contentsname'] = \ + self.babel_renewcommand(builder, '\contentsname', + document.settings.contentsname) + self.elements['numfig_format'] = self.generate_numfig_format(builder) self.highlighter = highlighting.PygmentsBridge( 'latex', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/roots/test-footnotes/bar.rst new/Sphinx-1.3.6/tests/roots/test-footnotes/bar.rst --- old/Sphinx-1.3.5/tests/roots/test-footnotes/bar.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/Sphinx-1.3.6/tests/roots/test-footnotes/bar.rst 2016-02-29 14:40:15.000000000 +0100 @@ -0,0 +1,6 @@ +bar +=== + +Same footnote number [1]_ in bar.rst + +.. [1] footnote in bar diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/roots/test-footnotes/baz.rst new/Sphinx-1.3.6/tests/roots/test-footnotes/baz.rst --- old/Sphinx-1.3.5/tests/roots/test-footnotes/baz.rst 1970-01-01 01:00:00.000000000 +0100 +++ new/Sphinx-1.3.6/tests/roots/test-footnotes/baz.rst 2016-02-29 14:40:15.000000000 +0100 @@ -0,0 +1,6 @@ +baz +=== + +Auto footnote number [#]_ in baz.rst + +.. [#] footnote in baz diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/roots/test-footnotes/index.rst new/Sphinx-1.3.6/tests/roots/test-footnotes/index.rst --- old/Sphinx-1.3.5/tests/roots/test-footnotes/index.rst 2016-01-09 08:50:40.000000000 +0100 +++ new/Sphinx-1.3.6/tests/roots/test-footnotes/index.rst 2016-02-29 14:40:15.000000000 +0100 @@ -2,6 +2,14 @@ test-footenotes =============== +.. toctree:: + + bar + baz + +.. contents:: + :local: + The section with a reference to [AuthorYear]_ ============================================= diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/test_build_html.py new/Sphinx-1.3.6/tests/test_build_html.py --- old/Sphinx-1.3.5/tests/test_build_html.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/tests/test_build_html.py 2016-02-29 14:40:15.000000000 +0100 @@ -38,9 +38,7 @@ HTML_WARNINGS = ENV_WARNINGS + """\ %(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\*' -%(root)s/markup.txt:269: WARNING: Could not parse literal_block as "c". highlighting skipped. %(root)s/footnote.txt:60: WARNING: citation not found: missing -%(root)s/markup.txt:158: WARNING: unknown option: &option """ if PY3: @@ -344,12 +342,23 @@ # only check for node presence pass else: + def get_text(node): + if node.text is not None: + return node.text + else: + # Since pygments-2.1.1, empty <span> tag is inserted at top of + # highlighting block + if len(node) == 1 and node[0].tag == 'span' and node[0].text is None: + return node[0].tail + else: + return '' + rex = re.compile(check) if be_found: - if any(node.text and rex.search(node.text) for node in nodes): + if any(rex.search(get_text(node)) for node in nodes): return else: - if all(node.text and not rex.search(node.text) for node in nodes): + if all(not rex.search(get_text(node)) for node in nodes): return assert False, ('%r not found in any node matching ' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/test_build_latex.py new/Sphinx-1.3.6/tests/test_build_latex.py --- old/Sphinx-1.3.5/tests/test_build_latex.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/tests/test_build_latex.py 2016-02-29 14:40:15.000000000 +0100 @@ -24,10 +24,8 @@ LATEX_WARNINGS = ENV_WARNINGS + """\ -%(root)s/markup.txt:158: WARNING: unknown option: &option %(root)s/footnote.txt:60: WARNING: citation not found: missing %(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\*' -%(root)s/markup.txt:269: WARNING: Could not parse literal_block as "c". highlighting skipped. """ if PY3: @@ -267,6 +265,25 @@ assert '\hyperref[baz:code22]{Code-\ref{baz:code22}}' in result +@with_app(buildername='latex', testroot='numfig', + confoverrides={'numfig': True, 'language': 'ru', 'latex_elements': {'babel': ''}}) +def test_numref_on_bable_disabled(app, status, warning): + app.builder.build_all() + result = (app.outdir / 'Python.tex').text(encoding='utf8') + print(result) + print(status.getvalue()) + print(warning.getvalue()) + assert '\renewcommand{\figurename}{Fig. }' in result + assert '\renewcommand{\tablename}{Table }' in result + assert '\SetupFloatingEnvironment{literal-block}{name=Listing }' in result + assert '\hyperref[index:fig1]{Fig. \ref{index:fig1}}' in result + assert '\hyperref[baz:fig22]{Figure\ref{baz:fig22}}' in result + assert '\hyperref[index:table-1]{Table \ref{index:table-1}}' in result + assert '\hyperref[baz:table22]{Table:\ref{baz:table22}}' in result + assert '\hyperref[index:code-1]{Listing \ref{index:code-1}}' in result + assert '\hyperref[baz:code22]{Code-\ref{baz:code22}}' in result + + @with_app(buildername='latex') def test_latex_add_latex_package(app, status, warning): app.add_latex_package('foo') @@ -353,6 +370,15 @@ print(result) print(status.getvalue()) print(warning.getvalue()) + assert 'Same footnote number \footnote[1]{\nfootnote in bar\n} in bar.rst' in result + assert 'Auto footnote number \footnote[1]{\nfootnote in baz\n} in baz.rst' in result + assert ('\phantomsection\label{index:id26}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to\string-authoryear]' + '{\emph{The section with a reference to \phantomsection\label{index:id1}' + '{\hyperref[index:authoryear]{\emph{{[}AuthorYear{]}}}}}}}' in result) + assert ('\phantomsection\label{index:id27}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to]{\emph{The section ' + 'with a reference to }}}' in result) assert 'First footnote: \footnote[2]{\nFirst\n}' in result assert 'Second footnote: \footnote[1]{\nSecond\n}' in result assert '\href{http://sphinx-doc.org/}{Sphinx} (http://sphinx-doc.org/)' in result @@ -379,20 +405,29 @@ print(result) print(status.getvalue()) print(warning.getvalue()) - assert 'First footnote: \footnote[2]{\nFirst\n}' in result + assert 'Same footnote number \footnote[1]{\nfootnote in bar\n} in bar.rst' in result + assert 'Auto footnote number \footnote[2]{\nfootnote in baz\n} in baz.rst' in result + assert ('\phantomsection\label{index:id26}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to\string-authoryear]' + '{\emph{The section with a reference to \phantomsection\label{index:id1}' + '{\hyperref[index:authoryear]{\emph{{[}AuthorYear{]}}}}}}}' in result) + assert ('\phantomsection\label{index:id27}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to]{\emph{The section ' + 'with a reference to }}}' in result) + assert 'First footnote: \footnote[3]{\nFirst\n}' in result assert 'Second footnote: \footnote[1]{\nSecond\n}' in result assert ('\href{http://sphinx-doc.org/}{Sphinx}' - '\footnote[3]{\nhttp://sphinx-doc.org/\n}' in result) - assert 'Third footnote: \footnote[5]{\nThird\n}' in result + '\footnote[4]{\nhttp://sphinx-doc.org/\n}' in result) + assert 'Third footnote: \footnote[6]{\nThird\n}' in result assert ('\href{http://sphinx-doc.org/~test/}{URL including tilde}' - '\footnote[4]{\nhttp://sphinx-doc.org/\\textasciitilde{}test/\n}' in result) - assert ('\item[{\href{http://sphinx-doc.org/}{URL in term}\protect\footnotemark[7]}] ' - '\leavevmode\footnotetext[7]{\nhttp://sphinx-doc.org/\n}\nDescription' in result) - assert ('\item[{Footnote in term \protect\footnotemark[9]}] ' - '\leavevmode\footnotetext[9]{\nFootnote in term\n}\nDescription' in result) - assert ('\item[{\href{http://sphinx-doc.org/}{Term in deflist}\protect' - '\footnotemark[8]}] ' + '\footnote[5]{\nhttp://sphinx-doc.org/\\textasciitilde{}test/\n}' in result) + assert ('\item[{\href{http://sphinx-doc.org/}{URL in term}\protect\footnotemark[8]}] ' '\leavevmode\footnotetext[8]{\nhttp://sphinx-doc.org/\n}\nDescription' in result) + assert ('\item[{Footnote in term \protect\footnotemark[10]}] ' + '\leavevmode\footnotetext[10]{\nFootnote in term\n}\nDescription' in result) + assert ('\item[{\href{http://sphinx-doc.org/}{Term in deflist}\protect' + '\footnotemark[9]}] ' + '\leavevmode\footnotetext[9]{\nhttp://sphinx-doc.org/\n}\nDescription' in result) assert ('\href{https://github.com/sphinx-doc/sphinx}' '{https://github.com/sphinx-doc/sphinx}\n' in result) assert ('\href{mailto:sphinx-dev@googlegroups.com}' @@ -407,6 +442,15 @@ print(result) print(status.getvalue()) print(warning.getvalue()) + assert 'Same footnote number \footnote[1]{\nfootnote in bar\n} in bar.rst' in result + assert 'Auto footnote number \footnote[1]{\nfootnote in baz\n} in baz.rst' in result + assert ('\phantomsection\label{index:id26}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to\string-authoryear]' + '{\emph{The section with a reference to \phantomsection\label{index:id1}' + '{\hyperref[index:authoryear]{\emph{{[}AuthorYear{]}}}}}}}' in result) + assert ('\phantomsection\label{index:id27}{\hyperref[index:the\string-section' + '\string-with\string-a\string-reference\string-to]{\emph{The section ' + 'with a reference to }}}' in result) assert 'First footnote: \footnote[2]{\nFirst\n}' in result assert 'Second footnote: \footnote[1]{\nSecond\n}' in result assert '\href{http://sphinx-doc.org/}{Sphinx}' in result diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/test_build_texinfo.py new/Sphinx-1.3.6/tests/test_build_texinfo.py --- old/Sphinx-1.3.5/tests/test_build_texinfo.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/tests/test_build_texinfo.py 2016-02-29 14:40:15.000000000 +0100 @@ -23,7 +23,6 @@ TEXINFO_WARNINGS = ENV_WARNINGS + """\ -%(root)s/markup.txt:158: WARNING: unknown option: &option %(root)s/footnote.txt:60: WARNING: citation not found: missing %(root)s/images.txt:20: WARNING: no matching candidate for image URI u'foo.\*' %(root)s/images.txt:29: WARNING: no matching candidate for image URI u'svgimg.\*' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Sphinx-1.3.5/tests/test_search.py new/Sphinx-1.3.6/tests/test_search.py --- old/Sphinx-1.3.5/tests/test_search.py 2016-01-24 03:53:47.000000000 +0100 +++ new/Sphinx-1.3.6/tests/test_search.py 2016-02-29 14:40:15.000000000 +0100 @@ -13,6 +13,9 @@ from docutils.parsers import rst from sphinx.search import IndexBuilder +from sphinx.util import jsdump + +from util import with_app settings = parser = None @@ -39,3 +42,13 @@ ix.feed('filename', 'title', doc) assert 'boson' not in ix._mapping assert 'fermion' in ix._mapping + + +@with_app() +def test_objects_are_escaped(app, status, warning): + app.builder.build_all() + searchindex = (app.outdir / 'searchindex.js').text() + assert searchindex.startswith('Search.setIndex(') + + index = jsdump.loads(searchindex[16:-2]) + assert 'n::Array<T, d>' in index.get('objects').get('') # n::Array<T,d> is escaped