Specifying path to custom CSS for DITA XHTML

Having trouble installing Oxygen? Got a bug to report? Post it all here.
rdevriese
Posts: 9
Joined: Thu Feb 11, 2010 11:24 pm

Specifying path to custom CSS for DITA XHTML

Post by rdevriese »

I'm having difficulty figuring out how to specify the path to a custom CSS file to be used to display XHTML. I'm using DITA as the markup. I've created a copy of the XHTML transform from the Configure Transformation Scenario dialog, but can't quite figure out which parameters need to be set. My project structure consists of a project directory, and a 'maps' subdirectory into which I've added a 'custom.css' file. Can someone provide guidance on which parameters need to be set, and to what values?
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by Radu »

Hi,

When you create/edit an XHTML transformation scenario for a DITA Map in Oxygen you can go to the Parameters tab, edit the args.css parameter and set its value to the custom CSS file path.
You can also edit the args.copycss parameter and set it to yes to copy the CSS to the output directory.

If you do that, the CSS file will get copied to the output directory and it will be referenced by all XHTML files created by the XHTML transformation together with the default commonltr.css which gets copied to the output directory by default:

Code: Select all


    <link rel="stylesheet" type="text/css" href="../commonltr.css"/>
<link rel="stylesheet" type="text/css" href="../personal.css"/>
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rdevriese
Posts: 9
Joined: Thu Feb 11, 2010 11:24 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by rdevriese »

Thanks Radu. I was hoping for something even more specific than you posted. Here is my project layout:

<Project Dir>
<maps dir>
project_name.ditamap
custom.css
<Topics>
topic_1.xml
...
topic_n.xml

Here is what I entered for the parameters
args.css = custom.css
args.cssroot = ${pd}/maps/
args.copycss = yes

Obviously, I'm not specifying this correctly, because the custom.css file does not get copied, nor is it added to any of the generated HTML files. Also, I'm using the Eclipse plug in version 11.2

Any help you can provide would be greatly appreciated.
rdevriese
Posts: 9
Joined: Thu Feb 11, 2010 11:24 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by rdevriese »

Sorry, previous post was not formatted correctly. Should have put it inside code box. Here is the corrected information.

Code: Select all


<Project Dir>
<maps dir>
project_name.ditamap
custom.css
<Topics>
topic_1.xml
...
topic_n.xml
Here is what I entered for the parameters

Code: Select all


args.css = custom.css
args.cssroot = ${pd}/maps/
args.copycss = yes
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by Radu »

Hi,

I tested a simple transformation to XHTML using parameters like your own and things seem to work OK.
I see you are using an Oxygen editor variable ${pd}. It gets expanded to the directory where the Oxygen project file (used in the Project view) is located: projectName.xpr. So it does not refer directly to the DITA Map project but to the project loaded in the Project view. Maybe you can use an absolute path for args.cssroot and tell us if it works.

If things still do not work maybe you can send us to our support email address a sample project and the output of the Oxygen console view.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rdevriese
Posts: 9
Joined: Thu Feb 11, 2010 11:24 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by rdevriese »

Radu, how do I check what ${pd} expands to? I've tried numerous settings of these variables, but cannot seem to get it to work. I'm using the Eclipse plug in. Is the OxygenXML project directory the same as the Eclipse project directory, e.g., the directory that contains the .project file?
Radu
Posts: 9055
Joined: Fri Jul 09, 2004 5:18 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by Radu »

Hi,

You mentioned previously in the post that you were using Eclipse but somehow I did not see that.
In Eclipse the ${pd} should get expanded to the directory of the Eclipse project from where the DITA Map was opened.

To see to what path the editor variables expand you can look in the Oxygen console view after executing the transformation. The console view contains the entire command line executed as a separate process. In your case, try to find args.cssroot.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
rdevriese
Posts: 9
Joined: Thu Feb 11, 2010 11:24 pm

Re: Specifying path to custom CSS for DITA XHTML

Post by rdevriese »

Thanks Radu. I finally figure out what the issue was ... somehow I entered a space character at the beginning of the args.css parameter. Your tip about examining the command invocation at the beginning of the log output helped me figure out what was wrong. Its working fine now. Thanks again.
Post Reply