Skip to content

Commit

Permalink
Merge pull request #8455 from tk0miya/8454_graphviz_layout_option
Browse files Browse the repository at this point in the history
Fix #8454: graphviz: The layout option for graph and digraph don't work
  • Loading branch information
tk0miya committed Nov 20, 2020
2 parents 18b2707 + e8b7fd2 commit 296e764
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Bugs fixed
* #8443: autodoc: autoattribute directive can't create document for PEP-526
based uninitalized variables
* #8419: html search: Do not load ``language_data.js`` in non-search pages
* #8454: graphviz: The layout option for graph and digraph directives don't work

Testing
--------
Expand Down
5 changes: 4 additions & 1 deletion sphinx/ext/graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand All @@ -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:
Expand Down

0 comments on commit 296e764

Please sign in to comment.