Optional syntax highlighting now added to LilyPond's HTML documentation

2022-02-08 Thread Jean Abou Samra

Hi,

The change to add syntax highlighting in the HTML version of the
LilyPond documentation, discussed at

https://lists.gnu.org/archive/html/lilypond-user/2022-01/msg00012.html

on the lilypond-user list and in various lilypond-devel and GitLab
threads, has now landed in the source tree and will be included in the
next release, 2.23.7.  A demo of the latest version that has been
merged can be found at

http://abou-samra.fr/new-highlighting-demo/notation/index.html

(this will stay available for a week or so, after which I will have to
delete it in order to free space on the server).

Along with style adjustments, this includes a toggle to disable syntax
highlighting, found at the bottom of the page.  The preference can be
saved in the browser so it remains across documentation pages and
between browser sessions.

This change was discussed over months and sparked numerous posts. I
wish to thank all those, too many to list, who provided the feedback,
both positive and negative, that led to its ultimate form. Special
thanks go to Matthäus G. Chajdas, the Pygments maintainer who reviewed
and merged the pull requests against Pygments adding and refining
LilyPond support.

Best regards,
Jean





Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-05 Thread Robin Bannister

Jean Abou Samra wrote:


[Robin]
The stroke width I see is 1px (Firefox at 100%).  This makes the 
stroke dominated by edge effects; the surrounding white dilutes its 
colour.
Do the WCAG recommendations recognise this?  If not, please don't 
apply their levels to this case.



I don't know. I am not a great specialist of all
the (complicated) WCAG rules. All I have been
interested in so far was the ones for color;
their criteria were a handy way to know if
the scheme was OK 


It looks like the contrast tools offer comparison of two colors, without 
considering such context complications.  Very idealised.


But I found tentative recognition at the top of
https://www.w3.org/WAI/GL/WCAG3/2021/how-tos/visual-contrast-of-text/#design-button 


This shows me that they have no handy criteria to offer (yet).


Cheers,
Robin

P.S.
Their #design-button fragment doesn't work for me.
I have to click on the [Design] tab.
All very bleeding edge.





Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Valentin Petzel
Hello Paul,

The documentation does not specify any fonts. It simply uses the  and 
 tags. That means that the fonts used are whatever font your 
browser chooses as default font, which on Windows systems appears to be 
Courier for monospace and apparently in your case Georgia for the regular 
text.

If we want to specify the font we’d probably need to find good default fonts 
for every system or provide our own fonts, which would very much favour OFL/
Apache/MIT/ kind of fonts.

I strongly vote to remain with a monospace font. Regular fonts are created for 
readability of regular text. Code is fundamentally different from regular text, 
so code becomes really hard to read in regular fonts. (Basically reading of 
normal text works by recognizing the shape of the words. But code is usually 
not made up from words.

But as you’ve mentioned the Source Sans Pro: Adobe has also issued a Source 
Code Pro font for Code, which might work really well here. It comes in an 
insane amount of cuts and even has a proper italic cut!

Also Source * fonts are licensed under the OFL, so there is no problem with 
distributing them with the website.

Cheers,
Valentin

Am Dienstag, 4. Jänner 2022, 11:14:49 CET schrieb Paul McKay:
> 
> And this seems the appropriate place to ask why the examples are all in
> fixed pitch Courier in any case. I know this is kind of  industry standard
> but it's one I don't find particularly helpful. I was once adept on the
> card punch machines and mechanical typewriters, but I think most of us
> abandoned fixed pitch fonts long, long ago. I'd suggest a sans serif font
> so that there's a clear contrast with the Georgia used as the text font in
> the documentation. Helvetica, Franklin Gothic and Source Sans Pro look good
> but I realize they might not be available on some platforms.
> 
> HTH
> Paul McKay


signature.asc
Description: This is a digitally signed message part.


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Jean Abou Samra

Le 04/01/2022 à 11:35, Thomas Morley a écrit :

Am Di., 4. Jan. 2022 um 11:15 Uhr schrieb Paul McKay :

Hi
Speaking as someone whose eyesight isn't quite as good as it used to be,

Same problem here


I'd like to suggest that anything in a colour is also in bold so that there are 
enough pixels for me to see what the colour is.

I'd go even further, why not all bold, apart from comments?
At least that's the way I configured my own editor.



I think it would be too much. Bold conveys the
message of something important. To me, an example
that is all bold sounds a bit like shouting;
not sure if you see what I mean? Plus, testing
it with new_style.py (just set Token: "bold"
if you want to play with it), I get the feeling
of a discordance between the style of the text and
that of the code. Screenshot:





I think we should rather try to make it readable
without bold, possibly increasing the font size
a bit (it's quite small at the moment) and possibly
picking a different font.



I don't have strong feelings about colors, though. My own
configuration is indeed like "angry fruit salad", but I doubt there
will be any setting satisfying everyone.



This is possibly the wisest remark in this thread.


[Robin]
The stroke width I see is 1px (Firefox at 100%).  This makes the 
stroke dominated by edge effects; the surrounding white dilutes its 
colour.
Do the WCAG recommendations recognise this?  If not, please don't 
apply their levels to this case.



I don't know. I am not a great specialist of all
the (complicated) WCAG rules. All I have been
interested in so far was the ones for color;
their criteria were a handy way to know if
the scheme was OK given that I could not experience
the highlighting from the point of view of a
colorblind person myself. The end goal is definitely
to have the documentation site readable for
everyone -- including those with disabilities --
and not just to follow recommendations blindly.


[Paul]
And this seems the appropriate place to ask why the examples are all 
in fixed pitch Courier in any case. I know this is kind of  industry 
standard but it's one I don't find particularly helpful. I was once 
adept on the card punch machines and mechanical typewriters, but I 
think most of us abandoned fixed pitch fonts long, long ago. I'd 
suggest a sans serif font so that there's a clear contrast with the 
Georgia used as the text font in the documentation. Helvetica, 
Franklin Gothic and Source Sans Pro look good but I realize they might 
not be available on some platforms.



Independently of the fact that I'm not
fond of the idea, a number of documentation
examples rely on the alignment specific to
fixed-width fonts. This comes to mind for
example:

http://abou-samra.fr/highlighting-demo/notation/multiple-voices.html#writing-music-in-parallel

So there is more to such a shift than introducing
highlighting.

Regards,
Jean




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Jean Abou Samra

Le 04/01/2022 à 23:19, Aaron Hill a écrit :

On 2022-01-04 1:42 pm, Jean Abou Samra wrote:

https://www.gnu.org/philosophy/javascript-trap.en.html
[ . . . ]
But I'm probably fretting for something that is
very easy in the end.


The code Lilypond's site would use would be entirely homegrown, 
licensed under GPL.  Not sure there is anything here to worry unless 
we determine there is an external dependency that is required.




If we add a toggle for switching highlighting on and
off, then the next question will of course be what
the default should be. Without surprise, I would prefer
if it were on by default, but I wouldn't mind the
other way.


And honestly, I like the default being on, simply because it 
advertises the new feature.  If folks load up the docs and see the 
familiar black and white, they might not know to look for the option 
to enable highlighting.


Perhaps a good strategy would be to initially enable the feature for 
an entire release cycle.  This gets folks using it and providing 
feedback.  Most of the discussion so far has been limited in scope so 
it is hard to know if the system works well over the entire manual and 
for day-to-day usage.


I would not be surprised if some creative folks on the list end up 
creating new color schemes to be included as options aside from the 
default.  A dark mode scheme is almost inevitable.



Absolutely agreed.





Are you sure about that? This is one page that drew
my attention:

https://law.stackexchange.com/questions/30739/do-the-gdpr-and-cookie-law-regulations-apply-to-localstorage 



One of the posts a little further down talks about shopping carts.  
The way I read this is that when a user is performing an action where 
something being saved is reasonably expected as part of the 
functionality, there is no need to ask permission. The question we 
would have is whether selecting a color scheme carries an expectation 
that it should persist.



Well, now that you say it: a way to go
about it would be to make it explicit,
with "Save my preference for all visits",
"Permanent setting" or something like that.
This would be a useful piece of information
regardless.

Thanks!
Jean




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Jean Abou Samra

Le 04/01/2022 à 00:33, David Kastrup a écrit :

Flaming Hakama by Elaine  writes:


In this sense, it seems like the place that has the most potential use
for helping people distinguish different data types is where the
syntax is the most complicated and dense, which is in music entry.

The ability to quickly distinguish articulations, dynamics, notes, and
durations seems like it would probably be most useful to people
reading examples in docs, since that is the most unusual aspect of
lilypond syntax.

I find splitting a8 into different colors about as helpful for reading
music as coloring note stems differently would be for reading score
sheets: there is a standard place they are attached to anyway and there
is no particular reason to look elsewhere.



Highlighting \breve and \longa is useful in my view
because it clarifies that they are not articulations
as their syntax might suggest.

And then there is still the problems that durations
are not recognized from numbers in general. I don't
have a whole lot of time this week; still have to
see if it looks good not to highlight any numbers
at all.




It would be much more useful to highlight note lengths separated by
space but still common to a preceding note or rest, like

\drummode { bd4 r r 4. 8 }

where the 4. is sucked into the second r likely unintentionally.
Highlighting this is helpful.



Then we are not talking about the same use cases
for highlighting. But while this might be helpful
in an editor, I don't see the relevance for
documentation. The goal is to help the reader,
not the documentation writer. Whether the input is
intentional or not -- and it should really be
for documentation --, focusing the reader's
attention on that is inappropriate. Not to mention
that \func a 8 where \func is some builtin or custom
function taking a pitch and a number will start
jumping out at the reader for no good reason.

The goal of my efforts is:

- Helping new users to grasp the syntax,

- Helping intermediately advanced users to understand
  the differences between categories of builtins
  (typically grobs vs. contexts),

- Helping all users to discern the structure
  of examples more easily.

But not to point at editing mistakes.


[snipped]


[Jacques]
I appreciate ‘light coloring’ of code to help locating islands in a 
large code base, here in my doc written with… Knuth’s (La)TeX:



Again there are several uses for highlighting that
don't necessarily agree on the way to do it :-)
The more you try to be helpful for understanding
syntax by making semantic categories (grobs vs.
contexts, music functions vs. markup commands, etc.),
the more the text becomes colored. Which is proving
a problem here because LilyPond documentation examples
are so dense in different constructs that as soon
as you try to convey semantic distinctions, most of
the code becomes colored.



[Peter]
There are various types of colour-blindness - red-green is the most 
common. I did a quick Google on "design for colour-blind" and got 
several useful hits, mostly for web designers. The basic message is 
"don't rely on colour to get a message across", which isn't much help 
to you.


One way round this might be to allow the user to select colours for 
the different distinguishable syntax elements (I think this has 
already been suggested somewhere in this thread). And not to make it 
too complicated. I personally get a bit fed up with Frescobaldi's 
colours but being normally-sighted I can live with it.





By "complicated", do you mean the number of
different colors or the complexity of the
distinctions that it tries to make between
syntactical elements while staying within a
limited pool of colors? I think we are touching
a core point.

Thanks,
Jean




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Aaron Hill

On 2022-01-04 1:42 pm, Jean Abou Samra wrote:

https://www.gnu.org/philosophy/javascript-trap.en.html
[ . . . ]
But I'm probably fretting for something that is
very easy in the end.


The code Lilypond's site would use would be entirely homegrown, licensed 
under GPL.  Not sure there is anything here to worry unless we determine 
there is an external dependency that is required.




If we add a toggle for switching highlighting on and
off, then the next question will of course be what
the default should be. Without surprise, I would prefer
if it were on by default, but I wouldn't mind the
other way.


And honestly, I like the default being on, simply because it advertises 
the new feature.  If folks load up the docs and see the familiar black 
and white, they might not know to look for the option to enable 
highlighting.


Perhaps a good strategy would be to initially enable the feature for an 
entire release cycle.  This gets folks using it and providing feedback.  
Most of the discussion so far has been limited in scope so it is hard to 
know if the system works well over the entire manual and for day-to-day 
usage.


I would not be surprised if some creative folks on the list end up 
creating new color schemes to be included as options aside from the 
default.  A dark mode scheme is almost inevitable.




Are you sure about that? This is one page that drew
my attention:

https://law.stackexchange.com/questions/30739/do-the-gdpr-and-cookie-law-regulations-apply-to-localstorage


One of the posts a little further down talks about shopping carts.  The 
way I read this is that when a user is performing an action where 
something being saved is reasonably expected as part of the 
functionality, there is no need to ask permission.  The question we 
would have is whether selecting a color scheme carries an expectation 
that it should persist.



-- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Jean Abou Samra

[Aaron]


On 2022-01-04 11:32 am, Jean Abou Samra wrote:

Always best to consult a lawyer on legal matters.



The wife of my cousin is actually a lawyer.
Sadly (but very happily in fact), she gave
birth yesterday, so she will not be in a position
to answer before a while :-)



My layman understanding is that GDPR generally deals with information 
that passes through servers that might be retained without offering 
some form of end-user control.  Use of localStorage, rather than 
cookies, should mean no settings ever need to be sent to the server.  
Users are entirely in control of this local data, although I suppose 
some browsers make it easier to access than others.


For those with privacy or security concerns, the web site source still 
remains entirely auditable as everything with styling is done local on 
the browser.  And the code in question should be so trivial that there 
is no need to minify/uglify it, so that preserves readability and 
hopefully earns some trust that we are not doing anything shady.




That would also be my expectation, but see below.





Other than that, well, there is still JavaScript.
That's may not be the thing to be most happy about, but
we could check how LibreJS handles that JavaScript,
possibly adding stylized license comments, so that
it would be no problem to those people refusing non-free
JavaScript using LibreJS/IceCat. All in all this approach
does look promising to me.


I think I am not understanding the concerns around licensing.



Me neither :-)

Basically, the root is this:

https://www.gnu.org/philosophy/javascript-trap.en.html

And this gives a bunch of advice for indicating
JavaScript code licenses:

https://www.gnu.org/software/librejs/free-your-javascript.html

Whatever your or my opinion, LilyPond is part of
GNU, so it has to stand with the FSF. Therefore
it is important to keep the website working with
LibreJS.

But I'm probably fretting for something that is
very easy in the end.



At the end of the day, if someone does not want to use JavaScript, 
then the functionality will not work. We should make sure the default 
behavior of the site is sound for such cases, so no one feels they 
have to enable JS if they do not wish.  That might mean the standard 
styling needs to be black and white if that creates the least friction 
for users.



If we add a toggle for switching highlighting on and
off, then the next question will of course be what
the default should be. Without surprise, I would prefer
if it were on by default, but I wouldn't mind the
other way.




Le 04/01/2022 à 21:31, Wol a écrit :

On 04/01/2022 19:32, Jean Abou Samra wrote:

Forgive my igorance with the inner workings of the
Internet: what does this mean in connection with GDPR
and all that? Am I right that the fact that the
information stored on the user's device serves
a purpose essential to satisfying the very request
of the user means that it would fall under PECR
exceptions to the requirement of a banner asking
for explicit consent of the user? Otherwise, as
far as I can read, the requirement is that you
must ask for permission before storing or using
the data, so this permission could be asked
to the reader just when toggling highlighting
and not for everyone reading the documentation,
right? I'm a bit at loss trying to understand
what is OK or not in this respect.


The fact that it's stored on the user's own device (and the server 
never sees it) means that the GDPR is irrelevant.


The GDPR places an onus on you to take appropriate care of OTHER 
PEOPLES' information. If you never have that information, then the 
GDPR is irrelevant. If you only have that information transiently, for 
the purpose of satisfying the user's web session, then I guess you 
just need to make sure that it's wiped when the session ends.


The big problem actually is with the webserver itself. If it keeps 
logs of people accessing the website, those logs are far more of a 
GDPR problem than all this stuff on the web site.




Are you sure about that? This is one page that drew
my attention:

https://law.stackexchange.com/questions/30739/do-the-gdpr-and-cookie-law-regulations-apply-to-localstorage


Emphasis mine:

  Member States shall ensure that the **storing of information**, or
  the gaining of access to information already stored, in the terminal
  equipment of a subscriber or user is only allowed on condition that
  the subscriber or user concerned has given his or her consent, having
  been provided with clear and comprehensive information, in accordance 
with

  Directive 95/46/EC, inter alia, about the purposes of the processing.
  This shall not prevent any technical storage or access for the sole
  purpose of carrying out the transmission of a communication over an
  electronic communications network, or as strictly necessary in order
  for the provider of an information society service explicitly requested
  by the subscriber or user to provide the service.

That is the part I wonder 

Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Wol

On 04/01/2022 19:32, Jean Abou Samra wrote:

Forgive my igorance with the inner workings of the
Internet: what does this mean in connection with GDPR
and all that? Am I right that the fact that the
information stored on the user's device serves
a purpose essential to satisfying the very request
of the user means that it would fall under PECR
exceptions to the requirement of a banner asking
for explicit consent of the user? Otherwise, as
far as I can read, the requirement is that you
must ask for permission before storing or using
the data, so this permission could be asked
to the reader just when toggling highlighting
and not for everyone reading the documentation,
right? I'm a bit at loss trying to understand
what is OK or not in this respect.


The fact that it's stored on the user's own device (and the server never 
sees it) means that the GDPR is irrelevant.


The GDPR places an onus on you to take appropriate care of OTHER 
PEOPLES' information. If you never have that information, then the GDPR 
is irrelevant. If you only have that information transiently, for the 
purpose of satisfying the user's web session, then I guess you just need 
to make sure that it's wiped when the session ends.


The big problem actually is with the webserver itself. If it keeps logs 
of people accessing the website, those logs are far more of a GDPR 
problem than all this stuff on the web site.


Cheers,
Wol



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Aaron Hill

On 2022-01-04 11:32 am, Jean Abou Samra wrote:

Forgive my igorance with the inner workings of the
Internet: what does this mean in connection with GDPR
and all that? Am I right that the fact that the
information stored on the user's device serves
a purpose essential to satisfying the very request
of the user means that it would fall under PECR
exceptions to the requirement of a banner asking
for explicit consent of the user?


Always best to consult a lawyer on legal matters.

My layman understanding is that GDPR generally deals with information 
that passes through servers that might be retained without offering some 
form of end-user control.  Use of localStorage, rather than cookies, 
should mean no settings ever need to be sent to the server.  Users are 
entirely in control of this local data, although I suppose some browsers 
make it easier to access than others.


For those with privacy or security concerns, the web site source still 
remains entirely auditable as everything with styling is done local on 
the browser.  And the code in question should be so trivial that there 
is no need to minify/uglify it, so that preserves readability and 
hopefully earns some trust that we are not doing anything shady.




Other than that, well, there is still JavaScript.
That's may not be the thing to be most happy about, but
we could check how LibreJS handles that JavaScript,
possibly adding stylized license comments, so that
it would be no problem to those people refusing non-free
JavaScript using LibreJS/IceCat. All in all this approach
does look promising to me.


I think I am not understanding the concerns around licensing.

At the end of the day, if someone does not want to use JavaScript, then 
the functionality will not work.  We should make sure the default 
behavior of the site is sound for such cases, so no one feels they have 
to enable JS if they do not wish.  That might mean the standard styling 
needs to be black and white if that creates the least friction for 
users.



-- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Valentin Petzel
Hello Jean,

The code Aaron provided is quite nice, but I suggest to rather use a linked 
stylesheet like



And then use JS like
document.getElementById("syntax-highlighting") = "highlighting1.css"

This results in less complicated JS and allows for multiple styles.

Cheers,
Valentin

Am Dienstag, 4. Jänner 2022, 20:32:50 CET schrieb Jean Abou Samra:
> > [Aaron]
> 
> > It is fairly straightforward with CSS and a little JavaScript:
> Yeah, that is also what I was starting to muse with
> more seriously. Thanks for providing ready-made code.
> 
> Forgive my igorance with the inner workings of the
> Internet: what does this mean in connection with GDPR
> and all that? Am I right that the fact that the
> information stored on the user's device serves
> a purpose essential to satisfying the very request
> of the user means that it would fall under PECR
> exceptions to the requirement of a banner asking
> for explicit consent of the user? Otherwise, as
> far as I can read, the requirement is that you
> must ask for permission before storing or using
> the data, so this permission could be asked
> to the reader just when toggling highlighting
> and not for everyone reading the documentation,
> right? I'm a bit at loss trying to understand
> what is OK or not in this respect.
> 
> Other than that, well, there is still JavaScript.
> That's may not be the thing to be most happy about, but
> we could check how LibreJS handles that JavaScript,
> possibly adding stylized license comments, so that
> it would be no problem to those people refusing non-free
> JavaScript using LibreJS/IceCat. All in all this approach
> does look promising to me.
> 
> 
> [Wol]
> 
> > Is that on the web page, or down to the reader?
> 
> On the web page.
> 
> Regards,
> Jean

signature.asc
Description: This is a digitally signed message part.


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Jean Abou Samra

[Aaron]
It is fairly straightforward with CSS and a little JavaScript:


Yeah, that is also what I was starting to muse with
more seriously. Thanks for providing ready-made code.

Forgive my igorance with the inner workings of the
Internet: what does this mean in connection with GDPR
and all that? Am I right that the fact that the
information stored on the user's device serves
a purpose essential to satisfying the very request
of the user means that it would fall under PECR
exceptions to the requirement of a banner asking
for explicit consent of the user? Otherwise, as
far as I can read, the requirement is that you
must ask for permission before storing or using
the data, so this permission could be asked
to the reader just when toggling highlighting
and not for everyone reading the documentation,
right? I'm a bit at loss trying to understand
what is OK or not in this respect.

Other than that, well, there is still JavaScript.
That's may not be the thing to be most happy about, but
we could check how LibreJS handles that JavaScript,
possibly adding stylized license comments, so that
it would be no problem to those people refusing non-free
JavaScript using LibreJS/IceCat. All in all this approach
does look promising to me.


[Wol]

Is that on the web page, or down to the reader?


On the web page.

Regards,
Jean




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Aaron Hill

On 2022-01-04 10:04 am, Valentin Petzel wrote:

The problem is that we probably want to
remember the set color scheme for longer than just the current page,
so we'd need something like cookies.


Not a problem in the slightest.  But not cookies... localStorage [1].

[1]: 
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage



-- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Valentin Petzel
In fact it is sufficient to have multiple stylesheets and load the one you want 
to switch to. The problem is that we probably want to remember the set color 
scheme for longer than just the current page, so we'd need something like 
cookies.

We could also do this without JS by generating multiple versions of the docs 
referencing different stylesheet.

Of course this would kind of blow up the size of the documentation for changing 
a single line.

Sadly the browser functionality for multiple stylesheets usually consists of an 
obscure list hidden in some menu.

In my opinion the best thing would be if the browser did some notification like 
"This page offers multiple styles" along with some selector. But as things are 
we can only do this either dynamically on the server (which we probably do not 
want), dynamically on the client by JS (which we probably don't want) or 
statically by with multiple versions (which would be rather unelegant).

Cheers,
Valentin

04.01.2022 17:23:59 Aaron Hill :

> On 2022-01-04 7:29 am, Erika Pirnes wrote:
>> Would it be terribly difficult to have a color setting on the
>> documentation page, so that people can choose between black and color?
> 
> It is fairly straightforward with CSS and a little JavaScript:
> 
> 
> 
> 
> 
>    
>    
>    
>    Dynamic styles
>    
>  body { font-size: 36pt; }
>  .button {
>    background: #999; border-radius: 9pt;
>    cursor: pointer; display: inline-block;
>    padding: 9pt; user-select: none;
>  }
>  .colors > code > .type { color: purple; }
>  .colors > code > .identifier { color: blue; }
>  .colors > code > .keyword { color: brown; }
>  .colors > code > .number { color: darkgoldenrod; }
>  .colors > code > .string { color: green; }
>  .colors > code > .punctuation { color: gray; }
>    
> 
> 
>    
>  function toggleColors() {
>    if (document.body.classList.contains('colors')) {
>  document.body.classList.remove('colors');
>    } else {
>  document.body.classList.add('colors');
>    }
>  }
>    
>    Toggle Colors
> 
>    
>  int
>  main() 
> {
>  printf class="punctuation">("Hello, 
> World!\n");
>  return
>  0;
>  }
>    
> 
> 
> 
> 
> -- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Wols Lists

On 04/01/2022 16:23, Aaron Hill wrote:

On 2022-01-04 7:29 am, Erika Pirnes wrote:

Would it be terribly difficult to have a color setting on the
documentation page, so that people can choose between black and color?


It is fairly straightforward with CSS and a little JavaScript:


Is that on the web page, or down to the reader?

I'm only just getting into Google Sheets and GoogleScript so calling it 
"fairly straightforward" is something I'd disagree with if I'm expected 
to do it. Not for somebody who has had no reason to go near 
js/gs/whatever before...


Cheers,
Wol



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Wols Lists

On 04/01/2022 15:14, J Martin Rushton wrote:

OK, I'll admit I only skimmed it, hence "I've saved the paper to read
later"!  I've got Doob's "A Gentle Introduction to TeX" and Oetiker's
"The Not So Short Introduction to LaTeX2e" both of which keep to the
fixed width convention.  Again, I'll be honest, I rarely use them since
I've retired though.


Reading through this, I'd just like to say I think we're confusing two 
things. Iirc someone said "Courier is a crap font" and the discussion 
rapidly veered off into fixed width.


While I have no real comment to make about Courier, and I think there 
are much better fonts out there, I do think we should keep fixed-width 
for code. Just look for a better font :-)


Cheers,
Wol



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Aaron Hill

On 2022-01-04 7:29 am, Erika Pirnes wrote:

Would it be terribly difficult to have a color setting on the
documentation page, so that people can choose between black and color?


It is fairly straightforward with CSS and a little JavaScript:





  
  
  
  Dynamic styles
  
body { font-size: 36pt; }
.button {
  background: #999; border-radius: 9pt;
  cursor: pointer; display: inline-block;
  padding: 9pt; user-select: none;
}
.colors > code > .type { color: purple; }
.colors > code > .identifier { color: blue; }
.colors > code > .keyword { color: brown; }
.colors > code > .number { color: darkgoldenrod; }
.colors > code > .string { color: green; }
.colors > code > .punctuation { color: gray; }
  


  
function toggleColors() {
  if (document.body.classList.contains('colors')) {
document.body.classList.remove('colors');
  } else {
document.body.classList.add('colors');
  }
}
  
  Toggle Colors

  
int
main() 
{
printfclass="punctuation">("Hello, 
World!\n");

return
0;
}
  




-- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Erika Pirnes
I personally find the black text much easier to read than the syntax-highlighed 
one in colors. I still have young eyes, but somehow the colored text feels 
tiring. Maybe this is just what I am used to, as I am still using the standard 
text editor to write my .ly files. Would it be terribly difficult to have a 
color setting on the documentation page, so that people can choose between 
black and color?

Erika


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread J Martin Rushton
OK, I'll admit I only skimmed it, hence "I've saved the paper to read
later"!  I've got Doob's "A Gentle Introduction to TeX" and Oetiker's
"The Not So Short Introduction to LaTeX2e" both of which keep to the
fixed width convention.  Again, I'll be honest, I rarely use them since
I've retired though.

On Tue, 2022-01-04 at 15:48 +0100, David Kastrup wrote:
> J Martin Rushton  writes:
> 
> > Interesting Aaron, but I do note that the paper is from 1983 and
> > didn't
> > catch on.  I wonder if there is a reason for that?  I've saved the
> > paper to read later.  Personally I don't know of a single language
> > that
> > is happy with word processor output as source code, but then I may
> > be
> > proved wrong.  Knuth seems to be addressing issues that have been
> > effectively bypassed by the rise of object orientated code.  I was
> > trained in a macro assembler (VAX-Macro) and am well aware of their
> > advantage for repeated idioms, but if they are just another layer
> > on
> > the top they can merely double the size of the language to master.
> > 
> > In passing, although Knuth uses variable width fonts in the first
> > six
> > pages, I note that as soon as he starts to give firm code on page 7
> > onwards he uses fixed width!
> 
> Uh, you are talking about "D. HOW THE EXAMPLE WAS SPECIFIED" which
> displays the macros used for typesetting the Literate Programming
> example.
> 
> That's sort of like complaining that someone lauding some computer
> language bootstraps his compiler from a different system.
> 
> Knuth has written both TeX and METAFONT entirely in his WEB
> programming
> system for Literate Programming.  I have the printed book for TeX.
> 
> > On Tue, 2022-01-04 at 05:10 -0800, Aaron Hill wrote:
> > > On 2022-01-04 4:19 am, J Martin Rushton wrote:
> > > > Sorry to disagree, but fixed pitch is _so_ much easier to lay
> > > > out
> > > > in an
> > > > editor.  Documentation flows nicely with variable pitch and
> > > > fancy
> > > > hidden formats, but for code (and Lily's input is a programming
> > > > language) you just want the plain line-by-line ASCII.  It is,
> > > > as
> > > > you
> > > > say, industry standard; and that is for a good reason.
> > > 
> > > As a counterpoint, Knuth's work with literate programming [1]
> > > showed
> > > it 
> > > was possible to have typographically beautiful setting of code
> > > for
> > > use 
> > > in print.  His style largely used proportional fonts though some 
> > > elements were still rendered in fixed width to provide useful
> > > contrast.  
> > > While Knuth's approach is not perfect for every language, I argue
> > > the 
> > > vast majority of programming books out there really should have
> > > followed 
> > > suit.  Editors (the people, not programs) seem to struggle with 
> > > fixed-width typefaces, and typos were abundant.
> > > 
> > > Going beyond printed documentation, some IDEs like Source
> > > Insight 
> > > enabled and encouraged programmers to use proportional fonts,
> > > where 
> > > horizontal alignment was something handled by the system not the 
> > > programmer.  Though I do concede this was probably a novelty,
> > > seeing
> > > as 
> > > these days terminals and editors still rely on fixed pitch.
> > > 
> > > [1]: http://www.literateprogramming.com/knuthweb.pdf
> > > 
> > > 
> > > -- Aaron Hill
-- 
J Martin Rushton MBCS




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread David Kastrup
J Martin Rushton  writes:

> Interesting Aaron, but I do note that the paper is from 1983 and didn't
> catch on.  I wonder if there is a reason for that?  I've saved the
> paper to read later.  Personally I don't know of a single language that
> is happy with word processor output as source code, but then I may be
> proved wrong.  Knuth seems to be addressing issues that have been
> effectively bypassed by the rise of object orientated code.  I was
> trained in a macro assembler (VAX-Macro) and am well aware of their
> advantage for repeated idioms, but if they are just another layer on
> the top they can merely double the size of the language to master.
>
> In passing, although Knuth uses variable width fonts in the first six
> pages, I note that as soon as he starts to give firm code on page 7
> onwards he uses fixed width!

Uh, you are talking about "D. HOW THE EXAMPLE WAS SPECIFIED" which
displays the macros used for typesetting the Literate Programming
example.

That's sort of like complaining that someone lauding some computer
language bootstraps his compiler from a different system.

Knuth has written both TeX and METAFONT entirely in his WEB programming
system for Literate Programming.  I have the printed book for TeX.

>
> On Tue, 2022-01-04 at 05:10 -0800, Aaron Hill wrote:
>> On 2022-01-04 4:19 am, J Martin Rushton wrote:
>> > Sorry to disagree, but fixed pitch is _so_ much easier to lay out
>> > in an
>> > editor.  Documentation flows nicely with variable pitch and fancy
>> > hidden formats, but for code (and Lily's input is a programming
>> > language) you just want the plain line-by-line ASCII.  It is, as
>> > you
>> > say, industry standard; and that is for a good reason.
>> 
>> As a counterpoint, Knuth's work with literate programming [1] showed
>> it 
>> was possible to have typographically beautiful setting of code for
>> use 
>> in print.  His style largely used proportional fonts though some 
>> elements were still rendered in fixed width to provide useful
>> contrast.  
>> While Knuth's approach is not perfect for every language, I argue
>> the 
>> vast majority of programming books out there really should have
>> followed 
>> suit.  Editors (the people, not programs) seem to struggle with 
>> fixed-width typefaces, and typos were abundant.
>> 
>> Going beyond printed documentation, some IDEs like Source Insight 
>> enabled and encouraged programmers to use proportional fonts, where 
>> horizontal alignment was something handled by the system not the 
>> programmer.  Though I do concede this was probably a novelty, seeing
>> as 
>> these days terminals and editors still rely on fixed pitch.
>> 
>> [1]: http://www.literateprogramming.com/knuthweb.pdf
>> 
>> 
>> -- Aaron Hill

-- 
David Kastrup



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Valentin Petzel
Hello Robin,

as far as I know the Lilypond Documentation does not specify the font to be 
used for this. So the system defaults to a standard monospace font.

So the font will depend on the system. We could ship a dedicated font with the 
documentation, but I'm not sure if we want that.

Cheers,
Valentin

04.01.2022 13:01:47 Robin Bannister :

> 
> 'Hear hear' to these recent posts from Thomas, Paul and the two Davids!
> 
> I don't object to the fixed width, but the code font has always been spindly 
> compared to the rest of the documentation text.  I find this makes it harder 
> to read anyway.
> 
> The stroke width I see is 1px (Firefox at 100%).  This makes the stroke 
> dominated by edge effects; the surrounding white dilutes its colour.
> Do the WCAG recommendations recognise this?  If not, please don't apply their 
> levels to this case.
> 
> 
> The demo shows me text that is slightly discoloured.  The differences in 
> colour are so vague that they require attention.  Attention to the 
> differences detracts from attention to the colours.  I don't get as far as 
> judging if attention to the colours aids attention to the text.
> 
> 
> Cheers,
> Robin



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread J Martin Rushton
Interesting Aaron, but I do note that the paper is from 1983 and didn't
catch on.  I wonder if there is a reason for that?  I've saved the
paper to read later.  Personally I don't know of a single language that
is happy with word processor output as source code, but then I may be
proved wrong.  Knuth seems to be addressing issues that have been
effectively bypassed by the rise of object orientated code.  I was
trained in a macro assembler (VAX-Macro) and am well aware of their
advantage for repeated idioms, but if they are just another layer on
the top they can merely double the size of the language to master.

In passing, although Knuth uses variable width fonts in the first six
pages, I note that as soon as he starts to give firm code on page 7
onwards he uses fixed width!

On Tue, 2022-01-04 at 05:10 -0800, Aaron Hill wrote:
> On 2022-01-04 4:19 am, J Martin Rushton wrote:
> > Sorry to disagree, but fixed pitch is _so_ much easier to lay out
> > in an
> > editor.  Documentation flows nicely with variable pitch and fancy
> > hidden formats, but for code (and Lily's input is a programming
> > language) you just want the plain line-by-line ASCII.  It is, as
> > you
> > say, industry standard; and that is for a good reason.
> 
> As a counterpoint, Knuth's work with literate programming [1] showed
> it 
> was possible to have typographically beautiful setting of code for
> use 
> in print.  His style largely used proportional fonts though some 
> elements were still rendered in fixed width to provide useful
> contrast.  
> While Knuth's approach is not perfect for every language, I argue
> the 
> vast majority of programming books out there really should have
> followed 
> suit.  Editors (the people, not programs) seem to struggle with 
> fixed-width typefaces, and typos were abundant.
> 
> Going beyond printed documentation, some IDEs like Source Insight 
> enabled and encouraged programmers to use proportional fonts, where 
> horizontal alignment was something handled by the system not the 
> programmer.  Though I do concede this was probably a novelty, seeing
> as 
> these days terminals and editors still rely on fixed pitch.
> 
> [1]: http://www.literateprogramming.com/knuthweb.pdf
> 
> 
> -- Aaron Hill
-- 
J Martin Rushton MBCS




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Aaron Hill

On 2022-01-04 4:19 am, J Martin Rushton wrote:

Sorry to disagree, but fixed pitch is _so_ much easier to lay out in an
editor.  Documentation flows nicely with variable pitch and fancy
hidden formats, but for code (and Lily's input is a programming
language) you just want the plain line-by-line ASCII.  It is, as you
say, industry standard; and that is for a good reason.


As a counterpoint, Knuth's work with literate programming [1] showed it 
was possible to have typographically beautiful setting of code for use 
in print.  His style largely used proportional fonts though some 
elements were still rendered in fixed width to provide useful contrast.  
While Knuth's approach is not perfect for every language, I argue the 
vast majority of programming books out there really should have followed 
suit.  Editors (the people, not programs) seem to struggle with 
fixed-width typefaces, and typos were abundant.


Going beyond printed documentation, some IDEs like Source Insight 
enabled and encouraged programmers to use proportional fonts, where 
horizontal alignment was something handled by the system not the 
programmer.  Though I do concede this was probably a novelty, seeing as 
these days terminals and editors still rely on fixed pitch.


[1]: http://www.literateprogramming.com/knuthweb.pdf


-- Aaron Hill



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread J Martin Rushton
Paul,
Sorry to disagree, but fixed pitch is _so_ much easier to lay out in an
editor.  Documentation flows nicely with variable pitch and fancy
hidden formats, but for code (and Lily's input is a programming
language) you just want the plain line-by-line ASCII.  It is, as you
say, industry standard; and that is for a good reason.
Regards,MartinOn Tue, 2022-01-04 at 10:14 +, Paul McKay wrote:
> Hi
> Speaking as someone whose eyesight isn't quite as good as it used to
> be, I'd like to suggest that anything in a colour is also in bold so
> that there are enough pixels for me to see what the colour is. 
> 
> And this seems the appropriate place to ask why the examples are all
> in fixed pitch Courier in any case. I know this is kind of  industry
> standard but it's one I don't find particularly helpful. I was once
> adept on the card punch machines and mechanical typewriters, but I
> think most of us abandoned fixed pitch fonts long, long ago. I'd
> suggest a sans serif font so that there's a clear contrast with the
> Georgia used as the text font in the documentation. Helvetica,
> Franklin Gothic and Source Sans Pro look good but I realize they
> might not be available on some platforms.
> 
> HTH
> Paul McKay
> 
> On Mon, 3 Jan 2022 at 23:33, David Kastrup  wrote:
> > Flaming Hakama by Elaine  writes:
> > 
> > 
> > 
> > > In this sense, it seems like the place that has the most
> > potential use
> > 
> > > for helping people distinguish different data types is where the
> > 
> > > syntax is the most complicated and dense, which is in music
> > entry.
> > 
> > >
> > 
> > > The ability to quickly distinguish articulations, dynamics,
> > notes, and
> > 
> > > durations seems like it would probably be most useful to people
> > 
> > > reading examples in docs, since that is the most unusual aspect
> > of
> > 
> > > lilypond syntax.
> > 
> > 
> > 
> > I find splitting a8 into different colors about as helpful for
> > reading
> > 
> > music as coloring note stems differently would be for reading score
> > 
> > sheets: there is a standard place they are attached to anyway and
> > there
> > 
> > is no particular reason to look elsewhere.
> > 
> > 
> > 
> > It would be much more useful to highlight note lengths separated by
> > 
> > space but still common to a preceding note or rest, like
> > 
> > 
> > 
> > \drummode { bd4 r r 4. 8 }
> > 
> > 
> > 
> > where the 4. is sucked into the second r likely unintentionally.
> > 
> > Highlighting this is helpful.  When there is a general "angry fruit
> > 
> > salad" flavor pervading the highlighting with lots of colors
> > everywhere,
> > 
> > there just is not a lot of attention one can draw to actually
> > important
> > 
> > things.
> > 
> > 
> > 
-- 
J Martin Rushton MBCS


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Robin Bannister



'Hear hear' to these recent posts from Thomas, Paul and the two Davids!

I don't object to the fixed width, but the code font has always been 
spindly compared to the rest of the documentation text.  I find this 
makes it harder to read anyway.


The stroke width I see is 1px (Firefox at 100%).  This makes the stroke 
dominated by edge effects; the surrounding white dilutes its colour.
Do the WCAG recommendations recognise this?  If not, please don't apply 
their levels to this case.



The demo shows me text that is slightly discoloured.  The differences in 
colour are so vague that they require attention.  Attention to the 
differences detracts from attention to the colours.  I don't get as far 
as judging if attention to the colours aids attention to the text.



Cheers,
Robin



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Thomas Morley
Am Di., 4. Jan. 2022 um 11:15 Uhr schrieb Paul McKay :
>
> Hi
> Speaking as someone whose eyesight isn't quite as good as it used to be,

Same problem here

> I'd like to suggest that anything in a colour is also in bold so that there 
> are enough pixels for me to see what the colour is.

I'd go even further, why not all bold, apart from comments?
At least that's the way I configured my own editor.

I don't have strong feelings about colors, though. My own
configuration is indeed like "angry fruit salad", but I doubt there
will be any setting satisfying everyone.

Cheers,
  Harm



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-04 Thread Paul McKay
Hi
Speaking as someone whose eyesight isn't quite as good as it used to be,
I'd like to suggest that anything in a colour is also in bold so that there
are enough pixels for me to see what the colour is.

And this seems the appropriate place to ask why the examples are all in
fixed pitch Courier in any case. I know this is kind of  industry standard
but it's one I don't find particularly helpful. I was once adept on the
card punch machines and mechanical typewriters, but I think most of us
abandoned fixed pitch fonts long, long ago. I'd suggest a sans serif font
so that there's a clear contrast with the Georgia used as the text font in
the documentation. Helvetica, Franklin Gothic and Source Sans Pro look good
but I realize they might not be available on some platforms.

HTH
Paul McKay

On Mon, 3 Jan 2022 at 23:33, David Kastrup  wrote:

> Flaming Hakama by Elaine  writes:
>
> > In this sense, it seems like the place that has the most potential use
> > for helping people distinguish different data types is where the
> > syntax is the most complicated and dense, which is in music entry.
> >
> > The ability to quickly distinguish articulations, dynamics, notes, and
> > durations seems like it would probably be most useful to people
> > reading examples in docs, since that is the most unusual aspect of
> > lilypond syntax.
>
> I find splitting a8 into different colors about as helpful for reading
> music as coloring note stems differently would be for reading score
> sheets: there is a standard place they are attached to anyway and there
> is no particular reason to look elsewhere.
>
> It would be much more useful to highlight note lengths separated by
> space but still common to a preceding note or rest, like
>
> \drummode { bd4 r r 4. 8 }
>
> where the 4. is sucked into the second r likely unintentionally.
> Highlighting this is helpful.  When there is a general "angry fruit
> salad" flavor pervading the highlighting with lots of colors everywhere,
> there just is not a lot of attention one can draw to actually important
> things.
>
> --
> David Kastrup
>
>


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-03 Thread David Kastrup
Flaming Hakama by Elaine  writes:

> In this sense, it seems like the place that has the most potential use
> for helping people distinguish different data types is where the
> syntax is the most complicated and dense, which is in music entry.
>
> The ability to quickly distinguish articulations, dynamics, notes, and
> durations seems like it would probably be most useful to people
> reading examples in docs, since that is the most unusual aspect of
> lilypond syntax.

I find splitting a8 into different colors about as helpful for reading
music as coloring note stems differently would be for reading score
sheets: there is a standard place they are attached to anyway and there
is no particular reason to look elsewhere.

It would be much more useful to highlight note lengths separated by
space but still common to a preceding note or rest, like

\drummode { bd4 r r 4. 8 }

where the 4. is sucked into the second r likely unintentionally.
Highlighting this is helpful.  When there is a general "angry fruit
salad" flavor pervading the highlighting with lots of colors everywhere,
there just is not a lot of attention one can draw to actually important
things.

-- 
David Kastrup



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-03 Thread Flaming Hakama by Elaine
>
> Am Sonntag, 2. Jänner 2022, 01:06:35 CET schrieb David Kastrup:
> > Jean Abou Samra  writes:
> > > Hi all,
> > >
> > > There is an ongoing proposal to add syntax highlighting
> > > in LilyPond's documentation. Since it is a notable change
> > > to the documentation reading experience, user feedback would
> > > be appreciated. You can browse a syntax-highlighted version
> > > of the notation manual here:
> > >
> > > http://abou-samra.fr/highlighting-demo/notation/index.html
> > >
> > > For comparison, this is the current notation manual:
> > >
> > > https://lilypond.org/doc/v2.23/Documentation/notation/index.html
> > >
> > > The main questions are: what do you think of the principle?
> > > And is the color scheme good enough?
> >
> > I just followed the discussion without much attention because I did not
> > think that it would affect me whether or not there was syntax
> > highlighting.  That probably was a mistake.  Taking a random
> example:___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user



In general, I think syntax highlighting is a good idea.

However, I would say that the backslash prefix already provides a level of
baked-in syntactic self-highlighting.  Using color to reinforce anything
with a backslash seems unnecessary, and potentially dilutes the
opportunities to have a meaningful palette, since a smaller palette is
easier to comprehend.

I'm not sure the distinction between categories of things like \layout,
\override, and \relative is what adds value.

However, I will say that if it is possible to tag it as such, we should.
It is better to have the ability to style against it in case someone wants
to customize it.  It is easy enough to have the default styling show them
all the same if that ends up being what is desired.

What I do find useful is the coloring of reserved words, such as objects
like Staff, properties like baseMoment, string literals, bare words that
are expected arguments, like volta, and clef names.

In this sense, it seems like the place that has the most potential use for
helping people distinguish different data types is where the syntax is the
most complicated and dense, which is in music entry.

The ability to quickly distinguish articulations, dynamics, notes, and
durations seems like it would probably be most useful to people reading
examples in docs, since that is the most unusual aspect of lilypond syntax.


Thanks,

Elaine Alt
415 . 341 .4954   "*Confusion is
highly underrated*"
ela...@flaminghakama.com
Producer ~ Composer ~ Instrumentalist ~ Educator
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-03 Thread David Zelinsky
Jean Abou Samra  writes:

> Hi all,
>
> There is an ongoing proposal to add syntax highlighting
> in LilyPond's documentation. Since it is a notable change
> to the documentation reading experience, user feedback would
> be appreciated. You can browse a syntax-highlighted version
> of the notation manual here:
>
> http://abou-samra.fr/highlighting-demo/notation/index.html
>
> For comparison, this is the current notation manual:
>
> https://lilypond.org/doc/v2.23/Documentation/notation/index.html
>
> The main questions are: what do you think of the principle?
> And is the color scheme good enough?
>
> Thanks in advance,
> Jean


For the short snippets in the manual, I find the synatx highlighting
more distracting than helpful.  I personally would prefer it without.  I
do use syntax highlighting when editing files and find it very useful,
but that's when there are large blocks of code, and the highlighting is
helpful for visually parsing it.

-David




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-03 Thread Peter Toye
Jean,
 
There are various types of colour-blindness - red-green is the most common. I 
did a quick Google on "design for colour-blind" and got several useful hits, 
mostly for web designers. The basic message is "don't rely on colour to get a 
message across", which isn't much help to you.
 
One way round this might be to allow the user to select colours for the 
different distinguishable syntax elements (I think this has already been 
suggested somewhere in this thread). And not to make it too complicated. I 
personally get a bit fed up with Frescobaldi's colours but being 
normally-sighted I can live with it.


Best regards,

Peter
mailto:lilyp...@ptoye.com
www.ptoye.com

-
Sunday, January 2, 2022, 5:01:11 PM, lilypond-user-requ...@gnu.org wrote:

> Send lilypond-user mailing list submissions to
>         lilypond-user@gnu.org

> To subscribe or unsubscribe via the World Wide Web, visit
>         https://lists.gnu.org/mailman/listinfo/lilypond-user
> or, via email, send a message with subject or body 'help' to
>         lilypond-user-requ...@gnu.org

> You can reach the person managing the list at
>         lilypond-user-ow...@gnu.org

> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of lilypond-user digest..."


> Today's Topics:

>    1. Re: Feedback wanted: syntax highlighting in the LilyPond
>       documentation (Wols Lists)
>    2. Re: Feedback wanted: syntax highlighting in the LilyPond
>       documentation (Jean Abou Samra)


> --

> Message: 1
> Date: Sun, 2 Jan 2022 16:24:39 +0000
> From: Wols Lists 
> To: lilypond-user@gnu.org
> Subject: Re: Feedback wanted: syntax highlighting in the LilyPond
>         documentation
> Message-ID: <0578c098-ae48-ac16-f8ae-79ef71076...@youngman.org.uk>
> Content-Type: text/plain; charset=UTF-8; format=flowed

> On 02/01/2022 09:34, Marc Lanoisel?e via LilyPond user discussion wrote:
>> It will be necessary to keep an uncolored version for men (in principle 
>> women do not have this problem) who do not see well certain colors.

> In principle (and practice) women DO suffer this problem. It's caused by 
> a defective X chromosome so, like haemophilia, the majority of sufferers 
> are men. If however a colour-blind man marries a carrier woman, any 
> daughter runs a 50-50 risk of being colour-blind.

> Cheers,
> Wol



> --

> Message: 2
> Date: Sun, 2 Jan 2022 17:32:32 +0100
> From: Jean Abou Samra 
> To: Knute Snortum 
> Cc: Lilypond-User Mailing List 
> Subject: Re: Feedback wanted: syntax highlighting in the LilyPond
>         documentation
> Message-ID: <5ceaea96-eda8-45bb-82bf-896733085...@abou-samra.fr>
> Content-Type: text/plain; charset=UTF-8; format=flowed

> Le 02/01/2022 ? 17:01, Knute Snortum a ?crit?:
>> On Sun, Jan 2, 2022 at 7:10 AM Jean Abou Samra  wrote:
>> ...
>>> [Marc]
>>>> It will be necessary to keep an uncolored version for men (in
>>>> principle women do not have this problem) who do not see well certain
>>>> colors.
>>> This is taken care of -- the colors have been
>>> chosen to have enough contrast to the white
>>> background to be readable even for those
>>> with impaired vision. Since I am not such a
>>> person, I have been checking the scheme against
>>> WCAG recommendations. The color with least
>>> contrast has 6.15, which is quite a bit
>>> above the WCAG AA level of 4.5. This means that
>>> even someone not discerning colors at all
>>> can read such highlighted code.
>> I am colorblind (which BTW means that it's hard to distinguish certain
>> colors, not that everything is gray).


> Sorry if I gave a wrong impression. I didn't
> mean that everything actually looked gray, just
> that it was the extreme imaginary case encompassing
> all types of colorblindness (I think there are
> different ones, right?).


>> I can't see a difference
>> between the blue and the purple, but this doesn't cause a problem for
>> me -- I just miss some of the highlighting, which is unavoidable.  The
>> bold terms jump out at me, but the coloration seems reasonable.  All
>> in all, the scheme seems reasonable to me.


> Thanks for the input! That's reassuring.

> Best regards,
> Jean




> --

> Subject: Digest Footer

> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user


> --

> End of lilypond-user Digest, Vol 230, Issue 10
> **

Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Wols Lists

On 02/01/2022 16:32, Jean Abou Samra wrote:



I am colorblind (which BTW means that it's hard to distinguish certain
colors, not that everything is gray).



Sorry if I gave a wrong impression. I didn't
mean that everything actually looked gray, just
that it was the extreme imaginary case encompassing
all types of colorblindness (I think there are
different ones, right?).


Yup. The eye contains four detectors, one for brightness, and one each 
for the three primary colours which I believe are Red, GREEN and Blue.


I've never heard of the brightness detector being missing - this gives 
us night vision and our sense of how bright the light is. I think any of 
the other three missing gives us our typical colour blindnesses.


And I'm guessing here, but I suspect Red/Green blindness is caused by a 
missing/faulty red detector, so the green detector strays into the red 
spectrum.


(Insects and birds, I believe, have a fourth colour detector for 
ultra-violet, while other animals have an infra-red detector.)


Cheers,
Wol



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Jean Abou Samra

Le 02/01/2022 à 17:01, Knute Snortum a écrit :

On Sun, Jan 2, 2022 at 7:10 AM Jean Abou Samra  wrote:
...

[Marc]

It will be necessary to keep an uncolored version for men (in
principle women do not have this problem) who do not see well certain
colors.


This is taken care of -- the colors have been
chosen to have enough contrast to the white
background to be readable even for those
with impaired vision. Since I am not such a
person, I have been checking the scheme against
WCAG recommendations. The color with least
contrast has 6.15, which is quite a bit
above the WCAG AA level of 4.5. This means that
even someone not discerning colors at all
can read such highlighted code.

I am colorblind (which BTW means that it's hard to distinguish certain
colors, not that everything is gray).



Sorry if I gave a wrong impression. I didn't
mean that everything actually looked gray, just
that it was the extreme imaginary case encompassing
all types of colorblindness (I think there are
different ones, right?).



I can't see a difference
between the blue and the purple, but this doesn't cause a problem for
me -- I just miss some of the highlighting, which is unavoidable.  The
bold terms jump out at me, but the coloration seems reasonable.  All
in all, the scheme seems reasonable to me.



Thanks for the input! That's reassuring.

Best regards,
Jean




Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Wols Lists

On 02/01/2022 09:34, Marc Lanoiselée via LilyPond user discussion wrote:
It will be necessary to keep an uncolored version for men (in principle 
women do not have this problem) who do not see well certain colors.


In principle (and practice) women DO suffer this problem. It's caused by 
a defective X chromosome so, like haemophilia, the majority of sufferers 
are men. If however a colour-blind man marries a carrier woman, any 
daughter runs a 50-50 risk of being colour-blind.


Cheers,
Wol



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Knute Snortum
On Sun, Jan 2, 2022 at 7:10 AM Jean Abou Samra  wrote:
>
...
> [Marc]
> > It will be necessary to keep an uncolored version for men (in
> > principle women do not have this problem) who do not see well certain
> > colors.
>
>
> This is taken care of -- the colors have been
> chosen to have enough contrast to the white
> background to be readable even for those
> with impaired vision. Since I am not such a
> person, I have been checking the scheme against
> WCAG recommendations. The color with least
> contrast has 6.15, which is quite a bit
> above the WCAG AA level of 4.5. This means that
> even someone not discerning colors at all
> can read such highlighted code.

I am colorblind (which BTW means that it's hard to distinguish certain
colors, not that everything is gray).  I can't see a difference
between the blue and the purple, but this doesn't cause a problem for
me -- I just miss some of the highlighting, which is unavoidable.  The
bold terms jump out at me, but the coloration seems reasonable.  All
in all, the scheme seems reasonable to me.

--
Knute Snortum



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Jean Abou Samra

Le 02/01/2022 à 10:16, Valentin Petzel a écrit :

Hello Jean,

What I’ve done here is:

1) Make any macro that has a structural character bold. This helps in quickly
understanding the basic structure of the document. \tuplet is just a simple
music function with no real structural importance, so it is not bold. Of
course it is arguable if something like \relative or \bar should be considered
as structurally important.



The problem with that is that there are hundreds
of commands. I don't want to decide for each one
if it is structural or not. This is also an issue
of maintainability of the autogenerated list of
builtins. Why not bold for music commands, but then
I think we should use it for all of them.



2) Get rid of bright, light highlighting of numbers. Here we might say that
duration indications are structurally important, so we might handle these
differently. And of course we can use color for numbers, but it should not
contrast to much with the surrounding colours (which is mainly black and dark
blue). See the appended images for an example with a hint of turquoise.



OK, I take note of the turquoise idea (inspired
from Frescobaldi, right?) which looks good. Note
that it's not feasible to highlight numbers differently
from durations since a bare "8" is always taken as a
number (because it's hard to distinguish in
general, e.g. \repeat unfold 8 vs. \skip 8).



3) Break up the color of property paths to make them structurally more
readable. Of course we can color the properties, but we might want to use a
color that is slightly (but not too much) different from the color for the
Grob. Again, check out the appended images for an example.


I'm not super keen about this one.  The
idea is to mark that grob properties belong
to grobs and context properties belong
to contexts in an attempt to help the user
get the distinction, so grobs and grob properties
are highlighted the same, and contexts and context
properties ditto. Maybe we could use bold for
grob/context names and non-bold for property
names? (An earlier version did that.)



I have now also thought that there is no real reason to introduce a whole new
color for something like \Voice.


Well, it depends on what you call a whole new
color -- it's used on articulations on that
same example, and elsewhere it is the color for
all context names. Can you try the new_style.py
script? That will get you working on a collection
of examples instead of fine-tuning a single one.



[Marc]
It will be necessary to keep an uncolored version for men (in 
principle women do not have this problem) who do not see well certain 
colors.



This is taken care of -- the colors have been
chosen to have enough contrast to the white
background to be readable even for those
with impaired vision. Since I am not such a
person, I have been checking the scheme against
WCAG recommendations. The color with least
contrast has 6.15, which is quite a bit
above the WCAG AA level of 4.5. This means that
even someone not discerning colors at all
can read such highlighted code.


[ebenezer]

Hi Jean,

I like the idea that it should be possible.

I would like for it to be (easily) customisable.



Well, it is built in a customizable way, see
the reply above to Calvin. The technique is
the same as to change the highlighting on,
say, Wikipedia.


I already have a text editor colour scheme that I use for music, for 
parts and scores I have found it is not so important.


My perspective is that I only need colour for highlighting key items 
within music such as \time, \tempo, comments, \override, bar lines and 
'beat space'; beat space is 2 white spaces that I use to delineate 
music within a measure, I find having this as bright white on a pale 
silver background really helps.



That's a bit tricky because the lexer doesn't recognize
double spaces specially. The customizability you get
is on the colors used for the different categories, not
on the classification itself. However, this is not
really a problem here because the LilyPond
documentation does not use this convention of
double spaces. If you want to use the highlighting
in your own documents, see
https://lists.gnu.org/archive/html/lilypond-user/2021-11/msg00418.html
You can tweak the lexer by subclassing it in Python, read
https://pygments.org/docs/lexerdevelopment/#subclassing-lexers-derived-from-regexlexer
for how to do that. (But be prepared to discover
that recognizing LilyPond syntax is not as easy
as it might seem.)




Thank you for throwing this out there, and sorry that you will have 
1001 conflicting opinions on how to progress!



I already have. :-)



Good luck.



Thanks!


Jean



Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread ebenezer

Hi Jean,

I like the idea that it should be possible.

I would like for it to be (easily) customisable.

I already have a text editor colour scheme that I use for music, for 
parts and scores I have found it is not so important.


My perspective is that I only need colour for highlighting key items 
within music such as \time, \tempo, comments, \override, bar lines and 
'beat space'; beat space is 2 white spaces that I use to delineate music 
within a measure, I find having this as bright white on a pale silver 
background really helps.


Thank you for throwing this out there, and sorry that you will have 1001 
conflicting opinions on how to progress!


Good luck.


On 2022-01-01 23:45, Jean Abou Samra wrote:

Hi all,

There is an ongoing proposal to add syntax highlighting
in LilyPond's documentation. Since it is a notable change
to the documentation reading experience, user feedback would
be appreciated. You can browse a syntax-highlighted version
of the notation manual here:

http://abou-samra.fr/highlighting-demo/notation/index.html

For comparison, this is the current notation manual:

https://lilypond.org/doc/v2.23/Documentation/notation/index.html

The main questions are: what do you think of the principle?
And is the color scheme good enough?

Thanks in advance,
Jean







Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Marc Lanoiselée via LilyPond user discussion



Le 02/01/2022 à 05:52, Jean Abou Samra a écrit :

Le 02/01/2022 à 01:06, David Kastrup a écrit :

Jean Abou Samra writes:


Hi all,

There is an ongoing proposal to add syntax highlighting
in LilyPond's documentation. Since it is a notable change
to the documentation reading experience, user feedback would
be appreciated. You can browse a syntax-highlighted version
of the notation manual here:

http://abou-samra.fr/highlighting-demo/notation/index.html

For comparison, this is the current notation manual:

https://lilypond.org/doc/v2.23/Documentation/notation/index.html

The main questions are: what do you think of the principle?
And is the color scheme good enough?

I just followed the discussion without much attention because I did not
think that it would affect me whether or not there was syntax
highlighting.  That probably was a mistake.  Taking a random example:


There is a wild mixture of colors and font styles without apparent rhyme
or reason.  I don't see that it helps legibility or conveys any useful
categories.  I cannot even figure out what it thinks it is doing.

\layout, \context, \remove are reserved words in the syntax and are
printed in boldface and black.  So is \override which is printed in
normalface blue, like \relative and \repeat.  But \relative is a music
function while \repeat is a reserved word.  Beam.breakable is printed in
red while unfold is printed in blue.



While you and me have the perspective of parser
keywords vs. music functions, I think we can agree
that this is mostly irrelevant to highlighting.
A typical user does not need or want to care
whether \repeat is implemented as a token or a
music function, and probably does not know the
difference anyway (until they try to redefine it,
in which case the lexer gives them a friendly warning).
What is relevant is clearly the function in input.
From this perspective, the highlighting applies one
rule of thumb: what yields an articulation is purple,
everything else that yields music is blue. From this
point of view, the example you show is consistent.
The case of \override in a context definition is
somewhat special since it bypasses music, but it
would be awkward to have it in a different color than
\override in the flow of music, particularly since
something like \once \override in a context definition
works via music (and we briefly discussed making
\override work the same some months ago).

However, because all rules are there to be broken,
there are notable exceptions to the "what yields
music is blue" rule, such as \new. There are two reasons
to this. One is that \new pairs with \context in music,
but \context should really be a keyword in output
definitions, and the lexer does not (yet) try to
distinguish between these cases. The other reason is
that \new drives the structure of many examples
and highlighting it in bold seemed to help grasping
good enough a number of them to be worth an exception.
So this is basically an admittedly handwaving reasoning
of "you want to see this first because it is an
important structuring element". Other important
such exceptions are mode switchers such as \addlyrics
and friends. Now, Valentin proposes a scheme where
(most?) music functions are bold too, so this could
be reconsidered.

unfold is blue because it's considered part of
the essence of the "\repeat something" command. It
don't pretend that is the best choice, and since I
eventually decided not to highlight clef names in
blue I should likely revert it.

Beam.breakable is red like all grob property paths.



There is apparently a large collection of colors



To be exact, five colors in total if you count
grey. That's not exactly what I would call a
large collection ...



and some font styles



Just bold for keywords. Nothing more.


[snipped]


[Valentin]


Hello Jean, hello David,

I do like the idea, but I do agree with David to some extent. Syntax
highlighting should emphasize the structure of the file and thus make 
reading
easier. But if it gets too colorful in terms of contrast of colors 
the colors

simply distract you.

For example there is no good reason for coloring all numbers some 
outstanding
way. Frescobaldi does this, but that just creates distracting dots of 
color in
the code. And numbers tend to be quite discernible, so you do not 
really need

a special color to mark them.



It seemed to help discerning articulations such as [(
from dotted durations and also those with multipliers.
Not that it matters so much to me though. Or perhaps
I should use a less bright color?


That being said your color scheme is much better than Frescobaldi’s 
scheme,
which is appallingly distracting. See the appended file for a 
comparison of

Frescobaldi and KDE Kate (which is by no means perfect, but at least an
improvement...).

I think your color scheme could be improved easily by doing something 
like in

the other screenshot (taking the same snippet as David).



Ok, thanks for trying o

Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Valentin Petzel
Here are the appended images. That’s the problem if you quickly send the mail 
because you need to do something.

Cheers,
Valentin

signature.asc
Description: This is a digitally signed message part.


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-02 Thread Valentin Petzel
Hello Jean,

What I’ve done here is:

1) Make any macro that has a structural character bold. This helps in quickly 
understanding the basic structure of the document. \tuplet is just a simple 
music function with no real structural importance, so it is not bold. Of 
course it is arguable if something like \relative or \bar should be considered 
as structurally important.

2) Get rid of bright, light highlighting of numbers. Here we might say that 
duration indications are structurally important, so we might handle these 
differently. And of course we can use color for numbers, but it should not 
contrast to much with the surrounding colours (which is mainly black and dark 
blue). See the appended images for an example with a hint of turquoise.

3) Break up the color of property paths to make them structurally more 
readable. Of course we can color the properties, but we might want to use a 
color that is slightly (but not too much) different from the color for the 
Grob. Again, check out the appended images for an example.

I have now also thought that there is no real reason to introduce a whole new 
color for something like \Voice.

Cheers,
Valentin

signature.asc
Description: This is a digitally signed message part.


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-01 Thread Jean Abou Samra

Le 02/01/2022 à 01:06, David Kastrup a écrit :

Jean Abou Samra  writes:


Hi all,

There is an ongoing proposal to add syntax highlighting
in LilyPond's documentation. Since it is a notable change
to the documentation reading experience, user feedback would
be appreciated. You can browse a syntax-highlighted version
of the notation manual here:

http://abou-samra.fr/highlighting-demo/notation/index.html

For comparison, this is the current notation manual:

https://lilypond.org/doc/v2.23/Documentation/notation/index.html

The main questions are: what do you think of the principle?
And is the color scheme good enough?

I just followed the discussion without much attention because I did not
think that it would affect me whether or not there was syntax
highlighting.  That probably was a mistake.  Taking a random example:


There is a wild mixture of colors and font styles without apparent rhyme
or reason.  I don't see that it helps legibility or conveys any useful
categories.  I cannot even figure out what it thinks it is doing.

\layout, \context, \remove are reserved words in the syntax and are
printed in boldface and black.  So is \override which is printed in
normalface blue, like \relative and \repeat.  But \relative is a music
function while \repeat is a reserved word.  Beam.breakable is printed in
red while unfold is printed in blue.



While you and me have the perspective of parser
keywords vs. music functions, I think we can agree
that this is mostly irrelevant to highlighting.
A typical user does not need or want to care
whether \repeat is implemented as a token or a
music function, and probably does not know the
difference anyway (until they try to redefine it,
in which case the lexer gives them a friendly warning).
What is relevant is clearly the function in input.
From this perspective, the highlighting applies one
rule of thumb: what yields an articulation is purple,
everything else that yields music is blue. From this
point of view, the example you show is consistent.
The case of \override in a context definition is
somewhat special since it bypasses music, but it
would be awkward to have it in a different color than
\override in the flow of music, particularly since
something like \once \override in a context definition
works via music (and we briefly discussed making
\override work the same some months ago).

However, because all rules are there to be broken,
there are notable exceptions to the "what yields
music is blue" rule, such as \new. There are two reasons
to this. One is that \new pairs with \context in music,
but \context should really be a keyword in output
definitions, and the lexer does not (yet) try to
distinguish between these cases. The other reason is
that \new drives the structure of many examples
and highlighting it in bold seemed to help grasping
good enough a number of them to be worth an exception.
So this is basically an admittedly handwaving reasoning
of "you want to see this first because it is an
important structuring element". Other important
such exceptions are mode switchers such as \addlyrics
and friends. Now, Valentin proposes a scheme where
(most?) music functions are bold too, so this could
be reconsidered.

unfold is blue because it's considered part of
the essence of the "\repeat something" command. It
don't pretend that is the best choice, and since I
eventually decided not to highlight clef names in
blue I should likely revert it.

Beam.breakable is red like all grob property paths.



There is apparently a large collection of colors



To be exact, five colors in total if you count
grey. That's not exactly what I would call a
large collection ...



and some font styles



Just bold for keywords. Nothing more.


[snipped]


[Valentin]


Hello Jean, hello David,

I do like the idea, but I do agree with David to some extent. Syntax
highlighting should emphasize the structure of the file and thus make reading
easier. But if it gets too colorful in terms of contrast of colors the colors
simply distract you.

For example there is no good reason for coloring all numbers some outstanding
way. Frescobaldi does this, but that just creates distracting dots of color in
the code. And numbers tend to be quite discernible, so you do not really need
a special color to mark them.



It seemed to help discerning articulations such as [(
from dotted durations and also those with multipliers.
Not that it matters so much to me though. Or perhaps
I should use a less bright color?



That being said your color scheme is much better than Frescobaldi’s scheme,
which is appallingly distracting. See the appended file for a comparison of
Frescobaldi and KDE Kate (which is by no means perfect, but at least an
improvement...).

I think your color scheme could be improved easily by doing something like in
the other screenshot (taking the same snippet as David).



Ok, thanks for trying out, but could you explain what
it does more precisely? Speci

Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-01 Thread Calvin Ransom
Hi Jean,
I think it sounds like a really good idea.
Would it be possible to have a menu for changing the highlighting settings to 
create some customizability? I'm not familiar with web development at all so I 
don't know if this would be difficult to implement.

Good luck!

Calvin Ransom

Calvin Ransom


From: lilypond-user  on behalf 
of Valentin Petzel 
Sent: Saturday, January 1, 2022 5:53 PM
To: Jean Abou Samra; lilypond-user@gnu.org
Cc: David Kastrup; Lilypond-User Mailing List
Subject: Re: Feedback wanted: syntax highlighting in the LilyPond documentation

Hello Jean, hello David,

I do like the idea, but I do agree with David to some extent. Syntax
highlighting should emphasize the structure of the file and thus make reading
easier. But if it gets too colorful in terms of contrast of colors the colors
simply distract you.

For example there is no good reason for coloring all numbers some outstanding
way. Frescobaldi does this, but that just creates distracting dots of color in
the code. And numbers tend to be quite discernible, so you do not really need
a special color to mark them.

That being said your color scheme is much better than Frescobaldi’s scheme,
which is appallingly distracting. See the appended file for a comparison of
Frescobaldi and KDE Kate (which is by no means perfect, but at least an
improvement...).

I think your color scheme could be improved easily by doing something like in
the other screenshot (taking the same snippet as David).

Cheers,
Valentin

Am Sonntag, 2. Jänner 2022, 01:06:35 CET schrieb David Kastrup:
> Jean Abou Samra  writes:
> > Hi all,
> >
> > There is an ongoing proposal to add syntax highlighting
> > in LilyPond's documentation. Since it is a notable change
> > to the documentation reading experience, user feedback would
> > be appreciated. You can browse a syntax-highlighted version
> > of the notation manual here:
> >
> > http://abou-samra.fr/highlighting-demo/notation/index.html
> >
> > For comparison, this is the current notation manual:
> >
> > https://lilypond.org/doc/v2.23/Documentation/notation/index.html
> >
> > The main questions are: what do you think of the principle?
> > And is the color scheme good enough?
>
> I just followed the discussion without much attention because I did not
> think that it would affect me whether or not there was syntax
> highlighting.  That probably was a mistake.  Taking a random example:


Re: Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-01 Thread David Kastrup
Jean Abou Samra  writes:

> Hi all,
>
> There is an ongoing proposal to add syntax highlighting
> in LilyPond's documentation. Since it is a notable change
> to the documentation reading experience, user feedback would
> be appreciated. You can browse a syntax-highlighted version
> of the notation manual here:
>
> http://abou-samra.fr/highlighting-demo/notation/index.html
>
> For comparison, this is the current notation manual:
>
> https://lilypond.org/doc/v2.23/Documentation/notation/index.html
>
> The main questions are: what do you think of the principle?
> And is the color scheme good enough?

I just followed the discussion without much attention because I did not
think that it would affect me whether or not there was syntax
highlighting.  That probably was a mistake.  Taking a random example:


There is a wild mixture of colors and font styles without apparent rhyme
or reason.  I don't see that it helps legibility or conveys any useful
categories.  I cannot even figure out what it thinks it is doing.

\layout, \context, \remove are reserved words in the syntax and are
printed in boldface and black.  So is \override which is printed in
normalface blue, like \relative and \repeat.  But \relative is a music
function while \repeat is a reserved word.  Beam.breakable is printed in
red while unfold is printed in blue.

There is apparently a large collection of colors and some font styles
but the application appears rather haphazard, being neither
systematically related to the actual category of the tokens nor to their
function in user input.

There does not appear to be a coherent payback for the inherent lowering
of readability (and printability) from the lower contrast of colored
passages.

What is the information you want to convey better?

-- 
David Kastrup


Feedback wanted: syntax highlighting in the LilyPond documentation

2022-01-01 Thread Jean Abou Samra

Hi all,

There is an ongoing proposal to add syntax highlighting
in LilyPond's documentation. Since it is a notable change
to the documentation reading experience, user feedback would
be appreciated. You can browse a syntax-highlighted version
of the notation manual here:

http://abou-samra.fr/highlighting-demo/notation/index.html

For comparison, this is the current notation manual:

https://lilypond.org/doc/v2.23/Documentation/notation/index.html

The main questions are: what do you think of the principle?
And is the color scheme good enough?

Thanks in advance,
Jean




Re: Syntax highlighting

2020-01-25 Thread Craig Dabelstein
Hi all,

This is what I've been doing to test, after cloning the repo. Instructions
start halfway down this page: https://pygments.org/docs/lexerdevelopment/

You probably don;t even have to `make mapfiles` on this LilyPond branch.


   1.

   Run make mapfiles
   2.

   Run the lexer to convert the LilyPond file to html: python -m pygments
   -O full -f html -o /tmp/example.html tests/examplefiles/example.ily
   3.

   Open the html file: /tmp/example.html


On Sat, 25 Jan 2020 at 23:50, Henning Hraban Ramm 
wrote:

>
> > Am 2020-01-25 um 10:45 schrieb Urs Liska :
> >
> > Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
> >> Hi everyone,
> >>
> >> I've written a LilyPond syntax highlighter for pygments. It's not
> perfect but it's mostly working. Is there anyone out there who could test
> it?
> >>
> >> https://github.com/craigdab/pygments/tree/LilyPond
> >
> > Thank you for working on it.
> >
> > How does one test it?
> > First clone the repository and install pygments from there (its
> `setup.py`) I suppose. The README suggests using `pip`, which surely
> wouldn't work, isn't it?
> >
> > I have installed Pygments through pip3, is there a way to avoid a
> conflict, e.g. by *not* installing your pygments clone but directly invoke
> the proper executable?
>
> It would make sense to create a virtualenv, activate it and install
> Craig’s pygments there via setup.py
>
>
> Greetlings, Hraban
> ---
> fiëé visuëlle
> Henning Hraban Ramm
> https://www.fiee.net
>
>
>
>
>
>

-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com E:
cr...@concertbandmusicstore.com 






Re: Syntax highlighting

2020-01-25 Thread Henning Hraban Ramm


> Am 2020-01-25 um 10:45 schrieb Urs Liska :
> 
> Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
>> Hi everyone,
>> 
>> I've written a LilyPond syntax highlighter for pygments. It's not perfect 
>> but it's mostly working. Is there anyone out there who could test it?
>> 
>> https://github.com/craigdab/pygments/tree/LilyPond
> 
> Thank you for working on it.
> 
> How does one test it?
> First clone the repository and install pygments from there (its `setup.py`) I 
> suppose. The README suggests using `pip`, which surely wouldn't work, isn't 
> it?
> 
> I have installed Pygments through pip3, is there a way to avoid a conflict, 
> e.g. by *not* installing your pygments clone but directly invoke the proper 
> executable?

It would make sense to create a virtualenv, activate it and install Craig’s 
pygments there via setup.py


Greetlings, Hraban
---
fiëé visuëlle
Henning Hraban Ramm
https://www.fiee.net







Re: Syntax highlighting

2020-01-25 Thread Urs Liska
Am Samstag, den 25.01.2020, 17:48 +1000 schrieb Craig Dabelstein:
> Hi everyone,
> I've written a LilyPond syntax highlighter for pygments. It's not
> perfect but it's mostly working. Is there anyone out there who could
> test it?
> 
> https://github.com/craigdab/pygments/tree/LilyPond

Thank you for working on it.
How does one test it?First clone the repository and install pygments
from there (its `setup.py`) I suppose. The README suggests using `pip`,
which surely wouldn't work, isn't it?
I have installed Pygments through pip3, is there a way to avoid a
conflict, e.g. by *not* installing your pygments clone but directly
invoke the proper executable?
I suppose testing would be done through using the command line version
as described on https://pygments.org/docs/cmdline/ ?
BestUrs
> I'm sure there is lots that could be improved on it. It is running
> without errors, but it is failing the pull request tests and I don't
> know why. I'm not experienced enough to work it out.
> 
> Thanks everyone,
> 
> Craig
> 
> 
> 
> 


Syntax highlighting

2020-01-24 Thread Craig Dabelstein
Hi everyone,

I've written a LilyPond syntax highlighter for pygments. It's not perfect
but it's mostly working. Is there anyone out there who could test it?

https://github.com/craigdab/pygments/tree/LilyPond

I'm sure there is lots that could be improved on it. It is running without
errors, but it is failing the pull request tests and I don't know why. I'm
not experienced enough to work it out.

Thanks everyone,

Craig




-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com E:
cr...@concertbandmusicstore.com 






Re: Syntax highlighting

2020-01-16 Thread Craig Dabelstein
The pygments LilyPond lexer is actually going ok. I'm still copying over
the info from python-ly, but I've worked it out and so far it's working
without errors. I will have to learn some regex tricks in the next few
days. Perhaps another week and it will be ready for some testing.

Craig

On Wed., 15 Jan. 2020, 12:16 pm Craig Dabelstein, <
craig.dabelst...@gmail.com> wrote:

> Federico,
>
> Is it just me or is the documentation for Pygments really hard to
> understand? I can't even find anywhere they discuss the setup.py file.
>
> I've opened a repo (https://github.com/craigdab/pygments-lilypond-test)
> and cut and paste from other peoples repositories as a start, but I really
> have no idea what I'm doing.
>
> Craig
>
>
> On Wed, 15 Jan 2020 at 10:38, Craig Dabelstein 
> wrote:
>
>> Thank you gentlemen,
>>
>> I'll have a go at taking the python-ly work and seeing if I can use it
>> work to make syntax highlighting with pygments. It's highly possible that I
>> will totally fail, but I'll give it a try.
>>
>> Craig
>>
>>
>> On Tue, 14 Jan 2020 at 23:38, Federico Bruni  wrote:
>>
>>> Il giorno mar 14 gen 2020 alle 12:34, Urs Liska 
>>> ha scritto:
>>> > Pygments is also what Pandoc uses for its syntax highlighting, so that
>>> > would also make sense for that (e.g. generating PDF documentation from
>>> > Markdown).
>>>
>>> Are you sure?
>>> I think that pygments is the name of the default style in Pandoc, but
>>> the highlight library is a Haskell library called skylighting:
>>> https://pandoc.org/MANUAL.html#syntax-highlighting
>>> https://github.com/jgm/skylighting
>>>
>>> It seems Wilbert contributed the definitions for lilypond syntax:
>>>
>>> https://github.com/KDE/syntax-highlighting/blob/master/data/syntax/lilypond.xml
>>>
>>> About 10 days ago I wanted to share this in the open issue in
>>> Frescobaldi tracker but I forgot to do it.
>>> I remember I found the lilypond file definition somewhere else...
>>>
>>>
>>>
>>>
>>
>> --
>> Craig Dabelstein
>> Owner
>> Maxime's Music
>> M: 0404884173
>> A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
>> W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
>> cr...@concertbandmusicstore.com 
>> <https://www.facebook.com/maximesmusic.com.au>
>> <https://www.linkedin.com/in/maximes-music>
>>
>> <https://www.designhill.com/email-signature-generator>
>>
>>
>
>
> --
> Craig Dabelstein
> Owner
> Maxime's Music
> M: 0404884173
> A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
> W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
> cr...@concertbandmusicstore.com 
> <https://www.facebook.com/maximesmusic.com.au>
> <https://www.linkedin.com/in/maximes-music>
>
> <https://www.designhill.com/email-signature-generator>
>
>


Re: Syntax highlighting

2020-01-14 Thread Craig Dabelstein
Federico,

Is it just me or is the documentation for Pygments really hard to
understand? I can't even find anywhere they discuss the setup.py file.

I've opened a repo (https://github.com/craigdab/pygments-lilypond-test) and
cut and paste from other peoples repositories as a start, but I really have
no idea what I'm doing.

Craig


On Wed, 15 Jan 2020 at 10:38, Craig Dabelstein 
wrote:

> Thank you gentlemen,
>
> I'll have a go at taking the python-ly work and seeing if I can use it
> work to make syntax highlighting with pygments. It's highly possible that I
> will totally fail, but I'll give it a try.
>
> Craig
>
>
> On Tue, 14 Jan 2020 at 23:38, Federico Bruni  wrote:
>
>> Il giorno mar 14 gen 2020 alle 12:34, Urs Liska 
>> ha scritto:
>> > Pygments is also what Pandoc uses for its syntax highlighting, so that
>> > would also make sense for that (e.g. generating PDF documentation from
>> > Markdown).
>>
>> Are you sure?
>> I think that pygments is the name of the default style in Pandoc, but
>> the highlight library is a Haskell library called skylighting:
>> https://pandoc.org/MANUAL.html#syntax-highlighting
>> https://github.com/jgm/skylighting
>>
>> It seems Wilbert contributed the definitions for lilypond syntax:
>>
>> https://github.com/KDE/syntax-highlighting/blob/master/data/syntax/lilypond.xml
>>
>> About 10 days ago I wanted to share this in the open issue in
>> Frescobaldi tracker but I forgot to do it.
>> I remember I found the lilypond file definition somewhere else...
>>
>>
>>
>>
>
> --
> Craig Dabelstein
> Owner
> Maxime's Music
> M: 0404884173
> A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
> W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
> cr...@concertbandmusicstore.com 
> <https://www.facebook.com/maximesmusic.com.au>
> <https://www.linkedin.com/in/maximes-music>
>
> <https://www.designhill.com/email-signature-generator>
>
>


-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
cr...@concertbandmusicstore.com 
<https://www.facebook.com/maximesmusic.com.au>
<https://www.linkedin.com/in/maximes-music>

<https://www.designhill.com/email-signature-generator>


Re: Syntax highlighting

2020-01-14 Thread Craig Dabelstein
Thank you gentlemen,

I'll have a go at taking the python-ly work and seeing if I can use it work
to make syntax highlighting with pygments. It's highly possible that I will
totally fail, but I'll give it a try.

Craig


On Tue, 14 Jan 2020 at 23:38, Federico Bruni  wrote:

> Il giorno mar 14 gen 2020 alle 12:34, Urs Liska 
> ha scritto:
> > Pygments is also what Pandoc uses for its syntax highlighting, so that
> > would also make sense for that (e.g. generating PDF documentation from
> > Markdown).
>
> Are you sure?
> I think that pygments is the name of the default style in Pandoc, but
> the highlight library is a Haskell library called skylighting:
> https://pandoc.org/MANUAL.html#syntax-highlighting
> https://github.com/jgm/skylighting
>
> It seems Wilbert contributed the definitions for lilypond syntax:
>
> https://github.com/KDE/syntax-highlighting/blob/master/data/syntax/lilypond.xml
>
> About 10 days ago I wanted to share this in the open issue in
> Frescobaldi tracker but I forgot to do it.
> I remember I found the lilypond file definition somewhere else...
>
>
>
>

-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
cr...@concertbandmusicstore.com 
<https://www.facebook.com/maximesmusic.com.au>
<https://www.linkedin.com/in/maximes-music>

<https://www.designhill.com/email-signature-generator>


Re: Syntax highlighting

2020-01-14 Thread Federico Bruni
Il giorno mar 14 gen 2020 alle 12:34, Urs Liska  
ha scritto:

Pygments is also what Pandoc uses for its syntax highlighting, so that
would also make sense for that (e.g. generating PDF documentation from
Markdown).


Are you sure?
I think that pygments is the name of the default style in Pandoc, but 
the highlight library is a Haskell library called skylighting:

https://pandoc.org/MANUAL.html#syntax-highlighting
https://github.com/jgm/skylighting

It seems Wilbert contributed the definitions for lilypond syntax:
https://github.com/KDE/syntax-highlighting/blob/master/data/syntax/lilypond.xml

About 10 days ago I wanted to share this in the open issue in 
Frescobaldi tracker but I forgot to do it.

I remember I found the lilypond file definition somewhere else...






Re: Syntax highlighting

2020-01-14 Thread Urs Liska
Am Dienstag, den 14.01.2020, 12:27 +0100 schrieb Federico Bruni:
> 
> Il giorno mar 14 gen 2020 alle 09:13, Craig Dabelstein 
>  ha scritto:
> > Hi all,
> > 
> > I'd like to add LilyPond syntax highlighting to highlight.js ( 
> > https://highlightjs.readthedocs.io/en/latest/ ) so that I can 
> > experiment with documentation tools such as mkDocs/readthedocs.
> > Does 
> > anyone have any experience with this? Would it just be a matter of 
> > getting one of the current syntax packages (such as 
> > https://github.com/yrammos/SubLilyPond or 
> > https://github.com/yrammos/AtLilyPond , and trying to modify them?
> > 
> > 
> 
> I don't have any experience with highlight.js.
> Some years ago I started writing a Pygments definition for LilyPond
> but 
> then I gave up or simply forgot about it.
> 
> The Sublimetext and Atom packages might be useful as a reference, but
> I 
> guess that highlight.js will need its own syntax so you'd better
> start 
> from scratch.
> 
> The problem with syntax highlighting is maintainance. LilyPond
> syntax 
> changes and a manually compiled list must be updated manually for
> every 
> new stable release.
> 
> See also python-ly:
> https://github.com/frescobaldi/python-ly/blob/master/ly/words.py
> 

I'm not sure where and how, but there is also a substantial part of
python-ly's knowledge that is retrieved directly from LilyPond (either
from the sources or by running some LilyPond code). As far as I know
python-ly is the most comprehensive syntax highlighting solution on the
market (although still 2.18.2), and I think it would be good to find a
way use that “knowlegde” to generate syntax highlighting for arbitrary
other highlighters from that set of data.

> 
> Personally I'd be more interested in adding lilypond to Pygments.
> Pygments can be easily exported to chroma¹ (for Hugo² static site 
> generator).
> And it seems Pygments may be used also in Mkdocs, see this
> discussion:
> https://github.com/mkdocs/mkdocs/issues/1588

Pygments is also what Pandoc uses for its syntax highlighting, so that
would also make sense for that (e.g. generating PDF documentation from
Markdown).

Urs

> 
> ¹ https://github.com/alecthomas/chroma
> ² https://gohugo.io/content-management/syntax-highlighting/
> 
> 
> 
> 




Re: Syntax highlighting

2020-01-14 Thread Federico Bruni




Il giorno mar 14 gen 2020 alle 09:13, Craig Dabelstein 
 ha scritto:

Hi all,

I'd like to add LilyPond syntax highlighting to highlight.js ( 
https://highlightjs.readthedocs.io/en/latest/ ) so that I can 
experiment with documentation tools such as mkDocs/readthedocs. Does 
anyone have any experience with this? Would it just be a matter of 
getting one of the current syntax packages (such as 
https://github.com/yrammos/SubLilyPond or 
https://github.com/yrammos/AtLilyPond , and trying to modify them?





I don't have any experience with highlight.js.
Some years ago I started writing a Pygments definition for LilyPond but 
then I gave up or simply forgot about it.


The Sublimetext and Atom packages might be useful as a reference, but I 
guess that highlight.js will need its own syntax so you'd better start 
from scratch.


The problem with syntax highlighting is maintainance. LilyPond syntax 
changes and a manually compiled list must be updated manually for every 
new stable release.


See also python-ly:
https://github.com/frescobaldi/python-ly/blob/master/ly/words.py


Personally I'd be more interested in adding lilypond to Pygments.
Pygments can be easily exported to chroma¹ (for Hugo² static site 
generator).

And it seems Pygments may be used also in Mkdocs, see this discussion:
https://github.com/mkdocs/mkdocs/issues/1588

¹ https://github.com/alecthomas/chroma
² https://gohugo.io/content-management/syntax-highlighting/






Syntax highlighting

2020-01-13 Thread Craig Dabelstein
Hi all,

I'd like to add LilyPond syntax highlighting to highlight.js (
https://highlightjs.readthedocs.io/en/latest/ ) so that I can experiment
with documentation tools such as mkDocs/readthedocs. Does anyone have
any experience with this? Would it just be a matter of getting one of
the current syntax packages (such as https://github.com/yrammos/SubLilyPond
 or https://github.com/yrammos/AtLilyPond , and trying to modify them?

All the best,

Craig


-- 
Craig Dabelstein
Owner
Maxime's Music
M: 0404884173
A: 19 Twelfth Ave,  Kedron QLD 4031, Australia
W: concertbandmusicstore.com <https://concertbandmusicstore.com/>E:
cr...@concertbandmusicstore.com 
<https://www.facebook.com/maximesmusic.com.au>
<https://www.linkedin.com/in/maximes-music>

<https://www.designhill.com/email-signature-generator>


color scheme (syntax highlighting vim Fedora 22)

2015-03-14 Thread Kevin Tough
Hi others and Pierre,

They or someone has changed the syntax highlighting colors in Fedora 22.
I hope it was not you Pierre. I find the syntax highlighting terrible on
my notebook.
I don't know if users of this list can effect any changes so parallel I
will try to contact someone in their development team.

Namaste,
Kevin


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: syntax highlighting in the doc, call for testers

2012-02-05 Thread Thomas Morley
Hi Federico,

2012/2/3 Federico Bruni fedel...@gmail.com:
 Il 02/02/2012 22:22, Thomas Morley ha scritto:

 1. Am I right you resigned of every highlighting within scheme?


 Yes, almost.
 I know nothing about Scheme. The only highlighting within Scheme that I'd
 like to preserve are the strings . I've just edited the scheme definition
 and it works.

 Is there any other highlghting within Scheme that I'm missing?
 Can you provide some example?

in your initial mail you wrote I'm trying to follow Frescobaldi
highlighting as much as possible and so you did! Congratulation! It's
nearly a perfect reproduction.

But (as remarked before) I don't like the highlighting style of
Frescobaldi. I prefer the style of jEdit, highlighting LilyPond and
scheme (well, it's not perfect but I like it). In case you don't know
the jEdit-style, I attached a screen-shot.

Some thoughts:
1. IIRC the tracker-issue is about highlighting stuff in the docs. So
maybe highlighting scheme isn't desirable.
2. Seems I'm the only user who answered, so my opinion isn't representative.

 No one else out there, interested in this stuff 

 source-highlight has already a scheme language and I might easily include
 it, but I don't think that it's desirable: you would get what you see in the
 attached file.

That looks not very nice and gives _very_ little advantage. So I think
you should not include it.

Regards,
 Harm
attachment: jEdit.png___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: syntax highlighting in the doc, call for testers

2012-02-02 Thread Federico Bruni

Il 02/01/2012 15:58, Thomas Morley ha scritto:

I tested a file with a large scheme-definition.
In the attached file you may notice some inconsequences:


Hi Thomas,

I have fixed the error in the scheme definition, so your file is 
highlighted correctly now.

I've done also some other improvements.

Anyone wishing to test it again is welcomed to do so, see files attached.

Tip for quick testing:

1) copy all the .ly files you want to test in a directory along with the 
attached files

2) create the html subdirectory
3) run ./srchilite.sh
4) open all the .html files at once and check tab by tab

I think that I'll submit the files upstream within saturday/sunday.
We'll fix next bugs when we find them :-) (I'm aware of some minor bugs 
in markup blocks)


Thanks,
Federico
java = java.lang 
moc = cpp.lang
cpp = cpp.lang
c = c.lang
C = cpp.lang
cc = cpp.lang
cs = csharp.lang
csharp = csharp.lang
h = cpp.lang
hh = cpp.lang
H = cpp.lang
hpp = cpp.lang
javascript = javascript.lang
js = javascript.lang
prolog = prolog.lang
pl = prolog.lang
perl = perl.lang
pm = perl.lang
php3 = php.lang
php4 = php.lang
php5 = php.lang
php = php.lang
ctp = php.lang
protobuf = proto.lang
proto = proto.lang
python = python.lang
py = python.lang
ruby = ruby.lang
rb = ruby.lang
flex = flex.lang
lex = flex.lang
l = flex.lang
ll = flex.lang
bison = bison.lang
yacc = bison.lang
y = bison.lang
yy = bison.lang
changelog = changelog.lang
lua = lua.lang
ml = caml.lang
caml = caml.lang
mli = caml.lang
sml = sml.lang
sig = sml.lang
syslog = log.lang
log = log.lang
pas = pascal.lang
pascal = pascal.lang
fortran = fortran.lang
free-fortran = fortran.lang
fixed-fortran = fixed-fortran.lang
html = html.lang
htm = html.lang
tex = latex.lang
latex = latex.lang
cls = latex.lang
sty = latex.lang
dtx = latex.lang
lgt = logtalk.lang
logtalk = logtalk.lang
diff = diff.lang
patch = diff.lang
lang = langdef.lang
langdef = langdef.lang
outlang = outlang.lang
style = style.lang
ps = postscript.lang
eps = postscript.lang
postscript = postscript.lang
kcfg = xml.lang
ui = xml.lang
kdevelop = xml.lang
rc = xml.lang
docbook = xml.lang
kidl = xml.lang
xml = xml.lang
xhtml = xml.lang
bash = sh.lang
sh = sh.lang
csh = sh.lang
ksh = sh.lang
tcsh = sh.lang
shell = sh.lang
tcl = tcl.lang
tk = tcl.lang
txt = nohilite.lang
sql = sql.lang
bib = bib.lang
makefile = makefile.lang
am = makefile.lang
in = makefile.lang
css = css.lang
m4 = m4.lang
ac = m4.lang
autoconf = m4.lang
sl = slang.lang
slsh = slang.lang
slang = slang.lang
properties = properties.lang
desktop = desktop.lang
ini = desktop.lang
conf = conf.lang
lsm = lsm.lang
spec = spec.lang
haxe = haxe.lang
hx = haxe.lang
ldap = ldap.lang
ldif = ldap.lang
glsl = glsl.lang
xorg = xorg.lang
scala = scala.lang
ada = ada.lang
adb = ada.lang
pc = pc.lang
pkgconfig = pc.lang
oz = oz.lang
texinfo = texinfo.lang
texi = texinfo.lang
hs = haskell.lang
hs = haskell.lang
lhs = haskell_literate.lang
haskell = haskell.lang
manifest = manifest.lang
mf = manifest.lang
asm = asm.lang
s = asm.lang
applescript = applescript.lang
scpt = applescript.lang
vbscript = vbscript.lang
vbs = vbscript.lang
awk = awk.lang
bat = bat.lang
batch = bat.lang
clipper = clipper.lang
prg = clipper.lang
cbl = cobol.lang
cobol = cobol.lang
dmd = d.lang
d = d.lang
errors = errors.lang
erl = erlang.lang
erlang = erlang.lang
vala = vala.lang
lisp = lisp.lang
el = lisp.lang
scm = scheme.lang
scheme = scheme.lang
po = po.lang
pot = po.lang
opa = opa.lang
javalog = javalog.lang
upc = upc.lang
tml = tml.lang
ly = lilypond.lang
# LilyPond v2.14.2

string delim \ \ multiline

environment scheme delim '#\'?\(' ) multiline nested begin
  environment scheme delim ( ) multiline nested begin
include url.lang
  end
end

scheme_value = '##(t|f)', '#{1,2}\'?[[:alnum:]\.:+-]+'

comment delim %{ %} multiline nested
comment start %

# Symbols
cbracket = {|}||
symbol = (|)|~|^|_
dynamic = '\\(||!|f{1,5}|p{1,5}|m(f|p)|fp|(r|s)fz|s(f|p){1,2})(?!\w)'

# Numbers
specialchar = '(?!#)-[1-5]\b', '\\[0-9]\b' # strings and fingerings
note_duration = '(?=[a-zR\',!?])(1|2|4|8|16|32|64|128)(\.+|\b)'
value = '[[:digit:]/\*]+'

# Markup commands
markup_command = '\\((left-|center-|right-|general-)?align|arrow-head',
'beam|bold|(left-|right-)brace|(filled-|rounded-)?box|(h)?bracket',
'caps|char|circle|combine|concat|(left-|center-|right-|dir-)?column',
'dynamic|dot|draw(-circle|-hline|-line)|eyeglasses|epsfile',

'fill-with-pattern|finger|(double|semi|sesqui)?flat|fontCaps|(abs-)?fontsize',
'(auto-)?footnote|fraction|fret-diagram(-terse|-verbose)?|fromproperty',
'halign|harp-pedal|hcenter-in|hspace|huge|italic|justify(-field|-string)?',
'(justified-|fill-)?line|large(r)?|lookup',
'magnify|mark(alphabet|letter)|markup(list|lines)?|medium',
'musicglyph|natural|normal-size(-super|-sub)|normalsize',
'normal-text|note(-by-number)?|null|number',
'override-lines|pad(-around|-markup|-to-box|-x)',
'page(-link|-ref)|parenthesize|path|pattern',

Re: syntax highlighting in the doc, call for testers

2012-02-02 Thread Thomas Morley
Hi Federico,

2012/2/2 Federico Bruni fedel...@gmail.com:
 Il 02/01/2012 15:58, Thomas Morley ha scritto:

 I tested a file with a large scheme-definition.

 In the attached file you may notice some inconsequences:


 Hi Thomas,

 I have fixed the error in the scheme definition, so your file is highlighted
 correctly now.
 I've done also some other improvements.

 Anyone wishing to test it again is welcomed to do so, see files attached.

 Tip for quick testing:

 1) copy all the .ly files you want to test in a directory along with the
 attached files
 2) create the html subdirectory
 3) run ./srchilite.sh
 4) open all the .html files at once and check tab by tab

 I think that I'll submit the files upstream within saturday/sunday.
 We'll fix next bugs when we find them :-) (I'm aware of some minor bugs in
 markup blocks)

 Thanks,
 Federico

1. Am I right you resigned of every highlighting within scheme?
2. I noticed that the number 1 in R1 is in a different color than in
R1*8 (see the attached small file)

I found nothing more to worry about, but I hope there will be more
testers, I'm not the best to do this sort of work.

HTH,
  Harm

\version "2.14.2"


%
% Vertical space skip!
%
% Usage: \vspace #2
%


#(define-markup-command (vspace layout props amount) (number?)
  "This produces a invisible object taking vertical space."
  (let ((amount (* amount 3.0)))
(if ( amount 0)
(ly:make-stencil "" (cons -1 1) (cons 0 amount))
(ly:make-stencil "" (cons -1 1) (cons amount amount)
  
 
%### Melody 

_One_ = {
	R1*8
}

%## 2. Stimme ##

Two = {
		R1
		R1
		R1
		R1
		R1
		R1
		R1
		R1
	\bar "|."
}

%## Akkorde 


akkorde = 
\chords { c2. g4 | c2 g2 | c4 g4 d4:m d4 | g2 r2 | 
	c2 f4 c4 | f1 | c2 d4:m g4 | c2. r4 | }



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: syntax highlighting in the doc, call for testers

2012-02-02 Thread Federico Bruni

Il 02/02/2012 22:22, Thomas Morley ha scritto:

1. Am I right you resigned of every highlighting within scheme?


Yes, almost.
I know nothing about Scheme. The only highlighting within Scheme that 
I'd like to preserve are the strings . I've just edited the scheme 
definition and it works.


Is there any other highlghting within Scheme that I'm missing?
Can you provide some example?

source-highlight has already a scheme language and I might easily 
include it, but I don't think that it's desirable: you would get what 
you see in the attached file.



2. I noticed that the number 1 in R1 is in a different color than in
R1*8 (see the attached small file)


this is fixed now, thanks

\version "2.14.2"


%
% Vertical space skip!
%
% Usage: \vspace #2
%


#(define-markup-command (vspace layout props amount) (number?)
  "This produces a invisible object taking vertical space."
  (let ((amount (* amount 3.0)))
(if ( amount 0)
(ly:make-stencil "" (cons -1 1) (cons 0 amount))
(ly:make-stencil "" (cons -1 1) (cons amount amount)
  
 
%### Melody 

_One_ = {
	R1*8
}

%## 2. Stimme ##

Two = {
		R1
		R1
		R1
		R1
		R1
		R1
		R1
		R1
	\bar "|."
}

%## Akkorde 


akkorde = 
\chords { c2. g4 | c2 g2 | c4 g4 d4:m d4 | g2 r2 | 
	c2 f4 c4 | f1 | c2 d4:m g4 | c2. r4 | }




___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


syntax highlighting in the doc, call for testers

2012-01-02 Thread Federico Bruni

Hi LilyPonders,

I'm following Graham's suggestion[0] and I'm asking here if you could 
please test the attached lilypond language file for source-highlight.


There's an issue on the tracker[1] about syntax highlighting in the doc.
The first step to make it happen is writing a language file for a third 
party package called source-highlight[2]. Before submitting it to 
source-highlight developers I'd appreciate some feedback from you. Not 
much about color scheme (I'm trying to follow Frescobaldi highlighting 
as much as possible).. what I really need is being sure that the regexp 
work fine in real files.
The files I've tested so far seem to work fine now (with this last 
version I'm attaching), but I may have missed something.


On Linux you just need to install the source-highlight package.
On Windows you may want to try these binaries[3]. It's v1.2.1 while I'm 
using v3.1.5, so I don't guarantee it will work.


Once you have source-highlight installed, place the attached files in a 
directory, open the terminal and change to that directory. Then launch 
the following command:


source-highlight -s lilypond.lang --style-file=lilypond.style -i test.ly 
-o test.html


NOTE: input files can be anywhere, but lilypond.lang, lilypond.style and 
lang.map must be in the current working directory (i.e. where you launch 
the command).


You can test it using your files or Mutopia files (better if v2.14, see 
advanced search of Mutopia).


I'll send the files to source-highlight developers next Sunday.
If you have any comment/improvement let me know.

Thanks,
Federico

[0] http://lists.gnu.org/archive/html/lilypond-devel/2011-12/msg00722.html
[1] http://code.google.com/p/lilypond/issues/detail?id=1005
[2] http://www.gnu.org/software/src-highlite/
[3] http://gnuwin32.sourceforge.net/packages/source-highlight.htm
java = java.lang 
moc = cpp.lang
cpp = cpp.lang
c = c.lang
C = cpp.lang
cc = cpp.lang
cs = csharp.lang
csharp = csharp.lang
h = cpp.lang
hh = cpp.lang
H = cpp.lang
hpp = cpp.lang
javascript = javascript.lang
js = javascript.lang
prolog = prolog.lang
pl = prolog.lang
perl = perl.lang
pm = perl.lang
php3 = php.lang
php4 = php.lang
php5 = php.lang
php = php.lang
ctp = php.lang
protobuf = proto.lang
proto = proto.lang
python = python.lang
py = python.lang
ruby = ruby.lang
rb = ruby.lang
flex = flex.lang
lex = flex.lang
l = flex.lang
ll = flex.lang
bison = bison.lang
yacc = bison.lang
y = bison.lang
yy = bison.lang
changelog = changelog.lang
lua = lua.lang
ml = caml.lang
caml = caml.lang
mli = caml.lang
sml = sml.lang
sig = sml.lang
syslog = log.lang
log = log.lang
pas = pascal.lang
pascal = pascal.lang
fortran = fortran.lang
free-fortran = fortran.lang
fixed-fortran = fixed-fortran.lang
html = html.lang
htm = html.lang
tex = latex.lang
latex = latex.lang
cls = latex.lang
sty = latex.lang
dtx = latex.lang
lgt = logtalk.lang
logtalk = logtalk.lang
diff = diff.lang
patch = diff.lang
lang = langdef.lang
langdef = langdef.lang
outlang = outlang.lang
style = style.lang
ps = postscript.lang
eps = postscript.lang
postscript = postscript.lang
kcfg = xml.lang
ui = xml.lang
kdevelop = xml.lang
rc = xml.lang
docbook = xml.lang
kidl = xml.lang
xml = xml.lang
xhtml = xml.lang
bash = sh.lang
sh = sh.lang
csh = sh.lang
ksh = sh.lang
tcsh = sh.lang
shell = sh.lang
tcl = tcl.lang
tk = tcl.lang
txt = nohilite.lang
sql = sql.lang
bib = bib.lang
makefile = makefile.lang
am = makefile.lang
in = makefile.lang
css = css.lang
m4 = m4.lang
ac = m4.lang
autoconf = m4.lang
sl = slang.lang
slsh = slang.lang
slang = slang.lang
properties = properties.lang
desktop = desktop.lang
ini = desktop.lang
conf = conf.lang
lsm = lsm.lang
spec = spec.lang
haxe = haxe.lang
hx = haxe.lang
ldap = ldap.lang
ldif = ldap.lang
glsl = glsl.lang
xorg = xorg.lang
scala = scala.lang
ada = ada.lang
adb = ada.lang
pc = pc.lang
pkgconfig = pc.lang
oz = oz.lang
texinfo = texinfo.lang
texi = texinfo.lang
hs = haskell.lang
hs = haskell.lang
lhs = haskell_literate.lang
haskell = haskell.lang
manifest = manifest.lang
mf = manifest.lang
asm = asm.lang
s = asm.lang
applescript = applescript.lang
scpt = applescript.lang
vbscript = vbscript.lang
vbs = vbscript.lang
awk = awk.lang
bat = bat.lang
batch = bat.lang
clipper = clipper.lang
prg = clipper.lang
cbl = cobol.lang
cobol = cobol.lang
dmd = d.lang
d = d.lang
errors = errors.lang
erl = erlang.lang
erlang = erlang.lang
vala = vala.lang
lisp = lisp.lang
el = lisp.lang
scm = scheme.lang
scheme = scheme.lang
po = po.lang
pot = po.lang
opa = opa.lang
javalog = javalog.lang
upc = upc.lang
tml = tml.lang
ly = lilypond.lang
# Symbols
cbracket = {|}
symbol = (|)|~|^|_
dynamic = '\\(||!|f{1,5}|p{1,5}|m(f|p)|fp|(r|s)fz|s(f|p){1,2})(?!\w)'
string delim \ \

# Scheme
scheme_block delim #'(( )) multiline
scheme delim '#(\'|\()' '\)|$' # single line only

# Comments
comment delim %{ %} multiline nested
comment start %

# Numbers
specialchar = '(?!#)-[1-5]\b', '\\[0-9]\b' # strings and fingerings
note_duration = '(?=[a-z\',!?])(1

Re: syntax highlighting in the doc, call for testers

2012-01-02 Thread Federico Bruni

Hi Harm,

thanks for your feedback.
Your example let me notice that I forgot that R (upper case) is a note 
as well, so I've updated the note_duration regexp.


Il 02/01/2012 15:58, Thomas Morley ha scritto:

I tested a file with a large scheme-definition.
In the attached file you may notice some inconsequences:

1. The scheme-functions of IR 4. Scheme functions aren't
high-lighted consistent:
 ly:grob? isn't colored and ly: never.

2. In #(define (center-note-column grob) (let* ...
 Some of the defined variables are colored some not.

Sory, that I can't do more than testing.



Scheme is the hardest part.
I don't have a solution for it. The problem is the conflict between 
single and multiline blocks. I must put the multiline regexp before the 
single line regexp, because the first has precedence. But I also need to 
distinguish them: they cannot have the same start delimiter.


Single line blocks can be:

\once \override Tie #'staff-position = #3.5
tempoWholesPerMinute = #(ly:make-moment 120 4)
tagline = \markup { \override #'(box-padding . 1.0) }

Start: #' or #(
End: ) or end of line

In your example the multiline blocks start with #( so the single line 
regexp applies.
I might define #( as a multiline start delimiter, but then the single 
line instance (see tempoWholesPerMinute above) would break everything.


Also, tracking the end of that big block is not easy at all.

I think I've covered the most frequent and basic uses of scheme inside a 
lilypond file. Large scheme definitions are quite difficult for me.

If any regexp guru has a good idea, please share it here.



HTH,
   Harm

P.S. Great work so far!


Thanks!

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Semantics of Lilypond syntax highlighting

2011-06-20 Thread Hans Aberg

On 20 Jun 2011, at 19:00, Garrett Fitzgerald wrote:

 I usually use the emacs tool to write lilypond code, but I use Notepad++ for 
 the rest of my editing. I'm trying to do a lilypond UDL for the Zenburn 
 scheme I'm currently using (http://victorgavin.co.uk/zenburn/), but I'm 
 having trouble matching a couple of the items up. Working off the list from 
 lilypond-words.el, I've defined the first list (\mf, \lyrics, \time, etc.) as 
 Keyword. However, how should I treat a-vibraslap and 
 Accidental_engraver-Volta-Engraver? And which list does strings go with? I 
 could just define them all as Keyword, but it seems to me there should be 
 some semantic difference. Maybe Indentifier?

LilyPond has lexer and parser file. You might look into them.

Hans


http://lilypond.org/doc/v2.15/Documentation/notation/technical-glossary#lexer
http://lilypond.org/doc/v2.15/Documentation/notation/technical-glossary#parser



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Syntax highlighting in LilyPad?

2008-08-04 Thread Mats Bengtsson
Please always keep the discussion on the mailing list 
lilypond-user@gnu.org,
for the benefit of yourself since you get access to the collected 
expertise on the
list and for the benefit of others who experience similar problems. I 
have never

used LilyPond on a Mac. I hope you have read section
http://lilypond.org/doc/v2.11/Documentation/user/lilypond-program/Text-editor-support#Text-editor-support
which describes several editors with good LilyPond support. You can find 
even more

examples if you search the mailing list archives.

  /Mats


Oliver Popp wrote:

Hey,

have you found a way for syntax highlighting in Lilypad?
I suppose you're using a mac and you prefer the Lilypad app instead of 
the Lilypond editor. Till now I could not find a nice way for editing 
in Lilypond as you have it in TeXShop for example.
I just tried to integrate Lilypond in TeXShop (which should be 
possible), however it didn't work out yet.


Do you have any ideas?

Many greets from Germany,

Oliver


--
=
Mats Bengtsson
Signal Processing
School of Electrical Engineering
Royal Institute of Technology (KTH)
SE-100 44  STOCKHOLM
Sweden
Phone: (+46) 8 790 8463 
   Fax:   (+46) 8 790 7260
Email: [EMAIL PROTECTED]
WWW: http://www.s3.kth.se/~mabe
=



___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Improved Lilypond syntax highlighting (KDE)

2007-10-06 Thread Damian leGassick
looks good, nice to see some support for kate which i use from time  
to time


d


On 5 Oct 2007, at 19:00, Wilbert Berendsen wrote:


Hi,

please find attached a massively improved Lilypond highlighting  
definition

file for KDE's Katepart, based on Andrea Primiani's first version.

Improvements:
- better recognition of being inside lyrics, drums, notes, chords  
and markup

sections
- detect multiline comments %{  %}
- links to ##Alerts in comments (e.g. TODO, FIXME)
- detect lilypond inside scheme #{ #}
- detect \score inside \markup, etc.
- helps with some often made errors like forgetting spaces around  
lyric

extenders and hyphens
- more scheme improvements: strings, numbers, $substitutions,  
lilypond objects

- highlights many variables, commands, lilypond objects, properties,
engravers, etc.
- by using entities for many regexps the main syntax checking parts  
remain

legible, and the file more maintainable.

This could be committed to KDE's katepart/syntax tree, but it's  
been a long
time i did some commits, zo i don't exactly know how/where to do  
it. :)


Cc: to lilypond-user for anyone using Lilypond+KDE who might find  
it useful :)


with best regards,
Wilbert Berendsen

--
http://www.wilbertberendsen.nl/ 
lilypond.xml.zip___

lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user




___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Improved Lilypond syntax highlighting (KDE)

2007-10-05 Thread Reinhold Kainhofer
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Am Freitag, 5. Oktober 2007 schrieb Wilbert Berendsen:
 please find attached a massively improved Lilypond highlighting definition
 file for KDE's Katepart, based on Andrea Primiani's first version.

Great! Thanks for you work.

 Improvements:
 - better recognition of being inside lyrics, drums, notes, chords and
 markup sections

Whis has the huge improvement that now code folding (i.e. opening/closing 
whole sections) works just fine, which didn't work at all in the 
lilypond.xml provided with 3.5.x. This makes working on large lilypond files 
much easier now!

 This could be committed to KDE's katepart/syntax tree, but it's been a long
 time i did some commits, zo i don't exactly know how/where to do it. :)

Check out the kdelibs module from subversion, replace lilypond.xml (in 
kate/syntax/data/lilypond.xml) and commit it with
  svn commit -m your commit message

Of course, you should get the permission/comments from the kate developers 
(who you cc'ed anyway, so I suppose they can help you better than some random 
KDE hacker like me). They will also be able to help you with putting the new 
version on the KDE servers so that the new version can be downloaded/updated 
in Kate's configure dialog in older versions, too.

 Cc: to lilypond-user for anyone using Lilypond+KDE who might find it useful

Thanks a lot!

Cheers,
Reinhold
- -- 
- --
Reinhold Kainhofer, Vienna University of Technology, Austria
email: [EMAIL PROTECTED], http://reinhold.kainhofer.com/
 * Financial and Actuarial Mathematics, TU Wien, http://www.fam.tuwien.ac.at/
 * K Desktop Environment, http://www.kde.org, KOrganizer maintainer
 * Chorvereinigung Jung-Wien, http://www.jung-wien.at/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFHBrTkTqjEwhXvPN0RAnMRAJ4hi77xeEKUb3k6KnNuUInxkiAcFACgvtNq
0PRlmWq/f30bx8gTBdzrCII=
=qWoo
-END PGP SIGNATURE-


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Syntax Highlighting / lilypond.words.vim

2004-02-11 Thread Lyle Raymond
 I apparently need to find lilypond.words.vim for the
 operation to be complete.  Where can I get it?

It should be distributed with LilyPond.  You don't say which
package you installed so we can't help more; recent Debian
packages put it into /usr/share/doc/lilypond.  Tell at least
a version number so that somebody can send one to you.
-- 
Feri.

I'm using Lilypond ver. 2.1.0.



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


Syntax Highlighting / lilypond.words.vim

2004-02-10 Thread Lyle Raymond
I spend most of my time editing in vi, so I cut and pasted Heikki Junes' 
lilypond.vim file into /syntax and inserted the appropriate text into 
filetype.vim, but now I apparently need to find lilypond.words.vim for the 
operation to be complete.  Where can I get it?



___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


Re: Syntax Highlighting / lilypond.words.vim

2004-02-10 Thread Aaron
Hi Lyle,
I also use vim (gvim) for lilypond editing.
I am looking for others to who use vim to create some sort of group to 
work on an extented vim mode for lilypond.

I made a lilypond ftplugin for vim but it is now out of date and needs 
much debugging.

If you are interested or anyone else let me know.

also
The lilypond vim files that are missing I found by searching google and 
downloading them from the cvs.

Aaron





___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user


Re: Syntax Highlighting / lilypond.words.vim

2004-02-10 Thread Ferenc Wagner
Lyle Raymond [EMAIL PROTECTED] writes:

 I apparently need to find lilypond.words.vim for the
 operation to be complete.  Where can I get it?

It should be distributed with LilyPond.  You don't say which
package you installed so we can't help more; recent Debian
packages put it into /usr/share/doc/lilypond.  Tell at least
a version number so that somebody can send one to you.
-- 
Feri.


___
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user