Use HTML conversion macros

You can use the following tables on the HTML reference page to define HTML conversion macros:

The HTML System Macros table, which contains eight predefined macro names you can use to perform special functions at the start or end of Web pages.

The HTML Cross-Reference Macros table, which contains replacement text for FrameMaker cross-references.

The HTML General Macros table, which contains general-purpose macros that you define (for example, the title of the converted document).

note:   You cannot alter the System or General HTML macros in the HTML Setup dialog box.

After a macro is defined, you can use it by name in other macros, or you can map to it in the HTML Mapping table. The macro name appears in the To pop-up menu in the HTML Setup dialog box, so you can map a format to it without editing the Mapping table directly.

For examples of HTML conversion macros, see the reference pages of the templates that are included with FrameMaker.

Create or edit an HTML conversion macro

1)Choose View > Reference Pages and display the HTML page.

2)Edit a macro in a table, or create a row (by pressing Control+Return) and enter a new macro starting with a macro name. (You cannot add macros to the HTML System Macros table; you can only edit their replacement text.)

Replacement text can contain any mixture of text, HTML codes, and FrameMaker building blocks. Be sure that you enter valid HTML code; FrameMaker does not check the HTML syntax.

Use building blocks in HTML conversion macros

You can use the following building blocks in HTML conversion macros to include special types of text.

Building block

Description

<$paratext>

<$paratag>

<$paranum>

<$paranumonly>

See Including source information in cross references and Including character formats in cross-references for details.

<$variable[varname]>

Contains the text of the variable

<$defaulttitle>

Contains the text of the first heading that appears in the current document

<$nextsubdoc>

Contains the URL of the next HTML subdocument

<$prevsubdoc>

Contains the URL of the previous HTML subdocument

<$parentdoc>

Contains the URL of the parent HTML document

Building blocks are enclosed in angle brackets (< >) and begin with a dollar sign ($). Enter these building blocks in all lowercase letters.

note:   The General Macros table has a column labeled “Head.” Use this column to define a title or to include special, advanced information about the HTML document (such as keywords that a search engine might use). To fill in this column, you need to know the HTML elements that are permitted in the HEAD section of an HTML document.

Redefining HTML system macros

HTML system macros are a special case because you can redefine them, but you cannot add new ones.

These macros are especially useful when splitting up documents into separate HTML files. For example, you can define the StartOfSubDoc macro so that your company logo appears at the top of every new Web page.

In these descriptions, the parent document refers to the first Web page and subdocument refers to a document linked to the parent document.

System macro

Use

StartOfDoc

Inserts text at the top of the topmost Web page

EndOfDoc

Inserts text at the end of the topmost Web page

StartOfSubDoc

Inserts text at the top of each subdocument except the first and last

EndOfSubDoc

Inserts text at the end of each subdocument except the first and last

StartOfFirstSubDoc

Inserts text at the top of only the first subdocument created

EndOfFirstSubDoc

Inserts the replacement text at the end of only the first subdocument

StartOfLastSubDoc

Inserts the replacement text at the top of only the last subdocument created

EndOfLastSubDoc

Inserts the replacement text at the end of only the last subdocument

Customize titles

The title of an HTML document appears in the window’s title bar. When you add a bookmark to that page, it also appears in the bookmark list. Initially, the <$defaulttitle> building block is used for the title, which uses the first heading in an HTML file as the title for that file. Usually, the default titles are satisfactory. However, you can specify a different title by editing macro tables on the HTML reference page.

System macros and general macros can define two sets of replacement text: one that appears in the body of the code and one that is inserted in the head area.

You can modify the default title, or you can remove the default title and set up your own titles.

Modify the default titles

1)Choose View > Reference Pages and display the HTML reference page.

2)In the HTML System Macros table, locate the four system macros that set up the default titles. Initially, they use the <$defaulttitle> building block to assign the first heading in the file as the title. You can change any or all of them.

Macro Name

Replace With

Head

Comments

StartOfDoc

 

<TITLE><$default�title></TITLE>

 

3)Change the default macro for Head. For example, the following macro changes the text of the title to static text.

Macro Name

Replace With

Head

Comments

StartOfDoc

 

<TITLE> My Book</TITLE>

 

Set up your own titles

1)Choose View > Reference Pages and display the HTML reference page.

2)Remove the four default title replacement texts from the HTML System Macros table.

3)In the HTML General Macros table, define a macro that uses the <TITLE> HTML element in the third column, the Replace With (in HEAD) column. For example, the following macro uses a paragraph autonumber and text for the title, and also as paragraph text in the document.

Macro Name

Replace With

Head

Comments

MyTitle

<P><$para�num><$para�text></P>

<TITLE><$para�num><$paratext>�

</TITLE>

 

4)Map the macro to the format that you are splitting the HTML document on.


September 30, 2016

Legal Notices | Online Privacy Policy