Connecting CHM file to dialog boxes

Post here questions and problems related to editing and publishing DITA content.
Tarja Koski
Posts: 4
Joined: Wed Apr 25, 2018 2:24 pm

Connecting CHM file to dialog boxes

Post by Tarja Koski »

Hello everyone,

The user manuals of our software have so far been written in HTML and compressed to a CHM file. We are now moving to DITA and thinking of using Oxygen XML editor for writing and creating outputs. We are still going to deliver a CHM file with the software. The help buttons in the software's dialog boxes have been connected to the CHM file with this definition in the html help project file HHP:

[ALIAS]
#include Main\Def\Dialoghelp.ali

[MAP]
#include Main\DialogIds\windialogs.h
#include Main\DialogIds\vxui_dialog_id.h

The .h files contain the dialog ids, and the .ali file connects the correct html page to the dialog id.
When I create a CHM file with the Oxygen transformation tool, it seems that the html help project files (HHP, HHC, HHK) are always regenerated. Is there a way I could set the above [ALIAS] and [MAP] information as parameters or attributes so that they would be added to the HHP file whenever I create the CHM file?

Thank you,
Tarja Koski / Vertex Systems Oy
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Connecting CHM file to dialog boxes

Post by Radu »

Hi Tarja,

Oxygen uses a bundled version of the DITA Open Toolkit open-source publishing engine for publishing DITA content to various output formats.
The XSLT stylesheet which generates the HHP file is this one:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\org.dita.htmlhelp\xsl\map2htmlhelp\map2hhpImpl.xsl

so you may want to try and modify it according to your needs.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Tarja Koski
Posts: 4
Joined: Wed Apr 25, 2018 2:24 pm

Re: Connecting CHM file to dialog boxes

Post by Tarja Koski »

Thank you, Radu

I could not yet find where to set the variables $HELPALIAS and $HELPMAP which are used in the map2hhpImpl.xsl file. Can they be set in the Oxygen's user interface? I tried to configure the DITA map CHM transformation by adding new parameters, but it does not seem to work that way.

However, when I edited the map2hhpImpl.xsl file directly by adding the necessary #include lines, it works. I guess I can live with that :-)

Thank you!
Tarja Koski / Vertex Systems Oy
Radu
Posts: 9057
Joined: Fri Jul 09, 2004 5:18 pm

Re: Connecting CHM file to dialog boxes

Post by Radu »

Hi Tarja,

With more modifications it is possible also to pass parameters from the outside.
This ANT build file OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT2.x\plugins\org.dita.htmlhelp\build_dita2htmlhelp.xml has a target called dita.map.htmlhelp.hhp which starts an <xslt> task with the main "map2hhp.xsl" which will use in its turn the map2hhpImpl.xsl.
You can add inside the <xslt> task another parameter declaration:

Code: Select all

<param name="HELPALIAS" expression="${HELPALIAS}" if="HELPALIAS"/>
meaning that if in the transformation scenario parameters list you set a new parameter called HELPALIAS with a value, it will be passed to the XSLT stylesheet.
The XSLT stylesheet needs to declare at the top level the parameter as an <xsl:param name="HELPALIAS"/> and then to use it with <xsl:value-of select="$HELPALIAS"/>

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Tarja Koski
Posts: 4
Joined: Wed Apr 25, 2018 2:24 pm

Re: Connecting CHM file to dialog boxes

Post by Tarja Koski »

Hi, Radu
That works nicely. I even managed to get two file names included in the [MAP] section by creating a new parameter HELPMAP2.
Thanks very much for your help!

Tarja Koski / Vertex Systems Oy
Post Reply