You can use the Ant build tool to automate builds that use the DITA processes including output for the sample documents provided with DITA.
DITA provides a set of XSLT scripts for producing help output in Eclipse, Java Help, HTML Help, for producing web HTML pages, or for producing PDF. To make it easier to invoke these scripts, the DITA distribution now provides an experimental Ant file that you can use to build the DITA documentation, demos, and samples.
Ant is a Java-based, Open Source tool provided by the Apache Foundation to declare a sequence of build actions. As such, Ant is well suited for document builds as well as development builds.
You don't have to set up a build environment, of course to run the DITA XSLT scripts. To execute the DITA scripts directly, see the .
Note: The following instructions and the associated build.xml
and ditatargets.xml
files are for the Java 1.4.1, Ant 1.6.1, FOP 0.20.5, and Saxon 6.5.3 releases. These instructions are likely to need some adjustment for other versions of these components and for specific environments.
To create an Ant build environment for DITA, you can download and install some Java Open Source components.
bin
and jre\bin
directories under the JDK and the bin
directory under Ant.saxon.jar
library
from the Saxon directory. For FOP, includes the fop.jar
file from the build
subdirectory and the avalon-framework-cvs-20020806.jar
and batik.jar
files from the lib
subdirectory.
In principle, you should not have to add JDK or Ant jar files to the CLASSPATH
,
but if you run into problems, you might want to try that.After you set up your Ant environment, you can build the DITA output. Merely change to the DITA 1.3 distribution directory and execute Ant on the DITA build.xml file.
ant all
The build creates an out
directory and puts the build output in subdirectories that parallel the source directory.
To experiment with DITA, you can modify the DITA sample files and then rebuild that portion of the output. First, you remove that portion of the output by specifying a "clean" target. For instance, to rebuild just the FAQ demo, you can execute
ant clean_faq_demo ant faq_demo
To find out the complete list of targets you can clean and build, look at the name
attributes for the target
elements within the build.xml
file. Or, just enter
ant -projecthelp
You can reuse the targets provided by the ditatargets.xml
file in builds for your own DITA content. Just copy the build.xml
and ditatargets.xml
file into a new directory and edit the build.xml
to specify your DITA files.
Note: To troubleshoot problems in setting up Java, Ant, Saxon, or FOP, you will get better information from the communities for those components than for the DITA community. Of course, if you find issues with the DITA XSLT scripts (or have ideas for improving them), you should engage the DITA community.