Home | 简体中文 | 繁体中文 | 杂文 | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | Github | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

第 30 章 写作团队的运作

目录

30.1. Docbook 环境初始化
30.1.1. FreeBSD
30.1.2. Ubuntu/Debian
30.2. Subversion 版本控制
30.3. GIT

前提条件: subversion 服务器一台,或者使用sf.net, github.com, code.google.com 等等提供的服务,团队人员需要懂得docbook以及配置docbook环境

30.1. Docbook 环境初始化

30.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
			

30.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