I have working syntax highlighting in Hugo 0.29, but not as good as I get with chroma standalone, and I’m wondering why…
Portion of my config:
pygmentsCodeFences: true
pygmentsUseClasses: true
In my hugo generated HTML, the tags have class names that look like s7d2 (for NameBuiltin), whereas with chroma standalone I get class names that look like nb (for NameBuiltin).
- Why does it generate different class names than chroma?
- Is it possible to use the original class names that chroma uses?
- Why does standalone chroma do better highlighting? For example:
echo '(setq test "test")' | chroma -l emacs-lisp --html
With chroma standalone I get:
<span class="nb">setq</span> <span class="nv">test</span> <span class="s">&
#34;test"</span>
But with hugo I get:
<span class="s7d0">setq</span><span class="s1f40"> </span><span class="s7d0">test</span><span class="s1f40"> </span><span class="sc1c">"test"</span>
The problem being that hugo applies the same class to both the setq and test, so I cannot style them differently, whereas standalone chroma applies different classes: the setq gets bolded, and test does not.
I’m assuming s7d0 is a default catch-all class? hugo gen chromastyles doesn’t even output that one.
Hi! I ran into a similar issue when upgrading to 0.29, and got the old behavior back using