mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.8'
This commit is contained in:
commit
98648325aa
12
CHANGES
12
CHANGES
@ -45,6 +45,10 @@ Dependencies
|
|||||||
Incompatible changes
|
Incompatible changes
|
||||||
--------------------
|
--------------------
|
||||||
|
|
||||||
|
* LaTeX ``\pagestyle`` commands have been moved to the LaTeX template. No
|
||||||
|
changes in PDF, except possibly if ``\sphinxtableofcontents``, which
|
||||||
|
contained them, had been customized in :file:`conf.py`. (refs: #5455)
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
----------
|
----------
|
||||||
|
|
||||||
@ -63,6 +67,12 @@ Bugs fixed
|
|||||||
* #5437: autodoc: crashed on modules importing eggs
|
* #5437: autodoc: crashed on modules importing eggs
|
||||||
* #5433: latex: ImportError: cannot import name 'DEFAULT_SETTINGS'
|
* #5433: latex: ImportError: cannot import name 'DEFAULT_SETTINGS'
|
||||||
* #5431: autodoc: ``autofunction`` emits a warning for callable objects
|
* #5431: autodoc: ``autofunction`` emits a warning for callable objects
|
||||||
|
* #5457: Fix TypeError in error message when override is prohibited
|
||||||
|
* #5453: PDF builds of 'howto' documents have no page numbers
|
||||||
|
* #5463: mathbase: math_role and MathDirective was disappeared in 1.8.0
|
||||||
|
* #5454: latex: Index has disappeared from PDF for Japanese documents
|
||||||
|
* #5432: py domain: ``:type:`` field can't process ``:term:`` references
|
||||||
|
* #5426: py domain: TypeError has been raised for class attribute
|
||||||
|
|
||||||
Testing
|
Testing
|
||||||
--------
|
--------
|
||||||
@ -221,6 +231,8 @@ Deprecated
|
|||||||
* ``sphinx.ext.mathbase.eqref`` node is deprecated
|
* ``sphinx.ext.mathbase.eqref`` node is deprecated
|
||||||
* ``sphinx.ext.mathbase.is_in_section_title()`` is deprecated
|
* ``sphinx.ext.mathbase.is_in_section_title()`` is deprecated
|
||||||
* ``sphinx.ext.mathbase.MathDomain`` is deprecated
|
* ``sphinx.ext.mathbase.MathDomain`` is deprecated
|
||||||
|
* ``sphinx.ext.mathbase.MathDirective`` is deprecated
|
||||||
|
* ``sphinx.ext.mathbase.math_role`` is deprecated
|
||||||
* ``sphinx.ext.mathbase.setup_math()`` is deprecated
|
* ``sphinx.ext.mathbase.setup_math()`` is deprecated
|
||||||
* ``sphinx.directives.other.VersionChanges`` is deprecated
|
* ``sphinx.directives.other.VersionChanges`` is deprecated
|
||||||
* ``sphinx.highlighting.PygmentsBridge.unhighlight()`` is deprecated
|
* ``sphinx.highlighting.PygmentsBridge.unhighlight()`` is deprecated
|
||||||
|
@ -183,6 +183,16 @@ The following is a list of deprecated interface.
|
|||||||
- 3.0
|
- 3.0
|
||||||
- ``sphinx.domains.math.MathDomain``
|
- ``sphinx.domains.math.MathDomain``
|
||||||
|
|
||||||
|
* - ``sphinx.ext.mathbase.MathDirective``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- ``sphinx.directives.patches.MathDirective``
|
||||||
|
|
||||||
|
* - ``sphinx.ext.mathbase.math_role()``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- ``docutils.parsers.rst.roles.math_role()``
|
||||||
|
|
||||||
* - ``sphinx.ext.mathbase.setup_math()``
|
* - ``sphinx.ext.mathbase.setup_math()``
|
||||||
- 1.8
|
- 1.8
|
||||||
- 3.0
|
- 3.0
|
||||||
|
@ -12,10 +12,12 @@
|
|||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
from docutils.parsers.rst.roles import math_role as math_role_base
|
||||||
|
|
||||||
from sphinx.addnodes import math, math_block as displaymath # NOQA # to keep compatibility
|
from sphinx.addnodes import math, math_block as displaymath # NOQA # to keep compatibility
|
||||||
from sphinx.builders.latex.nodes import math_reference as eqref # NOQA # to keep compatibility
|
from sphinx.builders.latex.nodes import math_reference as eqref # NOQA # to keep compatibility
|
||||||
from sphinx.deprecation import RemovedInSphinx30Warning
|
from sphinx.deprecation import RemovedInSphinx30Warning
|
||||||
|
from sphinx.directives.patches import MathDirective as MathDirectiveBase
|
||||||
from sphinx.domains.math import MathDomain # NOQA # to keep compatibility
|
from sphinx.domains.math import MathDomain # NOQA # to keep compatibility
|
||||||
from sphinx.domains.math import MathReferenceRole as EqXRefRole # NOQA # to keep compatibility
|
from sphinx.domains.math import MathReferenceRole as EqXRefRole # NOQA # to keep compatibility
|
||||||
|
|
||||||
@ -26,6 +28,21 @@ if False:
|
|||||||
from sphinx.application import Sphinx # NOQA
|
from sphinx.application import Sphinx # NOQA
|
||||||
|
|
||||||
|
|
||||||
|
class MathDirective(MathDirectiveBase):
|
||||||
|
def run(self):
|
||||||
|
warnings.warn('sphinx.ext.mathbase.MathDirective is moved to '
|
||||||
|
'sphinx.directives.patches package.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
return super(MathDirective, self).run()
|
||||||
|
|
||||||
|
|
||||||
|
def math_role(role, rawtext, text, lineno, inliner, options={}, content=[]):
|
||||||
|
warnings.warn('sphinx.ext.mathbase.math_role() is deprecated. '
|
||||||
|
'Please use docutils.parsers.rst.roles.math_role() instead.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
return math_role_base(role, rawtext, text, lineno, inliner, options, content)
|
||||||
|
|
||||||
|
|
||||||
def get_node_equation_number(writer, node):
|
def get_node_equation_number(writer, node):
|
||||||
# type: (Writer, nodes.Node) -> unicode
|
# type: (Writer, nodes.Node) -> unicode
|
||||||
warnings.warn('sphinx.ext.mathbase.get_node_equation_number() is moved to '
|
warnings.warn('sphinx.ext.mathbase.get_node_equation_number() is moved to '
|
||||||
|
@ -51,8 +51,11 @@
|
|||||||
<%= makeindex %>
|
<%= makeindex %>
|
||||||
\begin{document}
|
\begin{document}
|
||||||
<%= shorthandoff %>
|
<%= shorthandoff %>
|
||||||
|
\pagestyle{empty}
|
||||||
<%= maketitle %>
|
<%= maketitle %>
|
||||||
|
\pagestyle{plain}
|
||||||
<%= tableofcontents %>
|
<%= tableofcontents %>
|
||||||
|
\pagestyle{normal}
|
||||||
<%= body %>
|
<%= body %>
|
||||||
<%= atendofbody %>
|
<%= atendofbody %>
|
||||||
<%= indices %>
|
<%= indices %>
|
||||||
|
@ -29,8 +29,8 @@ help:
|
|||||||
@echo " applehelp to make an Apple Help Book"
|
@echo " applehelp to make an Apple Help Book"
|
||||||
@echo " devhelp to make HTML files and a Devhelp project"
|
@echo " devhelp to make HTML files and a Devhelp project"
|
||||||
@echo " epub to make an epub"
|
@echo " epub to make an epub"
|
||||||
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
|
@echo " latex to make LaTeX files (you can set PAPER=a4 or PAPER=letter)"
|
||||||
@echo " latexpdf to make LaTeX files and run them through pdflatex"
|
@echo " latexpdf to make LaTeX files and then PDFs out of them"
|
||||||
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
|
||||||
@echo " lualatexpdf to make LaTeX files and run them through lualatex"
|
@echo " lualatexpdf to make LaTeX files and run them through lualatex"
|
||||||
@echo " xelatexpdf to make LaTeX files and run them through xelatex"
|
@echo " xelatexpdf to make LaTeX files and run them through xelatex"
|
||||||
|
@ -30,8 +30,8 @@ if "%1" == "help" (
|
|||||||
echo. qthelp to make HTML files and a qthelp project
|
echo. qthelp to make HTML files and a qthelp project
|
||||||
echo. devhelp to make HTML files and a Devhelp project
|
echo. devhelp to make HTML files and a Devhelp project
|
||||||
echo. epub to make an epub
|
echo. epub to make an epub
|
||||||
echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter
|
echo. latex to make LaTeX files (you can set PAPER=a4 or PAPER=letter)
|
||||||
echo. latexpdf to make LaTeX files and run them through platex/dvipdfmx
|
echo. latexpdf to make LaTeX files and then PDFs out of them
|
||||||
echo. text to make text files
|
echo. text to make text files
|
||||||
echo. man to make manual pages
|
echo. man to make manual pages
|
||||||
echo. texinfo to make Texinfo files
|
echo. texinfo to make Texinfo files
|
||||||
|
@ -5,12 +5,10 @@ sub mendex {
|
|||||||
my ($source, $basename, $destination) = @_;
|
my ($source, $basename, $destination) = @_;
|
||||||
my $dictfile = $basename . ".dic";
|
my $dictfile = $basename . ".dic";
|
||||||
unlink($destination);
|
unlink($destination);
|
||||||
if (-f $dictfile) {
|
|
||||||
system("mendex", "-U", "-f", "-d", $dictfile, "-s", "python.ist", $source);
|
system("mendex", "-U", "-f", "-d", $dictfile, "-s", "python.ist", $source);
|
||||||
if ($? > 0) {
|
if ($? > 0) {
|
||||||
print("mendex exited with error code $? (ignored)\n");
|
print("mendex exited with error code $? (ignored)\n");
|
||||||
}
|
}
|
||||||
}
|
|
||||||
if (!-e $destination) {
|
if (!-e $destination) {
|
||||||
# create an empty .ind file if nothing
|
# create an empty .ind file if nothing
|
||||||
open(FH, ">" . $destination);
|
open(FH, ">" . $destination);
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
%
|
%
|
||||||
|
|
||||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||||
\ProvidesPackage{sphinx}[2018/07/18 v1.8 LaTeX package (Sphinx markup)]
|
\ProvidesPackage{sphinx}[2018/09/18 v1.8.1 LaTeX package (Sphinx markup)]
|
||||||
|
|
||||||
% provides \ltx@ifundefined
|
% provides \ltx@ifundefined
|
||||||
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
|
% (many packages load ltxcmds: graphicx does for pdftex and lualatex but
|
||||||
@ -499,15 +499,31 @@
|
|||||||
\sloppy
|
\sloppy
|
||||||
\hbadness = 5000 % don't print trivial gripes
|
\hbadness = 5000 % don't print trivial gripes
|
||||||
|
|
||||||
\pagestyle{empty} % start this way
|
|
||||||
|
|
||||||
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
|
|
||||||
% Note: this presupposes "twoside". If "oneside" class option, there will be warnings.
|
|
||||||
\ltx@ifundefined{fancyhf}{}{
|
|
||||||
% Use \pagestyle{normal} as the primary pagestyle for text.
|
% Use \pagestyle{normal} as the primary pagestyle for text.
|
||||||
|
% Redefine the 'normal' header/footer style when using "fancyhdr" package:
|
||||||
|
\@ifpackageloaded{fancyhdr}{%
|
||||||
|
\ltx@ifundefined{c@chapter}
|
||||||
|
{% no \chapter, "howto" (non-Japanese) docclass
|
||||||
|
\fancypagestyle{plain}{
|
||||||
|
\fancyhf{}
|
||||||
|
\fancyfoot[C]{{\py@HeaderFamily\thepage}}
|
||||||
|
\renewcommand{\headrulewidth}{0pt}
|
||||||
|
\renewcommand{\footrulewidth}{0pt}
|
||||||
|
}
|
||||||
|
% Same as 'plain', this way we can use it in template
|
||||||
|
% FIXME: shouldn't this have a running header with Name and Release like 'manual'?
|
||||||
\fancypagestyle{normal}{
|
\fancypagestyle{normal}{
|
||||||
\fancyhf{}
|
\fancyhf{}
|
||||||
% (for \py@HeaderFamily cf "TITLES")
|
\fancyfoot[C]{{\py@HeaderFamily\thepage}}
|
||||||
|
\renewcommand{\headrulewidth}{0pt}
|
||||||
|
\renewcommand{\footrulewidth}{0pt}
|
||||||
|
}
|
||||||
|
}%
|
||||||
|
{% classes with \chapter command
|
||||||
|
\fancypagestyle{normal}{
|
||||||
|
\fancyhf{}
|
||||||
|
% FIXME: this presupposes "twoside".
|
||||||
|
% If "oneside" class option, there are warnings in LaTeX log.
|
||||||
\fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
|
\fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
|
||||||
\fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
|
\fancyfoot[LO]{{\py@HeaderFamily\nouppercase{\rightmark}}}
|
||||||
\fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
|
\fancyfoot[RE]{{\py@HeaderFamily\nouppercase{\leftmark}}}
|
||||||
@ -520,7 +536,7 @@
|
|||||||
}
|
}
|
||||||
% Update the plain style so we get the page number & footer line,
|
% Update the plain style so we get the page number & footer line,
|
||||||
% but not a chapter or section title. This is to keep the first
|
% but not a chapter or section title. This is to keep the first
|
||||||
% page of a chapter and the blank page between chapters `clean.'
|
% page of a chapter `clean.'
|
||||||
\fancypagestyle{plain}{
|
\fancypagestyle{plain}{
|
||||||
\fancyhf{}
|
\fancyhf{}
|
||||||
\fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
|
\fancyfoot[LE,RO]{{\py@HeaderFamily\thepage}}
|
||||||
@ -528,6 +544,13 @@
|
|||||||
\renewcommand{\footrulewidth}{0.4pt}
|
\renewcommand{\footrulewidth}{0.4pt}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
{% no fancyhdr: memoir class
|
||||||
|
% Provide default for 'normal' style simply as an alias of 'plain' style
|
||||||
|
% This way we can use \pagestyle{normal} in LaTeX template
|
||||||
|
\def\ps@normal{\ps@plain}
|
||||||
|
% Users of memoir class are invited to redefine 'normal' style in preamble
|
||||||
|
}
|
||||||
|
|
||||||
% geometry
|
% geometry
|
||||||
\ifx\kanjiskip\@undefined
|
\ifx\kanjiskip\@undefined
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%
|
%
|
||||||
|
|
||||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||||
\ProvidesClass{sphinxhowto}[2017/03/26 v1.6 Document class (Sphinx HOWTO)]
|
\ProvidesClass{sphinxhowto}[2018/09/18 v1.8.1 Document class (Sphinx HOWTO)]
|
||||||
|
|
||||||
% 'oneside' option overriding the 'twoside' default
|
% 'oneside' option overriding the 'twoside' default
|
||||||
\newif\if@oneside
|
\newif\if@oneside
|
||||||
@ -66,12 +66,7 @@
|
|||||||
\vspace{12pt}
|
\vspace{12pt}
|
||||||
}
|
}
|
||||||
|
|
||||||
\@ifundefined{fancyhf}{
|
\pagenumbering{arabic}
|
||||||
\pagestyle{plain}}{
|
|
||||||
\pagestyle{normal}} % start this way; change for
|
|
||||||
\pagenumbering{arabic} % ToC & chapters
|
|
||||||
|
|
||||||
\thispagestyle{empty}
|
|
||||||
|
|
||||||
% Fix the bibliography environment to add an entry to the Table of
|
% Fix the bibliography environment to add an entry to the Table of
|
||||||
% Contents.
|
% Contents.
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
%
|
%
|
||||||
|
|
||||||
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
|
||||||
\ProvidesClass{sphinxmanual}[2017/03/26 v1.6 Document class (Sphinx manual)]
|
\ProvidesClass{sphinxmanual}[2018/09/18 v1.8.1 Document class (Sphinx manual)]
|
||||||
|
|
||||||
% chapters starting at odd pages (overridden by 'openany' document option)
|
% chapters starting at odd pages (overridden by 'openany' document option)
|
||||||
\PassOptionsToClass{openright}{\sphinxdocclass}
|
\PassOptionsToClass{openright}{\sphinxdocclass}
|
||||||
@ -75,7 +75,6 @@
|
|||||||
|
|
||||||
\newcommand{\sphinxtableofcontents}{%
|
\newcommand{\sphinxtableofcontents}{%
|
||||||
\pagenumbering{roman}%
|
\pagenumbering{roman}%
|
||||||
\pagestyle{plain}%
|
|
||||||
\begingroup
|
\begingroup
|
||||||
\parskip \z@skip
|
\parskip \z@skip
|
||||||
\tableofcontents
|
\tableofcontents
|
||||||
@ -83,7 +82,6 @@
|
|||||||
% before resetting page counter, let's do the right thing.
|
% before resetting page counter, let's do the right thing.
|
||||||
\if@openright\cleardoublepage\else\clearpage\fi
|
\if@openright\cleardoublepage\else\clearpage\fi
|
||||||
\pagenumbering{arabic}%
|
\pagenumbering{arabic}%
|
||||||
\ifdefined\fancyhf\pagestyle{normal}\fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
% This is needed to get the width of the section # area wide enough in the
|
% This is needed to get the width of the section # area wide enough in the
|
||||||
|
@ -305,7 +305,8 @@ class DocFieldTransformer(object):
|
|||||||
entries.append(field)
|
entries.append(field)
|
||||||
|
|
||||||
# but if this has a type then we can at least link it
|
# but if this has a type then we can at least link it
|
||||||
if typedesc and is_typefield and content:
|
if (typedesc and is_typefield and content and
|
||||||
|
len(content) == 1 and isinstance(content[0], nodes.Text)):
|
||||||
target = content[0].astext()
|
target = content[0].astext()
|
||||||
xrefs = typedesc.make_xrefs(
|
xrefs = typedesc.make_xrefs(
|
||||||
typedesc.typerolename,
|
typedesc.typerolename,
|
||||||
@ -318,7 +319,8 @@ class DocFieldTransformer(object):
|
|||||||
fieldbody.children[0].extend(xrefs)
|
fieldbody.children[0].extend(xrefs)
|
||||||
else:
|
else:
|
||||||
fieldbody.clear()
|
fieldbody.clear()
|
||||||
fieldbody.extend(xrefs)
|
fieldbody += nodes.paragraph()
|
||||||
|
fieldbody[0].extend(xrefs)
|
||||||
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
@ -38,3 +38,10 @@ module
|
|||||||
:type y: tuple(str, float)
|
:type y: tuple(str, float)
|
||||||
:rtype: list
|
:rtype: list
|
||||||
|
|
||||||
|
.. py:attribute:: attr1
|
||||||
|
|
||||||
|
:type: ModTopLevel
|
||||||
|
|
||||||
|
.. py:attribute:: attr2
|
||||||
|
|
||||||
|
:type: :doc:`index`
|
||||||
|
@ -113,7 +113,10 @@ def test_domain_py_xrefs(app, status, warning):
|
|||||||
assert_refnode(refnodes[9], False, False, 'str', 'class')
|
assert_refnode(refnodes[9], False, False, 'str', 'class')
|
||||||
assert_refnode(refnodes[10], False, False, 'float', 'class')
|
assert_refnode(refnodes[10], False, False, 'float', 'class')
|
||||||
assert_refnode(refnodes[11], False, False, 'list', 'class')
|
assert_refnode(refnodes[11], False, False, 'list', 'class')
|
||||||
assert len(refnodes) == 12
|
assert_refnode(refnodes[11], False, False, 'list', 'class')
|
||||||
|
assert_refnode(refnodes[12], False, False, 'ModTopLevel', 'class')
|
||||||
|
assert_refnode(refnodes[13], False, False, 'index', 'doc', domain='std')
|
||||||
|
assert len(refnodes) == 14
|
||||||
|
|
||||||
doctree = app.env.get_doctree('module_option')
|
doctree = app.env.get_doctree('module_option')
|
||||||
refnodes = list(doctree.traverse(addnodes.pending_xref))
|
refnodes = list(doctree.traverse(addnodes.pending_xref))
|
||||||
|
Loading…
Reference in New Issue
Block a user