Page 1 of 1

Generate single html from the ditamap

Posted: Thu Feb 11, 2010 12:02 am
by altein
Hi,
I noticed that when using the XHTML transformation, each topic is output in its own file. Is there a way of including a toc in every html file (i.e., in its own <div> element)?

Thanks,
Allan

Re: Generate single html from the ditamap

Posted: Thu Feb 11, 2010 10:27 am
by Radu
Hi Allan,

I don't quite understand your question.
From the subject I understand that you want to generate a single XHTML document (similar to the PDF output but in the XHTML form) from the DITA project.
From the topic body I understand that you want to include a table of contents in each of the generated XHTML files.
Which one is it?

Regards,
Radu

Re: Generate single html from the ditamap

Posted: Fri Feb 12, 2010 2:56 pm
by altein
I apologize for the unclarity.
I wanted to know if you could generate a single XHTML document
from the ditamap, like you do when you generate a .pdf file from the ditamap.

Thanks,
Allan

Re: Generate single html from the ditamap

Posted: Fri Feb 12, 2010 3:22 pm
by Radu
Hi Allan,

There is not a builtin transformation in Oxygen which does that but there is a way:
1) Edit the OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\demo\fo\build.xml file, find the target

Code: Select all

<target name="delete.fo2pdf.topic.fo" unless="retain.topic.fo">
and delete its entire content (leaving it empty). This will inhibit the DITA Open Toolkit from removing the output XSL:FO file once the PDF is constructed.

2) Run an IDIOM PDF transformation on the DITA Map.
After the transformation open in Oxygen the "topic.fo" file which will be created in the DITA transformation output folder.

3) There is a free XSLT stylesheet implementation which transforms from XSL:FO to XHTML. You can register on the RenderX website and download it:
http://www.renderx.com/tools/fo2html.html

4) Transform the FO file using the XSL stylesheet and saving the result as the HTML result.

Regards,
Radu

Re: Generate single html from the ditamap

Posted: Wed May 21, 2014 4:11 pm
by dagoss
While this is an older topic, I just wanted to add a better solution to this in case anyone finds it while searching for the same problem.

You can use the chuck attribute on your map to generate a single HTML file for your content:

Code: Select all


<map id="foo" chunk="to-content">
<topicref href="test1.dita"/>
<topicref href="test2.dita"/>
<topicref href="test3.dita"/>
</map>
The TOC is still generated as a separate chunk, but your content will appear all on a single HTML page. Tested with Oxygen 15.2 and DITA-OT 1.7.

Re: Generate single html from the ditamap

Posted: Wed May 21, 2014 4:32 pm
by Radu
Hi,

Thanks for updating this forum thread, your solution is the proper one.
I can only blame my suggested workaround at that time on the fact that back then I did not know much about DITA chunking.

Regards,
Radu