Skip to content

Commit 416e627

Browse files
authored
Merge pull request #3 from dita-ot/develop
Release 4.3
2 parents 7644409 + 3e607ca commit 416e627

64 files changed

Lines changed: 1455 additions & 2 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

plugin.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ Copyright 2024 Jarno Elovirta
77
See the accompanying LICENSE file for applicable license.
88
-->
99
<plugin id="org.dita.init" version="1.0.0">
10+
<feature extension="init.template" file="samples/" desc="DITA garage samples and Ant build scripts"/>
1011
<feature extension="init.template" file="startup/" desc="Startup template"/>
1112
</plugin>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="build-chm-pdf-hybrid" default="all" basedir=".">
3+
<description>An Ant build that calls the dita command</description>
4+
<include file="dita-cmd.xml"/><!-- defines the <dita-cmd> macro -->
5+
<target name="all" depends="pre,main,post"/>
6+
<target name="pre">
7+
<description>Pre-processing steps</description>
8+
</target>
9+
<target name="main">
10+
<description>Build the CHM and PDF with the dita command</description>
11+
<property name="absolute.path.base" location="../"/>
12+
<dita-cmd
13+
input="${absolute.path.base}/sequence.ditamap"
14+
format="htmlhelp"
15+
propertyfile="${absolute.path.base}/properties/chm.properties"
16+
/>
17+
<dita-cmd
18+
input="${absolute.path.base}/taskbook.ditamap"
19+
format="pdf"
20+
propertyfile="${absolute.path.base}/properties/pdf.properties"
21+
/>
22+
</target>
23+
<target name="post">
24+
<description>Postprocessing steps</description>
25+
</target>
26+
</project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<project name="build-chm-pdf" default="all" basedir=".">
3+
<property name="dita.dir" location="${basedir}/../../.."/>
4+
<target name="all" description="build CHM and PDF" depends="chm,pdf"/>
5+
<target name="chm" description="build CHM">
6+
<ant antfile="${dita.dir}/build.xml">
7+
<property name="args.input" location="../sequence.ditamap"/>
8+
<property name="transtype" value="htmlhelp"/>
9+
<property name="output.dir" location="../out/chm"/>
10+
<property name="args.gen.task.lbl" value="YES"/>
11+
</ant>
12+
</target>
13+
<target name="pdf" description="build PDF">
14+
<ant antfile="${dita.dir}/build.xml">
15+
<property name="args.input" location="../taskbook.ditamap"/>
16+
<property name="transtype" value="pdf"/>
17+
<property name="output.dir" location="../out/pdf"/>
18+
<property name="args.gen.task.lbl" value="YES"/>
19+
<property name="args.rellinks" value="nofamily"/>
20+
</ant>
21+
</target>
22+
</project>

samples/ant_sample/dita-cmd.xml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project basedir="." name="dita-cmd">
4+
5+
<description>Defines a dita-cmd macro you can use in your Ant builds. See build-chm-pdf-hybrid.xml for
6+
usage.</description>
7+
8+
<property name="dita.dir" location="${basedir}/../../.."/>
9+
10+
<macrodef name="dita-cmd">
11+
<attribute name="input"/>
12+
<attribute name="format"/>
13+
<attribute name="propertyfile"/>
14+
<sequential>
15+
<!-- For Unix run the DITA executable-->
16+
<exec taskname="dita-cmd" executable="${dita.dir}/bin/dita" osfamily="unix" failonerror="true">
17+
<arg value="--input"/>
18+
<arg value="@{input}"/>
19+
<arg value="--format"/>
20+
<arg value="@{format}"/>
21+
<arg value="--propertyfile"/>
22+
<arg value="@{propertyfile}"/>
23+
</exec>
24+
<!-- For Windows run DITA from a DOS command -->
25+
<exec taskname="dita-cmd" dir="${dita.dir}/bin" executable="cmd" osfamily="windows" failonerror="true">
26+
<arg value="/C"/>
27+
<arg value="dita --input @{input} --format @{format} --propertyfile=@{propertyfile}"/>
28+
</exec>
29+
</sequential>
30+
</macrodef>
31+
32+
</project>

samples/ant_sample/sample_all.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_all" default="all" basedir=".">
4+
5+
<import file="sample_html5.xml"/>
6+
<import file="sample_xhtml_plus_css.xml"/>
7+
<import file="sample_eclipsehelp.xml"/>
8+
<import file="sample_htmlhelp.xml"/>
9+
<import file="sample_pdf.xml"/>
10+
11+
<target name="all" depends="samples"/>
12+
13+
<target
14+
name="samples"
15+
description="build the sample output"
16+
depends="samples.html5, samples.xhtml_plus_css, samples.eclipse, samples.htmlhelp, samples.pdf"
17+
/>
18+
19+
<target
20+
name="clean.samples"
21+
description="remove the sample output"
22+
depends="clean.samples.html5, clean.samples.xhtml_plus_css, clean.samples.eclipse, clean.samples.htmlhelp, clean.samples.pdf"
23+
>
24+
<delete dir="${dita.dir}/out/samples"/>
25+
</target>
26+
27+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_eclipsehelp" default="samples.eclipse" basedir=".">
4+
5+
<property name="dita.dir" location="${basedir}/../../.."/>
6+
7+
<target name="samples.eclipse" description="build the samples for Eclipse" depends="clean.samples.eclipse">
8+
<ant antfile="${dita.dir}/build.xml">
9+
<property name="args.input" location="${dita.dir}/docsrc/samples/hierarchy.ditamap"/>
10+
<property name="output.dir" location="${dita.dir}/out/samples/org.dita.sample.doc"/>
11+
<property name="transtype" value="eclipsehelp"/>
12+
</ant>
13+
</target>
14+
15+
<target name="clean.samples.eclipse" description="remove the sample Eclipse output">
16+
<delete dir="${dita.dir}/out/samples/org.dita.sample.doc"/>
17+
</target>
18+
19+
</project>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_html5" default="samples.html5" basedir=".">
4+
5+
<property name="dita.dir" location="${basedir}/../../.."/>
6+
7+
<target name="samples.html5" description="build the HTML5 samples" depends="clean.samples.html5">
8+
<ant antfile="${dita.dir}/build.xml">
9+
<property name="args.input" location="${dita.dir}/docsrc/samples/hierarchy.ditamap"/>
10+
<property name="output.dir" location="${dita.dir}/out/samples/html5"/>
11+
<property name="args.html5.toc" value="toc"/>
12+
<property name="transtype" value="html5"/>
13+
</ant>
14+
</target>
15+
16+
<target name="clean.samples.html5" description="remove the sample html5 output">
17+
<delete dir="${dita.dir}/out/samples/html5"/>
18+
</target>
19+
20+
</project>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_htmlhelp" default="samples.htmlhelp" basedir=".">
4+
5+
<property name="dita.dir" location="${basedir}/../../.."/>
6+
7+
<target name="samples.htmlhelp" description="build the samples for HTMLHelp" depends="clean.samples.htmlhelp">
8+
<ant antfile="${dita.dir}/build.xml">
9+
<property name="args.input" location="${dita.dir}/docsrc/samples/hierarchy.ditamap"/>
10+
<property name="output.dir" location="${dita.dir}/out/samples/htmlhelp"/>
11+
<property name="transtype" value="htmlhelp"/>
12+
</ant>
13+
</target>
14+
15+
<target name="clean.samples.htmlhelp" description="remove the sample HTMLHelp output">
16+
<delete dir="${dita.dir}/out/samples/htmlhelp"/>
17+
</target>
18+
19+
</project>

samples/ant_sample/sample_pdf.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_pdf" default="samples.pdf" basedir=".">
4+
5+
<property name="dita.dir" location="${basedir}/../../.."/>
6+
7+
<target name="samples.pdf" description="build the samples as PDF" depends="clean.samples.pdf">
8+
<ant antfile="${dita.dir}/build.xml">
9+
<property name="args.input" location="${dita.dir}/docsrc/samples/sequence.ditamap"/>
10+
<property name="output.dir" location="${dita.dir}/out/samples/pdf"/>
11+
<property name="transtype" value="pdf"/>
12+
</ant>
13+
</target>
14+
15+
<target name="clean.samples.pdf" description="remove the sample PDF output">
16+
<delete dir="${dita.dir}/out/samples/pdf"/>
17+
</target>
18+
19+
</project>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- This file is part of the DITA Open Toolkit project. See the accompanying LICENSE file for applicable license. -->
3+
<project name="sample_xhtml_plus_css" default="samples.xhtml_plus_css" basedir=".">
4+
5+
<property name="dita.dir" location="${basedir}/../../.."/>
6+
7+
<property name="sample.output.dir" value="${dita.dir}/out/samples/xhtml_plus_css"/>
8+
<property name="css.source.dir" location="${dita.dir}/docsrc/samples/css"/>
9+
10+
<target name="samples.xhtml_plus_css" depends="clean.samples.xhtml_plus_css">
11+
<ant antfile="${dita.dir}/build.xml">
12+
<property name="args.input" location="${dita.dir}/docsrc/samples/hierarchy.ditamap"/>
13+
<property name="output.dir" location="${sample.output.dir}"/>
14+
<property name="transtype" value="xhtml"/>
15+
<property name="args.css" value="style.css"/>
16+
<property name="args.csspath" value="css"/>
17+
<property name="args.copycss" value="yes"/>
18+
<property name="args.cssroot" location="${css.source.dir}"/>
19+
</ant>
20+
</target>
21+
22+
<target name="clean.samples.xhtml_plus_css" description="remove the sample web output">
23+
<delete dir="${sample.output.dir}"/>
24+
</target>
25+
26+
</project>

0 commit comments

Comments
 (0)