Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add link to GitHub in the Sphinx documentation #17492

Closed
asmeurer opened this issue Aug 23, 2019 · 1 comment · Fixed by #17504
Closed

Add link to GitHub in the Sphinx documentation #17492

asmeurer opened this issue Aug 23, 2019 · 1 comment · Fixed by #17504

Comments

@asmeurer
Copy link
Member

Right now the docstrings in Sphinx have a "source" link that shows the source code for a file. But the way it works is that it pulls in the source for each file in RST and shows that. It would be better if it just linked to GitHub. This would also speed up the docs build time, because it currently spends a lot of time syntax highlighting the source.

We should see if the "source" extension can be modified or replaced with something that links to the source on GitHub. Maybe there is already an extension that does this. If not, we should just write something.

For the source link, if the docs can detect a git repo it should include the commit hash in the URL (like https://github.com/sympy/sympy/blob/99c6670e65207e879342cb5b1dd11cbffd5cb5ab/sympy/functions/special/delta_functions.py). Otherwise it should just have the plain link (e.g., building the docs from the source tarball), like https://github.com/sympy/sympy/tree/master/sympy/functions/special.

CC @moorepants @certik @lglattly

skirpichev added a commit to skirpichev/diofant that referenced this issue Aug 23, 2019
Code snippet was ported from the numpy's conf.py

BTW, closes sympy/sympy#17492
skirpichev added a commit to skirpichev/diofant that referenced this issue Aug 23, 2019
Code snippet was ported from the numpy's conf.py

BTW, closes sympy/sympy#17492
@sylee957
Copy link
Member

I see the patch in diofant works with little modification.
But it may have to be improved to use the commit hash of the current work, than the simple redirection to the master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants