Keynote, Apple's new presentation software for MacOS X is an interesting piece of software. On one hand, it's a very very light layer over Quartz and should have been a doddle to knock up. On the other hand, a lot of people will be comparing it to Powerpoint, so it has to have lots of knobs to turn.
Overall, I'm quite impressed with it. It makes it very easy to build simple presentations, and comes with better themes than Powerpoint does (although I bet you they'll start getting annoying as people overuse them). The alignment guide thing is neat. It is, however, a little slow on my iBook. It takes about a fifth of a second to flick from slide to slide, which only involves blitting 100 or so characters to the screen. That's slow. And it gets very slow when dealing with hundreds of slides... but I'm getting ahead of myself.
Take these two facts: Keynote's presentation format is XML, and I'm doing a tech talk next week entitled "Core Perl Modules You Might Not Know About". Clearly, the only sane thing to do would be to autogenerate slides for each core module, with each slide having the module name as title, the module description, and the synopsis. So I hack up some code with File::Find::Rule and Pod::POM, build a small presentation which displays a module how I want, dig into the XML code produced, and glue it all together with Template Toolkit. The TT stuff in question is fairly simple, and I know you all love angle brackets, so here we go:
[% # 4909 lines of boring theme-describing XML above here %] [% count = 3 %] [% FOREACH module = modules %][% END %] [% # 16 lines of boring UI-describing XML below here %] [% count = count + 1 %] [% module.name %] [% module.name %] \342\200\234[% module.description %]\342\200\235 Tip \342\200\242
Icky XML. Some of that is definitely silly (the thumbnail image probably shouldn't be in the presentation XML, for one thing), and the fact that they use SVG-like-but-not-quite-SVG. But to be honest, I can ignore all that, all I want to do is autogenerate my presentation. Which I do. And it all works, especially when I remember to use > etc. ;-) All in all, a cute little hack, and quite fun. I'll post the presentation after I've given it.
Now can I be bothered to do an AxPoint -> Keynote converter...
Re:Module!
acme on 2003-01-17T16:08:53
Unfortunately there's a lot more to a presentation than just the bullet points. How are you going to add your company logo in the background or a rotating transparent butterfly?;-) More seriously, there's so much XML in there I don't know where to start. Or if I should do it at all...
Re:Module!
pudge on 2003-01-17T16:18:15
Wuss!
My vision is to create a "template" that sets up the basic look of a slide (or slides), and then use Perl to generate all the individual slides. Right now I use a custom program called makeslides to take a text (YAML-ish) outline and creates pretty HTML with CSS etc. It'd be sweet if I could make it generate Keynote presentations too.
But I'll probably just end up doing as you've apparently done, create a few slides, then pull out the XML I want, and use that as a template.
Re:Module!
darobin on 2003-01-21T16:30:14
I'd guess that if you're using HTML+CSS, the HTML must be very semantically structured and it'd be trivial to output XML instead. Starting from that, a YourML-to-KeynoteML XSLT should be trivial.
[% thingy | html %]
Will automatically do the > for you, but you knew that.
Cool hack. Shouldn't you be doing this with SAX though? Just place <acmepresentation:tagname/> in the right place and using a nice filter...Re:html filters, SAX
acme on 2003-01-17T16:12:08
Oh, thanks. I'd forgotten about that. I could be using SAX, except SAX is horribly complicated when you're passing things around[1]. Template Toolkit is a tool I know well and I bet you dealing with XML in text blocks is faster than dealing with 500,000 XML events too.[1] Stop complaining that I complain about SAX too. It may be simple, but isn't practical.
Re:html filters, SAX
2shortplanks on 2003-01-17T16:41:41
Okay, then you could extract out the text with a XPath statement (using Template::Plugin::XML::LibXML, natch) then rerender it through a VIEW. At least this way you won't be screwed when apple decide to put a [% in their template;-). Hmm, you could do a presentation on that itself. "How I created this presentation: A fully recursive talk".
Re:html filters, SAX
darobin on 2003-01-21T16:27:33
TBH I'm not sure that SAX would be a good idea to do that. SAX is meant to be low-level, and works marvels at that. It's as close as you can get to XML without going lexical. Anyone using it for higher-level things will find it impractical, and rightly so.
Other XML-orientated options that would be fit here could be XSLT (which acme also hates) or a number of modules from Barrie Slaymaker that deal with SAX at higher levels (eg XML::Essex or XML::Filter::Dispatcher).