Adding topic numbers to webhelp
Posted: Mon Sep 12, 2016 2:25 pm
I have a use-case where the topic numbers need to be visible not only in the PDF but in the webhelp output as well. While adding this was pretty simple for the pdf it appears to require quite some effort for the webhelp!?
What i got so far is:
Patrik
What i got so far is:
- I modified the build_dita_template.xml to allow a custom value for ditaToc.xsl:
Code: Select all
[...]
<if>
<not>
<isset property="args.tocDita.xsl"/>
</not>
<then>
<property name="args.dita.out.map.webhelp.tocDita.xsl" value="${webhelp.dir}/xsl/dita/tocDita.xsl"/>
</then>
</if>
<xslt processor="trax"
in="${dita.temp.dir}/${user.input.file}"
out="${output.dir}/toc.xml"
style="${args.dita.out.map.webhelp.tocDita.xsl}"
[...] - In my custom ditaToc.xsl I additionally passed the class attribute to the toc:topic elements to allow different numbering (i.e. hide the number for notices and use letters for an appendices).
- In my custom createMainFiles.xsl I override the function oxygen:getTopicTitle() to add the number in front of the text.
- Is this the right way? For the frames html I would have to adapt additional XSLs... An alternative might be to add a preprocess step that modifies the navtitle element within the ditamap!?
- How can I comfortably add the topic number to the topic itself. Sicne each topic is processed individually I have no direct access to the corresponding topicref in the ditamap!?
Patrik