mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
#2575: Now `sphinx.ext.graphviz allows :align:` option
This commit is contained in:
@@ -19,3 +19,9 @@ Hello |graph| graphviz world
|
||||
|
||||
|
||||
.. graphviz:: graph.dot
|
||||
|
||||
.. digraph:: bar
|
||||
:align: right
|
||||
:caption: on right
|
||||
|
||||
foo -> bar
|
||||
|
||||
@@ -55,6 +55,10 @@ def test_graphviz_html(app, status, warning):
|
||||
html = '<img src=".*?" alt="digraph {\n bar -> baz\n}" />'
|
||||
assert re.search(html, content, re.M)
|
||||
|
||||
html = ('<div class="figure align-right" .*?>\s*<img .*?/>\s*<p class="caption">'
|
||||
'<span class="caption-text">on right</span>.*</p>\s*</div>')
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
|
||||
@with_app('latex', testroot='ext-graphviz')
|
||||
@skip_if_graphviz_not_found
|
||||
@@ -70,6 +74,11 @@ def test_graphviz_latex(app, status, warning):
|
||||
macro = 'Hello \\\\includegraphics{graphviz-\w+.pdf} graphviz world'
|
||||
assert re.search(macro, content, re.S)
|
||||
|
||||
macro = ('\\\\begin{wrapfigure}{r}{0pt}\n\\\\centering\n'
|
||||
'\\\\includegraphics{graphviz-\w+.pdf}\n'
|
||||
'\\\\caption{on right}\\\\label{.*}\\\\end{wrapfigure}')
|
||||
assert re.search(macro, content, re.S)
|
||||
|
||||
|
||||
@with_app('html', testroot='ext-graphviz', confoverrides={'language': 'xx'})
|
||||
@skip_if_graphviz_not_found
|
||||
|
||||
Reference in New Issue
Block a user