From 0071409fe0b01bf5ba2ee1decfeefe5258b6cb4d Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Fri, 20 Nov 2020 22:34:22 +0900 Subject: [PATCH] Fix #8454: graphviz: The layout option for graph and digraph don't work --- CHANGES | 1 + sphinx/ext/graphviz.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index b6bfa0e9368..e54d1f1f4ea 100644 --- a/CHANGES +++ b/CHANGES @@ -42,6 +42,7 @@ Bugs fixed is decorated * #8434: autodoc: :confval:`autodoc_type_aliases` does not effect to variables and attributes +* #8454: graphviz: The layout option for graph and digraph directives don't work Testing -------- diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index 62375f95bc2..dc1cbb68656 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -182,7 +182,8 @@ class GraphvizSimple(SphinxDirective): 'alt': directives.unchanged, 'align': align_spec, 'caption': directives.unchanged, - 'graphviz_dot': directives.unchanged, + 'layout': directives.unchanged, + 'graphviz_dot': directives.unchanged, # an old alias of `layout` option 'name': directives.unchanged, 'class': directives.class_option, } @@ -194,6 +195,8 @@ def run(self) -> List[Node]: node['options'] = {'docname': self.env.docname} if 'graphviz_dot' in self.options: node['options']['graphviz_dot'] = self.options['graphviz_dot'] + if 'layout' in self.options: + node['options']['graphviz_dot'] = self.options['layout'] if 'alt' in self.options: node['alt'] = self.options['alt'] if 'align' in self.options: