Although this is not yet possible with a real Markdown cell, you can easily create magic to get the same effect.
from __future__ import absolute_import from IPython.core.getipython import get_ipython from IPython.core.magic import (Magics, magics_class, cell_magic) @magics_class class MarkdownMagics(Magics): @cell_magic def markdown(self, line, cell): from IPython.core.display import HTML from markdown import markdown vars = line.split() d = {} for k, v in self.shell.user_ns.items(): if k in vars: d[k] = v return HTML("<p>{}</p>".format(markdown(cell.format(**d)))) get_ipython().register_magics(MarkdownMagics)
Set multiple variables
foo = 1 bar = 2
Then call the magic whose arguments are the variables you want to take from the namespace.
%%markdown foo bar Substitute _{foo}_ and *{bar}*
Eric Busboom
source share