Re: Syntax highlighting of a new grob name

2022-09-04 Thread Werner LEMBERG


> I see that CaesuraScript is highlighted differently than other grob
> names in this text:
> 
> \override Score.Script.color = ...
> \override Score.MultiMesaureRestScript.color = ...
> \override Score.CaesuraScript.color = ...
> 
> Can I do something to address this?  TIA.

Well, file `_lilypond_builtins.py`, part of `pygments.zip`, doesn't
know `CaesuraScript` yet.  This file gets generated by a file called
`lilypond-builtins-generator.ly`, which is not part of LilyPond...

What we probably need is a mechanism to add new grob names to pygments
via environment variables or something similar until the pygments
support gets updated.


Werner



Re: Syntax highlighting of a new grob name

2022-09-04 Thread Jean Abou Samra

Le 04/09/2022 à 21:15, Dan Eble a écrit :

I am trying to document \caesura in the Notation Reference.

I have just made the docs starting from a clean build directory.

I see that CaesuraScript is highlighted differently than other grob names in 
this text:

 \override Score.Script.color = ...
 \override Score.MultiMesaureRestScript.color = ...
 \override Score.CaesuraScript.color = ...

Can I do something to address this?  TIA.



No; the grob names are defined in a file in Pygments
(pygments/lexers/_lilypond_builtins.py) that is autogenerated
from LilyPond, but not dynamically. It's updated from time to
time in Pygments and from time to time a new release of Pygments
is used in the doc build (I've been procrastinating for the update
to the latest release for a week, but now that I said it I'll
need to do it this evening :-).

I still have a project to implement a LilyPond option that would
print out a JSON (or whatever) of all grob/property/context/...
names, for use by Pygments, Frescobaldi and such, and this would
potentially allow dynamic generation in the doc build, but I never
had the time combined with motivation to finish it.

Jean




Syntax highlighting of a new grob name

2022-09-04 Thread Dan Eble
I am trying to document \caesura in the Notation Reference.

I have just made the docs starting from a clean build directory.

I see that CaesuraScript is highlighted differently than other grob names in 
this text:

\override Score.Script.color = ...
\override Score.MultiMesaureRestScript.color = ...
\override Score.CaesuraScript.color = ...

Can I do something to address this?  TIA.
— 
Dan