27.5.2.7 Assigning a computed title

If titles for your HTML pages can be determined based on the value of a macro variable, or on values obtained by expanding a macro, you can assign the macro or macro variable to the [HTMLOptions]Title keyword.

For example, to provide a page title that consists of the DITA source file name followed by an integer that increments for each HTML file generated:

[HTMLOptions]
Title=<$PageTitle>
[PageTitle]
<$$_basefile><$$PgNumber++ as %-0.3d>
[MacroVariables]
PgNumber=0

Any other title specification overrides a computed [HTMLOptions]Title value.

See also:

§37.1 Defining and invoking macros

§37.3.3 Incrementing and decrementing macro variables

§37.6.3 Displaying expression results in output

Previous Topic:  27.5.2.6 Assigning a default title

Next Topic:  27.5.3 Supplying <meta> text for split or extract files

Parent Topic:  27.5.2 Specifying page titles for split or extract files

Sibling Topics:

27.5.2.1 Understanding title assignment precedence

27.5.2.2 Assigning a title with a paragraph format

27.5.2.3 Specifying a title prefix or suffix

27.5.2.4 Assigning a title with a file name

27.5.2.5 Assigning a title with a marker

27.5.2.6 Assigning a default title