[IPython-dev] using the notebook for teaching?

Thomas Kluyver takowl at gmail.com
Thu Dec 6 11:05:46 EST 2012

On 6 December 2012 15:28, W Gong <wen.g.gong at gmail.com> wrote:

> ipynb could be made more user-friendly, if new buttons are added to the
> tool bar,
> e.g. to add an youtube link, the button prompts for url or the code, then
> auto insert a cell:
> from IPython.display import YouTubeVideo
> YouTubeVideo('MTx6ha6fRwo')

I think the challenge is that there is an enormous wealth of things you can
do in the notebook - far more than we can put into the toolbar, and it's
pretty heavy even for a hierarchical menu (see the magics menu in the Qt
console). Is embedding Youtube videos so important to so many users that it
merits a valuable toolbar button?

What's interesting is how we integrate the notebook as a way to edit and
run code, with the notebook as a rich text presentation system. Embedding a
video needn't go through a Python cell, but at present that's simpler than
putting the relevant HTML into a Markdown cell. From the other direction,
we're now talking about ways to embed variable references into Markdown
cells, and definining a syntax to do that. I get the feeling we're missing
a coherent approach here.

To spark discussion, maybe what we need is something like a 'template
cell', that's in between a client-side Markdown cell and a code cell:
- Edit syntax something like Jinja2 templates, with fields that you can
fill in, loops, if clauses, and so on. We're thinking of using Jinja2
anyway, so let's not invent our own templating language.
- When you execute it (shift-enter), it is sent to the kernel to render the
- Python objects used in fields are rendered according to our display
protocol, i.e. _repr_html_() will be preferred.
- In the interface, the rendered output replaces the editor (like a
Markdown cell) until you double-click to edit it again.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20121206/b8b11923/attachment.html>

More information about the IPython-dev mailing list