Metatext

Overview of metatext

Metatext is a Virtual Laboratory hypertext program. It allows the user to access vlab objects in an arbitrary order, independent of the hierarchical organization of the lab. Metatext nodes (frames) consist of text, UNIX commands, and messages to the vlab daemon. Textual descriptions are displayed in separate windows. The set of textual descriptions and corresponding references to vlab objects forms an interactive document which guides the user through the lab.

Structure of metatext

The structure of metatext can be described from two perspectives: the static structure of links between information nodes that constitute a metatext database, and the dynamic structure of processes created while browsing and displaying information. A metatext data base (Figure 1) consists of two types of files: frames and index files.

Figure 1 - Static structure of a metatext data base

A frame is the basic information and display unit. It contains text to be displayed in the text window, and a list of commands to be run along with the text. An index file is a list of names grouping related frames into a section. A given frame can be listed in several index files, and can include references to other index files. This establishes a graph of references not limited to tree structures, built on top of the UNIX file system.

From the dynamic perspective, metatext runs as a number of concurrent processes (see Figure 2), which can be divided into 3 classes:

It is an essential concept of metatext that new metatext processes can be created in the same way as any application process, by executing the appropriate command in the frame. Consequently, several metatext processes may be active at the same time, offering different views of the vlab database.

Figure 2 - Dynamic structure of metatext processes

A user's view of metatext

A running metatext process is manifested by a small window (Figure 3a) with 4 buttons and the name of the current index file. The rightmost button is a down arrow, which is used to create an extended window with the metatext menu (Figure 3b). This menu includes an item for each frame in the section, plus several additional items (see The metatext menu). The other 3 buttons turn on or off operations invoked automatically when a frame is selected, specifically:

Two more buttons are included in the extended window:

The metatext menu

The metatext menu contains the following items:

        ....
        ....       names of the files from the index file
        ....
        --------
        Modify
        Reread
        Restart
        Quit

The items added automatically to the menus play the following role:

The extended menus may also be displayed as a popup style menu, using the right mouse button.

Sample metatext windows are displayed in Figure 3.

               (a)                         (b) 

Figure 3 - Metatext windows with and without extended menu pulled down

Invoking metatext

Metatext is invoked using the following command:

 metatext [-e] [-exec] [-view] [-edit] [-md|-mc|-mt]index_file

The following settings determine the state of metatext when invoked:
-e metatext is open with the extended window,
-exec execute all UNIX commands in the selected frame,
-view show the text in the selected frame,
-edit open an editor on the selected frame,
index_file the name of the index file.
In addition, the following settings are provided for backwards compatibility,
-md demo mode (equivalent to -exec -view),
-mc command mode (equivalent to -exec),
-mt text mode (equivalent to -view),

Index file format

An index file is a text file that contains the names of some or all frames in the metatext database. Each name must be listed on a separate line; these frame names are then included in the metatext menu.

For example, the following index file Demo resulted in the menu shown in Figure 3:

2D-plants
baretree
lychnis-demo
random-moss
cypress

Frame file format

Frame files contain a mixture of text and UNIX commands. When the user selects one of the menu items read from the index file, the text portion of the corresponding frame file is displayed in a window and the included UNIX commands are executed.

Syntactically, every line that does not start with a ":" is considered a part of the text and every line that starts with a ":" is assumed to include a UNIX command.

For example, the frame file 2D-plants may have the following form:

Understanding A Formalism
2D Plants
:xclock
:object /usr/u/vlab/oofs/ext/plants/ext/2D-plants

If the user now selects the 2D-plants item in the menu shown in Figure 3, then a window including the descriptive text associated with the object will be displayed, and the UNIX commands embedded in the frame file will be executed (for example, the xclock command will be run producing a clock display on the screen); the resulting display is shown in Figure 4.

The :object command is a special case. In addition to invoking the Object Manager, which will place the indicated object from the object database on the lab table, :object sends a message to all currently running browser processes in order to position them on the selected object.

Figure 4 - Example of a metatext display

Organization of the metatext data base

The navigation mechanism in metatext is inherently based on the concept of multiprogramming. A metatext process can invoke another metatext process using a UNIX command included in a frame, thus when the user navigates through the hypertext documents, new metatext processes are created with different index files. On the other hand, metatext processes that are no longer necessary can be terminated by the user. Thus the number of active metatext processes changes dynamically, reflecting the user's current view of the entire metatext database.

Although cyclic references to metatext processes are technically possible (i.e.; a metatext process with index file A may contain a frame indexing a metatext process with index file B and vice versa), users commonly organize their metatext databases in a hierarchical fashion, to facilitate the conceptualization of the hypertext documents.

Customization

Users may customize certain aspects of the metatext display. The relevant file is found in the vlab/config directory, also called metatext.

The file metatext contains the following:

Editor xwsh -e vi
Viewer xless -auto

These 2 lines define the UNIX commands to be executed when metatext invokes an editor or a window for viewing text.

References

P. Prusinkiewicz and J. Hanan. A hypertext environment for UNIX. In Graphics Interface '88 Conference proceedings, (Edmonton, Canada, June 6-10, 1988), pages 50-55, Canadian Information Processing Society, 1988.

Credits

P. Prusinkiewicz, J. Hanan, P. Federl - metatext implementation

I. Hernadi, P. Prusinkiewicz, J. Hanan - metatext documentation

Bugs

????
 


Last updated July 12th, 1999 by Pavol Federl