#!/usr/bin/perl

print <<EOB;
<html>
<head>
  <script src="events.js"></script>
  <link rel="stylesheet" href="presentation.css">
EOB

while (<>) {
	last if m(</rdf:RDF>);
}
print "</head>\n<body onload=\"jumpTo(0)\">\n";

$page = 0;
while (<>) {
	if (s(<slide)(<div id="page$page" class="slide")g) {
		$page++;
	}
	s(</slide>)(</div>)g;
	if (s(<section)(<section id="page$page" class="slide")g) {
		$page++;
	}
	s(<(/?)html:)(<$1)g;
	next if m(<\?);
	next if m(</presentation>);
	print;
}

print <<EOB;
</body>
<script>var slides=$page;</script>
</html>
EOB
