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