#(define (add-link url-strg) (lambda (grob) (let* ((stil (ly:grob-property grob 'stencil))) (if (ly:stencil? stil) (let* ((x-ext (ly:stencil-extent stil X)) (y-ext (ly:stencil-extent stil Y)) (url-expr `(url-link ,url-strg ,x-ext ,y-ext)) (new-stil (ly:stencil-add (ly:make-stencil url-expr x-ext y-ext) stil))) (ly:grob-set-property! grob 'stencil new-stil)))))) %%%% test %% For easier maintenance of this snippet the URL is formatted to use the %% actually used LilyPond version. %% Of course a literal URL would work as well. #(define major.minor-version (string-join (take (string-split (lilypond-version) #\.) 2) ".")) urlI = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/writing-pitches" major.minor-version) urlII = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/rhythms" major.minor-version) urlIII = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/note-heads" major.minor-version) urlIV = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/beams" major.minor-version) urlV = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/note-head-styles" major.minor-version) urlVI = #(format #f "http://lilypond.org/doc/v~a/Documentation/notation/writing-pitches" major.minor-version) \relative c' { \key cis \minor \once \override Staff.Clef.color = #green \once \override Staff.Clef.after-line-breaking = #(add-link urlI) \once \override Staff.TimeSignature.color = #green \once \override Staff.TimeSignature.after-line-breaking = #(add-link urlII) \once \override NoteHead.color = #green \once \override NoteHead.after-line-breaking = #(add-link urlIII) cis'1 \once \override Beam.color = #green \once \override Beam.after-line-breaking = #(add-link urlIV) cis8 dis e fis gis2 1 }