Tailoring HTML Help (.CHM) file

This should cover W3C XML Schema, Relax NG and DTD related problems.
JohnFitz
Posts: 3

Tailoring HTML Help (.CHM) file

Fri May 08, 2009 6:41 pm

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
Radu
Posts: 5208

Re: Tailoring HTML Help (.CHM) file

Mon May 11, 2009 10:40 am

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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
lopresti
Posts: 9

Re: Tailoring HTML Help (.CHM) file

Mon Sep 08, 2014 10:11 pm

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
sorin_ristache
Posts: 4144

Re: Tailoring HTML Help (.CHM) file

Tue Sep 09, 2014 10:30 am

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

Return to “XML Schemas”

Who is online

Users browsing this forum: No registered users and 1 guest