lilypond-user
[Top][All Lists]
Advanced

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

Re: Syntax highlighting


From: Federico Bruni
Subject: Re: Syntax highlighting
Date: Tue, 14 Jan 2020 12:27:21 +0100



Il giorno mar 14 gen 2020 alle 09:13, Craig Dabelstein <address@hidden> 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/






reply via email to

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