plots icon indicating copy to clipboard operation
plots copied to clipboard

Haddock: add generating code to figures

Open ocramz opened this issue 9 years ago • 5 comments

I would be extremely helpful if pages such as https://hackage.haskell.org/package/plots-0.1.0.2/docs/Plots-Types-Scatter.html also included the code snippet that generated the figure under the figure itself, as a -- > ... comment.

ocramz avatar Nov 22 '16 12:11 ocramz

The generating code is actually on that page, it's just hidden in the [+] Example heading of scatterPlot.

I could put a copy of that code to under the figure at the top or I could have a note under the top figure saying "(see scatterPlot example for generating code)". I think pointing out the example heading will get people looking for other examples.

What do you think?

cchalmers avatar Nov 22 '16 22:11 cchalmers

@cchalmers Can you please regenerate https://cchalmers.github.io/plots/ ? Thanks!

ggreif avatar Nov 22 '16 23:11 ggreif

@ggreif Done :)

cchalmers avatar Nov 22 '16 23:11 cchalmers

@cchalmers Yes, you could place a link from the plot at the top of the page to its generating code. In general, inline examples for a number of common functions would make users' life muuuuch easier.

ocramz avatar Dec 17 '16 13:12 ocramz

Cool. I've already done this in HEAD. (see here). I should bring out a new minor version soon so it'll be on haddock.

cchalmers avatar Dec 18 '16 17:12 cchalmers