How do I put the project's version number in a hyperlink in the documentation?

Bert IJff avatarBert IJff created an issue

Hi, I'm new here, so I apologise if this question is in the wrong place. I couldn't find an answer in the FAQ nor in the docs.

What's it about? I'm using sphinx and reST for my documentation. In my project's documentation I want to refer to 3 downloadable files by using hyperlinks. I found that I can specify the project's version number in the conf.py file, e.g.: version = '1.3.2'

Then I use |version| as a placeholder for the version number in the documentation e.g. Download http://www.domain.eu/download/part1-|version|.tar.gz and

$ sudo easy_install http://www.domain.eu/download/part2-|version|.tar.gz

http://www.domain.eu/download/part3-|version|.tar.gz.

Now the |version| part is replaced by the 1.3.2 but the hyperlink's href only contains the part on the left side of |version|.

How can I make the "|version|.tar.gz" part be included in the hyperlink's href?

Thanks for your help. Bert

P.S. I asked this with the Docutils-users and I was redirected to the sphinx group

Comments (6)

  1. Takayuki Shimizukawa

    I think there is no way to do that by current docutils features. However, if you create a new directive/role to do that, you will get the feature. refs: http://sphinx-doc.org/extdev/index.html

    > P.S. I asked this with the Docutils-users and I was redirected to the sphinx group
    

    :(

    I think docutils developers can create new directive/role that behave as you demanded without sphinx...

  2. Bert IJff

    Thank you for the pointer. It looks like a lot (?) of programming to get a new feature. I needed this particular feature for a piece of documentation that was (incompletely) ported from TeX to ReST. For me it was good enough to create a perl one-liner to change the TeX color info to HTML and I got what I wanted.

    Nonetheless I will keep your remark in mind.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.