Merge branch 'stable'

This commit is contained in:
jfbu 2016-06-08 11:38:33 +02:00
commit c51282530c
7 changed files with 73 additions and 54 deletions

View File

@ -32,6 +32,14 @@ Release 1.4.4 (in development)
Bugs fixed
----------
* #2630: Latex sphinx.sty Notice Enviroment formatting problem
* #2632: Warning directives fail in quote environment latex build
* #2633: Sphinx crashes with old styled indices
* Fix a \begin{\minipage} typo in sphinx.sty from 1.4.2 (ref: 68becb1)
* #2622: Latex produces empty pages after title and table of contents
* #2640: 1.4.2 LaTeX crashes if code-block inside warning directive
* Let LaTeX use straight quotes also in inline code (ref #2627)
Release 1.4.3 (released Jun 5, 2016)
====================================

View File

@ -81,6 +81,8 @@ that has to return the directory with themes in it::
Builtin themes
--------------
.. cssclass:: longtable
+--------------------+--------------------+
| **Theme overview** | |
+--------------------+--------------------+

View File

@ -15,7 +15,7 @@ from six import string_types, text_type
from sphinx.transforms import ApplySourceWorkaround, ExtraTranslatableNodes, Locale, \
CitationReferences, DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks, \
AutoNumbering, SortIds, RemoveTranslatableInline
AutoNumbering, AutoIndexUpgrader, SortIds, RemoveTranslatableInline
from sphinx.util import import_object, split_docinfo
@ -59,7 +59,7 @@ class SphinxStandaloneReader(SphinxBaseReader):
"""
transforms = [ApplySourceWorkaround, ExtraTranslatableNodes, Locale, CitationReferences,
DefaultSubstitutions, MoveModuleTargets, HandleCodeBlocks,
AutoNumbering, SortIds, RemoveTranslatableInline]
AutoNumbering, AutoIndexUpgrader, SortIds, RemoveTranslatableInline]
class SphinxI18nReader(SphinxBaseReader):

View File

@ -19,6 +19,7 @@
% For framing code-blocks and warning type notices, and shadowing topics
\RequirePackage{framed}
\newif\ifSphinx@inframed % flag set if we are in a framed environment
% ifthen not used anymore and will be removed at Sphinx-1.5
\RequirePackage{ifthen}
% The xcolor package draws better fcolorboxes around verbatim code
\IfFileExists{xcolor.sty}{
@ -142,7 +143,10 @@
% Some custom font markup commands.
%
\newcommand{\strong}[1]{{\textbf{#1}}}
\newcommand{\code}[1]{\texttt{#1}}
% let \code and \bfcode use straight quotes (\@noligs patched by upquote)
% use \scantokens to handle e.g. \item[{\code{'fontenc'}}], too late for
% \code to change catcodes.
\newcommand{\code}[1]{{\@noligs\scantokens{\texttt{#1}}}}
\newcommand{\bfcode}[1]{\code{\bfseries#1}}
\newcommand{\email}[1]{\textsf{#1}}
\newcommand{\tablecontinued}[1]{\textsf{#1}}
@ -326,6 +330,8 @@
\discretionary{\copy\Sphinxvisiblespacebox}{\Sphinxafterbreak}
{\kern\fontdimen2\font}%
}%
% go around fancyvrb's check of @currenvir (for case of minipage below)
\renewcommand*{\VerbatimEnvironment}{\gdef\FV@EnvironName{Verbatim}}%
% Allow breaks at special characters using \PYG... macros.
\Sphinxbreaksatspecials
% The list environment is needed to control perfectly the vertical space.
@ -343,7 +349,7 @@
}%
\item
% use a minipage if we are already inside a framed environment
\relax\ifSphinx@inframed\noindent\begin{\minipage}{\linewidth}\fi
\relax\ifSphinx@inframed\noindent\begin{minipage}{\linewidth}\fi
\MakeFramed {% adapted over from framed.sty's snugshade environment
\advance\hsize-\width\@totalleftmargin\z@\linewidth\hsize
\@setminipage }%
@ -528,7 +534,12 @@
\ifSphinx@inframed
\noindent\begin{minipage}{\linewidth}
\else
\vspace{\parskip}
% handle case where notice is first thing in a list item (or is quoted)
\if@inlabel
\noindent\par\vspace{-\baselineskip}
\else
\vspace{\parskip}
\fi
\fi
\MakeFramed {\Sphinx@inframedtrue
\advance\hsize-\width \@totalleftmargin\z@ \linewidth\hsize
@ -547,7 +558,8 @@
\ifvoid\@mpfootins\else
\vskip\skip\@mpfootins\normalcolor\footnoterule\unvbox\@mpfootins
\fi
\@minipagefalse\endMakeFramed
\@minipagefalse
\endMakeFramed
\ifSphinx@inframed\end{minipage}\fi
% arrange for similar spacing below frame as for "light" boxes.
\vskip .4\baselineskip
@ -563,7 +575,8 @@
% counteract previous possible negative skip (French lists!):
% (we can't cancel that any earlier \vskip introduced a potential pagebreak)
\ifdim\lastskip<\z@\vskip-\lastskip\fi
\nobreak\vbox{\noindent\rule[.4\baselineskip]{\linewidth}{0.5pt}}\allowbreak
\nobreak\vbox{\noindent\kern\@totalleftmargin
\rule[.4\baselineskip]{\linewidth}{0.5pt}\hss}\allowbreak
}
% Some are quite plain:
@ -750,12 +763,12 @@
\fi%
}
\providecommand*{\DUprovidelength}[2]{
\ifthenelse{\isundefined{#1}}{\newlength{#1}\setlength{#1}{#2}}{}
\providecommand*{\DUprovidelength}[2]{%
\ifdefined#1\else\newlength{#1}\setlength{#1}{#2}\fi
}
\DUprovidelength{\DUlineblockindent}{2.5em}
\ifthenelse{\isundefined{\DUlineblock}}{
\ifdefined\DUlineblock\else
\newenvironment{DUlineblock}[1]{%
\list{}{\setlength{\partopsep}{\parskip}
\addtolength{\partopsep}{\baselineskip}
@ -766,8 +779,7 @@
\raggedright
}
{\endlist}
}{}
\fi
% From footmisc.sty: allows footnotes in titles
\let\FN@sf@@footnote\footnote

View File

@ -77,52 +77,27 @@
\end{flushright}%\par
\@thanks
\end{titlepage}%
\cleardoublepage%
\setcounter{footnote}{0}%
\let\thanks\relax\let\maketitle\relax
%\gdef\@thanks{}\gdef\@author{}\gdef\@title{}
}
% Catch the end of the {abstract} environment, but here make sure the abstract
% is followed by a blank page if the 'openright' option is used.
%
\let\py@OldEndAbstract=\endabstract
\renewcommand{\endabstract}{
\if@openright
\ifodd\value{page}
\typeout{Adding blank page after the abstract.}
\vfil\pagebreak
\fi
\fi
\py@OldEndAbstract
}
% This wraps the \tableofcontents macro with all the magic to get the spacing
% right and have the right number of pages if the 'openright' option has been
% used. This eliminates a fair amount of crud in the individual document files.
%
\let\py@OldTableofcontents=\tableofcontents
\renewcommand{\tableofcontents}{%
% before resetting page counter, let's do the right thing.
\if@openright\cleardoublepage\else\clearpage\fi
\pagenumbering{roman}%
\setcounter{page}{1}%
\pagebreak%
\pagestyle{plain}%
{%
\parskip = 0mm%
\py@OldTableofcontents%
\if@openright%
\ifodd\value{page}%
\typeout{Adding blank page after the table of contents.}%
\pagebreak\hspace{0pt}%
\fi%
\fi%
\cleardoublepage%
}%
\begingroup
\parskip \z@skip
\py@OldTableofcontents
\endgroup
% before resetting page counter, let's do the right thing.
\if@openright\cleardoublepage\else\clearpage\fi
\pagenumbering{arabic}%
\@ifundefined{fancyhf}{}{\pagestyle{normal}}%
\ifdefined\fancyhf\pagestyle{normal}\fi
}
\pagenumbering{alph}
%\pagenumbering{alph}%
% This is needed to get the width of the section # area wide enough in the
% library reference. Doing it here keeps it the same for all the manuals.
@ -135,7 +110,7 @@
% For a report document class this environment is a chapter.
\let\py@OldThebibliography=\thebibliography
\renewcommand{\thebibliography}[1]{
\cleardoublepage
\if@openright\cleardoublepage\else\clearpage\fi
\phantomsection
\py@OldThebibliography{1}
\addcontentsline{toc}{chapter}{\bibname}
@ -147,7 +122,7 @@
\@ifclassloaded{memoir}{}{
\let\py@OldTheindex=\theindex
\renewcommand{\theindex}{
\cleardoublepage
\if@openright\cleardoublepage\else\clearpage\fi
\phantomsection
\py@OldTheindex
\addcontentsline{toc}{chapter}{\indexname}

View File

@ -170,6 +170,24 @@ class ApplySourceWorkaround(Transform):
apply_source_workaround(n)
class AutoIndexUpgrader(Transform):
"""
Detect old style; 4 column based indices and automatically upgrade to new style.
"""
default_priority = 210
def apply(self):
env = self.document.settings.env
for node in self.document.traverse(addnodes.index):
if 'entries' in node and any(len(entry) == 4 for entry in node['entries']):
msg = ('4 column based index found. '
'It might be a bug of extensions you use: %r' % node['entries'])
env.warn_node(msg, node)
for i, entry in enumerate(node['entries']):
if len(entry) == 4:
node['entries'][i] = entry + (None,)
class ExtraTranslatableNodes(Transform):
"""
make nodes translatable

View File

@ -1,22 +1,26 @@
Release checklist
=================
* Open https://travis-ci.org/sphinx-doc/sphinx/branches and check stable branch is green
* Check `git status`
* Run `make style-check`
* Run `tx pull -a -f` in sphinx/locale if final major release
* Update version info in sphinx/__init__.py
* Update release date in CHANGES
* `git commit`
* `git commit -am 'Bump to x.y.z final'`
* `make clean`
* `python setup.py release bdist_wheel sdist upload --identify=[your key]`
* `python setup.py release bdist_wheel sdist upload --identity=[your key]`
* Check PyPI release page for obvious errors
* `git tag` with version number
* Merge default into stable if final major release
* `git push stable --tags`
* `git push origin stable --tags`
* Open https://readthedocs.org/dashboard/sphinx/versions/ and enable the released version
* Add new version/milestone to tracker categories
* Write announcement and send to sphinx-dev, sphinx-users and python-announce
* Update version info, add new CHANGES entry for next version
* `git commit`
* `git push`
* `git commit -am 'Bump version'`
* `git push origin stable`
* `git checkout master`
* `git merge stable`
* `git push origin master`
* Update `sphinx-doc-translations <https://github.com/sphinx-doc/sphinx-doc-translations>`_