CHM Index customization

Post here questions and problems related to editing and publishing DITA content.
johnordawn
Posts: 2
Joined: Fri Sep 25, 2020 11:23 pm

CHM Index customization

Post by johnordawn »

We need to customize the HHK file of a CHM output so that the file names are determined by the contents of <resourceid> rather than just using the file name. If no <resourceid> exists, the html file saves according to the name of the DITA file, but if a <resourceid> exists it specifies the required name of the file. This was necessary due to a migration of content from another system; the software is looking for a specific file name that was generated out of the old system, but we don't want to keep the non-human readable file names in the new system. So existing topics use the <resourceid> to specify the old file name to use when outputting to the CHM used for context sensitive help. We successfully have all links and the ToC working correctly, but are unable to figure out how to write the correct file names to the HHK file for the index.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: CHM Index customization

Post by Radu »

Hi,

So you want the actual HTML files in the CHM to have file names computed from the resourceid element specified inside the DITA topic, right?
This is a problem which requires time to solve, it's not just a matter of generating a different HHK file, it's a matter of actually creating the HTML files in the first place with different names, and also of updating all internal links which exist between the HTML files to use the new file names.
Something like this is probably feasible but you would need to maybe add some custom processing step implemented maybe in some programming language like Java which goes through all HTML files and changes their names and the links between them, I cannot give you a fast solution for this or a precise sequence of steps.
Maybe you can also register and ask around on the DITA Users List, see if others have had similar use cases:

https://dita-users.groups.io/g/main

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
johnordawn
Posts: 2
Joined: Fri Sep 25, 2020 11:23 pm

Re: CHM Index customization

Post by johnordawn »

Yes, you understand the issue. We've actually already dealt with creating the new names and the linking between files. It is just the index that we can't figure out.

I'll post to DITA Users as you suggest.
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: CHM Index customization

Post by Radu »

Hi,

Sorry, I did not see the part where you said you had already solved the linking and resource renaming.
The ANT build file "OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT3.x/plugins/org.dita.htmlhelp/build_dita2htmlhelp.xml" has a target "dita.map.htmlhelp.hhk" which seems to create the hhk file using some custom Java code. Why don't you add after it an extra target to post process the HHK file?

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply