using-dita-command.dita 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA General Task//EN" "generaltask.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <task id="using-command-line-tool">
  5. <title>Building output using the <cmdname>dita</cmdname> command</title>
  6. <shortdesc>You can generate output using the <cmdname>dita</cmdname> command-line tool. Build parameters can be
  7. specified on the command line or with <filepath>.properties</filepath> files.</shortdesc>
  8. <prolog>
  9. <metadata>
  10. <keywords>
  11. <indexterm>macOS<indexterm><cmdname>dita</cmdname> command</indexterm></indexterm>
  12. <indexterm>Linux<indexterm><cmdname>dita</cmdname> command</indexterm></indexterm>
  13. <indexterm>Windows<indexterm><cmdname>dita</cmdname> command</indexterm></indexterm>
  14. <indexterm><cmdname>dita</cmdname> command<indexterm>using</indexterm></indexterm>
  15. </keywords>
  16. </metadata>
  17. </prolog>
  18. <taskbody>
  19. <context audience="novice">The DITA-OT client is a command-line tool with no graphical user interface. To verify
  20. that your installation works correctly, you can build output using the sample files included in the distribution
  21. package.</context>
  22. <steps>
  23. <step audience="novice">
  24. <cmd>Open a terminal window by typing the following in the search bar:</cmd>
  25. <info>
  26. <ul>
  27. <li platform="linux mac">On Linux and macOS, type <userinput>Terminal</userinput>.</li>
  28. <li platform="windows">On Windows, type <userinput>Command Prompt</userinput>.</li>
  29. </ul>
  30. </info>
  31. </step>
  32. <step>
  33. <cmd>At the command-line prompt, enter the following command:</cmd>
  34. <info><codeblock><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <parmname>--input</parmname>=<varname>input-file</varname> <parmname>--format</parmname>=<varname>format</varname> <ph audience="expert">[<varname>options</varname>]</ph></codeblock>
  35. <p>where:</p>
  36. <ul>
  37. <li conref="../resources/conref-task.dita#ID/novice-variables-1"
  38. conrefend="../resources/conref-task.dita#ID/novice-variables-last" audience="novice"/>
  39. <li conref="../resources/conref-task.dita#ID/novice-variables-1"
  40. conrefend="../resources/conref-task.dita#ID/novice-variables-2" audience="expert"/>
  41. <li conref="../resources/conref-task.dita#ID/expert-variables-last" audience="expert"/>
  42. <li conref="../resources/conref-task.dita#ID/options" audience="expert"/>
  43. </ul></info>
  44. <stepresult conref="../resources/conref-task.dita#ID/running-ditaot-results"/>
  45. </step>
  46. </steps>
  47. <example audience="novice">
  48. <p>Run from <filepath conref="../resources/conref-task.dita#ID/samples-dir"/>, the following command generates
  49. HTML5 output for the <filepath>sequence.ditamap</filepath> file:</p>
  50. <codeblock><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <parmname>--input</parmname>=<filepath>sequence.ditamap</filepath> <parmname>--format</parmname>=<option>html5</option></codeblock>
  51. <indexterm>DITA maps<indexterm><cmdname>dita</cmdname> command example</indexterm></indexterm>
  52. </example>
  53. <example audience="expert">
  54. <p>For example, from <filepath conref="../resources/conref-task.dita#ID/samples-dir"/>, run:</p>
  55. <p>
  56. <codeblock><cmdname>dita</cmdname> <parmname>--input</parmname>=<filepath>sequence.ditamap</filepath> <parmname>--format</parmname>=<option>html5</option> \
  57. <parmname>--output</parmname>=<filepath>output/sequence</filepath> \
  58. <parmname>--args.input.dir</parmname>=<filepath conref="../resources/conref-task.dita#ID/samples-dir"/> \
  59. <parmname>--propertyfile</parmname>=<filepath>properties/sequence-html5.properties</filepath></codeblock>
  60. </p>
  61. <p>This builds <filepath>sequence.ditamap</filepath> to HTML5 output in <filepath>output/sequence</filepath> using
  62. the following additional parameters specified in the <filepath>properties/sequence-html5.properties</filepath>
  63. file:</p>
  64. <p>
  65. <codeblock outputclass="language-properties normalize-space show-line-numbers show-whitespace"><coderef href="../samples/properties/sequence-html5.properties"/></codeblock>
  66. </p>
  67. <indexterm>DITA maps<indexterm><cmdname>dita</cmdname> command example</indexterm></indexterm>
  68. </example>
  69. <postreq>
  70. <p audience="novice">Most builds require you to specify more options than are described in this topic.</p>
  71. <p audience="expert">Usually, you will want to specify a set of reusable build parameters in a
  72. <filepath>.properties</filepath> file.</p>
  73. </postreq>
  74. </taskbody>
  75. </task>