On a readthedocs / Sphinx project, I need to display current_version
in rst file and to generate link with the current_version
.
Screenshot:
I've seen it in templates (versions.html):
v: {{ current_version }}
Is it possible to access {{ current_version }} in rst ? I've tried
|current_version|
But the result is
WARNING: Undefined substitution referenced: "current_version".
Precisions :
it work with |version|
which is declared in conf.py
. but I don't know how to display current_version
.
Edit 2 :
My point was not clear sorry. In a readthedocs project, I've got several branch of documentation. In my rst files, I need to know the branch to build special links http://xxx.xx/**branch**/ because I've to store data in another repository. In the conf.py
, there is the version field but, I want to get the branch automatically.
And I saw that in the RTD template, in file version.html
, there is {{ current_version }}
which is displayed in the screenshot.