Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Asciidoctor Highlight.js

We should take a look at @jirutka's Asciidoctor Highlight.js extension for it allows to use HLJS at convert time and free the final document from the need of loading HLJS package — thus making the docs truely portable to any HTML based format, including CHM, ePub, Mobi/Kindle, etc.

This project provides an Asciidoctor.js extension for highlighting source listing blocks using highlight.js right during document conversion (instead of in browser on client-side as the built-in highlight.js support).

It supports all Asciidoctor features such as callouts, passthroughs inside a code and all other substitutions, except highlighting of specified lines (attribute highlight).

This is an Asciidoctor.js extension, so it would require an alternative toolchain to the Ruby version, which might preclude using other Ruby-only extensions (not really sure of the implications). We might still rely on this for specific formats like CHM, etc.

Local tests and more digging are required, and this thread will be used to aggregate notes, links and discussions on evaluating the pros and cons of this alternative approach.

You must be logged in to vote

Replies: 2 comments

Comment options

This is an Asciidoctor.js extension, so it would require an alternative toolchain to the Ruby version

If you use Asciidoctor (Ruby), then asciidoctor-rouge is the way to go -- it's the same as asciidoctor-highlight.js, but written in Ruby and using Rouge (great code highlighter written in Ruby) instead of Highlight.js.

You must be logged in to vote
0 replies
Comment options

tajmone
Oct 17, 2018
Maintainer Author

Thanks a lot @jirutka ! But I have already created a custom syntax definition for the project, using HLJS, so I'm trying to stick to it. I had looked into Rouge and how to create new syntaxes, but it seems to introduce unneeded complications (the syntax at hand is quite simple, no need to use states stacking).

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #29 on May 23, 2021 23:43.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.