integrator.xml 3.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <!--
  2. This file is part of the DITA Open Toolkit project.
  3. Copyright 2007 Shawn McKenzie
  4. See the accompanying LICENSE file for applicable license.
  5. -->
  6. <!--
  7. UPDATES:
  8. 20110817 RDA: Several changes:
  9. * Use property dita.plugin.com.sophos.tocjs.dir (remove hard-coded demo/ dir)
  10. * Original design only works if $output.file is set in an Ant file, and
  11. if XHTML is created independently. Refactoring to use that original
  12. processing when $output.file is specified; otherwise:
  13. 1) Return HTML files along with navigation
  14. 2) Return default frameset (with name based on map name)
  15. 3) Set $output.file to a default value of toctree.js
  16. 4) Return supporting JS and CSS files for the default frameset
  17. *-->
  18. <project>
  19. <target name="dita2tocjs" depends="build-init, preprocess, tocjsInit, map2tocjs, topic2tocjs, tocjsDefaultOutput">
  20. </target>
  21. <target name="tocjsInit">
  22. <property name="html-version" value="xhtml"/>
  23. <condition property="dita.plugin.com.sophos.tocjs.copydefaults" value="true">
  24. <not>
  25. <isset property="output.file" />
  26. </not>
  27. </condition>
  28. <property name="output.file" value="${dita.output.dir}${file.separator}toctree.js"/>
  29. <property name="out.ext" value=".html"/>
  30. </target>
  31. <target name="topic2tocjs" if="noMap">
  32. <antcall target="dita.map.tocjs">
  33. <!-- No real support for tocjs on a single topic, only for map -->
  34. </antcall>
  35. <echo>The TocJS output type only supports ditamap files as input.</echo>
  36. </target>
  37. <target name="map2tocjs" unless="noMap">
  38. <antcall target="dita.map.tocjs">
  39. <param name="input" value="${dita.temp.dir}${file.separator}${user.input.file}"/>
  40. </antcall>
  41. </target>
  42. <target name="dita.map.tocjs" description="generate merged for tocjs">
  43. <xslt in="${input}" out="${output.file}"
  44. style="${dita.plugin.com.sophos.tocjs.dir}/xsl/tocjs.xsl">
  45. <param name="contentwin" expression="${content.frame}" if="content.frame"/>
  46. <param name="htmlext" expression="${out.ext}"/>
  47. <xmlcatalog refid="dita.catalog"/>
  48. </xslt>
  49. </target>
  50. <target name="tocjsDefaultOutput"
  51. if="dita.plugin.com.sophos.tocjs.copydefaults">
  52. <!-- Create usable output for people trying tocjs for the first time -->
  53. <antcall target="tocjsDefaultXhtmlOutput"/>
  54. <antcall target="tocjsDefaultFrameset"/>
  55. <!-- Copy default JS and related files -->
  56. <copy todir="${dita.output.dir}"><fileset
  57. dir="${dita.plugin.com.sophos.tocjs.dir}${file.separator}basefiles"><include name="**/*"/></fileset></copy>
  58. </target>
  59. <target name="tocjsDefaultXhtmlOutput" depends="copy-revflag, xhtml.topics, copy-css">
  60. <!-- Preprocess has already completed based on original dependencies;
  61. this target continues to XHTML for default output. Seems very
  62. indirect way to create the XHTML, so would like something better,
  63. but do not want to add new XHTML processing for people using
  64. the original dita2tocjs target. -->
  65. </target>
  66. <target name="tocjsDefaultFrameset" if="dita.plugin.com.sophos.tocjs.copydefaults">
  67. <!-- Create the default frameset itself -->
  68. <xslt
  69. basedir="${dita.temp.dir}"
  70. destdir="${dita.output.dir}"
  71. includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}"
  72. extension="${out.ext}"
  73. style="${dita.plugin.com.sophos.tocjs.dir}${file.separator}xsl${file.separator}frameset.xsl">
  74. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  75. <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
  76. <param name="CSSPATH" expression="${CSSPATH}" if="csspath"/>
  77. <xmlcatalog refid="dita.catalog"/>
  78. </xslt>
  79. </target>
  80. </project>