dita2markdown.dita 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. <prolog>
  9. <metadata>
  10. <keywords>
  11. <indexterm>Markdown</indexterm>
  12. <indexterm>transformations<indexterm>Markdown</indexterm></indexterm>
  13. <indexterm>GitHub-Flavored Markdown</indexterm>
  14. <indexterm>GitBook</indexterm>
  15. <indexterm>plug-ins<indexterm>dita2markdown</indexterm></indexterm>
  16. <indexterm>dita2markdown</indexterm>
  17. <indexterm>table of contents<indexterm>Markdown</indexterm></indexterm>
  18. </keywords>
  19. </metadata>
  20. </prolog>
  21. <body>
  22. <p>The new output formats can be used to feed DITA content into Markdown-based publishing systems or other workflows
  23. that lack the ability to process DITA XML.</p>
  24. <section id="generating-markdown-output">
  25. <title>Generating Markdown output</title>
  26. <p>Markdown output can be generated by passing one of the following transformation types to the dita command with
  27. the <parmname>--format</parmname> option:</p>
  28. <ul>
  29. <li>
  30. <p>To publish Markdown DITA files, use the <option>markdown</option> transtype.</p></li>
  31. <li>
  32. <p>To generate
  33. <xref keyref="gfm-spec"/> files, use the <option>markdown_github</option> transtype.</p></li>
  34. <li>
  35. <p>To publish GitHub-Flavored Markdown and generate a <filepath>SUMMARY.md</filepath> table of contents file
  36. for publication via
  37. <xref format="html" href="https://www.gitbook.com" scope="external">GitBook</xref>, use the
  38. <option>markdown_gitbook</option> transtype.</p></li>
  39. </ul>
  40. <p>Run the <cmdname>dita</cmdname> command and set the value of the output <parmname>--format</parmname> option to
  41. the desired format, for example:</p>
  42. <codeblock><filepath conref="../resources/conref-task.dita#ID/dita-cmd"/> <parmname>--input</parmname>=<varname>input-file</varname> <parmname>--format</parmname>=<option>markdown</option></codeblock>
  43. <p>where:</p>
  44. <ul>
  45. <li conref="../resources/conref-task.dita#ID/novice-variables-1"
  46. conrefend="../resources/conref-task.dita#ID/novice-variables-2"/>
  47. </ul></section>
  48. </body>
  49. </topic>