/[gentoo]/xml/htdocs/doc/en/xml-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/xml-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.3 Revision 1.21
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?>
3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 3
6<guide link="/doc/en/xml-guide.xml"> 4<guide link="/doc/en/xml-guide.xml">
7<title>Gentoo Linux Documentation Guide</title> 5<title>Gentoo Linux XML Guide</title>
8<author title="Chief Architect"><mail link="drobbins@gentoo.org">Daniel Robbins</mail></author>
9 6
7<author title="Author">
8 <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
9</author>
10<author title="Author"><!-- zhen@gentoo.org -->
11 John P. Davis
12</author>
13<author title="Editor">
14 <mail link="peesh@gentoo.org">Jorge Paulo</mail>
15</author>
16
17<license/>
18<abstract>
10<abstract>This guide shows you how to compose web documentation using the new lightweight Gentoo guide 19This guide shows you how to compose web documentation using the new lightweight
11XML syntax. This syntax is the official format for Gentoo Linux documentation, and this document 20Gentoo GuideXML syntax. This syntax is the official format for Gentoo Linux
12itself was created using guide XML. This guide assumes a basic working knowledge of XML and HTML. 21documentation, and this document itself was created using GuideXML. This guide
22assumes a basic working knowledge of XML and HTML.
13</abstract> 23</abstract>
14 24
15<version>1.0</version> 25<version>2.4</version>
16<date>07 Mar 2002</date> 26<date>November 5, 2003</date>
17 27
18<chapter> 28<chapter>
19<title>Guide basics</title> 29<title>Guide basics</title>
20
21<section> 30<section>
22<title>Guide XML design goals</title> 31<title>Guide XML design goals</title>
23<body> 32<body>
24 33
34<p>
25<p> The guide XML syntax is lightweight yet expressive, so that it is easy to 35The guide XML syntax is lightweight yet expressive, so that it is easy to
26learn yet also provides all the features we need for the creation of web 36learn yet also provides all the features we need for the creation of web
27documentation. The number of tags is kept to a minimum -- just those we need. 37documentation. The number of tags is kept to a minimum -- just those we need.
28This makes it easy to transform guide into other formats, such as DocBook 38This makes it easy to transform guide into other formats, such as DocBook
29XML/SGML or web-ready HTML. </p> 39XML/SGML or web-ready HTML.
40</p>
30 41
42<p>
31<p>The goal is to make it easy to <e>create</e> and <e>transform</e> guide XML 43The goal is to make it easy to <e>create</e> and <e>transform</e> guide XML
32documents.</p> 44documents.
45</p>
33 46
34</body> 47</body>
35</section>
36
37<section> 48</section>
38<title>How to transform guide XML into HTML</title> 49<section>
50<title>Further Resources</title>
39<body> 51<body>
40 52
41<p> Before we take a look at the guide syntax itself, it's helpful to know how
42guide XML is transformed into web-ready HTML. To do this, we use a special
43file called <path>guide-main.xsl</path>, along with a command-line XSLT processing
44tool (also called an "engine"). The <path>guide-main.xsl</path> file describes
45exactly how to transform the contents of the source guide XML document to
46create the target HTML file. Two popular XSLT processors are <c>sabcmd</c>
47(included in the <path>app-text/sablotron</path> package) and <c>xsltproc</c>
48(found in the <path>dev-libs/libxslt</path> package). From experience, we've
49found that <c>xsltproc</c> is the higher-quality and more feature-rich XSLT
50processor. </p>
51
52<p> Once you have either <c>xsltproc</c> or <c>sabcmd</c> installed, you're
53ready to convert guide XML into web-ready HTML. Here's how it works. First,
54download the latest snapshot of our Web site from
55<uri>http://www.gentoo.org/projects/xml.html</uri>, found in the <uri
56link="http://www.gentoo.org/projects/guide-xml-latest.tar.gz">xml-guide-latest.tar.gz</uri>
57file. Extract the tarball. Inside it, you'll find a <path>gentoo-src</path>
58directory, as well as a <path>gentoo-src/xml</path> directory, etc. Now, find
59<path>gentoo-src/xml/install.xml</path>. (The new user installation guide).
60This will be our source XML guide document. The easiest way to perform the
61transformation is to change directories to the location of the
62<path>guide-main.xsl</path> file. Then, execute <c>xsltproc</c> as follows:
63</p> 53<p>
64 54If you are planning on contributing documentation to Gentoo, or you want to test
65<pre> 55GuideXML, please read the <uri
66# <i>cd gentoo-web/xsl</i> 56link="http://www.gentoo.org/proj/en/gdp/doc/en/docdev.xml">Documentation
67# <i>xsltproc guide-main.xsl ../xml/install.xml &gt; /tmp/install.html</i> 57Developer Guide</uri> which contains tips and tricks for documentation
68</pre> 58development.
69
70<p> If all went well, you should have a web-ready version of
71<path>install.xml</path> at <path>/tmp/install.html</path>. For this document
72to display properly in a web browser, you may have to copy some files from
73<path>gentoo-web</path> to <path>/tmp</path>, such
74as <path>css/main-new.css</path> and (to be safe) the entire <path>images</path>
75directory.
76</p> 59</p>
77 60
78</body> 61</body>
79</section> 62</section>
80</chapter> 63</chapter>
64
81<chapter> 65<chapter>
82 <title>Guide XML</title> 66<title>Guide XML</title>
83<section> 67<section>
84<title>Basic structure</title> 68<title>Basic structure</title>
85<body> 69<body>
86 70
71<p>
87<p>Now that you know how to transform guide XML, you're ready to start learning 72Now that you know how to transform guide XML, you're ready to start learning
88the guide XML syntax. We'll start with the the initial tags used in a guide 73the GuideXML syntax. We'll start with the the initial tags used in a guide
89XML document: </p> 74XML document:
75</p>
90 76
91<pre caption="The initial part of a guide XML document"> 77<pre caption="The initial part of a guide XML document">
92&lt;?xml version='1.0'?&gt; 78&lt;?xml version='1.0' encoding="UTF-8"?&gt;
93&lt;guide&gt; 79&lt;guide link="relative_link_to_your_guide"&gt;
94&lt;title&gt;<i>Gentoo Linux Documentation Guide</i>&lt;/title&gt; 80&lt;title&gt;<i>Gentoo Linux Documentation Guide</i>&lt;/title&gt;
95&lt;author title="<i>Chief Architect</i>"&gt;&lt;mail link="<i>drobbins@gentoo.org</i>"&gt; 81&lt;author title="<i>Chief Architect</i>"&gt;
96 <i>Daniel Robbins</i>&lt;/mail&gt; 82 &lt;mail link="<i>drobbins@gentoo.org</i>"&gt;<i>Daniel Robbins</i>&lt;/mail&gt;
97&lt;/author&gt; 83&lt;/author&gt;
98&lt;author title="<i>Editor</i>"&gt;&lt;mail link="<i>thomasfl@gentoo.org</i>"&gt; 84&lt;author title="<i>Editor</i>"&gt;
99 <i>Thomas Flavel</i>&lt;/mail&gt; 85 &lt;mail link="<i>thomasfl@gentoo.org</i>"&gt;<i>Thomas Flavel</i>&lt;/mail&gt;
100&lt;/author&gt; 86&lt;/author&gt;
101 87
88&lt;abstract&gt;
102&lt;abstract&gt;<i>This guide shows you how to compose web documentation using 89<i>This guide shows you how to compose web documentation using
103our new lightweight Gentoo guide XML syntax. This syntax is the official 90our new lightweight Gentoo GuideXML syntax. This syntax is the official
104format for Gentoo Linux web documentation, and this document itself was created 91format for Gentoo Linux web documentation, and this document itself was created
105using guide XML.</i> &lt;/abstract&gt; 92using GuideXML.</i>
93&lt;/abstract&gt;
94
95&lt;license/&gt;
106 96
107&lt;version&gt;<i>1.0</i>&lt;/version&gt; 97&lt;version&gt;<i>1.0</i>&lt;/version&gt;
108&lt;date&gt;<i>29 Mar 2001</i>&lt;/date&gt; 98&lt;date&gt;<i>29 Mar 2001</i>&lt;/date&gt;
109</pre> 99</pre>
110 100
101<p>
111<p>On the first, line, we see the requisite tag that identifies this as an XML 102On the first, line, we see the requisite tag that identifies this as an XML
112document. Following it, there's a <c>&lt;guide&gt;</c> tag -- the entire 103document. Following it, there's a <c>&lt;guide&gt;</c> tag -- the entire
113guide document is enclosed within a <c>&lt;guide&gt; &lt;/guide&gt;</c> pair. 104guide document is enclosed within a <c>&lt;guide&gt; &lt;/guide&gt;</c> pair.
114Next, there's a <c>&lt;title&gt;</c> tag, used to set the title for the entire 105Next, there's a <c>&lt;title&gt;</c> tag, used to set the title for the entire
115guide document. </p> 106guide document.
107</p>
116 108
109<p>
117<p>Then, we come to the <c>&lt;author&gt;</c> tags, which contain information 110Then, we come to the <c>&lt;author&gt;</c> tags, which contain information
118about the various authors of the document. Each <c>&lt;author&gt;</c> tag 111about the various authors of the document. Each <c>&lt;author&gt;</c> tag
119allows for an optional <c>title=</c> element, used to specify the author's 112allows for an optional <c>title=</c> element, used to specify the author's
120relationship to the document (author, co-author, editor, etc.). In this 113relationship to the document (author, co-author, editor, etc.). In this
121particular example, the authors' names are enclosed in another tag -- a 114particular example, the authors' names are enclosed in another tag -- a
122<c>&lt;mail&gt;</c> tag, used to specify an email address for this particular 115<c>&lt;mail&gt;</c> tag, used to specify an email address for this particular
123person. The <c>&lt;mail&gt;</c> tag is optional and can be omitted, and no 116person. The <c>&lt;mail&gt;</c> tag is optional and can be omitted, and no
124more than one <c>&lt;author&gt;</c> element is required per guide document. 117more than one <c>&lt;author&gt;</c> element is required per guide document.
125</p> 118</p>
126 119
120<p>
127<p>Next, we come to the <c>&lt;abstract&gt;</c>, <c>&lt;version&gt;</c> and 121Next, we come to the <c>&lt;abstract&gt;</c>, <c>&lt;version&gt;</c> and
128<c>&lt;date&gt;</c> tags, used to specify a summary of the document, the 122<c>&lt;date&gt;</c> tags, used to specify a summary of the document, the
129current version number, and the current version date (in DD MMM YYYY format) 123current version number, and the current version date (in DD MMM YYYY format)
130respectively. This rounds out the tags that should appear at the beginning of 124respectively. This rounds out the tags that should appear at the beginning of
131a guide document. Besides the <c>&lt;title&gt;</c> and <c>&lt;mail&gt;</c> 125a guide document. Besides the <c>&lt;title&gt;</c> and <c>&lt;mail&gt;</c>
132tags, these tags shouldn't appear anywhere else except immediately inside the 126tags, these tags shouldn't appear anywhere else except immediately inside the
133<c>&lt;guide&gt;</c> tag, and for consistency it's recommended (but not 127<c>&lt;guide&gt;</c> tag, and for consistency it's recommended (but not
134required) that these tags appear before the content of the document. </p> 128required) that these tags appear before the content of the document.
129</p>
135 130
136</body> 131<p>
137</section> 132Finally we have the <c>&lt;license/&gt;</c> tag, used to publish the
133document under the <uri link="http://creativecommons.org/licenses/by-sa/1.0/">Creative
134Commons - Attribution / Share Alike</uri> license as required by the <uri
135link="/doc/en/doc-policy.xml">Documentation Policy</uri>.
136</p>
138 137
138</body>
139</section>
139<section> 140<section>
140<title>Chapters and sections</title> 141<title>Chapters and sections</title>
141<body> 142<body>
143
144<p>
142<p>Once the initial tags have been specified, you're ready to start adding 145Once the initial tags have been specified, you're ready to start adding
143the structural elements of the document. Guide documents are divided into 146the structural elements of the document. Guide documents are divided into
144chapters, and each chapter can hold one or more sections. Every chapter 147chapters, and each chapter can hold one or more sections. Every chapter
145and section has a title. Here's an example chapter with a single section, 148and section has a title. Here's an example chapter with a single section,
146consisting of a paragraph. If you append this XML to the XML in the <uri link="#doc_pre2">previous 149consisting of a paragraph. If you append this XML to the XML in the <uri link="#doc_chap2_pre1">previous
147excerpt</uri> and append a <c>&lt;/guide&gt;</c> to the end of the file, you'll have a valid 150excerpt</uri> and append a <c>&lt;/guide&gt;</c> to the end of the file, you'll have a valid
148(if minimal) guide document: 151(if minimal) guide document:
149</p> 152</p>
150 153
151<pre> 154<pre>
152&lt;chapter&gt; 155&lt;chapter&gt;
153&lt;title&gt;<i>This is my chapter</i>&lt;/title&gt; 156&lt;title&gt;<i>This is my chapter</i>&lt;/title&gt;
154&lt;section&gt; 157&lt;section&gt;
155 &lt;title&gt;<i>This is section one of my chapter</i>&lt;/title&gt; 158&lt;title&gt;<i>This is section one of my chapter</i>&lt;/title&gt;
156 &lt;body&gt; 159&lt;body&gt;
160
161&lt;p&gt;
157 &lt;p&gt;<i>This is the actual text content of my section.</i>&lt;/p&gt; 162<i>This is the actual text content of my section.</i>
163&lt;/p&gt;
164
158 &lt;/body&gt; 165&lt;/body&gt;
159&lt;/section&gt; 166&lt;/section&gt;
160&lt;/chapter&gt; 167&lt;/chapter&gt;
161</pre> 168</pre>
162 169
170<p>
163<p>Above, I set the chapter title by adding a child <c>&lt;title&gt;</c> 171Above, I set the chapter title by adding a child <c>&lt;title&gt;</c>
164element to the <c>&lt;chapter&gt;</c> element. Then, I created a section by 172element to the <c>&lt;chapter&gt;</c> element. Then, I created a section by
165adding a <c>&lt;section&gt;</c> element. If you look inside the 173adding a <c>&lt;section&gt;</c> element. If you look inside the
166<c>&lt;section&gt;</c> element, you'll see that it has two child elements -- a 174<c>&lt;section&gt;</c> element, you'll see that it has two child elements -- a
167<c>&lt;title&gt;</c> and a <c>&lt;body&gt;</c>. While the <c>&lt;title&gt;</c> 175<c>&lt;title&gt;</c> and a <c>&lt;body&gt;</c>. While the <c>&lt;title&gt;</c>
168is nothing new, the <c>&lt;body&gt;</c> is -- it contains the actual text 176is nothing new, the <c>&lt;body&gt;</c> is -- it contains the actual text
169content of this particular section. We'll look at the tags that are allowed 177content of this particular section. We'll look at the tags that are allowed
170inside a <c>&lt;body&gt;</c> element in a bit. </p> 178inside a <c>&lt;body&gt;</c> element in a bit.
179</p>
171 180
181<note>
172<note>A <c>&lt;guide&gt;</c> element can contain multiple 182A <c>&lt;guide&gt;</c> element can contain multiple <c>&lt;chapter&gt;</c>
173<c>&lt;chapter&gt;</c> elements, and a <c>&lt;chapter&gt;</c> can contain 183elements, and a <c>&lt;chapter&gt;</c> can contain multiple
174multiple <c>&lt;section&gt;</c> elements. However, a <c>&lt;section&gt;</c> 184<c>&lt;section&gt;</c> elements. However, a <c>&lt;section&gt;</c>
175element can only contain one <c>&lt;body&gt;</c> element. </note> 185element can only contain one <c>&lt;body&gt;</c> element.
186</note>
176 187
177</body> 188</body>
178</section> 189</section>
179
180<section> 190<section>
181<title>An example &lt;body&gt;</title> 191<title>An example &lt;body&gt;</title>
182<body> 192<body>
193
183<p> 194<p>
184Now, it's time to learn how to mark up actual content. Here's the XML code for an example <c>&lt;body&gt;</c> element: 195Now, it's time to learn how to mark up actual content. Here's the XML code for an example <c>&lt;body&gt;</c> element:
185</p> 196</p>
197
186<pre> 198<pre>
187&lt;p&gt; 199&lt;p&gt;
188This is a paragraph. &lt;path&gt;/etc/passwd&lt;/path&gt; is a file. 200This is a paragraph. &lt;path&gt;/etc/passwd&lt;/path&gt; is a file.
189&lt;uri&gt;http://www.gentoo.org&lt;/uri&gt; is my favorite website. 201&lt;uri&gt;http://www.gentoo.org&lt;/uri&gt; is my favorite website.
190Type &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. 202Type &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.
197Make HTML/XML easier to read by using selective emphasis: 209Make HTML/XML easier to read by using selective emphasis:
198&lt;foo&gt;&lt;i&gt;bar&lt;/i&gt;&lt;/foo&gt; 210&lt;foo&gt;&lt;i&gt;bar&lt;/i&gt;&lt;/foo&gt;
199 211
200&lt;codenote&gt;This is how to insert an inline note into the code block&lt;/codenote&gt; 212&lt;codenote&gt;This is how to insert an inline note into the code block&lt;/codenote&gt;
201&lt;/pre&gt; 213&lt;/pre&gt;
202&lt;note&gt;This is a note.&lt;/note&gt; 214
203&lt;warn&gt;This is a warning.&lt;/warn&gt; 215&lt;note&gt;
204&lt;impo&gt;This is important.&lt;/impo&gt; 216This is a note.
217&lt;/note&gt;
218
219&lt;warn&gt;
220This is a warning.
221&lt;/warn&gt;
222
223&lt;impo&gt;
224This is important.
225&lt;/impo&gt;
205</pre> 226</pre>
227
228<p>
206<p>Now, here's how this <c>&lt;body&gt;</c> element is rendered:</p> 229Now, here's how this <c>&lt;body&gt;</c> element is rendered:
230</p>
207 231
208<p> 232<p>
209This is a paragraph. <path>/etc/passwd</path> is a file. 233This is a paragraph. <path>/etc/passwd</path> is a file.
210<uri>http://www.gentoo.org</uri> is my favorite website. 234<uri>http://www.gentoo.org</uri> is my favorite website.
211Type <c>ls</c> if you feel like it. I <e>really</e> want to go to sleep now. 235Type <c>ls</c> if you feel like it. I <e>really</e> want to go to sleep now.
218Make HTML/XML easier to read by using selective emphasis: 242Make HTML/XML easier to read by using selective emphasis:
219&lt;foo&gt;<i>bar</i>&lt;/foo&gt; 243&lt;foo&gt;<i>bar</i>&lt;/foo&gt;
220 244
221<codenote>This is how to insert an inline note into the code block</codenote> 245<codenote>This is how to insert an inline note into the code block</codenote>
222</pre> 246</pre>
223<note>This is a note.</note>
224<warn>This is a warning.</warn>
225<impo>This is important.</impo>
226</body>
227</section>
228 247
248<note>
249This is a note.
250</note>
251
252<warn>
253This is a warning.
254</warn>
255
256<impo>
257This is important.
258</impo>
259
260</body>
261</section>
229<section> 262<section>
230<title>The &lt;body&gt; tags</title> 263<title>The &lt;body&gt; tags</title>
231<body> 264<body>
232 265
266<p>
233<p> We introduced a lot of new tags in the previous section -- here's what you 267We introduced a lot of new tags in the previous section -- here's what you
234need to know. The <c>&lt;p&gt;</c> (paragraph), <c>&lt;pre&gt;</c> (code 268need to know. The <c>&lt;p&gt;</c> (paragraph), <c>&lt;pre&gt;</c> (code
235block), <c>&lt;note&gt;</c>, <c>&lt;warn&gt;</c> (warning) and 269block), <c>&lt;note&gt;</c>, <c>&lt;warn&gt;</c> (warning) and
236<c>&lt;impo&gt;</c> (important) tags all can contain one or more lines of text. 270<c>&lt;impo&gt;</c> (important) tags all can contain one or more lines of text.
237Besides the <c>&lt;table&gt;</c> element (which we'll cover in just a bit), 271Besides the <c>&lt;table&gt;</c> element (which we'll cover in just a bit),
238these are the only tags that should appear immediately inside a 272these are the only tags that should appear immediately inside a
239<c>&lt;body&gt;</c> element. Another thing -- these tags <e>should not</e> be 273<c>&lt;body&gt;</c> element. Another thing -- these tags <e>should not</e> be
240stacked -- in other words, don't put a <c>&lt;note&gt;</c> element inside a 274stacked -- in other words, don't put a <c>&lt;note&gt;</c> element inside a
241<c>&lt;p&gt;</c> element. As you might guess, the <c>&lt;pre&gt;</c> element 275<c>&lt;p&gt;</c> element. As you might guess, the <c>&lt;pre&gt;</c> element
242preserves its whitespace exactly, making it well-suited for code excerpts.</p> 276preserves its whitespace exactly, making it well-suited for code excerpts.
277You can also name the <c>&lt;pre&gt;</c> tag:
278</p>
279
280<pre caption = "Named &lt;pre&gt;">
281&lt;pre caption = "Output of uptime"&gt;
282# &lt;i&gt;uptime&lt;/i&gt;
28316:50:47 up 164 days, 2:06, 5 users, load average: 0.23, 0.20, 0.25
284&lt;/pre&gt;
285</pre>
243 286
244</body> 287</body>
245</section> 288</section>
246<section> 289<section>
247<title>&lt;path&gt;, &lt;c&gt; and &lt;e&gt;</title> 290<title>&lt;path&gt;, &lt;c&gt; and &lt;e&gt;</title>
248<body> 291<body>
249 292
293<p>
250<p>The <c>&lt;path&gt;</c>, <c>&lt;c&gt;</c> and <c>&lt;e&gt;</c> elements can 294The <c>&lt;path&gt;</c>, <c>&lt;c&gt;</c> and <c>&lt;e&gt;</c> elements can
251be used inside any child <c>&lt;body&gt;</c> tag, except for 295be used inside any child <c>&lt;body&gt;</c> tag, except for
252<c>&lt;pre&gt;</c>. </p> 296<c>&lt;pre&gt;</c>.
297</p>
253 298
299<p>
254<p>The <c>&lt;path&gt;</c> element is used to mark text that refers to an 300The <c>&lt;path&gt;</c> element is used to mark text that refers to an
255<e>on-disk file</e> -- either an <e>absolute or relative path</e>, or a <e>simple filename</e>. 301<e>on-disk file</e> -- either an <e>absolute or relative path</e>, or a
256This element is generally rendered with a monospaced font to offset it from the 302<e>simple filename</e>. This element is generally rendered with a monospaced
257standard paragraph type. </p> 303font to offset it from the standard paragraph type.
304</p>
258 305
306<p>
259<p>The <c>&lt;c&gt;</c> element is used to mark up a <e>command</e> or <e>user 307The <c>&lt;c&gt;</c> element is used to mark up a <e>command</e> or <e>user
260input</e>. Think of <c>&lt;c&gt;</c> as a way to alert the reader to something 308input</e>. Think of <c>&lt;c&gt;</c> as a way to alert the reader to something
261that they can type in that will perform some kind of action. For example, all 309that they can type in that will perform some kind of action. For example, all
262the XML tags displayed in this document are enclosed in a <c>&lt;c&gt;</c> 310the XML tags displayed in this document are enclosed in a <c>&lt;c&gt;</c>
263element because they represent something that the user could type in that is 311element because they represent something that the user could type in that is
264not a path. By using <c>&lt;c&gt;</c> elements, you'll help your readers 312not a path. By using <c>&lt;c&gt;</c> elements, you'll help your readers
265quickly identify commands that they need to type in. Also, because 313quickly identify commands that they need to type in. Also, because
266<c>&lt;c&gt;</c> elements are already offset from regular text, <e>it is rarely 314<c>&lt;c&gt;</c> elements are already offset from regular text, <e>it is rarely
267necessary to surround user input with double-quotes</e>. For example, don't 315necessary to surround user input with double-quotes</e>. For example, don't
268refer to a "<c>&lt;c&gt;</c>" element like I did in this sentence. Avoiding 316refer to a "<c>&lt;c&gt;</c>" element like I did in this sentence. Avoiding
269the use of unnecessary double-quotes makes a document more readable -- and adorable!</p> 317the use of unnecessary double-quotes makes a document more readable -- and
318adorable!
319</p>
270 320
321<p>
271<p><c>&lt;e&gt;</c> is used to apply emphasis to a word or phrase; for example: 322<c>&lt;e&gt;</c> is used to apply emphasis to a word or phrase; for example:
272I <e>really</e> should use semicolons more often. As you can see, this text is 323I <e>really</e> should use semicolons more often. As you can see, this text is
273offset from the regular paragraph type for emphasis. This helps to give your 324offset from the regular paragraph type for emphasis. This helps to give your
274prose more <e>punch</e>!</p> 325prose more <e>punch</e>!
326</p>
275 327
276</body> 328</body>
277</section> 329</section>
278
279<section> 330<section>
280<title>&lt;mail&gt; and &lt;uri&gt;</title> 331<title>&lt;mail&gt; and &lt;uri&gt;</title>
281<body> 332<body>
282 333
334<p>
283<p>We've taken a look at the <c>&lt;mail&gt;</c> tag earlier; it's used to link some text 335We've taken a look at the <c>&lt;mail&gt;</c> tag earlier; it's used to link
284with a particular email address, and takes the form <c>&lt;mail link="foo@bar.com"&gt;Mr. Foo Bar&lt;/mail&gt;</c>.</p> 336some text with a particular email address, and takes the form <c>&lt;mail
337link="foo@bar.com"&gt;Mr. Foo Bar&lt;/mail&gt;</c>.
338</p>
285 339
340<p>
286<p>The <c>&lt;uri&gt;</c> tag is used to point to files/locations on the 341The <c>&lt;uri&gt;</c> tag is used to point to files/locations on the
287Internet. It has two forms -- the first can be used when you want to have the 342Internet. It has two forms -- the first can be used when you want to have the
288actual URI displayed in the body text, such as this link to 343actual URI displayed in the body text, such as this link to
289<uri>http://www.gentoo.org</uri>. To create this link, I typed 344<uri>http://www.gentoo.org</uri>. To create this link, I typed
290<c>&lt;uri&gt;http://www.gentoo.org&lt;/uri&gt;</c>. The alternate form is 345<c>&lt;uri&gt;http://www.gentoo.org&lt;/uri&gt;</c>. The alternate form is
291when you want to associate a URI with some other text -- for example, <uri 346when you want to associate a URI with some other text -- for example, <uri
292link="http://www.gentoo.org">the Gentoo Linux website</uri>. To create <e>this</e> 347link="http://www.gentoo.org">the Gentoo Linux website</uri>. To create
293link, I typed <c>&lt;uri link="http://www.gentoo.org"&gt;the Gentoo Linux website&lt;/uri&gt;</c>. 348<e>this</e> link, I typed <c>&lt;uri link="http://www.gentoo.org"&gt;the
349Gentoo Linux website&lt;/uri&gt;</c>.
294</p> 350</p>
295 351
296</body> 352</body>
297</section> 353</section>
298
299<section> 354<section>
300<title>Figures</title> 355<title>Figures</title>
301 356
302<body> 357<body>
303 358
359<p>
304<p>Here's how to insert a figure into a document -- <c>&lt;figure 360Here's how to insert a figure into a document -- <c>&lt;figure
305link="mygfx.png" short="my picture" caption="my favorite picture of all 361link="mygfx.png" short="my picture" caption="my favorite picture of all
306time"/&gt;</c>. The <c>link=</c> attribute points to the actual graphic image, 362time"/&gt;</c>. The <c>link=</c> attribute points to the actual graphic image,
307the <c>short=</c> attribute specifies a short description (currently used for 363the <c>short=</c> attribute specifies a short description (currently used for
308the image's HTML <c>alt=</c> attribute), and a caption. Not too difficult 364the image's HTML <c>alt=</c> attribute), and a caption. Not too difficult
309:) We also support the standard HTML-style &lt;img src="foo.gif"/&gt; tag 365:) We also support the standard HTML-style &lt;img src="foo.gif"/&gt; tag
310for adding images without captions, borders, etc.</p> 366for adding images without captions, borders, etc.
367</p>
311 368
312</body> 369</body>
313</section> 370</section>
314<section> 371<section>
315<title>Tables and lists</title> 372<title>Tables and lists</title>
316<body> 373<body>
317 374
375<p>
318<p>Guide supports a simplified table syntax similar to that of HTML. To start 376Guide supports a simplified table syntax similar to that of HTML. To start
319a table, use a <c>&lt;table&gt;</c> tag. Start a row with a <c>&lt;tr&gt;</c> 377a table, use a <c>&lt;table&gt;</c> tag. Start a row with a <c>&lt;tr&gt;</c>
320tag. However, for inserting actual table data, we <e>don't</e> support the 378tag. However, for inserting actual table data, we <e>don't</e> support the
321HTML &lt;td&gt; tag; instead, use the <c>&lt;th&gt;</c> if you are inserting a 379HTML &lt;td&gt; tag; instead, use the <c>&lt;th&gt;</c> if you are inserting a
322header, and <c>&lt;ti&gt;</c> if you are inserting a normal informational 380header, and <c>&lt;ti&gt;</c> if you are inserting a normal informational
323block. You can use a <c>&lt;th&gt;</c> anywhere you can use a <c>&lt;ti&gt;</c> -- 381block. You can use a <c>&lt;th&gt;</c> anywhere you can use a <c>&lt;ti&gt;</c>
324there's no requirement that <c>&lt;th&gt;</c> elements appear only in the 382-- there's no requirement that <c>&lt;th&gt;</c> elements appear only in the
325first row. Currently, these tags don't support any attributes, but some will 383first row. Currently, these tags don't support any attributes, but some will
326be added (such as a <c>caption=</c> attribute for <c>&lt;table&gt;</c>) soon. 384be added (such as a <c>caption=</c> attribute for <c>&lt;table&gt;</c>) soon.
327</p> 385</p>
328 386
387<p>
329<p> To create ordered or unordered lists, simply use the HTML-style 388To create ordered or unordered lists, simply use the HTML-style
330<c>&lt;ol&gt;</c>, <c>&lt;ul&gt;</c> and <c>&lt;li&gt;</c> tags. List tags 389<c>&lt;ol&gt;</c>, <c>&lt;ul&gt;</c> and <c>&lt;li&gt;</c> tags. List tags
331should only appear inside a <c>&lt;p&gt;</c>, <c>&lt;ti&gt;</c>, 390should only appear inside a <c>&lt;p&gt;</c>, <c>&lt;ti&gt;</c>,
332<c>&lt;note&gt;</c>, <c>&lt;warn&gt;</c> or <c>&lt;impo&gt;</c> tag. </p> 391<c>&lt;note&gt;</c>, <c>&lt;warn&gt;</c> or <c>&lt;impo&gt;</c> tag.
392</p>
333 393
334</body> 394</body>
335</section> 395</section>
336
337<section> 396<section>
338<title>Intra-document references</title> 397<title>Intra-document references</title>
339<body> 398<body>
340 399
400<p>
341<p>Guide makes it really easy to reference other parts of the document using 401Guide makes it really easy to reference other parts of the document using
342hyperlinks. You can create a link pointing to <uri link="#doc_chap1">Chapter 402hyperlinks. You can create a link pointing to <uri link="#doc_chap1">Chapter
343One</uri> by typing <c>&lt;uri link="#doc_chap1"&gt;Chapter 403One</uri> by typing <c>&lt;uri link="#doc_chap1"&gt;Chapter
344One&lt;/uri&gt;</c>. To point to <uri link="#doc_chap1_sect2">section two of 404One&lt;/uri&gt;</c>. To point to <uri link="#doc_chap1_sect2">section two of
345Chapter One</uri>, type <c>&lt;uri link="#doc_chap1_sect2"&gt;section two of 405Chapter One</uri>, type <c>&lt;uri link="#doc_chap1_sect2"&gt;section two of
346Chapter One&lt;/uri&gt;</c>. To refer to figure 3 in chapter 1, type <c>&lt;uri 406Chapter One&lt;/uri&gt;</c>. To refer to figure 3 in chapter 1, type <c>&lt;uri
347link="doc_chap1_fig3"&gt;figure 1.3&lt;/uri&gt;</c>. Or, to refer to <uri link="#doc_chap2_pre2">code listing 2 in chapter 2</uri>, 407link="doc_chap1_fig3"&gt;figure 1.3&lt;/uri&gt;</c>. Or, to refer to <uri
408link="#doc_chap2_pre2">code listing 2 in chapter 2</uri>, type <c>&lt;uri
348type <c>&lt;uri link="doc_chap2_pre2"&gt;code listing 2.2&lt;/uri&gt;</c>. We'll be 409link="doc_chap2_pre2"&gt;code listing 2.2&lt;/uri&gt;</c>. We'll be
349adding other auto-link abilities (such as table support) soon.</p> 410adding other auto-link abilities (such as table support) soon.
411</p>
350 412
351</body> 413</body>
352</section> 414</section>
353</chapter> 415</chapter>
416
417<chapter>
418<title>Coding Style</title>
419<section>
420<title>Introduction</title>
421<body>
422
423<p>
424Since all Gentoo Documentation is a joint effort and several people will
425most likely change existing documentation, a coding style is needed.
426A coding style contains two sections. The first one is regarding
427internal coding - how the xml-tags are placed. The second one is
428regarding the content - how not to confuse the reader.
429</p>
430
431<p>
432Both sections are described next.
433</p>
434
435</body>
436</section>
437<section>
438<title>Internal Coding Style</title>
439<body>
440
441<p>
442<b>Newlines</b> must be placed immediately after <e>every</e>
443GuideXML-tag (both opening as closing), except for:
444<c>&lt;version&gt;</c>, <c>&lt;date&gt;</c>, <c>&lt;title&gt;</c>,
445<c>&lt;th&gt;</c>, <c>&lt;ti&gt;</c>,
446<c>&lt;li&gt;</c>, <c>&lt;i&gt;</c>, <c>&lt;e&gt;</c>,
447<c>&lt;uri&gt;</c>, <c>&lt;path&gt;</c>, <c>&lt;b&gt;</c>,
448<c>&lt;comment&gt;</c>, <c>&lt;codenote&gt;</c>, <c>&lt;mail&gt;</c>.
449</p>
450
451<p>
452<b>Blank lines</b> must be placed immediately after <e>every</e>
453<c>&lt;body&gt;</c> (opening tag only) and before <e>every</e>
454<c>&lt;chapter&gt;</c>, <c>&lt;p&gt;</c>, <c>&lt;table&gt;</c>,
455<c>&lt;author&gt;</c> (set), <c>&lt;pre&gt;</c>, <c>&lt;ul&gt;</c>,
456<c>&lt;ol&gt;</c>, <c>&lt;warn&gt;</c>, <c>&lt;note&gt;</c> and
457<c>&lt;impo&gt;</c> (opening tags only).
458</p>
459
460<p>
461<b>Word-wrapping</b> must be applied at 80 characters except inside
462<c>&lt;pre&gt;</c>. Only when there is no other choice can be deviated from
463this rule (for instance when a URL exceeds the maximum amount of characters).
464The editor must then wrap whenever the first whitespace occurs.
465</p>
466
467<p>
468<b>Indentation</b> may not be used, except with the XML-constructs of which
469the parent XML-tags are <c>&lt;tr&gt;</c> (from <c>&lt;table&gt;</c>),
470<c>&lt;ul&gt;</c>, <c>&lt;ol&gt;</c> and <c>&lt;author&gt;</c>. If indentation
471is used, it <e>must</e> be two spaces for each indentation. That means <e>no</e>
472tabs and <e>not</e> more spaces.
473</p>
474
475<p>
476In case word-wrapping happens in <c>&lt;ti&gt;</c>, <c>&lt;th&gt;</c> or
477<c>&lt;li&gt;</c> constructs, indentation must be used for the content.
478</p>
479
480<p>
481An example for indentation is:
482</p>
483
484<pre caption = "Indentation Example">
485&lt;table&gt;
486&lt;tr&gt;
487 &lt;th&gt;Foo&lt;/th&gt;
488 &lt;th&gt;Bar&lt;/th&gt;
489&lt;/tr&gt;
490&lt;tr&gt;
491 &lt;ti&gt;This is an example for indentation.&lt;/ti&gt;
492 &lt;ti&gt;
493 In case text cannot be shown within an 80-character wide line, you
494 must use indentation if the parent tag allows it.
495 &lt;/ti&gt;
496&lt;/tr&gt;
497&lt;/table&gt;
498
499&lt;ul&gt;
500 &lt;li&gt;First option&lt;/li&gt;
501 &lt;li&gt;Second option&lt;/li&gt;
502&lt;/ul&gt;
503</pre>
504
505<p>
506<b>Attributes</b> may not have spaces in between the attribute, the
507&quot;=&quot; mark, and the attribute value. As an example:
508</p>
509
510<pre caption="Attributes">
511<comment>Wrong :</comment> &lt;pre caption = "Attributes"&gt;
512<comment>Correct:</comment> &lt;pre caption="Attributes"&gt;
513</pre>
514
515</body>
516</section>
517<section>
518<title>External Coding Style</title>
519<body>
520
521<p>
522Inside tables (<c>&lt;table&gt;</c>) and listings (<c>&lt;ul&gt;</c> and
523<c>&lt;ol&gt;</c>), periods (&quot;.&quot;) should not be used unless multiple
524sentences are used. In that case, every sentence should end with a period (or
525other reading marks).
526</p>
527
528<p>
529Every sentence, including those inside tables and listings, should start
530with a capital letter.
531</p>
532
533<pre caption="Periods and capital letters">
534&lt;ul&gt;
535 &lt;li&gt;No period&lt;/li&gt;
536 &lt;li&gt;With period. Multiple sentences, remember?&lt;/li&gt;
537&lt;/ul&gt;
538</pre>
539
540<p>
541Code Listings should <e>always</e> have a <c>caption</c>.
542</p>
543
544<p>
545Try to use <c>&lt;uri&gt;</c> with the <c>link</c> attribute as much as
546possible. In other words, the <uri link="http://www.gentoo.org">Gentoo
547Website</uri> is preferred over <uri>http://www.gentoo.org</uri>.
548</p>
549
550<p>
551When you comment something inside a <c>&lt;pre&gt;</c> construct, only use
552<c>&lt;codenote&gt;</c> if the content is a C or C++ code snippet. Otherwise,
553use <c>&lt;comment&gt;</c> and parantheses. Also place the comment <e>before</e>
554the subject of the comment.
555</p>
556
557<pre caption="Comment example">
558<comment>(Substitute "john" with your user name)</comment>
559# <i>id john</i>
560</pre>
561
562</body>
563</section>
564</chapter>
565
354<chapter> 566<chapter>
355<title>Resources</title> 567<title>Resources</title>
356<section> 568<section>
357 <title>Start writing</title> 569<title>Start writing</title>
358 <body> 570<body>
571
572<p>
359 <p>Guide has been specially designed to be "lean and mean" so that developers 573Guide has been specially designed to be "lean and mean" so that developers
360 can spend more time writing documentation and less time learning the actual XML 574can spend more time writing documentation and less time learning the actual XML
361 syntax. Hopefully, this will allow developers who aren't unusually "doc-savvy" 575syntax. Hopefully, this will allow developers who aren't unusually "doc-savvy"
362 to start writing quality Gentoo Linux documentation. If you'd like to help (or have any questions about guide), please 576to start writing quality Gentoo Linux documentation. If you'd like to help (or
363 post a message to <mail link="gentoo-dev@gentoo.org">the gentoo-dev mailing list</mail> 577have any questions about guide), please post a message to the <mail
364 stating what you'd like to tackle. 578link="gentoo-doc@gentoo.org">gentoo-doc mailing list</mail> stating what you'd
365 Have fun!</p> 579like to tackle. Have fun!
580</p>
581
366 </body> 582</body>
367</section> 583</section>
368</chapter> 584</chapter>
369</guide> 585</guide>
370 586

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.21

  ViewVC Help
Powered by ViewVC 1.1.20