Exporting Squeak Presentations to HTML+PNG
May 10th, 2006 tonyg
I’ve been using Squeak’s BookMorph to assemble presentation materials recently, but there’s been no way to export the presentation for the benefit of those without a Smalltalk image - until now. I just implemented a trivial little method on BookMorph that exports all its pages to PNG files, and writes a small HTML index file.
Here’s one I prepared earlier:
http://www.lshift.net/~tonyg/cake-presentation/PresentationBook.html
(the presentation itself isn’t done, and won’t mean much outside LShift at the moment, but it’s enough to demo the idea.)
Here’s the method I wrote:
exportPagesAsPng
| fileName indexPageStream |
'Exporting ', pages size printString, ' pages to PNG'
displayProgressAt: Sensor cursorPoint
from: 1 to: pages size
during: [:progressSetter |
pages doWithIndex: [:page :i |
progressSetter value: i.
fileName := self externalName, '_',
(i printStringLength: 3 padded: true), '.png'.
PNGReadWriter putForm: page imageForm onFileNamed: fileName.]].
indexPageStream _ FileStream newFileNamed: self externalName, '.html'.
indexPageStream nextPutAll: '<html>...</html>'.
"html and javascript elided - have a look at the example."
indexPageStream close.
Entry Filed under: Technology
1 Comment Add your own
1. matthew | May 10th, 2006 at 8:02 pm
What’s wrong with LaTeX and Beamer then? ;-)
Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Trackback this post | Subscribe to the comments via RSS Feed