first-build-using-dita-command.html 7.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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 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="../getting-started/index.html"><meta name="DC.Relation" scheme="URI" content="../getting-started/installing-client.html"><meta name="DC.Relation" scheme="URI" content="../user-guide/build-using-dita-command.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">
  4. <p>DITA Open Toolkit</p>
  5. <hr>
  6. </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><ul><li><a href="../getting-started/installing-client.html">Installing the toolkit</a></li><li class="active"><a href="../getting-started/first-build-using-dita-command.html">Building output</a></li></ul></li><li><a href="../user-guide/index.html">User Guide</a></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">
  7. <h1 class="title topictitle1" id="ariaid-title1">Building output using the <span class="keyword cmdname">dita</span> command</h1>
  8. <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
  9. parameters can be specified on the command line or with <span class="ph filepath">.properties</span> files.</p>
  10. <section class="section context"><div class="tasklabel"><h2 class="sectiontitle tasklabel">About this task</h2></div>The DITA-OT client is a command-line tool with no graphical user interface.</section>
  11. <div class="tasklabel"><h2 class="sectiontitle tasklabel">Procedure</h2></div><ol class="ol steps"><li class="li step stepexpand">
  12. <span class="ph cmd">Open a terminal window by typing the following in the search bar:</span>
  13. <div class="itemgroup info">
  14. <ul class="ul">
  15. <li class="li">On OS X and Linux, type <kbd class="ph userinput">Terminal</kbd>.</li>
  16. <li class="li">On Windows, type <kbd class="ph userinput">Command Prompt</kbd>.</li>
  17. </ul>
  18. </div>
  19. </li><li class="li step stepexpand">
  20. <span class="ph cmd">At the command-line prompt, enter the following command:</span>
  21. <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>&nbsp;<var class="keyword varname">input-file</var> <span class="keyword option">-format</span>&nbsp;<var class="keyword varname">format</var> </code></pre>
  22. <p class="p">where:</p>
  23. <ul class="ul">
  24. <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
  25. same values available for the <span class="keyword parmname">transtype</span> build parameter, for example,
  26. <code class="ph codeph">html5</code> or <code class="ph codeph">pdf</code>.</li>
  27. </ul></div>
  28. <div class="itemgroup stepresult">
  29. <p class="p">If processing is successful, nothing is printed in the terminal window. The built output is written to the
  30. specified output directory (by default, in the <span class="ph filepath">out</span> subdirectory of the current
  31. directory).</p>
  32. <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
  33. <span class="keyword cmdname">dita</span> command from any location on the file system without typing the path.</div>
  34. </div>
  35. </li></ol>
  36. <div class="example"><div class="tasklabel"><h2 class="sectiontitle tasklabel">Example</h2></div>
  37. <p class="p">Run from <span class="ph filepath"><var class="keyword varname">dita-ot-dir</var>/docsrc/samples</span>, the following command generates
  38. HTML5 output for the <span class="ph filepath">sequence.ditamap</span> file:</p>
  39. <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> sequence.ditamap <span class="keyword option">-format</span> html5</code></pre>
  40. </div>
  41. <section class="section postreq"><div class="tasklabel"><h2 class="sectiontitle tasklabel">What to do next</h2></div>
  42. <p class="p">Most builds require you to specify more options than are described in this topic.</p>
  43. </section>
  44. </div>
  45. <nav role="navigation" class="related-links"><div class="familylinks"><div class="parentlink"><strong>Parent topic:</strong> <a class="link" href="../getting-started/index.html" title="Getting Started provides a guided exploration of the DITA Open Toolkit. It is geared for an audience that has little or no knowledge of build scripts or DITA-OT parameters. It walks the novice user through installing the toolkit and building output.">Getting Started with the DITA Open Toolkit</a></div><div class="previouslink"><strong>Previous topic:</strong> <a class="link" href="../getting-started/installing-client.html" title="The DITA-OT distribution package can be installed on Linux, Mac OS&nbsp;X, and Windows. It contains everything that you need to run the toolkit except for Java.">Installing the distribution package</a></div></div><div class="linklist linklist relinfo reltasks"><strong>Related tasks</strong><br><div><a class="link" href="../user-guide/build-using-dita-command.html" title="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.">More information about building output with the <span class="keyword cmdname">dita</span> command</a></div></div></nav></article></main></body></html>