lilypond-devel
[Top][All Lists]
Advanced

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

Re: Comments wanted on code highlighting in PDF output


From: Jean Abou Samra
Subject: Re: Comments wanted on code highlighting in PDF output
Date: Mon, 21 Feb 2022 21:58:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0

Le 21/02/2022 à 21:15, Luca Fascione a écrit :


On Mon, Feb 21, 2022 at 9:01 PM Jean Abou Samra <jean@abou-samra.fr> wrote:

    Are you aware of

    https://myrealbook.vintherine.org/

    ?


I was not, the material I was working from was the openbook project, by Mark Veltzer. He's done all the heavy work, I'm just working on how to build his stuff and make it beautiful.
(and using that work as an opportunity to learn stuff).

    > Once I'm done with these, if there's still interest, I could see
    if I
    > can help with this stuff. I like parsey things fwiw.
    >
    > The idea of parsing lisp was because I was imagining you could
    scrape
    > the .scm source files to build a database of callables and their
    > signatures and then use that to guide highlighting examples
    found in
    > the docs. Wasn't aware of your other script


    Yeah, Scheme (at least its Guile incarnation) has enough
    reflective power that parsing it by hand is not necessary.


Yes, I've not done that much Lisp, but I have done a lot of TCL when I was younger. TCL is (very approximately) a lisp implementation with a fair few liberties,
so aside from parens, ticks, commas and let, I feel relatively at home.
Like it would be in lisp, parsing TCL with TCL is kinda the whole point of the language, almost.

I must say I miss the $ for dereferencing variables, the way Scheme has it seems more confusing to me.



Not sure what confuses you? It's the same as in most
other languages (such as C++): a bare name dereferences
a variable. The exception to this is within quotes,
which prevent evaluation of symbols, returning them naked.



(and the parentheses... take some getting used to, esp with strange indentation patterns)


In case you want to understand them better:

http://community.schemewiki.org/?scheme-style




    We actually do some parsing (scripts/build/lilypond-words.py),
    and that is what I hope to replace.


... with? Guile directly?



Yes, that is the approach taken in the script I linked.
The .ly file is made entirely of embedded Scheme code.



I like messing with language-y parse-y things a lot, if I can help with anything, happy to


Well, that thing is already done, but feel free to use
it if you want to introduce a distinction between @code
and something else.

Before spending significant time on it, though, be sure
to do a dedicated request for comments on the mailing list,
giving concrete examples of how it looks like in the
documentation -- not all ideas meet consensus (syntax
highlighting is a good example of a largely subjective
matter).


Jean



reply via email to

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