htol2ss

Introduction

htol2ss (HTml OutLine to Slide-Show) is a Perl script for converting presentation (lecture/seminar etc) outlines written as nested HTML lists, into a form appropriate for direct presentation using a (Netscape) browser.

I wrote this script as part of an ongoing process to find an effective, simple means for authoring presentations so that I maintained one master copy, but could produce derivatives optimised for different views (eg. printed notes, web notes, in class presentation), whilst minimising the workload needed to do this.

Previously I've mastered overheads using MS Word, and printed them 4 up for handouts, and used a customised rtftohtml to create web notes; and have mastered online presentations using MS Powerpoint, and printed them 6 up for handouts, and used a highly customised rtftohtml to create web notes from the outline saved as RTF. Whilst both approaches worked, I've not been totally happy with them. Hence this script.

This time I'm focusing on mastering the notes, concentrating on the content & structure rather than on the look. These notes can be written using any HTML or text editor. Each slide corresponds to a single point in the first level list. Under it can be further list levels, pre-formatted text, inline images, tables or whatever is desired. This file is then converted into a 2nd HTML file using the htol2ss script. It makes each first level list item into a slide header, with back and forward navigation arrows and a ruler over a suitable background image.

The over-riding principle was KISS - the notes master uses very basic HTML, which should be supported anywhere, with no attempt to control the final look on all platforms. The slide-show code produced, whilst it does use Netscape HTML extensions, can be displayed on just about any version of Netscape.

For example, given a preesentation such as the skeletal oline.html, the slide-show file can be created by the command: htol2ss oline.html which creates the file ss-oline.html.

htol2ss has a large number of command-line options which can be used to customise the look of the slide-show. These are summarised in the usage message displayed when you call htol2ss -h and detailed below. However as an example, another slide-show could be created from the same oline.html master, with a crimson background, yellow headers, green text, no ruler and the prefix "x" (ie output file is xoline.html) using:

htol2ss -b '#993333' -c '#ffff00' -p 'x' -R -t '#00ff00' oline.html

As a slightly larger example, have a look at the original htpres.html talk (excepted from the CS ADFA seminar on 26 Nov 98), and its slide-show form ss-htpres.html.

Using htol2ss

htol2ss processes one or more HTML files named on its command-line, and creates the slide-show form of each in a file with "ss-" prefixed onto the original name, provided the original file is newer than the slide-show (if it exists).

By default, it is assumed that a subdirectory img/ exists which holds the four inline images used by the script, being:

img/back.gif
the back arrow used to navigate to the previous slide
img/fwd.gif
the forward arrow used to navigate to the next slide
img/bg.jpg
the background image used for the slides
img/hr.gif
the ruler image used below the title for each slide
The background, ruler, and image directory names can be over-ridden using the command-line arguments.

Each slide has a named anchor of the form "sXX" where XX is the slide number. An initial arrow is placed just after the body tag to navigate to the first slide. You may find it useful to create an index of presentations, with the anchors naming "ss-XXX.html#s1" to jump straight to the first slide (eg. by hacking the output of htls -ht ss-* for example).

In more detail, htol2ss can be called with the following command-line arguments:

htol2ss [-b val] [-c val] [-f] [-h] [-i dir] [-p pref] [-q]
        [-r fil|-R] [-s siz] [-t val] file1.html [file2.html ...]
described in more detail below (and with the assumed defaults in brackets):
-b file
name of background image file for BODY tag (bg.jpg)
-b #rrggbb
OR the background color specified in BODY tag
-c #rrggbb
text color used for H2 slide headings (default)
-f
force update even if original is older
-h
prints this usage message
-i dir
name of directory the images are in (img/)
-p prefix
prefix added to form output slide-show file names (ss-)
-q
quiet mode, no status messages
-r file
name of ruler image used below slide headings (hr.gif)
-R
DONT use ruler image
-s fontsize
base font size (1..7) to use for slide-show text (6)
-t #rrggbb
text color specified in BODY tag (default)
file1.html [file2.html ...]
list of files to convert

nb. colors are specified as 3 hex values for RGB (eg bright red is #ff0000) as per the usual HTML conventions.

Assumed Structure of Input File

The input file is assumed to be a nested OL or UL list, and must have the body tags. ie. it should look like the skeletal oline.html, vis:
<html><head>
<title>Presentation Outline</title>
</head><body>
<h1>Presentation Outline</h1>
<ol>
<li> Slide 1
<ul>
<li> point 1
<li> point 2
<li> point 3 etc
</ul>

<li> Slide 2
<ul>
<li> point 1
<li> point 2
<li> point 3 etc
<pre>
some preformatted text etc
</pre>

</ul>
....
</ol>
<hr>
</body></html> 
This type of file can be easily created and changed using any HTML or text editor (even vi with a bunch of macros for common HTML tags like I use :-)

Installation

To install htol2ss you just need to copy the script (follow any hotlink to it in this file or go to http://lpb.canb.auug.org.au/adfa/src/htol2ss/) to either your working directory, or to a directory in your search path, and have Perl installed. DOS/Mac uses will also need the getopts.pl standard perl library module if the standard library has not been installed.

DOS uses will probably also need to invoke the script explicitly using perl, vis: perl htol2ss ...

You'll also need to get appropriate images for the arrows, ruler and background. You can steal the ones I use from the img/ directory here. If you find any nicer ones, I'd love to know about them.

Under the Hood

The perl script is a single file (with one dependency on getopts.pl), written in common perl4/5 (and runs happily using either version). After processing the command-line arguments it then loops over each input file in turn. For each, it checks to see if the slide-show needs to be updated, slurps in the entire file, spilts it up at the start of each HTML tag, and then loops to examine each tag in turn to see if any additions or rewrites are required before writing that piece of text to the slide-show file. I think it demonstrates how elegantly perl can handle this type of problem.

Wrapup

I'll be trialing the use of this approach with one of my courses in 1999. I would welcome any further comments or feedback others may have on this script and its uses.
Lawrie Brown / 9 Feb 99