build_dita2xhtml_template.xml 5.1 KB

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