Extending HTML mode

Extend menu You can add new HTML elements, or new attributes to existing elements, to HTML mode. New elements will be put in a new submenu Custom of the HTML menu. The possibility to extend HTML mode was originally developed when HTML was continuously evolving with Netscape and Microsoft adding new extensions to HTML. It provided a way for you to add these new elements before HTML mode was updated. Now when HTML has stabilized the main reason for the extendability is for the user to be able to add elements of scripting languages, which use tags which look like HTML tags.

Your custom elements will always be available, regardless of the document type declaration in the document or the attribute preferences. It is assumed that you add new element because you want to use them... However, when validating the document all custom elements are considered as unknown.

The Extend menu has three functions:

Adding a new element

New element

When adding a new element a dialog box is first opened where you can specify:

Next you are asked to give a key binding for the new element. This dialog box is the same as is used when changing key bindings in the menus.

Thereafter you are asked to specify the layout for the element. This is done in the way explained in the section about element layout.

Next a window is opened where you can specify the attributes. This is explained in the next subsection.

Editing an element

When you are adding a new element or editing an existing one a window is opened where you can specify the attributes. Note! You should not edit the text in this window directly, but only through dialog boxes and the key shortcuts described below. Direct editing has no effect, except possibly messing things up. There is a reason that this window is made read-only.

Edit element

Above is the edit window for the IMG element, where we have already added a new attribute MYATTRIBUTE. Each attribute is given in this window like this:

Adding a new attribute

New attribute

To add a new attribute type N. A dialog box is then opened where you can specify:

The available types are:

A few attribute types require additional information.

For attributes of the type Choices you must specify all valid choices in a second dialog box. The choices you define will be displayed in the dialog window as you go along, as shown below. Click

New choices 1
New choices 2

For attributes of the types Length, Integer, Multi length, Multi lengths, and Lengths you must specify the range of valid values in a second dialog box. Leave the edit fields blank if there is no minimum or maximum value.

Range

Editing and deleting attributes

To edit an attribute to change its name, type, and values, browse to the attribute and hit return. You can then give it values in the same way as when you define a new attribute as described above. Note that attributes marked with a bullet cannot be modified with one exception. You can add new choices to an attribute of type Choices. Cmd-double-clicking on an attribute also lets you edit it.

To delete an attribute browse to the attribute and type delete or backspace. You can also select several lines and delete them all at once. Note that attributes marked with a bullet cannot be deleted.

Saving

Once you are finished close the window to save your changes. To cancel the changes hold down the shift key while clicking the window's close box.

Previous page Next page