title: Substitutions inside links in reST / Sphinx
body: <p>I am using Sphinx to document a webservice that will be deployed in different servers. The documentation is full of URL examples for the user to click and they should just work. My problem is that the host, port and deployment root will vary and the documentation will have to be re-generated for every deployment.</p>
  
  <p>I tried defining substitutions like this:</p>
  
  <pre><code>|base_url|/path
  .. |base_url| replace:: http://localhost:8080
  </code></pre>
  
  <p>But the generated HTML is not what I want (doesn't include "/path" in the generated link):</p>
  
  <pre><code>&lt;a href="http://localhost:8080"&gt;http://localhost:8080&lt;/a&gt;/path
  </code></pre>
  
  <p>Does anybody know how to work around this?</p>