Page 1 of 1

Tailoring HTML Help (.CHM) file

Posted: Fri May 08, 2009 6:41 pm
by JohnFitz
I am trying to create custom HTML Help output from DITA. I can create the .CHM file, but I cannot tailor it with a .css file. I have tried a number of .css files, but no luck.

My questions are:-
- What Help compiler should I be using? I am currently using HTML Help Workshop 4.74

- Is there a specific .css file out there I should be using?

- Is this an known issue in 10.2?

Thanks

Re: Tailoring HTML Help (.CHM) file

Posted: Mon May 11, 2009 10:40 am
by Radu
Hi John,

The opened CHM output is split in two parts (the index in the left part and the content in the right part).

I assume you want to style the content.
By default the OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\resource\commonltr.css is copied to the output folder and used to style all the HTML content.

You can create your own CSS starting from the commonltr.css content or including it.
Then in the transformation scenario you have to set the following parameters:
args.copycss to yes
args.css to your_custom_css_file_name.css
args.cssroot to path\to\directory\containing\css\file

Attention: your custom CSS should have a name different than commonltr.css. This is important because the custom CSS file is copied in the output directory after the default CSS file was copied. If they have the same name the ANT copy task copy-css-user from OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\build_preprocess.xml will fail (as it does not have an overwrite="yes" set to it).

So it is best that your custom CSS file has a name different than commonltr.css, imports it relatively and then sets some styles of its own.

If you want to style the index part of the CHM, this does not seem to be supported by default but I can take a look and propose a solution.

Hope this helps.
Regards,
Radu

Re: Tailoring HTML Help (.CHM) file

Posted: Mon Sep 08, 2014 10:11 pm
by lopresti
Thanks for this topic. I have a couple questions, since I think there have been changes to the Open Toolkit since this article was posted.

For example, commonltr.css is no longer stored at OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\resource. It has been moved to a plug-in folder (DITA Open Toolkit Release 1.8 feature #1447), but I don't know which one.

Also, I was able to apply my own CSS when I set the following two parameters:
args.copycss to yes
args.css to your_custom_css_file_name.css

When I set this parameter, my styles do not come across in the output.
args.cssroot to path\to\directory\containing\css\file

Questions: Which plug-in directory stores the commonltr.css for CHM outputs? Is args.cssroot no longer required?

Thanks,
Kate

Re: Tailoring HTML Help (.CHM) file

Posted: Tue Sep 09, 2014 10:30 am
by sorin_ristache
Hi Kate,
lopresti wrote:Questions: Which plug-in directory stores the commonltr.css for CHM outputs? Is args.cssroot no longer required?
You can find the commonltr.css file in directory OXYGEN_INSTALL_DIR_frameworks\dita\DITA-OT\plugins\org.dita.xhtml\resource. args.cssroot is not required, just set the args.csscopy parameter to yes and the args.css parameter to the file path of your custom CSS.


Regards,
Sorin