mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #4845 from tk0miya/deprecate_highlightlang_directive
Deprecate highlightlang directive
This commit is contained in:
commit
9c98af5382
1
CHANGES
1
CHANGES
@ -48,6 +48,7 @@ Deprecated
|
||||
* ``Config.check_types()`` is deprecated
|
||||
* ``Config.check_unicode()`` is deprecated
|
||||
* ``sphinx.application.CONFIG_FILENAME`` is deprecated
|
||||
* ``highlightlang`` directive is deprecated
|
||||
|
||||
For more details, see `deprecation APIs list
|
||||
<http://www.sphinx-doc.org/en/master/extdev/index.html#deprecated-apis>`_
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: python
|
||||
.. highlight:: python
|
||||
|
||||
.. _build-config:
|
||||
|
||||
|
@ -116,6 +116,11 @@ The following is a list of deprecated interface.
|
||||
- (will be) Removed
|
||||
- Alternatives
|
||||
|
||||
* - :rst:dir:`highlightlang`
|
||||
- 1.8
|
||||
- 4.0
|
||||
- :rst:dir:`highlight`
|
||||
|
||||
* - :meth:`~sphinx.application.Sphinx.add_stylesheet()`
|
||||
- 1.8
|
||||
- 4.0
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: python
|
||||
.. highlight:: python
|
||||
|
||||
.. _latex:
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: python
|
||||
.. highlight:: python
|
||||
|
||||
.. _markdown:
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: python
|
||||
.. highlight:: python
|
||||
|
||||
HTML theming support
|
||||
====================
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: rst
|
||||
.. highlight:: rst
|
||||
|
||||
.. _rst-primer:
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.. highlightlang:: rst
|
||||
.. highlight:: rst
|
||||
|
||||
===========
|
||||
Field Lists
|
||||
|
@ -9,6 +9,7 @@
|
||||
|
||||
import codecs
|
||||
import sys
|
||||
import warnings
|
||||
from difflib import unified_diff
|
||||
|
||||
from docutils import nodes
|
||||
@ -17,6 +18,7 @@ from docutils.statemachine import ViewList
|
||||
from six import text_type
|
||||
|
||||
from sphinx import addnodes
|
||||
from sphinx.deprecation import RemovedInSphinx40Warning
|
||||
from sphinx.locale import __
|
||||
from sphinx.util import logging
|
||||
from sphinx.util import parselinenos
|
||||
@ -59,6 +61,17 @@ class Highlight(SphinxDirective):
|
||||
linenothreshold=linenothreshold)]
|
||||
|
||||
|
||||
class HighlightLang(Highlight):
|
||||
"""highlightlang directive (deprecated)"""
|
||||
|
||||
def run(self):
|
||||
# type: () -> List[nodes.Node]
|
||||
warnings.warn('highlightlang directive is deprecated. '
|
||||
'Please use highlight directive instead.',
|
||||
RemovedInSphinx40Warning)
|
||||
return Highlight.run(self)
|
||||
|
||||
|
||||
def dedent_lines(lines, dedent, location=None):
|
||||
# type: (List[unicode], int, Any) -> List[unicode]
|
||||
if not dedent:
|
||||
@ -462,7 +475,7 @@ class LiteralInclude(SphinxDirective):
|
||||
def setup(app):
|
||||
# type: (Sphinx) -> Dict[unicode, Any]
|
||||
directives.register_directive('highlight', Highlight)
|
||||
directives.register_directive('highlightlang', Highlight) # old
|
||||
directives.register_directive('highlightlang', HighlightLang)
|
||||
directives.register_directive('code-block', CodeBlock)
|
||||
directives.register_directive('sourcecode', CodeBlock)
|
||||
directives.register_directive('literalinclude', LiteralInclude)
|
||||
|
Loading…
Reference in New Issue
Block a user