Open tajmone opened 5 years ago
Since the creation of this issue, I've updated various times my custom version of highlight-treeprocessor_mod.rb
— now it fully supports substitutions, correctly allows using line-numbering, and even allows enforcing custom syntax definitions over built-in syntaxes via env vars.
Basically, it's now possible to use Highlight for the HTML backend of every document that doesn't use call-outs.
On the one hand, I'm tempted to switch to Highlight all those docs that don't use call-outs, but on the other hand I think that call-outs are such a cool feature that it might be best to wait that Highlight supports them. The problem here is that, in the meantime, Asciidoctor switched to a new syntax highlighter interface, so my extension is already obsolete (although it works).
I wish I knew Ruby better, for I looked into the new Asciidoctor API for highlighters, but I just can't hack my way through it (I've lost count of the hours spent in attempting to solve this).
Unfortunately, it seems that Highlight integration has a very low priority in the Asciidoctor agenda (even though Highlight is one of the oldest highlighters on the scene, and the one offering more built-in syntaxes than any other, more energy has been invested in other highlighters).
I could really do with some help from someone fluent in Ruby!!! Together we could quickly create an extension using the new Asciidoctor API 2.0 and settle the matter of Highlight integration once and for all.
EDIT — moved to #107!
This problem of adding callouts support to Highlight has been pending a solution for so many years that I think it might be worth considering switching to Rouge instead, and create an ALAN definition for it.
Rouge has the following pros and cons over Highlight:
v2.0.0
update will be released, syntax highlight via Rouge won't break (whereas our Highlight extension will probably stop working).See:
Follow also this new Issue I've opened:
Now that we can also use Rouge for highlighting, Highlight is only used for those documents which need to add spans or highlight/marked to code blocks (which is currently unsupported in Rouge), so fixing the HL ADoc Extensions is no longer a high priority (still, it would be nice to see it done).
Update the
highlight-treeprocessor.rb
extension to add support for callouts in Highlight extension, so that Highlight can be used instead of Highlight.js for syntax highlighting HTML-based backends.This is prefarable to using Hihglight.js for it allows static syntax highlighting, easier usage of custom syntaxes, and because Highlight offers more options to customize results.
For more info, see #99: