Custom words for highlighting


My problem is that the code I’m trying to highlight is not recognized by the highlighter. The word in question is a typedefed “custom” datatype, which should, like other datatypes be .kt. But since it’s not recognized as a datatype, it’s being assigned the .n class.

Is there any way to add a list of keywords and what class they should belong to for the highlighter?

Thanks in advance!

No. The lexers provided by the Chroma syntax highlighter are not extensible at run time.

I understand that and I wasn’t talking about runtime. I was asking for ANY way to do what I wanted. I know a config.toml file can be used to get classes instead of inline styles and wondered if there was some simple way to include some sort of list there.

By runtime jmooring means when you run (or configure) Hugo. Chroma is built when the Hugo binary is built and and the list of lexers is built into the binary.

Chroma does not have a ‘custom logic’ thing you can do (such as adding words to highlight with certain classes). Indeed doing so would probably not be correct for code syntax highlighter as usually not just the word matters, but what type of context it is in.