generate-copy-outer.dita 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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>Handling content outside the map directory</title>
  6. <shortdesc>By default, DITA-OT assumes content is located in or beneath the directory containing the DITA map file.
  7. The <parmname>generate.copy.outer</parmname> parameter can be used to adjust how output is generated for content
  8. that is located outside the map directory.</shortdesc>
  9. <prolog>
  10. <metadata>
  11. <keywords>
  12. <indexterm><parmname>generate.copy.outer</parmname></indexterm>
  13. <indexterm>HTML
  14. <indexterm>files outside map directory</indexterm></indexterm>
  15. <indexterm>DITA maps
  16. <indexterm>relative file locations</indexterm></indexterm>
  17. </keywords>
  18. </metadata>
  19. </prolog>
  20. <conbody>
  21. <section>
  22. <title>Background</title>
  23. <p>This is an issue in the following situations:
  24. <ul>
  25. <li>The DITA map is in a directory that is a peer to directories that contain referenced objects.</li>
  26. <li>The DITA map is in a directory that is below the directories that contain the referenced objects.</li>
  27. </ul></p>
  28. <p>Let’s assume that the directory structure for the DITA content looks like the following:</p>
  29. <p><pre>images/
  30. fig.png
  31. maps/
  32. start.ditamap
  33. topics/
  34. topic.dita</pre></p>
  35. <p>The DITA map is in the <filepath>maps</filepath> directory, the topics are in the <filepath>topics</filepath>
  36. directory, and the images are in the <filepath>images</filepath> directory.</p>
  37. </section>
  38. <section>
  39. <title>Exclude content outside the map directory</title>
  40. <indexterm>index
  41. <index-see-also>entry file</index-see-also></indexterm>
  42. <indexterm>entry file
  43. <indexterm>broken links, reason for</indexterm></indexterm>
  44. <p>Let’s assume that you run the HTML5 transformation. By default, DITA-OT uses the
  45. <parmname>generate.copy.outer</parmname> parameter with a value of <option>1</option>, which means that no
  46. output is generated for content that is located outside the DITA map directory.</p>
  47. <p>You receive only the following output:</p>
  48. <p><pre>index.html
  49. commonltr.css
  50. commonrtl.css</pre></p>
  51. <p>The <filepath>index.html</filepath> file contains the navigation structure, but all the links are broken, since
  52. no HTML files were built for the topics.</p>
  53. <p>How do you fix this? By adjusting the parameter setting to shift the output directory.</p>
  54. </section>
  55. <section>
  56. <title>Shift the output directory to include all content</title>
  57. <p>To preserve the links to referenced topics and images and make it easier to copy the output directory, set the
  58. <parmname>generate.copy.outer</parmname> parameter to <option>3</option>.</p>
  59. <p>Now your output directory structure resembles the structure of the source directory:</p>
  60. <p><pre>images/
  61. fig.png
  62. maps/
  63. index.html
  64. topics/
  65. topic.html
  66. commonltr.css
  67. commonrtl.css</pre></p>
  68. <p>The <filepath>index.html</filepath> file is in the <filepath>maps</filepath> directory, the HTML files for the
  69. topics are in the <filepath>topics</filepath> directory, and the referenced images are in the
  70. <filepath>images</filepath> directory.</p>
  71. <note type="tip">If <parmname>args.csspath</parmname> is not set, the default CSS files (and any custom CSS files
  72. specified via <parmname>args.css</parmname>) will be copied to the root level of the output folder. To copy CSS
  73. files to an output subfolder named <filepath>css</filepath>, set <parmname>args.csspath</parmname> to
  74. <option>css</option>.
  75. <indexterm>CSS
  76. <indexterm>copy to specific location</indexterm></indexterm>
  77. </note>
  78. </section>
  79. </conbody>
  80. </concept>