fix image path
This commit is contained in:
parent
673d9f87df
commit
71d9cb91c4
1 changed files with 2 additions and 1 deletions
|
@ -11,9 +11,10 @@ class D2langDirective(Directive):
|
||||||
def run(self):
|
def run(self):
|
||||||
# TODO : add tempfile for diag_source
|
# TODO : add tempfile for diag_source
|
||||||
outdir = self.state.document.settings.env.app.builder.outdir
|
outdir = self.state.document.settings.env.app.builder.outdir
|
||||||
|
srcdir = self.state.document.settings.env.srcdir
|
||||||
diag_source = self.content
|
diag_source = self.content
|
||||||
d2_bin = which('d2')
|
d2_bin = which('d2')
|
||||||
cmd_line = "echo %s | %s - %s" % (diag_source, d2_bin, outdir + "/test.svg")
|
cmd_line = "echo %s | %s - %s" % (diag_source, d2_bin, srcdir + "/test.svg")
|
||||||
args = shlex.split(cmd_line)
|
args = shlex.split(cmd_line)
|
||||||
subprocess.run(args)
|
subprocess.run(args)
|
||||||
image_node = nodes.image(uri="/test.svg")
|
image_node = nodes.image(uri="/test.svg")
|
||||||
|
|
Loading…
Reference in a new issue