build_dita2xhtml.xml 4.4 KB

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