mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-09-03 20:52:55 -05:00
`sphinx.ext.graphviz` supports graph substituions by locale
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
digraph {
|
||||
bar -> baz
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
digraph {
|
||||
BAR -> BAZ
|
||||
}
|
||||
@@ -16,3 +16,6 @@ Hello |graph| graphviz world
|
||||
:graphviz_dot: neato
|
||||
|
||||
bar -> baz
|
||||
|
||||
|
||||
.. graphviz:: graph.dot
|
||||
|
||||
@@ -52,6 +52,9 @@ def test_graphviz_html(app, status, warning):
|
||||
html = 'Hello <img .*?/>\n graphviz world'
|
||||
assert re.search(html, content, re.S)
|
||||
|
||||
html = '<img src=".*?" alt="digraph {\n bar -> baz\n}" />'
|
||||
assert re.search(html, content, re.M)
|
||||
|
||||
|
||||
@with_app('latex', testroot='ext-graphviz')
|
||||
@skip_if_graphviz_not_found
|
||||
@@ -66,3 +69,13 @@ def test_graphviz_latex(app, status, warning):
|
||||
|
||||
macro = 'Hello \\\\includegraphics{graphviz-\w+.pdf} graphviz world'
|
||||
assert re.search(macro, content, re.S)
|
||||
|
||||
|
||||
@with_app('html', testroot='ext-graphviz', confoverrides={'language': 'xx'})
|
||||
@skip_if_graphviz_not_found
|
||||
def test_graphviz_i18n(app, status, warning):
|
||||
app.builder.build_all()
|
||||
|
||||
content = (app.outdir / 'index.html').text()
|
||||
html = '<img src=".*?" alt="digraph {\n BAR -> BAZ\n}" />'
|
||||
assert re.search(html, content, re.M)
|
||||
|
||||
Reference in New Issue
Block a user