-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_dita2troff.xml
72 lines (64 loc) · 2.92 KB
/
build_dita2troff.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of the DITA Open Toolkit project.
Copyright 2006 IBM Corporation
See the accompanying LICENSE file for applicable license.
-->
<project name="dita2troff" xmlns:if="ant:if">
<target name="dita2troff-ast.init">
<property name="troff-ast.xsl" location="${dita.plugin.org.dita.troff.dir}/xsl/dita2troff-ast-shell.xsl"/>
</target>
<target name="dita2troff.init">
<property name="out.ext" value=".cli"/>
<property name="troff.step2.xsl" location="${dita.plugin.org.dita.troff.dir}/xsl/dita2troff-step2-shell.xsl"/>
</target>
<target name="dita2troff"
depends="dita2troff-ast.init, dita2troff.init, build-init, preprocess, dita.topic.troff-ast, dita.topic.troff, dita.inner.topic.troff">
</target>
<target name="dita.topic.troff-ast" unless="noTopic" depends="dita2troff-ast.init"
description="Build Troff-specific AST output from dita topics.">
<pipeline>
<xslt basedir="${dita.temp.dir}"
destdir="${dita.temp.dir}"
style="${troff-ast.xsl}">
<ditafileset format="dita" processingRole="normal"/>
<param name="defaultLanguage" expression="${default.language}"/>
<mapper type="glob" from="*" to="*.ast" />
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
<move todir="${dita.temp.dir}">
<fileset dir="${dita.temp.dir}" includes="**/*.ast" />
<mapper type="glob" from="*.ast" to="*" />
</move>
</target>
<target name="dita.topic.troff" unless="noTopic" if="old.transform"
description="Build troff output from dita inner and outer topics,which will adjust the directory.">
<pipeline>
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}" extension="${out.ext}"
classpathref="dost.class.path"
style="${troff.step2.xsl}">
<ditafileset format="dita" processingRole="normal"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if:set="troff.outformat"/>
<param name="defaultLanguage" expression="${default.language}"/>
<mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
</target>
<!--The new solution which divides the whole process into the inner and outer steps -->
<target name="dita.inner.topic.troff" unless="noTopic" if="inner.transform"
description="Build troff output from inner dita topics">
<echo level="info">the ditmapoutputdir is ${dita.map.output.dir}</echo>
<!-- step 2 -->
<pipeline>
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}" extension="${out.ext}"
style="${troff.step2.xsl}">
<ditafileset format="dita" processingRole="normal"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if:set="troff.outformat"/>
<mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
</target>
</project>