chroma-highlighted code, grabs the
data-lang attribute, and creates a custom
<div> above the code block that contains the name of the code language. I call these
<div>s “codeblock headers” because they tell readers the language of the code they’re reading. It looks like this:
<div class="codeblock-header">language here</div> before every block of code in my markdown. Besides, I already put the name of the language in the opening code fence, so I should be able to make use of that.
pre.chroma element and its children, so that when i run
As a workaround, I wrote some
hugo serve, because
hugo serve doesn’t act nicely when you modify the HTML it spits out, and I have to have a separate script watching for
hugo serve to spit out HTML so I can modify it using my
Is there a way for me to customize the way
Hugo creates these syntax-highlighted portions, so that these headers are created automatically?