mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Drop deprecated options for graphviz extension
This commit is contained in:
@@ -76,21 +76,9 @@ It adds these directives:
|
||||
alternate text for HTML output. If not given, the alternate text defaults to
|
||||
the graphviz code.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
All three directives support an ``inline`` flag that controls paragraph
|
||||
breaks in the output. When set, the graph is inserted into the current
|
||||
paragraph. If the flag is not given, paragraph breaks are introduced before
|
||||
and after the image (the default).
|
||||
|
||||
.. versionadded:: 1.1
|
||||
All three directives support a ``caption`` option that can be used to give a
|
||||
caption to the diagram. Naturally, diagrams marked as "inline" cannot have a
|
||||
caption.
|
||||
|
||||
.. deprecated:: 1.4
|
||||
``inline`` option is deprecated.
|
||||
All three directives generate inline node by default. If ``caption`` is given,
|
||||
these generate block node instead.
|
||||
caption to the diagram.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
All three directives support a ``graphviz_dot`` option that can be switch the
|
||||
|
||||
@@ -82,7 +82,6 @@ class Graphviz(Directive):
|
||||
option_spec = {
|
||||
'alt': directives.unchanged,
|
||||
'align': align_spec,
|
||||
'inline': directives.flag,
|
||||
'caption': directives.unchanged,
|
||||
'graphviz_dot': directives.unchanged,
|
||||
'name': directives.unchanged,
|
||||
@@ -122,8 +121,6 @@ class Graphviz(Directive):
|
||||
node['alt'] = self.options['alt']
|
||||
if 'align' in self.options:
|
||||
node['align'] = self.options['align']
|
||||
if 'inline' in self.options:
|
||||
node['inline'] = True
|
||||
|
||||
caption = self.options.get('caption')
|
||||
if caption:
|
||||
@@ -144,7 +141,6 @@ class GraphvizSimple(Directive):
|
||||
option_spec = {
|
||||
'alt': directives.unchanged,
|
||||
'align': align_spec,
|
||||
'inline': directives.flag,
|
||||
'caption': directives.unchanged,
|
||||
'graphviz_dot': directives.unchanged,
|
||||
'name': directives.unchanged,
|
||||
@@ -162,8 +158,6 @@ class GraphvizSimple(Directive):
|
||||
node['alt'] = self.options['alt']
|
||||
if 'align' in self.options:
|
||||
node['align'] = self.options['align']
|
||||
if 'inline' in self.options:
|
||||
node['inline'] = True
|
||||
|
||||
caption = self.options.get('caption')
|
||||
if caption:
|
||||
@@ -233,16 +227,6 @@ def render_dot(self, code, options, format, prefix='graphviz'):
|
||||
return relfn, outfn
|
||||
|
||||
|
||||
def warn_for_deprecated_option(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
if hasattr(self.builder, '_graphviz_warned_inline'):
|
||||
return
|
||||
|
||||
if 'inline' in node:
|
||||
logger.warning(':inline: option for graphviz is deprecated since version 1.4.0.')
|
||||
self.builder._graphviz_warned_inline = True
|
||||
|
||||
|
||||
def render_dot_html(self, node, code, options, prefix='graphviz',
|
||||
imgcls=None, alt=None):
|
||||
# type: (nodes.NodeVisitor, graphviz, unicode, Dict, unicode, unicode, unicode) -> Tuple[unicode, unicode] # NOQA
|
||||
@@ -290,7 +274,6 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
|
||||
|
||||
def html_visit_graphviz(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
warn_for_deprecated_option(self, node)
|
||||
render_dot_html(self, node, node['code'], node['options'])
|
||||
|
||||
|
||||
@@ -327,7 +310,6 @@ def render_dot_latex(self, node, code, options, prefix='graphviz'):
|
||||
|
||||
def latex_visit_graphviz(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
warn_for_deprecated_option(self, node)
|
||||
render_dot_latex(self, node, node['code'], node['options'])
|
||||
|
||||
|
||||
@@ -345,13 +327,11 @@ def render_dot_texinfo(self, node, code, options, prefix='graphviz'):
|
||||
|
||||
def texinfo_visit_graphviz(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
warn_for_deprecated_option(self, node)
|
||||
render_dot_texinfo(self, node, node['code'], node['options'])
|
||||
|
||||
|
||||
def text_visit_graphviz(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
warn_for_deprecated_option(self, node)
|
||||
if 'alt' in node.attributes:
|
||||
self.add_text(_('[graph: %s]') % node['alt'])
|
||||
else:
|
||||
@@ -361,7 +341,6 @@ def text_visit_graphviz(self, node):
|
||||
|
||||
def man_visit_graphviz(self, node):
|
||||
# type: (nodes.NodeVisitor, graphviz) -> None
|
||||
warn_for_deprecated_option(self, node)
|
||||
if 'alt' in node.attributes:
|
||||
self.body.append(_('[graph: %s]') % node['alt'])
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user