1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @node Documentation work
3 @chapter Documentation work
6 * Introduction to documentation work::
7 * Texinfo introduction and usage policy::
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 introduction and usage policy
56 @section Texinfo introduction and usage policy
59 * Texinfo introduction::
60 * Sectioning commands::
61 * LilyPond formatting::
64 * Other text concerns::
68 @node Texinfo introduction
69 @subsection Texinfo introduction
71 The language is called Texinfo; you can see its manual here:
73 @uref{http://www.gnu.org/software/texinfo/manual/texinfo/}
75 However, you don't need to read those docs. The most important
76 thing to notice is that text is text. If you see a mistake in the
77 text, you can fix it. If you want to change the order of
78 something, you can cut-and-paste that stuff into a new location.
80 @warning{Rule of thumb: follow the examples in the existing docs.
81 You can learn most of what you need to know from this; if you want
82 to do anything fancy, discuss it on @code{lilypond-devel} first.}
85 @node Sectioning commands
86 @subsection Sectioning commands
88 Most of the manual operates at the
96 level. Sections are created with
105 Please leave two blank lines above a @@node; this makes it
106 easier to find sections in texinfo.
109 Sectioning commands (@@node and @@section) must not appear
110 inside an @@ignore. Separate those commands with a space, ie @@n
116 @node LilyPond formatting
117 @subsection LilyPond formatting
122 Use two spaces for indentation in lilypond examples. (no
126 All text strings should be prefaced with #. LilyPond does
127 not strictly require this, but it is helpful to get users
128 accustomed to this scheme construct. ie @code{\set
129 Staff.instrumentName = #"cello"}
132 All engravers should have double-quotes around them:
135 \consists "Spans_arpeggio_engraver"
138 Again, LilyPond does not strictly require this, but it is a useful
142 Examples should end with a complete bar if possible.
145 If possible, only write one bar per line. The notes on each
146 line should be an independent line -- tweaks should occur on their
147 own line if possible. Bad:
150 \override textscript #'padding = #3 c1^"hi"
156 \override textscript #'padding = #3
161 Most LilyPond input should be produced with:
164 @@lilypond[verbatim,quote,relative=2]
171 @@lilypond[verbatim,quote,relative=1]
174 If you want to use \layout@{@} or define variables, use
177 @@lilypond[verbatim,quote]
180 In rare cases, other options may be used (or omitted), but ask first.
183 Inspirational headwords are produced with
186 @@lilypondfile[quote,ragged-right,line-width=16\cm,staffsize=16]
187 @{pitches-headword.ly@}
191 LSR snippets are linked with
194 @@lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
199 excepted in Templates, where `doctitle' may be omitted.
202 Avoid long stretches of input code. Noone is going to read
203 them in print. Please create a smaller example. (the smaller
204 example does not need to be minimal, however)
207 Specify durations for at least the first note of every bar.
210 If possible, end with a complete bar.
213 Comments should go on their own line, and be placed before
214 the line(s) to which they refer.
217 Add extra spaces around @{ @} marks; ie
220 not: \chordmode @{c e g@}
221 but instead: \chordmode @{ c e g @}
225 If you only have one bar per line, omit bar checks. If you
226 put more than one bar per line (not recommended), then include bar
230 If you want to work on an example outside of the manual (for
231 easier/faster processing), use this header:
235 #(define dump-extents #t)
237 line-width = 160\mm - 2.0 * 0.4\in
239 force-assignment = #""
240 line-width = #(- line-width (* mm 3.000000))
247 You may not change any of these values. If you are making an
248 example demonstrating special \paper@{@} values, contact the
249 Documentation Editor.
254 @node Text formatting
255 @subsection Text formatting
260 Lines should be less than 72 characters long. (I personally
261 recommend writing with 66-char lines, but don't bother modifying
268 Do not use spaces at the beginning of a line (except in
269 @@example or @@verbatim environments), and do not use more than a
270 single space between words. `makeinfo' copies the input lines
271 verbatim without removing those spaces.
274 Use two spaces after a period.
277 In examples of syntax, use @@var@{musicexpr@} for a music
281 Don't use @@rinternals@{@} in the main text. If you're
282 tempted to do so, you're probably getting too close to "talking
283 through the code". If you really want to refer to a context, use
284 @@code@{@} in the main text and @@rinternals@{@} in the @@seealso.
287 Variables or numbers which consist of a single character
288 (probably followed by a punctuation mark) should be tied properly,
289 either to the previous or the next word. Example:
292 The variable@@tie@{@}@@var@{a@} ...
296 To get consistent indentation in the DVI output it is better
297 to avoid the @@verbatim environment. Use the @@example
298 environment instead if possible, but without extraneous
299 indentation. For example, this
310 should be replaced with
321 where `@@example' starts the line (without leading spaces).
324 Do not compress the input vertically; this is, do not use
327 Beginning of logical unit
331 continuation of logical unit
338 Beginning of logical unit
345 continuation of logical unit
348 This makes it easier to avoid forgetting the `@@noindent'. Only
349 use @@noindent if the material is discussing the same material;
350 new material should simply begin without anything special on the
354 in @@itemize use @@item
355 on a separate line like this:
366 Do not use @@itemize @@bullet.
369 To get LilyPond version, use @@version@{@} (this does not work
370 inside LilyPond snippets). If you write "@@version@{@}" (enclosed
371 with quotes), or generally if @@version@{@} is not followed by a
372 space, tere will be an ugly line break in PDF output unless you
380 @@w@{"@@version@{@}"@}
387 @subsection Syntax survey
391 @@c - single line comments
392 "@@c NOTE:" is a comment which should remain in the final
393 version. (gp only command ;)
395 @@ignore ... @@end ignore - multi-line comment
398 @@cindex - General index. Please add as many as you can. Don't
399 capitalize the first word.
401 @@funindex - is for a \lilycommand.
404 @@example ... @@end ignore - example text that should be set as a
405 blockquote. Any @{@} must be escaped with @@@{ @}@@
409 B ... @@end itemize - for bulleted lists.
410 Do not compress vertically like this.
413 @@code@{@} - typeset in a tt-font. Use for actual lilypond code or
414 property/context names. If the name contains a space, wrap
415 the entire thing inside @@w@{@@code@{ @}@}.
417 @@notation@{@} - refers to pieces of notation, e.g.
418 "@@notation@{cres.@}". Also use to specific lyrics ("the
419 @@notation@{A - men@} is centered"). Only use once per subsection
422 @@q@{@} - Single quotes. Used for `vague' terms.
424 @@qq@{@} - Double quotes. Used for actual quotes ("he said") or for
425 introducing special input modes.
428 @@tie@{@} - Variables or numbers which consist of a single character
429 (probably followed by a punctuation mark) should be tied
430 properly, either to the previous or the next word. Example:
431 "The letter@@tie@{@}@@q@{I@} is skipped"
434 @@var - Use for variables.
436 @@warning@{@} - produces a "Note: " box. Use for important messages.
439 @@bs - Generates a backslash inside @@warning.
440 Any `\' used inside @@warning (and @@q or @@qq) must be written as `@@bs@{@}'
441 (texinfo would also allow \\, but this breaks with PDF output).
447 @node Other text concerns
448 @subsection Other text concerns
453 References must occur at the end of a sentence, for more
454 information see @@ref@{the texinfo manual@}. Ideally this should
455 also be the final sentence of a paragraph, but this is not
456 required. Any link in a doc section must be duplicated in the
457 @@seealso section at the bottom.
460 Introducing examples must be done with
463 . (ie finish the previous sentence/paragaph)
464 : (ie `in this example:')
465 , (ie `may add foo with the blah construct,')
468 The old "sentence runs directly into the example" method is not
472 Abbrevs in caps, e.g., HTML, DVI, MIDI, etc.
483 When beginning a quote: "So, he said,...".
485 This usage is rarer. Americans often just use a comma.
488 When adding a defining example at the end of a sentence.
493 Non-ASCII characters which are in utf-8 should be directly used;
494 this is, don't say `Ba@@ss@{@}tuba' but `Baßtuba'. This ensures
495 that all such characters appear in all output formats.
502 @node Documentation policy
503 @section Documentation policy
507 * Section organization::
508 * Checking cross-references::
510 * Technical writing style::
516 There are four parts to the documentation: the Learning Manual,
517 the Notation Reference, the Program Reference, and the Music
525 The LM is written in a tutorial style which introduces the most
526 important concepts, structure and syntax of the elements of a
527 LilyPond score in a carefully graded sequence of steps.
528 Explanations of all musical concepts used in the Manual can be
529 found in the Music Glossary, and readers are assumed to have no
530 prior knowledge of LilyPond. The objective is to take readers to
531 a level where the Notation Reference can be understood and
532 employed to both adapt the templates in the Appendix to their
533 needs and to begin to construct their own scores. Commonly used
534 tweaks are introduced and explained. Examples are provided
535 throughout which, while being focussed on the topic being
536 introduced, are long enough to seem real in order to retain the
537 readers' interest. Each example builds on the previous material,
538 and comments are used liberally. Every new aspect is thoroughly
539 explained before it is used.
541 Users are encouraged to read the complete Learning Manual from
546 Notation Reference: a (hopefully complete) description of LilyPond
547 input notation. Some material from here may be duplicated in the
548 Learning Manual (for teaching), but consider the NR to be the
549 "definitive" description of each notation element, with the LM
550 being an "extra". The goal is _not_ to provide a step-by-step
551 learning environment -- do not avoid using notation that has not
552 be introduced previously in the NR (for example, use \break if
553 appropriate). This section is written in formal technical writing
556 Avoid duplication. Although users are not expected to read this
557 manual from start to finish, they should be familiar with the
558 material in the Learning Manual (particularly ``Fundamental
559 Concepts''), so do not repeat that material in each section of
560 this book. Also watch out for common constructs, like ^ - _ for
561 directions -- those are explained in NR 3. In NR 1, you can
562 write: DYNAMICS may be manually placed above or below the staff,
563 see @@ref@{Controlling direction and placement@}.
565 Most tweaks should be added to LSR and not placed directly in the
566 .itely file. In some cases, tweaks may be placed in the main
567 text, but ask about this first.
569 Finally, you should assume that users know what the notation
570 means; explaining musical concepts happens in the Music Glossary.
574 Application Usage: information about using the program lilypond
575 with other programs (lilypond-book, operating systems, GUIs,
576 convert-ly, etc). This section is written in formal technical
579 Users are not expected to read this manual from start to finish.
583 Music Glossary: information about the music notation itself.
584 Explanations and translations about notation terms go here.
586 Users are not expected to read this manual from start to finish.
589 Internals Reference: not really a documentation book, since it is
590 automagically generated from the source, but this is its name.
595 @node Section organization
596 @subsection Section organization
601 The order of headings inside documentation sections should
614 You @emph{must} include a @@seealso.
618 The order of items inside the @@seealso section is
627 @@rlearning@{foozle@}.
637 @@file@{path/to/dir/blahz@}.
639 Snippets: @@rlsr@{section@}.
642 @@rinternals@{fazzle@},
643 @@rinternals@{booar@}.
647 If there are multiple entries, separate them by commas but do not
651 Always end with a period.
654 Place each link on a new line as above; this makes it much easier
655 to add or remove links. In the output, they appear on a single
658 ("Snippets" is REQUIRED; the others are optional)
661 Any new concepts or links which require an explanation should go
662 as a full sentence(s) in the main text.
665 Don't insert an empty line between @@seealso and the first entry!
666 Otherwise there is excessive vertical space in the PDF output.
671 To create links, use @@ref@{@} if the link is within the same
675 @@predefined ... @@endpredefined is for commands in ly/*-init.ly
679 Do not include any real info in second-level sections (ie 1.1
680 Pitches). A first-level section may have introductory material,
681 but other than that all material goes into third-level sections
682 (ie 1.1.1 Writing Pitches).
687 @node Checking cross-references
688 @subsection Checking cross-references
690 Cross-references between different manuals are heavily used in the
691 documentation, but they are not checked during compilation.
692 However, if you compile the documentation, a script called
693 check_texi_refs can help you with checking and fixing these
694 cross-references; for information on usage, cd into a source tree
695 where documentation has been built, cd into Documentation and look
696 for check-xrefs and fix-xrefs targets in 'make help' output. Note
697 that you have to find yourself the source files to fix
698 cross-references in the generated documentation such as the
699 Internals Reference; e.g. you can grep scm/ and lily/.
702 @node General writing
703 @subsection General writing
708 Do not forget to create @@cindex entries for new sections of text.
709 Enter commands with @@funindex, i.e.
712 @@cindex pitches, writing in different octaves
717 do not bother with the @@code@{@} (they are added automatically).
718 These items are added to both the command index and the unified
721 Both index commands should go in front of the actual material.
723 @@cindex entries should not be capitalized, ie
726 @@cindex time signature
730 is preferred instead of @qq{Time signature}, Only use capital
731 letters for musical terms which demand them, like D.S. al Fine.
733 For scheme functions, only include the final part, i.e.,
736 @@funindex modern-voice-cautionary
738 @@funindex #(set-accidental-style modern-voice-cautionary)
747 In general, use the American spellings. The internal lilypond
748 property names use this spelling.
751 List of specific terms:
755 simultaneous NOT concurrent
756 measure: the unit of music
757 bar line: the symbol delimiting a measure NOT barline
758 note head NOT notehead
759 chord construct NOT chord (when referring to <>)
767 @node Technical writing style
768 @subsection Technical writing style
770 These refer to the NR. The LM uses a more gentle, colloquial
776 Do not refer to LilyPond in the text. The reader knows what the
777 manual is about. If you do, capitalization is LilyPond.
780 If you explicitly refer to @q{lilypond} the program (or any other
781 command to be executed), write @code{@@command@{lilypond@}}.
784 Do not explicitly refer to the reader/user. There is no one else
785 besides the reader and the writer.
788 Avoid contractions (don't, won't, etc.). Spell the words out completely.
791 Avoid abbreviations, except for commonly used abbreviations of foreign
792 language terms such as etc. and i.e.
795 Avoid fluff (@qq{Notice that,} @qq{as you can see,}
799 The use of the word @q{illegal} is inappropriate in most cases.
800 Say @q{invalid} instead.
805 @node Tips for writing docs
806 @section Tips for writing docs
808 In the NR, I highly recommend focusing on one subsection at a
809 time. For each subsection,
814 check the mundane formatting. Are the headings (@@predefined,
815 @@seealso, etc.) in the right order?
818 add any appropriate index entries.
821 check the links in the @@seealso section -- links to music
822 glossary, internal references, and other NR sections are the main
823 concern. Check for potential additions.
826 move LSR-worthy material into LSR. Add the snippet, delete the
827 material from the .itely file, and add a @@lilypondfile command.
830 check the examples and descriptions. Do they still work?
831 @strong{Do not} assume that the existing text is
832 accurate/complete; some of the manual is highly out of date.
835 is the material in the @@knownissues still accurate?
838 can the examples be improved (made more explanatory), or is there
839 any missing info? (feel free to ask specific questions on -user;
840 a couple of people claimed to be interesting in being
841 @qq{consultants} who would help with such questions)
845 In general, I favor short text explanations with good examples --
846 @qq{an example is worth a thousand words}. When I worked on the
847 docs, I spent about half my time just working on those tiny
848 lilypond examples. Making easily-understandable examples is much
849 harder than it looks.
852 @subsubheading TWEAKS
854 In general, any \set or \override commands should go in the
855 @qq{select snippets} section, which means that they should go in
856 LSR and not the .itely file. For some cases, the command
857 obviously belongs in the @qq{main text} (i.e. not inside
858 @@predefined or @@seealso or whatever) -- instrument names are a
859 good example of this.
862 \set Staff.instrumentName = #"foo"
865 On the other side of this,
868 \override Score.Hairpin #'after-line-breaking = ##t
871 clearly belongs in LSR.
873 I'm quite willing to discuss specific cases if you think that a
874 tweaks needs to be in the main text. But items that can go into
875 LSR are easier to maintain, so I'd like to move as much as
879 It would be @qq{nice} if you spent a lot of time crafting nice
880 tweaks for users... but my recommendation is @strong{not} to do
881 this. There's a lot of doc work to do without adding examples of
882 tweaks. Tweak examples can easily be added by normal users by adding
885 One place where a documentation writer can profitably spend time writing
886 or upgrading tweaks is creating tweaks to deal with known issues. It
887 would be ideal if every significant known issue had a workaround to avoid
891 @node Updating docs with convert-ly
892 @section Updating doc with @command{convert-ly}
894 cd into Documentation and run
897 find . -name '*.itely' | xargs convert-ly -e
901 This also updates translated documentation.
905 @node Translating the documentation
906 @section Translating the documentation
909 * Getting started with documentation translation::
910 * Documentation translation details::
911 * Documentation translation maintenance::
912 * Translations management policies::
913 * Technical background::
916 @node Getting started with documentation translation
917 @subsection Getting started with documentation translation
919 First, get the sources from the Git repository, see @ref{Documentation
920 translations source code}.
923 * Translation requirements::
924 * Which documentation can be translated::
925 * Starting translation in a new language::
928 @node Translation requirements
929 @unnumberedsubsubsec Translation requirements
931 Working on LilyPond documentation translations requires the following
932 pieces of software, in order to make use of dedicated helper tools:
935 @item Python 2.4 or higher,
940 It is not required to build LilyPond and the documentation to
941 translate the documentation. However, if you have enough time and
942 motivation and a suitable system, it can be very useful to build at
943 least the documentation so that you can check the output yourself and
944 more quickly; if you are interested, see @ref{Compiling from source}.
949 @node Which documentation can be translated
950 @unnumberedsubsubsec Which documentation can be translated
952 The makefiles and scripts infrastructure currently supports translation
953 of the following documentation:
956 @item documentation index (HTML);
957 @item user manual and program usage -- Texinfo source, PDF and HTML
958 output; Info output might be added if there is enough demand for it;
959 @item the News document.
962 The following pieces of documentation should be added soon, by
963 descending order of priority:
966 @item automatically generated documentation: markup commands,
967 predefined music functions;
968 @item the Snippets List;
969 @item the examples page;
970 @item the Internals Reference.
974 @node Starting translation in a new language
975 @unnumberedsubsubsec Starting translation in a new language
977 At top of the source directory, do
984 or (if you want to install your self-compiled LilyPond locally)
987 ./autogen.sh --prefix=$HOME
991 If you want to compile LilyPond -- which is almost required to build
992 the documentation, but is not required to do translation only -- fix
993 all dependencies and rerun @command{./configure} (with the same
994 options as for @command{autogen.sh}).
996 Then @command{cd} into @file{Documentation} and run
999 make ISOLANG=@var{MY-LANGUAGE} new-lang
1003 where @var{MY-LANGUAGE} is the ISO 639 language code.
1005 Finally, add a language definition for your language in
1006 @file{python/langdefs.py}.
1008 Before starting the real translation work, it is recommended to commit
1009 changes you made so far to Git, so e.g. you are able to get back to
1010 this state of the sources easily if needed; see @ref{Sharing your
1014 @node Documentation translation details
1015 @subsection Documentation translation details
1017 Please follow all the instructions with care to ensure quality work.
1019 All files should be encoded in UTF-8.
1022 * Files to be translated::
1023 * Translating the Learning Manual and other Texinfo documentation::
1024 * Translating the Notation Reference and Application Usage::
1025 * Translating the Documentation index index.html.in::
1028 @node Files to be translated
1029 @unnumberedsubsubsec Files to be translated
1031 @include doc-translation-list.itexi
1033 @node Translating the Learning Manual and other Texinfo documentation
1034 @unnumberedsubsubsec Translating the Learning Manual and other Texinfo documentation
1036 Any title which comes with one of the following commands must not be
1037 translated directly in the Texinfo source
1040 @@node @@majorheading
1041 @@chapter @@unnumbered @@appendix @@chapheading
1042 @@section @@unnumberedsec @@appendixsec @@heading
1043 @@subsection @@unnumberedsubsec @@appendixsubsec @@subheading
1044 @@subsubsection @@unnumberedsubsubsec @@appendixsubsubsec @@subsubheading
1045 @@ref @@rglos @@ruser @@rlearning @@rprogram @@rlsr
1048 The same applies to first argument of @code{@@r@var{manual}named}
1049 commands; however, the second argument @var{Bar baz} of
1050 @code{@@ref@{@var{Foo},@var{Bar baz},,@var{info-file}@}} and
1051 @code{@@r@var{manual}named@{@var{Foo},@var{Bar baz}@}} should be
1054 @code{@@uref}'s names are to be translated.
1056 In any section which looks like
1060 * @var{node1}:: @var{thing1}
1061 * @var{node2}:: @var{thing2}
1067 the node names @var{nodeN} are @emph{not} to be translated, whereas
1068 extra title information @var{thingN} is.
1070 Every node name or section title must from now on be translated
1071 separately in a @file{.po} file (just as well as LilyPond output
1072 messages) in @file{Documentation/po}. The Gettext domain is named
1073 @code{lilypond-doc}, and unlike @code{lilypond} domain it is not
1074 managed through the Free Translation Project.
1077 Take care of using typographic rules for your language, especially in
1078 @file{user/macros.itexi}.
1081 Please keep verbatim copies of music snippets (in @code{@@lilypond}
1082 blocs). However, some music snippets containing text that shows in
1083 the rendered music, and sometimes translating this text really helps
1084 the user to understand the documentation; in this case, and only in
1085 this case, you may as an exception translate text in the music
1086 snippet, and then you must add a line immediately before the
1087 @code{@@lilypond} block, starting with
1094 Otherwise the music snippet would be reset to the same content as the
1095 English version at next @command{make snippet-update} run -- see
1096 @ref{Updating documentation translation}.
1101 @@lilypondfile[<number of fragment options>,texidoc]@{@var{filename.ly}@}
1105 in the source, open @file{input/lsr/@var{filename}.ly}, translate the
1106 @code{texidoc} header field it contains, enclose it with
1107 @code{texidoc@var{MY-LANGUAGE} = "} and @code{"}, and write it into
1108 @file{input/texidocs/@var{filename}.texidoc} -- please keep possibly
1109 existing translations in other languages! Additionnally, you may
1110 translate the snippet's title in @code{doctitle} header field, in case
1111 @code{doctitle} is a fragment option used in @code{@@lilypondfile};
1112 you can do this exactly the same way as @code{texidoc}. For instance,
1113 @file{input/texidocs/@var{filename}.texidoc} may contain
1116 doctitlees = "Spanish title baz"
1118 Spanish translation blah
1120 doctitlede = "German title bar"
1121 texidocde = "German translation foo
1125 @code{@@example} blocs need not be verbatim copies, e.g. variable
1126 names, file names and comments should be translated.
1128 Index entries (@code{@@cindex} and so on) should be translated.
1130 Finally, please carefully apply every rule exposed in @ref{Texinfo
1131 introduction and usage policy}, and @ref{Documentation policy}. If
1132 one of these rules conflicts with a rule specific to your language,
1133 please ask the Translation meister and/or the Documentation Editors on
1134 @email{lilypond-devel@@gnu.org}.
1137 @node Translating the Notation Reference and Application Usage
1138 @unnumberedsubsubsec Translating the Notation Reference and Application Usage
1140 Copy @file{user/lilypond.tely} (or @file{user/lilypond-program.tely},
1141 respectively) into @file{@var{MY-LANGUAGE}/user}, then translate this
1142 file and run @code{skeleton-update} -- see @ref{Updating documentation
1143 translation}. Your are now ready to translate the Notation Reference
1144 (Application Usage, respectively) exactly like the Learning Manual.
1147 @node Translating the Documentation index index.html.in
1148 @unnumberedsubsubsec Translating the Documentation index @file{index.html.in}
1150 Unlike almost all HTML pages in this documentation, links in this page
1151 are not tweaked by @file{postprocess_html.py}, so links should be
1152 manually edited to link to existing translations.
1155 @node Documentation translation maintenance
1156 @subsection Documentation translation maintenance
1158 Several tools have been developed to make translations maintenance
1159 easier. These helper scripts make use of the power of Git, the
1160 version control system used for LilyPond development.
1163 * Check state of translation::
1164 * Updating documentation translation::
1167 @node Check state of translation
1168 @unnumberedsubsubsec Check state of translation
1170 First pull from Git, then cd into @file{Documentation/} (or at top of
1171 the source tree, replace @command{make} with @command{make -C
1172 Documentation}) and run
1175 make ISOLANG=@var{MY_LANGUAGE} check-translation
1179 This presents a diff of the original files since the most recent
1180 revision of the translation. To check a single file, cd into
1181 @file{Documentation/} and run
1184 make CHECKED_FILES=@var{MY_LANGUAGE/user/foo.itely} check-translation
1187 To see only which files need to be updated, do
1190 make ISOLANG=@var{MY_LANGUAGE} check-translation | grep 'diff --git'
1193 To avoid printing terminal colors control characters, which is often
1194 desirable when you redirect output to a file, run
1197 make ISOLANG=@var{MY_LANGUAGE} NO_COLOR=1 check-translation
1200 Global state of the translation is recorded in
1201 @file{Documentation/translations.html.in}, which is used to generate
1202 Translations status page. To update that page, do from
1203 @file{Documentation/}
1206 make translation-status
1209 This will also leave @file{out/translations-status.txt}, which contains
1210 up-to-dateness percentages for each translated file, and update word
1211 counts of documentation files in this Guide.
1215 @ref{Maintaining without updating translations}.
1218 @node Updating documentation translation
1219 @unnumberedsubsubsec Updating documentation translation
1221 Instead of running @code{check-translation}, you may want to run
1222 @code{update-translation}, which will run your favorite text editor to
1223 update files. First, make sure environment variable @code{EDITOR} is
1224 set to a text editor command, then run from @file{Documentation/}
1227 make ISOLANG=@var{MY_LANGUAGE} update-translation
1230 or to update a single file
1233 make CHECKED_FILES=@var{MY_LANGUAGE/user/foo.itely} update-translation
1236 For each file to be udpated, update-translation will open your text
1237 editor with this file and a diff of the file in English; if the diff
1238 cannot be generated or is bigger than the file in English itself, the
1239 full file in English will be opened instead.
1241 Texinfo skeleton files, i.e. @file{.itely} files not yet translated,
1242 containing only the Texinfo structure can be updated automatically:
1243 whenever @command{make check-translation} shows that such files should
1244 be updated, run from @file{Documentation/}
1247 make ISOLANG=@var{MY_LANGUAGE} skeleton-update
1250 @file{.po} message catalogs in @file{Documentation/po/} may be updated
1251 by issuing from @file{Documentation/} or @file{Documentation/po/}
1257 @warning{if you run po-update and somebody else does the same and
1258 pushes before you push or send a patch to be applied, there will be a
1259 conflict when you pull. Therefore, it is better that only the
1260 Translation meister runs this command.}
1262 Updating music snippets can quickly become cumbersome, as most
1263 snippets should be identical in all languages. Fortunately, there is
1264 a script that can do this odd job for you (run from
1265 @file{Documentation/}):
1268 make ISOLANG=@var{MY_LANGUAGE} snippet-update
1271 This script overwrites music snippets in
1272 @file{@var{MY_LANGUAGE/user/every.itely}} with music snippets from
1273 @file{@var{user/every.itely}}. It ignores skeleton files, and keeps
1274 intact music snippets preceded with a line starting with @code{@@c
1275 KEEP LY}; it reports an error for each @file{.itely} that has not the
1276 same music snippet count in both languages. Always use this script
1277 with a lot of care, i.e. run it on a clean Git working tree, and check
1278 the changes it made with @command{git diff} before committing; if you
1279 don't do so, some @code{@@lilypond} snippets might be broken or make
1280 no sense in their context.
1282 Finally, a command runs the three update processes above for all
1283 enabled languages (from @file{Documentation/}):
1286 make all-translations-update
1289 Use this command with caution, and keep in mind it will not be really
1290 useful until translations are stabilized after the end of GDP.
1294 @ref{Maintaining without updating translations}.
1297 @node Translations management policies
1298 @subsection Translations management policies
1300 These policies show the general intent of how the translations should
1301 be managed, they aim at helping translators, developers and
1302 coordinators work efficiently.
1305 * Maintaining without updating translations::
1306 * Managing documentation translation with Git::
1309 @node Maintaining without updating translations
1310 @unnumberedsubsubsec Maintaining without updating translations
1312 Keeping translations up to date under heavy changes in the
1313 documentation in English may be almost impossible, especially as
1314 during the former Grand Documentation Project (GDP) or the Grand
1315 Organization Project (GOP) when a lot of contributors brings changes.
1316 In addition, transloators may be (and that) involved in these porjects too.
1318 it is possible -- and even recommended -- to
1319 perform some maintaining that keeps translated documentation usable
1320 and eases future translation updating. The rationale below the tasks
1321 list motivates this plan. The rationale below the tasks
1322 list motivates this plan.
1324 The following tasks are listed in decreasing priority order.
1327 @item Update macros.itexi.
1328 For each obsolete macro definition, if it is possible to update macro
1329 usage in documentation with an automatic text or regexp substitution,
1330 do it and delete the macro definition from macros.itexi; otherwise,
1331 mark this macro definition as obsolete with a comment, and keep it in
1332 macros.itexi until the documentation translation has been updated and
1333 no longer uses this macro.
1335 @item Update @file{*.tely} files completely with
1336 @command{make check-translation} -- you may want to redirect ouptput
1337 to a file because of overwhelming output, or call check-translation.py
1338 on individual files, see @ref{Check state of translation}.
1340 @item In @file{.itelys}, match sections and .itely file names with those from
1341 English docs, which possibly involves moving nodes contents in block
1342 between files, without updating contents itself. In other words, the
1343 game is catching where has gone each section. In Learning manual, and
1344 in Notation Reference sections which have been revised in GDP, there
1345 may be completely new sections: in this case, copy @code{@@node} and
1346 @code{@@section}-command from English docs, and add the marker for
1347 untranslated status @code{@@untranslated} on a single line. Note that
1348 it is not possible to exactly match subsections or subsubsections of
1349 documentation in English, when contents has been deeply revised; in
1350 this case, keep obsolete (sub)subsections in the translation, marking
1351 them with a line @code{@@c obsolete} just before the node.
1353 Emacs with Texinfo mode makes this step easier:
1356 @item without Emacs AucTeX installed, @key{C-c C-s} shows structure of current
1357 Texinfo file in a new buffer *Occur*; to show structure of two files
1358 simultaneously, first split Emacs window in 4 tiles (with @key{C-x 1}
1359 and @key{C-x 2}), press @key{C-c C-s} to show structure of one file
1360 (e.g. the translated file), copy *Occur* contents into *Scratch*, then
1361 press @key{C-c C-s} for the other file.
1363 If you happen to have installed AucTeX, you can either call the macro
1364 by doing @key{M-x texinfo-show-structure} or create a key binding in your
1365 @file{~/.emacs}, by adding the four following lines:
1368 (add-hook 'Texinfo-mode-hook
1370 (define-key Texinfo-mode-map "\C-cs"
1371 'texinfo-show-structure)))
1375 and then obtain the structure in the *Occur* buffer with @key{C-c s}.
1377 @item Do not bother updating @code{@@menu}s when all menu entries are in the same
1378 file, just do @key{C-c C-u C-a} ("update all menus") when you have
1379 updated all the rest of the file.
1381 @item Moving to next or previous node using incremental search: press
1382 @key{C-s} and type @code{node} (or @key{C-s @@node} if the text
1383 contains the word @q{node}) then press @key{C-s} to move to next node
1384 or @key{C-r} to move to previous node. Similar operation can be used
1385 to move to the next/previous section. Note that every cursor move
1386 exits incremental search, and hitting @key{C-s} twice starts
1387 incremental search with the text entered in previous incremental
1390 @item Moving a whole node (or even a sequence of nodes): jump to beginning
1391 of the node (quit incremental search by pressing an arrow), press
1392 @key{C-SPACE}, press @key{C-s node} and repeat @key{C-s} until you
1393 have selected enough text, cut it with @key{C-w} or @key{C-x}, jump to
1394 the right place (moving between nodes with the previous hint is often
1395 useful) and paste with @key{C-y} or @key{C-v}.
1398 @item Update sections finished in the English documentation; check
1400 @uref{http://lilypondwiki.tuxfamily.org/index.php?title=Documentation_coordination}.
1402 @item Update documentation PO. It is recommended not to update
1403 strings which come from documentation that is currently deeply revised
1404 in English, to avoid doing the work more than once.
1406 @item Fix broken cross-references by running (from @file{Documentation/})
1409 make ISOLANG=@var{YOUR-LANGUAGE} fix-xrefs
1413 This step requires a sucessful documentation build (with @command{make
1414 web}). Some cross-references are broken because they point to a node
1415 that exists in the documentation in English, which has not been added
1416 to the translation; in this case, do not fix the cross-reference but
1417 keep it "broken", so that the resulting HTML link will point to an
1418 existing page of documentation in English.
1421 @subsubheading Rationale
1423 You may wonder if it would not be better to leave translations as-is
1424 until you can really start updating translations. There are several
1425 reasons to do these maintenance tasks right now.
1428 @item This will have to be done sooner or later anyway, before updating
1429 translation of documentation contents, and this can already be done
1430 without needing to be redone later, as sections of documentation in
1431 English are mostly revised once. However, note that not all
1432 documentation sectioning has been revised in one go, so all this
1433 maintenance plan has to be repeated whenever a big reorganization is
1436 @item This just makes translated documentation take advantage of the new
1437 organization, which is better than the old one.
1439 @item Moving and renaming sections to match sectioning of documentation in
1440 English simplify future updating work: it allows updating the
1441 translation by side-by-side comparison, without bothering whether
1442 cross-reference names already exist in the translation.
1444 @item Each maintenance task except @q{Updating PO files} can be done by
1445 the same person for all languages, which saves overall time spent by
1446 translators to achieve this task: the node names and section titles
1447 are in English, so you can do. It is important to take advantage of
1448 this now, as it will be more complicated (but still possible) to do
1449 step 3 in all languages when documentation is compiled with
1450 @command{texi2html} and node names are directly translated in source
1455 @node Managing documentation translation with Git
1456 @unnumberedsubsubsec Managing documentation translation with Git
1458 This policy explains how to manage Git branches and commit
1459 translations to Git.
1462 @item Translation changes matching master branch are preferably made on
1463 @code{lilypond/translation} branch; they may be pushed directly to
1464 @code{master} only if they do not break compilation of LilyPond and
1465 its documentation, and in this case they should be pushed to
1466 @code{lilypond/translation} too. Similarly, changes matching
1467 @code{stable/X.Y} are preferably made on
1468 @code{lilypond/X.Ytranslation}.
1470 @item @code{lilypond/translation} Git branch may be merged into master only if
1471 LilyPond (@command{make all}) and documentation (@command{make web}) compile
1474 @item @code{master} Git branch may be merged into
1475 @code{lilypond/translation} whenever @command{make} and @command{make
1476 web} are succesful (in order to ease documentation compilation by
1477 translators), or when significant changes had been made in
1478 documentation in English in master branch.
1480 @item General maintenance may be done by anybody who knows what he does
1481 in documentation in all languages, without informing translators
1482 first. General maintenance include simple text substitutions
1483 (e.g. automated by sed), compilation fixes, updating Texinfo or
1484 lilypond-book commands, updating macros, updating ly code, fixing
1485 cross-references, and operations described in @ref{Maintaining
1486 without updating translations}.
1490 @node Technical background
1491 @subsection Technical background
1493 A number of Python scripts handle a part of the documentation
1494 translation process. All scripts used to maintain the translations
1495 are located in @file{scripts/auxiliar/}.
1498 @item @file{check_translation.py} -- show diff to update a translation,
1499 @item @file{texi-langutils.py} -- quickly and dirtily parse Texinfo files to
1500 make message catalogs and Texinfo skeleton files,
1501 @item @file{texi-skeleton-update.py} -- update Texinfo skeleton files,
1502 @item @file{update-snippets.py} -- synchronize ly snippets with those
1504 @item @file{translations-status.py} -- update translations status pages and word
1505 counts in the file you are reading,
1506 @item @file{tely-gettext.py} -- gettext node names, section titles and references
1507 in the sources; WARNING only use this script once for each file, when support for
1508 "makeinfo --html" has been dropped.
1511 Other scripts are used in the build process, in @file{scripts/build/}:
1514 @item @file{html-gettext.py} -- translate node names, section titles and cross
1515 references in HTML files generated by @command{makeinfo},
1516 @item @file{texi-gettext.py} -- gettext node names, section titles and references
1517 before calling @command{texi2pdf},
1518 @item @file{mass-link.py} -- link or symlink files between English documentation
1519 and documentation in other languages.
1522 Python modules used by scripts in @file{scripts/auxiliar/} or @file{scripts/build/} (but
1523 not by installed Python scripts) are located in @file{python/auxiliar/}:
1525 @item @file{manuals_definitions.py} -- define manual names and name of
1526 cross-reference Texinfo macros,
1527 @item @file{buildlib.py} -- common functions (read piped output
1528 of a shell command, use Git),
1529 @item @file{postprocess_html.py} (module imported by @file{www_post.py}) -- add footer and
1530 tweak links in HTML pages.
1535 @item @file{python/langdefs.py} -- language definitions module