rescript-association / reasonml.org

Deprecated in favor of rescript-lang.org
MIT License
125 stars 34 forks source link

Add links to source code for functions #154

Open johnridesabike opened 4 years ago

johnridesabike commented 4 years ago

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.

ryyppy commented 4 years ago

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

mlms13 commented 4 years ago

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.

rizo commented 4 years ago

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).