Add example for using your own Github integration

rtd2
Eric Holscher 2012-12-06 12:00:12 -08:00
parent e70ac65ea5
commit 1c1d845280
1 changed files with 16 additions and 0 deletions

View File

@ -8,6 +8,22 @@ Github Integration
We now support linking to GitHub by default in the sidebar. It links to the page on GitHub, and directly links to the edit view as well. This should help people quickly update typos and send pull requests to contribute to project documentation.
If you want to integrate this into your own theme, the following variables are available in your custom templates:
* github_user
* github_repo
* github_version
* display_github
It can be used like this::
{% if display_github %}
<li><a href="https://github.com/{{ github_user }}/{{ github_repo }}/blob/{{ github_version }}{{ conf_py_path }}{{ pagename }}.rst">
Show on GitHub</a></li>
<li><a href="https://github.com/{{ github_user }}/{{ github_repo }}/edit/{{ github_version }}{{ conf_py_path }}{{ pagename }}.rst">
Edit on GitHub</a></li>
{% endif %}
Screenshot
~~~~~~~~~~