redhataccess / ascii_binder

AsciiBinder is an AsciiDoc-based system for authoring and publishing closely related documentation sets from a single source.
https://asciibinder.net
MIT License
76 stars 39 forks source link

Use rouge syntax highlighter #153

Closed jboxman closed 4 years ago

jboxman commented 4 years ago

This PR changes the highlighter to rogue, a Ruby based syntax highlighter. It requires asciidoctor 2.0.0 or newer, however.

cc @vikram-redhat

vikram-redhat commented 4 years ago

I vaguely remember asciibinder barfing on any asciidoctor over 1.5.7. Have you run this locally with asciidoctor 2.0.0 and asciibinder runs ok?

jboxman commented 4 years ago

So far, the only issue for master and enterprise-3.11 are these warnings where applicable:

asciidoctor: WARNING: found deprecated footnoteref macro: footnoteref:[bastionnode, The Bastion node is part of the OCP network and is used to orchestrate the performance and scale tests.]; use footnote macro with target instead
gem list asciidoctor

*** LOCAL GEMS ***

asciidoctor (2.0.10)
asciidoctor-diagram (2.0.2, 1.5.11)
vikram-redhat commented 4 years ago

Thanks. I am also getting gem rouge not found when running asciibinder. Don't we need to add that as a dependency?

vikram-redhat commented 4 years ago

Also - could you post a screenshot of it working with the new highlighter?

jboxman commented 4 years ago

@vikram-redhat, yes, that can be a dependency; I didn't know if we want to break backwards compatibility with earlier asciibinder versions. If so, that's easy; If not, need to make this configurable and set the default back to Coderay.

Rouge requires a style sheet and adds CSS classes at build time. There are a variety to choose from. The current highlighter, Coderay, is JavaScript based and injects its styling at runtime.

3.11

Screen Shot 2020-04-26 at 10 48 37 PM

4.4

Screen Shot 2020-04-26 at 10 49 28 PM
vikram-redhat commented 4 years ago

I feel uncomfortable changing it this week. Let's revisit this next week when 4.4 is out.

jboxman commented 4 years ago

This only applies when a highlight style is specified:

[source,<lang>]

Blocks without the preamble are ignored.

jboxman commented 4 years ago

@vikram-redhat thoughts on this?

vikram-redhat commented 4 years ago

Let's talk about it in our 1 * 1 tomorrow.

jboxman commented 4 years ago

@vikram-redhat pushed without the extraneous file.

jboxman commented 4 years ago

@vikram-redhat, any news?

vikram-redhat commented 4 years ago

@jboxman merging this and after doing some local testing will republish the gem. Thanks for this!