mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate footnotes helpers
This commit is contained in:
parent
6977270b66
commit
abf8999ce7
5
CHANGES
5
CHANGES
@ -36,6 +36,11 @@ Deprecated
|
|||||||
* ``env._nitpick_ignore`` is deprecated
|
* ``env._nitpick_ignore`` is deprecated
|
||||||
* ``app.override_domain()`` is deprecated
|
* ``app.override_domain()`` is deprecated
|
||||||
* ``app.add_stylesheet()`` is deprecated
|
* ``app.add_stylesheet()`` is deprecated
|
||||||
|
* ``sphinx.writers.latex.Table.caption_footnotetexts`` is deprecated
|
||||||
|
* ``sphinx.writers.latex.Table.header_footnotetexts`` is deprecated
|
||||||
|
* ``sphinx.writers.latex.LaTeXWriter.footnotestack`` is deprecated
|
||||||
|
* ``sphinx.writers.latex.LaTeXWriter.restrict_footnote()`` is deprecated
|
||||||
|
* ``sphinx.writers.latex.LaTeXWriter.unrestrict_footnote()`` is deprecated
|
||||||
|
|
||||||
For more details, see `deprecation APIs list
|
For more details, see `deprecation APIs list
|
||||||
<http://www.sphinx-doc.org/en/master/extdev/index.html#deprecated-apis>`_
|
<http://www.sphinx-doc.org/en/master/extdev/index.html#deprecated-apis>`_
|
||||||
|
@ -119,6 +119,31 @@ The following is a list of deprecated interface.
|
|||||||
- 4.0
|
- 4.0
|
||||||
- :meth:`~sphinx.application.Sphinx.add_css_file()`
|
- :meth:`~sphinx.application.Sphinx.add_css_file()`
|
||||||
|
|
||||||
|
* - ``sphinx.writers.latex.Table.caption_footnotetexts``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- -
|
||||||
|
|
||||||
|
* - ``sphinx.writers.latex.Table.header_footnotetexts``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- -
|
||||||
|
|
||||||
|
* - ``sphinx.writers.latex.LaTeXWriter.footnotestack``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- -
|
||||||
|
|
||||||
|
* - ``sphinx.writers.latex.LaTeXWriter.restrict_footnote()``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- -
|
||||||
|
|
||||||
|
* - ``sphinx.writers.latex.LaTeXWriter.unrestrict_footnote()``
|
||||||
|
- 1.8
|
||||||
|
- 3.0
|
||||||
|
- -
|
||||||
|
|
||||||
* - ``sphinx.application.Sphinx.override_domain()``
|
* - ``sphinx.application.Sphinx.override_domain()``
|
||||||
- 1.8
|
- 1.8
|
||||||
- 3.0
|
- 3.0
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
import warnings
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
from os import path
|
from os import path
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ from sphinx import addnodes
|
|||||||
from sphinx import highlighting
|
from sphinx import highlighting
|
||||||
from sphinx.builders.latex.nodes import footnotetext
|
from sphinx.builders.latex.nodes import footnotetext
|
||||||
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA # for compatibility
|
from sphinx.builders.latex.transforms import URI_SCHEMES, ShowUrlsTransform # NOQA # for compatibility
|
||||||
|
from sphinx.deprecation import RemovedInSphinx30Warning
|
||||||
from sphinx.errors import SphinxError
|
from sphinx.errors import SphinxError
|
||||||
from sphinx.locale import admonitionlabels, _, __
|
from sphinx.locale import admonitionlabels, _, __
|
||||||
from sphinx.util import split_into, logging
|
from sphinx.util import split_into, logging
|
||||||
@ -240,8 +242,6 @@ class Table(object):
|
|||||||
self.has_oldproblematic = False
|
self.has_oldproblematic = False
|
||||||
self.has_verbatim = False
|
self.has_verbatim = False
|
||||||
self.caption = None # type: List[unicode]
|
self.caption = None # type: List[unicode]
|
||||||
self.caption_footnotetexts = [] # type: List[unicode]
|
|
||||||
self.header_footnotetexts = [] # type: List[unicode]
|
|
||||||
self.stubs = [] # type: List[int]
|
self.stubs = [] # type: List[int]
|
||||||
|
|
||||||
# current position
|
# current position
|
||||||
@ -255,6 +255,20 @@ class Table(object):
|
|||||||
# (cell = rectangular area)
|
# (cell = rectangular area)
|
||||||
self.cell_id = 0 # last assigned cell_id
|
self.cell_id = 0 # last assigned cell_id
|
||||||
|
|
||||||
|
@property
|
||||||
|
def caption_footnotetexts(self):
|
||||||
|
# type: () -> List[unicode]
|
||||||
|
warnings.warn('table.caption_footnotetexts is deprecated.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
return []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def header_footnotetexts(self):
|
||||||
|
# type: () -> List[unicode]
|
||||||
|
warnings.warn('table.header_footnotetexts is deprecated.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
return []
|
||||||
|
|
||||||
def is_longtable(self):
|
def is_longtable(self):
|
||||||
# type: () -> bool
|
# type: () -> bool
|
||||||
"""True if and only if table uses longtable environment."""
|
"""True if and only if table uses longtable environment."""
|
||||||
@ -631,7 +645,6 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
self.hlsettingstack = 2 * [[builder.config.highlight_language,
|
self.hlsettingstack = 2 * [[builder.config.highlight_language,
|
||||||
sys.maxsize]]
|
sys.maxsize]]
|
||||||
self.bodystack = [] # type: List[List[unicode]]
|
self.bodystack = [] # type: List[List[unicode]]
|
||||||
self.footnotestack = [] # type: List[Dict[unicode, List[Union[collected_footnote, bool]]]] # NOQA
|
|
||||||
self.footnote_restricted = False
|
self.footnote_restricted = False
|
||||||
self.pending_footnotes = [] # type: List[nodes.footnote_reference]
|
self.pending_footnotes = [] # type: List[nodes.footnote_reference]
|
||||||
self.curfilestack = [] # type: List[unicode]
|
self.curfilestack = [] # type: List[unicode]
|
||||||
@ -668,12 +681,18 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
|
|
||||||
def restrict_footnote(self, node):
|
def restrict_footnote(self, node):
|
||||||
# type: (nodes.Node) -> None
|
# type: (nodes.Node) -> None
|
||||||
|
warnings.warn('LaTeXWriter.restrict_footnote() is deprecated.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
|
||||||
if self.footnote_restricted is False:
|
if self.footnote_restricted is False:
|
||||||
self.footnote_restricted = node
|
self.footnote_restricted = node
|
||||||
self.pending_footnotes = []
|
self.pending_footnotes = []
|
||||||
|
|
||||||
def unrestrict_footnote(self, node):
|
def unrestrict_footnote(self, node):
|
||||||
# type: (nodes.Node) -> None
|
# type: (nodes.Node) -> None
|
||||||
|
warnings.warn('LaTeXWriter.unrestrict_footnote() is deprecated.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
|
||||||
if self.footnote_restricted == node:
|
if self.footnote_restricted == node:
|
||||||
self.footnote_restricted = False
|
self.footnote_restricted = False
|
||||||
for footnode in self.pending_footnotes:
|
for footnode in self.pending_footnotes:
|
||||||
@ -681,6 +700,13 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
|||||||
footnode.walkabout(self)
|
footnode.walkabout(self)
|
||||||
self.pending_footnotes = []
|
self.pending_footnotes = []
|
||||||
|
|
||||||
|
@property
|
||||||
|
def footnotestack(self):
|
||||||
|
# type: () -> List[Dict[unicode, List[Union[collected_footnote, bool]]]]
|
||||||
|
warnings.warn('LaTeXWriter.footnotestack is deprecated.',
|
||||||
|
RemovedInSphinx30Warning)
|
||||||
|
return []
|
||||||
|
|
||||||
def format_docclass(self, docclass):
|
def format_docclass(self, docclass):
|
||||||
# type: (unicode) -> unicode
|
# type: (unicode) -> unicode
|
||||||
""" prepends prefix to sphinx document classes
|
""" prepends prefix to sphinx document classes
|
||||||
|
Loading…
Reference in New Issue
Block a user