ditac command-line utility by using examples. You'll
find all the DITA input files used to run the following examples in the
ditac_install_dir/docsrc/manual/
directory.
TipXMLmind DITA Converter has
been integrated to XMLmind XSL Utility
Unlike
ditac, which is a command-line
utility, XMLmind XSL Utility is a graphical tool. It makes it easy
parameterizing the DITA conversion process and then performing document
conversions.![]() Moreover, this graphical tool comes in a Windows,
auto-installable, self-contained, setup.exe distribution(1) which includes Apache
FOP
If you just want to quickly and
easily evaluate all the potential of ditac, you may want to download
XMLmind XSL Utility Evaluation Edition from XMLmind
XSL-FO Converter web site
|
$ ditac -r manual_files out/manual.pdf manual.ditamap
out/ is automatically created if it
does not already exist.-r
manual_files option is needed here only because this manual
references audio and video files and also contains TeX/LaTeX math. However,
specifying this option (or -resources or
-i or -images, which are all aliases of
-r) is generally not needed when converting a DITA
document to any of the XSL-FO based output formats (PDF, DOCX, ODT,
etc).ditac.options file which XSL-FO processor to
use, you'll have to execute:$ ditac -fop /opt/fop/fop -r manual_files \ out/manual.pdf manual.ditamap
$ ditac -xep /opt/xep/xep -r manual_files \ out/manual.pdf manual.ditamap
$ ditac -ahf "C:\AHFv6\AHFCmd.exe" -r manual_files \ out/manual.pdf manual.ditamap
TipNo need to declare
Apache FOP using the -fop command-line
option if you have installed the distribution called
ditac-N_N_N-plus-fop.zip. This distribution contains most
recent Apache FOP
|
$ ditac -r manual_files out/manual.ps manual.ditamap
ditac also allows to convert one
or more topic files rather than a single map or bookmap file:$ ditac -toc \ out/draft.pdf embed1.dita embed2.dita
-toc option. Using the
-toc option when the input file already specifies a TOC
is harmless, so you could as well add a -toc line to your ditac.options
file.ditac.$ ditac -r manual_files out/manual.rtf manual.ditamap
ditac.options file which XSL-FO processor to
use, you'll have to execute:$ ditac -xfc /opt/xfc/fo2rtf -r manual_files \ out/manual.rtf manual.ditamap
fo2rtf (fo2rtf.bat on Windows).
Using this location, ditac infers the locations of
fo2wml, fo2docx and
fo2odt.
WARNINGXMLmind
XSL-FO Converter
|
$ ditac -xfc /opt/xfc/fo2wml -r manual_files out/manual.word.xml manual.ditamap
$ ditac -xfc /opt/xfc/fo2docx -r manual_files out/manual.docx manual.ditamap
$ ditac -xfc /opt/xfc/fo2odt -v -p number all -r manual_files \
out/manual.odt manual.ditamap
ditac to print progress messages on the console.
Recommended when converting large documents.$ ditac -r manual_files -p xsl-resources-directory res \
out/manual/_.html manual.ditamap
ditac are created in
the out/manual/ directory.ditac to
copy all the image, audio, video files referenced by the input DITA
document to out/manual/manual_files/, possibly
converting some image files from a non-supported format (e.g. TIFF) to
a format supported by web browsers (e.g. PNG).
RememberSpecifying the
-r option (or -resources or
-i or -images, which are all aliases
of -r) when generating an output format based on
XHTML/HTML is needed in almost all the use cases. |
ditac to copy all the resources needed by the XSLT
stylesheets (CSS stylesheet, navigation icons, etc) to
out/manual/res/.
RememberSpecifying a value for the xsl-resources-directory
parameter when generating an output format based on XHTML/HTML is
needed in almost all the use cases.
|
out/manual/_.html. In fact, this name is just
used to specify the filename extension of the output files. The actual
basenames of the output files are determined by examining the
chunk and copy-to attributes possibly specified in
the DITA map.
$ ditac -r manual_files -p xsl-resources-directory res \
out/manual/foo.html manual.ditamap
ditac will use "foo" as a basename and you
may end up having some output files called
foo.html, foo-2.html,
foo-3.html, etc. When the basename is specified
as "_", it is the basename of the DITA map which is used.
That is, you may have some output files called
manual.html, manual-2.html,
manual-3.html, etc.-format
option (or -f in its short form). Example:$ ditac -format html \
-r manual_files -p xsl-resources-directory res \
out/manual/_.html manual.ditamap
$ ditac -r manual_files -p xsl-resources-directory res \
-p number all \
-p chain-pages both \
-p chain-topics yes \
-p default-table-width 100% \
out/manual/_.html manual.ditamap
-c in its short form).$ ditac -chunk single \
-r manual_files -p xsl-resources-directory res \
out/manual.html manual.ditamap
$ ditac -format webhelp \
-r manual_files -p xsl-resources-directory res \
webhelp/_.html manual.ditamap
C:\> ditac -r manual_files -p xsl-resources-directory res \
out\manual.chm manual.ditamap
ditac.options file the location of
hhc.exe, you'll have to execute:C:\> ditac -hhc "C:\Program Files\HTML Help Workshop\hhc.exe" \ -r manual_files -p xsl-resources-directory res \ out\manual.chm manual.ditamap
$ ditac -format eclipsehelp \
-r manual_files -p xsl-resources-directory res \
out/com.acme.widget.userguide/_.html manual.ditamap
com.acme.widget.userguide/ in the case of
the above example) to the plugins/ directory of
Eclipse and then use a text or XML editor to modify the generated
output_directory/plugin.xml:<plugin name="EDIT HERE: title of this help"
id="EDIT HERE: unique.id.of.this.plugin"
provider-name="EDIT HERE: author, company or organization"
version="1.0.0">
<extension point="org.eclipse.help.toc">
<toc file="toc.xml" primary="true"/>
</extension>
<extension point="org.eclipse.help.index">
<index file="index.xml"/>
</extension>
</plugin>
plugin.xml, suffice to pass extra XSLT stylesheet
parameters to ditac:$ ditac -format eclipsehelp \
-p plugin-name "ACME Widget User's Guide" \
-p plugin-id com.acme.widget.userguide \
-p plugin-provider "ACME Corp." \
-r manual_files -p xsl-resources-directory res \
out/com.acme.widget.documentation/_.html manual.ditamap
RememberIf you want to see your document by selecting
in Eclipse:
|
$ ditac -r manual_files -p xsl-resources-directory res \
out/manual.epub manual.ditamap
| (1) | Of course, a .zip distribution is also available for platforms other than Windows. |