Adding topic numbers to webhelp
Post here questions and problems related to editing and publishing DITA content.
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Adding topic numbers to webhelp
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
-
- Posts: 404
- Joined: Thu Aug 21, 2003 11:36 am
- Location: Craiova
- Contact:
Re: Adding topic numbers to webhelp
Post by radu_pisoi »
Hi,
The code for computing the topic path might be:
I didn't try a such customization, so I'm affraid I don't know the right way. The solution that you alredy found seems to be OK.Patrik wrote: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!?
You can try to find the associated topic in the temporary DITA map by looking for its relative path. The 'dita2webhelp.xsl' stylesheet already receives two parameters: FILEDIR and FILENAME. I think you can use they to compute the path to the topic and then find the associated topic in the DITA map using this path.Patrik wrote: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!?
The code for computing the topic path might be:
Code: Select all
<!-- Extract the file name without extension -->
<xsl:variable name="FILENAME_WITHOUT_EXT" select="oxygen:getFileName($FILENAME)"/>
<!-- Compute the output file name -->
<xsl:variable name="OUT_FILENAME" select="concat($FILENAME_WITHOUT_EXT, $OUT_FILE_EXT)"/>
<!-- The path for the current file -->
<xsl:variable name="current-file"
select="
translate(
if ($FILEDIR = '.') then
$OUT_FILENAME
else
concat($FILEDIR, '/', $OUT_FILENAME), '\', '/')"/>
Radu Pisoi
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 280
- Joined: Thu Nov 28, 2013 9:32 am
- Location: Hamburg/Germany
- Contact:
Re: Adding topic numbers to webhelp
Hi Radu,
thanks for your thoughts. Since I found several other things I'd have to modify (especially all kind of links within the map) I decided to implement it as an additional step in the preprocess.
So if anyone else should have the same requirement and comes across this thread - just tell me and I will make it open-source...
Patrik
thanks for your thoughts. Since I found several other things I'd have to modify (especially all kind of links within the map) I decided to implement it as an additional step in the preprocess.
So if anyone else should have the same requirement and comes across this thread - just tell me and I will make it open-source...
Patrik
Return to “DITA (Editing and Publishing DITA Content)”
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service