SOLVED: Rainbow.js doesn't work

Since my personal opinion is that line numbers are important to code examples, and since the concept seems to be an anathema to the author of highlight.js, I decided to try out one of the other examples listed in the docs: rainbow.js.

I added the css theme to the head and the inclusion of rainbow.js to the foot (the docs don’t mention a specific highlight method, so it looks like it’s called implicitly).

I can’t seem to get it to work though. Looking through the docs for rainbow.js, it seems that it needs code blocks to be defined like so:

<pre><code data-language="mylang">code here</code></pre>

Whereas Hugo renders them like this

<pre><code class="language-mylang">code here</code></pre>

Am I missing something? Is there something else I need to do, or is rainbow.js not an option in the current codebase?

They don’t mention this in the docs, but it turns out rainbow.js DOES support this. The problem was that matching theme file I downloaded had a dash instead of an underscore and wasn’t getting properly applied. So static/css/highlight/solarized_dark needed to be static/css/highlight/solarized-dark. I am ashamed at how difficult that was to track down :frowning: