(Pandoc) Nix KDE Syntax Highlighting

Hi, wonderful folks in nixland,

I noticed that Pandoc does not support nix as a language for syntax highlighting. I was pointed to https://github.com/KDE/syntax-highlighting/tree/master/data/syntax as a place to add a KDE-style nix.xml file, but before diving into that world I know nothing about, I wanted to ask 3 questions:

  1. Has anyone already done this and want to share it?
  2. If not, does anyone else want to do this? (selfish question)
  3. If not, does anyone have any tips on where to find all the information around the nix language specification?

Thanks for your time!

3 Likes

I’m also looking into this. I won’t have time to pull this off by the time of my next presentation though.

An idea for later would be to start with https://github.com/KDE/syntax-highlighting/blob/94260da326255d0133d1e02e66f80f580e751d2b/data/syntax/json.xml and modify it to catch at least nix keywords (let, in, etc.) and matching brackets (normal, curly, square). Maybe some effort done in First effort at writing a Nix lstlisting language definition. · GitHub could be reused?

1 Like

FWIW, I did a basic syntax definition for a Pandoc presentation some time ago.

4 Likes

Did you ever get anything close to PR-able? :pray: