[IPython-dev] first experiment creating Software Carpentry teaching materials using the IPython Notebook

Damián Avila damianavila@gmail....
Sun Mar 24 08:03:17 CDT 2013

Trying to add a little, some thoughts...

El 23/03/13 15:36, Greg Wilson escribió:
> * Part-way through building the notebook, I decided I wanted to
>     reorder a couple of things, but just moving the cells around didn't
>     have the desired effect, because the things in question had side
>     effects [5].  Is there a way to say, "Re-set the In[*] counter to 1
>     and re-run all cells in the current order"?  (I know I can restart
>     the kernel and run all, but I don't feel I should have to quit the
>     editor to renumber things.)  The closest I could get without a
>     restart was to select the first cell and re-run it and all
>     subsequent cells manually; that put everything in the right order,
>     but of course now the numbering starts with '20' instead of '1'.
Maybe you can run a command line script to re-run all the cells 
notebook, so the numbering will be ok...

Here you have a little script to run the notebook and save the new 
resulting ipynb: https://gist.github.com/damianavila/5208296
(it is working with the current dev version, to use it with previous you 
have to tweak it a little, any help, let me know...)

> * Cell 37 contains:
>        import sys
>        filename = sys.argv[1]
>        source = open(filename, 'r')
>        atoms = set()
>        for line in source:
>            name = line.strip()
>            atoms.add(name)
>        print atoms
>     I want this pretty-printed as Python, but do _not_ want the notebook
>     to try to execute it, because I'm not launching it from the command
>     line.  Can I do that?  And similarly, if I want to format cells to
>     look like shell commands and their output (and then populate them
>     with copy-and-paste), can I do that?  I realize it's contrary to the
>     "lab notebook" philosophy, but pedagogically it's very useful. (And
>     yes, I _can_ use plain old Markdown cells, but I'd like the colorizing
>     to be done automatically and consistently.)
In reveal&IPython-powered slideshows you have this: 

As you can see, it seems a shell command, the coloring is providing by 
highlight.js shipped with reveal, maybe if you want something similar in 
the live notebook, you can use this library...

> * Related to all of the above: I want some way to mark specific cells
>     with classes.  For example, I want the 'Understand' and 'Summary'
>     cells to be distinct from regular paragraphs, and the cell starting
>     with the title 'Negation' to be marked as a callout box, so that I
>     can give it a border (and maybe a faint gray background) via CSS.
>     More importantly, I want to be able to mark notebook content as
>     being:
>     1. slide
>     2. presenter's notes
>     3. pedagogical metadata
>     The first is what the instructor would show learners while teaching.
>     The second is the narrative about that (e.g., the paragraphs of text
>     in the sample notebook in [2]), while the third is things like the
>     learning objectives (the section marked "Understand" at the start),
>     which might never be presented to learners, but helps instructors
>     make sense of it all.  (I _could_ keep these all in separate files,
>     but experience shows they're much more likely to stay in step if
>     they're side-by-side.)  Once they're marked with classes somehow, it
>     should be almost trivial to implement show/hide buttons so that
>     authors can toggle between "here's what I want learners to see at
>     this point" and "here's what I want instructors to know about the
>     same material".

Matthias has pointed out the "live" version of the slideshow... and it 
is great because we have availability for live coding there...
As alternative you have the reveal&IPython-powered slideshow inside 
nbconvert... you can generate slideshow like this one: 
You have support for horizontal slides (where you can put the main 
concepts) and vertical sub-slides (where you can put pedagogical data).
And, if you press "s" you will see support for presenter notes... I 
think it fit very well the structure you have pointed out in the las 
This slideshow is not live (not live coding, yet...) which is a 
constrain, but its static html nature made perfect to distribute and 
post it online...



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-dev/attachments/20130324/ab252245/attachment.html 

More information about the IPython-dev mailing list