Page 1 of 1

Images in HTML source not copied

Posted: Fri Apr 03, 2020 5:17 am
by syed
Hi,

Some of the topics are in HTML source. There are images being referred from the HTML topics. Regular img tag is used. When generating the WebHelp Responsive output, the images are not copied to the 'out' folder. The images and HTML topics are in folders below the master ditamap level.

Is this expected because the source is HTML or is there a way to copy the images from HTML topics?

Thanks...
Syed

Re: Images in HTML source not copied

Posted: Mon Apr 06, 2020 10:51 am
by radu_pisoi
Hi,

Yes, this is the expected behavior for non DITA resource like HTML. Non DITA resources are not processed by the DITA-OT publishing engine to gather referenced to other resources.

You have two options to copy images referenced in the HTML files to the WebHelp transformation output:
1. Declare images in the DITA map as resource only:

Code: Select all

<topicref href="images/image.jpg" format="jpg" processing-role="resource-only"/>
2. If you store all images in a folder, you can use the webhelp.custom.resources parameter.

You can see more details in the How to Copy Additional Resources to Output Directory topic from our documentation.

Re: Images in HTML source not copied

Posted: Mon Apr 06, 2020 4:00 pm
by syed
Thanks Radu.

Do you know if there is a way to call all the files of a particular format using one topicref? Maybe use a regular expression?

For example

Code: Select all

<topicref href="images/*.jpg" format="jpg" processing-role="resource-only"/>
Syed

Re: Images in HTML source not copied

Posted: Wed Apr 08, 2020 10:38 am
by radu_pisoi
Hi,

No, I don't think the topicref/@href attribute supports regular expressions.

You can read more details in DITA specs:
https://www.oxygenxml.com/dita/1.3/spec ... ibute.html