]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/devel/doc-work.itexi
Doc-fr: unfretted strings update
[lilypond.git] / Documentation / devel / doc-work.itexi
1 @c -*- coding: us-ascii; mode: texinfo; -*-
2 @node Documentation work
3 @chapter Documentation work
4
5 @menu
6 * Introduction to documentation work::  
7 * Texinfo crash course::        
8 * Documentation policy::        
9 * Tips for writing docs::       
10 * Updating docs with convert-ly::  
11 * Translating the documentation::  
12 @end menu
13
14
15 @node Introduction to documentation work
16 @section Introduction to documentation work
17
18 Our documentation tries to adhere to the @ref{Documentation
19 policy} as strictly as possible.  One policy in particular is
20 often questioned by potential contributors: we do not repeat
21 material in the Notation Reference, and instead provide links to
22 the @qq{definitive} presentation of that information.
23
24 Some people point out, with good reason, that this makes the
25 documentation harder to read.  If we repeated certain information
26 in relevant places, readers would be less likely to miss that
27 information.
28
29 That reasoning is sound, but we have two counter-arguments.
30 First, the Notation Reference -- one of @emph{five} manuals for
31 users to read -- is already over 500 pages long.  If we repeated
32 material, we could easily exceed 1000 pages!  Second, and much
33 more importantly, LilyPond is an evolving project.  New features
34 are added, bugs are fixed, and bugs are discovered and documented.
35 If features are discussed in multiple places, the documentation
36 team must find every instance.  Since the manual is so large, it
37 is impossible for one person to have the location of every piece
38 of information memorized, so any attempt to update the
39 documentation will invariably omit a few places.  This second
40 concern is not at all theoretical; the documentation used to be
41 plagued with inconsistent information.
42
43 If the documentation were targeted for a specific version -- say,
44 LilyPond 2.10.5 -- and we had unlimited resources to spend on
45 documentation, then we could avoid this second problem.  But since
46 LilyPond evolves (and that is a very good thing!), and since we
47 have quite limited resources, this policy remains in place.
48
49 A few other policies (such as not permitting the use of tweaks in
50 the main portion of NR 1+2) may also seem counter-intuitive, but
51 they also stem from attempting to find the most effective use of
52 limited documentation help.
53
54
55
56 @node Texinfo crash course
57 @section Texinfo crash course
58
59 The language is called texinfo; you can see its manual here:
60 @uref{http://www.gnu.org/software/texinfo/manual/texinfo/}
61
62 However, you don't need to read those docs.  The most important
63 thing to notice is that text is text.  If you see a mistake in the
64 text, you can fix it.  If you want to change the order of
65 something, you can cut-and-paste that stuff into a new location.
66
67 @warning{Rule of thumb: follow the examples in the existing docs.
68 You can learn most of what you need to know from this; if you want
69 to do anything fancy, discuss it on @code{lilypond-devel} first.}
70
71
72 @subsection Sectioning commands
73
74 Most of the manual operates at the
75         @@node Foo
76         @@subsubsection Foo
77 level.  Sections are created with
78         @@node Foo
79         @@subsection Foo
80 commands.
81
82 * Please leave two blank lines above a @@node; this makes it easier
83   to findw sections in texinfo.
84
85 * sectioning commands (@@node and @@section) must not appear inside
86   an @@ignore.  Separate those commands with a space, ie @@n ode.
87
88
89
90 @subsection LilyPond formatting
91
92 * Use two spaces for indentation in lilypond examples.  (no tabs)
93
94 * All text strings should be prefaced with #.  LilyPond does not
95   strictly require this, but it is helpful to get users accustomed
96   to this scheme construct.  ie
97     \set Staff.instrumentName = #"cello"
98
99 * All engravers should have double-quotes around them:
100     \consists "Spans_arpeggio_engraver"
101   Again, LilyPond does not strictly require this, but it is a
102   useful standard to follow.
103
104 * Examples should end with a complete bar if possible.
105
106 * If possible, only write one bar per line.  The notes on each
107   line should be an independent line -- tweaks should occur on
108   their own line if possible.
109   Bad:
110     \override textscript #'padding = #3 c1^"hi"
111   Good:
112     \override textscript #'padding = #3
113     c1^"hi"
114
115 * Most LilyPond input should be produced with:
116     @@lilypond[verbatim,quote,relative=2]
117   or
118     @@lilypond[verbatim,quote,relative=1]
119
120   If you want to use \layout@{@} or define variables, use
121     @@lilypond[verbatim,quote]
122
123   In rare cases, other options may be used (or omitted), but ask first.
124
125 * Inspirational headwords are produced with
126   @@lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
127   @{pitches-headword.ly@}
128
129 * LSR snippets are linked with
130   @@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
131   @{filename.ly@}
132   excepted in Templates, where `doctitle' may be omitted.
133
134 * Avoid long stretches of input code.  Noone is going to read them
135   in print.  Please create a smaller example.  (the smaller
136   example does not need to be minimal, however)
137
138 * Specify durations for at least the first note of every bar.
139
140 * If possible, end with a complete bar.
141
142 * Comments should go on their own line, and be placed before the
143   line(s) to which they refer.
144
145 * Add extra spaces around @{ @} marks; ie
146   not:          \chordmode @{c e g@}
147   but instead:  \chordmode @{ c e g @}
148
149 * If you only have one bar per line, omit bar checks.  If you
150   put more than one bar per line (not recommended), then include
151   bar checks.
152
153 * If you want to work on an example outside of the manual (for
154   easier/faster processing), use this header:
155
156 \paper @{
157   #(define dump-extents #t)
158   indent = 0\mm
159   line-width = 160\mm - 2.0 * 0.4\in
160   ragged-right = ##t
161   force-assignment = #""
162   line-width = #(- line-width (* mm  3.000000))
163 @}
164
165 \layout @{
166 @}
167
168   You may not change any of these values.  If you are making an
169   example demonstrating special \paper@{@} values, contact the
170   Documentation Editor.
171
172
173 @subsection Text formatting
174
175 * Lines should be less than 72 characters long.  (I personally
176   recommend writing with 66-char lines, but don't bother modifying
177   existing material.)
178
179 * Do not use tabs.
180
181 * Do not use spaces at the beginning of a line (except in @@example
182   or @@verbatim environments), and do not use more than a single
183   space between words.  `makeinfo' copies the input lines verbatim
184   without removing those spaces.
185
186 * Use two spaces after a period.
187
188 * In examples of syntax, use @@var@{musicexpr@} for a music
189   expression.
190
191 * Don't use @@rinternals@{@} in the main text.  If you're tempted to
192   do so, you're probably getting too close to "talking through the
193   code".  If you really want to refer to a context, use @@code@{@} in
194   the main text and @@rinternals@{@} in the @@seealso.
195
196 * Variables or numbers which consist of a single character
197   (probably followed by a punctuation mark) should be tied
198   properly, either to the previous or the next word.  Example:
199
200       The variable@@tie@{@}@@var@{a@} ...
201
202 * To get consistent indentation in the DVI output it is better to
203   avoid the @@verbatim environment.  Use the @@example environment
204   instead if possible, but without extraneous indentation.  For
205   example, this
206
207     @@example
208       foo @{
209         bar
210       @}
211     @@end example
212
213   should be replaced with
214
215     @@example
216     foo @{
217       bar
218     @}
219     @@end example
220
221   where `@@example' starts the line (without leading spaces).
222
223 * Do not compress the input vertically; this is, do not use
224
225     Beginning of logical unit
226     @@example
227     ...
228     @@end example
229     continuation of logical unit
230
231   but
232
233     Beginning of logical unit
234
235     @@example
236     ...
237     @@end example
238
239     @@noindent
240     continuation of logical unit
241
242   This makes it easier to avoid forgetting the `@@noindent'.  Only
243   use @@noindent if the material is discussing the same material;
244   new material should simply begin without anything special on the
245   line above it.
246
247 * in @@itemize use @@item on a separate line like this:
248   @@itemize
249   @@item
250   Foo
251
252   @@item
253   Bar
254
255   Do not use @@itemize @@bullet.
256
257 * To get LilyPond version, use @@version@{@} (this does not work inside
258   LilyPond snippets).  If you write "@@version@{@}" (enclosed with
259   quotes), or generally if @@version@{@} is not followed by a space,
260   enclose it with
261
262   @@w@{ ... @}
263
264   e.g.
265
266   @@w@{"@@version@{@}"@}
267
268   to prevent an ugly line break in PDF output.
269
270
271 @subsection Syntax survey
272
273 @@c - single line comments
274   "@@c NOTE:" is a comment which should remain in the final
275   version.  (gp only command ;)
276 @@ignore ... @@end ignore - multi-line comment
277
278 @@cindex - General index. Please add as many as you can.  Don't
279   capitalize the first word.
280 @@funindex - is for a \lilycommand.
281
282 @@example ... @@end ignore - example text that should be set as a
283   blockquote.  Any @{@} must be escaped with @@@{ @}@@
284 @@itemize @@item A @@item B ... @@end itemize - for bulleted lists.
285   Do not compress vertically like this.
286
287 @@code@{@} - typeset in a tt-font. Use for actual lilypond code or
288   property/context names.  If the name contains a space, wrap
289   the entire thing inside @@w@{@@code@{  @}@}.
290 @@notation@{@} - refers to pieces of notation, e.g.
291   "@@notation@{cres.@}".  Also use to specific lyrics ("the
292   @@notation@{A - men@} is centered").  Only use once per subsection
293   per term.
294 @@q@{@} - Single quotes. Used for `vague' terms.
295 @@qq@{@} - Double quotes.  Used for actual quotes ("he said") or for
296   introducing special input modes.
297
298 @@tie@{@} - Variables or numbers which consist of a single character
299   (probably followed by a punctuation mark) should be tied
300   properly, either to the previous or the next word.  Example:
301     "The letter@@tie@{@}@@q@{I@} is skipped"
302
303 @@var - Use for variables.
304 @@warning@{@} - produces a "Note: " box. Use for important messages.
305
306 @@bs - Generates a backslash inside @@warning.
307     Any `\' used inside @@warning (and @@q or @@qq) must be written as `@@bs@{@}' 
308     (texinfo would also allow \\, but this breaks with PDF output).
309
310
311
312 @subsection Other text concerns
313
314 * References must occur at the end of a sentence, for more
315   information see @@ref@{the texinfo manual@}.  Ideally this should
316   also be the final sentence of a paragraph, but this is not
317   required.  Any link in a doc section must be duplicated in the
318   @@seealso section at the bottom.
319
320 * Introducing examples must be done with
321      . (ie finish the previous sentence/paragaph)
322      : (ie `in this example:')
323      , (ie `may add foo with the blah construct,')
324   The old "sentence runs directly into the example" method is not
325   allowed any more.
326
327 * Abbrevs in caps, e.g., HTML, DVI, MIDI, etc.
328
329 * Colon usage
330
331   1. To introduce lists
332   2. When beginning a quote: "So, he said,..."
333      This usage is rarer.  Americans often just use a comma.
334   3. When adding a defining example at the end of a sentence.
335
336 * Non-ASCII characters which are in utf-8 should be directly used;
337   this is, don't say `Ba@@ss@{@}tuba' but `Baßtuba'.  This ensures that
338   all such characters appear in all output formats.
339
340
341
342
343 @node Documentation policy
344 @section Documentation policy
345
346
347 @subsection Books
348
349 There are four parts to the documentation: the Learning Manual,
350 the Notation Reference, the Program Reference, and the Music
351 Glossary.
352
353 * Learning Manual:
354   The LM is written in a tutorial style which introduces the most
355   important concepts, structure and syntax of the elements of a
356   LilyPond score in a carefully graded sequence of steps.
357   Explanations of all musical concepts used in the Manual can be
358   found in the Music Glossary, and readers are assumed to have no
359   prior knowledge of LilyPond.  The objective is to take readers to
360   a level where the Notation Reference can be understood and
361   employed to both adapt the templates in the Appendix to their
362   needs and to begin to construct their own scores.  Commonly used
363   tweaks are introduced and explained.  Examples are provided
364   throughout which, while being focussed on the topic being
365   introduced, are long enough to seem real in order to retain the
366   readers' interest.  Each example builds on the previous material,
367   and comments are used liberally.  Every new aspect is thoroughly
368   explained before it is used.
369
370 Users are encouraged to read the complete Learning Manual from
371 start-to-finish.
372
373
374 * Notation Reference: a (hopefully complete) description of
375   LilyPond input notation.  Some material from here may be
376   duplicated in the Learning Manual (for teaching), but consider
377   the NR to be the "definitive" description of each notation
378   element, with the LM being an "extra".  The goal is _not_ to
379   provide a step-by-step learning environment -- do not avoid
380   using notation that has not be introduced previously in the
381   NR  (for example, use \break if appropriate).  This section is
382   written in formal technical writing style.
383
384 Avoid duplication.  Although users are not expected to read this
385 manual from start to finish, they should be familiar with the
386 material in the Learning Manual (particularly ``Fundamental
387 Concepts''), so do not repeat that material in each section of
388 this book.  Also watch out for common constructs, like ^ - _ for
389 directions -- those are explained in NR 3.  In NR 1, you can
390 write:
391 DYNAMICS may be manually placed above or below the
392 staff, see @@ref@{Controlling direction and placement@}.
393
394 Most tweaks should be added to LSR and not placed directly in the
395 .itely file.  In some cases, tweaks may be placed in the main
396 text, but ask about this first.
397
398 Finally, you should assume that users know what the notation
399 means; explaining musical concepts happens in the Music Glossary.
400
401
402 * Application Usage: information about using the program lilypond
403   with other programs (lilypond-book, operating systems, GUIs,
404   convert-ly, etc).  This section is written in formal technical
405   writing style.
406
407 Users are not expected to read this manual from start to finish.
408
409
410 * Music Glossary: information about the music notation itself.
411   Explanations and translations about notation terms go here.
412
413 Users are not expected to read this manual from start to finish.
414
415 * Internals Reference: not really a documentation book, since it
416   is automagically generated from the source, but this is its
417   name.
418
419
420 @subsection Section organization
421
422 The order of headings inside documentation sections should be:
423
424 main docs
425 @@predefined
426 @@endpredefined
427 @@snippets
428 @@seealso
429 @@knownissues
430
431 * You _must_ include a @@seealso.  The order of items inside the
432   @@seealso section is
433
434     Music Glossary:
435     @@rglos@{foo@},
436     @@rglos@{bar@}.
437
438     Learning Manual:
439     @@rlearning@{baz@},
440     @@rlearning@{foozle@}.
441
442     Notation Reference:
443     @@ruser@{faazle@},
444     @@ruser@{boo@}.
445
446     Application Usage:
447     @@rprogram@{blah@}.
448
449     Installed Files:
450     @@file@{path/to/dir/blahz@}.
451
452     Snippets: @@rlsr@{section@}.
453
454     Internals Reference:
455     @@rinternals@{fazzle@},
456     @@rinternals@{booar@}.
457
458       If there are multiple entries, separate them by commas
459       but do not include an `and'.
460
461       Always end with a period.
462
463       Place each link on a new line as above; this makes it much
464       easier to add or remove links.  In the output, they
465       appear on a single line.
466
467   ("Snippets" is REQUIRED; the others are optional)
468
469   Any new concepts or links which require an explanation should go
470   as a full sentence(s) in the main text.
471
472   Don't insert an empty line between @@seealso and the first entry!
473   Otherwise there is excessive vertical space in the PDF output.
474
475 * To create links, use @@ref@{@} if the link is within the same
476   manual.
477
478 * @@predefined ... @@endpredefined is for commands in ly/*-init.ly
479   FIXME?
480
481 * Do not include any real info in second-level sections (ie 1.1
482   Pitches).  A first-level section may have introductory material,
483   but other than that all material goes into third-level sections
484   (ie 1.1.1 Writing Pitches).
485
486
487 @subsection Checking cross-references
488
489 Cross-references between different manuals are heavily used in the
490 documentation, but they are not checked during compilation.  However,
491 if you compile the documentation, a script called check_texi_refs can
492 help you with checking and fixing these cross-references; for
493 information on usage, cd into a source tree where documentation has
494 been built, cd into Documentation and look for check-xrefs and
495 fix-xrefs targets in 'make help' output.  Note that you have to find
496 yourself the source files to fix cross-references in the generated
497 documentation such as the Internals Reference; e.g. you can grep
498 scm/ and lily/.
499
500
501 @subsection General writing
502
503 * Do not forget to create @@cindex entries for new sections of text.
504   Enter commands with @@funindex, i.e.
505     @@cindex pitches, writing in different octaves
506     @@funindex \relative
507   do not bother with the @@code@{@} (they are added automatically).  These
508   items are added to both the command index and the unified index.
509
510   Both index commands should go in front of the actual material.
511
512   @@cindex entries should not be capitalized, ie
513     @@cindex time signature
514   is preferred.  (instead of `Time signature')   Only use capital
515   letters for musical terms which demand them, like D.S. al Fine.
516
517   For scheme functions, only include the final part, ie
518     @@funindex modern-voice-cautionary
519   and NOT
520     @@funindex #(set-accidental-style modern-voice-cautionary)
521
522 * Preferred terms:
523     - in general, use the American spellings.  The internal
524       lilypond property names use this spelling.
525     - list of specific terms:
526 canceled
527 simultaenous    NOT concurrent
528 measure: the unit of music
529 bar line: the symbol delimiting a measure   NOT barline
530 note head   NOT notehead
531 chord construct   NOT chord (when referring to <>)
532
533
534 @subsection Technical writing style
535
536 * Do not refer to LilyPond in the text.  The reader knows what the
537   manual is about.  If you do, capitalization is LilyPond.
538
539 * If you explicitly refer to `lilypond' the program (or any other
540   command to be executed), say `@@command@{lilypond@}'.
541
542 * Do not explicitly refer to the reader/user.  There is no one
543   else besides the reader and the writer.
544
545 * Do not use abbreviations (don't, won't, etc.).  If you do, use a
546   comma after it:
547
548     blabla blabla, i.e., blabla blabla
549
550 * Avoid fluff (``Notice that,'' ``as you can see,''
551   ``Currently,'').
552
553 * The use of the word `illegal' is inappropriate in most cases.
554   Say `invalid' instead.
555
556
557 @node Tips for writing docs
558 @section Tips for writing docs
559
560 In the NR, I highly recommend working on one subsection at a time.
561 For each subsection,
562
563 - check the mundane formatting.  Are the headings (@@predefined,
564   @@seealso, etc) in the right order?
565 - add any appropriate index entries.
566 - check the links in the @@seealso section -- links to music
567   glossary, internal references, and other NR sections are the
568   main concern.  Check for potential additions.
569 - move LSR-worthy material into LSR.  Add the snippet (or
570   just send it to Valentin for adding), delete the material from
571   the .itely file, and add a @@lilypondfile command.
572
573 - check the examples and descriptions.  Do they still work?
574   *Do not* assume that the existing text is accurate/complete;
575   some of the manual is highly out of date.
576 - is the material in the @@knownissues  still accurate?
577 - process anything on the TODO list on the GDP web site.
578 - can the examples be improved (made more explanatory), or is
579   there any missing info?  (feel free to ask specific questions
580   on -user; a couple of people claimed to be interesting in being
581   "consultants" who would help with such questions)
582
583 In general, I favor short text explanations with good examples --
584 "an example is worth a thousand words".  When I worked on the
585 docs, I spent about half my time just working on those tiny
586 lilypond examples.  Making easily-understandable examples is much
587 harder than it looks.
588
589
590 TWEAKS
591
592 In general, any \set or \override commands should go in the
593 "select snippets" section, which means that they should go in LSR
594 and not the .itely file.  For some cases, the command obviously
595 belongs in the "main text" (ie not inside @@predefined or @@seealso
596 or whatever) -- instrument names are a good example of this.
597   \set Staff.instrumentName = #"foo"
598 On the other side of this,
599   \override Score.Hairpin #'after-line-breaking = ##t
600 clearly belongs in LSR.
601
602 I'm quite willing to discuss specific cases if you think that a
603 tweaks needs to be in the main text.  But items that can go into
604 LSR are easier to maintain, so I'd like to move as much as
605 possible into there.
606
607
608 It would be "nice" if you spent a lot of time crafting nice tweaks
609 for users... but my recommendation is *not* to do this.  There's a
610 lot of doc work to do without adding examples of tweaks.  Tweak
611 examples are trivial to add later -- they could be made by normal
612 users, or by you after GDP is over.
613
614 Basically, it's not something that needs to be done while I'm
615 around.  Remember that I'm gone in August at the latest; there's a
616 *lot* of doc work that should be done before then.  I strongly
617 recommend that you save all the tweaks until later.
618
619
620 FINAL
621
622 - when you think you're finished, let me know.  I'll spend a few
623   minutes and send you a list of mistakes to fix.
624   (there's a *lot* of details to cover; we'll probably spend a
625   week going back and forth like this.  See earlier warning about
626   hating me by the time you're done with a doc section :)
627 - I'll ask people on -user to review the Snippet list at this
628   time; correcting things on the Snippet list is much easier than
629   getting comments on the integrated snippets.
630 - when we're both satisfied with the section, we'll invite
631   comments from -user.  Judging from my experience with Pitches,
632   it will take between three and five weeks to keep on revising
633   the "final" version.
634
635 I personally found it quite frustrating to still be fixing
636 problems in a doc section which I thought was "perfect" a whole
637 bloody *month* ago.  Don't get me wrong; it's great that we get so
638 many comments from -user.  :)   But just be aware that when you
639 think you're finally done with a section, you're actually only
640 halfway there.
641
642
643
644
645
646
647
648 @node Updating docs with convert-ly
649 @section Updating doc with convert-ly
650
651 cd into Documentation and run
652
653 @example
654 find . -name '*.itely' | xargs convert-ly -e
655 @end example
656
657 @noindent
658 (This also updates translated docs.)
659
660
661
662
663 @node Translating the documentation
664 @section Translating the documentation
665
666