The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

mkpres - generate HTML slide files from talk.xml

SYNOPSIS

  mkpres [options]

  Options:

   -d     enable 'dev' mode - links will be timestamped
   -?     detailed help message

DESCRIPTION

Generates a linked set of HTML slide files from the contents of talk.xml.

OPTIONS

-d

Enables 'dev' mode. When this mode is enabled, the 'next' and 'previous' links between slides will be made unique through the addition of a numeric query-string. This is handy for working around browser caching issues while the presentation is under development.

You almost certainly don't want this option enabled when generating the final version of a presentation for publication on the web.

-?

Display this documentation.

OUTPUTS

Generates the following files in the html directory:

  • a series of slide files called slide001.html ... slideNNN.html

  • a main cover page called index.html

  • a table of contents page called toc.html

These files are generated from the _slide.html, _index.html and _toc.html template files respectively.

XML SCHEMA

This script expects to read a file called talk.xml in the current directory. That file should be in XML format with:

  • a top-level element called <presentation>

  • some metadata elements

  • a series of <slide> elements

You are encouraged to introduce extra elements that you need. You'll need to do a bit of code and template hacking to make them work.

Metadata Elements

The metadata elements primarily affect the index page however they are available to all slides and can be used in headers, footers etc, with appropriate tweaks to templates and stylesheets.

<title>

The name of the presentation.

<subtitle>

An optional subtitle for the presentation.

<author>

The name of the presenter.

<email>

Presenter's email address (optional).

<event>

Not generally used. Some themes display this in the footer. By convention it is the name of the event where the talk is presented but you can put whatever you like in it.

<date>

Like the 'event' element above, this is not generally used but will be displayed in the footer by some themes. Use it for whatever you like.

Slide Elements

Each <slide> element can have an optional id attribute. The value will be used as the id of the <body> tag in the generated HTML. This can be useful for having certain CSS styling apply only to specific slides.

Each <slide> should also have a <title>.

A <slide> can include an optional image tag. The referenced image would typically be displayed on the righthand side of the slide as decoration. The text content of this tag is used as the filename. The file must exist in the html/images directory.

Following the title and optional image, a slide can contain any number of <bullet>, <pause>, <code> and <screenshot> 'content' elements:

<bullet>

Text for a bullet point. This text can contain HTML markup, which is typically used to make hyperlinks or to emphasise words or phrases.

  <bullet>Here is <a href="http://example.com">a link</a></bullet>
<pause />

You can insert a 'pause' between bullet points or other content items. Items following the pause will not be displayed until the presenter advances the slide - typically by pressing the spacebar. Audiences generally hate this effect so you should use it sparingly (eg: to avoid prematurely revealing a punchline).

If a slide includes multiple <image> elements, only the 'last' one before the pause will be used.

<code>

The code tag is used for displaying sample snippets of source code. The line-wrapping and indentation will be preserved. The code can optionally be syntax highlighted if you have the Text::VimColor module installed. To enable syntax highlighting, include a 'syntax' attribute which specifies the language.

Entering programming code into an XML document can be tedious due to special characters like <, > and &. For this reason, you would typically use a CDATA section within the code tags:

    <code syntax="perl"><![CDATA[
      if( $dow > 0 && $dow < 6) {
          print "Wake up - it's a work day!\n";
      }
    ]]></code>
<screenshot>

The screenshot element is used for any image that should be displayed 'inline' as part of the presentation (unlike the <image> elements which are usually visual fluff).

  <screenshot>flowchart.png</screenshot>

COPYRIGHT

Copyright (c) 2004-2007 Grant McLean <grantm@cpan.org>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.