From 216804f3142da96f350bf9e5cb86a0682bd241fb Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sun, 9 Nov 2014 19:04:01 +0100 Subject: Deprecate make_admonition. --- sphinx/util/compat.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sphinx/util/compat.py b/sphinx/util/compat.py index 9e5d619d..a0cb566d 100644 --- a/sphinx/util/compat.py +++ b/sphinx/util/compat.py @@ -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: -- cgit v1.2.1