When you use CSS, DITA2Go generates any tags assigned to a character format in [CharTags]; see §30.3 Mapping character formats. By default, DITA2Go maps each 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 §31.7.1 Understanding CSS class name restrictions).
For example, suppose your document uses character format names Emphasis, Prog Term, and Link, with the first two assigned HTML tags in [CharTags]. DITA2Go would treat these formats as follows, provided ClassIsTag=No (see §31.7.8 Using CSS class names as tags for XML):
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 character format name not listed in [CharTags] is assigned to a span class of the same name as the format.
When UseSpanAsDefault=No, any character format name not listed in [CharTags] is skipped, and becomes just an override in HTML output.
To explicitly map an individual character format to a CSS span class:
[CharTags] CharFormat=span
[CharClasses] CharFormat=classname
[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">, DITA2Go 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, DITA2Go uses the [CharTags] setting for backward compatibility. See §30.3 Mapping character formats.
For generic XML output, see §23.3.1 Deriving XML tags from format and class names.