Syntaxhighliters with Hugo / Asciidoc

Hello Hugoers,

I am looking for a way to use the built-in syntax highlighters with asciidoc documents - so far I got it working - but only without linenumbering…

Please enlight me how I use it with line numbering enabled.

Best,

Sven Wehrend

How? Are you using rouge as documented here? Or a shortcode? Or something else?

Yes, using rouge - but I’d like to get with the built-in Chroma…

[markup.highlight]
lineNos = true
lineNumbersInTable = true
style = “monokai” # Hier wird das Dark Theme festgelegt
noClasses = true # Sorgt dafür, dass Hugo das CSS direkt einbettet

[markup]
[markup.asciidocExt]
workingFolderCurrent = true
[markup.asciidocExt.attributes]
toc = “left”
toclevels = “2”
source-highlighter = “hugo”

previously it was rouge

[source,cpp,linenums]

#include
using namespace std;

int main() {

cout << "Hello World" << "\\n";
return 0;

}

With AsciiDoc content, if you want to use chroma instead of rouge, you must use the highlight shortcode instead of a listing block.

I will try that. Thanks!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.