InfoPrism Ruleset Scripts

A fundamental principle of InfoPrism is the ability to cope with any reasonable DTD. This is realized with ruleset scripts . The InfoPrism package includes ruleset scripts for the default document type Manual. Support for the Docbook DTD is under development.

Commands

Rulesets

Virtual Rulesets

Elements representing common document components usually have different names in DTDs. Virtual rulesets are identified by symbolic names and can be attached to concrete elements later:
	virtrule paragraph -front paragraph
	grabrule paragraph PARA

Environments

Environments mark a special section of a document. Usually, you enter the environment with the begin command in the front part of a girule and leave it with the end command in the back part of a girule:
girule "PRE" -front {
	begin verbatim
	return "[newline][newline 1]"
} -back {
	end verbatim
	return "[newline][newline 1]"
}
Additional arguments may be passed to the begin command. The arguments of the active instance of the enviroment ENVIRON are accessible with the envargs command. Environments, e.g. table can be nested. level returns the nesting depth of an environment.
indent
Indents enclosed text. Amount of indentation depends on the nesting depth.
hidden
Excludes descendant nodes from translation.

Text Processing

text [OPTION ...] STRING
Formats STRING and returns the result. Inserts linebreaks if fill column is exceeded. This behaviour can be disabled by passing the OPTION -nobreak.

Features

Any kind of information a translator needs about a document must be retrieved independent of the SGML elements used in the document. Instead of explicitly examining the document a translator queries for results of features. The provide command serves as a way to implement a certain feature. The following example shows the implementation of the indices feature for the document type Manual:
provide indices {doc} {
	foreach node [$doc gilist MAKEINDEX] {
		set indices([$node attval NAME]) [Index $node]
	}
	return [array get indices]
}
The implementation is responsible for the correct format of the information it supplies. The following features may be provided:
stylesheets
deflang
Default language of the document.
authors
Authors of the document supplied as Author objects.
nodenames
defindices
indices
Document indices.
bibliographies
Bibliographies within the document.
stamps
Time stamps for document nodes, usually sectioning elements, supplied as Stamp objects.
registerentry
Categorizing information.

Auxiliary Functions

A rule script may define any number of auxiliary functions with the auxproc command. However, you should not use any of the following auxiliary function names in a context other than described below.
secup NODE
Returns the next ancestor of NODE which is a sectioning element.
auxproc secup {node} {
	set up [$node seek "cget -up" "cget -gi" SECTION]
	if ![llength $up] {set up [$node seek "cget -up" "cget -gi" MANUAL]}
	set up
}

Reference Implementation

This section provides some information about the output generated by the ruleset scripts included by the distribution.

HTML

Stylesheets

CommandSGML elementClass name
navbar<LINK> within preamble navbar

Index of Commands

Index


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