Omni Systems, Inc.

  

Mif2Go User's Guide, Version 55

  

Valid HTML 4.01!

 

Made with Mif2Go

21 Mapping text formats to HTML/XML > 21.3 Mapping paragraph formats > 21.3.1 Assigning HTML tags and attributes to paragraph formats


21.3.1 Assigning HTML tags and attributes to paragraph formats

To specify the HTML tag to be used for headings and other special-purpose formats:

[ParaTags]

; Document para format name = HTML style name (default is <p>)

; use h1-h6, pre, script, address, or blockquote for HTML styles

Although these (and span) are the only valid HTML tag names you can specify in this section, Mif2Go does not require you to stick to valid tags. You can use any tags, to allow XML within HTML. In fact, you can use any text that can go inside the <> brackets Mif2Go supplies around the text. However, only tags valid in HTML for paragraphs produce effects in HTML output.

If you are creating Web pages that will be available to search engines, keep in mind that headings that are actually tagged as headings (h1 through h6) can be important for search ranking. For example, Google search might look at the following (rather than keywords in meta tags):

1. titles of pages

2. words displayed in links to those pages

3. words used in headings that are tagged as such

4. words used within the pages.

With paragraph tag settings in [ParaTags] you can also do the following:

Add attributes to a tag

Apply a character tag to a paragraph format

Provide a CSS class name

Suppress paragraph tags entirely.

Add attributes to a tag

To add attributes to the paragraph tag, list them after the tag. For example:

[ParaTags]

CodeBold = pre type="bold"

Everything after the first space that follows the tag name is removed for the end tag. To apply an attribute to an individual instance of a paragraph format, insert an attribute marker in the paragraph; see §29.2.4 Using attribute markers for HTML or XML. For this example, you would use a marker of type ParaType with content bold (no quotation marks).

Apply a character tag to a paragraph format

To apply an HTML character tag (for example, em) to a paragraph format, you would have to do something like this:

[HTMLParaStyles]

ParaFmt = CodeStart CodeEnd

[ParaStyleCodeStart]

ParaFmt = <em>

[ParaStyleCodeEnd]

ParaFmt = </em>

(With CSS, it might be simpler to add font-style: italic; to the CSS style for the <p.parafmt> tag.)

Provide a CSS class name

If you are using CSS, by default the tag name becomes the CSS class name for HTML output; for XML output, the default is reversed. See §22.5 Understanding how CSS affects other options.

You can provide your own class names. For example:

[ParaTags]

Heading 1 = H1 class="tophead"

results in:

<h1 class="tophead">

for all Heading 1 paragraphs in HTML output.

If you do provide your own class names, do not also have Mif2Go generate a style sheet (see §22.4.1 Specifying CSS options at project set-up time); you would get duplicate class entries for any such paragraph formats. See also §22.7.2 Mapping paragraph formats to CSS classes.

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

Suppress paragraph tags entirely

To eliminate style tags entirely, map the paragraph format to nothing:

[ParaTags]

ParaFmt =

Specifying an empty [ParaTags] class is equivalent to assigning format property NoPara to the paragraph format; see §21.3.6 Stripping paragraph properties.

If you are producing DITA XML output, see also §15.4.3.2 Omitting element tags for selected paragraph formats.



21 Mapping text formats to HTML/XML > 21.3 Mapping paragraph formats > 21.3.1 Assigning HTML tags and attributes to paragraph formats