mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Deprecate make_admonition.
This commit is contained in:
parent
4f4d8688d5
commit
09d2c399d3
@ -8,19 +8,19 @@
|
|||||||
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
|
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
|
||||||
:license: BSD, see LICENSE for details.
|
:license: BSD, see LICENSE for details.
|
||||||
"""
|
"""
|
||||||
|
import warnings
|
||||||
|
|
||||||
from docutils import nodes
|
from docutils import nodes
|
||||||
|
|
||||||
from docutils import __version__ as _du_version
|
from docutils import __version__ as _du_version
|
||||||
docutils_version = tuple(int(x) for x in _du_version.split('.')[:2])
|
docutils_version = tuple(int(x) for x in _du_version.split('.')[:2])
|
||||||
|
|
||||||
|
|
||||||
def make_admonition(node_class, name, arguments, options, content, lineno,
|
def make_admonition(node_class, name, arguments, options, content, lineno,
|
||||||
content_offset, block_text, state, state_machine):
|
content_offset, block_text, state, state_machine):
|
||||||
#if not content:
|
warnings.warn('make_admonition is deprecated, use '
|
||||||
# error = state_machine.reporter.error(
|
'docutils.parsers.rst.directives.admonitions.BaseAdmonition '
|
||||||
# 'The "%s" admonition is empty; content required.' % (name),
|
'instead', DeprecationWarning, stacklevel=1)
|
||||||
# nodes.literal_block(block_text, block_text), line=lineno)
|
|
||||||
# return [error]
|
|
||||||
text = '\n'.join(content)
|
text = '\n'.join(content)
|
||||||
admonition_node = node_class(text)
|
admonition_node = node_class(text)
|
||||||
if arguments:
|
if arguments:
|
||||||
|
Loading…
Reference in New Issue
Block a user