Documentation pages on ReadTheDocs have a nice sidebar with extra "Show on GitHub" and "Edit on GitHub" links. Here's how you can have those for your own Sphinx documentation:
- Create _ext and _templates subdirectories.
- Create a file _ext/edit_on_github.py that hooks into html-page-context to add a couple of template variables.
- Create a file _templates/sourcelink.html that uses those two variables to insert "Show on GitHub" and "Edit on GitHub" links in the sidebar.
- Edit conf.py and add os.path.abspath('_ext') to sys.path.
- Add edit_on_github to the list of extensions.
- Use edit_on_github_project to specify your GitHub username and repository (separated by a slash).
- Optionally use edit_on_github_branch to specify the desired branch (it defaults to 'master').
- Make sure _templates is in the templates path.
- make html and enjoy