SGML Scripting

I suppose that most programmers and several other people would like to write their documents similar to scripts rather than as plain SGML files. InfoPrism allows this for documents with the document type Manual and the scripting language Tcl resp. [incr Tcl]. This document describes SGML scripting with InfoPrism and the additional commands you have to learn.

Important Notes

The command set and the syntax is similar to those of ordinary scripts written for [incr Tcl] version 3.0a1. However, SGML scripts are processed by a safe interpreter.

Document Structure

Title

The first command in any SGML script is the manual command with the document title as argument. Additional options are:
-lang CODE
Specifies the document language. Recognized are DE and EN.

Other Global Commands

Global commands affect the whole document and may appear anywhere in the document.
author [-email ADDRESS] NAME
Specifies the author of the document. Optionally the email ADDRESS of the author may be given.
keywords [NAME ...]
Specifies keywords related to the document.
stylesheet URL [TYPE]
Specifies a stylesheet for rendering the output document.

Sections

Sectioning commands are, in descending order, h2, h3 , h4, h5 and h6. The argument is used as section title.

Additional options are:

-descr TEXT
Use TEXT as long section name.
-label NAME
Attach label NAME to section.

Additional Control Structures

include FILE
Works similar to the vanilla Tcl command source.

Lists

Unordered Lists

ul {
    li cats
    li dogs
}

Ordered Lists

ol {
    li [code ./configure]
    li [code make]
    li [code make install]
}
Software packages adhering to the GNU standards can be easily installed with the following commands:
  1. ./configure
  2. make
  3. make install

Definition Lists

Definition lists are lists where each item consists of a term and a description.

Composed List Items

The syntax of the Tcl language makes it difficult to script nested lists and complex items. In this section we describe a set of commands used as remedy for this problem:
liwul
Unordered list within an ordinary list item:
liwul "Some animals are: " {
	li "cats"
	li "dogs"
}
	
ddwul
Unordered list within a description list item.
ddwdl
Description list within a description list item.
ddwex
Example within a description list item.

Tables

Tables can be created with the table and row commands.
table SCRIPT
Evaluates SCRIPT and creates a table with the result as it contents.
row [COLUMN ...]
Creates table row from COLUMN arguments.
table {
	row Name Age
	row Stefanie 18
	row Christine 16
	row Ulla 32
}
NameAge
Stefanie18
Christine16
Ulla32

Text Markup

Entities

You can use the ent command to generate entities:
text "[ent copy] 1998 by Stefan Hornburg"
© 1998 by Stefan Hornburg

Preformatted Text

The pre and example commands marks the enclosed text as preformatted.
pre "Preserved =>    <= blanks"
Preserved =>    <= blanks

Cross-References

label KEY TEXT
Marks TEXT as target for references to KEY.
ref KEY TEXT
TEXT refers to KEY.

Indices

Each index has to be declared with the makeindex command. insertindex inserts the index into the document. Index entries are generated by the index and withindex commands.
makeindex animals
text "Famous animals living in the sea are the [withindex animals whale]
and the [withindex animals dolphin]."
insertindex animals
Famous animals living in the sea are the whale and the dolphin.

Miscellaneous

img SRC [ALT]
Inserts image located at SRC. It it recommended to pass an string ALT containing an short description of the image.

Undocumented Commands

Index of Commands

Concept Index


Written by Stefan Hornburg <racke@gundel.han.de>
Translated from sbl.tcl by Info Prism's sgml2html v0.0.6
Last modified 21 December 1998