我有一个多模块 maven 项目,其中每个模块都有自己的参考手册,以 docbook 格式编写。然后我有一个通用参考手册,也是用包含其他文档的 docbook 编写的,所以我正在重新使用文档。当我执行 mvn site 时,该项目会生成包含所有参考手册的 HTML 和 PDF 文件,并将它们巧妙地集成到 maven 站点中。为此,我使用 docbkx 插件。我认为它真的很摇滚。这是插件配置:
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<executions>
<execution>
<id>docbook-HTML</id>
<phase>pre-site</phase>
<goals>
<goal>generate-html</goal>
</goals>
<!-- HTML configuration -->
<configuration>
<generateToc>false</generateToc>
<targetDirectory>${project.build.directory}/site</targetDirectory>
<htmlCustomization>${basedir}/src/site/docbkx-config/docbook-html.xsl</htmlCustomization>
<htmlStylesheet>./css/apache-maven-fluido-1.3.0.min.css</htmlStylesheet>
<chunkedOutput>false</chunkedOutput>
</configuration>
</execution>
<execution>
<id>docbook-PDF</id>
<phase>pre-site</phase>
<goals>
<goal>generate-pdf</goal>
</goals>
<!-- PDF configuration -->
<configuration>
<generateToc>true</generateToc>
<paperType>A4</paperType>
<imgSrcPath>file:///${basedir}/src/site/resources/</imgSrcPath>
<calloutGraphicsPath>file:///${basedir}/src/site/resources/images/callouts/</calloutGraphicsPath>
<calloutGraphicsExtension>.svg</calloutGraphicsExtension>
<calloutGraphicsNumberLimit>30</calloutGraphicsNumberLimit>
<calloutIconSize>6</calloutIconSize>
<shadeVerbatim>true</shadeVerbatim>
<targetDirectory>${project.build.directory}</targetDirectory>
<foCustomization>${basedir}/src/site/docbkx-config/docbook-fo.xsl</foCustomization>
<!-- <bodyFontFamily>Kaffeesatz</bodyFontFamily>
<monospaceFontFamily>LiberationMono</monospaceFontFamily>
-->
<fonts>
<font>
<name>Kaffeesatz</name>
<style>normal</style>
<weight>normal</weight>
<embedFile>${basedir}/src/fonts/YanoneKaffeesatz-Regular.ttf</embedFile>
<metricsFile>${basedir}/target/fonts/YanoneKaffeesatz-Regular-metrics.xml</metricsFile>
</font>
<font>
<name>LiberationMono</name>
<style>normal</style>
<weight>normal</weight>
<embedFile>${basedir}/src/fonts/LiberationMono-Regular.ttf</embedFile>
<metricsFile>${basedir}/target/fonts/LiberationMono-Regular-metrics.xml</metricsFile>
</font>
<font>
<name>VeraMono</name>
<style>normal</style>
<weight>normal</weight>
<embedFile>${basedir}/src/fonts/VeraMono.ttf</embedFile>
<metricsFile>${basedir}/target/fonts/VeraMono-metrics.xml</metricsFile>
</font>
</fonts>
</configuration>
</execution>
</executions>
<!-- Shared configuration -->
<configuration>
<sourceDirectory>${basedir}/src/site/docbkx</sourceDirectory>
<includes>*.xml</includes>
<xincludeSupported>true</xincludeSupported>
<generatedSourceDirectory>${project.build.directory}/site</generatedSourceDirectory>
<highlightSource>1</highlightSource>
<calloutGraphics>true</calloutGraphics>
<!-- DEFAULT HTML CONFIG -->
<targetDirectory>${project.build.directory}/site</targetDirectory>
<htmlCustomization>src/site/docbook-config/docbook-html.xsl</htmlCustomization>
<htmlStylesheet>css/apache-maven-fluido-1.3.0.min.css</htmlStylesheet>
<!-- // DEFAULT HTML CONFIG -->
</configuration>
</plugin>
你可以在这里查看我的项目站点,你甚至可以将源代码下载到你的计算机中,看看整个事情是如何设置的。如果您有任何问题,请随时与我们联系。
希望能帮助到你
干杯卡洛斯