asciidoctor / asciidoctor.org

:globe_with_meridians: Asciidoctor project site. Composed in AsciiDoc. Baked with Awestruct.
https://asciidoctor.org
Other
322 stars 807 forks source link

Setting Rouge style attributes not explained in documentation #964

Closed mcp292 closed 3 years ago

mcp292 commented 3 years ago

The rouge-style attribute is mentioned in the documentation, but no usage is shown.

I tried putting this under my doc title

= Title
:source-highlighter: rouge
:rogue-style: thankful-eyes

but it has no effect.

I also tried

[source,c,rouge-style=thankful-eyes]

above the code block with and without quotes around the value.

mojavelinux commented 3 years ago

You almost had it correct in your first example, except that you have spelled Rouge incorrectly (rogue instead of rouge). It should be:

= Title
:source-highlighter: rouge
:rouge-style: thankful-eyes

[source,ruby]
----
puts "Hello, World!"
----

I also tried ... above the code block with and without quotes around the value.

The syntax highlighter theme is a global setting, so it will not work if you try to define it using a block attribute. It must be defined as a document attribute in the header.

mcp292 commented 3 years ago

Haha! Good catch! Thank you!

mojavelinux commented 3 years ago

This is now documented here: https://docs.asciidoctor.org/asciidoctor/latest/syntax-highlighting/rouge/#rouge-attributes