#### 30.2.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, DITA2Go 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 DITA2Go 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 PI marker in the paragraph; see §38.3 Adding attributes with PI markers. For this example, you would use a PI marker of type ParaType with content bold.

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 §31.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.

For XML output, see §23.3.1 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 §30.2.4 Stripping paragraph properties.

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

Previous Topic: 30.2 Mapping paragraph formats

Next Topic: 30.2.2 Including or excluding paragraph autonumbers

Parent Topic: 30.2 Mapping paragraph formats

Sibling Topics:

30.2.2 Including or excluding paragraph autonumbers

30.2.3 Designating script paragraph formats

30.2.4 Stripping paragraph properties

30.2.5 Providing content for empty paragraphs

30.2.6 Eliminating unwanted paragraphs

Table of Contents • Index