integrator.xml 3.9 KB

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