reasonml.org icon indicating copy to clipboard operation
reasonml.org copied to clipboard

Add links to source code for functions

Open johnridesabike opened this issue 5 years ago • 4 comments

I think it would be useful to have links to the source code with the function definitions. For BuckleScript, it may be also be good to link to the compiled JS source in addition to the OCaml/Reason source.

johnridesabike avatar Mar 31 '20 15:03 johnridesabike

That's a task for the odoc-json tool... definitely worth considering, but not sure how much effort it would be (so might end up lower on the prio list)

\cc @rizo

ryyppy avatar Mar 31 '20 17:03 ryyppy

Upstream odoc issue: https://github.com/ocaml/odoc/issues/128

This would be a fantastic addition. PureScript's docs have this, and I can't count how many times it's been incredibly valuable to take a quick look at the source to see how an implementation works.

mlms13 avatar Mar 31 '20 18:03 mlms13

I will look into the odoc side of things to evaluate how hard it would be to implement this in an automatic way. I agree that, if doable, it would be great to have this information included in the JSON output.

An approach that could work as a workaround is adding a custom doc attribute to link to the implementation (something like @src path/to/Module.re#L30).

rizo avatar Mar 31 '20 19:03 rizo