Chapter 3.3. Paragraphs and Blocks
This section lists all supported XHTML elements and attributes for defining paragraphs and other formatted blocks. The listed elements and attributes are supported for interactive and print output. The elements and attributes that are not mentioned in this section may still work for HTML-based output (e.g. WebHelp), but are most likely ignored for print-output.
The class attribute
In Docmenta the formatting of paragraphs and other blocks has to be done by assigning a CSS class to the corresponding element. The assignment of a CSS class is done by setting the class attribute. The class attribute has to contain the ID of a Docmenta style.
The class attribute allows to assign multiple styles to a single element. This can be done by separating the style IDs with spaces. For example <div class="important warning">...</div> creates a block that is formatted with the style properties of both styles, "important" and "warning". However, assignment of multiple styles to a single element is discouraged, as it may not be supported by all output formats. Furthermore not all XHTML editors may support assigning multiple styles (CSS classes) to a single element. Therefore, if a merged style is required, it is recommended to create a new style that combines the properties of several other styles.
The style attribute
The style attribute should not be used to define formatting properties. Instead, the class attribute should be used (see the section above). However, in few cases Docmenta uses the style attribute to allow insertion of print-specific formatting instructions. For example, the insertion of page-breaks can be done via the style attribute (see Chapter 3.11, Controlling Page Breaks for details).
The id and title attributes
The id attribute can be used to assign an alias name to an element. Be aware that the alias name has to be unique within the complete product-tree. By assigning an alias to an element, the element can be referenced through links as described in Chapter 3.4, Links. However, normally an alias is only assigned to section-nodes, figures, tables and labeled blocks, but not to a paragraph. If an alias is assigned to an element and the element is referenced by links, then also a title should be assigned to the element by setting the title attribute. For more information on how to create links to content elements, see Section 1.4.2, “Referencing images and tables” and Section 1.13.8, “Labeled blocks”.
Supported elements and attributes
Following table lists all elements for creating paragraphs and blocks, which are supported for interactive and print output. For each element the supported attributes are listed. The last column gives hints on how the elements should be used.
class, id, title
Defines a block with arbitrary content. A div element should always have a class attribute containing the ID of a block-style.
class, id, title
Defines a paragraph. Note that p elements should only contain inline content like text, links or images. A p element should not contain any other p element as direct child. If blocks need to be nested, then the outer blocks should be defined by div elements instead.
A p element can have a class attribute containing the ID of a block-style. To create an indented paragraph, the class attribute needs to be set to the value indent-levelX, where X is a digit (0-9) defining the indentation level. The default indentation level is 0, namely no indention. In other words <p>...</p> and <p class="indent-level0">...</p> both create a non-indented paragraph. Whereas <p class="indent-level1">...</p> creates a paragraph that is indented by 1 level. The actual indentation space is defined by the output configuration and should not be defined in the XHTML source.
class, id, title
Defines a pre-formatted block. In other words, line breaks in the XHTML source are rendered as line breaks in the output. This can be useful for the formatting of listings (to avoid the need of inserting br elements at the end of each line).
A pre element can have a class attribute containing the ID of a block-style. If no class attribute is specified, then the block is formatted using the pre-defined block-style "pre" (see Section 2.4.2, “Pre-defined styles”).