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/, appendices/contributing/
Date: Wed, 12 Apr 2017 21:24:18
Message-Id: 1492017578.8be0d382fb82dc4cfe73b1b85bb7fc3c923a21c7.gokturk@gentoo
1 commit: 8be0d382fb82dc4cfe73b1b85bb7fc3c923a21c7
2 Author: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 12 15:37:57 2017 +0000
4 Commit: Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
5 CommitDate: Wed Apr 12 17:19:38 2017 +0000
6 URL: https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=8be0d382
7
8 appendices/contributing/devbook-guide: initial commit
9
10 Imported from:
11 https://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo/xml/htdocs/doc/en/xml-guide.xml?revision=1.72
12
13 The only modifications that have been made are the removals of DOCTYPE
14 and the CVS header, and the addition of self attribute to <guide>
15
16 appendices/contributing/devbook-guide/text.xml | 1224 ++++++++++++++++++++++++
17 appendices/contributing/text.xml | 3 +-
18 2 files changed, 1226 insertions(+), 1 deletion(-)
19
20 diff --git a/appendices/contributing/devbook-guide/text.xml b/appendices/contributing/devbook-guide/text.xml
21 new file mode 100644
22 index 0000000..a4a69af
23 --- /dev/null
24 +++ b/appendices/contributing/devbook-guide/text.xml
25 @@ -0,0 +1,1224 @@
26 +<?xml version="1.0" encoding="UTF-8"?>
27 +
28 +<guide self="appendices/contributing/devbook-guide/">
29 +<title>Gentoo GuideXML Guide</title>
30 +
31 +<author title="Author">
32 + <mail link="neysx"/>
33 +</author>
34 +<author title="Author">
35 + <mail link="drobbins@g.o">Daniel Robbins</mail>
36 +</author>
37 +<author title="Author"><!-- zhen@g.o -->
38 + John P. Davis
39 +</author>
40 +<author title="Editor">
41 + <mail link="peesh@g.o">Jorge Paulo</mail>
42 +</author>
43 +<author title="Editor">
44 + <mail link="swift@g.o">Sven Vermeulen</mail>
45 +</author>
46 +<author title="Editor">
47 + <mail link="nightmorph"/>
48 +</author>
49 +
50 +<abstract>
51 +This guide shows you how to compose web documentation using the new lightweight
52 +Gentoo GuideXML syntax. This syntax is the official format for Gentoo
53 +documentation, and this document itself was created using GuideXML. This guide
54 +assumes a basic working knowledge of XML and HTML.
55 +</abstract>
56 +
57 +<!-- The content of this document is licensed under the CC-BY-SA license -->
58 +<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
59 +<license/>
60 +
61 +<version>13</version>
62 +<date>2012-10-07</date>
63 +
64 +<chapter>
65 +<title>GuideXML basics</title>
66 +<section>
67 +<title>GuideXML design goals</title>
68 +<body>
69 +
70 +<p>
71 +The guideXML syntax is lightweight yet expressive, so that it is easy to
72 +learn yet also provides all the features we need for the creation of web
73 +documentation. The number of tags is kept to a minimum -- just those we need.
74 +This makes it easy to transform guide into other formats, such as DocBook
75 +XML/SGML or web-ready HTML.
76 +</p>
77 +
78 +<p>
79 +The goal is to make it easy to <e>create</e> and <e>transform</e> guideXML
80 +documents.
81 +</p>
82 +
83 +</body>
84 +</section>
85 +<section>
86 +<title>Further Resources</title>
87 +<body>
88 +
89 +<p>
90 +If you are planning on contributing documentation to Gentoo, or you want to
91 +test GuideXML, please read our <uri
92 +link="/proj/en/gdp/doc/doc-tipsntricks.xml">Doc Tips 'n' Tricks</uri> guide
93 +which contains tips and tricks for documentation development.
94 +</p>
95 +
96 +<p>
97 +You may want to look at the <uri link="?passthru=1">XML source</uri> of this
98 +document while you read it.
99 +</p>
100 +
101 +</body>
102 +</section>
103 +</chapter>
104 +
105 +<chapter>
106 +<title>GuideXML</title>
107 +<section>
108 +<title>Basic structure</title>
109 +<body>
110 +
111 +<p>
112 +Let's start learning the GuideXML syntax. We'll start with the the initial
113 +tags used in a GuideXML document:
114 +</p>
115 +
116 +<pre caption="The initial part of a guide XML document">
117 +&lt;?xml version="1.0" encoding="UTF-8"?&gt;
118 +&lt;!DOCTYPE guide SYSTEM "/dtd/guide.dtd"&gt;
119 +&lt;!-- &#36;Header&#36; --&gt;
120 +
121 +&lt;guide lang="<i>en</i>"&gt;
122 +&lt;title&gt;<i>Gentoo Documentation Guide</i>&lt;/title&gt;
123 +
124 +&lt;author title="<i>Author</i>"&gt;
125 + &lt;mail link="<i>yourname@g.o</i>"&gt;<i>Your Name</i>&lt;/mail&gt;
126 +&lt;/author&gt;
127 +
128 +&lt;abstract&gt;
129 +<i>This guide shows you how to compose web documentation using
130 +our new lightweight Gentoo GuideXML syntax. This syntax is the official
131 +format for Gentoo web documentation, and this document itself was created
132 +using GuideXML.</i>
133 +&lt;/abstract&gt;
134 +
135 +&lt;!-- The content of this document is licensed under the CC-BY-SA license --&gt;
136 +&lt;!-- See http://creativecommons.org/licenses/by-sa/3.0 --&gt;
137 +&lt;license version="3.0"/&gt;
138 +
139 +&lt;version&gt;<i>1</i>&lt;/version&gt;
140 +&lt;date&gt;<i>2011-11-29</i>&lt;/date&gt;
141 +</pre>
142 +
143 +<p>
144 +On the first lines, we see the requisite tag that identifies this as an XML
145 +document and specifies its DTD. The <c>&lt;!-- &#36;Header&#36; --&gt;</c> line
146 +will be automatically modified by the CVS server and helps to track revisions.
147 +Next, there's a <c>&lt;guide&gt;</c> tag -- the entire guide document is
148 +enclosed within a <c>&lt;guide&gt; &lt;/guide&gt;</c> pair.
149 +<br/>
150 +The <c>lang</c> attribute should be used to specify the language code of your
151 +document. It is used to format the date and insert strings like "<e>Note</e>",
152 +"<e>Content</e>", etc. in the specified language. The default is English.
153 +</p>
154 +
155 +<p>
156 +Next, there's a <c>&lt;title&gt;</c> tag, used to set the title for the entire
157 +guide document.
158 +</p>
159 +
160 +<p>
161 +Then, we come to the <c>&lt;author&gt;</c> tags, which contain information
162 +about the various authors of the document. Each <c>&lt;author&gt;</c> tag
163 +allows for an optional <c>title</c> element, used to specify the author's
164 +relationship to the document (author, co-author, editor, etc.). In this
165 +particular example, the authors' names are enclosed in another tag -- a
166 +<c>&lt;mail&gt;</c> tag, used to specify an email address for this particular
167 +person. The <c>&lt;mail&gt;</c> tag is optional and can be omitted, and at
168 +least one <c>&lt;author&gt;</c> element is required per guide document.
169 +</p>
170 +
171 +<p>
172 +Next, we come to the <c>&lt;abstract&gt;</c>, <c>&lt;version&gt;</c> and
173 +<c>&lt;date&gt;</c> tags, used to specify a summary of the document, the
174 +current version number, and the current version date (in YYYY-MM-DD format)
175 +respectively. Dates that are invalid or not in the YYYY-MM-DD format will
176 +appear verbatim in the rendered document.
177 +</p>
178 +
179 +<p>
180 +This sums up the tags that should appear at the beginning of a guide document.
181 +Besides the <c>&lt;title&gt;</c> and <c>&lt;mail&gt;</c> tags, these tags
182 +shouldn't appear anywhere else except immediately inside the
183 +<c>&lt;guide&gt;</c> tag, and for consistency it's recommended (but not
184 +required) that these tags appear before the content of the document.
185 +</p>
186 +
187 +<p>
188 +Finally we have the <c>&lt;license version="3.0"/&gt;</c> tag, used to publish
189 +the document under the <uri link="http://creativecommons.org/licenses/by-sa/3.0/">Creative
190 +Commons - Attribution / Share Alike</uri> license as required by the <uri
191 +link="/proj/en/gdp/doc/doc-policy.xml">Documentation Policy</uri>. Historically,
192 +the tag <c>&lt;license /&gt;</c> was used, which denoted the 2.5 version of the
193 +license. This is still accepted/allowed.
194 +</p>
195 +
196 +</body>
197 +</section>
198 +<section>
199 +<title>Chapters and sections</title>
200 +<body>
201 +
202 +<p>
203 +Once the initial tags have been specified, you're ready to start adding the
204 +structural elements of the document. Guide documents are divided into
205 +chapters, and each chapter can hold one or more sections. Every chapter and
206 +section has a title. Here's an example chapter with a single section,
207 +consisting of a paragraph. If you append this XML to the XML in the <uri
208 +link="#doc_chap2_pre1">previous excerpt</uri> and append a
209 +<c>&lt;/guide&gt;</c> to the end of the file, you'll have a valid (if minimal)
210 +guide document:
211 +</p>
212 +
213 +<pre caption="Minimal guide example">
214 +&lt;chapter&gt;
215 +&lt;title&gt;<i>This is my chapter</i>&lt;/title&gt;
216 +&lt;section&gt;
217 +&lt;title&gt;<i>This is section one of my chapter</i>&lt;/title&gt;
218 +&lt;body&gt;
219 +
220 +&lt;p&gt;
221 +<i>This is the actual text content of my section.</i>
222 +&lt;/p&gt;
223 +
224 +&lt;/body&gt;
225 +&lt;/section&gt;
226 +&lt;/chapter&gt;
227 +</pre>
228 +
229 +<p>
230 +Above, I set the chapter title by adding a child <c>&lt;title&gt;</c>
231 +element to the <c>&lt;chapter&gt;</c> element. Then, I created a section by
232 +adding a <c>&lt;section&gt;</c> element. If you look inside the
233 +<c>&lt;section&gt;</c> element, you'll see that it has two child elements -- a
234 +<c>&lt;title&gt;</c> and a <c>&lt;body&gt;</c>. While the <c>&lt;title&gt;</c>
235 +is nothing new, the <c>&lt;body&gt;</c> is -- it contains the actual text
236 +content of this particular section. We'll look at the tags that are allowed
237 +inside a <c>&lt;body&gt;</c> element in a bit.
238 +</p>
239 +
240 +<note>
241 +A <c>&lt;guide&gt;</c> element must contain at least one <c>&lt;chapter&gt;</c>
242 +elements, a <c>&lt;chapter&gt;</c> must contain at least one
243 +<c>&lt;section&gt;</c> elements and a <c>&lt;section&gt;</c> element must
244 +contain at least one <c>&lt;body&gt;</c> element.
245 +</note>
246 +
247 +</body>
248 +</section>
249 +<section>
250 +<title>An example &lt;body&gt;</title>
251 +<body>
252 +
253 +<p>
254 +Now, it's time to learn how to mark up actual content. Here's the XML code for
255 +an example <c>&lt;body&gt;</c> element:
256 +</p>
257 +
258 +<pre caption="Example of a body element">
259 +&lt;p&gt;
260 +This is a paragraph. &lt;path&gt;/etc/passwd&lt;/path&gt; is a file.
261 +&lt;uri&gt;http://forums.gentoo.org&lt;/uri&gt; is my favorite website.
262 +Type &lt;c&gt;ls&lt;/c&gt; if you feel like it. I &lt;e&gt;really&lt;/e&gt; want to go to sleep now.
263 +&lt;/p&gt;
264 +
265 +&lt;pre caption="Code Sample"&gt;
266 +This is text output or code.
267 +# &lt;i&gt;this is user input&lt;/i&gt;
268 +
269 +Make HTML/XML easier to read by using selective emphasis:
270 +&lt;foo&gt;&lt;i&gt;bar&lt;/i&gt;&lt;/foo&gt;
271 +
272 +&lt;comment&gt;(This is how to insert a comment into a code block)&lt;/comment&gt;
273 +&lt;/pre&gt;
274 +
275 +&lt;note&gt;
276 +This is a note.
277 +&lt;/note&gt;
278 +
279 +&lt;warn&gt;
280 +This is a warning.
281 +&lt;/warn&gt;
282 +
283 +&lt;impo&gt;
284 +This is important.
285 +&lt;/impo&gt;
286 +</pre>
287 +
288 +<p>
289 +Now, here's how the <c>&lt;body&gt;</c> element above is rendered:
290 +</p>
291 +
292 +<p>
293 +This is a paragraph. <path>/etc/passwd</path> is a file.
294 +<uri>http://forums.gentoo.org</uri> is my favorite web site.
295 +Type <c>ls</c> if you feel like it. I <e>really</e> want to go to sleep now.
296 +</p>
297 +
298 +<pre caption="Code Sample">
299 +This is text output or code.
300 +# <i>this is user input</i>
301 +
302 +Make HTML/XML easier to read by using selective emphasis:
303 +&lt;foo&gt;<i>bar</i>&lt;/foo&gt;
304 +
305 +<comment>(This is how to insert a comment into a code block)</comment>
306 +</pre>
307 +
308 +<note>
309 +This is a note.
310 +</note>
311 +
312 +<warn>
313 +This is a warning.
314 +</warn>
315 +
316 +<impo>
317 +This is important.
318 +</impo>
319 +
320 +</body>
321 +</section>
322 +<section>
323 +<title>The &lt;body&gt; tags</title>
324 +<body>
325 +
326 +<p>
327 +We introduced a lot of new tags in the previous section -- here's what you need
328 +to know. The <c>&lt;p&gt;</c> (paragraph), <c>&lt;pre&gt;</c> (code block),
329 +<c>&lt;note&gt;</c>, <c>&lt;warn&gt;</c> (warning) and <c>&lt;impo&gt;</c>
330 +(important) tags all can contain one or more lines of text. Besides the
331 +<c>&lt;table&gt;</c>, <c>&lt;ul&gt;</c>, <c>&lt;ol&gt;</c> and
332 +<c>&lt;dl&gt;</c> elements (which we'll cover in just a bit), these are the
333 +only tags that should appear immediately inside a <c>&lt;body&gt;</c> element.
334 +Another thing -- these tags <e>should not</e> be stacked -- in other words,
335 +don't put a <c>&lt;note&gt;</c> element inside a <c>&lt;p&gt;</c> element. As
336 +you might guess, the <c>&lt;pre&gt;</c> element preserves its whitespace
337 +exactly, making it well-suited for code excerpts. You must name the
338 +<c>&lt;pre&gt;</c> tag with a <c>caption</c> attribute:
339 +</p>
340 +
341 +<pre caption="Named &lt;pre&gt;">
342 +&lt;pre caption="Output of uptime"&gt;
343 +# &lt;i&gt;uptime&lt;/i&gt;
344 +16:50:47 up 164 days, 2:06, 5 users, load average: 0.23, 0.20, 0.25
345 +&lt;/pre&gt;
346 +</pre>
347 +
348 +</body>
349 +</section>
350 +<section>
351 +<title>Epigraphs</title>
352 +<body>
353 +
354 +<p by="Anonymous student">
355 +Delegates from the original 13 states formed the Contented Congress. Thomas
356 +Jefferson, a Virgin, and Benjamin Franklin were two singers of the Declaration
357 +of Independence. Franklin discovered electricity by rubbing two cats backwards
358 +and declared, "A horse divided against itself cannot stand." Franklin died in
359 +1790 and is still dead.
360 +</p>
361 +
362 +<p>
363 +Epigraphs are sometimes used at the beginning of chapters to illustrate what is
364 +to follow. It is simply a paragraph with a <c>by</c> attribute that contains
365 +the signature.
366 +</p>
367 +
368 +<pre caption="Short epigraph">
369 +&lt;p by="Anonymous student"&gt;
370 +Delegates from the original 13 states formed the...
371 +&lt;/p&gt;
372 +</pre>
373 +
374 +</body>
375 +</section>
376 +<section>
377 +<title>
378 + &lt;path&gt;, &lt;c&gt;, &lt;b&gt;, &lt;e&gt;, &lt;sub&gt; and &lt;sup&gt;
379 +</title>
380 +<body>
381 +
382 +<p>
383 +The <c>&lt;path&gt;</c>, <c>&lt;c&gt;</c>, <c>&lt;b&gt;</c>, <c>&lt;e&gt;</c>,
384 +<c>&lt;sub&gt;</c> and <c>&lt;sup&gt;</c> elements can be used inside any child
385 +<c>&lt;body&gt;</c> tag, except for <c>&lt;pre&gt;</c>.
386 +</p>
387 +
388 +<p>
389 +The <c>&lt;path&gt;</c> element is used to mark text that refers to an
390 +<e>on-disk file</e> -- either an <e>absolute or relative path</e>, or a
391 +<e>simple filename</e>. This element is generally rendered with a mono spaced
392 +font to offset it from the standard paragraph type.
393 +</p>
394 +
395 +<p>
396 +The <c>&lt;c&gt;</c> element is used to mark up a <e>command</e> or <e>user
397 +input</e>. Think of <c>&lt;c&gt;</c> as a way to alert the reader to something
398 +that they can type in that will perform some kind of action. For example, all
399 +the XML tags displayed in this document are enclosed in a <c>&lt;c&gt;</c>
400 +element because they represent something that the user could type in that is
401 +not a path. By using <c>&lt;c&gt;</c> elements, you'll help your readers
402 +quickly identify commands that they need to type in. Also, because
403 +<c>&lt;c&gt;</c> elements are already offset from regular text, <e>it is rarely
404 +necessary to surround user input with double-quotes</e>. For example, don't
405 +refer to a "<c>&lt;c&gt;</c>" element like I did in this sentence. Avoiding
406 +the use of unnecessary double-quotes makes a document more readable -- and
407 +adorable!
408 +</p>
409 +
410 +<p>
411 +As you might have guessed, <c>&lt;b&gt;</c> is used to <b>boldface</b> some
412 +text.
413 +</p>
414 +
415 +<p>
416 +<c>&lt;e&gt;</c> is used to apply emphasis to a word or phrase; for example:
417 +I <e>really</e> should use semicolons more often. As you can see, this text is
418 +offset from the regular paragraph type for emphasis. This helps to give your
419 +prose more <e>punch</e>!
420 +</p>
421 +
422 +<p>
423 +The <c>&lt;sub&gt;</c> and <c>&lt;sup&gt;</c> elements are used to specify
424 +<sub>subscript</sub> and <sup>superscript</sup>.
425 +</p>
426 +
427 +</body>
428 +</section>
429 +<section>
430 +<title>Code samples and colour-coding</title>
431 +<body>
432 +
433 +<p>
434 +To improve the readability of code samples, the following tags are allowed
435 +inside <c>&lt;pre&gt;</c> blocks:
436 +</p>
437 +
438 +<dl>
439 + <dt><c>&lt;i&gt;</c></dt>
440 + <dd>Distinguishes user input from displayed text</dd>
441 + <dt><c>&lt;comment&gt;</c></dt>
442 + <dd>Comments relevant to the action(s) that appear after the comment</dd>
443 + <dt><c>&lt;keyword&gt;</c></dt>
444 + <dd>Denotes a keyword in the language used in the code sample
445 + </dd>
446 + <dt><c>&lt;ident&gt;</c></dt>
447 + <dd>Used for an identifier
448 + </dd>
449 + <dt><c>&lt;const&gt;</c></dt>
450 + <dd>Used for a constant
451 + </dd>
452 + <dt><c>&lt;stmt&gt;</c></dt>
453 + <dd>Used for a statement
454 + </dd>
455 + <dt><c>&lt;var&gt;</c></dt>
456 + <dd>Used for a variable
457 + </dd>
458 +</dl>
459 +
460 +<note>
461 +Remember that all leading and trailing spaces, and line breaks in
462 +<c>&lt;pre&gt;</c> blocks will appear in the displayed html page.
463 +</note>
464 +
465 +<p>
466 +Sample colour-coded <c>&lt;pre&gt;</c> block:
467 +</p>
468 +
469 +<pre caption="My first ebuild">
470 +<comment># Copyright 1999-2009 <b>Gentoo Foundation</b>
471 +# Distributed under the terms of the GNU General Public License v2
472 +# &#36;Header: $</comment>
473 +
474 +<ident>DESCRIPTION</ident>=<const>"Exuberant ctags generates tags files for quick source navigation"</const>
475 +<ident>HOMEPAGE</ident>=<const>"http://ctags.sourceforge.net"</const>
476 +<ident>SRC_URI</ident>=<const>"mirror://sourceforge/ctags/<var>${P}</var>.tar.gz"</const>
477 +
478 +<ident>LICENSE</ident>=<const>"GPL-2"</const>
479 +<ident>SLOT</ident>=<const>"0"</const>
480 +<ident>KEYWORDS</ident>=<const>"~mips ~sparc ~x86"</const>
481 +<ident>IUSE</ident>=<const>""</const>
482 +
483 +<stmt>src_compile()</stmt> {
484 + <keyword>econf</keyword> --with-posix-regex
485 + <keyword>emake</keyword> || <keyword>die</keyword> <const>"emake failed"</const>
486 +}
487 +
488 +<stmt>src_install()</stmt> {
489 + <keyword>make</keyword> <ident>DESTDIR</ident>="<var>${D}</var>" install || <keyword>die</keyword> <const>"install failed"</const>
490 +
491 + <keyword>dodoc</keyword> FAQ NEWS README
492 + <keyword>dohtml</keyword> EXTENDING.html ctags.html
493 +}
494 +</pre>
495 +
496 +</body>
497 +</section>
498 +<section>
499 +<title>&lt;mail&gt; and &lt;uri&gt;</title>
500 +<body>
501 +
502 +<p>
503 +We've taken a look at the <c>&lt;mail&gt;</c> tag earlier; it's used to link
504 +some text with a particular email address, and takes the form <c>&lt;mail
505 +link="foo.bar@×××××××.com"&gt;Mr. Foo Bar&lt;/mail&gt;</c>. If you want to display the
506 +email address, you can use <c>&lt;mail&gt;foo.bar@×××××××.com&lt;/mail&gt;</c>, this
507 +would be displayed as <mail>foo.bar@×××××××.com</mail>.
508 +</p>
509 +
510 +<p>
511 +Shorter forms make it easier to use names and emails of Gentoo developers. Both
512 +<c>&lt;mail&gt;neysx&lt;/mail&gt;</c> and <c>&lt;mail link="neysx"/&gt;</c>
513 +would appear as <mail>neysx</mail>. If you want to use a Gentoo dev's email
514 +with a different content than his full name, use the second form with some
515 +content. For instance, use a dev's first name: <c>&lt;mail
516 +link="neysx"&gt;Xavier&lt;/mail&gt;</c> appears as <mail
517 +link="neysx">Xavier</mail>.
518 +<br/>
519 +This is particularly useful when you want to name a developer whose name
520 +contains "funny" characters that you can't type.
521 +</p>
522 +
523 +<p>
524 +The <c>&lt;uri&gt;</c> tag is used to point to files/locations on the Internet.
525 +It has two forms -- the first can be used when you want to have the actual URI
526 +displayed in the body text, such as this link to
527 +<uri>http://forums.gentoo.org/</uri>. To create this link, I typed
528 +<c>&lt;uri&gt;http://forums.gentoo.org/&lt;/uri&gt;</c>. The alternate form is
529 +when you want to associate a URI with some other text -- for example, <uri
530 +link="http://forums.gentoo.org/">the Gentoo Forums</uri>. To create
531 +<e>this</e> link, I typed <c>&lt;uri link="http://forums.gentoo.org/"&gt;the
532 +Gentoo Forums&lt;/uri&gt;</c>. You don't need to write
533 +<c>http://www.gentoo.org/</c> to link to other parts of the Gentoo web site.
534 +For instance, a link to the <uri link="/doc/en/">documentation main index</uri>
535 +should be simply <c>&lt;uri link="/doc/en/index.xml"&gt;documentation main
536 +index&lt;/uri&gt;</c>. You can even omit <c>index.xml</c> when you link to a
537 +directory index, e.g. <c>&lt;uri link="/doc/en/"&gt;documentation main
538 +index&lt;/uri&gt;</c>. Leaving the trailing slash saves an extra HTTP request.
539 +</p>
540 +
541 +<p>
542 +You should not use a <c>&lt;uri&gt;</c> tag with a <c>link</c> attribute that
543 +starts with <c>mailto:</c>. In this case, use a <c>&lt;mail&gt;</c> tag.
544 +</p>
545 +
546 +<p>
547 +Please avoid the <uri link="http://en.wikipedia.org/wiki/Click_here">click here
548 +syndrome</uri> as recommended by the <uri
549 +link="http://www.w3.org/QA/Tips/noClickHere">W3C</uri>.
550 +</p>
551 +
552 +</body>
553 +</section>
554 +<section>
555 +<title>Figures</title>
556 +<body>
557 +
558 +<p>
559 +Here's how to insert a figure into a document -- <c>&lt;figure
560 +link="mygfx.png" short="my picture" caption="my favorite picture of all
561 +time"/&gt;</c>. The <c>link</c> attribute points to the actual graphic image,
562 +the <c>short</c> attribute specifies a short description (currently used for
563 +the image's HTML <c>alt</c> attribute), and a caption. Not too difficult
564 +:) We also support the standard HTML-style &lt;img src="foo.gif"/&gt; tag
565 +for adding images without captions, borders, etc.
566 +</p>
567 +
568 +</body>
569 +</section>
570 +<section>
571 +<title>Tables</title>
572 +<body>
573 +
574 +<p>
575 +GuideXML supports a simplified table syntax similar to that of HTML. To start a
576 +table, use a <c>&lt;table&gt;</c> tag. Start a row with a <c>&lt;tr&gt;</c>
577 +tag. However, for inserting actual table data, we <e>don't</e> support the HTML
578 +&lt;td&gt; tag; instead, use the <c>&lt;th&gt;</c> if you are inserting a
579 +header, and <c>&lt;ti&gt;</c> if you are inserting a normal informational
580 +block. You can use a <c>&lt;th&gt;</c> anywhere you can use a <c>&lt;ti&gt;</c>
581 +-- there's no requirement that <c>&lt;th&gt;</c> elements appear only in the
582 +first row.
583 +</p>
584 +
585 +<p>
586 +Besides, both table headers (<c>&lt;th&gt;</c>) and table items
587 +(<c>&lt;ti&gt;</c>) accept the <c>colspan</c> and <c>rowspan</c> attributes to
588 +span their content across rows, columns or both.
589 +</p>
590 +
591 +<p>
592 +Furthermore, table cells (<c>&lt;ti&gt;</c> &amp; <c>&lt;th&gt;</c>) can be
593 +right-aligned, left-aligned or centered with the <c>align</c> attribute.
594 +</p>
595 +
596 +<table>
597 + <tr>
598 + <th align="center" colspan="4">This title spans 4 columns</th>
599 + </tr>
600 + <tr>
601 + <th rowspan="6">This title spans 6 rows</th>
602 + <ti>Item A1</ti>
603 + <ti>Item A2</ti>
604 + <ti>Item A3</ti>
605 + </tr>
606 + <tr>
607 + <ti align="center">Item B1</ti>
608 + <th colspan="2" rowspan="2" align="right">Blocky 2x2 title</th>
609 + </tr>
610 + <tr>
611 + <ti align="right">Item C1</ti>
612 + </tr>
613 + <tr>
614 + <ti colspan="3" align="center">Item D1..D3</ti>
615 + </tr>
616 + <tr>
617 + <ti rowspan="2">Item E1..F1</ti>
618 + <ti colspan="2" align="right">Item E2..E3</ti>
619 + </tr>
620 + <tr>
621 + <ti colspan="2" align="right">Item F2..F3</ti>
622 + </tr>
623 +</table>
624 +
625 +</body>
626 +</section>
627 +<section>
628 +<title>Lists</title>
629 +<body>
630 +
631 +<p>
632 +To create ordered or unordered lists, simply use the XHTML-style
633 +<c>&lt;ol&gt;</c>, <c>&lt;ul&gt;</c> and <c>&lt;li&gt;</c> tags. Lists may only
634 +appear inside the <c>&lt;body&gt;</c> and <c>&lt;li&gt;</c> tags which means
635 +that you can have lists inside lists. Don't forget that you are writing XML and
636 +that you must close all tags including list items unlike in HTML.
637 +</p>
638 +
639 +<p>
640 +Definition lists (<c>&lt;dl&gt;</c>) are also supported. Please note that
641 +neither the definition term tag (<c>&lt;dt&gt;</c>) nor the definition data tag
642 +(<c>&lt;dd&gt;</c>) accept any other block level tag such as paragraphs or
643 +admonitions. A definition list comprises:
644 +</p>
645 +
646 +<dl>
647 + <dt><c>&lt;dl&gt;</c></dt>
648 + <dd>A <b>D</b>efinition <b>L</b>ist Tag containing</dd>
649 + <dt><c>&lt;dt&gt;</c></dt>
650 + <dd>Pairs of <b>D</b>efinition <b>T</b>erm Tags</dd>
651 + <dt><c>&lt;dd&gt;</c></dt>
652 + <dd>and <b>D</b>efinition <b>D</b>ata Tags</dd>
653 +</dl>
654 +
655 +<p>
656 +The following list copied from <uri
657 +link="http://www.w3.org/TR/REC-html40/struct/lists.html">w3.org</uri> shows
658 +that a definition list can contain ordered and unordered lists. It may not
659 +contain another definition list though.
660 +</p>
661 +
662 +<dl>
663 + <dt><b>The ingredients:</b></dt>
664 + <dd>
665 + <ul>
666 + <li>100 g. flour</li>
667 + <li>10 g. sugar</li>
668 + <li>1 cup water</li>
669 + <li>2 eggs</li>
670 + <li>salt, pepper</li>
671 + </ul>
672 + </dd>
673 + <dt><b>The procedure:</b></dt>
674 + <dd>
675 + <ol>
676 + <li>Mix dry ingredients thoroughly</li>
677 + <li>Pour in wet ingredients</li>
678 + <li>Mix for 10 minutes</li>
679 + <li>Bake for one hour at 300 degrees</li>
680 + </ol>
681 + </dd>
682 + <dt><b>Notes:</b></dt>
683 + <dd>The recipe may be improved by adding raisins</dd>
684 +</dl>
685 +
686 +</body>
687 +</section>
688 +<section>
689 +<title>Intra-document references</title>
690 +<body>
691 +
692 +<p>
693 +GuideXML makes it really easy to reference other parts of the document using
694 +hyperlinks. You can create a link pointing to <uri link="#doc_chap1">Chapter
695 +One</uri> by typing <c>&lt;uri link="#doc_chap1"&gt;Chapter
696 +One&lt;/uri&gt;</c>. To point to <uri link="#doc_chap1_sect2">section two of
697 +Chapter One</uri>, type <c>&lt;uri link="#doc_chap1_sect2"&gt;section two of
698 +Chapter One&lt;/uri&gt;</c>. To refer to figure 3 in chapter 1, type
699 +<c>&lt;uri link="#doc_chap1_fig3"&gt;figure 1.3&lt;/uri&gt;</c>. Or, to refer
700 +to <uri link="#doc_chap2_pre2">code listing 2 in chapter 2</uri>, type
701 +<c>&lt;uri link="#doc_chap2_pre2"&gt;code listing 2.2&lt;/uri&gt;</c>.
702 +</p>
703 +
704 +<p>
705 +However, some guides change often and using such "counting" can lead to broken
706 +links. In order to cope with this, you can define a name for a
707 +<c>&lt;chapter&gt;</c>, <c>&lt;section&gt;</c> or a <c>&lt;tr&gt;</c> by using
708 +the <c>id</c> attribute, and then point to that attribute, like this:
709 +</p>
710 +
711 +<pre caption="Using the id attribute">
712 +&lt;chapter id="foo"&gt;
713 +&lt;title&gt;This is foo!&lt;/title&gt;
714 +...
715 +&lt;p&gt;
716 +More information can be found in the &lt;uri link="#foo"&gt;foo chapter&lt;/uri&gt;
717 +&lt;/p&gt;
718 +</pre>
719 +
720 +</body>
721 +</section>
722 +<section>
723 +<title>Disclaimers and obsolete documents</title>
724 +<body>
725 +
726 +<p>
727 +A <c>disclaimer</c> attribute can be applied to guides and handbooks to display
728 +a predefined disclaimer at the top of the document. The available disclaimers
729 +are:
730 +</p>
731 +
732 +<ul>
733 + <li>
734 + <b>articles</b> is used for <uri link="/doc/en/articles/">republished
735 + articles</uri>
736 + </li>
737 + <li>
738 + <b>draft</b> is used to indicate a document is still being worked on and
739 + should not be considered official
740 + </li>
741 + <li>
742 + <b>oldbook</b> is used on old handbooks to indicate they are not maintained
743 + anymore
744 + </li>
745 + <li><b>obsolete</b> is used to mark a document as obsolete.</li>
746 +</ul>
747 +
748 +<p>
749 +When marking a document as obsolete, you might want to add a link to a new
750 +version. The <c>redirect</c> attribute does just that. The user might be
751 +automatically redirected to the new page but you should not rely on that
752 +behaviour.
753 +</p>
754 +
755 +<pre caption="Disclaimer sample">
756 +&lt;?xml version="1.0" encoding="UTF-8"?&gt;
757 +&lt;!DOCTYPE guide SYSTEM "/dtd/guide.dtd"&gt;
758 +&lt;!-- &#36;Header&#36; --&gt;
759 +
760 +&lt;guide disclaimer="obsolete" redirect="/doc/en/handbook/handbook-x86.xml"&gt;
761 +&lt;title>Gentoo x86 Installation Guide&lt;/title&gt;
762 +
763 +&lt;author title="Author"&gt;
764 +...
765 +</pre>
766 +
767 +</body>
768 +</section>
769 +<section>
770 +<title>FAQs</title>
771 +<body>
772 +
773 +<p>
774 +FAQ documents need to start with a list of questions with links to their
775 +answers. Creating such a list is both time-consuming and error-prone. The list
776 +can be created automatically if you use a <c>faqindex</c> element as the first
777 +chapter of your document. This element has the same structure as a
778 +<c>chapter</c> to allow some introductory text. The structure of the document
779 +is expected to be split into chapters (at least one chapter) containing
780 +sections, each section containing one question specified in its <c>title</c>
781 +element with the answer in its <c>body</c>. The FAQ index will appear as one
782 +section per chapter and one link per question.
783 +</p>
784 +
785 +<p>
786 +A quick look at a <uri link="/doc/en/faq.xml">FAQ</uri> and <uri
787 +link="/doc/en/faq.xml?passthru=1">its source</uri> should make the above
788 +obvious.
789 +</p>
790 +
791 +</body>
792 +</section>
793 +</chapter>
794 +
795 +<chapter>
796 +<title>Handbook Format</title>
797 +<section>
798 +<title>Guide vs Book</title>
799 +<body>
800 +
801 +<p>
802 +For high-volume documentation, such as the <uri
803 +link="/doc/en/handbook/handbook-x86.xml?part=1">Installation Instructions</uri>, a
804 +broader format was needed. We designed a GuideXML-compatible enhancement that
805 +allows us to write modular and multi-page documentation.
806 +</p>
807 +
808 +</body>
809 +</section>
810 +<section>
811 +<title>Main File</title>
812 +<body>
813 +
814 +<p>
815 +The first change is the need for a "master" document. This document contains no
816 +real content, but links to the individual documentation modules. The syntax
817 +doesn't differ much from GuideXML:
818 +</p>
819 +
820 +<pre caption="Example book usage">
821 +&lt;?xml version='1.0' encoding='UTF-8'?&gt;
822 +&lt;!DOCTYPE book SYSTEM "/dtd/book.dtd"&gt;
823 +&lt;!-- &#36;Header&#36; --&gt;
824 +
825 +&lt;<i>book</i>&gt;
826 +&lt;title&gt;Example Book Usage&lt;/title&gt;
827 +
828 +&lt;author...&gt;
829 + ...
830 +&lt;/author&gt;
831 +
832 +&lt;abstract&gt;
833 + ...
834 +&lt;/abstract&gt;
835 +
836 +&lt;!-- The content of this document is licensed under the CC-BY-SA license --&gt;
837 +&lt;!-- See http://creativecommons.org/licenses/by-sa/3.0 --&gt;
838 +&lt;license version="3.0"/&gt;
839 +
840 +&lt;version&gt;...&lt;/version&gt;
841 +&lt;date&gt;...&lt;/date&gt;
842 +</pre>
843 +
844 +<p>
845 +So far no real differences (except for the <c>&lt;book&gt;</c> instead of
846 +<c>&lt;guide&gt;</c> tag). Instead of starting with the individual
847 +<c>&lt;chapter&gt;</c>s, you define a <c>&lt;part&gt;</c>, which is the
848 +equivalent of a separate part in a book:
849 +</p>
850 +
851 +<pre caption="Defining a part">
852 +&lt;part&gt;
853 +&lt;title&gt;Part One&lt;/title&gt;
854 +&lt;abstract&gt;
855 + ...
856 +&lt;/abstract&gt;
857 +
858 +<comment>(Defining the several chapters)</comment>
859 +&lt;/part&gt;
860 +</pre>
861 +
862 +<p>
863 +Each part is accompanied by a <c>&lt;title&gt;</c> and an
864 +<c>&lt;abstract&gt;</c> which gives a small introduction to the part.
865 +</p>
866 +
867 +<p>
868 +Inside each part, you define the individual <c>&lt;chapter&gt;</c>s. Each
869 +chapter <e>must</e> be a separate document. As a result it is no surprise that
870 +a special tag (<c>&lt;include&gt;</c>) is added to allow including the separate
871 +document.
872 +</p>
873 +
874 +<pre caption="Defining a chapter">
875 +&lt;chapter&gt;
876 +&lt;title&gt;Chapter One&lt;/title&gt;
877 +
878 + &lt;include href="path/to/chapter-one.xml"/&gt;
879 +
880 +&lt;/chapter&gt;
881 +</pre>
882 +
883 +</body>
884 +</section>
885 +<section>
886 +<title>Designing the Individual Chapters</title>
887 +<body>
888 +
889 +<p>
890 +The content of an individual chapter is structured as follows:
891 +</p>
892 +
893 +<pre caption="Chapter Syntax">
894 +&lt;?xml version='1.0' encoding='UTF-8'?&gt;
895 +&lt;!DOCTYPE sections SYSTEM "/dtd/book.dtd"&gt;
896 +&lt;!-- &#36;Header&#36; --&gt;
897 +
898 +&lt;!-- The content of this document is licensed under the CC-BY-SA license --&gt;
899 +&lt;!-- See http://creativecommons.org/licenses/by-sa/3.0 --&gt;
900 +
901 +&lt;sections&gt;
902 +
903 +&lt;abstract&gt;
904 + This is a small explanation on chapter one.
905 +&lt;/abstract&gt;
906 +
907 +&lt;version&gt;...&lt;/version&gt;
908 +&lt;date&gt;...&lt;/date&gt;
909 +
910 +<comment>(Define the several &lt;section&gt; and &lt;subsection&gt;)</comment>
911 +
912 +&lt;/sections&gt;
913 +</pre>
914 +
915 +<p>
916 +Inside each chapter you can define <c>&lt;section&gt;</c>s (equivalent of
917 +<c>&lt;chapter&gt;</c> in a Guide) and <c>&lt;subsection&gt;</c>s (equivalent
918 +of <c>&lt;section&gt;</c> in a Guide).
919 +</p>
920 +
921 +<p>
922 +Each individual chapter should have its own date and version elements. The
923 +latest date of all chapters and master document will be displayed when a user
924 +browses through all parts of the book.
925 +</p>
926 +
927 +</body>
928 +</section>
929 +</chapter>
930 +
931 +<chapter>
932 +<title>Advanced Handbook Features</title>
933 +<section>
934 +<title>Global Values</title>
935 +<body>
936 +
937 +<p>
938 +Sometimes, the same values are repeated many times in several parts of a
939 +handbook. Global search and replace operations tend to forget some or introduce
940 +unwanted changes. Besides, it can be useful to define different values to be
941 +used in shared chapters depending on which handbook includes the chapter.
942 +</p>
943 +
944 +<p>
945 +Global values can be defined in a handbook master file and used in all included
946 +chapters.
947 +</p>
948 +
949 +<p>
950 +To define global values, add a <c>&lt;values&gt;</c> element to the handbook
951 +master file. Each value is then defined in a <c>&lt;key&gt;</c> element whose
952 +<c>id</c> attribute identifies the value, i.e. it is the name of your variable.
953 +The content of the <c>&lt;key&gt;</c> is its value.
954 +</p>
955 +
956 +<p>
957 +The following example defines three values in a handbook master file:
958 +</p>
959 +
960 +<pre caption="Define values in a handbook">
961 +&lt;?xml version='1.0' encoding='UTF-8'?&gt;
962 +&lt;!DOCTYPE book SYSTEM "/dtd/book.dtd"&gt;
963 +&lt;!-- &#36;Header&#36; --&gt;
964 +
965 +&lt;book&gt;
966 +&lt;title&gt;Example Book Usage&lt;/title&gt;
967 +
968 +<i>&lt;values>
969 + &lt;key id="arch"&gt;x86&lt;/key&gt;
970 + &lt;key id="min-cd-name"&gt;install-x86-minimal-2007.0-r1.iso&lt;/key&gt;
971 + &lt;key id="min-cd-size"&gt;57&lt;/key&gt;
972 +&lt;/values&gt;</i>
973 +
974 +&lt;author...&gt;
975 + ...
976 +&lt;/author&gt;
977 +
978 +...
979 +</pre>
980 +
981 +<p>
982 +The defined values can then be used throughout the handbook with the in-line
983 +<c>&lt;keyval id="key_id"/&gt;</c> element. Specify the name of the key in its
984 +<c>id</c> attribute, e.g. &lt;keyval id="min-cd-name"/&gt; would be replaced by
985 +"install-x86-minimal-2007.0-r1.iso" in our example.
986 +</p>
987 +
988 +<pre caption="Using defined values">
989 +&lt;p&gt;
990 +The Minimal Installation CD is called &lt;c&gt;<i>&lt;keyval id="min-cd-name"/&gt;</i>&lt;/c&gt;
991 +and takes up only <i>&lt;keyval id="min-cd-size"/&gt;</i> MB of diskspace. You can use this
992 +Installation CD to install Gentoo, but &lt;e&gt;only&lt;/e&gt; with a working Internet
993 +connection.
994 +&lt;/p&gt;
995 +</pre>
996 +
997 +<p>
998 +To make life easier on our translators, only use actual values, i.e. content
999 +that does not need to be translated. For instance, we defined the
1000 +<c>min-cd-size</c> value to <c>57</c> and not <c>57 MB</c>.
1001 +</p>
1002 +
1003 +</body>
1004 +</section>
1005 +<section>
1006 +<title>Conditional Elements</title>
1007 +<body>
1008 +
1009 +<p>
1010 +Chapters that are shared by several handbooks such as our <uri
1011 +link="/doc/en/handbook/">Installation Handbooks</uri> often have small
1012 +differences depending on which handbook includes them. Instead of adding
1013 +content that is irrelevant to some handbooks, authors can add a condition to
1014 +the following elements: <c>&lt;section&gt;</c>, <c>&lt;subsection&gt;</c>,
1015 +<c>&lt;body&gt;</c>, <c>&lt;note&gt;</c>, <c>&lt;impo&gt;</c>,
1016 +<c>&lt;warn&gt;</c>, <c>&lt;pre&gt;</c>, <c>&lt;p&gt;</c>,
1017 +<c>&lt;table&gt;</c>, <c>&lt;tr&gt;</c>, <c>&lt;ul&gt;</c>, <c>&lt;ol&gt;</c>
1018 +and <c>&lt;li&gt;</c>.
1019 +</p>
1020 +
1021 +<p>
1022 +The condition must be an <uri
1023 +link="http://en.wikipedia.org/wiki/XPath">XPATH</uri> expression that will be
1024 +evaluated when transforming the XML. If it evaluates to <c>true</c>, the
1025 +element is processed, if not, it is ignored. The condition is specified in a
1026 +<c>test</c> attribute.
1027 +</p>
1028 +
1029 +<p>
1030 +The following example uses the <c>arch</c> value that is defined in each
1031 +handbook master file to condition some content:
1032 +</p>
1033 +
1034 +<pre caption="Using conditional elements">
1035 +&lt;body test="contains('AMD64 x86',func:keyval('arch'))"&gt;
1036 +
1037 +&lt;p&gt;
1038 +This paragraph applies to both x86 and AMD64 architectures.
1039 +&lt;/p&gt;
1040 +
1041 +&lt;p test="func:keyval('arch')='x86'"&gt;
1042 +This paragraph only applies to the x86 architecture.
1043 +&lt;/p&gt;
1044 +
1045 +&lt;p test="func:keyval('arch')='AMD64'"&gt;
1046 +This paragraph only applies to the AMD64 architecture.
1047 +&lt;/p&gt;
1048 +
1049 +&lt;p test="func:keyval('arch')='PPC'"&gt;
1050 +This paragraph will never be seen!
1051 +The whole body is skipped because of the first condition.
1052 +&lt;/p&gt;
1053 +
1054 +&lt;/body&gt;
1055 +
1056 +&lt;body test="contains('AMD64 PPC64',func:keyval('arch'))"&gt;
1057 +
1058 +&lt;p&gt;
1059 +This paragraph applies to the AMD64, PPC64 <comment>and PPC</comment> architectures because
1060 +the 'AMD64 PPC64' string does contain 'PPC'.
1061 +&lt;/p&gt;
1062 +
1063 +&lt;note test="func:keyval('arch')='AMD64' or func:keyval('arch')='PPC64'"&gt;
1064 +This note only applies to the AMD64 and PPC64 architectures.
1065 +&lt;/note&gt;
1066 +
1067 +&lt;/body&gt;
1068 +</pre>
1069 +
1070 +</body>
1071 +</section>
1072 +</chapter>
1073 +
1074 +<chapter id="codingstyle">
1075 +<title>Coding Style</title>
1076 +<section>
1077 +<title>Introduction</title>
1078 +<body>
1079 +
1080 +<p>
1081 +Since all Gentoo Documentation is a joint effort and several people will
1082 +most likely change existing documentation, a coding style is needed.
1083 +A coding style contains two sections. The first one is regarding
1084 +internal coding - how the XML-tags are placed. The second one is
1085 +regarding the content - how not to confuse the reader.
1086 +</p>
1087 +
1088 +<p>
1089 +Both sections are described next.
1090 +</p>
1091 +
1092 +</body>
1093 +</section>
1094 +<section>
1095 +<title>Internal Coding Style</title>
1096 +<body>
1097 +
1098 +<p>
1099 +<b>Newlines</b> must be placed immediately after <e>every</e>
1100 +GuideXML-tag (both opening as closing), except for:
1101 +<c>&lt;version&gt;</c>, <c>&lt;date&gt;</c>, <c>&lt;title&gt;</c>,
1102 +<c>&lt;th&gt;</c>, <c>&lt;ti&gt;</c>,
1103 +<c>&lt;li&gt;</c>, <c>&lt;i&gt;</c>, <c>&lt;e&gt;</c>,
1104 +<c>&lt;uri&gt;</c>, <c>&lt;path&gt;</c>, <c>&lt;b&gt;</c>, <c>&lt;c&gt;</c>,
1105 +<c>&lt;comment&gt;</c>, <c>&lt;mail&gt;</c>.
1106 +</p>
1107 +
1108 +<p>
1109 +<b>Blank lines</b> must be placed immediately after <e>every</e>
1110 +<c>&lt;body&gt;</c> (opening tag only) and before <e>every</e>
1111 +<c>&lt;chapter&gt;</c>, <c>&lt;p&gt;</c>, <c>&lt;table&gt;</c>,
1112 +<c>&lt;author&gt;</c> (set), <c>&lt;pre&gt;</c>, <c>&lt;ul&gt;</c>,
1113 +<c>&lt;ol&gt;</c>, <c>&lt;warn&gt;</c>, <c>&lt;note&gt;</c> and
1114 +<c>&lt;impo&gt;</c> (opening tags only).
1115 +</p>
1116 +
1117 +<p>
1118 +<b>Word-wrapping</b> must be applied at 80 characters except inside
1119 +<c>&lt;pre&gt;</c>. You may only deviate from this rule when there is no other
1120 +choice (for instance when a URL exceeds the maximum amount of characters). The
1121 +editor must then wrap whenever the first whitespace occurs. You should try to
1122 +keep the <e>rendered</e> content of <c>&lt;pre&gt;</c> elements within 80
1123 +columns to help console users.
1124 +</p>
1125 +
1126 +<p>
1127 +<b>Indentation</b> may not be used, except with the XML-constructs of which the
1128 +parent XML-tags are <c>&lt;tr&gt;</c> (from <c>&lt;table&gt;</c>),
1129 +<c>&lt;ul&gt;</c>, <c>&lt;ol&gt;</c>, <c>&lt;dl&gt;</c>, and
1130 +<c>&lt;author&gt;</c>. If indentation is used, it <e>must</e> be two spaces for
1131 +each indentation. That means <e>no tabs</e> and <e>not</e> more spaces.
1132 +Besides, tabs are not allowed in GuideXML documents.
1133 +</p>
1134 +
1135 +<p>
1136 +In case word-wrapping happens in <c>&lt;ti&gt;</c>, <c>&lt;th&gt;</c>,
1137 +<c>&lt;li&gt;</c> or <c>&lt;dd&gt;</c> constructs, indentation must be used for
1138 +the content.
1139 +</p>
1140 +
1141 +<p>
1142 +An example for indentation is:
1143 +</p>
1144 +
1145 +<pre caption="Indentation Example">
1146 +&lt;table&gt;
1147 +&lt;tr&gt;
1148 + &lt;th&gt;Foo&lt;/th&gt;
1149 + &lt;th&gt;Bar&lt;/th&gt;
1150 +&lt;/tr&gt;
1151 +&lt;tr&gt;
1152 + &lt;ti&gt;This is an example for indentation&lt;/ti&gt;
1153 + &lt;ti&gt;
1154 + In case text cannot be shown within an 80-character wide line, you
1155 + must use indentation if the parent tag allows it
1156 + &lt;/ti&gt;
1157 +&lt;/tr&gt;
1158 +&lt;/table&gt;
1159 +
1160 +&lt;ul&gt;
1161 + &lt;li&gt;First option&lt;/li&gt;
1162 + &lt;li&gt;Second option&lt;/li&gt;
1163 +&lt;/ul&gt;
1164 +</pre>
1165 +
1166 +<p>
1167 +<b>Attributes</b> may not have spaces in between the attribute, the "=" mark,
1168 +and the attribute value. As an example:
1169 +</p>
1170 +
1171 +<pre caption="Attributes">
1172 +<comment>Wrong :</comment> &lt;pre caption = "Attributes"&gt;
1173 +<comment>Correct:</comment> &lt;pre caption="Attributes"&gt;
1174 +</pre>
1175 +
1176 +</body>
1177 +</section>
1178 +<section>
1179 +<title>External Coding Style</title>
1180 +<body>
1181 +
1182 +<p>
1183 +Inside tables (<c>&lt;table&gt;</c>) and listings (<c>&lt;ul&gt;</c>,
1184 +<c>&lt;ol&gt;</c>) and <c>&lt;dl&gt;</c>, periods (".") should not be used
1185 +unless multiple sentences are used. In that case, every sentence should end
1186 +with a period (or other reading marks).
1187 +</p>
1188 +
1189 +<p>
1190 +Every sentence, including those inside tables and listings, should start
1191 +with a capital letter.
1192 +</p>
1193 +
1194 +<pre caption="Periods and capital letters">
1195 +&lt;ul&gt;
1196 + &lt;li&gt;No period&lt;/li&gt;
1197 + &lt;li&gt;With period. Multiple sentences, remember?&lt;/li&gt;
1198 +&lt;/ul&gt;
1199 +</pre>
1200 +
1201 +<p>
1202 +Code Listings should <e>always</e> have a <c>caption</c>.
1203 +</p>
1204 +
1205 +<p>
1206 +Try to use <c>&lt;uri&gt;</c> with the <c>link</c> attribute as much as
1207 +possible. In other words, the <uri link="http://forums.gentoo.org">Gentoo
1208 +Forums</uri> is preferred over <uri>http://forums.gentoo.org</uri>.
1209 +</p>
1210 +
1211 +<p>
1212 +When you comment something inside a <c>&lt;pre&gt;</c> construct, use
1213 +<c>&lt;comment&gt;</c> and parentheses or the comment marker for the language
1214 +that is being used (<c>#</c> for bash scripts and many other things, <c>//</c>
1215 +for C code, etc.) Also place the comment <e>before</e> the subject of the
1216 +comment.
1217 +</p>
1218 +
1219 +<pre caption="Comment example">
1220 +<comment>(Substitute "john" with your user name)</comment>
1221 +# <i>id john</i>
1222 +</pre>
1223 +
1224 +</body>
1225 +</section>
1226 +</chapter>
1227 +
1228 +<chapter>
1229 +<title>Resources</title>
1230 +<section>
1231 +<title>Start writing</title>
1232 +<body>
1233 +
1234 +<p>
1235 +GuideXML has been specially designed to be "lean and mean" so that developers
1236 +can spend more time writing documentation and less time learning the actual XML
1237 +syntax. Hopefully, this will allow developers who aren't unusually "doc-savvy"
1238 +to start writing quality Gentoo documentation. You might be interested in our
1239 +<uri link="/proj/en/gdp/doc/doc-tipsntricks.xml">Documentation Development Tips
1240 +&amp; Tricks</uri>. If you'd like to help (or have any questions about
1241 +GuideXML), please post a message to the <uri
1242 +link="/main/en/lists.xml">gentoo-doc mailing list</uri> stating what you'd like
1243 +to tackle. Have fun!
1244 +</p>
1245 +
1246 +</body>
1247 +</section>
1248 +</chapter>
1249 +</guide>
1250
1251 diff --git a/appendices/contributing/text.xml b/appendices/contributing/text.xml
1252 index 5550aef..04fc9a8 100644
1253 --- a/appendices/contributing/text.xml
1254 +++ b/appendices/contributing/text.xml
1255 @@ -143,5 +143,6 @@ really should first examine the GuideXML guide in a reasonable amount of depth.
1256 </section>
1257 </chapter>
1258
1259 -</guide>
1260 +<include href="devbook-guide/"/>
1261
1262 +</guide>