Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

22 Setting up CSS for HTML > 22.7 Assigning CSS classes > 22.7.3 Mapping character formats to tags or span classes


22.7.3 Mapping character formats to tags or span classes

When you use CSS, Mif2Go generates any tags assigned to a character format in [CharTags]; see §21.4 Mapping character formats. By default, Mif2Go maps each FrameMaker character format that is not assigned a tag in [CharTags] to a CSS span class of the same name as the format, applying to the name any needed transformations (see §22.7.1 Understanding CSS class name restrictions).

For example, suppose your FrameMaker document uses catalogued character format names Emphasis, Prog Term, and Link, with the first two assigned HTML tags in [CharTags]. Mif2Go would treat these formats as follows, provided ClassIsTag=No (see §22.7.9 Using CSS class names as tags for XML): 

[spacer]

FM format name

[CharTags]

Mif2Go HTML output

Mif2Go CSS entry

Emphasis

Emphasis=em

<em>

em.emphasis {...}

Prog Term

Prog Term=code

<code>

code.progterm {...}

Link

(no setting)

<span class="link">

span.link {...}

If no tags are specified in [CharTags] for a particular character format, by default that format gets a span class.

To avoid creating CSS span classes for any character formats that are neither explicitly assigned an HTML tag nor explicitly assigned to a span class:

[CSS]

; UseSpanAsDefault = Yes (default, use span as element name

;  for all char formats that do not specify one in [CharTags]

;  or No

UseSpanAsDefault=No

When UseSpanAsDefault=Yes, any catalogued character format name not listed in [CharTags] is assigned to a span class of the same name as the format.

When UseSpanAsDefault=No, any catalogued character format name not listed in [CharTags] is skipped, and becomes just an override in HTML output.

Untagged Bold and Italic applied with FrameMaker toolbar buttons get mapped to <b> and <i> respectively.

To explicitly map an individual character format to a CSS span class:

[CharTags]

CharFormat=span

[CharClasses]

CharFormat=classname

Or:

[CharTags]

CharFormat=span class="classname"

You can use either method to assign <span class="classname"> tags, to define character formats globally in CSS. For example, if you map character format CodeBold to <span class="codebold">, Mif2Go inserts corresponding generic selector .codebold in the CSS file.

If you assign a class name to the same format in both [CharClasses] and [CharTags], and the class names are different, Mif2Go uses the [CharTags] setting for backward compatibility. See §21.4 Mapping character formats.

Generic XML

For generic XML output, see §14.4.2 Deriving XML tags from format and class names.



22 Setting up CSS for HTML > 22.7 Assigning CSS classes > 22.7.3 Mapping character formats to tags or span classes