comparison README @ 765:d8c85d831fb4

Merge with http://hg.serpentine.com/mercurial/book
author Dongsheng Song <songdongsheng@live.cn>
date Tue, 31 Mar 2009 21:17:59 +0800
parents 83a687a996b2 a21668c4af50
children
comparison
equal deleted inserted replaced
764:53f179393f5c 765:d8c85d831fb4
1 HOW-TO: Compiling the Mercurial Book 1 Mercurial: The Definitive Guide
2 ====================================== 2 -------------------------------
3 3
4 This Mercurial Book is written in DocBook 4.5. 4 Welcome to the source code for the book. You can clone the definitive
5 copy of the source tree using Mercurial as follows:
5 6
6 The goal of this document is to give simple instructions to anyone who 7 hg clone http://hg.serpentine.com/mercurial/book
7 wants to compile this book into a useful format, like HTML or PDF. It
8 should state *exactly* which tools to use, and how to invoke them, in
9 simplest terms.
10 8
11 Table of Contents: 9 Here's a top-level tour of interesting directories:
12 10
13 I. PRIMER 11 en English-language content
14 II. COMPILING THE DOCS 12 es Spanish-language content
15 III. HACKING ON THE DOCS 13 examples Miscellaneous example scripts
16 14 tools Old, largely unused conversion scripts
17 I. PRIMER 15 web Content and comment system for http://hgbook.red-bean.com/
18 16 xsl XSLT scripts for generating HTML
19 DocBook has a tortured, confusing history. Before you do anything,
20 take a look at Eric Raymond's excellent "DocBook Demystification HOWTO":
21
22 http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/
23
24 It's very short and clears up many things.
25
26
27 II. COMPILING THE DOCS
28
29
30 1. Install XML DTD and XSL stylesheets for DocBook
31
32 % sudo apt-get install docbook-xml docbook-xsl
33
34 2. Install libxml2-utils
35
36 % sudo apt-get install libxml2-utils
37
38 3. Install graph drawing tools
39
40 % sudo apt-get install graphviz inkscape
41
42 4. Install pdf support
43
44 % sudo apt-get install openjdk-6-jdk docbook-xsl-saxon libsaxon-java fop
45
46 The Makefile will actually invoke tools/fop/fop.sh, you should do
47 some trick, let fop's CLASSPATH include saxon.jar and docbook-xsl-saxon.jar .
48
49 5. Make
50 Run 'make' for more details, for example:
51
52 * make all document(pdf, html and html-single for all languages)
53 % make all
54
55 * make english document(pdf, html and html-single for all languages)
56 % make LINGUA=en all
57
58 * make Chinese document(pdf, html and html-single for all languages)
59 % make LINGUA=zh all
60
61 * make Chinese pdf document
62 % make LINGUA=zh pdf
63
64 III. HACKING ON THE DOCS
65
66 In addition to everything in section II:
67
68
69 1. Get a nice editing environment for SGML/XML.
70
71 This isn't strictly required, but it's nice when your editor
72 colorizes things, understands the DTD, tells you what tags you can
73 insert, etc.
74
75 If you use emacs, we recommend the PSGML major-mode. Most free
76 operating systems package it, or its home page is here:
77
78 http://www.lysator.liu.se/projects/about_psgml.html
79
80 If you use vim, you might check out xmledit, at:
81
82 http://www.vim.org/scripts/script.php?script_id=301
83
84
85 2. Get a validating parser.
86
87 Actually, if you have what you need to compile the documentation,
88 then you almost certainly have an XML validator installed already -
89 it is called xmllint, and comes as part of libxml2.
90
91 The makefile is preconfigured with a suitable invocation of it,
92 so simply run:
93
94 $ make validate
95
96 3. Read about DocBook.
97
98 You'll want to get real intimate with a DocBook reference, such as
99 can be found at: http://www.docbook.org/tdg/en/html/