| 1 | ------------------------------------------------------------------------------ |
|---|
| 2 | H Y D R O G E N Drum machine |
|---|
| 3 | ------------------------------------------------------------------------------ |
|---|
| 4 | |
|---|
| 5 | HYDROGEN DOCUMENTATION |
|---|
| 6 | ====================== |
|---|
| 7 | |
|---|
| 8 | Contents: |
|---|
| 9 | |
|---|
| 10 | 1. Overview |
|---|
| 11 | 2. Tools, Supported Platforms, and Releases |
|---|
| 12 | 3. Translators |
|---|
| 13 | 4. Documentors |
|---|
| 14 | 5. Developers |
|---|
| 15 | 6. XML and Validation |
|---|
| 16 | 7. INSTALL.txt Changelog |
|---|
| 17 | |
|---|
| 18 | 1. Overview |
|---|
| 19 | ----------- |
|---|
| 20 | |
|---|
| 21 | Hydrogen documentation is maintained in DocBook 4.0 (XML) and |
|---|
| 22 | translated to HTML before release. Different translations are managed |
|---|
| 23 | through GNU gettext PO files. When the documentation is generated, |
|---|
| 24 | the PO files and the master documentation are merged to create the doc |
|---|
| 25 | for that specific language. |
|---|
| 26 | |
|---|
| 27 | This document is split up into the three types of people who may want |
|---|
| 28 | to contribute to Hydrogen documentation: Translators, Documentors, |
|---|
| 29 | and Developers. A section is devoted to each one, individually. |
|---|
| 30 | |
|---|
| 31 | This document assumes that you don't know much, and tries to give you |
|---|
| 32 | pointers to the stuff you need to know. |
|---|
| 33 | |
|---|
| 34 | 2. Tools, Supported Platforms, and Releases |
|---|
| 35 | ------------------------------------------- |
|---|
| 36 | |
|---|
| 37 | The following tools are used to maintain and process the |
|---|
| 38 | documentation. Depending on what you're working on, you may not need |
|---|
| 39 | all (or any) of these. |
|---|
| 40 | |
|---|
| 41 | xml2po - Creates and updates the translation templates (*.pot) and |
|---|
| 42 | translation files (*.po) based on the original DocBook source.[1] |
|---|
| 43 | |
|---|
| 44 | po2xml - Merges the master DocBook source with a translation file |
|---|
| 45 | (*.po) to create a translated DocBook file.[1] |
|---|
| 46 | |
|---|
| 47 | xmlto - Converts DocBook files to HTML. (Note that xmlto can |
|---|
| 48 | convert DocBook to much more than just HTML.)[2] |
|---|
| 49 | |
|---|
| 50 | xmllint - Used to validate the DocBook files against the DocBook |
|---|
| 51 | DTD.[3] |
|---|
| 52 | |
|---|
| 53 | make - GNU's make utility. |
|---|
| 54 | |
|---|
| 55 | As it happens, these tools are all very easy to install on Linux, |
|---|
| 56 | being a part of the core toolchains for KDE, Gnome, Debian, etc. |
|---|
| 57 | However, these tools are not as easy to set up on non-Linux platforms. |
|---|
| 58 | Furthermore, it is undesireable to add these to the list of build |
|---|
| 59 | dependencies for Hydrogen. |
|---|
| 60 | |
|---|
| 61 | Therefore, these files will be processed before making a release of |
|---|
| 62 | Hydrogen, and the generated HTML output will become a part of the |
|---|
| 63 | distribution. |
|---|
| 64 | |
|---|
| 65 | [1] xml2po and po2xml are part of poxml, which is in the KDE SDK. |
|---|
| 66 | http://www.kde.org/. The Makefile is set up for the KDE3 version. |
|---|
| 67 | [2] xmlto is a convenient front-end to an XSLT processor. |
|---|
| 68 | http://cyberelk.net/tim/software/xmlto/ |
|---|
| 69 | [3] xmllint is part of libxml http://xmlsoft.org/ |
|---|
| 70 | |
|---|
| 71 | 3. Translators |
|---|
| 72 | -------------- |
|---|
| 73 | |
|---|
| 74 | To translate documentation for Hydrogen you will need: |
|---|
| 75 | |
|---|
| 76 | * To understand XML, and enough DocBook to be dangerous. |
|---|
| 77 | |
|---|
| 78 | * A PO-file editor. (Note that a text editor works fine, but a |
|---|
| 79 | translation assistant like KBabel is better.) |
|---|
| 80 | |
|---|
| 81 | * To be able to read and understand English. |
|---|
| 82 | |
|---|
| 83 | If you don't have all the tools listed in Section 2, that's OK. Ask |
|---|
| 84 | the Hydrogen Developer list and someone there can process files for |
|---|
| 85 | you. |
|---|
| 86 | |
|---|
| 87 | To make a new translation of the Hydrogen manual or tutorial, simply |
|---|
| 88 | copy the template and get started: |
|---|
| 89 | |
|---|
| 90 | $ cp manual.pot manual_ja.po |
|---|
| 91 | |
|---|
| 92 | Note that the _ZZ is added, and ZZ is the IANA abbreviation code for |
|---|
| 93 | that language. (E.g. 'ja' is for 'Japanese.') The registry for the |
|---|
| 94 | codes is located here: |
|---|
| 95 | |
|---|
| 96 | http://www.iana.org/assignments/language-subtag-registry |
|---|
| 97 | |
|---|
| 98 | If a translation already exists, but needs to be updated, you can |
|---|
| 99 | update the .po file like this: |
|---|
| 100 | |
|---|
| 101 | $ touch manual.docbook |
|---|
| 102 | $ make manual_es.po |
|---|
| 103 | |
|---|
| 104 | You can either see the changes using 'diff' or your translation |
|---|
| 105 | editor. |
|---|
| 106 | |
|---|
| 107 | When you want to check your translation (and view it in HTML), this |
|---|
| 108 | can be done like this: |
|---|
| 109 | |
|---|
| 110 | $ make manual_ja.html |
|---|
| 111 | |
|---|
| 112 | NOTICE: Before creating the HTML file, the document will be |
|---|
| 113 | validated. If the document does not validate, you will have to alter |
|---|
| 114 | your translation file so that the output is a valid DocBook document. |
|---|
| 115 | For more information on Validation, see Section 6. |
|---|
| 116 | |
|---|
| 117 | RULES AND GUIDELINES FOR TRANSLATING: |
|---|
| 118 | |
|---|
| 119 | * No new content. New content must be first added to the master |
|---|
| 120 | (English) manual, and then translated to all the other manuals. |
|---|
| 121 | |
|---|
| 122 | * Maintain the DocBook XML structure as closely as possible. Do |
|---|
| 123 | not add sections, divide paragraphs, or alter the markup |
|---|
| 124 | significantly. |
|---|
| 125 | |
|---|
| 126 | * The English translation uses a little humor to try to keep the |
|---|
| 127 | reading interesting. When this happens, the language and idioms |
|---|
| 128 | being used are very cultural. Please do *NOT* translate the |
|---|
| 129 | words literally. Instead, please translate the ideas to your |
|---|
| 130 | culture as you see fit. We've asked the Documentors to mark |
|---|
| 131 | when this is happening so that you don't miss the joke. This |
|---|
| 132 | should show up in the PO file. |
|---|
| 133 | |
|---|
| 134 | * If your culture doesn't like American-style informal writing, |
|---|
| 135 | please feel free to make a humor-less translation. |
|---|
| 136 | |
|---|
| 137 | * Submit translations to the Hydrogen Developers list |
|---|
| 138 | (hydrogen-devel@lists.sourceforge.net) |
|---|
| 139 | |
|---|
| 140 | 4. Documentors |
|---|
| 141 | -------------- |
|---|
| 142 | |
|---|
| 143 | The master Hydrogen Manual and Tutorial are in English. All new |
|---|
| 144 | content and major revisions shall be done there first. In order to |
|---|
| 145 | work on the documentation, you will need: |
|---|
| 146 | |
|---|
| 147 | * To know and understand XML and DocBook well. |
|---|
| 148 | |
|---|
| 149 | * To know and understand Hydrogen well enough to *ask* |
|---|
| 150 | *questions*. |
|---|
| 151 | |
|---|
| 152 | * An XML editor (note: any text editor will do). |
|---|
| 153 | |
|---|
| 154 | * An XML validator (e.g. xmllint, xsltproc, Xalan) |
|---|
| 155 | |
|---|
| 156 | * A way to create PNG images. (e.g. GIMP, PhotoShop) |
|---|
| 157 | |
|---|
| 158 | What you write is pretty much your own style. Please *do* keep the |
|---|
| 159 | text interesting to read by using wit and a more familiar |
|---|
| 160 | conversational style. If you are using an English pun or expression |
|---|
| 161 | that is intended to convey humor, please mark it so that the |
|---|
| 162 | translator gets the joke: |
|---|
| 163 | |
|---|
| 164 | <!-- TRANSLATORS: "Have your squash and eat it, too." This |
|---|
| 165 | combines a well-known cliche ("Have your cake and eat it, too.") |
|---|
| 166 | and a pun on the word "squash." In English, "squash" is a |
|---|
| 167 | vegetable (and not a very popular one) and "squash" is also a verb |
|---|
| 168 | meaning "to flatten in a destructive way." For example: "I |
|---|
| 169 | squashed the bug to kill it." --> |
|---|
| 170 | |
|---|
| 171 | (Ahem, don't ask me how I came up with that one.....) |
|---|
| 172 | |
|---|
| 173 | Before submitting (or committing) your changes, please make sure that |
|---|
| 174 | your documents validate (see Section 6 below). Some guidelines: |
|---|
| 175 | |
|---|
| 176 | * Use double-quotes for all attributes. |
|---|
| 177 | Good: <foo id="bar"/> |
|---|
| 178 | Bad: <foo id='bar'/> |
|---|
| 179 | Reason: po2xml chokes on them. |
|---|
| 180 | |
|---|
| 181 | * Please make good use of <xref> tags for internal links within |
|---|
| 182 | the document. |
|---|
| 183 | |
|---|
| 184 | * Since we're using <xref>'s -- if you change an id=".." |
|---|
| 185 | attribute, make sure that you change all its references, too. |
|---|
| 186 | If you create a broken link, the document won't validate. |
|---|
| 187 | |
|---|
| 188 | * Do not make reference to specific section numbers, figure |
|---|
| 189 | numbers, or titles (e.g. "See section 2.1.3 The Menu Bar"). |
|---|
| 190 | Instead, use <xref> tags so that this text will be generated for |
|---|
| 191 | you. |
|---|
| 192 | |
|---|
| 193 | * For italics, you do not need to set the role="italic" attribute, |
|---|
| 194 | since that is the default. To get boldface, you must use |
|---|
| 195 | role="bold". |
|---|
| 196 | Example: <emphasis role="bold">really</emphasis> |
|---|
| 197 | Bad: <emphasis rold="italic">might</emphasis> |
|---|
| 198 | |
|---|
| 199 | * For web links, don't write the URL twice. The processor will do |
|---|
| 200 | that for you, and it makes it more readable. |
|---|
| 201 | Good: <ulink url="http://www.google.com"/> |
|---|
| 202 | Bad: <ulink url="http://www.google.com">http://www.google.com</ulink> |
|---|
| 203 | |
|---|
| 204 | * Don't worry about typesetting in the DocBook documents. That's |
|---|
| 205 | what XSL and CSS stylesheets are for. Get the content done, and |
|---|
| 206 | then worry about formatting. Don't get distracted by stuff like |
|---|
| 207 | section indents or relative font sizes. |
|---|
| 208 | |
|---|
| 209 | * However, *do* worry about typesetting on pre-formatted tags like |
|---|
| 210 | <screen> and <code> and <literallayout>. Extra spaces and |
|---|
| 211 | indents in the source document *will* carry through all the way |
|---|
| 212 | to the final document. |
|---|
| 213 | |
|---|
| 214 | 5. Developers |
|---|
| 215 | ------------- |
|---|
| 216 | |
|---|
| 217 | Since we don't want to add xmlto, poxml, xmllint, and the DocBook |
|---|
| 218 | DTD's to our normal build requirements: All HTML files need to be |
|---|
| 219 | generated and committed before releasing. After the release, the |
|---|
| 220 | generated HTML files can (and should) be deleted. Do not commit the |
|---|
| 221 | generated DocBook documents. |
|---|
| 222 | |
|---|
| 223 | If you are preparing a Hydrogen release, you must have all the tools |
|---|
| 224 | listed above so that you can process the documents. You may also need |
|---|
| 225 | to understand DocBook enough to help a translator with validation |
|---|
| 226 | issues. (See Section 6 below.) |
|---|
| 227 | |
|---|
| 228 | The reason for doing it this way is that (as of this writing) xmlto, |
|---|
| 229 | poxml, xmllint, and DocBook are not very portable across Linux, Mac, |
|---|
| 230 | and Windows. Nor or they even very portable across different Linux |
|---|
| 231 | distributions. However, the tools are fairly stable on Debian/Ubuntu |
|---|
| 232 | -- which most of the current developers are using. |
|---|
| 233 | |
|---|
| 234 | 6. XML and Validation |
|---|
| 235 | --------------------- |
|---|
| 236 | |
|---|
| 237 | You've probably written HTML before, and found it pretty easy. HTML |
|---|
| 238 | is an application of something bigger called SGML. However, SGML very |
|---|
| 239 | difficult to implement reliably. ("Best viewed on Netscape |
|---|
| 240 | Navigator(TM)!!") Because of this, XML was developed as a replacement |
|---|
| 241 | to SGML. To read more about XML, check out the Wikipedia article: |
|---|
| 242 | |
|---|
| 243 | http://en.wikipedia.org/wiki/XML |
|---|
| 244 | |
|---|
| 245 | It's very much like HTML except that: |
|---|
| 246 | |
|---|
| 247 | * The tags are case sensitive. <IMG> and <img> are the same in |
|---|
| 248 | HTML, but in XML they are considered different. |
|---|
| 249 | |
|---|
| 250 | * Closing tags are not optional. In HTML you could start a |
|---|
| 251 | paragraph with a <P>, and then start a new one by putting |
|---|
| 252 | another <P>. The closing tag </P> is implied. In XML, you must |
|---|
| 253 | include the closing tag: |
|---|
| 254 | |
|---|
| 255 | <p>"Knock, knock."</p> |
|---|
| 256 | <p>"Who's there?"</p> |
|---|
| 257 | |
|---|
| 258 | * Empty tags are like this: <br/>. (In HTML they didn't have the |
|---|
| 259 | forward slash.) |
|---|
| 260 | |
|---|
| 261 | If a document follows all the rules of XML, it is called |
|---|
| 262 | "Well-Formed." For example, the following is a well-formed XML |
|---|
| 263 | document: |
|---|
| 264 | |
|---|
| 265 | <?xml version='1.0' encoding='UTF-8'?> |
|---|
| 266 | <ijustmadethistagup> |
|---|
| 267 | <because>It's</because><ok/> to <make it="up">as</make> |
|---|
| 268 | you go</ijustmadethistagup> |
|---|
| 269 | |
|---|
| 270 | But the following is *NOT* a well-formed XML document: |
|---|
| 271 | |
|---|
| 272 | <?xml version='1.0' encoding='UTF-8'?> |
|---|
| 273 | <ijustmadethistagup> |
|---|
| 274 | <because>It's <ok/> to <make it=up>as</make> |
|---|
| 275 | you go</ijustmadethistagup> |
|---|
| 276 | |
|---|
| 277 | (Can you find the errors? If you get stumped, feed it to a |
|---|
| 278 | validator.) |
|---|
| 279 | |
|---|
| 280 | While it's imperative that documents be well-formed, many documents |
|---|
| 281 | (such as DocBook) have a specific structure that must be maintained. |
|---|
| 282 | For example, in HTML you should only have paragraphs inside of the |
|---|
| 283 | body: |
|---|
| 284 | |
|---|
| 285 | <body> |
|---|
| 286 | <p>I am the very model of a modern |
|---|
| 287 | major general.</p> |
|---|
| 288 | </body> |
|---|
| 289 | |
|---|
| 290 | But, if I do this, it will still be well-formed XML: |
|---|
| 291 | |
|---|
| 292 | <p> |
|---|
| 293 | <body>I am the <happy>very</happy> model of a modern |
|---|
| 294 | major general.</body> |
|---|
| 295 | </p> |
|---|
| 296 | |
|---|
| 297 | It is not, however, a Valid HTML document. The W3C published a DTD |
|---|
| 298 | (Document Type Definition) for HTML that clearly specifies that the |
|---|
| 299 | former is OK and the latter is degenerate. |
|---|
| 300 | |
|---|
| 301 | When a document is checked against the DTD, it is said to be "Valid" |
|---|
| 302 | or "Validated" if it passes all the requirements of the DTD. |
|---|
| 303 | |
|---|
| 304 | Validation is important, because our DocBook source files are going to |
|---|
| 305 | be _processed_ by several automatic tools. These tools know the |
|---|
| 306 | structure of DocBook, and are able to generate output based on that. |
|---|
| 307 | However, if we feed them an invalid document, the tools may process |
|---|
| 308 | the data -- but they probably won't process it *right*. |
|---|
| 309 | |
|---|
| 310 | 7. README.DOCUMENTATION.txt Changelog |
|---|
| 311 | ------------------------------------- |
|---|
| 312 | |
|---|
| 313 | 2009-04-09 Gabriel M. Beddingfield <gabriel@teuton.org> |
|---|
| 314 | * Create README.DOCUMENTATION.txt |
|---|