Re: markup function accepting either markup or markup list as argument

2024-06-22 Thread Werner LEMBERG
>> I want to write a user-friendly markup command that can accept either >> a markup or a markup list as arguments. Example: >> >> ``` >> % \ornament >> \markup \ornament \number ♭ >> \musicglyph "scripts.turn" >> \number ♮ >> \markup \ornament { \number ♭ \

Re: markup function accepting either markup or markup list as argument

2024-06-22 Thread David Kastrup
Werner LEMBERG writes: >> The real question is what you actually are trying to achieve here. > > I want to write a user-friendly markup command that can accept either > a markup or a markup list as arguments. Example: > > ``` > % \ornament > \markup \ornament \number ♭ > \mu

Re: markup function accepting either markup or markup list as argument

2024-06-22 Thread Werner LEMBERG
> The documentation clearly states: > > > >Arguments are distinguished according to their type: >• a markup, corresponding to type predicate ‘markup?’; >• a list of markups, corresponding to type

Re: markup function accepting either markup or markup list as argument

2024-06-21 Thread David Kastrup
Werner LEMBERG writes: > Folks, > > > I would like to write a markup function that can either accept a > markup or a markup list as an argument. You mean, a markup command. > The code below works fine, reporting > > ``` > bar: (#) > baz: 1 > bar: ((#) > (#)) > baz: 1 > ``` > > as expected

Re: markup function

2013-01-06 Thread Thomas Morley
2013/1/5 David Kastrup : > Noeck writes: [...] >> The words "layout props" and the "interpret-markup" are still cryptic >> to me. Is there a documentation where this is described for noobs like >> me? > > No. I don't think there is reasonable documentation where this is > described for experts ei

Re: markup function

2013-01-05 Thread Noeck
> > #(define-markup-command (myfunction layout props link text) > (markup? markup?) (string? string?) > "Comment." > (interpret-markup layout props > #{\markup \with-url #(string-append #"http" #link) #text #})) > Now it became clearer to me. What I meant in the last line was: #{\markup

Re: markup function

2013-01-05 Thread David Kastrup
Noeck writes: >> It might make sense to look in the Guile manual for string operations. >> Other than that, check out the notation manual for a description of >> available markup commands (like \concat). > > I know concat, but it did not work here. For the \with-url command I > need to replace th

Re: markup function

2013-01-05 Thread Noeck
> It might make sense to look in the Guile manual for string operations. > Other than that, check out the notation manual for a description of > available markup commands (like \concat). I know concat, but it did not work here. For the \with-url command I need to replace the #"http" which is some

Re: markup function

2013-01-05 Thread David Kastrup
Noeck writes: >> Have you tried looking into the "Extending LilyPond" manual? >> >> http://lilypond.org/doc/v2.16/Documentation/extending/markup-functions> > > I did not reach it, because I did not understand the sections 2.1 and > 2.2 and then I gave up. Examples would help me a lot in these se

Re: markup function

2013-01-05 Thread Noeck
> How can I combine two strings? The #"http" and the #text in this example? > How can I change a string to lower case? I just want to add, that I know the functions (via google serach): (string-downcase "Abc Def") and (string-append "hello" " " "world") But I don't understand how to use them her

Re: markup function

2013-01-05 Thread Noeck
> Have you tried looking into the "Extending LilyPond" manual? > > http://lilypond.org/doc/v2.16/Documentation/extending/markup-functions> I did not reach it, because I did not understand the sections 2.1 and 2.2 and then I gave up. Examples would help me a lot in these sections. I played around

Re: markup function

2013-01-05 Thread David Kastrup
Noeck writes: > Hi, > > how can I write a function that returns a markup? > > In Python (using LilyPond syntax) I would write something like: > > def function(text): > url = "http://www.something"; + text.lower() > return \markup { \with-color #red \with-url #url text } Have you tried lo