using-dita-command.dita 4.6 KB

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