Skip to content

Commit

Permalink
Merge branch '3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
tk0miya committed Feb 12, 2021
2 parents 8b78638 + 73b2f94 commit def6f13
Show file tree
Hide file tree
Showing 8 changed files with 350 additions and 250 deletions.
8 changes: 8 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ Deprecated
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.broken``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.good``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.redirected``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.rqueue``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.to_ignore``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.workers``
* ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.wqueue``
* ``sphinx.builders.linkcheck.node_line_or_0()``
* ``sphinx.ext.autodoc.AttributeDocumenter.isinstanceattribute()``
* ``sphinx.ext.autodoc.directive.DocumenterBridge.reporter``
Expand Down Expand Up @@ -134,6 +137,7 @@ Features added
* #6550: html: Allow to use HTML permalink texts via
:confval:`html_permalinks_icon`
* #1638: html: Add permalink icons to glossary terms
* #8868: html search: performance issue with massive lists
* #8852: i18n: Allow to translate heading syntax in MyST-Parser
* #8649: imgconverter: Skip availability check if builder supports the image
type
Expand Down Expand Up @@ -221,6 +225,10 @@ Bugs fixed
* #8849: LaTex: code-block printed out of margin (see the opt-in LaTeX syntax
boolean :ref:`verbatimforcewraps <latexsphinxsetupforcewraps>` for use via
the :ref:`'sphinxsetup' <latexsphinxsetup>` key of ``latex_elements``)
* #8183: LaTeX: Remove substitution_reference nodes from doctree only on LaTeX
builds
* #8865: LaTeX: Restructure the index nodes inside title nodes only on LaTeX
builds

Testing
--------
Expand Down
2 changes: 1 addition & 1 deletion doc/development/tutorials/examples/recipe.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def handle_signature(self, sig, signode):

def add_target_and_index(self, name_cls, sig, signode):
signode['ids'].append('recipe' + '-' + sig)
if 'noindex' not in self.options:
if 'contains' not in self.options:
ingredients = [
x.strip() for x in self.options.get('contains').split(',')]

Expand Down
15 changes: 15 additions & 0 deletions doc/extdev/deprecated.rst
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,26 @@ The following is a list of deprecated interfaces.
- 5.0
- N/A

* - ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.rqueue``
- 3.5
- 5.0
- N/A

* - ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.to_ignore``
- 3.5
- 5.0
- N/A

* - ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.workers``
- 3.5
- 5.0
- N/A

* - ``sphinx.builders.linkcheck.CheckExternalLinksBuilder.wqueue``
- 3.5
- 5.0
- N/A

* - ``sphinx.builders.linkcheck.node_line_or_0()``
- 3.5
- 5.0
Expand Down
51 changes: 25 additions & 26 deletions sphinx/builders/latex/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class SubstitutionDefinitionsRemover(SphinxPostTransform):
default_priority = Substitutions.default_priority + 1
builders = ('latex',)

def apply(self, **kwargs: Any) -> None:
def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(nodes.substitution_definition):
node.parent.remove(node)

Expand Down Expand Up @@ -192,7 +192,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
headings having footnotes
<footnote_reference>
1
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
Expand All @@ -203,11 +203,9 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
<section>
<title>
headings having footnotes
<footnotemark>
<footnotemark refid="id1">
1
<footnotetext>
footnote body
<footnotetext>
<footnotetext ids="id1">
<label>
1
<paragraph>
Expand All @@ -222,7 +220,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
1
blah blah blah ...
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
Expand All @@ -231,7 +229,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
After::
blah blah blah
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
Expand All @@ -251,7 +249,7 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
1
blah blah blah ...
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
Expand All @@ -260,21 +258,21 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
After::
blah blah blah
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
footnote body
blah blah blah
<footnotemark>
<footnotemark refid="id1">
1
blah blah blah ...
* Remove unreferenced footnotes
Before::
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
Expand All @@ -291,26 +289,26 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
<table>
<title>
title having footnote_reference
<footnote_reference refid="1">
<footnote_reference refid="id1">
1
<tgroup>
<thead>
<row>
<entry>
header having footnote_reference
<footnote_reference refid="2">
<footnote_reference refid="id2">
2
<tbody>
<row>
...
<footnote ids="1">
<footnote ids="id1">
<label>
1
<paragraph>
footnote body
<footnote ids="2">
<footnote ids="id2">
<label>
2
<paragraph>
Expand All @@ -321,23 +319,23 @@ class LaTeXFootnoteTransform(SphinxPostTransform):
<table>
<title>
title having footnote_reference
<footnotemark>
<footnotemark refid="id1">
1
<tgroup>
<thead>
<row>
<entry>
header having footnote_reference
<footnotemark>
<footnotemark refid="id2">
2
<tbody>
<footnotetext>
<footnotetext ids="id1">
<label>
1
<paragraph>
footnote body
<footnotetext>
<footnotetext ids="id2">
<label>
2
<paragraph>
Expand Down Expand Up @@ -382,7 +380,7 @@ def unrestrict(self, node: Element) -> None:
self.restricted = None
pos = node.parent.index(node)
for i, footnote, in enumerate(self.pendings):
fntext = footnotetext('', *footnote.children)
fntext = footnotetext('', *footnote.children, ids=footnote['ids'])
node.parent.insert(pos + i + 1, fntext)
self.pendings = []

Expand Down Expand Up @@ -427,7 +425,7 @@ def depart_thead(self, node: nodes.thead) -> None:
def depart_table(self, node: nodes.table) -> None:
tbody = list(node.traverse(nodes.tbody))[0]
for footnote in reversed(self.table_footnotes):
fntext = footnotetext('', *footnote.children)
fntext = footnotetext('', *footnote.children, ids=footnote['ids'])
tbody.insert(0, fntext)

self.table_footnotes = []
Expand All @@ -442,13 +440,13 @@ def visit_footnote_reference(self, node: nodes.footnote_reference) -> None:
number = node.astext().strip()
docname = node['docname']
if self.restricted:
mark = footnotemark('', number)
mark = footnotemark('', number, refid=node['refid'])
node.replace_self(mark)
if (docname, number) not in self.appeared:
footnote = self.get_footnote_by_reference(node)
self.pendings.append(footnote)
elif (docname, number) in self.appeared:
mark = footnotemark('', number)
mark = footnotemark('', number, refid=node['refid'])
node.replace_self(mark)
else:
footnote = self.get_footnote_by_reference(node)
Expand Down Expand Up @@ -574,7 +572,7 @@ def run(self, **kwargs: Any) -> None:
section['ids'].append(':doc') # special label for :doc:


class IndexInSectionTitleTransform(SphinxTransform):
class IndexInSectionTitleTransform(SphinxPostTransform):
"""Move index nodes in section title to outside of the title.
LaTeX index macro is not compatible with some handling of section titles
Expand All @@ -601,8 +599,9 @@ class IndexInSectionTitleTransform(SphinxTransform):
...
"""
default_priority = 400
builders = ('latex',)

def apply(self, **kwargs: Any) -> None:
def run(self, **kwargs: Any) -> None:
for node in self.document.traverse(nodes.title):
if isinstance(node.parent, nodes.section):
for i, index in enumerate(node.traverse(addnodes.index)):
Expand Down
Loading

0 comments on commit def6f13

Please sign in to comment.