|
| 1 | +<?xml version="1.0"?> |
| 2 | +<!-- - Author: Lars Vogel --> |
| 3 | +<project name="build HTML5" default="build-html"> |
| 4 | + |
| 5 | + <description> |
| 6 | + Used to transform DocBook XML to HTML5 output |
| 7 | + </description> |
| 8 | + |
| 9 | + <!-- Define base properties --> |
| 10 | + <property name="input.dir" value="input" /> |
| 11 | + <property name="output.dir" value="output" /> |
| 12 | + <property name="docbook.xsl.dir" value="docbook-xsl-1.76.1" /> |
| 13 | + <property name="mydocbook.xsl.dir" value="mystylesheets" /> |
| 14 | + <property name="xhtml5.stylesheet" value="${docbook.xsl.dir}/xhtml5/docbook.xsl" /> |
| 15 | + |
| 16 | + <!-- Making saxon available --> |
| 17 | + <path id="saxon.class.path"> |
| 18 | + <pathelement location="lib/saxon.jar" /> |
| 19 | + </path> |
| 20 | + |
| 21 | + |
| 22 | + <!-- - target: usage --> |
| 23 | + <target name="usage" description="Prints help"> |
| 24 | + <echo message="Use -projecthelp to get a list of the available targets." /> |
| 25 | + </target> |
| 26 | + |
| 27 | + <!-- - target: clean --> |
| 28 | + <target name="clean" description="Cleans up generated files."> |
| 29 | + <delete dir="${output.dir}" /> |
| 30 | + </target> |
| 31 | + |
| 32 | + <!-- - target: depends --> |
| 33 | + <target name="createtargetdir" description="Generate targetdir."> |
| 34 | + <mkdir dir="${output.dir}" /> |
| 35 | + <mkdir dir="${output.dir}/images" /> |
| 36 | + </target> |
| 37 | + |
| 38 | + |
| 39 | + <!-- - target: build-html - Iterates through the specified directory and |
| 40 | + transforms DocBook files into .html files using the DocBook XSL. --> |
| 41 | + <target name="oldbuild-html" depends="clean, createtargetdir" |
| 42 | + description="Generates HTML5 files"> |
| 43 | + <!-- Copy the stylesheet to the same directory as the HTML files --> |
| 44 | + <copy todir="${output.dir}"> |
| 45 | + <fileset dir="css"> |
| 46 | + <include name="style.css" /> |
| 47 | + </fileset> |
| 48 | + </copy> |
| 49 | + |
| 50 | + <!-- Copy the images to the same directory as the HTML files --> |
| 51 | + <copy todir="${output.dir}\images"> |
| 52 | + <fileset dir="${input.dir}\images"> |
| 53 | + <include name="title.png" /> |
| 54 | + </fileset> |
| 55 | + </copy> |
| 56 | + <!-- Transfer to HTML --> |
| 57 | + <xslt style="${xhtml5.stylesheet}" extension=".html" basedir="${input.dir}" |
| 58 | + destdir="${output.dir}"> |
| 59 | + <include name="**/*book.xml" /> |
| 60 | + <include name="**/*article*.xml" /> |
| 61 | + <param name="html.stylesheet" expression="style.css" /> |
| 62 | + <param name="docbook.css.source" expression="" /> |
| 63 | + <param name="section.autolabel" expression="1" /> |
| 64 | + <param name="highlight.source" expression="1" /> |
| 65 | + <param name="highlight.xslthl.config" |
| 66 | + expression="file:///C:/Users/D034797/workspace/vogella/de.vogella.docbook.first/docbook-xsl-1.76.1/highlighting/xslthl-config.xml" /> |
| 67 | + <param name="make.clean.html" expression="1" /> |
| 68 | + <outputproperty name="indent" value="yes" /> |
| 69 | + <classpath refid="saxon.class.path" /> |
| 70 | + </xslt> |
| 71 | + |
| 72 | + </target> |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + <target name="build-html" depends="clean, createtargetdir" |
| 78 | + description="Generates HTML5 files"> |
| 79 | + <echo message="Building HTML5 output" /> |
| 80 | + |
| 81 | + <!-- Copy the stylesheet to the same directory as the HTML files --> |
| 82 | + <copy todir="${output.dir}"> |
| 83 | + <fileset dir="css"> |
| 84 | + <include name="style.css" /> |
| 85 | + </fileset> |
| 86 | + </copy> |
| 87 | + |
| 88 | + <!-- Copy the images to the same directory as the HTML files --> |
| 89 | + <copy todir="${output.dir}\images"> |
| 90 | + <fileset dir="${input.dir}\images"> |
| 91 | + <include name="title.png" /> |
| 92 | + </fileset> |
| 93 | + </copy> |
| 94 | + <!-- Transfer to HTML --> |
| 95 | + <xslt style="${xhtml5.stylesheet}" extension=".html2" basedir="${input.dir}" |
| 96 | + destdir="${output.dir}"> |
| 97 | + <include name="**/*book.xml" /> |
| 98 | + <include name="**/*article*.xml" /> |
| 99 | + <param name="html.stylesheet" expression="style.css" /> |
| 100 | + <param name="docbook.css.source" expression="" /> |
| 101 | + <param name="section.autolabel" expression="1" /> |
| 102 | + <param name="make.clean.html" expression="1" /> |
| 103 | + <outputproperty name="indent" value="yes" /> |
| 104 | + <classpath refid="saxon.class.path" /> |
| 105 | + </xslt> |
| 106 | + </target> |
| 107 | + |
| 108 | +</project> |
0 commit comments