[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Update for http://lilypond.org/doc/v2.20/Documentation/snippets/twea
From: |
Thomas Morley |
Subject: |
Re: Update for http://lilypond.org/doc/v2.20/Documentation/snippets/tweaks-and-overrides |
Date: |
Thu, 29 Oct 2020 22:37:00 +0100 |
Am Do., 29. Okt. 2020 um 18:18 Uhr schrieb Johannes Feulner
<johannes.feulner@scorio.com>:
>
> I suggest to update code and picture of the snippet "Adding Links to
> objects".
>
> Changes:
>
> * Update link URLs to a more current version of the documentation
>
> * Fix link for accidental
>
> #(define (add-link url-strg)
> (lambda (grob)
> (let* ((stil (ly:grob-property grob 'stencil)))
> (if (ly:stencil? stil)
> (begin
> (let* (
> (x-ext (ly:stencil-extent stil X))
> (y-ext (ly:stencil-extent stil Y))
> (url-expr (list 'url-link url-strg `(quote ,x-ext) `(quote
> ,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)))
> #f))))
>
> %%%% test
>
> urlI =
> "http://lilypond.org/doc/v2.20/Documentation/notation/writing-pitches"
>
> urlII =
> "http://lilypond.org/doc/v2.20/Documentation/notation/rhythms"
>
> urlIII =
> "http://lilypond.org/doc/v2.20/Documentation/notation/note-heads"
>
> urlIV =
> "http://lilypond.org/doc/v2.20/Documentation/notation/beams"
>
> urlV =
> "http://lilypond.org/doc/v2.20/Documentation/notation/note-head-styles"
>
> urlVI =
> "http://lilypond.org/doc/v2.20/Documentation/notation/writing-pitches"
>
> \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
> <gis,
> \tweak Accidental.color #green
> \tweak Accidental.after-line-breaking #(add-link urlVI)
> \tweak color #green
> \tweak after-line-breaking #(add-link urlV)
> \tweak style #'harmonic
> bis
> dis
> fis
> >1
> <cis, cis' e>
> }
>
> Now with colored accidental and link on the accidental:
>
> Before:
>
> --
> Johannes Feulner
> Tel: +49 721 33500158 johannes.feulner@scorio.com
>
> scorio GmbH Bonhoefferweg 3 76327 Pfinztal
> Geschäftsführer Johannes Feulner
> Sitz der Gesellschaft Karlsruhe
> Amtsgericht Mannheim HRB 713486
>
> _______________________________________________
> bug-lilypond mailing list
> bug-lilypond@gnu.org
> https://lists.gnu.org/mailman/listinfo/bug-lilypond
Hi Johannes.
this one is actually one of my early doc-tagged lsr-snippets...
Instead of manually updating the urls, I let them point to the docs of
the actually used version.
I hope it will be less maintaining effort.
While on it, I did some cleanup, code-formating etc.
lsr.di.unimi.it/LSR/Item?u=1&id=865
Since this snippet is tagged doc, it will be automatically catched for
Documentations/snippets with next lsr-import
Cheers,
Harm