Links in package.elm-lang.org to the source code of every function

As described in this old pull request, the info would not really be added to the site, but to the package documentation, which is then used by the package web site to render the package specific page.

Here are a few pointers:

If you want to explore this feature, you could try to add line numbers to the compiled package documentation in the compiler, patch the documentation decoding library to get them, then to test more easily, you could use for example a custom version of elm-doc-preview (which includes a forked version of the package.elm-lang.org frontend) to add links to source code per function/declaration (on GitHub). Finally, once this works, you could port the patch to package.elm-lang.org frontend.

So at the end, you would need at least 3 patches:

Good luck, you will most likely be on your own, as there is not much documentation except for the project-metadata-utils package. There is also no guaranty that it would be merged.

2 Likes