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

Contents of /xml/htdocs/proj/en/gdp/doc/metadoc-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download) (as text)
Thu Jan 6 17:18:12 2005 UTC (9 years, 8 months ago) by neysx
Branch: MAIN
Changes since 1.1: +29 -14 lines
File MIME type: application/xml
parent attribute has been moved from <file> to <metadoc>

1 <?xml version='1.0' encoding='UTF-8'?>
2
3 <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/gdp/doc/metadoc-guide.xml,v 1.1 2004/12/27 22:11:16 swift Exp $ -->
4
5 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
6
7 <guide link="metadoc-guide.xml">
8 <title>Gentoo Metadoc XML Guide</title>
9
10 <author title="Author">
11 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
12 </author>
13
14 <author title="Editor">
15 <mail link="neysx@gentoo.org">Xavier Neys</mail>
16 </author>
17
18 <abstract>
19 This guide informs developers how to use the Metadoc XML format that allows the
20 Gentoo Documentation Project to keep its documentation in a hierarchical manner
21 and allow more information to be stored about each document.
22 </abstract>
23
24 <!-- The content of this document is licensed under the CC-BY-SA license -->
25 <!-- See http://creativecommons.org/licenses/by-sa/2.0 -->
26 <license/>
27
28 <version>1.1</version>
29 <date>2005-01-06</date>
30
31 <chapter>
32 <title>Introduction</title>
33 <section>
34 <title>Why is MetadocXML Needed?</title>
35 <body>
36
37 <p>
38 MetadocXML is not needed, it's an additional resource for the Gentoo
39 Documentation Project to keep track of documents, even if they are located
40 outside of the normal <path>[gentoo]/xml/htdocs/doc</path> scope.
41 </p>
42
43 <p>
44 Thanks to MetadocXML, we can now
45 </p>
46
47 <ul>
48 <li>
49 track documents that are located inside project webspace
50 (<path>/proj</path>) instead of the usual documentation repository
51 (<path>/doc</path>)
52 </li>
53 <li>
54 categorize documentation into various categories (or subcategories) with the
55 additional benefit that we can now automatically generate the documentation
56 index (and more)
57 </li>
58 <li>
59 track non-official documentation team members (such as translators)
60 </li>
61 <li>
62 use parts of big documents (Handbooks) as individual guides on certain
63 topics
64 </li>
65 <li>
66 assign bugs to particular documents for quick reference and with the
67 possibility of masking out a document in case of a major showstopping bug
68 </li>
69 <li>
70 primitively check if a translated file is in sync with it's English
71 counterpart or not
72 </li>
73 </ul>
74
75 <p>
76 Note that the last advantage is primitive and will probably not be extended.
77 There are more powerful tools (such as Xavier's <uri
78 link="http://dev.gentoo.org/~neysx/trads/trads-doc.html">trads-doc</uri> script)
79 that has many more features than this.
80 </p>
81
82 <p>
83 Translation teams that do not use MetadocXML yet don't need to worry - they will
84 not lose any current functionality as it only builds upon the existing
85 infrastructure - there are no changes to the GuideXML format that need
86 MetadocXML.
87 </p>
88
89 </body>
90 </section>
91 <section>
92 <title>How does MetadocXML Work?</title>
93 <body>
94
95 <p>
96 There is one central file in which all meta information on the documentation is
97 maintained. We call this file <path>metadoc.xml</path>. This file should be
98 located inside your main repository (<path>/doc/${LANGUAGE}</path>) although
99 this is not hard-coded.
100 </p>
101
102 <p>
103 Inside this file, all meta information is stored:
104 </p>
105
106 <ul>
107 <li>Members of the team</li>
108 <li>Categories in which documents participate</li>
109 <li>Files that are covered</li>
110 <li>Documents that are covered</li>
111 <li>Bugs that are part of a document</li>
112 </ul>
113
114 <p>
115 Next to <path>metadoc.xml</path>, one also can have a dynamically generated index
116 file (usually called <path>index.xml</path>), an overview listing of all
117 documentation (usually called <path>list.xml</path>) and an overview listing of
118 all members, files and bugs (usually called <path>overview.xml</path>).
119 </p>
120
121 </body>
122 </section>
123 </chapter>
124
125 <chapter>
126 <title>The metadoc.xml File</title>
127 <section>
128 <title>XML Structure</title>
129 <body>
130
131 <p>
132 The <path>metadoc.xml</path> file is started with the usual XML initialisation
133 code and Gentoo CVS header information:
134 </p>
135
136 <pre caption="XML Initialisation">
137 &lt;?xml version='1.0' encoding="UTF-8"?&gt;
138 &lt;!-- &#36;Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/metadoc.xml,v 1.25 2004/12/23 09:51:30 swift Exp &#36; --&gt;
139 &lt;!DOCTYPE metadoc SYSTEM "/dtd/metadoc.dtd"&gt;
140 </pre>
141
142 <p>
143 Then, one starts with the MetadocXML declaration.
144 </p>
145
146 <pre caption="English MetadocXML declaration">
147 &lt;metadoc lang="<comment>en</comment>"&gt;
148 </pre>
149
150 <p>
151 Translators should reference the main <path>/doc/en/metadoc.xml</path> in the
152 <c>parent</c> attribute. This lets metadoc identify untranslated files and find
153 out whether versions of translated versions and originals still match.
154 </p>
155
156 <pre caption="Translated MetadocXML declaration">
157 &lt;metadoc lang="<comment>language code</comment>" parent="/doc/en/metadoc.xml"&gt;
158 </pre>
159
160 <p>
161 Beneath the <c>metadoc</c> entity, the following entities should be declared (in
162 the given order):
163 </p>
164
165 <ul>
166 <li>
167 <c>members</c> which declares all members of the given language team
168 </li>
169 <li>
170 <c>categories</c> which declares the possible categories used
171 </li>
172 <li>
173 <c>files</c> which contains all files covered by the Metadoc file
174 </li>
175 <li>
176 <c>docs</c> which contains all documents covered by the Metadoc file
177 </li>
178 </ul>
179
180 </body>
181 </section>
182 <section>
183 <title>The Members Entity</title>
184 <body>
185
186 <p>
187 Inside the members entity, one can declare two 'types' of members: <c>lead</c>
188 and <c>member</c>. A <c>lead</c> should be known by the Gentoo Developers
189 Relations as it takes only the nickname of the Lead developer and looks it up in
190 the Gentoo Memberlist. A <c>member</c> can either be a Gentoo Developer (in
191 which case only a nickname is given) or a contributor.
192 </p>
193
194 <p>
195 In case of a contributor, a <c>member</c> tag is given two attributes,
196 <c>mail</c> and <c>fullname</c>, containing the contributor's e-mail address and
197 full name.
198 </p>
199
200 <pre caption="Example use of the members entity">
201 &lt;members&gt;
202 &lt;lead&gt;swift&lt;/lead&gt;
203 &lt;lead&gt;neysx&lt;/lead&gt;
204 &lt;member&gt;dertobi123&lt;/member&gt;
205 &lt;member mail="gentoo_contributor@gmail.com" fullname="Jhon Doe"&gt;jdoe&lt;/member&gt;
206 &lt;/members&gt;
207 </pre>
208
209 </body>
210 </section>
211 <section>
212 <title>The Categories Entity</title>
213 <body>
214
215 <p>
216 Inside the <c>categories</c> entity one only declares <c>cat</c> entities. Each
217 <c>cat</c> entity covers one Category. It uses one mandatory parameter <c>id</c>
218 which is used to reference the category. You can also define a parameter
219 <c>parent</c> in case the category is a child of another category.
220 </p>
221
222 <p>
223 In this case, the <c>parent</c> attribute references the <c>id</c> attribute of
224 the parent category.
225 </p>
226
227 <pre caption="Example use of the categories entity">
228 &lt;categories&gt;
229 &lt;cat id="faq"&gt;Frequently Asked Questions&lt;/cat&gt;
230 &lt;cat id="install"&gt;Installation Related Resources&lt;/cat&gt;
231 &lt;cat id="install_guides"&gt;Installation Guides&lt;/cat&gt;
232 &lt;/categories&gt;
233 </pre>
234
235 </body>
236 </section>
237 <section>
238 <title>The Files Entity</title>
239 <body>
240
241 <p>
242 The <c>files</c> entity contains only <c>file</c> entities.
243 </p>
244
245 <p>
246 Each <c>file</c> entity references a single XML file. It has a mandatory
247 <c>id</c> attribute which should be seen as a primary key to lookup the file.
248 Metadoc will compare the file name defined with the same <c>id</c> attribute in
249 the metadoc's parent file (defined in the root element) to find out whether the
250 file is a translation or an untranslated file. File names would be identical in
251 the latter case.
252 </p>
253
254 <pre caption="Files entity example">
255 &lt;files&gt;
256 &lt;file id="ati-faq"&gt;/doc/nl/ati-faq.xml&lt;/file&gt;
257 &lt;/files&gt;
258 </pre>
259
260 </body>
261 </section>
262 <section>
263 <title>The Docs Entity</title>
264 <body>
265
266 <p>
267 The <c>docs</c> entity should only contain <c>doc</c> entities.
268 </p>
269
270 <p>
271 Each <c>doc</c> entity has a mandatory <c>id</c> attribute which should be seen
272 as a primary key for the document.
273 </p>
274
275 <p>
276 Inside each <c>doc</c> entity, at least one entity should be available: the
277 <c>fileid</c> entity, which refers to the <c>id</c> attribute of a <c>file</c>
278 entity corresponding with the main file for the document.
279 </p>
280
281 <p>
282 In case of a handbook chapter, one must refer to the main handbook page (the top
283 handbook XML file). The <c>fileid</c> entity then contains two additional
284 parameters, called <c>vpart</c> and <c>vchap</c> which refer to the
285 corresponding part and chapter of the document inside the handbook.
286 </p>
287
288 <p>
289 Inside the <c>doc</c> entity, two other entities are possible:
290 </p>
291
292 <ul>
293 <li>
294 One or more <c>memberof</c> entities, referring to the categorie(s) in which
295 the document is located (note that a document can be in several categories
296 at once)
297 </li>
298 <li>
299 One <c>bugs</c> entity containing one or more <c>bug</c> entities. A
300 <c>bug</c> entity refers to a bugnumber that covers a bug in the document.
301 In case of a major bug, one can add the attribute <c>stopper="yes"</c> to
302 the <c>bug</c> entity in order for the document not to appear on the
303 generated index page.
304 </li>
305 </ul>
306
307 <pre caption="Example Docs entity">
308 &lt;docs&gt;
309 &lt;doc id="handbook_x86"&gt;
310 &lt;memberof&gt;install_guides&lt;/memberof&gt;
311 &lt;fileid&gt;handbook-x86&lt;/fileid&gt;
312 &lt;bugs&gt;
313 &lt;bug&gt;70753&lt;/bug&gt;
314 &lt;/bugs&gt;
315 &lt;/doc&gt;
316 &lt;doc id="portage-intro"&gt;
317 &lt;memberof&gt;gentoo_portage&lt;/memberof&gt;
318 &lt;fileid vpart="2" vchap="1"&gt;handbook-x86&lt;/fileid&gt;
319 &lt;/doc&gt;
320 &lt;doc id="uml"&gt;
321 &lt;memberof&gt;sysadmin_general&lt;/memberof&gt;
322 &lt;fileid&gt;uml&lt;/fileid&gt;
323 &lt;/doc&gt;
324 &lt;/docs&gt;
325 </pre>
326
327 </body>
328 </section>
329 </chapter>
330
331 <chapter>
332 <title>The Additional MetadocXML Files</title>
333 <section>
334 <title>Automatically Generated Index</title>
335 <body>
336
337 <p>
338 When you want an automatically generated index, you should start the document
339 with the following code:
340 </p>
341
342 <pre caption="Dynamically Generated Index">
343 &lt;?xml version='1.0' encoding='UTF-8'?&gt;
344 &lt;?xml-stylesheet href="/xsl/metadoc.xsl" type="text/xsl"?&gt;
345 &lt;?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?&gt;
346
347 &lt;!-- &#36;Header&#36; --&gt;
348
349 &lt;!DOCTYPE dynamic SYSTEM "/dtd/metadoc.dtd"&gt;
350
351 <comment>&lt;!-- Substitute "/doc/en/metadoc.xml" with the location of your metadoc file --&gt;</comment>
352 &lt;dynamic metadoc="<i>/doc/en/metadoc.xml</i>"&gt;
353 &lt;title&gt;<i>Gentoo Documentation Resources</i>&lt;/title&gt;
354 &lt;intro&gt;
355
356 <comment>(...)</comment>
357
358 &lt;/intro&gt;
359
360 &lt;catid&gt;<i>faq</i>&lt;/catid&gt;
361 &lt;catid&gt;<i>install</i>&lt;/catid&gt;
362
363 &lt;/dynamic&gt;
364 </pre>
365
366 <p>
367 In between the <c>intro</c> tags you should write one or more sections which
368 will always appear on the top of the page. You will probably want to write an
369 introduction and some additional information for the reader to know who to
370 contact in case of translation mishaps or other issues.
371 </p>
372
373 <p>
374 Inside the <c>intro</c> tags you can use plain GuideXML starting from
375 <c>section</c>.
376 </p>
377
378 <p>
379 The <c>catid</c> tags refer to the main categories used by the dynamical index.
380 You should list each possible non-child category that is declared in your
381 metadoc file. <e>Do not list</e> categories that are child of another category.
382 </p>
383
384 </body>
385 </section>
386 <section>
387 <title>Dynamically Generated List Document</title>
388 <body>
389
390 <p>
391 A dynamically generated list document starts identically to a dynamically
392 generated index file:
393 </p>
394
395 <pre caption="Dynamically generated list document">
396 &lt;?xml version='1.0' encoding='UTF-8'?&gt;
397 &lt;?xml-stylesheet href="/xsl/metadoc.xsl" type="text/xsl"?&gt;
398 &lt;?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?&gt;
399
400 &lt;!-- &#36;Header&#36; --&gt;
401
402 &lt;!DOCTYPE dynamic SYSTEM "/dtd/metadoc.dtd"&gt;
403
404 <comment>&lt;!-- Substitute "/doc/en/metadoc.xml" with the location of your metadoc file --&gt;</comment>
405 &lt;dynamic metadoc="<i>/doc/en/metadoc.xml</i>"&gt;
406 &lt;title&gt;<i>Gentoo Documentation Listing</i>&lt;/title&gt;
407 </pre>
408
409 <p>
410 However, there is no <c>intro</c> tag. What needs to be added are all the top
411 categories used by the listing. To differentiate this from the index (which will
412 also display the abstract information on each document) this happens between
413 <c>list</c> tags inside <c>listing</c>:
414 </p>
415
416 <pre caption="Listing of categories">
417 &lt;listing&gt;
418 &lt;list&gt;faq&lt;/list&gt;
419 &lt;list&gt;install&lt;/list&gt;
420 &lt;/listing&gt;
421 </pre>
422
423 </body>
424 </section>
425 <section>
426 <title>Dynamically Generated Overview Document</title>
427 <body>
428
429 <p>
430 The overview document is started similarly as the two documents decribed above:
431 </p>
432
433 <pre caption="Dynamically generated overview document">
434 &lt;?xml version='1.0' encoding='UTF-8'?&gt;
435 &lt;?xml-stylesheet href="/xsl/metadoc.xsl" type="text/xsl"?&gt;
436 &lt;?xml-stylesheet href="/xsl/guide.xsl" type="text/xsl"?&gt;
437
438 &lt;!-- &#36;Header&#36; --&gt;
439
440 &lt;!DOCTYPE dynamic SYSTEM "/dtd/metadoc.dtd"&gt;
441
442 <comment>&lt;!-- Substitute "/doc/en/metadoc.xml" with the location of your metadoc file --&gt;</comment>
443 &lt;dynamic metadoc="<i>/doc/en/metadoc.xml</i>"&gt;
444 &lt;title&gt;<i>Documentation Development Overview</i>&lt;/title&gt;
445 </pre>
446
447 <p>
448 You can again write up a small introduction in GuideXML between the <c>intro</c>
449 XML tags, starting from a <c>section</c> up. Once that is finished, a single tag
450 <c>&lt;overview/&gt;</c> is sufficient.
451 </p>
452
453 <pre caption="Intro and overview tags">
454 &lt;intro&gt;
455 <comment>(...)</comment>
456 &lt;/intro&gt;
457
458 &lt;overview/&gt;
459 </pre>
460
461 </body>
462 </section>
463 </chapter>
464
465 </guide>

  ViewVC Help
Powered by ViewVC 1.1.20