Page 1 of 1

HTML5 CSS path wrong in output

Posted: Sat May 09, 2020 1:05 am
by ericn
Hi, I have a project that renders fin when I transform the main ditamap, but the CSS links in the HTML do not point to the correct file path when I try to transform one of the child maps.

My main ditamap is at the root of my project, and the child ditamaps are in their respective ChapterNN/<child-map> folders. I have the following paramters set:

args.css = <name of CSS file>
args.cssroot = <absolute path to CSS folder, using ${pd} variable>
args.copycss = yes
generate.copy.outer = 3 (this is required to get the index.html files to point to the correct locations)

The CSS file gets copied to the ${pd}/out/html5 folder. But the links in my HTML files point to the following location:
<link rel="stylesheet" type="text/css" href="commonltr.css"><link rel="stylesheet" type="text/css" href="patc.css">

How can I get the HTML files to point to the correct CSS files?

Eric

Re: HTML5 CSS path wrong in output

Posted: Tue May 12, 2020 8:24 am
by Radu
Hi Eric,

This looks like a bug in the way the DITA Open Toolkit publishing engine computes the path to the custom CSS when the generate.copy.outer is set to "3". If you are publishing from inside Oxygen maybe you can try to set the "fix.external.refs" parameter insted of generate.copy.outer:

https://www.oxygenxml.com/doc/versions/ ... -refs.html

Otherwise I'm not sure what do advice you, if you can come up with a small sample project exhibiting the problem and send us an email (support@oxygenxml.com) I could try to check if the latest DITA OT version (version 3.5) still has this problem and if it does I can open an issue on the DITA OT issues list. As a workaround maybe you can run some kind of regular expression find/replace on the output folder to update the reference to the custom CSS. Or you could try to keep the submaps in the same folder as the main DITA Map, so that all topic references point to resources which are inside the DITA Map folder.

Regards,
Radu