lilypond-user-fr
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: markup conditionnel


From: Vincent Gay
Subject: Re: markup conditionnel
Date: Sat, 4 Jan 2020 07:43:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.3.0

Le 03/01/2020 à 22:28, Valentin Villenave a écrit :
> Au minimum, cela pourrait être quelque chose comme cela :
>
> #(define (played? layout props arg)
>   (if (string? (chain-assoc-get 'header:asplayed props))
>       (interpret-markup layout props arg)
>       empty-stencil))
>
> \header {
>   asplayed = "Oscar Peterson"
>   url = "https://www.youtube.com/watch?v=aT22bCkKmTk";
>
>   arranger = \markup \on-the-fly #played?
>     \with-url #url
>     \with-color #blue \underline
>     \concat { "(as played by " \fromproperty #'header:asplayed ")" }
> }

Merci infiniment Valentin, cela répond parfaitement à mon besoin.

> Après, il y a des façons plus élégantes et sophistiquées de procéder
> mais cela dépend vraiment de ce dont vous avez besoin.
Pour ma modeste culture vous testez ici que la variable existe et non
pas qu'elle est non vide n'est-ce pas ? L'incidence est parfaitement
minime, il me suffit de commenter la ligne contenant la variable (je
travaille à partir de modèles, comme tout le monde j'imagine).
L'important pour moi étant que je puisse récupérer cette variable dans
un petit programme bash alimentant un tableau d'une page web.

Merci encore et tous mes vœux pour 2020

-- 
Vincent Gay
Envoyé depuis mon saxo-phone :)
http://blog.vintherine.org/ - http://photos.vintherine.org/


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]