diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 13:50:15 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2018-12-15 14:13:04 +0300 |
commit | 08bc8479643107627a98db34374e85a7e3734767 (patch) | |
tree | 53707f299ea296ac535a5297017d8a7e6be792ea /sphinx/addnodes.py | |
parent | aaf0046f441aab454c64c792291dd87867fd0699 (diff) |
Deprecate abbreviation node (refs: #5720)
Diffstat (limited to 'sphinx/addnodes.py')
-rw-r--r-- | sphinx/addnodes.py | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sphinx/addnodes.py b/sphinx/addnodes.py index d907f617a..4b330b8ec 100644 --- a/sphinx/addnodes.py +++ b/sphinx/addnodes.py @@ -13,7 +13,7 @@ import warnings from docutils import nodes -from sphinx.deprecation import RemovedInSphinx30Warning +from sphinx.deprecation import RemovedInSphinx30Warning, RemovedInSphinx40Warning if False: # For type annotation @@ -344,8 +344,18 @@ class literal_strong(nodes.strong, not_smartquotable): """ -class abbreviation(nodes.Inline, nodes.TextElement): - """Node for abbreviations with explanations.""" +class abbreviation(nodes.abbreviation): + """Node for abbreviations with explanations. + + .. deprecated:: 2.0 + """ + + def __init__(self, rawsource='', text='', *children, **attributes): + # type: (str, str, *nodes.Node, **Any) -> None + warnings.warn("abbrevition node for Sphinx was replaced by docutils'.", + RemovedInSphinx40Warning, stacklevel=2) + + super(abbreviation, self).__init__(rawsource, text, *children, **attributes) class manpage(nodes.Inline, nodes.FixedTextElement): @@ -389,7 +399,6 @@ def setup(app): app.add_node(download_reference) app.add_node(literal_emphasis) app.add_node(literal_strong) - app.add_node(abbreviation, override=True) app.add_node(manpage) return { |