dita-command-arguments.html 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. <!DOCTYPE html
  2. SYSTEM "about:legacy-compat">
  3. <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 2020"><meta name="DC.rights.owner" content="(C) Copyright 2020"><meta name="DC.type" content="reference"><meta name="description" content="The dita command takes mandatory arguments to process DITA content. Subcommands can be used to manage plug-ins, or print information about the current configuration. A series of options are available to modify the command behavior or specify additional configuration parameters."><meta name="DC.subject" content="filters, command, dita, command, arguments list, arguments, installing, uninstalling, artlbl, args.artlbl"><meta name="keywords" content="filters, command, dita, command, arguments list, arguments, installing, uninstalling, artlbl, args.artlbl"><meta name="DC.relation" scheme="URI" content="../parameters/index.html"><meta name="DC.relation" scheme="URI" content="../topics/build-using-dita-command.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.relation" scheme="URI" content="../topics/using-dita-properties-file.html"><meta name="DC.format" content="HTML5"><meta name="DC.identifier" content="dita-command-properties"><meta name="DC.language" content="en"><link rel="stylesheet" type="text/css" href="../css/commonltr.css"><link rel="stylesheet" type="text/css" href="../css/dita-ot-doc.css"><title>Arguments and options for the dita command</title></head><body id="dita-command-properties"><header role="banner"><div class="header">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </div></header><nav role="toc"><ul><li><a href="../index.html">DITA Open Toolkit 3.5</a></li><li><a href="../release-notes/index.html">Release Notes</a></li><li><a href="../topics/installing-client.html">Installing DITA-OT</a></li><li><a href="../topics/building-output.html">Building output</a></li><li><a href="../topics/input-formats.html">Authoring formats</a></li><li><a href="../topics/output-formats.html">Output formats</a></li><li><a href="../parameters/index.html">Parameters</a><ul><li class="active"><a href="../parameters/dita-command-arguments.html">DITA command arguments</a></li><li><a href="../parameters/parameters_intro.html">DITA-OT parameters</a></li><li><a href="../parameters/configuration-properties.html">Configuration properties</a></li></ul></li><li><a href="../topics/html-customization.html">Customizing HTML</a></li><li><a href="../topics/pdf-customization.html">Customizing PDF</a></li><li><a href="../topics/adding-plugins.html">Adding plug-ins</a></li><li><a href="../topics/custom-plugins.html">Creating plug-ins</a></li><li><a href="../topics/troubleshooting-overview.html">Troubleshooting</a></li><li><a href="../reference/index.html">Reference</a></li><li><a href="../topics/dita-and-dita-ot-resources.html">Resources</a></li></ul></nav><main role="main"><article role="article" aria-labelledby="ariaid-title1">
  7. <h1 class="title topictitle1" id="ariaid-title1">Arguments and options for the <span class="keyword cmdname">dita</span> command</h1>
  8. <div class="body refbody"><p class="shortdesc">The <span class="keyword cmdname">dita</span> command takes mandatory arguments to process DITA content. Subcommands can be
  9. used to manage plug-ins, or print information about the current configuration. A series of options are available to
  10. modify the command behavior or specify additional configuration parameters.</p>
  11. <section class="section"><h2 class="title sectiontitle">Usage</h2>
  12. <p class="p">To convert content from one format to another, specify the file to transform and the desired output format. If
  13. necessary, you can set additional configuration parameters with options.</p>
  14. <div style="display: block; border: 1 black solid; padding: 2pt; color: maroon; margin-bottom: 6pt;">
  15. <div><a name=""></a>
  16. <blockquote>
  17. <kbd><b>dita</b></kbd>
  18. <kbd><b>--input</b></kbd>
  19. <kbd class="ph oper">=</kbd>
  20. <var>file</var>
  21. <kbd><b>--format</b></kbd>
  22. <kbd class="ph oper">=</kbd>
  23. <var>name</var>
  24. [
  25. <var>options</var>
  26. ]
  27. </blockquote>
  28. </div>
  29. <div><a name=""></a>
  30. <blockquote>
  31. <kbd><b>dita</b></kbd>
  32. <kbd><b>--project</b></kbd>
  33. <kbd class="ph oper">=</kbd>
  34. <var>file</var>
  35. [
  36. <var>options</var>
  37. ]
  38. </blockquote>
  39. </div>
  40. </div>
  41. <div class="note note note_note"><span class="note__title">Note:</span> Most <span class="keyword cmdname">dita</span> command options support several syntax alternatives. All options can be
  42. specified with a GNU-style option keyword preceded by two hyphens. In many cases, Unix-style single-letter
  43. options (preceded by a single hyphen) are also available for brevity and backwards compatibility.</div>
  44. <p class="p">The <span class="keyword cmdname">dita</span> command also supports a series of subcommands that can be used to manage plug-ins,
  45. or print information about the current configuration or version.</p>
  46. <div style="display: block; border: 1 black solid; padding: 2pt; color: maroon; margin-bottom: 6pt;">
  47. <div><a name=""></a>
  48. <blockquote>
  49. <kbd><b>dita</b></kbd>
  50. <kbd><b>deliverables</b></kbd>
  51. <var>file</var>
  52. </blockquote>
  53. </div>
  54. <div><a name=""></a>
  55. <blockquote>
  56. <kbd><b>dita</b></kbd>
  57. <kbd><b>install</b></kbd>
  58. [ {
  59. <var>ID</var>
  60. <var> | URL</var>
  61. <var> | file</var>
  62. } ]
  63. </blockquote>
  64. </div>
  65. <div><a name=""></a>
  66. <blockquote>
  67. <kbd><b>dita</b></kbd>
  68. <kbd><b>plugins</b></kbd>
  69. </blockquote>
  70. </div>
  71. <div><a name=""></a>
  72. <blockquote>
  73. <kbd><b>dita</b></kbd>
  74. <kbd><b>transtypes</b></kbd>
  75. </blockquote>
  76. </div>
  77. <div><a name=""></a>
  78. <blockquote>
  79. <kbd><b>dita</b></kbd>
  80. <kbd><b>uninstall</b></kbd>
  81. <var>ID</var>
  82. </blockquote>
  83. </div>
  84. <div><a name=""></a>
  85. <blockquote>
  86. <kbd><b>dita</b></kbd>
  87. <kbd><b>version</b></kbd>
  88. </blockquote>
  89. </div>
  90. </div>
  91. <div class="note attention note_attention"><span class="note__title">Attention:</span> Prior to DITA-OT 3.5, subcommands were specified with the double-hyphen option syntax,
  92. which is still supported for backwards compatibility. (For example, <span class="keyword cmdname">dita</span>
  93. <span class="keyword parmname">--install</span> will still work.)</div>
  94. </section>
  95. <section class="section"><h2 class="title sectiontitle">Arguments</h2>
  96. <p class="p">Each transformation requires you to specify at least the file to transform and the desired output format.</p>
  97. <dl class="dl parml">
  98. <dt class="dt pt dlterm">
  99. <span class="keyword parmname">--input</span>=<var class="keyword varname">file</var></dt>
  100. <dt class="dt pt dlterm">
  101. <span class="keyword parmname">-i</span>
  102. <var class="keyword varname">file</var>
  103. </dt>
  104. <dd class="dd pd" id="dita-command-properties__args.input.desc">Specifies the master file for your documentation project. This argument corresponds
  105. to the common parameter <span class="keyword parmname">args.input</span>. Typically this is a DITA map, however it also can
  106. be a DITA topic if you want to transform a single DITA file. The path can be absolute, relative to
  107. <span class="keyword parmname">args.input.dir</span>, or relative to the current directory if
  108. <span class="keyword parmname">args.input.dir</span> is not defined.</dd>
  109. <dt class="dt pt dlterm">
  110. <span class="keyword parmname">--format</span>=<var class="keyword varname">name</var></dt>
  111. <dt class="dt pt dlterm">
  112. <span class="keyword parmname">-f</span>
  113. <var class="keyword varname">name</var>
  114. </dt>
  115. <dd class="dd pd">Specifies the output format (transformation type).</dd>
  116. <dd class="dd pd ddexpand">This argument corresponds to the common parameter <span class="keyword parmname">transtype</span>.</dd>
  117. <dd class="dd pd ddexpand">To list the formats that are currently available in your environment, use <span class="keyword cmdname">dita
  118. transtypes</span>.</dd>
  119. <dd class="dd pd ddexpand">
  120. <div class="p">You can create plug-ins to add new output formats; by default, the following values are
  121. available:
  122. <ul class="ul">
  123. <li class="li"><span class="keyword option">dita</span></li>
  124. <li class="li"><span class="keyword option">eclipsehelp</span></li>
  125. <li class="li"><span class="keyword option">html5</span></li>
  126. <li class="li"><span class="keyword option">htmlhelp</span></li>
  127. <li class="li"><span class="keyword option">markdown</span>, <span class="keyword option">markdown_gitbook</span>, and
  128. <span class="keyword option">markdown_github</span></li>
  129. <li class="li"><span class="keyword option">pdf</span></li>
  130. <li class="li"><span class="keyword option">xhtml</span></li>
  131. </ul>
  132. <div class="note tip note_tip"><span class="note__title">Tip:</span> See
  133. <a class="xref" href="../topics/output-formats.html" title="DITA Open Toolkit ships with several core transformations that convert DITA content to different output formats. Additional formats are available from the plug-in registry at dita-ot.org/plugins.">DITA-OT transformations (output formats)</a> for sample command line syntax and more information on each
  134. transformation. </div>
  135. </div>
  136. </dd>
  137. </dl>
  138. </section>
  139. <section class="section"><h2 class="title sectiontitle">Subcommands</h2>
  140. <dl class="dl parml">
  141. <dt class="dt pt dlterm">
  142. <span class="keyword parmname">deliverables</span>
  143. <var class="keyword varname">file</var></dt>
  144. <dd class="dd pd">Show a list of the available deliverables in the specified project <var class="keyword varname">file</var>.</dd>
  145. <dt class="dt pt dlterm">
  146. <span class="keyword parmname">install</span>
  147. <var class="keyword varname">{ ID | URL | file }</var></dt>
  148. <dt class="dt pt dlterm">
  149. <span class="keyword parmname">--install</span>=<var class="keyword varname">{ ID | URL | file }</var></dt>
  150. <dd class="dd pd">Install a single plug-in <var class="keyword varname">ID </var>from the registry at
  151. <a class="xref" href="https://www.dita-ot.org/plugins" target="_blank" rel="external noopener">dita-ot.org/plugins</a> (or a local registry), from a remote <var class="keyword varname">URL</var>, or a
  152. local ZIP <var class="keyword varname">file</var>.</dd>
  153. <dt class="dt pt dlterm">
  154. <span class="keyword parmname">install</span>
  155. </dt>
  156. <dt class="dt pt dlterm">
  157. <span class="keyword parmname">--install</span>
  158. </dt>
  159. <dd class="dd pd"><span class="ph">If no <var class="keyword varname">ID</var>, <var class="keyword varname">URL</var>, or
  160. <var class="keyword varname">file</var> argument is provided, the installation process reloads the current set of
  161. plug-ins from the <span class="ph filepath">plugins</span> directory. This approach can be used to add or remove
  162. multiple plug-ins at once, or any individual plug-ins you have already copied to (or removed from) the
  163. <span class="ph filepath">plugins</span> directory. Any plug-ins added or removed in the process will be listed
  164. by their plug-in ID.</span></dd>
  165. <dt class="dt pt dlterm">
  166. <span class="keyword parmname">uninstall</span>
  167. <var class="keyword varname">ID</var>
  168. </dt>
  169. <dt class="dt pt dlterm">
  170. <span class="keyword parmname">--uninstall</span>=<var class="keyword varname">ID</var>
  171. </dt>
  172. <dd class="dd pd">
  173. <p class="p">Remove the plug-in with the specified <var class="keyword varname">ID</var>.</p>
  174. </dd>
  175. <dd class="dd pd ddexpand">For a list of the currently installed plug-in IDs, use <span class="keyword cmdname">dita plugins</span>.</dd>
  176. <dd class="dd pd ddexpand">
  177. <div class="note attention note_attention"><span class="note__title">Attention:</span> The <span class="keyword cmdname">uninstall</span> subcommand also
  178. removes the corresponding plug-in directory from the <span class="ph filepath">plugins</span> folder.
  179. </div>
  180. </dd>
  181. <dt class="dt pt dlterm">
  182. <span class="keyword parmname">plugins</span>
  183. </dt>
  184. <dt class="dt pt dlterm">
  185. <span class="keyword parmname">--plugins</span>
  186. </dt>
  187. <dd class="dd pd">Show a list of the currently installed plug-ins.</dd>
  188. <dt class="dt pt dlterm">
  189. <span class="keyword parmname">transtypes</span>
  190. </dt>
  191. <dt class="dt pt dlterm">
  192. <span class="keyword parmname">--transtypes</span>
  193. </dt>
  194. <dd class="dd pd">Show a list of the available output formats (transformation types).</dd>
  195. <dd class="dd pd ddexpand">The entries in this list may be passed as values to the <span class="keyword parmname">--format</span> argument.</dd>
  196. <dt class="dt pt dlterm">
  197. <span class="keyword parmname">version</span>
  198. </dt>
  199. <dt class="dt pt dlterm">
  200. <span class="keyword parmname">--version</span>
  201. </dt>
  202. <dd class="dd pd">Print version information and exit.</dd>
  203. </dl>
  204. </section>
  205. <section class="section"><h2 class="title sectiontitle">Options</h2>
  206. <dl class="dl parml" id="dita-command-properties__dita_build_options">
  207. <dt class="dt pt dlterm">
  208. <span class="keyword parmname">--debug</span></dt>
  209. <dt class="dt pt dlterm">
  210. <span class="keyword parmname">-d</span>
  211. </dt>
  212. <dd class="dd pd">Debug logging prints considerably more additional information. The debug log includes all information from
  213. the verbose log, plus details on Java classes, additional Ant properties and overrides, preprocessing
  214. filters, parameters, and stages, and the complete build sequence. Debug logging requires additional
  215. resources and can slow down the build process, so it should only be enabled when further details are
  216. required to diagnose problems.</dd>
  217. <dt class="dt pt dlterm">
  218. <span class="keyword parmname">--output</span>=<var class="keyword varname">dir</var></dt>
  219. <dt class="dt pt dlterm">
  220. <span class="keyword parmname">-o</span>
  221. <var class="keyword varname">dir</var>
  222. </dt>
  223. <dd class="dd pd" id="dita-command-properties__output.dir.desc">
  224. <p class="p">Specifies the path of the output directory; the path can be absolute or relative to the current
  225. directory.</p>
  226. <p class="p">This argument corresponds to the common parameter <span class="keyword parmname">output.dir</span>. By default, the output
  227. is written to the <span class="ph filepath">out</span> subdirectory of the current directory.</p>
  228. </dd>
  229. <dt class="dt pt dlterm">
  230. <span class="keyword parmname">--filter</span>=<var class="keyword varname">files</var>
  231. </dt>
  232. <dd class="dd pd">Specifies filter file(s) used to include, exclude, or flag content. </dd>
  233. <dd class="dd pd ddexpand">
  234. <p class="p">This argument corresponds to the common parameter <span class="keyword parmname">args.filter</span>. Relative paths are
  235. resolved against the current directory and internally converted to absolute paths.</p>
  236. <div class="note note note_note"><span class="note__title">Note:</span>
  237. <p class="p">To specify multiple filter files, use the system path separator character to delimit individual file
  238. paths (semicolon ‘<code class="ph codeph">;</code>’ on Windows, and colon ‘<code class="ph codeph">:</code>’ on macOS and Linux) and
  239. wrap the value in quotes:</p>
  240. <p class="p"><code class="ph codeph">--filter="filter1.ditaval;filter2.ditaval;filter3.ditaval"</code></p>
  241. <p class="p">DITAVAL files are evaluated in the order specified, so conditions specified in the first file take
  242. precedence over matching conditions specified in later files, just as conditions at the start of a
  243. DITAVAL document take precedence over matching conditions later in the same document.</p>
  244. </div>
  245. </dd>
  246. <dt class="dt pt dlterm">
  247. <span class="keyword parmname">--force</span>
  248. </dt>
  249. <dd class="dd pd">Force-install an existing plug-in.</dd>
  250. <dd class="dd pd ddexpand">Passed as an additional option to the installation subcommand: <span class="keyword cmdname">dita
  251. install</span>&nbsp;<var class="keyword varname">plug-in-zip</var>&nbsp;<span class="keyword parmname">--force</span></dd>
  252. <dt class="dt pt dlterm">
  253. <span class="keyword parmname">--help</span></dt>
  254. <dt class="dt pt dlterm">
  255. <span class="keyword parmname">-h</span>
  256. </dt>
  257. <dd class="dd pd">Print a list of available arguments, options, and subcommands.</dd>
  258. <dt class="dt pt dlterm">
  259. <span class="keyword parmname">--logfile</span>=<var class="keyword varname">file</var></dt>
  260. <dt class="dt pt dlterm">
  261. <span class="keyword parmname">-l</span>
  262. <var class="keyword varname">file</var>
  263. </dt>
  264. <dd class="dd pd">Write logging messages to a file.</dd>
  265. <dt class="dt pt dlterm">
  266. <span class="keyword parmname">--parameter</span>=<var class="keyword varname">value</var></dt>
  267. <dt class="dt pt dlterm">
  268. <span class="keyword parmname">-D</span><var class="keyword varname">parameter</var>=<var class="keyword varname">value</var>
  269. </dt>
  270. <dd class="dd pd">Specify a value for a DITA-OT or Ant build parameter.
  271. <p class="p">The GNU-style <span class="keyword parmname">--parameter</span>=<var class="keyword varname">value</var> form is only available for
  272. parameters that are configured in the plug-in configuration file; the Java-style <span class="keyword parmname">-D</span>
  273. form can also be used to specify additional non-configured parameters or set system properties.</p>
  274. <p class="p">Parameters not implemented by the specified transformation type or referenced in a
  275. <span class="ph filepath">.properties</span> file are ignored.</p>
  276. <div class="note tip note_tip"><span class="note__title">Tip:</span> If you are building in different environments where the location of the input
  277. files is not consistent, set <span class="keyword option">args.input.dir</span> with the <span class="keyword cmdname">dita</span> command and
  278. reference its value with <code class="ph codeph">${args.input.dir}</code> in your <span class="ph filepath">.properties</span> file.
  279. </div></dd>
  280. <dt class="dt pt dlterm">
  281. <span class="keyword parmname">--propertyfile</span>=<var class="keyword varname">file</var>
  282. </dt>
  283. <dd class="dd pd">Use build parameters defined in the referenced <span class="ph filepath">.properties</span> file.
  284. <p class="p">Build parameters specified on the command line override those set in the <span class="ph filepath">.properties</span>
  285. file.</p></dd>
  286. <dt class="dt pt dlterm">
  287. <span class="keyword parmname">--resource</span>=<var class="keyword varname">file</var>
  288. </dt>
  289. <dt class="dt pt dlterm">
  290. <span class="keyword parmname">-r</span>
  291. <var class="keyword varname">file</var>
  292. </dt>
  293. <dd class="dd pd">Process input with additional resources.
  294. <div class="p">For example, to process a single topic file with a map that contains key definitions, use a command like
  295. this:
  296. <pre class="pre codeblock"><code><span class="keyword cmdname">dita</span> <span class="keyword parmname">--input</span>=<span class="ph filepath">topic.dita</span> <span class="keyword parmname">--resource</span>=<span class="ph filepath">keys.ditamap</span> <span class="keyword parmname">--format</span>=<span class="keyword option">html5</span></code></pre>
  297. </div></dd>
  298. <dt class="dt pt dlterm">
  299. <span class="keyword parmname">--temp</span>=<var class="keyword varname">dir</var></dt>
  300. <dt class="dt pt dlterm">
  301. <span class="keyword parmname">-t</span>
  302. <var class="keyword varname">dir</var>
  303. </dt>
  304. <dd class="dd pd">Specifies the location of the temporary directory.</dd>
  305. <dd class="dd pd ddexpand">This argument corresponds to the common parameter <span class="keyword parmname">dita.temp.dir</span>.</dd>
  306. <dt class="dt pt dlterm">
  307. <span class="keyword parmname">--verbose</span></dt>
  308. <dt class="dt pt dlterm">
  309. <span class="keyword parmname">-v</span>
  310. </dt>
  311. <dd class="dd pd">Verbose logging prints additional information to the console, including directory settings, effective
  312. values for Ant properties, input/output files, and informational messages to assist in troubleshooting.</dd>
  313. </dl>
  314. </section>
  315. </div>
  316. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../parameters/index.html" title="You can adjust DITA Open Toolkit behavior via dita command arguments and options, DITA-OT parameter settings, and configuration properties.">DITA Open Toolkit parameters</a></div></div><div class="linklist reltasks"><strong>Related tasks</strong><br><ul class="linklist"><li class="linklist"><a class="link" href="../topics/build-using-dita-command.html" title="You can generate output using the dita command-line tool. Build parameters can be specified on the command line or with .properties files.">Building output using the dita command</a></li><li class="linklist"><a class="link" href="../topics/using-dita-properties-file.html" title="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 .properties file when building output with the dita command. If needed, you can override any parameter by specifying it explicitly as an argument to the dita command.">Setting build parameters with .properties files</a></li></ul></div><div class="linklist relref"><strong>Related reference</strong><br><ul class="linklist"><li class="linklist"><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 --parameter=value syntax or included in build scripts as Ant properties.">DITA-OT parameters</a></li><li class="linklist"><a class="link" href="../parameters/internal-ant-properties.html" title="Reference list of Ant properties used by DITA-OT internally.">Internal Ant properties</a></li></ul></div></nav></article></main></body></html>