rlespinasse / drawio-export

Export Draw.io diagrams using docker
https://hub.docker.com/r/rlespinasse/drawio-export
MIT License
63 stars 11 forks source link

mdbooks integration #76

Open brandonphelps opened 1 year ago

brandonphelps commented 1 year ago

Hi,

I'm interested in using these docker images to provide support for exporting drawio diagrams into svg format so they can be embedded into mdbooks.

However I'm stumbling into issues using the docker image. I believe part of my issue is coming from how the output directory flag is being used for specifying the output directory. with the directory structure of

src/chapter1.md
src/diagram1.md
book/
book.toml

if i run the docker container with the following.

docker run -it -v $(pwd):/data rlespinasse/drawio-export --output book src/diagram1.md

I was expecting the output to be in the book folder, however the results end up in.

src/book/

For the export process I'd like put the output into output directory that a mdbook user would expect.

Looking at the drawio-export rust utility, https://github.com/rlespinasse/drawio-exporter/blob/927228c390fb0e9a3957ae65ebbcd988f3d9fa7a/src/drawio_exporter/ops/exporter.rs#L95 shows that the output folder options passed to the drawio-exporter is joined to the path of where directory containing diagram.

So I'm curious on any thoughts on either supporting a direct way to specify the output directory or other suggestions that I'm missing.

Additionally thanks for creating this tool, this will be very helpful.

rlespinasse commented 1 year ago

Currently, it's not possible without a post-script on your side. rlespinasse/drawio-exporter#28 will enable us to do this kind of export directly.

brandonphelps commented 1 year ago

Okay sounds good, thanks for following up.

I'll take a look at that issue and see if I can add that in.