build_dita2html5_template.xml 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- This file is part of the DITA Open Toolkit project.
  3. See the accompanying license.txt file for applicable licenses.-->
  4. <project xmlns:dita="http://dita-ot.sourceforge.net" name="dita2html5">
  5. <target name="dita2html5"
  6. depends="html5.init,
  7. build-init,
  8. preprocess,
  9. html5.topic,
  10. html5.map,
  11. html5.css"/>
  12. <target name="html5.init">
  13. <property name="html-version" value="html5"/>
  14. <condition property="args.xsl" value="${dita.plugin.org.dita.html5.dir}/xsl/dita2html5.xsl">
  15. <not>
  16. <isset property="args.xsl" />
  17. </not>
  18. </condition>
  19. <condition property="args.xhtml.toc.xsl" value="${dita.plugin.org.dita.html5.dir}/xsl/map2html5-cover.xsl">
  20. <not>
  21. <isset property="args.xhtml.toc.xsl" />
  22. </not>
  23. </condition>
  24. <condition property="html5.nav-toc" value="${nav-toc}" else="none">
  25. <isset property="nav-toc"/>
  26. </condition>
  27. </target>
  28. <target name="html5.topic.init" unless="noMap">
  29. <loadfile property="html5.map" srcfile="${dita.temp.dir}/${user.input.file.listfile}">
  30. <filterchain>
  31. <headfilter lines="1"/>
  32. </filterchain>
  33. </loadfile>
  34. <makeurl property="html5.map.url" file="${dita.temp.dir}/${html5.map}"/>
  35. </target>
  36. <target name="html5.topic"
  37. depends="html5.topic.init,
  38. xhtml.init,
  39. xhtml.image-metadata,
  40. dita.topics.html5.common,
  41. dita.inner.topics.html5.common"/>
  42. <target name="dita.topics.html5.common" unless="noTopic" if="old.transform">
  43. <topics.html>
  44. <dita:extension id="dita.conductor.html5.param" behavior="org.dita.dost.platform.InsertAction"/>
  45. </topics.html>
  46. </target>
  47. <target name="dita.inner.topics.html5.common" unless="noTopic" if="inner.transform">
  48. <topics.html>
  49. <dita:extension id="dita.conductor.html5.param" behavior="org.dita.dost.platform.InsertAction"/>
  50. <!--New,To generate&copy all dita files in the inputmap.dir,not all files in dita.temp.dir -->
  51. <mapper type="regexp"
  52. from="^(${tempdirToinputmapdir.relative.value})(.*?)(\.(\w+))$$"
  53. to="\2${out.ext}"/>
  54. </topics.html>
  55. </target>
  56. <target name="html5.map"
  57. depends="dita.map.xhtml.init,
  58. dita.map.html5.toc"/>
  59. <target name="dita.map.html5.toc"
  60. unless="noMap"
  61. description="Build HTML5 TOC file">
  62. <map.html>
  63. <dita:extension id="dita.conductor.html5.toc.param" behavior="org.dita.dost.platform.InsertAction"/>
  64. </map.html>
  65. </target>
  66. <target name="html5.css" unless="user.csspath.url" description="Copy CSS files">
  67. <condition property="user.copycss.yes">
  68. <and>
  69. <equals arg1="${args.copycss}" arg2="yes"/>
  70. <isset property="args.css.present"/>
  71. </and>
  72. </condition>
  73. <property name="user.csspath.real" location="${output.dir}/${user.csspath}"/>
  74. <mkdir dir="${user.csspath.real}"/>
  75. <!-- Always copy system default css files -->
  76. <copy todir="${user.csspath.real}">
  77. <fileset dir="${dita.plugin.org.dita.html5.dir}/css" includes="*.css"/>
  78. </copy>
  79. <!-- Copy user specify css file when required -->
  80. <antcall target="html5.copy-css-user"/>
  81. </target>
  82. <target name="html5.copy-css-user" if="user.copycss.yes">
  83. <copy file="${args.css.real}" todir="${user.csspath.real}"/>
  84. </target>
  85. </project>