Deprecate make_admonition.

This commit is contained in:
Georg Brandl 2014-11-09 19:04:01 +01:00
parent 4f4d8688d5
commit 09d2c399d3

View File

@ -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: