JuliaDocs / Documenter.jl

A documentation generator for Julia.
https://documenter.juliadocs.org
MIT License
815 stars 480 forks source link

SVGJS support for Gadfly docs? #229

Closed tlnagy closed 6 years ago

tlnagy commented 8 years ago

I'm in the process of rewriting the documentation for Gadfly and we're transitioning to Documenter.jl. What would be the best way to show the plot in an @example block?

Currently:

using Gadfly # hide
plot(x = rand(10), y = rand(10)

gives

Plot...

which isn't very useful. I know I can do something like the following:

p = # hide
plot(x = rand(10), y = rand(10)
save(SVG("test.svg", 10cm, 6cm), p) # hide

and include ![](test.svg) which is way more cumbersome. I'm using the HTML renderer in the latest Documenter on 0.5 btw.

MichaelHatherly commented 8 years ago

This will need an implementation of "inline" displays similar to what IJulia does, which just hasn't been that high on the list of priorities. It's perfectly doable, but I probably won't get around to implementing it for a little while yet.

tlnagy commented 8 years ago

It would be super nice for https://github.com/dcjones/Gadfly.jl/pull/879. I've mostly finished the transition, but it's missing all the plots that were automatically generated using https://github.com/dcjones/Judo.jl.

MichaelHatherly commented 8 years ago

It would be super nice for dcjones/Gadfly.jl#879.

Yes, definitely. Getting a complete solution to this will take a little while, but I think I could possibly hack in something to at least get basic svg output working for you for the moment.

tlnagy commented 8 years ago

@MichaelHatherly I'm super happy with the SVG support on master. Here's the docs for what is required for SVGJS support when you get the chance to look into it: http://tamasnagy.com/Gadfly.jl/man/backends.html#Changing-the-backend-1 Thanks!

MichaelHatherly commented 8 years ago

Thanks, I'll have a look at that sometime over the next few weeks if I get a chance.

mortenpi commented 6 years ago

I believe #764 fixed this. Please re-open / open a new issue if it still doesn't work.