project-files-json.dita 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE concept PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
  3. <!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
  4. <concept id="ID">
  5. <title>Sample JSON project files</title>
  6. <titlealts>
  7. <navtitle>JSON project files</navtitle>
  8. </titlealts>
  9. <shortdesc>DITA-OT includes sample project files in
  10. <xref keyref="json"/> format that can be used to define a publication project. Like the XML project samples, the
  11. sample JSON files illustrate how deliverables can be described for use in publication projects. The JSON samples are
  12. functionally equivalent to their XML and YAML counterparts, with minor adaptations to JSON file syntax.</shortdesc>
  13. <prolog>
  14. <metadata>
  15. <keywords>
  16. <indexterm>JSON project files</indexterm>
  17. <indexterm>project files
  18. <indexterm>JSON</indexterm></indexterm>
  19. </keywords>
  20. </metadata>
  21. </prolog>
  22. <conbody>
  23. <p>Project files can be designed in a modular fashion to create reusable configuration structures that allow you to
  24. define settings in one file and refer to them in other projects to publish multiple deliverables at once.</p>
  25. <p>For example, <filepath conkeyref="conref-task/samples-dir"/><filepath>/project-files/html.json</filepath> defines
  26. a single HTML deliverable.</p>
  27. <fig>
  28. <title>Sample project file for HTML output</title>
  29. <codeblock outputclass="language-json normalize-space show-line-numbers show-whitespace"><coderef href="../samples/project-files/html.json"/></codeblock>
  30. </fig>
  31. <p>This file can be used to generate the HTML version of the DITA-OT documentation by running the following command
  32. from the <filepath>docsrc</filepath> folder of the DITA-OT installation directory:</p>
  33. <codeblock><cmdname>dita</cmdname> <parmname>--project</parmname>=<varname>samples/project-files/html.json</varname></codeblock>
  34. <p>The project file for HTML output imports the common <codeph>html</codeph> context from a shared project context
  35. defined in the <filepath conkeyref="conref-task/samples-dir"/><filepath>/project-files/common.json</filepath>
  36. file, which includes the input map file and the DITAVAL file used to filter the output.</p>
  37. <fig>
  38. <title>Sample shared context for HTML-based output</title>
  39. <codeblock outputclass="language-json normalize-space show-line-numbers show-whitespace"><coderef href="../samples/project-files/common.json"/></codeblock>
  40. </fig>
  41. </conbody>
  42. </concept>