Skip to content

Commit 58d91f0

Browse files
authored
OPENNLP-1792: Add docbkx plugin config to produce PDF of dev manual (#920)
* OPENNLP-1792: Add docbkx plugin config to produce PDF of dev manual - modernizes xml files of the OpenNLP dev manual to use Docbook dtd in version 5.x - adds plugin configuration to produce the PDF as separate outcome - adds xsl file for customization of the layout of text in the PDF - adds hyphenation support for PDF and epub versions - introduces specific profiles for html, pdf, and epub3 targets of the dev manual - adds cover entry to opennlp.xml for epub target - fixes inconsistencies in dev manual's structure (duplicate ids...) - fixes 'informaltable' column counts, mainly in cli.xml - fixes missing inlinemediaobject for parsetree1.png image include causing trouble during epub3 generation - adds config for pdf and epub file inclusion to bin.xml config in opennlp-distr/assembly
1 parent ced5be1 commit 58d91f0

26 files changed

+5856
-5600
lines changed

opennlp-distr/src/main/assembly/bin.xml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,26 @@
114114
<outputDirectory>docs/manual</outputDirectory>
115115
</fileSet>
116116

117+
<fileSet>
118+
<directory>../opennlp-docs/target/docbkx/pdf</directory>
119+
<fileMode>644</fileMode>
120+
<directoryMode>755</directoryMode>
121+
<includes>
122+
<include>*.pdf</include>
123+
</includes>
124+
<outputDirectory>docs</outputDirectory>
125+
</fileSet>
126+
127+
<fileSet>
128+
<directory>../opennlp-docs/target/docbkx</directory>
129+
<fileMode>644</fileMode>
130+
<directoryMode>755</directoryMode>
131+
<includes>
132+
<include>*.epub</include>
133+
</includes>
134+
<outputDirectory>docs</outputDirectory>
135+
</fileSet>
136+
117137
<fileSet>
118138
<directory>../opennlp-tools/target/reports/apidocs</directory>
119139
<fileMode>644</fileMode>

opennlp-docs/pom.xml

Lines changed: 149 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -31,46 +31,153 @@
3131
<artifactId>opennlp-docs</artifactId>
3232
<packaging>pom</packaging>
3333
<name>Apache OpenNLP :: Documentation</name>
34-
35-
<build>
36-
<plugins>
37-
<plugin>
38-
<groupId>com.agilejava.docbkx</groupId>
39-
<artifactId>docbkx-maven-plugin</artifactId>
40-
<version>2.0.17</version>
41-
<executions>
42-
<execution>
43-
<goals>
44-
<goal>generate-html</goal>
45-
</goals>
46-
<phase>package</phase>
47-
</execution>
48-
</executions>
49-
<dependencies>
50-
<dependency>
51-
<groupId>org.docbook</groupId>
52-
<artifactId>docbook-xml</artifactId>
53-
<version>4.4</version>
54-
</dependency>
55-
</dependencies>
56-
<configuration>
57-
<xincludeSupported>true</xincludeSupported>
58-
<includes>opennlp.xml</includes>
59-
<htmlStylesheet>css/opennlp-docs.css</htmlStylesheet>
60-
<highlightSource>1</highlightSource>
61-
<htmlCustomization>${project.basedir}/src/main/resources/xsl/html.xsl</htmlCustomization>
62-
<postProcess>
63-
<copy todir="${project.build.directory}/docbkx/html">
64-
<fileset dir="${project.basedir}/src/docbkx">
65-
<include name="**/*.css" />
66-
<include name="**/*.png" />
67-
<include name="**/*.gif" />
68-
<include name="**/*.jpg" />
69-
</fileset>
70-
</copy>
71-
</postProcess>
72-
</configuration>
73-
</plugin>
74-
</plugins>
75-
</build>
34+
35+
<profiles>
36+
<profile>
37+
<id>doc-manual-html</id>
38+
<activation>
39+
<activeByDefault>true</activeByDefault>
40+
</activation>
41+
<build>
42+
<plugins>
43+
<plugin>
44+
<groupId>com.agilejava.docbkx</groupId>
45+
<artifactId>docbkx-maven-plugin</artifactId>
46+
<executions>
47+
<execution>
48+
<id>doc-manual-html</id>
49+
<goals>
50+
<goal>generate-html</goal>
51+
</goals>
52+
<phase>package</phase>
53+
</execution>
54+
</executions>
55+
<configuration>
56+
<htmlStylesheet>css/opennlp-dev-manual.css</htmlStylesheet>
57+
<highlightSource>1</highlightSource>
58+
<htmlCustomization>${project.basedir}/src/main/resources/xsl/html.xsl</htmlCustomization>
59+
<postProcess>
60+
<copy todir="${project.build.directory}/docbkx/html">
61+
<fileset dir="${project.basedir}/src/docbkx">
62+
<include name="**/*.css" />
63+
<include name="**/*.png" />
64+
<include name="**/*.gif" />
65+
<include name="**/*.jpg" />
66+
</fileset>
67+
</copy>
68+
</postProcess>
69+
</configuration>
70+
</plugin>
71+
</plugins>
72+
</build>
73+
</profile>
74+
<profile>
75+
<id>doc-manual-pdf</id>
76+
<activation>
77+
<activeByDefault>true</activeByDefault>
78+
</activation>
79+
<build>
80+
<plugins>
81+
<plugin>
82+
<groupId>com.agilejava.docbkx</groupId>
83+
<artifactId>docbkx-maven-plugin</artifactId>
84+
<executions>
85+
<execution>
86+
<id>doc-manual-pdf</id>
87+
<goals>
88+
<goal>generate-pdf</goal>
89+
</goals>
90+
<phase>package</phase>
91+
</execution>
92+
</executions>
93+
<configuration>
94+
<foCustomization>${project.basedir}/src/main/resources/xsl/pdf.xsl</foCustomization>
95+
<highlightSource>1</highlightSource>
96+
<hyphenate>true</hyphenate>
97+
<hyphenateVerbatim>false</hyphenateVerbatim>
98+
<showXslMessages>false</showXslMessages>
99+
</configuration>
100+
</plugin>
101+
</plugins>
102+
</build>
103+
</profile>
104+
<profile>
105+
<id>doc-manual-epub</id>
106+
<activation>
107+
<activeByDefault>false</activeByDefault>
108+
</activation>
109+
<build>
110+
<plugins>
111+
<plugin>
112+
<groupId>com.agilejava.docbkx</groupId>
113+
<artifactId>docbkx-maven-plugin</artifactId>
114+
<executions>
115+
<execution>
116+
<id>doc-manual-epub</id>
117+
<goals>
118+
<goal>generate-epub3</goal>
119+
</goals>
120+
<phase>package</phase>
121+
</execution>
122+
</executions>
123+
<configuration>
124+
<hyphenate>true</hyphenate>
125+
<hyphenateVerbatim>false</hyphenateVerbatim>
126+
<htmlStylesheet>css/opennlp-dev-manual.css</htmlStylesheet>
127+
<epub3Customization>${project.basedir}/src/main/resources/xsl/epub3.xsl</epub3Customization>
128+
<chunkQuietly>true</chunkQuietly>
129+
<showXslMessages>false</showXslMessages>
130+
<preProcess>
131+
<copy todir="${project.build.directory}/docbkx/epub3/images">
132+
<fileset dir="src/docbkx/images/">
133+
<include name="*.png"/>
134+
</fileset>
135+
</copy>
136+
<copy todir="${project.build.directory}/docbkx/epub3/css"
137+
file="src/docbkx/css/opennlp-dev-manual.css"/>
138+
</preProcess>
139+
</configuration>
140+
</plugin>
141+
</plugins>
142+
</build>
143+
</profile>
144+
</profiles>
145+
146+
<build>
147+
<pluginManagement>
148+
<plugins>
149+
<plugin>
150+
<groupId>com.agilejava.docbkx</groupId>
151+
<artifactId>docbkx-maven-plugin</artifactId>
152+
<version>2.0.17</version>
153+
<dependencies>
154+
<dependency>
155+
<groupId>net.sf.docbook</groupId>
156+
<artifactId>docbook-xml</artifactId>
157+
<version>5.0-all</version>
158+
<classifier>resources</classifier>
159+
<type>zip</type>
160+
<scope>runtime</scope>
161+
</dependency>
162+
<dependency>
163+
<groupId>net.sf.xslthl</groupId>
164+
<artifactId>xslthl</artifactId>
165+
<version>2.0.1</version>
166+
<scope>runtime</scope>
167+
</dependency>
168+
<dependency>
169+
<groupId>net.sf.offo</groupId>
170+
<artifactId>fop-hyph</artifactId>
171+
<version>1.2</version>
172+
<scope>runtime</scope>
173+
</dependency>
174+
</dependencies>
175+
<configuration>
176+
<xincludeSupported>true</xincludeSupported>
177+
<includes>opennlp.xml</includes>
178+
</configuration>
179+
</plugin>
180+
</plugins>
181+
</pluginManagement>
182+
</build>
76183
</project>

0 commit comments

Comments
 (0)