<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    用maven-jdocbook-plugin簡單配置docbook5.0環境

    很多人都說docbook配置環境比較繁瑣,今天看了一下docbook5的文檔,5.0不再使用舊的SGML DTD,轉而使用XML,感覺配置相對容易多了,網上有篇文章介紹5.0的編譯環境,真的比較簡單.不過我今天看了看jboss seam的文檔構建過程,構建環境搭建真是簡單的不能再簡單了,jboss seam使用maven來發布docbook文檔,用到了maven-jdocbook-plugin,我把jboss seam的構建提取出來,大家可以參考來方便構建自己的docbook.

    創建一個最最簡單的maven空項目,pom.xml內容如下:
    <?xml version="1.0"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
             xmlns:xsi
    ="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation
    ="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        
    <modelVersion>4.0.0</modelVersion>
        
    <groupId>org.kuuyee</groupId>
        
    <artifactId>first-docbook</artifactId>
        
    <packaging>jar</packaging>
        
    <version>1.0-SNAPSHOT</version>
        
    <name>first-docbook</name>

                
    <build>
                    
    <plugins>
                   
    <!-- the docbook generation plugin for the user guide -->
                        
    <plugin>
                            
    <groupId>org.jboss.maven.plugins</groupId>
                            
    <artifactId>maven-jdocbook-plugin</artifactId>
                            
    <version>2.1.1</version>
                            
    <extensions>true</extensions>
                            
    <dependencies>
                                
    <dependency>
                                    
    <groupId>org.jboss</groupId>
                                    
    <artifactId>jbossorg-docbook-xslt</artifactId>
                                    
    <version>1.1.0</version>
                                
    </dependency>
                                
    <dependency>
                                    
    <groupId>org.jboss</groupId>
                                    
    <artifactId>jbossorg-jdocbook-style</artifactId>
                                    
    <version>1.1.0</version>
                                    
    <type>jdocbook-style</type>
                                
    </dependency>
                            
    </dependencies>
                            
    <executions>
                                
    <execution>
                                    
    <id>tutorial_zh_CN</id>
                                    
    <phase>package</phase>
                                    
    <goals>
                                        
    <goal>resources</goal>
                                        
    <goal>generate</goal>
                                    
    </goals>
                                    
    <configuration>
                                        
    <sourceDocumentName>master.xml</sourceDocumentName>
                                        
    <sourceDirectory>${basedir}/src/main/docbook/zh_CN</sourceDirectory>
                                        
    <imageResource>
                                            
    <directory>${basedir}/src/main/docbook/images</directory>
                                        
    </imageResource>
                                        
    <cssResource>
                                            
    <directory>${basedir}/src/main/docbook/css</directory>
                                        
    </cssResource>
                                        
    <targetDirectory>${basedir}/target/docbook/zh_CN</targetDirectory>

                                        
    <formats>
                                            
    <format>
                                                
    <formatName>pdf</formatName>
                                                
    <stylesheetResource>classpath:/xslt/org/jboss/pdf.xsl</stylesheetResource>
                                                
    <finalName>zh_CN.pdf</finalName>
                                            
    </format>
                                            
    <format>
                                                
    <formatName>html</formatName>
                                                
    <stylesheetResource>classpath:/xslt/org/jboss/xhtml.xsl</stylesheetResource>
                                                
    <finalName>index.html</finalName>
                                            
    </format>
                                            
    <format>
                                                
    <formatName>html_single</formatName>
                                                
    <stylesheetResource>classpath:/xslt/org/jboss/xhtml-single.xsl</stylesheetResource>
                                                
    <finalName>index.html</finalName>
                                            
    </format>
                                        
    </formats>
                                        
    <options>
                                            
    <xincludeSupported>true</xincludeSupported>
                                        
    </options>
                                    
    </configuration>
                                
    </execution>
                            
    </executions>
                        
    </plugin>
                    
    </plugins>
                
    </build>
        
        
    <!-- basic JBoss repository so that the common parent POM in jbosscache-support can be found -->
        
    <repositories>
            
    <repository>
                
    <id>snapshots.jboss.org</id>
                
    <url>http://snapshots.jboss.org/maven2</url>
            
    </repository>
            
    <repository>
                
    <id>repository.jboss.org</id>
                
    <url>http://repository.jboss.org/maven2</url>
            
    </repository>
        
    </repositories>
    </project>

    在src/main/docbook/zh_CN下新建兩個xml文件master.xml,chap1.xml.這里用到了docbook的物理分割概念,就是把單個文檔拆分文檔為多個文件,這在文檔比較巨大的時候很實用.
    master.xml是文檔主文件,內容如下:
    <?xml version='1.0' encoding="utf-8"?>
    <book xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="zh-CN" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude">
    <title>光子的第一本Docbook書</title>
    <xi:include href="chap1.xml"/>
    </book>

    chap1.xml是文檔的第一章,內容如下:
    <?xml version='1.0' encoding="utf-8"?>
    <chapter xmlns="http://docbook.org/ns/docbook" version="5.0" xml:lang="zh-CN"
      xmlns:xlink
    ="http://www.w3.org/1999/xlink" id="ch1" xmlns:xi="http://www.w3.org/2001/XInclude">

        
    <title>光子的第一篇Docbook 5.0文檔</title>
                      
      
    <section>   
        
    <title>第一章標題</title>
        
    <para>
          這是光子的第一篇Docbook 5.0文檔,我的BLOG
    <link xlink:href='http://www.tkk7.com/kuuyee/'>光子CI之旅</link>。
        
    </para>
      
    </section>
    </chapter>

    ok,我們可以發布文檔了,沒錯!就是這么簡單,在項目根目錄運行命令
    mvn clean package

    如果大家不明白可以下載附件源碼看看!樣式還是使用jboss的,不過可以自己修改xsl!
    樣例代碼

    貼張圖看看生成的文檔,呵呵!






    posted on 2009-07-27 17:24 kuuyee 閱讀(2778) 評論(2)  編輯  收藏 所屬分類: Git/MavenJEE

    評論

    # re: 用maven-jdocbook-plugin簡單配置docbook5.0環境 2010-02-26 09:42 王興朝

    你好!樓主,我想問一下你生成的pdf格式的文本文件中文有沒有出現亂碼呀(就是所有顯示中文的地方全部用'#'代替了),html格式的文檔沒有出現亂碼,跟你的貼圖顯示是一樣的。控制臺提示的信息為:
    2010-2-26 9:23:10 org.apache.fop.hyphenation.Hyphenator getHyphenationTree
    嚴重: Couldn't find hyphenation pattern en
    希望樓主能幫忙解決一下,謝謝啦!  回復  更多評論   

    # re: 用maven-jdocbook-plugin簡單配置docbook5.0環境 2011-06-16 21:38 stliu

    hi,

    i'm the developer of maven-jdocbook-plugin, and I do have plan to add docbook 5.0 support, are you interested in helping on it :) ?

    btw, the jdocbook plugin has been split into three projects:
    jdocbook-core (https://github.com/sebersole/jdocbook-core)
    jdocbook-maven-plugin (hosted in jboss svn)
    jdocbook-gradle-plugin (https://github.com/gradle/gradle-jdocbook)

    anyway, seems you're very interested in jboss projects, my email is stliu@hibernate.org, i also work on hibernate project.
    thanks
      回復  更多評論   

    導航

    <2009年7月>
    2829301234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    統計

    隨筆分類(139)

    Linux內核

    搜索

    •  

    積分與排名

    • 積分 - 320429
    • 排名 - 178

    最新評論

    閱讀排行榜

    主站蜘蛛池模板: 亚洲黄色在线视频| 国产亚洲精久久久久久无码AV| 亚洲va在线va天堂va不卡下载| 日韩一级片免费观看| 色视频色露露永久免费观看| 亚洲av成人综合网| 久久福利资源网站免费看| 亚洲黄色中文字幕| 免费福利网站在线观看| 亚洲中文字幕无码一去台湾 | 亚洲色精品aⅴ一区区三区| 七次郎成人免费线路视频| 亚洲欧洲自拍拍偷精品 美利坚| 亚洲乱妇老熟女爽到高潮的片| 精品久久久久成人码免费动漫| 亚洲一区二区三区免费在线观看| 日本亚洲免费无线码| 亚洲AV男人的天堂在线观看| 全免费a级毛片免费**视频| 国产精品亚洲专一区二区三区| 亚洲成AV人在线观看网址| 国产精品免费αv视频| 亚洲AV永久无码精品成人| 毛片免费全部播放无码| 亚洲人成网站色7799| 亚洲国产精品自产在线播放| 拍拍拍无挡免费视频网站| 亚洲精品福利在线观看| 午夜dj免费在线观看| jizz免费观看| 亚洲欧洲日产韩国在线| 国产精品免费小视频| 国产自国产自愉自愉免费24区| 亚洲一区中文字幕久久| 日韩毛片免费在线观看| 久久免费视频一区| 亚洲va在线va天堂va手机| 亚洲福利精品电影在线观看| 一级毛片在线免费观看| 在线播放高清国语自产拍免费| 亚洲综合久久成人69|