A guide for the perplexed

This chapter tells you how to start up HoTMetaL PRO and gives the basic information you need to get going with creating and editing files. If you are new to HoTMetaL PRO, HTML, or SGML, you should certainly read this section, as it will help you get acquainted with the product and learn about the components and procedures you'll need to get your work done.

Purpose

HoTMetaL PRO is an editor for creating files that can be read by graphical browsers (such as Mosaic) that are connected to the World Wide Web (WWW). The file format for such files is called the Hypertext Markup Language (HTML). The HTML format is actually a type of file format based on the Standard Generalized Markup Language (SGML). All HTML files are SGML files (the converse is not true, however--there are many other file formats described by SGML, so most SGML files are not in HTML format.)

If you have Mosaic, you can see what the HTML format looks like by invoking the View Source... command in Mosaic's File menu when you have an open document. HoTMetaL PRO provides an easy-to-use, graphical, structured editor for creating files in this format.

An overview of the menus

This section provides a summary of the main features.

How to run HoTMetaL PRO

The usual way to run HoTMetaL PRO is by double-clicking on the icon labeled `HoTMetaL PRO' in the HoTMetaL PRO Program Group. If this group has not been created, you should create it, as explained below.

The icon must have a command line associated with it. You can check the command line associated with this icon by using the Properties... command in the Windows File menu. You can also change the HoTMetaL PRO command line by using the Properties... command. You can create a new program group using the New... command in the Windows File menu, then add HoTMetaL PRO to that group (also using the New... command). Alternatively, you could add HoTMetaL PRO to an existing program group. When adding HoTMetaL PRO to a group, associate it with a command line like
c:\hotmtpro\sqhmpro.exe
as appropriate. An icon will be provided for you by HoTMetaL PRO.

Two other ways you can launch HoTMetaL PRO from within a Windows session are:

Setting the HoTMetaL PRO directory

The directory where HoTMetaL PRO is installed is referred to as "the HoTMetaL PRO directory", or the "SQDIR", throughout this documentation.

If you are running a copy of the HoTMetaL PRO executable file (sqhmpro.exe) that is not in the installation directory, it will not be able to find automatically the various auxiliary files and directories that it needs to run. In this situation you must inform HoTMetaL PRO of the location of the HoTMetaL PRO directory explicitly. There are two ways to do this:

If you set the HoTMetaL PRO directory using both methods, the value that you specify on the command line will take precedence. If you will be running more than one copy of HoTMetaL PRO, and will have a different HoTMetaL PRO directory for each, you should specify the directories on the command line.

Creating and editing files

This section gives the basic information needed to start editing files with HoTMetaL PRO.

Creating a new file

HoTMetaL PRO comes up with a new, empty HTML document ready for you to use. You can also create a new file as follows:

  1. Click on the New... command in the File menu.
HoTMetaL PRO brings up a new, empty file.

Editing an existing HTML file

If you already have an HTML file that you want to edit:

  1. Click on the Open... command in the File menu.
  2. In the dialog box that appears, choose the file that you want to edit.
Once you've done this, HoTMetaL PRO opens the file and you can begin editing.

Some "legacy" HTML documents cannot be opened because of bad markup. See the section on the Open... command for information on strategies for dealing with this.

Text and markup

Like most electronic documents, an HTML file consists of text and markup. (Markup is special codes inside the file that indicate how part of the file is to be processed: for example, a word-processor file would contain markup indicating typographical features such as the font and font size for various parts of the document.) In an HTML file the markup consists primarily of elements. Elements normally consist of a start-tag that is placed at the beginning of a section of the text, and an end-tag that is placed at the end of that section of text. In HoTMetaL PRO, when you insert an element in the document, you are actually positioning its start- and end-tags. When you want words and phrases to be considered as distinct elements, you surround them with tags.

For example, a title in an HTML file would look like this:
<title>This is a title!</title>

As you will see, when you are editing documents with HoTMetaL PRO, you don't have to deal with tags on this level: the start- and end-tags are represented on the screen by icons, and HoTMetaL PRO will insert both tags for you when you select a portion of the text to be surrounded by an element. (In fact, HoTMetaL PRO doesn't let you type tags literally--if you type the `<' character, HoTMetaL PRO will replace it by a `character entity' icon that looks like this: {lt}.)

It is important to realize that HTML markup is not primarily intended to indicate how the document is formatted typographically, it is meant to describe the document's structure. The same file may look different when displayed with different browsers. When you are marking up a document in HTML format, you mark up parts of the document according to their function in the structure of the document. For example, there are different elements for headings, lists, list items, paragraphs, titles, and many other parts of a document's structure. One of the reasons for using HTML (and SGML) is that the files can be readily re-processed in a different format by other publishing, browsing, database, etc., applications.

In addition to describing the structure of a document, some elements also describe the links to other documents that can be accessed from an HTML document.

Because HTML documents are structured documents, the elements must be arranged according to specific rules: otherwise, the document is considered invalid. When you are using HoTMetaL PRO, you don't have to keep track of these rules yourself--HoTMetaL PRO does it for you. One of HoTMetaL PRO's most important features is automatic rules checking, which ensures that you do not violate the required structure as you are creating a document. As well, when you open or save a document, HoTMetaL PRO checks that the markup is correct and complete.

Many HTML browsers have permitted a very loose, unstructured document format. Therefore, if you are editing existing HTML files, you may find that the structure that HoTMetaL PRO imposes on documents is somewhat constraining. If you need to, you can relax these constraints using the Turn Rules Checking Off command in HoTMetaL PRO's Special menu. Because there is an emerging trend toward browsers that require a stricter document structure, we believe that you will find it to your advantage to create all your new HTML documents with HoTMetaL PRO's default rules in force. It will also be worthwhile to modify existing documents to conform to these rules.

The document-structuring rules built in to HoTMetaL PRO are designed to be flexible while at the same time maintaining a useful document structure. If an existing `legacy' document (one that was not created with HoTMetaL PRO!) does not conform to these rules, HoTMetaL PRO's Open... command will give you the opportunity to pass the document through a filter that will attempt to adjust the markup so that the document can be opened. You also have the choice of opening the document as a text document and editing it by hand. Once the errors are fixed, you can use the Interpret Document command to do the equivalent of Open... on the text file.

Inserting markup

The most common operations you will carry out in order to add or change markup are:

Special characters

Characters in the ISO 8859-1 character set that cannot always be inserted in the document directly from the keyboard can be inserted using the Insert Character Entity... command in the Markup menu. These characters will be represented by small rectangular icons. In addition to this, if you type the characters `<' or `&' (both of which are special characters in SGML files) they will be replaced by special character icons.

Rules files

The rules that determine how elements can be arranged in an HTML file are described by a set of declarations collectively known as a document type declaration, or DTD. HTML files are no exception to this. HoTMetaL PRO reads a DTD in a special, binary form called a rules file, which contains the same information as the DTD but in a different format, one that is more efficient for HoTMetaL PRO to read. It is not mandatory for you to know more details about DTDs and rules files. HoTMetaL PRO uses a rules file called html.mtl: this file is located in a directory called rules in the HoTMetaL PRO directory.

If you are interested in seeing the DTD for HTML files, look at the file html.dtd in the dtds directory underneath the HoTMetaL PRO directory.

The configuration mechanism

HoTMetaL PRO's configuration mechanism allows you to modify certain aspects of HoTMetaL PRO's behavior: find and save options, location of auxiliary files and directories, etc. HoTMetaL PRO reads parameters called configuration variables from two configuration files: these are the file sqhmpro.ini in the HoTMetaL PRO installation directory, and the file sqhmpro.ini in the Microsoft Windows directory (usually this is the c:\windows directory. Specific configuration variables are discussed in various locations throughout this manual. For full details, see the chapter The configuration mechanism.

Links

It is normal for HTML documents to contain links to other documents, which can be located anywhere on the WWW. These links are provided by Universal Resource Locators (URLs), which are identifiers that name the location and filename of a document, and the protocol used to access it. There are a number of elements available to you whose function is to contain URLs: one such element is called `A' (this name stands for "Anchor"). Rather than typing in the URL between the tags as text, you edit an attribute of the element: this is a piece of information attached to an element.

HoTMetaL PRO has three commands for working with URLs:

More information on each of these commands may be found in the chapters on their respective menus.

Attributes

Elements can have content (text and sub-elements contained in the element) and attributes. An attribute is a piece of information about the element which does not appear in the content of the element. Some common uses for attributes are: to represent a link (URL); giving an element a unique ID so that it can be cross-referenced; naming an image file; setting formatting parameters (especially in tables).

Viewing attribute values

There are a number of ways of telling whether or not an element has attributes, and of seeing what the attribute values are.

Editing attributes

Attribute values may be inserted or changed using the Edit SGML Attributes... command in the Markup menu. When you invoke this command, you will get a dialog box that contains a line for each attribute of the current element. Each line contains the attribute name followed by either a text box or a pop-up menu, depending on what kind of value the rules file says the attribute must have. The attribute value may be text (which could be subject to restrictions such as the length of the text or first character in the text), or a selection from a list of values.

You should use Edit URL... to edit attributes that represent URLs.

Structure of HTML documents

The authoritative source of information on the structure of HTML documents is the document HyperText Markup Language (HTML) Version 2.0. This section provides a short summary of this material. The rules governing the HTML format are quite flexible, and furthermore HoTMetaL PRO will guide you through the document structure: therefore, the approach followed here will not be to enumerate all the possible combinations of elements. Rather, an overview of the structure will be presented, together with a discussion of the different groups of elements (emphasis, links, lists, etc.).

Overview

Typographical elements

The following elements are used primarily for typographical considerations such as emphasis and line breaks:

List elements

HTML supplies five list elements. With the exception of DL, list elements are composed of one or more LI (list item) elements.

Link elements

The following elements represent links to other documents:

Forms

The following elements are used to construct forms that the user can fill in and submit (e.g., via e-mail). When your document is browsed, the browser will generate the appropriate graphical widgets.

Other elements

The elements in this section do not fit into the categories described above.

Screen formatting

HoTMetaL PRO provides screen-formatting capabilities that facilitate the document creation process by allowing you to assign distinctive styles to the elements in your document. This formatting is in effect only while you are editing the file in HoTMetaL PRO. Another application such a a browser may (in fact, almost certainly will) format the document differently.

Because HTML files are structured documents, setting a style for an element means setting it for all elements of the same type.

The following kinds of typographical properties can be set:

Styles

HoTMetaL PRO stores its formatting information in files called styles files: these contain the formatting information set with the Character..., Separation..., Color..., and Ruler... commands.

HoTMetaL PRO maintains two kinds of styles files. There is one default styles file, which is used whenever a file is created or opened with HoTMetaL PRO. This is a binary file called html.stl. When an HoTMetaL PRO file is created or opened, HoTMetaL PRO looks for this styles file in the styles path, that is, the set of directories named by the styles_path configuration variable. If it finds the styles file, then the formatting information contained in that file is used for the current HoTMetaL PRO file. If the styles file is not found, then a new styles file, containing the default formatting information, is created in the first directory in the styles path. Whenever the current HoTMetaL PRO document is saved, this styles file is updated with whatever formatting parameters are in effect for the document.

HoTMetaL PRO also uses styles files in text format. These styles file are loaded using the Load Styles... command. You can switch styles in the middle of a HoTMetaL PRO session by choosing a new text styles file with this command. The formatting information from a text styles file will not be written to the default (binary) style unless the current file is saved. Text styles files are created using the Save Styles... command. You can maintain as many text styles files as you wish.

Displaying icons

Using the Show/Hide Tags command in the View menu, you can cause the special character icons and the tag icons that represent elements to be visible or invisible.

Displaying a document outline

The command Show Structure View in the View menu displays a nested outline view of the document. You can cut, copy, paste, and navigate in this outline. For more information, see this command's documentation in the chapter The View Menu.

Images

The Show Image command in the View menu lets you launch an external application to display a graphical image. GIF images can also be displayed inline (in the HoTMetaL PRO document window).

Newlines

Although pressing the KEY:Return or KEY:Enter key will put a "newline" into the file, Mosaic and other browsers follow the SGML whitespace rules, and therefore will ignore new line characters in some circumstances.

Tables

Tables are not supported in HTML Level 2. However, recent versions of Mosaic do provide table support, and HoTMetaL PRO will allow you to enter tables into your HTML documents.

To enter a table, you must first insert a TABLE element. When you do so, a dialog box appears, allowing you to specify the number of rows and columns in the table. When you click on [OK], a table is inserted in your document. This table is in graphical format: it looks like an ordinary table consisting of rows and columns, rather than being composed of tag icons like the other markup in the document.

The Markup menu contains four commands for changing the structure and format of tables: