JuliaTeX / TreeView.jl

Draw Julia syntax trees as a graph
Other
82 stars 15 forks source link

Save to SVG file #27

Open mroavi opened 3 years ago

mroavi commented 3 years ago

Is there a way to save the resulting picture as an SVG file? I know that with TikzPictures.jl you can use:

save(SVG("output"), tp)

but I haven't been able to connect this with TreeView.jl. The reason I would like to do this is because I don't use Jupyter notebooks. Instead I use Vim + REPL for writing Julia code.

If there exists an alternative to viewing the picture in a vim + REPL environment other than saving it and opening it with e.g. the browser, I would also be interested in knowing what it is. Thanks in advance.

dpsanders commented 3 years ago

The result of @tree et al. is a TikzGraphs object. You can save it using the instructions in their docs:

https://nbviewer.jupyter.org/github/JuliaTeX/TikzGraphs.jl/blob/master/doc/TikzGraphs.ipynb

dpsanders commented 3 years ago

A PR toTreeView.jl saying how to do this would be welcome!

mroavi commented 3 years ago

A PR toTreeView.jl saying how to do this would be welcome!

Have you had a chance to look at the PR? Regards.