1 @c -*- coding: us-ascii; mode: texinfo; -*-
6 * Introduction to LSR::
7 * Adding and editing snippets::
10 * Fixing snippets in LilyPond sources::
14 @node Introduction to LSR
15 @section Introduction to LSR
18 @uref{http://lsr.dsi.unimi.it/, LilyPond Snippet Repository (LSR)}
19 is a collection of lilypond examples. A subset of these examples
20 are automatically imported into the documentation, making it easy
21 for users to contribute to the docs without learning Git and
25 @node Adding and editing snippets
26 @section Adding and editing snippets
28 @subheading General guidelines
30 When you create (or find!) a nice snippet, if it supported by LilyPond
31 version running on LSR, please add it to LSR. Go to
32 @uref{http://lsr.dsi.unimi.it/, LSR} and log in -- if you haven't
33 already, create an account. Follow the instructions on the website.
34 These instructions also explain how to modify existing snippets.
36 If you think the snippet is particularly informative and you think it
37 should be included in the documentation, tag it with @qq{docs} and one
38 or more other categories, or ask somebody who has editing permissions to
39 do it on the development list.
41 Please make sure that the lilypond code follows the guidelines in
42 @ref{LilyPond formatting}.
44 If a new snippet created for documentation purposes compiles with
45 LilyPond version currently on LSR, it should be added to LSR, and a
46 reference to the snippet should be added to the documentation.
48 If the new snippet uses new features that are not available in the
49 current LSR version, the snippet should be added to @file{input/new} and
50 a reference should be added to the manual.
52 Snippets created or updated in @file{input/new} should be copied to
53 @file{input/lsr} by invoking at top of the source tree
56 scripts/auxiliar/makelsr.py
59 Be sure that @command{make web} runs successfully before submitting a
60 patch, to prevent breaking compilation.
62 @subheading Formatting snippets in @file{input/new}
64 When adding a file to this directory, please start the file with
69 lsrtags = "rhythms,expressive-marks" % use existing LSR tags other than
70 % 'docs'; see makelsr.py for the list of tags used to sort snippets.
71 texidoc = "This code demonstrates ..." % this will be formated by Texinfo
72 doctitle = "Snippet title" % please put this at the end so that
73 the '% begin verbatim' mark is added correctly by makelsr.py.
77 and name the file @file{snippet-title.ly}.
80 @node Approving snippets
81 @section Approving snippets
83 The main task of LSR editors is approving snippets. To find a list of
84 unapproved snippets, log into @uref{http://lsr.dsi.unimi.it/, LSR} and
85 select @qq{No} from the dropdown menu to the right of the word
86 @qq{Approved} at the bottom of the interface, then click
94 Does the snippet make sense and does what the author claims that
95 it does? If you think the snippet is particularly helpful, add
96 the @qq{docs} tag and at least one other tag.
99 If the snippet is tagged with @qq{docs}, check to see if it
100 matches our guidelines for @ref{LilyPond formatting}.
103 If the snippet uses scheme, check that everything looks good and
104 there are no security risks.
106 @warning{Somebody could sneak a @code{#'(system "rm -rf /")}
107 command into our source tree if you do not do this! Take this
108 step @strong{VERY SERIOUSLY}.}
119 Make sure that @command{convert-ly} and @command{lilypond} commands in
120 current PATH are in a bleeding edge version -- latest release from
121 master branch, or even better a fresh snapshot from Git master branch.
124 From the top source directory, run:
127 wget http://lsr.dsi.unimi.it/download/lsr-snippets-docs-@var{YYYY-MM-DD}.tar.gz
128 tar -xzf lsr-snippets-docs-@var{YYYY-MM-DD}.tar.gz
129 scripts/auxiliar/makelsr.py lsr-snippets-docs-@var{YYYY-MM-DD}
133 where @var{YYYY-MM-DD} is the current date, e.g. 2009-02-28.
136 Follow the instructions printed on the console to manually check for
139 @warning{Somebody could sneak a @code{#'(system "rm -rf /")}
140 command into our source tree if you do not do this! Take this
141 step @strong{VERY SERIOUSLY}.}
144 Do a git add / commit / push.
148 Note that whenever there is one snippet from @file{input/new} and the
149 other from LSR with the same file name, the one from @file{input/new}
150 will be copied by @command{makelsr.py}.
153 @node Fixing snippets in LilyPond sources
154 @section Fixing snippets in LilyPond sources
156 In case some snippet from @file{input/lsr} cause the documentation
157 compilation to fail, the following steps should be followed to fix it
163 Look up the snippet filename @file{@var{foo}.ly} in the error output
164 or log, then fix the file @file{input/lsr/@var{foo}.ly} to make the
165 documentation build succesfully.
168 Determine where it comes from by looking at its first line, e.g. run
171 head -1 input/lsr/@var{foo}.ly
175 @strong{In case the snippet comes from LSR}, apply the fix to the
176 snippet in LSR and send a notification email to a LSR editor with CC
177 to the development list -- see @ref{Adding and editing snippets}. The
178 failure may sometimes not be caused by the snippet in LSR but by the
179 syntax conversion made by @command{convert-ly}; in this case, try to
180 fix @command{convert-ly} or report the problem on the development
181 list, then run @command{makelsr.py} again, see @ref{LSR to Git}. In
182 some cases, when some features has been introduced or vastly changed
183 so it requires (or takes significant advantage of) important changes
184 in the snippet, it is simpler and recommended to write a new version
185 of the snippet in @file{input/new}, then run @command{makelsr.py}.
188 @strong{In case the snippet comes from} @file{input/new}, apply in
189 @file{input/new/@var{foo}.ly} the same fix you did in
190 @file{input/lsr/@var{foo}.ly}. In case the build failure was caused
191 by a translation string, you may have to fix
192 @file{input/texidocs/@var{foo}.texidoc} instead.
195 In any case, commit all changes to Git.