Page 1 of 1

Autonumbering Task Topic Titles for Tutorials in Webhelp

Posted: Tue Aug 29, 2017 11:05 pm
by dgallo
We are using a series of task topics to create one large tutorial. In the DITA webhelp, is it possible to automatically assign a number in the title of each task topic. We would only want this customization to apply to the task topics that make a tutorial, not for normal task topics.

For example:

T-1000: Introduction Tutorial
Topic (1: Title)
Topic (1.1 Title)
Topic (2: Title)
Topic (2.1 Title)
Topic (3: Title)
Topic (4: Title)
Topic (4.1: Title)
Topic (4.2: Title)

Re: Autonumbering Task Topic Titles for Tutorials in Webhelp

Posted: Wed Aug 30, 2017 5:02 pm
by bogdan_cercelaru
Hello,

Assuming that you are using the chunk="to-content" attribute to obtain one large tutorial from a series of topics, you could use the outputclass attribute and the CSS Counters to obtain what you required.
The outputclass attribute should be set on the root element of the topic that will be included in the bigger tutorial. Below is an example of a CSS that you can use:

Code: Select all


body {
counter-reset: section;
}
.custom-section {
counter-reset: subsection;
}
.custom-section>.title::before {
counter-increment: section;
content: counter(section) ": Title";
}
.custom-subsection>.title::before{
counter-increment: subsection;
content: counter(section) "." counter(subsection) ": Title";
}
Regards,
Bogdan