summaryrefslogtreecommitdiff
path: root/sphinx/directives/code.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r--sphinx/directives/code.py17
1 files changed, 2 insertions, 15 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py
index 8c19dd0c5..fabf259e8 100644
--- a/sphinx/directives/code.py
+++ b/sphinx/directives/code.py
@@ -7,9 +7,9 @@
"""
import sys
-import warnings
from difflib import unified_diff
from typing import Any, Dict, List, Tuple
+from typing import TYPE_CHECKING
from docutils import nodes
from docutils.nodes import Element, Node
@@ -18,14 +18,12 @@ from docutils.statemachine import StringList
from sphinx import addnodes
from sphinx.config import Config
-from sphinx.deprecation import RemovedInSphinx40Warning
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util import parselinenos
from sphinx.util.docutils import SphinxDirective
-if False:
- # For type annotation
+if TYPE_CHECKING:
from sphinx.application import Sphinx
logger = logging.getLogger(__name__)
@@ -57,16 +55,6 @@ class Highlight(SphinxDirective):
linenothreshold=linenothreshold)]
-class HighlightLang(Highlight):
- """highlightlang directive (deprecated)"""
-
- def run(self) -> List[Node]:
- warnings.warn('highlightlang directive is deprecated. '
- 'Please use highlight directive instead.',
- RemovedInSphinx40Warning, stacklevel=2)
- return super().run()
-
-
def dedent_lines(lines: List[str], dedent: int, location: Tuple[str, int] = None) -> List[str]:
if not dedent:
return lines
@@ -468,7 +456,6 @@ class LiteralInclude(SphinxDirective):
def setup(app: "Sphinx") -> Dict[str, Any]:
directives.register_directive('highlight', Highlight)
- directives.register_directive('highlightlang', HighlightLang)
directives.register_directive('code-block', CodeBlock)
directives.register_directive('sourcecode', CodeBlock)
directives.register_directive('literalinclude', LiteralInclude)