lilypond-devel
[Top][All Lists]
Advanced

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

Re: Allura code highlighting


From: Urs Liska
Subject: Re: Allura code highlighting
Date: Wed, 9 Sep 2015 16:25:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0


Am 09.09.2015 um 15:56 schrieb Simon Albrecht:
> Hello,
>
> Trevor has already introduced a warning to use ~~~~ delimiting for .ly
> code blocks. Now I noticed that Allura imposes some code highlighting
> by default, and pygments (the tool used) doesn’t make a good guess on
> the language. Unfortunately, it doesn’t support LilyPond (yet?).
> I couldn’t figure out how to turn of highlighting, but I can recommend
> using TeX until we have a better solution:
> "
> ~~~~
> :::TeX
> % here comes the lily code
> ~~~~
> "
>
> Wilbert, excuse my straightforwardness. Allura uses a python tool,
> Pygments, for code highlighting, and I thought it might be possible to
> reuse code from python-ly to provide a LilyPond lexer for Pygments.
> Perhaps you could take a look at the documentation on
> <http://pygments.org/docs/> and see if that is possible?

Is it possible to "feed" code through some external script like
different templating engines do. I successfully implemented such a
script to do lilypond highlighting through python-ly
using a plugin infrastructure (https://github.com/GitbookIO/plugin).

See
https://git.openlilylib.org/oll/book/blob/master/node_modules/gitbook-plugin-lilypond-styles/index.js
and
https://git.openlilylib.org/oll/book/blob/master/python/colorize-lilypond

If it's possible to hook an external script into Allura something like
that should not be too complicated.

Urs

>
> Best regards,
> Simon
>
> _______________________________________________
> lilypond-devel mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-devel




reply via email to

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