介绍
Doxia 允许您以 Doxia 支持的任何格式编写用户手册和指南等书籍。结合 Doxia Book Maven,您可以将手册直接包含在您生成的站点中,并带有 XDoc、PDF、RTF 和 LaTeX 等离线友好格式的链接。
可以在此处查看已呈现到此站点的 Xdoc 输出。
这个怎么运作
除了内容文件本身之外,您唯一需要的是一个简单的书籍描述符,用于指定章节的顺序和章节的名称。
有关描述符的引用,请参阅Book Descriptor Reference。
创建图书描述符
XML 文件用于描述本书的布局。
下面给出一个示例:
<book xmlns="http://maven.apache.org/BOOK/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/BOOK/1.0.0 http://maven.apache.org/xsd/book-1.0.0.xsd">
<id>doxia-example-book</id>
<title>XFire User Manual</title>
<chapters>
<chapter>
<id>bind</id>
<title>Bindings</title>
<sections>
<section>
<id>bindings</id>
</section>
<section>
<id>aegis-binding</id>
</section>
<section>
<id>castor</id>
</section>
</sections>
</chapter>
<chapter>
<id>transports</id>
<title>Transports</title>
<sections>
<section>
<id>transport-and-channel-api</id>
</section>
<section>
<id>http-transport</id>
</section>
<section>
<id>jms-transport</id>
</section>
<section>
<id>local-transport</id>
</section>
</sections>
</chapter>
</chapters>
</book>
配置 Doxia Book Maven 插件
这个例子说明了如何配置 Doxia Book Maven 插件。它将以三种不同的格式呈现这本书。默认情况下,输出将在target/generated-site/<format>/<book id> .
当前支持的格式 ID 为:xdoc, pdf, latex, rtf, xhtml,doc-book
pom.xml下面给出一个示例:
<plugin>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-book-maven-plugin</artifactId>
<version>1.3-SNAPSHOT</version>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>render-books</goal>
</goals>
</execution>
</executions>
<configuration>
<books>
<book>
<directory>content/books/example-book</directory>
<descriptor>content/books/example-book.xml</descriptor>
<formats>
<format>
<id>latex</id>
</format>
<format>
<id>xdoc</id>
</format>
<format>
<id>pdf</id>
</format>
<format>
<id>rtf</id>
</format>
</formats>
</book>
</books>
</configuration>
</plugin>



