]> Shamusworld >> Repos - ardour-manual/blob - STYLE_GUIDE
Minor edit to 'Controlling Track with Automation'.
[ardour-manual] / STYLE_GUIDE
1
2 *Style guide for the Ardour manual*
3
4
5 1. Rationale
6 ============
7
8 The Ardour manual should be consistent across different media, and it should
9 be easily updatable when Ardour's behaviour changes. The markup should be
10 semantic--looks are determined in the CSS, and only there. If you feel you must
11 compromise the markup in order to obtain a certain look: don't do it. Accept
12 the look. Alternatively, edit the CSS, but be careful not to make matters worse
13 elsewhere.
14
15
16 1.1 visual markup
17 -----------------
18
19 <b>,<i>,<u>,<font> or any other purely visual elements are not used in the
20 Ardour manual. What you really mean is an <em>phasis or a <strong> emphasis.
21 If you feel that some special terms should always be green and underlined, the
22 approach of choice is this:
23
24 <span class="my_important_keyword">foobar</span>
25
26 and then add
27
28 .my_important_keyword {
29         text-decoration: underline;
30         color: #004400;
31         background-color: #eeffee;
32 }
33
34 to apps.css.
35
36 If you add a new class with semantic meaning, document it below, under
37 "Custom classes", and be sure to explain it to the reader at
38 include/about-ardour-documentation.html.
39
40
41 2. Format and Validation
42 ========================
43
44 The Ardour manual has been converted to valid XHTML 1.0. That means it must
45 be valid XML, with all tags closed properly. The reason for this extra
46 complication is that XML can be more easily checked and automatically
47 refactored than plain HTML, which eases maintenance.
48
49 Watch out for the ampersand "&" and angle brackets "<" and ">". They will
50 render your XHTML invalid, and must be replaced by their named entities
51 "&amp;", "&lt;", and "&gt;".
52
53
54 3. Custom classes
55 =================
56
57 We use the class attribute for some aspects of styling (such as to float an
58 image left or right in a text paragraph), and also for more fine-grained
59 semantic markup than core XHTML allows.
60
61 Any XHTML element can include a class attribute. If you need to add a class
62 attribute to a word or a few words which don't have an element of their own,
63 use <span class="my_new_category">foo bar</span>.
64
65 If you need to apply a class to several block-level elements such as
66 paragraphs or lists, enclose them in a <div>..</div>. Wherever possible,
67 create semantic classes rather than visual ones.
68
69 .left: 
70 make an element float left in the surrounding paragraph.
71
72 .right: 
73 make an element float right in the surrounding paragraph.
74
75 .note: 
76 use for important notes that should be visually distinct from the
77 normal text flow, or asides. Currently rendered in a gray box.
78
79 .warning:
80 use for potentially dangerous situations involving data loss, malfunction,
81 or sound quality issues. Currently rendered in a red box.
82
83 .mac, .lin, .win: 
84 use as additional classes to mark a section as relevant for these operating
85 systems only.
86
87 Check include/about-ardour-documentation.html, it serves as a style and
88 markup guide.
89
90
91 4. Element use
92 ==============
93
94
95 4.1 Main structural elements
96 ----------------------------
97
98 <h1>..<h6>
99 An <h1/> heading is added by the build script, so it should not be used in
100 the manual page itself. If you feel you need another <h1>, start a new
101 subpage. Heading levels must not be skipped. Any sub-heading must be exactly
102 one level below its predecessor. Do not abuse headings to style a head line.
103
104 <p>
105 Every snippet of text should be enclosed in a block level element. The
106 default choice is <p>, the plain paragraph.
107
108 <a>
109 Internal manual links should be absolutely stable, as long as the references in
110 the master document do not change (and they absolutely *should* not be changed
111 except for a *very* good reason, even then they probably should not be
112 changed!). Use the form:
113
114 <a href="@@my-internal-link">
115
116 where @@my-internal-link is a reference to a "link:" keyword in a header in the
117 master document. Note that in the master document, they will not have the
118 double at-sign ("@@") in front, that is *only* used in the page content to
119 signal to the build system that it is an internal link that needs to be fixed
120 so that it points to the correct URL.
121
122
123 4.1 Inline markups
124 ------------------
125
126 <dfn>
127 encloses a newly introduced term that is being explained. Use for the first
128 occurrence of the main concept of every manual page, or the first occurrence
129 of a new concept after a sub-heading if necessary. Renders in bold face. Keep
130 in mind that <dfn> tags might be used to generate an index of keywords--don't
131 pollute it too much.
132
133 <abbr>
134 is used to explain an abbreviation such as <abbr title="Linux Audio Developers
135 Simple Plugin API">LADSPA</abbr>. Browsers will usually pop up the definition
136 when the user hovers over the word. Renders as dotted underlined in most
137 browsers. On each page, use only for the first occurrence of every
138 abbreviation. Avoid a redundant explanation in the text--the expansion can
139 easily be extracted via CSS for printing. Use only in the text body, not in
140 headings.
141
142 <em>
143 is used to emphasize a word. Commonly rendered as italics. Use only if its a
144 truly ad-hoc, one-off situation. For anything else, consider adding a new
145 semantic markup with <span class="foo">.
146
147 <strong>
148 is used to strongly emphasize a word. Commonly rendered in bold. See above for
149 usage.
150
151 <br>
152 Most of the time, these should be avoided, and used very infrequently. A line-
153 break can sometimes be used to structure a paragraph, or to split a longish
154 heading. Never use spurious <br>s at the end of paragraphs or to control the
155 spacing of sections. If you're unhappy with those, fix the CSS (which fixes the
156 entire manual in one go!).
157
158
159 4.2 Lists
160 ---------
161
162 <ul>, <ol>
163 Use the unordered list for information snippets that do not have an implied
164 order. The ordered list should always be used when a sequence of actions is
165 described. Within the lists, each item must be enclosed in <li> tags. Lists
166 cannot be included in <p>aragraphs. Close the paragraph first.
167
168 <dl>
169 Definition lists are for technical terms <dt> and their definition <dd>. Do
170 not abuse them for anything else.
171
172
173 4.3 Quotations
174 --------------
175
176 <blockquote>
177 is used when an entire paragraph is quoted. Must contain a cite="http://
178 mysource.net/foo.pdf" attribute. Do not abuse to indent a paragraph!
179
180 <cite>, <q>
181 For inline citations, the <cite>W3C</cite> recommends to <q cite="http://
182 www.w3.org/TR/xhtml1/dtds.html">use the cite and q elements</q>.
183
184
185 4.4 Keyboard/Controller interaction
186 -----------------------------------
187
188 <kbd>
189 Any keys or key combinations, mouse buttons or controllers, menu items or
190 textual user input should be marked with this element. It is used here in
191 the widest possible sense, qualified by classes. E.g.:
192
193 "Press <kbd>f</kbd> to fit all tracks to the height of the Editor window."
194 "Move <kbd>Fader 1</kbd> on your MIDI controller to bind it."
195
196 Since modifier keys are not cross-platform and Ardour makes a point of 
197 abstracting them, do not hard-code "Alt", "Cmd" and friends, use 
198
199         class="modN" 
200
201 instead.
202
203 So if you want the user to press Ctrl-N on Linux, that's actually <kbd
204 class="mod1">N</kbd>. It will render as "Ctrl N" for you, and as "Cmd N" for
205 your Mac-using friend. Nice, huh?
206
207 Multiple modifier keys are supported as "modNM" as well, so for Ctrl-Shift-N on Linux, you would use "mod13".
208
209 N.B.: If you want to have just the name of the modifier key by itself, use the
210       modN name followed by a lower case "n", like so: <kbd class="mod1n></kbd>
211
212 For anything you want the user to type, use <kbd> as a block-level element.
213 See above for other <kbd> classes to denote menu items, selections, mouse
214 events and controller actions.
215
216 Keys and mouse key names should always be entered lowercase, even though the
217 stylesheet might capitalize them.
218
219 CSS Classes used with <kbd> are:
220
221 .modN, .modNM, .modNn, .modNMn
222 .mouse: mouse buttons
223 .cmd: a command line
224 .lin, .win, .mac: add nice prompts to that command line
225 .input: inline text to be entered by the user
226 .menu: path to an Ardour menu or other GUI item
227 .option: path to an option, with (X) at the end.
228 .optoff: path to an option, with ( ) at the end.
229 .button, .fader, .knob: external controllers (OSC or MIDI).
230
231 <code>
232 is only used for program code, or the content of configuration files etc. Do
233 not abuse to style keys or user input, use <kbd> instead.
234
235 <samp>
236 is only used for the textual output of any code, never for anything the user
237 types or presses.
238
239
240 4.5 Images
241 ----------
242
243 <img>
244 The image tag must contain a 'src="/images/yourimage.png"' element and a
245 descriptive 'alt="A short textual description of the image content"' element.
246 Images are usually placed as block-level elements, i.e. outside of a paragraph,
247 unless they are no higher than one row and make sense in the text flow.
248
249 Images should also be wrapped (unless they are embedded inside a paragraph) in
250 a <figure></figure> block, and should contain a <figcaption></figcaption> block
251 inside as well to describe to the reader what the image is.
252
253
254 5. Other conventions
255 ====================
256
257
258 5.1 Typography
259 --------------
260
261 * Avoid any typographical quotation marks to highlight terms or express any
262   kind of subtle inflection, use semantic markup instead.
263 * The hyphen is used to for compound words such as this well-advised example.
264 * Do not hyphenate words at line breaks.
265 * For breaks in thought&mdash;such as this splendid example&mdash;use the long
266   em-dash. Note that the em-dash is snugged up against the text on both
267   sides--this is the proper way to use them.
268 * For ranges of values, use the en-dash: Monday&ndash;Friday, 0&ndash;11. Note
269   again, the en-dash is snugged up to its surrounding elements.
270 * Use a non-breaking space ("&nbsp;") between a number and its unit.
271 * Colons (":") always snug up to their text on the left: it is an error to add
272   space between text on the left and the colon.
273
274
275 5.2 Language
276 ------------
277
278 * The Ardour manual is written in American English spelling.
279 * Use SI units with standard abbreviations. Give imperial units only as
280   additional information, if at all.
281 * Do not use contractions like "it'll", always write full forms.
282 * Do not over-use "You"; write about the program, not the user. Avoid it if at 
283   all possible, it makes for tighter and better reading text.
284 * Always write out numbers less than 11. E.g., "One or two ..." instead of
285   "1 or 2 ...".
286
287
288 5.3 Chapter Headline Capitalization
289 ------------------------------------
290
291 Capitalization follows
292 https://developer.gnome.org/hig-book/3.6/design-text-labels.html.en#layout-capitalization:
293
294 * Capitalize all words in the headline, with the following exceptions:
295     Articles: a, an, the.
296     Conjunctions: and, but, for, not, so, yet ...
297     Prepositions of three or fewer letters: at, for, by, in, to ...
298 * Keep headlines short and concise.
299 * secondary headlines in articles are not capitalized
300 * Do not capitalize concepts in the text body, with the possible exceptions
301   of _the_ Editor and _the_ Mixer.
302
303
304 5.4 Janitorial tasks/review
305 ---------------------------
306
307 If you encounter something that is unclear or patent nonsense, but you are not
308 bold or knowledgeable to fix it, express your doubts with an <p
309 class="fixme">editorial note</p>, so that readers will be warned and fellow
310 editors know where there's work to do.
311
312
313 5.5 Writing style suggestions
314 -----------------------------
315
316 * "Click OK" and similar explanations of the utterly obvious should be
317   avoided. Keep the writing concise and to the point. Explain as much as
318   possible, with as few words as possible.
319 * Do not fear repetitions, this is not artistic prose. Repeat important 
320   keywords, rather than burden the user with synonyms made up on the spot.
321 * Do not create headings for different ways of doing the same thing (<h>Via
322   the context menu</h>,...<h>Via hotkeys</h>). Headings separate new
323   concepts. To not add gratuitous sub-headings if there is very little
324   content per heading and you do not expect the article to grow.
325 * If pages grow long, consider splitting them into sub-chapters at their
326   headings.
327 * Nobody needs "the next paragraph is about the following" paragraphs.
328 * When creating a <p class="note">NOTE</p>, *do not* put the word NOTE into
329   the note, the styling tells the user that it is a note.
330
331
332 5.6. Encoding
333 -------------
334
335 * Pages should be encoded in UTF-8, with Unix-style newlines if possible
336   (although that's not critical). Avoid using verbatim special symbols, use
337   HTML character entities instead, for example for cursor arrows: &rarr;
338   &larr; &uarr; &darr;. Diacriticals on vowels and other special letters are
339   probably ok by now, so don't bother with &eacute; and friends, just type é.
340