dita2markdown.dita 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <topic id="markdown">
  5. <title>Markdown</title>
  6. <shortdesc>Along with Markdown input, DITA-OT now provides three new transformation types to convert DITA content to
  7. Markdown, including the original syntax, GitHub-Flavored Markdown, and GitBook.</shortdesc>
  8. <body>
  9. <p>The new output formats can be used to feed DITA content into Markdown-based publishing systems or other workflows
  10. that lack the ability to process DITA XML.</p>
  11. <section id="generating-markdown-output">
  12. <title>Generating Markdown output</title>
  13. <p>Markdown output can be generated by passing one of the following transformation types to the dita command with
  14. the <parmname>--format</parmname> option:</p>
  15. <ul>
  16. <li>
  17. <p>To publish Markdown DITA files, use the <option>markdown</option> transtype.</p></li>
  18. <li>
  19. <p>To generate
  20. <xref keyref="gfm-spec"/> files, use the <option>markdown_github</option> transtype.</p></li>
  21. <li>
  22. <p>To publish GitHub-Flavored Markdown and generate a <filepath>SUMMARY.md</filepath> table of contents file
  23. for publication via
  24. <xref format="html" href="https://www.gitbook.com" scope="external">GitBook</xref>, use the
  25. <option>markdown_gitbook</option> transtype.</p></li>
  26. </ul>
  27. <p>Run the <cmdname>dita</cmdname> command and set the value of the output <parmname>--format</parmname> option to
  28. the desired format:</p><codeblock xml:space="preserve"><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <parmname>--input</parmname>=<varname>input-file</varname> <parmname>--format</parmname>=<option>markdown</option></codeblock>
  29. <p>where:</p>
  30. <ul>
  31. <li conref="../resources/conref-task.dita#ID/novice-variables-1"
  32. conrefend="../resources/conref-task.dita#ID/novice-variables-2"/>
  33. </ul></section>
  34. </body>
  35. </topic>