Gentoo Archives: gentoo-commits

From: "Göktürk Yüksek" <gokturk@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/devmanual:devbook-guide commit in: appendices/contributing/devbook-guide/
Date: Wed, 12 Apr 2017 21:24:23
Message-Id: 1492020031.e86ac3f696f078dc7aedc5b56111098c16934c10.gokturk@gentoo
1 commit: e86ac3f696f078dc7aedc5b56111098c16934c10
2 Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 12 18:00:31 2017 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 12 18:00:31 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=e86ac3f6
7
8 appendices/contributing/devbook-guide: remove unnecessary sections 3 and 4
9
10 Remove the unnecessary sections "Handbook Format" and
11 "Advanced Handbook Features".
12
13 appendices/contributing/devbook-guide/text.xml | 279 -------------------------
14 1 file changed, 279 deletions(-)
15
16 diff --git a/appendices/contributing/devbook-guide/text.xml b/appendices/contributing/devbook-guide/text.xml
17 index a4a69af..4f4e8ac 100644
18 --- a/appendices/contributing/devbook-guide/text.xml
19 +++ b/appendices/contributing/devbook-guide/text.xml
20 @@ -767,285 +767,6 @@ obvious.
21 </section>
22 </chapter>
23
24 -<chapter>
25 -<title>Handbook Format</title>
26 -<section>
27 -<title>Guide vs Book</title>
28 -<body>
29 -
30 -<p>
31 -For high-volume documentation, such as the <uri
32 -link="/doc/en/handbook/handbook-x86.xml?part=1">Installation Instructions</uri>, a
33 -broader format was needed. We designed a GuideXML-compatible enhancement that
34 -allows us to write modular and multi-page documentation.
35 -</p>
36 -
37 -</body>
38 -</section>
39 -<section>
40 -<title>Main File</title>
41 -<body>
42 -
43 -<p>
44 -The first change is the need for a "master" document. This document contains no
45 -real content, but links to the individual documentation modules. The syntax
46 -doesn't differ much from GuideXML:
47 -</p>
48 -
49 -<pre caption="Example book usage">
50 -&lt;?xml version='1.0' encoding='UTF-8'?&gt;
51 -&lt;!DOCTYPE book SYSTEM "/dtd/book.dtd"&gt;
52 -&lt;!-- &#36;Header&#36; --&gt;
53 -
54 -&lt;<i>book</i>&gt;
55 -&lt;title&gt;Example Book Usage&lt;/title&gt;
56 -
57 -&lt;author...&gt;
58 - ...
59 -&lt;/author&gt;
60 -
61 -&lt;abstract&gt;
62 - ...
63 -&lt;/abstract&gt;
64 -
65 -&lt;!-- The content of this document is licensed under the CC-BY-SA license --&gt;
66 -&lt;!-- See http://creativecommons.org/licenses/by-sa/3.0 --&gt;
67 -&lt;license version="3.0"/&gt;
68 -
69 -&lt;version&gt;...&lt;/version&gt;
70 -&lt;date&gt;...&lt;/date&gt;
71 -</pre>
72 -
73 -<p>
74 -So far no real differences (except for the <c>&lt;book&gt;</c> instead of
75 -<c>&lt;guide&gt;</c> tag). Instead of starting with the individual
76 -<c>&lt;chapter&gt;</c>s, you define a <c>&lt;part&gt;</c>, which is the
77 -equivalent of a separate part in a book:
78 -</p>
79 -
80 -<pre caption="Defining a part">
81 -&lt;part&gt;
82 -&lt;title&gt;Part One&lt;/title&gt;
83 -&lt;abstract&gt;
84 - ...
85 -&lt;/abstract&gt;
86 -
87 -<comment>(Defining the several chapters)</comment>
88 -&lt;/part&gt;
89 -</pre>
90 -
91 -<p>
92 -Each part is accompanied by a <c>&lt;title&gt;</c> and an
93 -<c>&lt;abstract&gt;</c> which gives a small introduction to the part.
94 -</p>
95 -
96 -<p>
97 -Inside each part, you define the individual <c>&lt;chapter&gt;</c>s. Each
98 -chapter <e>must</e> be a separate document. As a result it is no surprise that
99 -a special tag (<c>&lt;include&gt;</c>) is added to allow including the separate
100 -document.
101 -</p>
102 -
103 -<pre caption="Defining a chapter">
104 -&lt;chapter&gt;
105 -&lt;title&gt;Chapter One&lt;/title&gt;
106 -
107 - &lt;include href="path/to/chapter-one.xml"/&gt;
108 -
109 -&lt;/chapter&gt;
110 -</pre>
111 -
112 -</body>
113 -</section>
114 -<section>
115 -<title>Designing the Individual Chapters</title>
116 -<body>
117 -
118 -<p>
119 -The content of an individual chapter is structured as follows:
120 -</p>
121 -
122 -<pre caption="Chapter Syntax">
123 -&lt;?xml version='1.0' encoding='UTF-8'?&gt;
124 -&lt;!DOCTYPE sections SYSTEM "/dtd/book.dtd"&gt;
125 -&lt;!-- &#36;Header&#36; --&gt;
126 -
127 -&lt;!-- The content of this document is licensed under the CC-BY-SA license --&gt;
128 -&lt;!-- See http://creativecommons.org/licenses/by-sa/3.0 --&gt;
129 -
130 -&lt;sections&gt;
131 -
132 -&lt;abstract&gt;
133 - This is a small explanation on chapter one.
134 -&lt;/abstract&gt;
135 -
136 -&lt;version&gt;...&lt;/version&gt;
137 -&lt;date&gt;...&lt;/date&gt;
138 -
139 -<comment>(Define the several &lt;section&gt; and &lt;subsection&gt;)</comment>
140 -
141 -&lt;/sections&gt;
142 -</pre>
143 -
144 -<p>
145 -Inside each chapter you can define <c>&lt;section&gt;</c>s (equivalent of
146 -<c>&lt;chapter&gt;</c> in a Guide) and <c>&lt;subsection&gt;</c>s (equivalent
147 -of <c>&lt;section&gt;</c> in a Guide).
148 -</p>
149 -
150 -<p>
151 -Each individual chapter should have its own date and version elements. The
152 -latest date of all chapters and master document will be displayed when a user
153 -browses through all parts of the book.
154 -</p>
155 -
156 -</body>
157 -</section>
158 -</chapter>
159 -
160 -<chapter>
161 -<title>Advanced Handbook Features</title>
162 -<section>
163 -<title>Global Values</title>
164 -<body>
165 -
166 -<p>
167 -Sometimes, the same values are repeated many times in several parts of a
168 -handbook. Global search and replace operations tend to forget some or introduce
169 -unwanted changes. Besides, it can be useful to define different values to be
170 -used in shared chapters depending on which handbook includes the chapter.
171 -</p>
172 -
173 -<p>
174 -Global values can be defined in a handbook master file and used in all included
175 -chapters.
176 -</p>
177 -
178 -<p>
179 -To define global values, add a <c>&lt;values&gt;</c> element to the handbook
180 -master file. Each value is then defined in a <c>&lt;key&gt;</c> element whose
181 -<c>id</c> attribute identifies the value, i.e. it is the name of your variable.
182 -The content of the <c>&lt;key&gt;</c> is its value.
183 -</p>
184 -
185 -<p>
186 -The following example defines three values in a handbook master file:
187 -</p>
188 -
189 -<pre caption="Define values in a handbook">
190 -&lt;?xml version='1.0' encoding='UTF-8'?&gt;
191 -&lt;!DOCTYPE book SYSTEM "/dtd/book.dtd"&gt;
192 -&lt;!-- &#36;Header&#36; --&gt;
193 -
194 -&lt;book&gt;
195 -&lt;title&gt;Example Book Usage&lt;/title&gt;
196 -
197 -<i>&lt;values>
198 - &lt;key id="arch"&gt;x86&lt;/key&gt;
199 - &lt;key id="min-cd-name"&gt;install-x86-minimal-2007.0-r1.iso&lt;/key&gt;
200 - &lt;key id="min-cd-size"&gt;57&lt;/key&gt;
201 -&lt;/values&gt;</i>
202 -
203 -&lt;author...&gt;
204 - ...
205 -&lt;/author&gt;
206 -
207 -...
208 -</pre>
209 -
210 -<p>
211 -The defined values can then be used throughout the handbook with the in-line
212 -<c>&lt;keyval id="key_id"/&gt;</c> element. Specify the name of the key in its
213 -<c>id</c> attribute, e.g. &lt;keyval id="min-cd-name"/&gt; would be replaced by
214 -"install-x86-minimal-2007.0-r1.iso" in our example.
215 -</p>
216 -
217 -<pre caption="Using defined values">
218 -&lt;p&gt;
219 -The Minimal Installation CD is called &lt;c&gt;<i>&lt;keyval id="min-cd-name"/&gt;</i>&lt;/c&gt;
220 -and takes up only <i>&lt;keyval id="min-cd-size"/&gt;</i> MB of diskspace. You can use this
221 -Installation CD to install Gentoo, but &lt;e&gt;only&lt;/e&gt; with a working Internet
222 -connection.
223 -&lt;/p&gt;
224 -</pre>
225 -
226 -<p>
227 -To make life easier on our translators, only use actual values, i.e. content
228 -that does not need to be translated. For instance, we defined the
229 -<c>min-cd-size</c> value to <c>57</c> and not <c>57 MB</c>.
230 -</p>
231 -
232 -</body>
233 -</section>
234 -<section>
235 -<title>Conditional Elements</title>
236 -<body>
237 -
238 -<p>
239 -Chapters that are shared by several handbooks such as our <uri
240 -link="/doc/en/handbook/">Installation Handbooks</uri> often have small
241 -differences depending on which handbook includes them. Instead of adding
242 -content that is irrelevant to some handbooks, authors can add a condition to
243 -the following elements: <c>&lt;section&gt;</c>, <c>&lt;subsection&gt;</c>,
244 -<c>&lt;body&gt;</c>, <c>&lt;note&gt;</c>, <c>&lt;impo&gt;</c>,
245 -<c>&lt;warn&gt;</c>, <c>&lt;pre&gt;</c>, <c>&lt;p&gt;</c>,
246 -<c>&lt;table&gt;</c>, <c>&lt;tr&gt;</c>, <c>&lt;ul&gt;</c>, <c>&lt;ol&gt;</c>
247 -and <c>&lt;li&gt;</c>.
248 -</p>
249 -
250 -<p>
251 -The condition must be an <uri
252 -link="http://en.wikipedia.org/wiki/XPath">XPATH</uri> expression that will be
253 -evaluated when transforming the XML. If it evaluates to <c>true</c>, the
254 -element is processed, if not, it is ignored. The condition is specified in a
255 -<c>test</c> attribute.
256 -</p>
257 -
258 -<p>
259 -The following example uses the <c>arch</c> value that is defined in each
260 -handbook master file to condition some content:
261 -</p>
262 -
263 -<pre caption="Using conditional elements">
264 -&lt;body test="contains('AMD64 x86',func:keyval('arch'))"&gt;
265 -
266 -&lt;p&gt;
267 -This paragraph applies to both x86 and AMD64 architectures.
268 -&lt;/p&gt;
269 -
270 -&lt;p test="func:keyval('arch')='x86'"&gt;
271 -This paragraph only applies to the x86 architecture.
272 -&lt;/p&gt;
273 -
274 -&lt;p test="func:keyval('arch')='AMD64'"&gt;
275 -This paragraph only applies to the AMD64 architecture.
276 -&lt;/p&gt;
277 -
278 -&lt;p test="func:keyval('arch')='PPC'"&gt;
279 -This paragraph will never be seen!
280 -The whole body is skipped because of the first condition.
281 -&lt;/p&gt;
282 -
283 -&lt;/body&gt;
284 -
285 -&lt;body test="contains('AMD64 PPC64',func:keyval('arch'))"&gt;
286 -
287 -&lt;p&gt;
288 -This paragraph applies to the AMD64, PPC64 <comment>and PPC</comment> architectures because
289 -the 'AMD64 PPC64' string does contain 'PPC'.
290 -&lt;/p&gt;
291 -
292 -&lt;note test="func:keyval('arch')='AMD64' or func:keyval('arch')='PPC64'"&gt;
293 -This note only applies to the AMD64 and PPC64 architectures.
294 -&lt;/note&gt;
295 -
296 -&lt;/body&gt;
297 -</pre>
298 -
299 -</body>
300 -</section>
301 -</chapter>
302 -
303 <chapter id="codingstyle">
304 <title>Coding Style</title>
305 <section>