Per Greg's suggestion, this is a command-line tool allowing one to quickly view, dump or replace time codes of a Slide Deck presentation. (This functionality will eventually be in the butter plugin, but that doesn't exist yet.) It uses Python with lxml. It alters whitespace, encodes non-ASCII entities and uses HTML-style self-closing tags, but doesn't otherwise mangle the original document.
$ ./times.py show index.html
[ 0] t= 1 Software Carpentry in 90 Seconds
[ 1] t= 4 Mission Help scientists be more producti
[ 2] t= 9 Problem Scientists spend 40% or mor
[ 3] t= 14 But 95% or more are primarily self-ta
[ 4] t= 17 So they spend hours doing things that shoul
[ 5] t= 20 ...reinvent a lot of wheels... .
[ 6] t= 22 ...and still don't know if their results ar
[ 7] t= 24 Solution Short intensive workshops
...
For now this considers a "slide" to be any element with a popcorn-slideshow attribute instead of looking for the slide class, because I couldn't find a reliable way to precisely query classes with XPath 1.0 (used by lxml). If we're generating new presentations we'll need to specify a placeholder value or modify this.
I'm not sure where this file should go. Right now, everything in here seems to client/browser code. Maybe we need a /bin/ for tools?
Per Greg's suggestion, this is a command-line tool allowing one to quickly view, dump or replace time codes of a Slide Deck presentation. (This functionality will eventually be in the butter plugin, but that doesn't exist yet.) It uses Python with lxml. It alters whitespace, encodes non-ASCII entities and uses HTML-style self-closing tags, but doesn't otherwise mangle the original document.
For now this considers a "slide" to be any element with a
popcorn-slideshow
attribute instead of looking for theslide
class, because I couldn't find a reliable way to precisely query classes with XPath 1.0 (used by lxml). If we're generating new presentations we'll need to specify a placeholder value or modify this.I'm not sure where this file should go. Right now, everything in here seems to client/browser code. Maybe we need a
/bin/
for tools?