Help Wanted: addition of a Go Template lexer to Chroma?

Anybody motivated ? :smiley:

@kaushalmodi I see you started a ticket for an Org-mode lexter, any luck with that?

I used Prism and decided to switch to Hugo bundled Chroma! So nice, but it lacks Go Template lexter :frowning:

No, that’s still on my todo list. Need to start learning to write Pygments/Chroma lexers.

1 Like

Up up!
Hugo’s built-in syntax highlighter (Chroma) does not have a lexer for Go Template. Too bad it’s used a lot in Hugo docs and as more people will want to blog about Hugo, this would be a nice feat to have on Hugo built websites.

If anyone is good with lexical analysis it may not take him/her too much time to do this. There’s already a few templ. lang. lexer to fork from (twig among them).

Thanks :pray:

1 Like

Chroma’s creator @alecthomas just closed the issue, can’t wait to try it out.

1 Like

It’s almost there… once this issue is resolved.


… and it’s fixed :smiley:

Update 2:

Just a minor mis-highlighting, but otherwise looks great!

… Also the Go templating code blocks need to now be tagged with go-html-template language in the doc site.

Update 3:

Many thanks to Chroma dev Alec Thomas! Now that issue is fixed too!