目录
- 35.1. Docbook 环境初始化
-
- 35.1.1. FreeBSD
- 35.1.2. Ubuntu/Debian
- 35.2. Subversion 版本控制
- 35.3. GIT
前提条件: subversion 服务器一台,或者使用sf.net, github.com, code.google.com 等等提供的服务,团队人员需要懂得docbook以及配置docbook环境
35.1. Docbook 环境初始化
35.1.1. FreeBSD
# pkg_add -r vim # pkg_add -r git # pkg_add -r libxml2 libxslt # pkg_add -r docbook-xsl
创建 book.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE subject SYSTEM "/usr/local/share/xml/docbook/5.0/dtd/docbook.dtd"> <book> <bookinfo> <title>An Example Book</title> <author> <firstname>Your first name</firstname> <surname>Your surname</surname> <affiliation> <address> <email>foo@example.com</email> </address> </affiliation> </author> <copyright> <year>2000</year> <holder>Copyright string here</holder> </copyright> <abstract> <para>If your book has an abstract then it should go here.</para> </abstract> </bookinfo> <preface> <title>Preface</title> <para>Your book may have a preface, in which case it should be placed here.</para> </preface> <chapter> <title>My first chapter</title> <para>This is the first chapter in my book.</para> <section> <title>My first section</title> <para>This is the first section in my book.</para> </section> </chapter> </book>
生成文档
$ xsltproc /usr/local/share/xsl/docbook/xhtml/docbook.xsl book.xml > book.html
35.1.2. Ubuntu/Debian
$ sudo apt-get install docbook-xsl $ sudo apt-get install xsltproc xmlto $ sudo apt-get install make $ sudo apt-get install git
创建 book.xml
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE subject SYSTEM "/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd"> <book> <bookinfo> <title>An Example Book</title> <author> <firstname>Your first name</firstname> <surname>Your surname</surname> <affiliation> <address> <email>foo@example.com</email> </address> </affiliation> </author> <copyright> <year>2000</year> <holder>Copyright string here</holder> </copyright> <abstract> <para>If your book has an abstract then it should go here.</para> </abstract> </bookinfo> <preface> <title>Preface</title> <para>Your book may have a preface, in which case it should be placed here.</para> </preface> <chapter> <title>My first chapter</title> <para>This is the first chapter in my book.</para> <section> <title>My first section</title> <para>This is the first section in my book.</para> </section> </chapter> </book>
生成文档
$ xsltproc /usr/share/xml/docbook/stylesheet/docbook-xsl/xhtml/docbook.xsl book.xml > book.html
原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。