"""Module for interactive demos using IPython.

This module implements a few classes for running Python scripts interactively
in IPython for demonstrations.  With very simple markup (a few tags in
comments), you can control points where the script stops executing and returns
control to IPython.


Provided classes
================

The classes are (see their docstrings for further details):

 - Demo: pure python demos

 - IPythonDemo: demos with input to be processed by IPython as if it had been
 typed interactively (so magics work, as well as any other special syntax you
 may have added via input prefilters).

 - LineDemo: single-line version of the Demo class.  These demos are executed
 one line at a time, and require no markup.

 - IPythonLineDemo: IPython version of the LineDemo class (the demo is
 executed a line at a time, but processed via IPython).

 - ClearMixin: mixin to make Demo classes with less visual clutter.  It
   declares an empty marquee and a pre_cmd that clears the screen before each
   block (see Subclassing below).

 - ClearDemo, ClearIPDemo: mixin-enabled versions of the Demo and IPythonDemo
   classes.


Subclassing
===========

The classes here all include a few methods meant to make customization by
subclassing more convenient.  Their docstrings below have some more details:

  - marquee(): generates a marquee to provide visible on-screen markers at each
    block start and end.

  - pre_cmd(): run right before the execution of each block.