| 1 |
=================================================================================== |
| 2 |
:mod:`cloud_sptheme.ext.issue_tracker` - support for `issue` text role |
| 3 |
=================================================================================== |
| 4 |
|
| 5 |
.. module:: cloud_sptheme.ext.issue_tracker |
| 6 |
:synopsis: quickly create links to project's issue tracker with ``:issue:`` role |
| 7 |
|
| 8 |
Overview |
| 9 |
======== |
| 10 |
This Sphinx extension adds a new text role, ``:issue:``, which will automatically |
| 11 |
be converted into links to your project's issue tracker. |
| 12 |
|
| 13 |
Issue roles should have the format ``:issue:`5``` or ``:issue:`Custom Title <5>```. |
| 14 |
They will be converted into external references to the appropriate issue number |
| 15 |
in your project's issue tracker. |
| 16 |
|
| 17 |
Configuration |
| 18 |
============= |
| 19 |
This extension reads the following ``conf.py`` options: |
| 20 |
|
| 21 |
``issue_tracker_url`` |
| 22 |
|
| 23 |
This should provide a path to the project's issue tracker. |
| 24 |
It should have one of the following formats: |
| 25 |
|
| 26 |
* :samp:`bb:{user}/{project}` -- link to BitBucket issue tracker for specified project |
| 27 |
* :samp:`gh:{user}/{project}` -- link to GitHub issue tracker for specified project |
| 28 |
* string containing arbitrary url, the substring ``{issue}`` will be replaced with the relevant issue number, |
| 29 |
and ``{title}`` with the link title. |
| 30 |
|
| 31 |
If this option is not specified, all issue references will be converted |
| 32 |
into labels instead of links. |
| 33 |
|
| 34 |
``issue_tracker_title`` |
| 35 |
|
| 36 |
Template for generating default title for references that only |
| 37 |
specify the issue number (e.g. ``:issue:`5```). This defaults |
| 38 |
to ``Issue {issue}``. |
| 39 |
|
| 40 |
``conf.py`` Usage Example:: |
| 41 |
|
| 42 |
# add to list of extensions: |
| 43 |
extensions = [ |
| 44 |
... |
| 45 |
'cloud_sptheme.ext.issue_tracker', |
| 46 |
] |
| 47 |
|
| 48 |
... |
| 49 |
|
| 50 |
# set path to issue tracker: |
| 51 |
issue_tracker_url = "https://example.org/tracker/{issue}" |
| 52 |
|
| 53 |
Internals |
| 54 |
========= |
| 55 |
.. note:: |
| 56 |
|
| 57 |
For themeing purposes, the generated ``<a>`` tag |
| 58 |
will have an ``issue`` CSS class added to it. |
| 59 |
|
| 60 |
.. versionchanged:: 1.8.4 |
| 61 |
|
| 62 |
Removed "Google Code" preset url format. |
| 63 |
|