patrick-kidger / equinox

Elegant easy-to-use neural networks + scientific computing in JAX. https://docs.kidger.site/equinox/
Apache License 2.0
2.1k stars 141 forks source link

Add a [source] to docs [feature request] #683

Open lockwo opened 7 months ago

lockwo commented 7 months ago

For users that are interested/regularly investigate the source code, having a method to go from docs to associated source code is very helpful (this is what I am talking about: https://jax.readthedocs.io/en/latest/_autosummary/jax.nn.log_sigmoid.html there is a [source] link that when clicked takes you to the actual source code). I find myself going to google, which takes me to the docs of a method, then having to go through the repo to find it so I was wondering if this an interesting/possible feature for the docs?

patrick-kidger commented 7 months ago

This seems reasonable to me! I'd be happy to take a PR on this.

The only thing I'd say is that I'd like to point directly to the code on GitHub -- not to copy the source code into the documentation as some projects do.

f0uriest commented 7 months ago

I've used https://github.com/tdkorn/sphinx-github-style in a few other projects and find it works fairly well.

patrick-kidger commented 7 months ago

We do use MkDocs, not Sphinx, though.

It means I can write Markdown rather than the unreadable mess that is reStructuredText.. !