Hello William, On Thursday, 8 August 2019 18:08:12 UTC+2, William Abernathy wrote: > > I am trying to automate our documentation (rst/sphinx to html and to > xetex/PDF output) > > I want to stick a version variable into a hyperlink as follows: > > `link text, version |version|< > https://documentation.com/product/|version|/index.html>`_ > > From posts on other forums, I understand that this breaks the logic of RST > (one apparently cannot nest inline markup). > > Is there a workaround, or has this been fixed? > You can simulate that result, but not perfectly, by using the extlinks extension and defining a custom role. Setup: * in conf.py: extensions = [ 'sphinx.ext.extlinks' ] # add to your list of extensions extlinks = { 'ver': ('https://documentation.com/product/%s/index.html', 'version ') }
* in any file, use the role _ver_ inline: please check :ver:`4.0` of the product. I thinks there's no better solution/workaround to your problem now, unless the "link text" you mention is always the same (then put it in conf.py instead of 'version ') or want to create a new role for each variant of "link text". I can't figure out which version of Sphinx I have installed, and if you > could help with that, I'd be most appreciative as well. > Issue sphinx-build --version from the command line. For the record, I successfully use in my projects the same syntax used above since Sphinx 1.6. HTH, Stefano > > -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/sphinx-users/b80e6c8f-9c8b-47ab-8c6f-694df9b2cbde%40googlegroups.com.
