build_dita2html5.xml 3.4 KB

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