simonw / sqlite-utils

Python CLI utility and library for manipulating SQLite databases
https://sqlite-utils.datasette.io
Apache License 2.0
1.66k stars 111 forks source link

Link from documentation to source code #464

Closed simonw closed 2 years ago

simonw commented 2 years ago

Twitter conversation asking for ways to automate this here: https://twitter.com/simonw/status/1558260492015046656

simonw commented 2 years ago

https://github.com/beanbaginc/beanbag-docutils/blob/master/beanbag_docutils/sphinx/ext/github.py via https://twitter.com/chipx86/status/1558271211901050880 looks like a good option.

It works using this Sphinx mechanism: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html

simonw commented 2 years ago

I tried it out and ran into a bug, which I've reported and submitted a PR for:

I'm going to ship a version that uses my fork of the repo here: https://github.com/simonw/beanbag-docutils/tree/bytes-in-url

simonw commented 2 years ago

Source links are now live here: https://sqlite-utils.datasette.io/en/latest/reference.html

CleanShot 2022-08-13 at 09 49 02@2x

simonw commented 2 years ago

Extracted a TIL: https://til.simonwillison.net/python/setup-py-from-url

simonw commented 2 years ago

I may be able to do this without that extra dependency: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html