forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ross Gardler <rgard...@apache.org>
Subject Re: DITA plugin
Date Thu, 31 Mar 2005 22:24:06 GMT
Jeff Levitt wrote:
> --- Ross Gardler <rgardler@apache.org> wrote:
> 
>>Jeff Levitt wrote:
>>

...

> So the dita files get transformed to new dita files in
> a temp directory, and those are the dita files that
> get processed by the rest of the xsl files into html,
> pdf, etc.  The preprocess xsl files are located in
> xsl/preprocess/ in the toolkit.  The ant build.xml
> file is used to automatically call the preprocessing
> and then the general processing using the correct xsl
> files for each output.

OK, I've had a look at the build files. The preprocessing stage is 
actually optional. There are some things that don't work if you don't do 
it (like conrefs whatever they are).

So, I propose that for this first instance we ignore the preprocessing 
step and just focus on getting the files into a forrest site.

I'm done for the night now so here's where I am up to. I should get time 
to look at this again in a few days time. In the meantime if you want to 
have a go at getting started, I (and others) will be glad to answer 
questions.

----

It seems that this will not be just one plugin, it will be two. One (an 
internal plugin) to generate the site.xml (or book.xml) files and one 
(and input plugin) to generate the XDocs.


The Dita Toolkit provides a set of XSL sheet sfor building HTML or PDF 
from DITA files. Since we do our own PDF generation we'll focus on the HTML.

Ignoring the preprocess stage for now, there are two important targets:

dita.map.xhtml Target
---------------------

This target is in ditatargets.xml

This appears to be the target that creates the table of contents:

<xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
		includes="${dita.input}"
		style="${dita.script.dir}${file.separator}map2htmtoc.xsl">
   <param name="DITAEXT" expression="${dita.extname}" if="dita.extname"/>
   <mapper type="glob" from="*${dita.input.filename}" 
to="*${args.xhtml.toc}.html"/>
</xslt>


Since ths is the table of contents, it will create our site.xml and will 
belong in an internal plugin.

Expressed as the beginnings of a Forrest pipeline this is:

<map:match pattern="site.xml".>
   <map:generate src="?????"/>
   <map:transform src="resources/stylesheets/map2htmtoc.xsl"/>
     <map:parameter name="DITAEXT" value="?????"/>
   </map:transform>
   <map:seriliaze type="xml"/>
</map:match>

FIXME: What file are we generating from here? i.e. what is the DITA 
equivalent to our site.xml

FIXME: What is the parameter DITAEXT for?

dita.topics.xhtml
-----------------

This target is in ditatargets.xml

This target is the "meat" of the transformation. It provides the main 
XSLT transformation:

<xslt processor="trax"
		basedir="${dita.temp.dir}"
		destdir="${output.dir}"
		includes="${fullditatopc.list}"
		extension=".html"
		style="${dita.script.dir}${file.separator}dita2xhtml.xsl">
         <param name="DITAEXT" expression="${dita.extname}" 
if="dita.extname"/>
         <param name="FILTERFILE" expression="${dita.input.valfile}" 
if="dita.input.valfile"/>
         <param name="CSS" expression="${args.css}" if="args.css"/>
         <param name="CSSPATH" expression="${args.csspath}" 
if="args.csspath"/>
         <param name="HDF" expression="${args.hdf}" if="args.hdf"/>
         <param name="HDR" expression="${args.hdr}" if="args.hdr"/>
         <param name="FTR" expression="${args.ftr}" if="args.ftr"/>
         <param name="DRAFT" expression="${args.draft}" if="args.draft"/>
         <param name="ARTLBL" expression="${args.artlbl}" if="args.artlbl"/>
</xslt>

This is what will provide our internal formats and so this belongs in an 
input plugin.

Expressed as the beginnings of a Forrest pipeline this is:

<map:match pattern="**.xml".>
   <map:generate src="{1}.xml/>
   <map:transform src="resources/stylesheets/dita2xhtml.xsl"/>
         <map:parameter name="DITAEXT" expression="?????"/>
         <map:parameter name="FILTERFILE" expression="?????"/>
         <map:parameter name="CSS" expression="?????"/>
         <map:parameter name="CSSPATH" expression="?????"/>
         <map:parameter name="HDF" expression="?????"/>
         <map:parameter name="HDR" expression="?????"/>
         <map:parameter name="FTR" expression="?????"/>
         <map:parameter name="DRAFT" expression="?????"/>
         <map:parameter name="ARTLBL" expression="?????"/>
   </map:transform>
   <map:transform src="{forrest:stylesheets}html2document.xml"/>
   <map:serialize type="xml"/>
</map:match>

I think the thing to do now is test out the many assumptions I have made 
in this document by building a plugin with some of the samples from the 
DITA toolkit. Once we can make that build we can start work on your files.

I notice the DITA toolkit is CPL licensed. I'm pretty sure that this is 
not ASF2 compatible (it requires derivative works to be licensed under 
the CPL. So we can't work on this in ASF repositories. This is not a 
problem from the point of view of the plugin becuase they can be hosted 
anywhere.

I'll create a module at my Burrokeet project (which also uses Forrest ) 
for this plugin unless there is somewhere else you would like to house 
it. Discussion should be kept here though as it is a FOrrest plugin not 
a Burrokeet one.

Ross

Mime
View raw message