Omni Systems, Inc. Mif2Go User's Guide, Version 55

<< Prev | Next >>

> 29 Working with FrameMaker markers > 29.7 Inserting code or text with markers > 29.7.2 Surrounding marker content with code

### 29.7.2 Surrounding marker content with code

If you assign the Code property or the Text property to a marker type (see §29.4.1 Assigning properties to marker types), you can have Mif2Go surround the content with additional “before” and “after” code, or replace the content with code:

[MarkerTypeCodeBefore]

; marker type name = macro

; for markers assigned the Code or Text property in MarkerTypes.

[MarkerTypeCodeAfter]

; marker type name = macro

; for markers assigned the Code or Text property in MarkerTypes.

[MarkerTypeCodeReplace]

; marker type name = macro

; for markers assigned the Code or Text property in MarkerTypes.

Mif2Go expands macros assigned in these sections. If the marker type is assigned the Code property and marker content includes macros, those macros are expanded, also. If the marker type is assigned the Text property, marker content is treated as plain text.

ALink references

Following the example in §29.3 Remapping marker types and hypertext commands, to create an ALink reference to the link identified in the marker content:

[Markers]

Subject = Index ALinkRef

[MarkerTypes]

ALinkRef = Code

[MarkerTypeCodeBefore]

ALinkRef=<a href="alink:

[MarkerTypeCodeAfter]

ALinkRef=">Related Topics</a>

In this example, if you are generating Oracle Help for Java, you specify one subject name in the ALinkRef marker, and get both an ALink (which makes the current topic a member of the group) and a hotspot that calls up that list of topics.

Macro variables

You can capture marker content in a macro variable at the same time. For example:

[Markers]

ALink = ALink AName

[MarkerTypes]

AName = Code

[MarkerTypeCodeBefore]

AName = <$$ALinkText= "

[MarkerTypeCodeAfter]

AName =">

Mif2Go first makes a copy (AName) of the ALink marker, then uses that copy to create a macro assignment statement:

<$$ALinkText= "marker content">

This statement sets the value of the macro variable to the content of the marker, without producing any output; and you can use the macro variable in other macros. Because the same variable may be assigned multiple times in a document, Mif2Go processes each assignment in document sequence. Therefore the assignment must precede the point of use.

For a more extensive example for HTML Help, see §9.7.5.2 Creating a list of ALink keywords from markers.

Content replacement

You can replace marker content at the same time; for example, to substitute a numeric entity for a special character:

[MarkerTypeCodeBefore]

HeaderFooter2=<ph outputclass="HeaderFooter2"><$$string="

[MarkerTypeCodeAfter]

HeaderFooter2="><$($$string replace "®" with "&#174;")></ph>

For marker content “Vertigo®” the result would be:

<ph outputclass="HeaderFooter2">Vertigo&#174;</ph>

See §28.6.5 Specifying substrings in expressions.