How to link and render a markdown file readme.md from a notebook MyNotebook.ipynb?

4,585 views
Skip to first unread message

Owen Kelly

unread,
Nov 15, 2016, 1:55:03 PM11/15/16
to Project Jupyter
Hi All,

I have a notebook file and a markdown file:
   MyNotebook.ipynb
   readme.md

The notebook has a markdown cell that includes the following raw text

  ## Instructions
  [Setup instructions](http://localhost:8888/edit/readme.md

When I process this cell, it looks good and the text "Setup instructions" is a hotlink.

When you follow the link, you come to a page where you can *edit* readme.md .
I want to go to a page where readme.md is *rendered*.

Any thoughts on how to do that?

Thanks and regards,

Owen

Logan Page

unread,
Nov 20, 2016, 8:11:40 AM11/20/16
to Project Jupyter
Not sure how you can create a link to a new page with a rendered markdown file, but you can render the markdown file in the notebook with:

from IPython.display import display, Markdown

with open('readme.md', 'r') as fh:
    content
= fh.read()

display
(Markdown(content))

MinRK

unread,
Nov 21, 2016, 6:51:48 AM11/21/16
to Project Jupyter
There isn't a handler that renders markdown (the server does no markdown rendering), so there is no URL for such a thing unless you add an extension that provides it. JupyterLab adds rendering support for markdown files in the editor, though.

-Min

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+unsubscribe@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/42d20b33-87f4-45dd-84db-37d12c137f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Owen Kelly

unread,
Dec 5, 2016, 2:58:23 PM12/5/16
to Project Jupyter
Thanks Min and Logan.

-Owen

Jürgen Hasch

unread,
Dec 6, 2016, 2:48:53 PM12/6/16
to Project Jupyter
There is the notebook server extension https://github.com/Jupyter-contrib/jupyter_nbextensions_configurator that provides a markdown renderer.
It is normally used to display readme files for notebook extensions (https://github.com/ipython-contrib/jupyter_contrib_nbextensions), but can be used for any markdown file that can be served by Jupyter, e.g.:
http://127.0.0.1:8888/nbextensions/nbextensions_configurator/rendermd/files/README.md
would show README.md from the root directory of the notebook server.

  Juergne

Reply all
Reply to author
Forward
0 new messages