title: How to set a base url for markdown links in IPython?
body: <p>I was happily setting </p>
  
   
  
  <pre><code>&lt;head&gt;
  &lt;base href="http://complex_url_to_local_wiki:port/path/" target="_blank" /&gt;
  &lt;/head&gt;
  </code></pre>
  
  <p>in a Markdown cell in my IPython html notebook (IPython 0.12) in order to be able to abbreviate links as<code>[wiki documentation](doc.html)</code> in Markdown cells.</p>
  
  <p>But this makes saving the notebook impossible (saving is restored by <code>&lt;base href='/'/&gt;</code>).</p>
  
  <p>Is there any (alternative) way to achieve what I am seeking? I know how to produce the URL from Python code by use of <code>IPython.core.display.HTML</code>[1], but it is considerably more convenient to inline the links in the Markdown documentation</p>
  
  <p>Thanks,</p>
  
  <p>Álvaro.</p>
  
  <p>[1] The non-optimal solution producing the link from Python is pasted below in case it is useful for somebody or you have suggestions for improvement</p>
  
  <pre class="lang-python prettyprint-override"><code>def wurl(x, text="Node {} in wiki",
              baseurl="http://complex_url_to_local_wiki:port/path/{}"):
      """Render a link on a base URL as html."""
  
      from IPython.core.display import HTML
      url_t = '&lt;a href="{baseurl}" target="_blank"&gt;{text}&lt;/a&gt;'
      return HTML(url_t.format(baseurl=baseurl.format(x), text=text.format(x)))
  </code></pre>