How to Use CSS Styling to Customize WebHelp OutputEdit online
The most common way to customize the look and style of your WebHelp output is to use custom CSS styling. This method can be used to make small, simple styling changes or more advanced, precise changes. To implement the styling in your WebHelp output, you simply need to create the custom CSS file and reference it in your transformation scenario or script. This custom file will be the final CSS to be applied so its content will override the styles in the other pre-existing CSS files.
Using the CSS Inspector to Identify Content for Custom CSS File
You can use your browser's CSS inspector to identify the pertinent code in the current CSS files and you can even make changes directly in the CSS inspector to test the results so that you know exactly what content to use in your custom CSS file.
Referencing the Custom CSS Using Oxygen XML Editor/Author
- Create your custom CSS file.
- Edit the WebHelp transformation
scenario and open the Parameters tab.
- For a DITA transformation, set the
args.cssparameter to the path of your custom CSS file. Also, set theargs.copycssparameter toyesto automatically copy your custom CSS in the output folder when the transformation scenario is processed. - For a DocBook transformation, set the
html.stylesheetparameter to the path of your custom CSS file.
- For a DITA transformation, set the
- Run the WebHelp transformation scenario to generate the output.
Referencing the Custom CSS Using a Script Outside of Oxygen XML Editor/Author
- You must have a valid license for the Oxygen XML WebHelp Plugin (https://www.oxygenxml.com/buy_webhelp.html).
- The Oxygen XML WebHelp Plugin must be installed and integrated for the DITA Open Toolkit or a DocBook XSL Distribution.
- Create your custom CSS file.
- Reference your custom CSS file:
- For DITA transformations, use the
args.cssparameter in your transformation script and set its value to the path of your custom CSS file. Also, set theargs.copycssparameter toyesto automatically copy your custom CSS in the output folder when the transformation scenario is processed. - For DocBook transformations, use the
html.stylesheetparameter in your transformation script and set its value to the path of your custom CSS file.
- For DITA transformations, use the
- Execute the transformation script.
- Windows:
dita.bat -i c:\mySample.ditamap -f webhelp -Dargs.css=c:\myFile.css -Dargs.copycss=yes - Mac OS X/ Linux:
dita -i /mySample.ditamap -f webhelp -Dargs.css=/myFile.css -Dargs.copycss=yes