[Python-modules-commits] [sphinx] 01/03: New upstream version 1.5.3
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Wed Mar 15 09:36:15 UTC 2017
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch debian/master
in repository sphinx.
commit e6e7608de4e0f8d18b096af721dc907297b3fcbc
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Wed Mar 15 12:31:10 2017 +0300
New upstream version 1.5.3
---
CHANGES | 33 +++++++
Makefile | 2 +-
PKG-INFO | 2 +-
Sphinx.egg-info/PKG-INFO | 2 +-
Sphinx.egg-info/SOURCES.txt | 6 +-
Sphinx.egg-info/requires.txt | 2 +-
doc/conf.py | 1 +
doc/config.rst | 64 +++++++++-----
doc/contents.rst | 1 +
doc/latex.rst | 96 +++++++++++++++++---
doc/markdown.rst | 45 ++++++++++
doc/markup/misc.rst | 5 +-
doc/rest.rst | 2 +-
setup.py | 2 +-
sphinx/__init__.py | 6 +-
sphinx/builders/html.py | 5 +-
sphinx/directives/code.py | 4 +-
sphinx/directives/patches.py | 39 ++++++++-
sphinx/domains/std.py | 2 +-
sphinx/locale/__init__.pyc | Bin 9694 -> 0 bytes
sphinx/locale/fr/LC_MESSAGES/sphinx.po | 4 +-
sphinx/make_mode.py | 22 ++---
sphinx/pycode/Grammar-py2.pickle | Bin 18705 -> 19065 bytes
sphinx/pycode/Grammar-py3.pickle | Bin 19546 -> 19909 bytes
sphinx/quickstart.py | 14 ++-
sphinx/search/__init__.py | 20 +++--
sphinx/templates/latex/content.tex_t | 2 +-
sphinx/texinputs/python.ist | 4 +-
sphinx/texinputs/sphinx.sty | 135 ++++++++++++++++++++++++-----
sphinx/themes/nature/static/nature.css_t | 4 +
sphinx/themes/pyramid/static/pyramid.css_t | 4 +
sphinx/util/__init__.py | 13 +--
sphinx/util/inspect.py | 2 +-
sphinx/util/requests.py | 37 +++++---
sphinx/writers/html.py | 17 +++-
sphinx/writers/latex.py | 21 ++---
tests/path.py | 6 ++
tests/root/objects.txt | 4 +-
tests/roots/test-html_entity/conf.py | 5 ++
tests/roots/test-html_entity/index.rst | 31 +++++++
tests/roots/test-intl/literalblock.po | 6 ++
tests/roots/test-intl/literalblock.txt | 4 +
tests/roots/test-intl/table.po | 50 +++++++++++
tests/roots/test-intl/table.txt | 14 +++
tests/run.py | 6 +-
tests/test_autodoc.py | 2 +
tests/test_build.py | 7 +-
tests/test_build_html.py | 12 +++
tests/test_build_latex.py | 29 ++++---
tests/test_config.py | 8 +-
tests/test_directive_code.py | 24 ++---
tests/test_directive_only.py | 4 +-
tests/test_domain_cpp.py | 3 +-
tests/test_ext_intersphinx.py | 2 +-
tests/test_ext_math.py | 14 +--
tests/test_ext_todo.py | 4 +-
tests/test_intl.py | 48 ++++++++--
tests/test_markup.py | 3 +-
tests/test_search.py | 128 ++++++++++++++++++++++++---
tests/test_setup_command.py | 7 +-
tests/test_theming.py | 2 +-
tests/test_toctree.py | 1 +
tests/test_util.py | 22 ++++-
tests/test_websupport.py | 4 +-
tests/util.py | 3 +-
utils/release-checklist | 2 +-
66 files changed, 856 insertions(+), 217 deletions(-)
diff --git a/CHANGES b/CHANGES
index 4bca0f8..3d0f8fa 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,35 @@
+Release 1.5.3 (released Feb 26, 2017)
+=====================================
+
+Features added
+--------------
+
+* Support requests-2.0.0 (experimental) (refs: #3367)
+* (latex) PDF page margin dimensions may be customized (refs: #3387)
+* #3400: make-mode doesn't use subprocess on building docs
+
+Bugs fixed
+----------
+
+* #3370: the caption of code-block is not picked up for translation
+* LaTeX: :confval:`release` is not escaped (refs: #3362)
+* #3364: sphinx-quickstart prompts overflow on Console with 80 chars width
+* since 1.5, PDF's TOC and bookmarks lack an entry for general Index
+ (refs: #3383)
+* #3392: ``'releasename'`` in :confval:`latex_elements` is not working
+* #3356: Page layout for Japanese ``'manual'`` docclass has a shorter text area
+* #3394: When ``'pointsize'`` is not ``10pt``, Japanese ``'manual'`` document
+ gets wrong PDF page dimensions
+* #3399: quickstart: conf.py was not overwritten by template
+* #3366: option directive does not allow punctuations
+* #3410: return code in :confval:`release` breaks html search
+* #3427: autodoc: memory addresses are not stripped on Windows
+* #3428: xetex build tests fail due to fontspec v2.6 defining ``\strong``
+* #3349: Result of ``IndexBuilder.load()`` is broken
+* #3450:   is appeared in EPUB docs
+* #3418: Search button is misaligned in nature and pyramid theme
+* #3421: Could not translate a caption of tables
+
Release 1.5.2 (released Jan 22, 2017)
=====================================
@@ -53,6 +85,7 @@ Bugs fixed
* #3295: Could not import extension sphinx.builders.linkcheck
* #3285: autosummary: asterisks are escaped twice
* LaTeX, pass dvipdfm option to geometry package for Japanese documents (ref #3363)
+* Fix parselinenos() could not parse left half open range (cf. "-4")
Release 1.5.1 (released Dec 13, 2016)
diff --git a/Makefile b/Makefile
index 0b1a434..101cfca 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ clean-backupfiles:
clean-generated:
find . -name '.DS_Store' -exec rm -f {} +
- rm -f doc/_build/
+ rm -rf doc/_build/
rm -f sphinx/pycode/*.pickle
rm -f utils/*3.py*
rm -f utils/regression_test.js
diff --git a/PKG-INFO b/PKG-INFO
index 8cd0105..205414f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Sphinx
-Version: 1.5.2
+Version: 1.5.3
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
diff --git a/Sphinx.egg-info/PKG-INFO b/Sphinx.egg-info/PKG-INFO
index 8cd0105..205414f 100644
--- a/Sphinx.egg-info/PKG-INFO
+++ b/Sphinx.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: Sphinx
-Version: 1.5.2
+Version: 1.5.3
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
diff --git a/Sphinx.egg-info/SOURCES.txt b/Sphinx.egg-info/SOURCES.txt
index 43e1a0f..34e5d61 100644
--- a/Sphinx.egg-info/SOURCES.txt
+++ b/Sphinx.egg-info/SOURCES.txt
@@ -44,6 +44,7 @@ doc/intro.rst
doc/invocation.rst
doc/latex.rst
doc/make.bat
+doc/markdown.rst
doc/more.png
doc/pythonorg.png
doc/rest.rst
@@ -214,7 +215,6 @@ sphinx/ext/napoleon/__init__.py
sphinx/ext/napoleon/docstring.py
sphinx/ext/napoleon/iterators.py
sphinx/locale/__init__.py
-sphinx/locale/__init__.pyc
sphinx/locale/sphinx.pot
sphinx/locale/bn/LC_MESSAGES/sphinx.js
sphinx/locale/bn/LC_MESSAGES/sphinx.mo
@@ -814,6 +814,8 @@ tests/roots/test-html_assets/static/subdir/.htaccess
tests/roots/test-html_assets/static/subdir/.htpasswd
tests/roots/test-html_assets/subdir/background.png
tests/roots/test-html_assets/subdir/_build/index.html
+tests/roots/test-html_entity/conf.py
+tests/roots/test-html_entity/index.rst
tests/roots/test-image-glob/conf.py
tests/roots/test-image-glob/img.gif
tests/roots/test-image-glob/img.ja.png
@@ -880,6 +882,8 @@ tests/roots/test-intl/rubric.txt
tests/roots/test-intl/seealso.po
tests/roots/test-intl/seealso.txt
tests/roots/test-intl/sphinx.po
+tests/roots/test-intl/table.po
+tests/roots/test-intl/table.txt
tests/roots/test-intl/versionchange.po
tests/roots/test-intl/versionchange.txt
tests/roots/test-intl/warnings.po
diff --git a/Sphinx.egg-info/requires.txt b/Sphinx.egg-info/requires.txt
index dec5766..b108784 100644
--- a/Sphinx.egg-info/requires.txt
+++ b/Sphinx.egg-info/requires.txt
@@ -6,7 +6,7 @@ snowballstemmer>=1.1
babel>=1.3,!=2.0
alabaster>=0.7,<0.8
imagesize
-requests>=2.4.0
+requests>=2.0.0
[:sys_platform=="win32"]
colorama>=0.3.5
diff --git a/doc/conf.py b/doc/conf.py
index 349c0e7..1a5be57 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -56,6 +56,7 @@ latex_logo = '_static/sphinx.png'
latex_elements = {
'fontpkg': '\\usepackage{palatino}',
'passoptionstopackages': '\\PassOptionsToPackage{svgnames}{xcolor}',
+ 'printindex': '\\footnotesize\\raggedright\\printindex',
}
latex_show_urls = 'footnote'
diff --git a/doc/config.rst b/doc/config.rst
index 2ef5fe8..00e154b 100644
--- a/doc/config.rst
+++ b/doc/config.rst
@@ -101,10 +101,13 @@ General configuration
suffix that is not in the dictionary will be parsed with the default
reStructuredText parser.
-
For example::
- source_parsers = {'.md': 'some.markdown.module.Parser'}
+ source_parsers = {'.md': 'recommonmark.parser.CommonMarkParser'}
+
+ .. note::
+
+ Read more about how to use Markdown with Sphinx at :ref:`markdown`.
.. versionadded:: 1.3
@@ -1710,11 +1713,12 @@ These options influence LaTeX output. See further :doc:`latex`.
``'12pt'``), default ``'10pt'``.
``'pxunit'``
the value of the ``px`` when used in image attributes ``width`` and
- ``height``. The default value is ``'49336sp'`` which achieves
- ``96px=1in`` (``1in = 72.27*65536 = 4736286.72sp``, and all dimensions
- in TeX are internally integer multiples of ``sp``). To obtain for
- example ``100px=1in``, one can use ``'0.01in'`` but it is more precise
- to use ``'47363sp'``. To obtain ``72px=1in``, use ``'1bp'``.
+ ``height``. The default value is ``'0.75bp'`` which achieves
+ ``96px=1in`` (in TeX ``1in = 72bp = 72.27pt``.) To obtain for
+ example ``100px=1in`` use ``'0.01in'`` or ``'0.7227pt'`` (the latter
+ leads to TeX computing a more precise value, due to the smaller unit
+ used in the specification); for ``72px=1in``,
+ simply use ``'1bp'``; for ``90px=1in``, use ``'0.8bp'`` or ``'0.803pt'``.
.. versionadded:: 1.5
``'sphinxsetup'``
@@ -1727,17 +1731,6 @@ These options influence LaTeX output. See further :doc:`latex`.
contain ``\\PassOptionsToPackage{options}{foo}`` commands. Default empty.
.. versionadded:: 1.4
- ``'geometry'``
- "geometry" package inclusion, the default definition is:
-
- ``'\\usepackage[margin=1in,marginparwidth=0.5in]{geometry}'``.
-
- .. versionadded:: 1.5
-
- .. versionchanged:: 1.5.2
- For Japanese documents also ``dvipdfm`` option is passed to
- ``geometry``.
-
``'babel'``
"babel" package inclusion, default ``'\\usepackage{babel}'`` (the
suitable document language string is passed as class option, and
@@ -1785,7 +1778,7 @@ These options influence LaTeX output. See further :doc:`latex`.
.. deprecated:: 1.5
Use ``'atendofbody'`` key instead.
- * Keys that don't need be overridden unless in special cases are:
+ * Keys that don't need to be overridden unless in special cases are:
``'maxlistdepth'``
LaTeX allows by default at most 6 levels for nesting list and
@@ -1822,6 +1815,36 @@ These options influence LaTeX output. See further :doc:`latex`.
.. versionchanged:: 1.5
Defaults to ``'\\usepackage{fontspec}'`` when
:confval:`latex_engine` is ``'xelatex'``.
+ ``'geometry'``
+ "geometry" package inclusion, the default definition is:
+
+ ``'\\usepackage{geometry}'``
+
+ with an additional ``[dvipdfm]`` for Japanese documents.
+ The Sphinx LaTeX style file executes:
+
+ ``\PassOptionsToPackage{hmargin=1in,vmargin=1in,marginpar=0.5in}{geometry}``
+
+ which can be customized via corresponding :ref:`'sphinxsetup' options
+ <latexsphinxsetup>`.
+
+ .. versionadded:: 1.5
+
+ .. versionchanged:: 1.5.2
+ ``dvipdfm`` option if :confval:`latex_engine` is ``'platex'``.
+
+ .. versionadded:: 1.5.3
+ The :ref:`'sphinxsetup' keys for the margins
+ <latexsphinxsetuphmargin>`.
+
+ .. versionchanged:: 1.5.3
+ The location in the LaTeX file has been moved to after
+ ``\usepackage{sphinx}`` and ``\sphinxsetup{..}``, hence also after
+ insertion of ``'fontpkg'`` key. This is in order to handle the paper
+ layout options in a special way for Japanese documents: the text
+ width will be set to an integer multiple of the *zenkaku* width, and
+ the text height to an integer multiple of the baseline. See the
+ :ref:`hmargin <latexsphinxsetuphmargin>` documentation for more.
``'hyperref'``
"hyperref" package inclusion; also loads package "hypcap" and issues
``\urlstyle{same}``. This is done after :file:`sphinx.sty` file is
@@ -1840,7 +1863,8 @@ These options influence LaTeX output. See further :doc:`latex`.
generate a differently-styled title page.
``'releasename'``
value that prefixes ``'release'`` element on title page, default
- ``'Release'``.
+ ``'Release'``. As for *title* and *author* used in the tuples of
+ :confval:`latex_documents`, it is inserted as LaTeX markup.
``'tableofcontents'``
"tableofcontents" call, default ``'\\sphinxtableofcontents'`` (it is a
wrapper of unmodified ``\tableofcontents``, which may itself be
diff --git a/doc/contents.rst b/doc/contents.rst
index 0f5527b..92fb13f 100644
--- a/doc/contents.rst
+++ b/doc/contents.rst
@@ -19,6 +19,7 @@ Sphinx documentation contents
theming
templating
latex
+ markdown
extensions
extdev/index
websupport
diff --git a/doc/latex.rst b/doc/latex.rst
index 355948c..3d32233 100644
--- a/doc/latex.rst
+++ b/doc/latex.rst
@@ -14,13 +14,19 @@ The *latex* target does not benefit from pre-prepared themes like the
.. raw:: latex
\begingroup
- \sphinxsetup{verbatimwithframe=false,%
- VerbatimColor={named}{OldLace}, TitleColor={named}{DarkGoldenrod},%
- hintBorderColor={named}{LightCoral}, attentionBgColor={named}{LightPink},%
- attentionborder=3pt, attentionBorderColor={named}{Crimson},%
- noteBorderColor={named}{Olive}, noteborder=2pt,%
- cautionBorderColor={named}{Cyan}, cautionBgColor={named}{LightCyan},%
- cautionborder=3pt}
+ \sphinxsetup{%
+ verbatimwithframe=false,
+ VerbatimColor={named}{OldLace},
+ TitleColor={named}{DarkGoldenrod},
+ hintBorderColor={named}{LightCoral},
+ attentionborder=3pt,
+ attentionBorderColor={named}{Crimson},
+ attentionBgColor={named}{FloralWhite},
+ noteborder=2pt,
+ noteBorderColor={named}{Olive},
+ cautionborder=3pt,
+ cautionBorderColor={named}{Cyan},
+ cautionBgColor={named}{LightCyan}}
\relax
@@ -75,6 +81,8 @@ configured, for example::
latex_additional_files = ["mystyle.sty"]
+.. _latexsphinxsetup:
+
The Sphinx LaTeX style package options
--------------------------------------
@@ -109,13 +117,19 @@ If non-empty, it will be passed as argument to the ``\sphinxsetup`` command::
dynamically the option values: this is actually what we did for the
duration of this chapter for the PDF output, which is styled using::
+ \sphinxsetup{%
verbatimwithframe=false,
- VerbatimColor={named}{OldLace}, TitleColor={named}{DarkGoldenrod},
- hintBorderColor={named}{LightCoral}, attentionBgColor={named}{LightPink},
- attentionborder=3pt, attentionBorderColor={named}{Crimson},
- noteBorderColor={named}{Olive}, noteborder=2pt,
- cautionBorderColor={named}{Cyan}, cautionBgColor={named}{LightCyan},
- cautionborder=3pt
+ VerbatimColor={named}{OldLace},
+ TitleColor={named}{DarkGoldenrod},
+ hintBorderColor={named}{LightCoral},
+ attentionborder=3pt,
+ attentionBorderColor={named}{Crimson},
+ attentionBgColor={named}{FloralWhite},
+ noteborder=2pt,
+ noteBorderColor={named}{Olive},
+ cautionborder=3pt,
+ cautionBorderColor={named}{Cyan},
+ cautionBgColor={named}{LightCyan}}
and with the ``svgnames`` option having been passed to "xcolor" package::
@@ -137,6 +151,62 @@ Here are the currently available options together with their default values.
LaTeX requires for keys with Boolean values to use **lowercase** ``true`` or
``false``.
+.. _latexsphinxsetuphmargin:
+
+``hmargin``
+ The dimensions of the horizontal margins. Legacy Sphinx default value is
+ ``1in`` (which stands for ``{1in,1in}``.) It is passed over as ``hmargin``
+ option to ``geometry`` package.
+
+ Here is an example for non-Japanese documents of use of this key::
+
+ 'sphinxsetup': 'hmargin={2in,1.5in}, vmargin={1.5in,2in}, marginpar=1in',
+
+ Japanese documents currently accept only the form with only one dimension.
+ This option is handled then in a special manner in order for ``geometry``
+ package to set the text width to an exact multiple of the *zenkaku* width
+ of the base document font.
+
+ .. hint::
+
+ For a ``'manual'`` type document with :confval:`language` set to
+ ``'ja'``, which by default uses the ``jsbook`` LaTeX document class, the
+ dimension units, when the pointsize isn't ``10pt``, must be so-called TeX
+ "true" units::
+
+ 'sphinxsetup': 'hmargin=1.5truein, vmargin=1.5truein, marginpar=5zw',
+
+ This is due to the way the LaTeX class ``jsbook`` handles the
+ pointsize.
+
+ Or, one uses regular units but with ``nomag`` as document class option.
+ This can be achieved for example via::
+
+ 'pointsize': 'nomag,12pt',
+
+ in the :confval:`latex_elements` configuration variable.
+
+ .. versionadded:: 1.5.3
+
+``vmargin``
+ The dimension of the vertical margins. Legacy Sphinx default value is
+ ``1in`` (or ``{1in,1in}``.) Passed over as ``vmargin`` option to
+ ``geometry``.
+
+ Japanese documents will arrange for the text height to be an integer
+ multiple of the baselineskip, taking the closest match suitable for the
+ asked-for vertical margin. It can then be only one dimension. See notice
+ above.
+
+ .. versionadded:: 1.5.3
+
+``marginpar``
+ The ``\marginparwidth`` LaTeX dimension, defaults to ``0.5in``. For Japanese
+ documents, the value is modified to be the closest integer multiple of the
+ *zenkaku* width.
+
+ .. versionadded:: 1.5.3
+
``verbatimwithframe``
default ``true``. Boolean to specify if :rst:dir:`code-block`\ s and literal
includes are framed. Setting it to ``false`` does not deactivate use of
diff --git a/doc/markdown.rst b/doc/markdown.rst
new file mode 100644
index 0000000..75a35b9
--- /dev/null
+++ b/doc/markdown.rst
@@ -0,0 +1,45 @@
+.. highlightlang:: python
+
+.. _markdown:
+
+Markdown support
+================
+
+`Markdown <https://daringfireball.net/projects/markdown/>`__ is a lightweight markup language with a simplistic plain
+text formatting syntax.
+It exists in many syntactically different *flavors*.
+To support Markdown-based documentation, Sphinx can use
+`recommonmark <http://recommonmark.readthedocs.io/en/latest/index.html>`__.
+recommonmark is a Docutils bridge to `CommonMark-py <https://github.com/rtfd/CommonMark-py>`__, a
+Python package for parsing the `CommonMark <http://commonmark.org/>`__ Markdown flavor.
+
+
+Configuration
+-------------
+
+To configure your Sphinx project for Markdown support, proceed as follows:
+
+#. Install recommonmark:
+
+ ::
+
+ pip install recommonmark
+
+#. Add the Markdown parser to the ``source_parsers`` configuration variable in your Sphinx configuration file:
+
+ ::
+
+ source_parsers = {
+ '.md': 'recommonmark.parser.CommonMarkParser',
+ }
+
+ You can replace `.md` with a filename extension of your choice.
+
+#. Add the Markdown filename extension to the ``source_suffix`` configuration variable:
+
+ ::
+
+ source_suffix = ['.rst', '.md']
+
+#. You can further configure recommonmark to allow custom syntax that standard CommonMark doesn't support. Read more in
+ the `recommonmark documentation <http://recommonmark.readthedocs.io/en/latest/auto_structify.html>`__.
diff --git a/doc/markup/misc.rst b/doc/markup/misc.rst
index bdfc334..0e1d104 100644
--- a/doc/markup/misc.rst
+++ b/doc/markup/misc.rst
@@ -233,8 +233,9 @@ following directive exists:
|``J``| justified column with automatic width |
+-----+------------------------------------------+
- The automatic width is determined by rendering the content in the table, and
- scaling them according to their share of the total width.
+ The automatic widths of the ``LRCJ`` columns are attributed by ``tabulary``
+ in proportion to the observed shares in a first pass where the table cells
+ are rendered at their natural "horizontal" widths.
By default, Sphinx uses a table layout with ``L`` for every column.
diff --git a/doc/rest.rst b/doc/rest.rst
index 7b2b92d..f39ade6 100644
--- a/doc/rest.rst
+++ b/doc/rest.rst
@@ -226,7 +226,7 @@ as long as the text::
Normally, there are no heading levels assigned to certain characters as the
structure is determined from the succession of headings. However, this
-convention is used in `Python's Style Guide for documentating
+convention is used in `Python's Style Guide for documenting
<https://docs.python.org/devguide/documenting.html#style-guide>`_ which you may
follow:
diff --git a/setup.py b/setup.py
index fa0be67..177ae8d 100644
--- a/setup.py
+++ b/setup.py
@@ -50,7 +50,7 @@ requires = [
'babel>=1.3,!=2.0',
'alabaster>=0.7,<0.8',
'imagesize',
- 'requests>=2.4.0',
+ 'requests>=2.0.0',
]
extras_require = {
# Environment Marker works for wheel 0.24 or later
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index dd4feb6..8cf8f4a 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -30,13 +30,13 @@ if 'PYTHONWARNINGS' not in os.environ:
warnings.filterwarnings('ignore', "'U' mode is deprecated",
DeprecationWarning, module='docutils.io')
-__version__ = '1.5.2'
-__released__ = '1.5.2' # used when Sphinx builds its own docs
+__version__ = '1.5.3'
+__released__ = '1.5.3' # 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, 5, 2, 'final', 0)
+version_info = (1, 5, 3, 'final', 0)
package_dir = path.abspath(path.dirname(__file__))
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index b9ab446..eeb32e3 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -10,6 +10,7 @@
"""
import os
+import re
import sys
import zlib
import codecs
@@ -50,6 +51,8 @@ INVENTORY_FILENAME = 'objects.inv'
#: the filename for the "last build" file (for serializing builders)
LAST_BUILD_FILENAME = 'last_build'
+return_codes_re = re.compile('[\r\n]+')
+
def get_stable_hash(obj):
"""
@@ -329,7 +332,7 @@ class StandaloneHTMLBuilder(Builder):
self.globalcontext = dict(
embedded = self.embedded,
project = self.config.project,
- release = self.config.release,
+ release = return_codes_re.sub('', self.config.release),
version = self.config.version,
last_updated = self.last_updated,
copyright = self.config.copyright,
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index e0c1b68..3aeb986 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -73,8 +73,8 @@ def container_wrapper(directive, literal_node, caption):
raise ValueError(parsed[0])
caption_node = nodes.caption(parsed[0].rawsource, '',
*parsed[0].children)
- caption_node.source = parsed[0].source
- caption_node.line = parsed[0].line
+ caption_node.source = literal_node.source
+ caption_node.line = literal_node.line
container_node += caption_node
container_node += literal_node
return container_node
diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py
index 8b14ba2..2348b13 100644
--- a/sphinx/directives/patches.py
+++ b/sphinx/directives/patches.py
@@ -9,9 +9,10 @@
from docutils import nodes
from docutils.parsers.rst import directives
-from docutils.parsers.rst.directives import images, html
+from docutils.parsers.rst.directives import images, html, tables
from sphinx import addnodes
+from sphinx.util.nodes import set_source_info
class Figure(images.Figure):
@@ -55,9 +56,45 @@ class Meta(html.Meta):
return result
+class RSTTable(tables.RSTTable):
+ """The table directive which sets source and line information to its caption."""
+
+ def make_title(self):
+ title, message = tables.RSTTable.make_title(self)
+ if title:
+ set_source_info(self, title)
+
+ return title, message
+
+
+class CSVTable(tables.CSVTable):
+ """The csv-table directive which sets source and line information to its caption."""
+
+ def make_title(self):
+ title, message = tables.CSVTable.make_title(self)
+ if title:
+ set_source_info(self, title)
+
+ return title, message
+
+
+class ListTable(tables.ListTable):
+ """The list-table directive which sets source and line information to its caption."""
+
+ def make_title(self):
+ title, message = tables.ListTable.make_title(self)
+ if title:
+ set_source_info(self, title)
+
+ return title, message
+
+
def setup(app):
directives.register_directive('figure', Figure)
directives.register_directive('meta', Meta)
+ directives.register_directive('table', RSTTable)
+ directives.register_directive('csv-table', CSVTable)
+ directives.register_directive('list-table', ListTable)
return {
'version': 'builtin',
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py
index 244b12e..d8c8431 100644
--- a/sphinx/domains/std.py
+++ b/sphinx/domains/std.py
@@ -28,7 +28,7 @@ from sphinx.util.compat import Directive
# RE for option descriptions
-option_desc_re = re.compile(r'((?:/|--|-|\+)?[-\.?@#_a-zA-Z0-9]+)(=?\s*.*)')
+option_desc_re = re.compile(r'((?:/|--|-|\+)?[-+\.?@#_a-zA-Z0-9]+)(=?\s*.*)')
# RE for grammar tokens
token_re = re.compile('`(\w+)`', re.U)
diff --git a/sphinx/locale/__init__.pyc b/sphinx/locale/__init__.pyc
deleted file mode 100644
index 8f4d60c..0000000
Binary files a/sphinx/locale/__init__.pyc and /dev/null differ
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
index a730688..dab9b52 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
@@ -128,12 +128,12 @@ msgstr "Paramètres"
#: sphinx/domains/c.py:61 sphinx/domains/cpp.py:4060
#: sphinx/domains/javascript.py:128 sphinx/domains/python.py:161
msgid "Returns"
-msgstr "Retourne"
+msgstr "Renvoie"
#: sphinx/domains/c.py:63 sphinx/domains/javascript.py:130
#: sphinx/domains/python.py:163
msgid "Return type"
-msgstr "Type retourné"
+msgstr "Type renvoyé"
#: sphinx/domains/c.py:177
#, python-format
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py
index e6bcd13..b125f0a 100644
--- a/sphinx/make_mode.py
+++ b/sphinx/make_mode.py
@@ -19,9 +19,9 @@ from __future__ import print_function
import os
import sys
from os import path
-from subprocess import call
import sphinx
+from sphinx import cmdline
from sphinx.util.console import bold, blue
from sphinx.util.osutil import cd, rmtree
@@ -250,20 +250,12 @@ class Make(object):
if doctreedir is None:
doctreedir = self.builddir_join('doctrees')
- orig_cmd = sys.argv[0]
- if sys.platform == 'win32' and orig_cmd.endswith('.exe'):
- # win32: 'sphinx-build.exe'
- cmd = [orig_cmd]
- elif sys.platform == 'win32' and os.path.splitext(orig_cmd)[1] == '':
- # win32: 'sphinx-build' without extension
- cmd = [orig_cmd + '.exe']
- else:
- # win32: 'sphinx-build.py'
- # linux, mac: 'sphinx-build' or 'sphinx-build.py'
- cmd = [sys.executable, orig_cmd]
-
- return call(cmd + ['-b', builder] + opts +
- ['-d', doctreedir, self.srcdir, self.builddir_join(builder)])
+ args = [sys.argv[0],
+ '-b', builder,
+ '-d', doctreedir,
+ self.srcdir,
+ self.builddir_join(builder)]
+ return cmdline.main(args + opts)
def run_make_mode(args):
diff --git a/sphinx/pycode/Grammar-py2.pickle b/sphinx/pycode/Grammar-py2.pickle
index 086b5df..95d1962 100644
Binary files a/sphinx/pycode/Grammar-py2.pickle and b/sphinx/pycode/Grammar-py2.pickle differ
diff --git a/sphinx/pycode/Grammar-py3.pickle b/sphinx/pycode/Grammar-py3.pickle
index 7b3cdad..e8279a0 100644
Binary files a/sphinx/pycode/Grammar-py3.pickle and b/sphinx/pycode/Grammar-py3.pickle differ
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index dda98ce..d09ef7c 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -43,9 +43,6 @@ from sphinx.util import texescape
TERM_ENCODING = getattr(sys.stdin, 'encoding', None)
-# function to get input from terminal -- overridden by the test suite
-term_input = input
-
DEFAULT_VALUE = {
'path': '.',
'sep': False,
@@ -73,6 +70,12 @@ def mkdir_p(dir):
os.makedirs(dir)
+# function to get input from terminal -- overridden by the test suite
+def term_input(prompt):
+ print(prompt, end='')
+ return input('')
+
+
class ValidationError(Exception):
"""Raised for validation errors."""
@@ -435,7 +438,10 @@ def generate(d, overwrite=True, silent=False, templatedir=None):
else:
print('File %s already exists, skipping.' % fpath)
- with open(os.path.join(package_dir, 'templates', 'quickstart', 'conf.py_t')) as f:
+ conf_path = os.path.join(templatedir, 'conf.py_t') if templatedir else None
+ if not conf_path or not path.isfile(conf_path):
+ conf_path = os.path.join(package_dir, 'templates', 'quickstart', 'conf.py_t')
+ with open(conf_path) as f:
conf_text = convert_python_source(f.read())
write_file(path.join(srcdir, 'conf.py'), template.render_string(conf_text, d))
diff --git a/sphinx/search/__init__.py b/sphinx/search/__init__.py
index 8f29352..4b309be 100644
--- a/sphinx/search/__init__.py
+++ b/sphinx/search/__init__.py
@@ -270,7 +270,8 @@ class IndexBuilder(object):
if not isinstance(frozen, dict) or \
frozen.get('envversion') != self.env.version:
raise ValueError('old format')
- index2fn = frozen['filenames']
+ index2fn = frozen['docnames']
+ self._filenames = dict(zip(index2fn, frozen['filenames']))
self._titles = dict(zip(index2fn, frozen['titles']))
def load_terms(mapping):
@@ -358,17 +359,20 @@ class IndexBuilder(object):
def label(self):
return "%s (code: %s)" % (self.lang.language_name, self.lang.lang)
- def prune(self, filenames):
- """Remove data for all filenames not in the list."""
+ def prune(self, docnames):
+ """Remove data for all docnames not in the list."""
new_titles = {}
- for filename in filenames:
- if filename in self._titles:
- new_titles[filename] = self._titles[filename]
+ new_filenames = {}
+ for docname in docnames:
+ if docname in self._titles:
+ new_titles[docname] = self._titles[docname]
+ new_filenames[docname] = self._filenames[docname]
self._titles = new_titles
+ self._filenames = new_filenames
for wordnames in itervalues(self._mapping):
- wordnames.intersection_update(filenames)
+ wordnames.intersection_update(docnames)
for wordnames in itervalues(self._title_mapping):
- wordnames.intersection_update(filenames)
+ wordnames.intersection_update(docnames)
def feed(self, docname, filename, title, doctree):
"""Feed a doctree to the index."""
diff --git a/sphinx/templates/latex/content.tex_t b/sphinx/templates/latex/content.tex_t
index e35c836..b3a77ca 100644
--- a/sphinx/templates/latex/content.tex_t
+++ b/sphinx/templates/latex/content.tex_t
@@ -14,7 +14,6 @@
\let\sphinxpxdimen\pdfpxdimen\else\newdimen\sphinxpxdimen
\fi \sphinxpxdimen=<%= pxunit %>\relax
<%= passoptionstopackages %>
-<%= geometry %>
<%= inputenc %>
<%= utf8extra %>
<%= cmappkg %>
@@ -26,6 +25,7 @@
<%= longtable %>
\usepackage<%= sphinxpkgoptions %>{sphinx}
<%= sphinxsetup %>
+<%= geometry %>
\usepackage{multirow}
\usepackage{eqparbox}
<%= usepackages %>
diff --git a/sphinx/texinputs/python.ist b/sphinx/texinputs/python.ist
index 9ffa0f9..687d26c 100644
--- a/sphinx/texinputs/python.ist
+++ b/sphinx/texinputs/python.ist
@@ -2,10 +2,12 @@ line_max 100
headings_flag 1
heading_prefix " \\bigletter "
-preamble "\\begin{theindex}
+preamble "\\begin{sphinxtheindex}
\\def\\bigletter#1{{\\Large\\sffamily#1}\\nopagebreak\\vspace{1mm}}
"
+postamble "\n\n\\end{sphinxtheindex}\n"
+
symhead_positive "{Symbols}"
numhead_positive "{Numbers}"
diff --git a/sphinx/texinputs/sphinx.sty b/sphinx/texinputs/sphinx.sty
index 05a1f8b..3bc7af5 100644
--- a/sphinx/texinputs/sphinx.sty
+++ b/sphinx/texinputs/sphinx.sty
@@ -6,7 +6,37 @@
%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
-\ProvidesPackage{sphinx}[2017/01/16 v1.5.2 LaTeX package (Sphinx markup)]
+\ProvidesPackage{sphinx}[2017/02/17 v1.5.3 LaTeX package (Sphinx markup)]
+
+% this is the \ltx at ifundefined of ltxcmds.sty, which is loaded by
+% kvoptions (and later by hyperref), but the first release of
+% ltxcmds.sty as in TL2009/Debian has wrong definition.
+\newcommand{\spx at ifundefined}[1]{%
+ \ifcsname #1\endcsname
+ \expandafter\ifx\csname #1\endcsname\relax
+ \expandafter\expandafter\expandafter\@firstoftwo
+ \else
+ \expandafter\expandafter\expandafter\@secondoftwo
+ \fi
+ \else
+ \expandafter\@firstoftwo
+ \fi
+}
+
+%% for deprecation warnings
+\newcommand\sphinxdeprecationwarning[4]{% #1 the deprecated macro or name,
+% #2 = version when deprecated, #3 = version when removed, #4 = message
+ \edef\spx at tempa{\detokenize{#1}}%
+ \spx at ifundefined{sphinx_depr_\spx at tempa}{%
+ \global\expandafter\let\csname sphinx_depr_\spx at tempa\endcsname\spx at tempa
+ \expandafter\AtEndDocument\expandafter{\expandafter\let\expandafter
+ \sphinxdeprecatedmacro\csname sphinx_depr_\spx at tempa\endcsname
+ \PackageWarningNoLine{sphinx}{^^J**** SPHINX DEPRECATION WARNING:^^J
+ \sphinxdeprecatedmacro\space will be (or has been)
+ deprecated at Sphinx #2^^J and will be removed at Sphinx #3.^^J
+ #4^^J****}}%
+ }{% warning already emitted (at end of latex log), don't repeat
+ }}
% we delay handling of options to after having loaded packages, because
% of the need to use \definecolor.
@@ -61,6 +91,18 @@
\RequirePackage{kvoptions}
\SetupKeyvalOptions{prefix=spx at opt@} % use \spx at opt@ prefix
+% Sphinx legacy text layout: 1in margins on all four sides
+\ifx\@jsc at uplatextrue\undefined
+\DeclareStringOption[1in]{hmargin}
+\DeclareStringOption[1in]{vmargin}
+\DeclareStringOption[.5in]{marginpar}
+\else
+% Japanese standard document classes handle \mag in a special way
+\DeclareStringOption[\inv at mag in]{hmargin}
+\DeclareStringOption[\inv at mag in]{vmargin}
+\DeclareStringOption[.5\dimexpr\inv at mag in\relax]{marginpar}
+\fi
+
\DeclareBoolOption{dontkeepoldnames} % \ifspx at opt@dontkeepoldnames = \iffalse
\DeclareStringOption[0]{maxlistdepth}% \newcommand*\spx at opt@maxlistdepth{0}
@@ -162,20 +204,6 @@
% user interface: options can be changed midway in a document!
\newcommand\sphinxsetup[1]{\setkeys{sphinx}{#1}}
-% this is the \ltx at ifundefined of ltxcmds.sty, which was loaded by
-% kvoptions already, (and later by hyperref), but the first release of
-% ltxcmds.sty as in TL2009/Debian has wrong definition.
-\newcommand{\spx at ifundefined}[1]{%
- \ifcsname #1\endcsname
- \expandafter\ifx\csname #1\endcsname\relax
- \expandafter\expandafter\expandafter\@firstoftwo
- \else
- \expandafter\expandafter\expandafter\@secondoftwo
- \fi
- \else
- \expandafter\@firstoftwo
- \fi
-}
% FIXME: the reasons might be obsolete (better color drivers now?)
% use pdfoutput for pTeX and dvipdfmx
% when pTeX (\kanjiskip is defined), set pdfoutput to evade \include{pdfcolor}
@@ -1052,13 +1080,60 @@
{\endlist}
\fi
-% adjust the margins for footer,
-% this works with the jsclasses only (Japanese standard document classes)
-% FIXME: rather, pass options to "geometry".
+\ifx\kanjiskip\undefined
+ \PassOptionsToPackage{%
+ hmargin={\unexpanded{\spx at opt@hmargin}},%
+ vmargin={\unexpanded{\spx at opt@vmargin}},%
+ marginpar=\unexpanded{\spx at opt@marginpar}}
+ {geometry}
+\else
+ % set text width for Japanese documents to be integer multiple of 1zw
+ % and text height to be integer multiple of \baselineskip
+ % the execution is delayed to \sphinxsetup then geometry.sty
+ \normalsize\normalfont
... 1372 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx.git
More information about the Python-modules-commits
mailing list