build_dita2xhtml.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?xml version="1.0" encoding="UTF-8"?><!-- (c) Copyright IBM Corp. 2006 All Rights Reserved. hosted on
  2. Sourceforge.net. See the accompanying license.txt file for
  3. applicable licenses.--><!-- (c) Copyright IBM Corp. 2006 All Rights Reserved. --><project xmlns:dita="http://dita-ot.sourceforge.net" name="dita2xhtml">
  4. <target name="dita2xhtml.init">
  5. <property name="html-version" value="xhtml"/>
  6. </target>
  7. <target name="dita2xhtml" depends="dita2xhtml.init, build-init, preprocess, xhtml.topics, dita.map.xhtml, copy-css">
  8. </target>
  9. <target name="dita.map.xhtml" depends="dita.map.xhtml.init, dita.map.xhtml.toc"/>
  10. <target name="dita.map.xhtml.init" unless="noMap">
  11. <condition property="args.xhtml.toc.xsl" value="${dita.plugin.org.dita.xhtml.dir}/xsl/map2${html-version}-cover.xsl">
  12. <not>
  13. <isset property="args.xhtml.toc.xsl"/>
  14. </not>
  15. </condition>
  16. <condition property="args.xhtml.toc" value="index">
  17. <not>
  18. <isset property="args.xhtml.toc"/>
  19. </not>
  20. </condition>
  21. </target>
  22. <target name="dita.map.xhtml.toc" unless="noMap" description="Build HTML TOC file">
  23. <map.html>
  24. </map.html>
  25. </target>
  26. <macrodef name="map.html">
  27. <element name="params" optional="true" implicit="true"/>
  28. <sequential>
  29. <local name="xhtml.toc.output.dir"/>
  30. <condition property="xhtml.toc.output.dir" value="${output.dir}" else="${_dita.map.output.dir}">
  31. <isset property="inner.transform"/>
  32. </condition>
  33. <xslt basedir="${dita.temp.dir}" destdir="${xhtml.toc.output.dir}" includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}" classpathref="dost.class.path" style="${args.xhtml.toc.xsl}">
  34. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  35. <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
  36. <param name="contenttarget" expression="${args.xhtml.contenttarget}" if="args.xhtml.contenttarget"/>
  37. <param name="CSS" expression="${args.css.file}" if="args.css.file"/>
  38. <param name="CSSPATH" expression="${user.csspath}" if="user.csspath"/>
  39. <param name="OUTPUTCLASS" expression="${args.xhtml.toc.class}" if="args.xhtml.toc.class"/>
  40. <params/>
  41. <mergemapper to="${args.xhtml.toc}${out.ext}"/>
  42. <xmlcatalog refid="dita.catalog"/>
  43. </xslt>
  44. </sequential>
  45. </macrodef>
  46. <!-- Deprecated since 2.1 -->
  47. <target name="dita.out.map.xhtml.toc" unless="noMap" if="inner.transform" description="Build HTML TOC file,which will adjust the directory">
  48. <dita-ot-echo id="DOTX070W"><param name="1" value="dita.out.map.xhtml.toc"/></dita-ot-echo>
  49. <xslt basedir="${dita.temp.dir}" destdir="${output.dir}" includesfile="${dita.temp.dir}${file.separator}${user.input.file.listfile}" classpathref="dost.class.path" style="${args.xhtml.toc.xsl}">
  50. <excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
  51. <param name="OUTEXT" expression="${out.ext}" if="out.ext"/>
  52. <param name="contenttarget" expression="${args.xhtml.contenttarget}" if="args.xhtml.contenttarget"/>
  53. <param name="CSS" expression="${args.css.file}" if="args.css.file"/>
  54. <param name="CSSPATH" expression="${user.csspath}" if="user.csspath"/>
  55. <param name="OUTPUTCLASS" expression="${args.xhtml.toc.class}" if="args.xhtml.toc.class"/>
  56. <mapper type="glob" from="${user.input.file}" to="${args.xhtml.toc}${out.ext}"/>
  57. <xmlcatalog refid="dita.catalog"/>
  58. </xslt>
  59. </target>
  60. <target name="copy-revflag" if="dita.input.valfile">
  61. <dita-ot-echo id="DOTA069W">
  62. <param name="1" value="copy-revflag"/>
  63. </dita-ot-echo>
  64. </target>
  65. <target name="copy-css" unless="user.csspath.url" description="Copy CSS files">
  66. <condition property="user.copycss.yes">
  67. <and>
  68. <equals arg1="${args.copycss}" arg2="yes"/>
  69. <isset property="args.css.present"/>
  70. </and>
  71. </condition>
  72. <property name="user.csspath.real" location="${output.dir}/${user.csspath}"/>
  73. <mkdir dir="${user.csspath.real}"/>
  74. <!-- Always copy system default css files -->
  75. <copy todir="${user.csspath.real}">
  76. <fileset dir="${dita.plugin.org.dita.xhtml.dir}/resource" includes="*.css"/>
  77. </copy>
  78. <!-- Copy user specify css file when required -->
  79. <antcall target="copy-css-user"/>
  80. </target>
  81. <target name="copy-css-user" if="user.copycss.yes">
  82. <copy file="${args.css.real}" todir="${user.csspath.real}"/>
  83. </target>
  84. </project>