pygments as a syntax highligher

29 views
Skip to first unread message

gar

unread,
Mar 1, 2020, 7:44:40 AM3/1/20
to leo-editor
I tried to use pygments as a colorer for JS code. But encountered that when leo configured to use pygments - it colors any code as it was python code, no matter which @language is set atop of a node.
I suspect that it was tested with python only, or no other languages have been supported.
There are a really few info about leo+pygments (some words in the docs + a couple of issues on github + some threads here) so I could not find the answer.

Can please somebody advise me how to configure leo to use pygments to highlight js (and others like html, css, c++, .....) since original leo's highlighting schemes are very poor and outdated.

Also I would like to know can I extend existing pygments scheme for some language and teach leo to use this extended scheme
(for instance, I would like force JS colorer to color 'that' and 'self and support `such ${string} syntax` since pygments does not still able to do so)

Thanks in advance!

PS: I almost re-implemented JS scheme in jEdit approach and then thought that it's not necessary since leo can work together with pygments. Should I nevertheless continue with jedit? or take care on pygments way only?

Edward K. Ream

unread,
Mar 2, 2020, 7:04:42 AM3/2/20
to leo-editor
On Sun, Mar 1, 2020 at 6:44 AM gar <gar...@gmail.com> wrote:

I tried to use pygments as a colorer for JS code. But encountered that when leo configured to use pygments - it colors any code as it was python code, no matter which @language is set atop of a node.

Thanks for this report. I have just created #1520 for this.

Edward
Reply all
Reply to author
Forward
0 new messages