Mercurial > hgbook
comparison README @ 725:83a687a996b2
Basically completed Docbook xml make environment
author | Dongsheng Song <dongsheng.song@gmail.com> |
---|---|
date | Thu, 12 Mar 2009 15:52:36 +0800 |
parents | |
children | d8c85d831fb4 |
comparison
equal
deleted
inserted
replaced
724:cfdb601a3c8b | 725:83a687a996b2 |
---|---|
1 HOW-TO: Compiling the Mercurial Book | |
2 ====================================== | |
3 | |
4 This Mercurial Book is written in DocBook 4.5. | |
5 | |
6 The goal of this document is to give simple instructions to anyone who | |
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 | |
11 Table of Contents: | |
12 | |
13 I. PRIMER | |
14 II. COMPILING THE DOCS | |
15 III. HACKING ON THE DOCS | |
16 | |
17 I. PRIMER | |
18 | |
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/ |