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.
|
||||
:license: BSD, see LICENSE for details.
|
||||
"""
|
||||
import warnings
|
||||
|
||||
from docutils import nodes
|
||||
|
||||
from docutils import __version__ as _du_version
|
||||
docutils_version = tuple(int(x) for x in _du_version.split('.')[:2])
|
||||
|
||||
|
||||
def make_admonition(node_class, name, arguments, options, content, lineno,
|
||||
content_offset, block_text, state, state_machine):
|
||||
#if not content:
|
||||
# error = state_machine.reporter.error(
|
||||
# 'The "%s" admonition is empty; content required.' % (name),
|
||||
# nodes.literal_block(block_text, block_text), line=lineno)
|
||||
# return [error]
|
||||
warnings.warn('make_admonition is deprecated, use '
|
||||
'docutils.parsers.rst.directives.admonitions.BaseAdmonition '
|
||||
'instead', DeprecationWarning, stacklevel=1)
|
||||
text = '\n'.join(content)
|
||||
admonition_node = node_class(text)
|
||||
if arguments:
|
||||
|
Loading…
Reference in New Issue
Block a user