[IPython-user] Color transcript to HTML?

Alexander Schmolck a.schmolck at gmx.net
Fri Aug 20 07:26:37 CDT 2004

"Tom Locke" <tom at livelogix.com> writes:

> Hi folks.
> Anyone know of a way to get a transcript of an IPython session, with color,
> into nicely marked up HTML?


If you have emacs, you can simply 

1. download http://fly.srk.fer.hr/~hniksic/emacs/htmlize.el and install it,
   i.e. save it somewhere and put the following into your .emacs (presumably
   _emacs on windoze)
    (add-to-list 'load-path "WHATEVER\\DIR\\YOU\\PUT\\IT")
    (require 'htmlize)

2. run ipython from within emacs (either using the emacs support files you'll
   find on the ipython website, or by just typing M-x shell (M-x means hold
   Alt and x) and running ipython in the shell).

3. M-x htmlize-buffer, then save the result under whatever filename you want 
If you don't have emacs, installing it and following the above is presumably
still less hassle than coding up something yourself and this scheme is quite
flexible -- you can also convert any subset of the output to html at any time
you want (M-x htmlize-region)



p.s. could you please not send html emails to lists?

More information about the IPython-user mailing list