SLIDES - an SGML slide mode


preliminary

Mark Eichin The Herd Of Kittens

Abstract

Overhead transparencies, of the sort widely used before PowerPoint took over the world, are an interesting example of structured text. SLIDES, which began as an exercise in SGML, has developed into a useful presentation tool.

This document needs to be split into code documentation vs. user documentation.

Input

Currently, input is handled by using the Emacs psgml-mode along with slides.dtd to enter the slides and their data. However, any SGML-aware editor will serve the purpose.

The SLIDES DTD has a relatively small set of elements. From the top down, we have

slideshow

which is the entire set of slides which make up a single presentation

title, author, date

which describe the presentation; at the moment, date is ignored because it interferes with reuse of presentations, but records the first time the slides were presented

slide

which represents a single individual transparency page; slides are ordered

header

which is the title for this particular slide

bullet

which is a single "bullet item", a line of text

url

which indicates an item which is actually a URL

raw

which indicates that the item is a line of a code sample or other literal text; it is intended to be set a little smaller because there are likely to be a batch of them together

eps

which indicates a pathname to an inclusion; the tag name refers to Adobe's Encapsulated PostScript format, which is used by default

At the bottom level, content is simple parsed character data. Three entities are defined, lt, gt, and amp to trivially allow enough quoting to self-represent the notation.

An example of some a simple slide presentation that shows off many features:

<!doctype slideshow SYSTEM "slides.dtd">
<slideshow>
  <title>Programming the 3com/USR PalmPilot</title>
  <author>Mark Eichin, SIPB</author>
  <date>IAP 1998</date>
  <slide>
    <header>Programming Model</header>
    <bullet>CPU: Dragonball 68328 (cpu32)</bullet>
    <bullet>32 bit, little endian</bullet>
    <raw>#pragma pack(2)</raw>
    <bullet>RAM 128k..1M, 1M/2M ROM</bullet>
  </slide>
  <slide>
    <header>Mary Chung's Menu app</header>
    <eps>pilot-m2.ps</eps>
  </slide>
</slideshow>
The first line is the standard doctype declaration; some day I'll assign a public id but a system id works for now. The title, author, and date tags are straightforward. They are followed by two slide elements, with headers describing them. The first slide is mostly simple bullet items, with one raw for a particular literal bit of code. The second slide only contains an eps inclusion of an externally generated picture.

The remaining features can be demonstrated in one more slide:

  <slide><header>What it looks like</header>
    <raw>&lt;tag&gt;  &lt;/tag&gt;</raw>
    <raw>&lt;tag attr=value&gt;</raw>
    <raw>&amp;lt; &amp;amp; &amp;gt;</raw>
    <url>http://www.sil.org/sgml/sgml.html</url>
  </slide>
Here we have a slide from a different presentation, showing the use of the predefined entities to protect the tag syntax. We also use a url tag to reference an external site.

That should be enough to create slides; running the output generation scripts should produce output for any input that validates correctly. Slide style is another issue, however; this system doesn't even detect, much less prevent, overfull slides at this time.

Output

Output is produced in two forms, PostScript and HTML. The former uses a perl script, the latter uses the jade DSSSL in translation mode.

PostScript output engine

slides.pl is a perl5 script that uses the SGMLS package.

Text Handling

The script uses the sdata and cdata recognizers to coalesce text that is content into the variable <PARAMETER>$lastcdata</PARAMETER>. This is reset but the &inittag function, which is run from all of the start tag recognizers.

Document-wide state

TITLE, AUTHOR, and DATE simply store their content (as "finished" by the recognizer for the respective end tags) in <PARAMETER>$savetitle</PARAMETER>, <PARAMETER>$saveauthor</PARAMETER>, and <PARAMETER>$savedate</PARAMETER> respectively. These are then output later as needed (in the SLIDE start tag recognizer.)

Future extensions would include

HTML output engine

slides.dsl is a DSSSL program that matches the elements of the SLIDES DTD and performs actions that generate corresponding HTML constructions.

Helper functions

<FUNCSYNOPSIS><FUNCPROTOTYPE><FUNCDEF>insert-comment</FUNCDEF><PARAMDEF>text</PARAMDEF></FUNCPROTOTYPE><FUNCSYNOPSISINFO>returns a sequence which is a formatting instruction that forms an SGML comment whose value is <PARAMETER>text</PARAMETER>. <PARAMETER>text</PARAMETER> is not checked for internal text that would interfere with the comment.</FUNCSYNOPSISINFO></FUNCSYNOPSIS><FUNCSYNOPSIS><FUNCPROTOTYPE><FUNCDEF>insert-meta</FUNCDEF><PARAMDEF>name</PARAMDEF><PARAMDEF>content</PARAMDEF></FUNCPROTOTYPE><FUNCSYNOPSISINFO>returns a sequence which is a single element META tag with name and content attributes.</FUNCSYNOPSISINFO></FUNCSYNOPSIS><FUNCSYNOPSIS><FUNCPROTOTYPE><FUNCDEF>make-trailer</FUNCDEF><VOID></VOID></FUNCPROTOTYPE><FUNCSYNOPSISINFO>generates a sequence to be inserted at the end of the document, including a processing timestamp.</FUNCSYNOPSISINFO></FUNCSYNOPSIS>

The SLIDESHOW element does all the work of setting up the proper formatting framework for an HTML document. It sets the <PARAMETER>document-type</PARAMETER>, adds a comment and a META tag with the <PARAMETER>generator-version</PARAMETER> value, and another META tag with a useful ObjectType. It then extracts the TITLE and makes the HTML TITLE from it. Finally, it produces a single BODY element composed of whatever processing the children perform and the trailer produced by make-trailer.

The first level children themselves are fairly simple; AUTHOR and DATE just break the line and italicize themselves; TITLE makes itself an H1 level one heading. SLIDE does a bit more work:

The BULLET, RAW, and URL second level children are now straightforward uses of LI. URL has added code to construct an A tag with an href attribute, duplicating the text of the content. RAW just uses TT for formatting.

EPS is a little tricky; it generates an IMG tag, but first calls html-mutate on the content of the element. Currently, html-mutate blindly turns a .ps extension into a .jpg which suffices for the original use. It would be more appropriate for the EPS tag to have some indication of possible filename options and types, and for the various output stages to select the "most likely".

Future extensions would include

Last processed: 1998-02-07T02:14:32