How to set base url for markdown links in IPython?

I happily installed

 
<head>
<base href="http://complex_url_to_local_wiki:port/path/" target="_blank" />
</head>

      

in a Markdown cell in my IPython html notebook (IPython 0.12) to be able to shorten links like [wiki documentation](doc.html)

in Markdown cells.

But this makes it impossible to save the laptop (save is restored <base href='/'/>

).

Is there an (alternative) way to achieve what I am looking for? I know how to create a URL from Python code using IPython.core.display.HTML

[1], but it is much more convenient to embed links in the Markdown documentation

Thank,

Álvaro.

[1] A suboptimal solution creating a Python link is pasted below if it is helpful to someone or you have suggestions for improvement

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 = '<a href="{baseurl}" target="_blank">{text}</a>'
    return HTML(url_t.format(baseurl=baseurl.format(x), text=text.format(x)))

      

+1
python html markdown ipython


source to share


No one has answered this question yet

See similar questions:

3
In Jekyll (i.e. Markdown), is it possible to split the base portion of given urls between links?

or similar:

2170
How can I change the url without reloading the page?
1738
How do I create an HTML button that acts like a link?
1312
How do I set a default value for the HTML <select> element?
752
How to make matplotlib laptop IP address
453
GitHub relative link in Markdown file
406
How to link to part of the same document in Markdown?
340
How to connect to a named anchor in Multimarkdown?
246
Can I create links with "target =" _blank "" in Markdown?
46
Unable to display HTML string
7
IPython / Jupyter Notebook: how to render a markdown cell without reloading the document?



All Articles
Loading...
X
Show
Funny
Dev
Pics