[New-bugs-announce] [issue43212] Link to class and function source code on GitHub

Борис Верховский report at bugs.python.org
Fri Feb 12 18:09:53 EST 2021


New submission from Борис Верховский <boris.verk at gmail.com>:

We can use shpinx.ext.linkcode to link classes and functions/methods to their source code on GitHub from the documentation. See linked PR for screen shots. This is far from linking all the symbols in the docs, but it's gets quite a few. It would be hard to get to 100% because of C modules that get re-exported in Python files.

It slighty increase the time it takes to generate the documentation with `make html`. I get 1m33s with these changes vs 1m28s without them.

One thing is that when you merge a PR on GitHub, any files it touches will have the wrong line numbers while the documentation is being re-built and deployed. That's mostly neglible since most files haven't been edited in the last couple of minutes, but if it's an issue it may be possible to set up the CI to build the documentation then deploy the docs and merge the PR at the same time.

----------
assignee: docs at python
components: Documentation
messages: 386889
nosy: boris, docs at python
priority: normal
pull_requests: 23306
severity: normal
status: open
title: Link to class and function source code on GitHub
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue43212>
_______________________________________


More information about the New-bugs-announce mailing list