diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-07 04:29:06 +0300 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2020-03-07 13:36:41 +0300 |
commit | 3e0618ba3a84c7db51813cab43779d11c5fe7802 (patch) | |
tree | a0148ca006d312c83ec36a906352e13f924b376b /sphinx/directives | |
parent | c4321ce8303e125ddb01be3d44e697865d7c8eaf (diff) |
Deprecate codes for docutils-0.13 or 0.14
Diffstat (limited to 'sphinx/directives')
-rw-r--r-- | sphinx/directives/patches.py | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/sphinx/directives/patches.py b/sphinx/directives/patches.py index 4b73a7955..8a27c0170 100644 --- a/sphinx/directives/patches.py +++ b/sphinx/directives/patches.py @@ -6,6 +6,7 @@ :license: BSD, see LICENSE for details. """ +import warnings from typing import Any, Dict, List, Tuple from typing import cast @@ -15,6 +16,7 @@ from docutils.parsers.rst import directives from docutils.parsers.rst.directives import images, html, tables from sphinx import addnodes +from sphinx.deprecation import RemovedInSphinx60Warning from sphinx.directives import optional_int from sphinx.domains.math import MathDomain from sphinx.util.docutils import SphinxDirective @@ -73,6 +75,11 @@ class RSTTable(tables.RSTTable): Only for docutils-0.13 or older version.""" + def run(self) -> List[Node]: + warnings.warn('RSTTable is deprecated.', + RemovedInSphinx60Warning) + return super().run() + def make_title(self) -> Tuple[nodes.title, List[system_message]]: title, message = super().make_title() if title: @@ -86,6 +93,11 @@ class CSVTable(tables.CSVTable): Only for docutils-0.13 or older version.""" + def run(self) -> List[Node]: + warnings.warn('RSTTable is deprecated.', + RemovedInSphinx60Warning) + return super().run() + def make_title(self) -> Tuple[nodes.title, List[system_message]]: title, message = super().make_title() if title: @@ -99,6 +111,11 @@ class ListTable(tables.ListTable): Only for docutils-0.13 or older version.""" + def run(self) -> List[Node]: + warnings.warn('RSTTable is deprecated.', + RemovedInSphinx60Warning) + return super().run() + def make_title(self) -> Tuple[nodes.title, List[system_message]]: title, message = super().make_title() if title: @@ -209,9 +226,6 @@ class MathDirective(SphinxDirective): def setup(app: "Sphinx") -> Dict[str, Any]: directives.register_directive('figure', Figure) directives.register_directive('meta', Meta) - directives.register_directive('table', RSTTable) - directives.register_directive('csv-table', CSVTable) - directives.register_directive('list-table', ListTable) directives.register_directive('code', Code) directives.register_directive('math', MathDirective) |