On Fri, Oct 22, 2021 at 4:42 AM Seb Astien <
babo...@gmail.com> wrote:
> thanks for helping but it is still not highlighting anything...
The two examples which use "~~~ language" seem to be working
correctly. Inside the HTML, we can see that `rouge` tokenized the code
into distinct elements, each with the appropriate CSS class:
<div class="language-ruby highlighter-rouge">
<div class="highlight">
<pre class="highlight">
<code>
<span class="k">def</span>
<span class="nf">hi</span>
<span class="p">()</span>
<span class="nb">puts</span>
<span class="s2">"hi"</span>
<span class="k">end</span>
</code>
</pre>
</div>
</div>
> I may completely mistaken, but I expect that nanoc would propose a kind of code rendering like my editor out of the box.
> But, even if the output html looks ok, as I don't have css class like language-ruby highlighter-rouge in my project, the code is not highlighted.
> Should I create the specifics css by myself ?
You could create it by hand, but the `rouge` website says that it is
compatible with Pygments stylesheets, which means you should be able
to download and use an existing stylesheet easily. A quick Google
search results in some possibilities:
https://richleland.github.io/pygments-css/
https://github.com/Anomareh/pygments-styles-dump