GNU LilyPond Contributor's Guide: 5.2 Adding and editing snippets

## 5.2 Adding and editing snippets

### General guidelines

When you create (or find!) a nice snippet, if it supported by LilyPond version running on LSR, please add it to LSR. Go to LSR and log in – if you haven’t already, create an account. Follow the instructions on the website. These instructions also explain how to modify existing snippets.

If you think the snippet is particularly informative and you think it should be included in the documentation, tag it with “docs” and one or more other categories, or ask somebody who has editing permissions to do it on the development list.

Please make sure that the lilypond code follows the guidelines in LilyPond formatting.

If a new snippet created for documentation purposes compiles with LilyPond version currently on LSR, it should be added to LSR, and a reference to the snippet should be added to the documentation.

If the new snippet uses new features that are not available in the current LSR version, the snippet should be added to ‘`input/new`’ and a reference should be added to the manual.

Snippets created or updated in ‘`input/new`’ should be copied to ‘`input/lsr`’ by invoking at top of the source tree

>     scripts/auxiliar/makelsr.py

Be sure that `make doc` runs successfully before submitting a patch, to prevent breaking compilation.

### Formatting snippets in ‘`input/new`’

When adding a file to this directory, please start the file with

>     \version "2.x.y"
>     \header {
>       lsrtags = "rhythms,expressive-marks"  % use existing LSR tags other than
>     %   'docs'; see makelsr.py for the list of tags used to sort snippets.
>       texidoc = "This code demonstrates ..."  % this will be formated by Texinfo
>       doctitle = "Snippet title"  % please put this at the end so that
>         the '% begin verbatim' mark is added correctly by makelsr.py.
>     }

and name the file ‘`snippet-title.ly`’.

#### Contributor’s Guide