Topic and Map Template Building Blocks

Building blocks control the file name format and structure for topics and maps.

The fm2dita.ini file includes two settings that require the use of file name building blocks. Most of the building blocks are the same as those provided in DITA-FMx (all except the “$FMX_” types), in addition to a four more “$FM_” types. A building block is a string of text enclosed in angle brackets and are used in the TopicNameTpl and MapNameTpl INI parameters.

The $TITLE* building blocks provide various options for using the text of the topic title. In all cases the text returned is processed by stripping the “stop words” as defined in the StopWords parameter.

You can include a modifier value after the building block name in square brackets. This value must be a number (from 0 to 99), and if provided, limits the length of the resulting string to that value (the first N characters). If you want to extract a substring from a building block, include the start and end positions in square brackets. For example, the following building block will extract the first two characters from the topic type:

<$TOPIC_TYPE[2]>

Or, to extract the second through fifth characters, use the following syntax:

<$TOPIC_TYPE[2-5]>

Other modifiers can be used to change the case of the text that results from the building block. These single-character modifers must follow any numeric modifiers if present. The following modifiers are available:

The following syntax will generate the first two characters from the topic type in uppercase:

<$TOPIC_TYPE[2U]>

Valid building blocks are listed below (some of these make more sense to use in a file name than others):

Note: Using time-based building blocks can result in errors if the conversion time spans the time unit boundary used in the building block. Use these building blocks with care.