| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <!DOCTYPE html
- SYSTEM "about:legacy-compat">
- <html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta charset="UTF-8"><meta name="copyright" content="(C) Copyright 2016"><meta name="DC.rights.owner" content="(C) Copyright 2016"><meta name="DC.Type" content="task"><meta name="description" content="You can generate output using the DITA Open Toolkit dita command-line tool. Build parameters can be specified on the command line or with .properties files."><meta name="DC.Relation" scheme="URI" content="../user-guide/transforming-dita-content.html"><meta name="DC.Relation" scheme="URI" content="../user-guide/build-using-dita-properties-file.html"><meta name="DC.Relation" scheme="URI" content="../user-guide/build-migrating-ant-to-dita.html"><meta name="DC.Relation" scheme="URI" content="../parameters/dita-command-arguments.html"><meta name="DC.Relation" scheme="URI" content="../parameters/parameters_intro.html"><meta name="DC.Relation" scheme="URI" content="../parameters/internal-ant-properties.html"><meta name="DC.Format" content="XHTML"><meta name="DC.Identifier" content="using-command-line-tool"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Building output using the dita command</title></head><body id="using-command-line-tool"><header role="banner"><div class="header">
- <p>DITA Open Toolkit</p>
- <hr>
- </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 2.3</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../getting-started/index.html">Getting Started</a></li><li><a href="../user-guide/index.html">User Guide</a><ul><li><a href="../user-guide/transforming-dita-content.html">Publishing DITA content</a><ul><li class="active"><a href="../user-guide/build-using-dita-command.html">Using the dita command</a><ul><li><a href="../user-guide/build-using-dita-properties-file.html">Using a properties file</a></li><li><a href="../user-guide/build-migrating-ant-to-dita.html">Migrating Ant builds</a></li></ul></li><li><a href="../user-guide/publishing-with-ant.html">Using Ant</a></li></ul></li><li><a href="../user-guide/AvailableTransforms.html">Output formats</a></li><li><a href="../user-guide/DITA_spec-support.html">DITA specification support</a></li><li><a href="../user-guide/DITA-globalization.html">Globalizing DITA content</a></li><li><a href="../user-guide/troubleshooting-overview.html">Troubleshooting</a></li></ul></li><li><a href="../parameters/index.html">Parameter Reference</a></li><li><a href="../dev_ref/index.html">Developer Reference</a></li><li><a href="../user-guide/dita-and-dita-ot-resources.html">DITA Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
- <h1 class="title topictitle1" id="ariaid-title1">Building output using the <span class="keyword cmdname">dita</span> command</h1>
-
- <div class="body taskbody"><p class="shortdesc">You can generate output using the DITA Open Toolkit <span class="keyword cmdname">dita</span> command-line tool. Build
- parameters can be specified on the command line or with <span class="ph filepath">.properties</span> files.</p>
-
- <div class="tasklabel"><h2 class="sectiontitle tasklabel">Procedure</h2></div><div class="li step p">
- <span class="ph cmd">At the command-line prompt, enter the following command:</span>
- <div class="itemgroup info"><pre class="pre codeblock"><code><span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/bin/<span class="keyword cmdname">dita</span></span> <span class="keyword option">-input</span> <var class="keyword varname">input-file</var> <span class="keyword option">-format</span> <var class="keyword varname">format</var> <var class="keyword varname">options</var></code></pre>
- <p class="p">where:</p>
- <ul class="ul">
- <li class="li"><span class="ph filepath"><var class="keyword varname">dita-ot-dir</var></span> is the DITA-OT installation directory.</li><li class="li"><var class="keyword varname">input-file</var> is the DITA map or DITA file that you want to process.</li><li class="li"><var class="keyword varname">format</var> is the output format (transformation type). Use the
- same values available for the <span class="keyword parmname">transtype</span> build parameter, for example,
- <code class="ph codeph">html5</code> or <code class="ph codeph">pdf</code>.</li>
- <li class="li"><var class="keyword varname">options</var> include the following optional build parameters:<dl class="dl parml">
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-o</span>, <span class="keyword parmname">-output</span>
- <var class="keyword varname">dir</var></dt>
- <dd class="dd pd" id="using-command-line-tool__d21e286">Specifies the path of the output directory; the path can be
- absolute or relative to the current directory. By default, the output is written to the
- <span class="ph filepath">out</span> subdirectory of the current directory.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-filter</span>
- <var class="keyword varname">file</var></dt>
- <dd class="dd pd">Specifies a filter file to be used to include, exclude, or flag content.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-t</span>, <span class="keyword parmname">-temp</span>
- <var class="keyword varname">dir</var></dt>
- <dd class="dd pd">Specifies the location of the temporary directory.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-v</span>, <span class="keyword parmname">-verbose</span></dt>
- <dd class="dd pd">Verbose logging.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-d</span>, <span class="keyword parmname">-debug</span></dt>
- <dd class="dd pd">Debug logging.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-l</span>, <span class="keyword parmname">-logfile</span>
- <var class="keyword varname">file</var></dt>
- <dd class="dd pd">Write logging messages to a file.</dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-D</span><var class="keyword varname">parameter</var>=<var class="keyword varname">value</var></dt>
- <dd class="dd pd">Specify a value for a DITA-OT or Ant build parameter. <p class="p">Parameters not implemented by
- the specified transformation type or referenced in a <span class="ph filepath">.properties</span>
- file are ignored.</p><div class="note tip note_tip"><span class="note__title tiptitle">Tip:</span> If you are building in different environments where the location of the input
- files is not consistent, set <span class="keyword option">args.input.dir</span> with the <span class="keyword cmdname">dita</span> command and
- reference its value with <code class="ph codeph">${args.input.dir}</code> in your <span class="ph filepath">.properties</span>
- file.</div></dd>
-
-
- <dt class="dt pt dlterm"><span class="keyword parmname">-propertyfile</span>
- <var class="keyword varname">file</var></dt>
- <dd class="dd pd">Use build parameters defined in the referenced <span class="ph filepath">.properties</span> file.
- <p class="p">Build parameters specified on the command line override those set in the
- <span class="ph filepath">.properties</span> file.</p></dd>
-
- </dl></li>
- </ul></div>
- <div class="itemgroup stepresult">
- <p class="p">If processing is successful, nothing is printed in the terminal window. The built output is written to the
- specified output directory (by default, in the <span class="ph filepath">out</span> subdirectory of the current
- directory).</p>
- <div class="note tip note_tip" id="using-command-line-tool__d8e151"><span class="note__title tiptitle">Tip:</span> Add the absolute path for <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var></span><span class="ph filepath">/bin</span> to the <var class="keyword varname">PATH</var> environment variable to run the
- <span class="keyword cmdname">dita</span> command from any location on the file system without typing the path.</div>
- </div>
- </div>
-
- <div class="example"><div class="tasklabel"><h2 class="sectiontitle tasklabel">Example</h2></div>
- <p class="p">For example, from <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span>, run:</p>
- <pre class="pre codeblock"><code>dita <span class="keyword option">-input</span> sequence.ditamap <span class="keyword option">-format</span> html5 \
- <span class="keyword option">-output</span> output/sequence \
- <span class="keyword option">-D</span>args.input.dir=<span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span> \
- <span class="keyword option">-propertyfile</span> properties/sequence-html5.properties</code></pre>
- <p class="p">This builds <span class="ph filepath">sequence.ditamap</span> to HTML5 output in <span class="ph filepath">output/sequence</span> using
- the additional parameters specified in the <span class="ph filepath">properties/sequence-html5.properties</span> file:</p>
- <pre class="pre codeblock"><code>args.gen.task.lbl = NO
- args.cssroot = ${args.input.dir}/css/
- args.css = style.css
- args.copycss = yes
- args.csspath = branding
- nav-toc = full
- args.xhtml.toc = toc</code></pre>
- </div>
- <section class="section postreq"><div class="tasklabel"><h2 class="sectiontitle tasklabel">What to do next</h2></div>
-
- <p class="p">Usually, you will want to specify a set of reusable build parameters in a
- <span class="ph filepath">.properties</span> file.</p>
- </section>
- </div>
- <nav role="navigation" class="related-links"><ul class="ullinks"><li class="link ulchildlink"><strong><a href="../user-guide/build-using-dita-properties-file.html">Setting build parameters with .properties files</a></strong><br>Usually, DITA builds require setting a number of parameters that do not change frequently. You can reference a set of build parameters defined in a <span class="ph filepath">.properties</span> file when building output with the <span class="keyword cmdname">dita</span> command. If needed, you can override any parameter by specifying it explicitly as an argument to the <span class="keyword cmdname">dita</span> command.</li><li class="link ulchildlink"><strong><a href="../user-guide/build-migrating-ant-to-dita.html">Migrating Ant builds to use the dita command</a></strong><br>Although Ant builds are still supported in the DITA Open Toolkit, you might want to switch to use the new <span class="keyword cmdname">dita</span> command.</li></ul><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../user-guide/transforming-dita-content.html" title="You can use either the dita command-line tool or Ant to transform DITA content to the various output formats that are supported by the DITA Open Toolkit.">Publishing DITA content</a></div></div><div class="linklist linklist relinfo relref"><strong>Related reference</strong><br><div><a class="link" href="../parameters/dita-command-arguments.html" title="The dita command takes mandatory arguments to process DITA content, manage plug-ins, or print information about the command. Options can be used to modify the command behavior or specify additional configuration parameters.">Arguments and options for the dita command</a></div><div><a class="link" href="../parameters/parameters_intro.html" title="Certain parameters apply to all DITA-OT transformations. Other parameters are common to the HTML-based transformations. Some parameters apply only to specific transformation types. These parameters can be passed as options to the dita command using the -Dparameter-name=value syntax or included in build scripts as Ant properties.">DITA-OT parameters</a></div><div><a class="link" href="../parameters/internal-ant-properties.html" title="Reference list of Ant properties used by DITA-OT internally.">Internal Ant properties</a></div></div></nav></article></main></body></html>
|