Open norweis opened 8 years ago
This is something I'm interested in - I, too have this as a desired feature. It impacts output from .MD (markdown) as well as from DITA files. The standard way of producing numbering counts from the map.
An approach was suggested on the DITA list, but I lack the knowledge to implement it:
Create a copy of $map where you decorate the topicref elements with section numbers (for example, <topicref id="xyz" ... sect-number="2.3.1">. Use a dedicated template mode to do this. For example,
Enhance the mode="section-numbers" topicref template so that it will process each corresponding topic in the stage1! .xml file. In other words, find the topic element with the matching @id and create topicref nodes in variable number-tree for it and each of its topic descendants. Make sure to populate @sect-number and to copy @id.
Define a xsl:key
Use $number-tree with the key:
Notice that the $number-tree variable is being used in key() as the content source.
When having topics at the end of a topic file (within the topic file, not within the map file), their headings are not numbered, although I checked "title numbering" on all Heading n formats. But sub-topic are influenced by the Heading n formats, e.g. Italics and fonts for sub-topics works, only numbering does not work.
PS: in our application, we generate DITA files dynamically, and it would be difficult to generate seperate files for each topic in these cases.