1 @c -*- coding: us-ascii; mode: texinfo; -*-
2 @node Documentation work
3 @chapter Documentation work
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::
15 @node Introduction to documentation work
16 @section Introduction to documentation work
18 Our documentation tries to adhere to our @ref{Documentation
19 policy}. This policy contains a few items which may seem odd.
20 One policy in particular is often questioned by potential
21 contributors: we do not repeat material in the Notation Reference,
22 and instead provide links to the @qq{definitive} presentation of
23 that information. Some people point out, with good reason, that
24 this makes the documentation harder to read. If we repeated
25 certain information in relevant places, readers would be less
26 likely to miss that information.
28 That reasoning is sound, but we have two counter-arguments.
29 First, the Notation Reference -- one of @emph{five} manuals for
30 users to read -- is already over 500 pages long. If we repeated
31 material, we could easily exceed 1000 pages! Second, and much
32 more importantly, LilyPond is an evolving project. New features
33 are added, bugs are fixed, and bugs are discovered and documented.
34 If features are discussed in multiple places, the documentation
35 team must find every instance. Since the manual is so large, it
36 is impossible for one person to have the location of every piece
37 of information memorized, so any attempt to update the
38 documentation will invariably omit a few places. This second
39 concern is not at all theoretical; the documentation used to be
40 plagued with inconsistent information.
42 If the documentation were targeted for a specific version -- say,
43 LilyPond 2.10.5 -- and we had unlimited resources to spend on
44 documentation, then we could avoid this second problem. But since
45 LilyPond evolves (and that is a very good thing!), and since we
46 have quite limited resources, this policy remains in place.
48 A few other policies (such as not permitting the use of tweaks in
49 the main portion of NR 1+2) may also seem counter-intuitive, but
50 they also stem from attempting to find the most effective use of
51 limited documentation help.
55 @node Texinfo crash course
56 @section Texinfo crash course
58 The language is called texinfo; you can see its manual here:
59 @uref{http://www.gnu.org/software/texinfo/manual/texinfo/}
61 However, you don't need to read those docs. The most important
62 thing to notice is that text is text. If you see a mistake in the
63 text, you can fix it. If you want to change the order of
64 something, you can cut-and-paste that stuff into a new location.
66 @warning{Rule of thumb: follow the examples in the existing docs.
67 You can learn most of what you need to know from this; if you want
68 to do anything fancy, discuss it on @code{lilypond-devel} first.}
71 @subsection Sectioning commands
73 Most of the manual operates at the
81 level. Sections are created with
89 @item Please leave two blank lines above a @@node; this makes it
90 easier to find sections in texinfo.
92 @item Sectioning commands (@@node and @@section) must not appear
93 inside an @@ignore. Separate those commands with a space, ie @@n
100 @subsection LilyPond formatting
104 @item Use two spaces for indentation in lilypond examples. (no
107 @item All text strings should be prefaced with #. LilyPond does
108 not strictly require this, but it is helpful to get users
109 accustomed to this scheme construct. ie @code{\set
110 Staff.instrumentName = #"cello"}
112 @item All engravers should have double-quotes around them:
115 \consists "Spans_arpeggio_engraver"
118 Again, LilyPond does not strictly require this, but it is a useful
121 @item Examples should end with a complete bar if possible.
123 @item If possible, only write one bar per line. The notes on each
124 line should be an independent line -- tweaks should occur on their
125 own line if possible. Bad:
128 \override textscript #'padding = #3 c1^"hi"
134 \override textscript #'padding = #3
138 @item Most LilyPond input should be produced with:
141 @@lilypond[verbatim,quote,relative=2]
148 @@lilypond[verbatim,quote,relative=1]
151 If you want to use \layout@{@} or define variables, use
154 @@lilypond[verbatim,quote]
157 In rare cases, other options may be used (or omitted), but ask first.
160 Inspirational headwords are produced with
163 @@lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
164 @{pitches-headword.ly@}
167 @item LSR snippets are linked with
170 @@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
175 excepted in Templates, where `doctitle' may be omitted.
177 @item Avoid long stretches of input code. Noone is going to read
178 them in print. Please create a smaller example. (the smaller
179 example does not need to be minimal, however)
181 @item Specify durations for at least the first note of every bar.
183 @item If possible, end with a complete bar.
185 @item Comments should go on their own line, and be placed before
186 the line(s) to which they refer.
188 @item Add extra spaces around @{ @} marks; ie
191 not: \chordmode @{c e g@}
192 but instead: \chordmode @{ c e g @}
195 @item If you only have one bar per line, omit bar checks. If you
196 put more than one bar per line (not recommended), then include bar
199 @item If you want to work on an example outside of the manual (for
200 easier/faster processing), use this header:
204 #(define dump-extents #t)
206 line-width = 160\mm - 2.0 * 0.4\in
208 force-assignment = #""
209 line-width = #(- line-width (* mm 3.000000))
216 You may not change any of these values. If you are making an
217 example demonstrating special \paper@{@} values, contact the
218 Documentation Editor.
223 @subsection Text formatting
228 * Lines should be less than 72 characters long. (I personally
229 recommend writing with 66-char lines, but don't bother modifying
236 * Do not use spaces at the beginning of a line (except in @@example
237 or @@verbatim environments), and do not use more than a single
238 space between words. `makeinfo' copies the input lines verbatim
239 without removing those spaces.
242 * Use two spaces after a period.
245 * In examples of syntax, use @@var@{musicexpr@} for a music
249 * Don't use @@rinternals@{@} in the main text. If you're tempted to
250 do so, you're probably getting too close to "talking through the
251 code". If you really want to refer to a context, use @@code@{@} in
252 the main text and @@rinternals@{@} in the @@seealso.
255 * Variables or numbers which consist of a single character
256 (probably followed by a punctuation mark) should be tied
257 properly, either to the previous or the next word. Example:
259 The variable@@tie@{@}@@var@{a@} ...
262 * To get consistent indentation in the DVI output it is better to
263 avoid the @@verbatim environment. Use the @@example environment
264 instead if possible, but without extraneous indentation. For
273 should be replaced with
281 where `@@example' starts the line (without leading spaces).
284 * Do not compress the input vertically; this is, do not use
286 Beginning of logical unit
290 continuation of logical unit
294 Beginning of logical unit
301 continuation of logical unit
303 This makes it easier to avoid forgetting the `@@noindent'. Only
304 use @@noindent if the material is discussing the same material;
305 new material should simply begin without anything special on the
309 * in @@itemize use @@item on a separate line like this:
317 Do not use @@itemize @@bullet.
320 * To get LilyPond version, use @@version@{@} (this does not work inside
321 LilyPond snippets). If you write "@@version@{@}" (enclosed with
322 quotes), or generally if @@version@{@} is not followed by a space,
329 @@w@{"@@version@{@}"@}
331 to prevent an ugly line break in PDF output.
335 @subsection Syntax survey
339 @@c - single line comments
340 "@@c NOTE:" is a comment which should remain in the final
341 version. (gp only command ;)
343 @@ignore ... @@end ignore - multi-line comment
346 @@cindex - General index. Please add as many as you can. Don't
347 capitalize the first word.
349 @@funindex - is for a \lilycommand.
352 @@example ... @@end ignore - example text that should be set as a
353 blockquote. Any @{@} must be escaped with @@@{ @}@@
355 @@itemize @@item A @@item B ... @@end itemize - for bulleted lists.
356 Do not compress vertically like this.
359 @@code@{@} - typeset in a tt-font. Use for actual lilypond code or
360 property/context names. If the name contains a space, wrap
361 the entire thing inside @@w@{@@code@{ @}@}.
363 @@notation@{@} - refers to pieces of notation, e.g.
364 "@@notation@{cres.@}". Also use to specific lyrics ("the
365 @@notation@{A - men@} is centered"). Only use once per subsection
368 @@q@{@} - Single quotes. Used for `vague' terms.
370 @@qq@{@} - Double quotes. Used for actual quotes ("he said") or for
371 introducing special input modes.
374 @@tie@{@} - Variables or numbers which consist of a single character
375 (probably followed by a punctuation mark) should be tied
376 properly, either to the previous or the next word. Example:
377 "The letter@@tie@{@}@@q@{I@} is skipped"
380 @@var - Use for variables.
382 @@warning@{@} - produces a "Note: " box. Use for important messages.
385 @@bs - Generates a backslash inside @@warning.
386 Any `\' used inside @@warning (and @@q or @@qq) must be written as `@@bs@{@}'
387 (texinfo would also allow \\, but this breaks with PDF output).
393 @subsection Other text concerns
398 * References must occur at the end of a sentence, for more
399 information see @@ref@{the texinfo manual@}. Ideally this should
400 also be the final sentence of a paragraph, but this is not
401 required. Any link in a doc section must be duplicated in the
402 @@seealso section at the bottom.
405 * Introducing examples must be done with
406 . (ie finish the previous sentence/paragaph)
407 : (ie `in this example:')
408 , (ie `may add foo with the blah construct,')
409 The old "sentence runs directly into the example" method is not
413 * Abbrevs in caps, e.g., HTML, DVI, MIDI, etc.
418 1. To introduce lists
419 2. When beginning a quote: "So, he said,..."
420 This usage is rarer. Americans often just use a comma.
421 3. When adding a defining example at the end of a sentence.
424 * Non-ASCII characters which are in utf-8 should be directly used;
425 this is, don't say `Ba@@ss@{@}tuba' but `Baßtuba'. This ensures that
426 all such characters appear in all output formats.
433 @node Documentation policy
434 @section Documentation policy
439 There are four parts to the documentation: the Learning Manual,
440 the Notation Reference, the Program Reference, and the Music
447 The LM is written in a tutorial style which introduces the most
448 important concepts, structure and syntax of the elements of a
449 LilyPond score in a carefully graded sequence of steps.
450 Explanations of all musical concepts used in the Manual can be
451 found in the Music Glossary, and readers are assumed to have no
452 prior knowledge of LilyPond. The objective is to take readers to
453 a level where the Notation Reference can be understood and
454 employed to both adapt the templates in the Appendix to their
455 needs and to begin to construct their own scores. Commonly used
456 tweaks are introduced and explained. Examples are provided
457 throughout which, while being focussed on the topic being
458 introduced, are long enough to seem real in order to retain the
459 readers' interest. Each example builds on the previous material,
460 and comments are used liberally. Every new aspect is thoroughly
461 explained before it is used.
463 Users are encouraged to read the complete Learning Manual from
468 * Notation Reference: a (hopefully complete) description of
469 LilyPond input notation. Some material from here may be
470 duplicated in the Learning Manual (for teaching), but consider
471 the NR to be the "definitive" description of each notation
472 element, with the LM being an "extra". The goal is _not_ to
473 provide a step-by-step learning environment -- do not avoid
474 using notation that has not be introduced previously in the
475 NR (for example, use \break if appropriate). This section is
476 written in formal technical writing style.
478 Avoid duplication. Although users are not expected to read this
479 manual from start to finish, they should be familiar with the
480 material in the Learning Manual (particularly ``Fundamental
481 Concepts''), so do not repeat that material in each section of
482 this book. Also watch out for common constructs, like ^ - _ for
483 directions -- those are explained in NR 3. In NR 1, you can
485 DYNAMICS may be manually placed above or below the
486 staff, see @@ref@{Controlling direction and placement@}.
488 Most tweaks should be added to LSR and not placed directly in the
489 .itely file. In some cases, tweaks may be placed in the main
490 text, but ask about this first.
492 Finally, you should assume that users know what the notation
493 means; explaining musical concepts happens in the Music Glossary.
497 * Application Usage: information about using the program lilypond
498 with other programs (lilypond-book, operating systems, GUIs,
499 convert-ly, etc). This section is written in formal technical
502 Users are not expected to read this manual from start to finish.
506 * Music Glossary: information about the music notation itself.
507 Explanations and translations about notation terms go here.
509 Users are not expected to read this manual from start to finish.
512 * Internals Reference: not really a documentation book, since it
513 is automagically generated from the source, but this is its
519 @subsection Section organization
523 @item The order of headings inside documentation sections should
536 * You _must_ include a @@seealso. The order of items inside the
545 @@rlearning@{foozle@}.
555 @@file@{path/to/dir/blahz@}.
557 Snippets: @@rlsr@{section@}.
560 @@rinternals@{fazzle@},
561 @@rinternals@{booar@}.
563 If there are multiple entries, separate them by commas
564 but do not include an `and'.
566 Always end with a period.
568 Place each link on a new line as above; this makes it much
569 easier to add or remove links. In the output, they
570 appear on a single line.
572 ("Snippets" is REQUIRED; the others are optional)
574 Any new concepts or links which require an explanation should go
575 as a full sentence(s) in the main text.
577 Don't insert an empty line between @@seealso and the first entry!
578 Otherwise there is excessive vertical space in the PDF output.
581 * To create links, use @@ref@{@} if the link is within the same
585 * @@predefined ... @@endpredefined is for commands in ly/*-init.ly
589 * Do not include any real info in second-level sections (ie 1.1
590 Pitches). A first-level section may have introductory material,
591 but other than that all material goes into third-level sections
592 (ie 1.1.1 Writing Pitches).
597 @subsection Checking cross-references
599 Cross-references between different manuals are heavily used in the
600 documentation, but they are not checked during compilation. However,
601 if you compile the documentation, a script called check_texi_refs can
602 help you with checking and fixing these cross-references; for
603 information on usage, cd into a source tree where documentation has
604 been built, cd into Documentation and look for check-xrefs and
605 fix-xrefs targets in 'make help' output. Note that you have to find
606 yourself the source files to fix cross-references in the generated
607 documentation such as the Internals Reference; e.g. you can grep
611 @subsection General writing
616 * Do not forget to create @@cindex entries for new sections of text.
617 Enter commands with @@funindex, i.e.
618 @@cindex pitches, writing in different octaves
620 do not bother with the @@code@{@} (they are added automatically). These
621 items are added to both the command index and the unified index.
623 Both index commands should go in front of the actual material.
625 @@cindex entries should not be capitalized, ie
626 @@cindex time signature
627 is preferred. (instead of `Time signature') Only use capital
628 letters for musical terms which demand them, like D.S. al Fine.
630 For scheme functions, only include the final part, ie
631 @@funindex modern-voice-cautionary
633 @@funindex #(set-accidental-style modern-voice-cautionary)
637 - in general, use the American spellings. The internal
638 lilypond property names use this spelling.
639 - list of specific terms:
641 simultaenous NOT concurrent
642 measure: the unit of music
643 bar line: the symbol delimiting a measure NOT barline
644 note head NOT notehead
645 chord construct NOT chord (when referring to <>)
650 @subsection Technical writing style
655 * Do not refer to LilyPond in the text. The reader knows what the
656 manual is about. If you do, capitalization is LilyPond.
659 * If you explicitly refer to `lilypond' the program (or any other
660 command to be executed), say `@@command@{lilypond@}'.
663 * Do not explicitly refer to the reader/user. There is no one
664 else besides the reader and the writer.
667 * Do not use abbreviations (don't, won't, etc.). If you do, use a
670 blabla blabla, i.e., blabla blabla
673 * Avoid fluff (``Notice that,'' ``as you can see,''
677 * The use of the word `illegal' is inappropriate in most cases.
678 Say `invalid' instead.
683 @node Tips for writing docs
684 @section Tips for writing docs
686 In the NR, I highly recommend working on one subsection at a time.
689 - check the mundane formatting. Are the headings (@@predefined,
690 @@seealso, etc) in the right order?
691 - add any appropriate index entries.
692 - check the links in the @@seealso section -- links to music
693 glossary, internal references, and other NR sections are the
694 main concern. Check for potential additions.
695 - move LSR-worthy material into LSR. Add the snippet (or
696 just send it to Valentin for adding), delete the material from
697 the .itely file, and add a @@lilypondfile command.
699 - check the examples and descriptions. Do they still work?
700 *Do not* assume that the existing text is accurate/complete;
701 some of the manual is highly out of date.
702 - is the material in the @@knownissues still accurate?
703 - process anything on the TODO list on the GDP web site.
704 - can the examples be improved (made more explanatory), or is
705 there any missing info? (feel free to ask specific questions
706 on -user; a couple of people claimed to be interesting in being
707 "consultants" who would help with such questions)
709 In general, I favor short text explanations with good examples --
710 "an example is worth a thousand words". When I worked on the
711 docs, I spent about half my time just working on those tiny
712 lilypond examples. Making easily-understandable examples is much
713 harder than it looks.
718 In general, any \set or \override commands should go in the
719 "select snippets" section, which means that they should go in LSR
720 and not the .itely file. For some cases, the command obviously
721 belongs in the "main text" (ie not inside @@predefined or @@seealso
722 or whatever) -- instrument names are a good example of this.
723 \set Staff.instrumentName = #"foo"
724 On the other side of this,
725 \override Score.Hairpin #'after-line-breaking = ##t
726 clearly belongs in LSR.
728 I'm quite willing to discuss specific cases if you think that a
729 tweaks needs to be in the main text. But items that can go into
730 LSR are easier to maintain, so I'd like to move as much as
734 It would be "nice" if you spent a lot of time crafting nice tweaks
735 for users... but my recommendation is *not* to do this. There's a
736 lot of doc work to do without adding examples of tweaks. Tweak
737 examples are trivial to add later -- they could be made by normal
738 users, or by you after GDP is over.
740 Basically, it's not something that needs to be done while I'm
741 around. Remember that I'm gone in August at the latest; there's a
742 *lot* of doc work that should be done before then. I strongly
743 recommend that you save all the tweaks until later.
748 - when you think you're finished, let me know. I'll spend a few
749 minutes and send you a list of mistakes to fix.
750 (there's a *lot* of details to cover; we'll probably spend a
751 week going back and forth like this. See earlier warning about
752 hating me by the time you're done with a doc section :)
753 - I'll ask people on -user to review the Snippet list at this
754 time; correcting things on the Snippet list is much easier than
755 getting comments on the integrated snippets.
756 - when we're both satisfied with the section, we'll invite
757 comments from -user. Judging from my experience with Pitches,
758 it will take between three and five weeks to keep on revising
761 I personally found it quite frustrating to still be fixing
762 problems in a doc section which I thought was "perfect" a whole
763 bloody *month* ago. Don't get me wrong; it's great that we get so
764 many comments from -user. :) But just be aware that when you
765 think you're finally done with a section, you're actually only
774 @node Updating docs with convert-ly
775 @section Updating doc with convert-ly
777 cd into Documentation and run
780 find . -name '*.itely' | xargs convert-ly -e
784 (This also updates translated docs.)
789 @node Translating the documentation
790 @section Translating the documentation