Sphinx extension to substitute version in references.
Project description
This extension adds a single role to Sphinx. With :version-ref:`<ref>` one can substitute the version given in conf.py into <ref>.
Usage
In your conf.py file:
release = '1.4.1a5' version = '.'.join(release.split('.')[:2]) extensions = ['sphinx_version_ref']
Where version can of course be any string. The following uses of <ref> then will be parsed as:
Entered as <ref> |
Parsed as |
---|---|
https://docs.com/{version}/index.html |
`https://docs.com/1.4/index.html`_ |
{version} <http://github.com/user/project/tree/{version}> |
`1.4 <http://github.com/user/project/tree/1.4>`_ |
See version {version} <http://github.com/user/project/tree/{release}> |
`See version 1.4 <http://github.com/user/project/tree/1.4.1a5>`_ |
See the docs for more information.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for sphinx_version_ref-0.1.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5748efe10b4b4dce2279341ec2f5b06d9c3119e08d3b13635252b1ba81d0c39b |
|
MD5 | 633b03e7b82d7b5215fb7127e2fd4ee9 |
|
BLAKE2b-256 | 9df86b0ec805e2930339d82cf6c1ff91134c035ec5c265077b48f513db03480a |