A Sphinx extension for linking to your project's issue tracker. Includes roles for linking to issues, pull requests, user profiles, with built-in support for GitHub (though this works with other services).
For an example usage, check out marshmallow's changelog, which makes use of the roles in this library.
pip install sphinx-issuesAdd sphinx_issues to extensions in your conf.py. If your project is on GitHub, add the issues_github_path config variable. Otherwise, use issues_uri and issues_pr_uri.
# docs/conf.py
# ...
extensions = [
# ...
"sphinx_issues"
]
# Github repo
issues_github_path = "sloria/marshmallow"
# equivalent to
issues_uri = "https://github.com/sloria/marshmallow/issues/{issue}"
issues_pr_uri = "https://github.com/sloria/marshmallow/pull/{pr}"
issues_commit_uri = "https://github.com/sloria/marshmallow/commit/{commit}"Use the :issue: and :pr: roles in your docs like so:
See issue :issue:`42`
See issues :issue:`12,13`
See :issue:`sloria/konch#45`.
See PR :pr:`58`Use the :user: role in your docs to link to user profiles (Github by default, but can be configured via the issues_user_uri config variable).
Thanks to :user:`bitprophet` for the idea!You can also use explicit names if you want to use a different name than the github user name:
This change is due to :user:`Andreas Mueller <amueller>`.Use the :commit: role to link to commits.
Fixed in :commit:`6bb9124d5e9dbb2f7b52864c3d8af7feb1b69403`.Use the :cve: role to link to CVEs on https://cve.mitre.org.
:cve:`CVE-2018-17175` - Addresses possible vulnerability when...Credit goes to Jeff Forcier for his work on the releases extension, which is a full-featured solution for generating changelogs. I just needed a quick way to reference Github issues in my docs, so I yoinked the bits that I needed.
MIT licensed. See the bundled LICENSE file for more details.
- Add
:commit:role for linking to commits. - Add support for linking to external repos.
- Test against Python 3.7.
- Add
:cve:role for linking to CVEs on https://cve.mitre.org.
- Add
:pr:role. Thanks @jnotham for the suggestion. - Drop support for Python 3.4.
- Raise
ValueErrorif neitherissues_urinorissues_github_pathis set. Thanks @jnothman for the PR. - Drop support for Python 2.6 and 3.3.
setupreturns metadata, preventing warnings about parallel reads and writes. Thanks @jfinkels for reporting.
- Support anchor text for
:user:role. Thanks @jnothman for the suggestion and thanks @amueller for the PR.
- Add
:user:role for linking to Github user profiles.
- Initial release.