using-dita-command.dita 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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.md file for applicable licenses.-->
  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 DITA Open Toolkit <cmdname>dita</cmdname> command-line tool. Build
  7. parameters can be specified on the command line or with <filepath>.properties</filepath> files.</shortdesc>
  8. <taskbody>
  9. <context audience="novice">The DITA-OT client is a command-line tool with no graphical user interface.</context>
  10. <steps>
  11. <step audience="novice">
  12. <cmd>Open a terminal window by typing the following in the search bar:</cmd>
  13. <info>
  14. <ul>
  15. <li>On OS X and Linux, type <userinput>Terminal</userinput>.</li>
  16. <li>On Windows, type <userinput>Command Prompt</userinput>.</li>
  17. </ul>
  18. </info>
  19. </step>
  20. <step>
  21. <cmd>At the command-line prompt, enter the following command:</cmd>
  22. <info><codeblock><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <option>-input</option> <varname>input-file</varname> <option>-format</option> <varname>format</varname> <varname audience="expert">options</varname></codeblock>
  23. <p>where:</p>
  24. <ul>
  25. <li conref="../resources/conref-task.dita#ID/novice-variables-1"
  26. conrefend="../resources/conref-task.dita#ID/novice-variables-last"/>
  27. <li conref="../resources/conref-task.dita#ID/options" audience="expert"/>
  28. </ul></info>
  29. <stepresult conref="../resources/conref-task.dita#ID/running-ditaot-results"/>
  30. </step>
  31. </steps>
  32. <example audience="novice">
  33. <p>Run from <filepath conref="../resources/conref-task.dita#ID/samples-dir"/>, the following command generates
  34. HTML5 output for the <filepath>sequence.ditamap</filepath> file:</p>
  35. <codeblock><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <option>-input</option> sequence.ditamap <option>-format</option> html5</codeblock>
  36. </example>
  37. <example audience="expert">
  38. <p>For example, from <filepath conref="../resources/conref-task.dita#ID/samples-dir"/>, run:</p>
  39. <codeblock>dita <option>-input</option> sequence.ditamap <option>-format</option> html5 \
  40. <option>-output</option> output/sequence \
  41. <option>-D</option>args.input.dir=<filepath conref="../resources/conref-task.dita#ID/samples-dir"/> \
  42. <option>-propertyfile</option> properties/sequence-html5.properties</codeblock>
  43. <p>This builds <filepath>sequence.ditamap</filepath> to HTML5 output in <filepath>output/sequence</filepath> using
  44. the additional parameters specified in the <filepath>properties/sequence-html5.properties</filepath> file:</p>
  45. <codeblock><coderef href="../samples/properties/sequence-html5.properties"/></codeblock>
  46. </example>
  47. <postreq>
  48. <p audience="novice">Most builds require you to specify more options than are described in this topic.</p>
  49. <p audience="expert">Usually, you will want to specify a set of reusable build parameters in a
  50. <filepath>.properties</filepath> file.</p>
  51. </postreq>
  52. </taskbody>
  53. </task>