Running DITA-OT from command-line tool

The DITA Open Toolkit provides a command-line tool as an alternative for users with little knowledge of Ant. Most parameters available to the Ant builds are also available using the command-line tool.

Important: The command-line tool interface is simply a wrapper around the Ant interface; it takes the simplified parameters as input, converts them to Ant parameters, and then runs an Ant build. This means that applications embedding the toolkit should always invoke Ant directly. For individual builds, the additional Java overhead is minimal, but for repeated or server based builds, it the extra memory usage will become more of an issue.

Running command-line tool

If you are using the "Full Easy Install" package, running the startcmd batch file will set up a build environment for you and put you in the correct directory. If you are not using this method, you must set up all of your tools (Ant, XSLT, FOP, etc) before running the build.

  1. Change into the DITA Open Toolkit installation directory.
  2. On the command-line, enter the following command:
    java -jar lib/dost.jar /i:samples/sequence.ditamap /outdir:out /transtype:xhtml

This particular example calls Ant to build the sample sequence.ditamap file to XHTML. The output is placed in the out/ directory.

Note:
  1. In this example, the character slash preceded by a space is the separator for each parameter.
  2. Currently, the parameters /filter, /ftr, /hdr, and /hdf require an absolute path.
  3. The properties file is saved in the ${args.logdir} directory. The following command provides an example using this properties file:
    ant -propertyfile ${args.logdir}/property.temp
  4. To see a list of all supported parameters from the command-line tool, run the following command with no additional parameters:
    java -jar lib/dost.jar

Supported parameters

See Command-line tool arguments for DITA-OT for supported command-line tool arguments. To get a full list of arguments, run

java -jar lib/dost.jar -help

Command-line help

You can find the version of toolkit and the usage of the command-line from the command line help by using the following commands:
java -jar lib/dost.jar -version
java -jar lib/dost.jar -h        

You can see the brief description of the supported parameters in the command-line window when you type a specified command.