Replies: 2 comments 6 replies
-
Hey! I just enabled GitHub discussions, it will be a good opportunity to evaluate this feature 😉
Since you are using a custom converter ( As you can see, this version correctly highlights the keyword
As far as I know, Highlight.js does not support such features by default but you can find community plugins maintained by the community:
Please note that you will need to adjust the HTML generated to accommodate these plugins. You can also take a look at https://prismjs.com/ which has a Line Highlight plugin and a Line Numbers plugin.
should generate something like: <pre class="line-numbers" data-line="1,4">
<code class="language-python">...</code>
</pre> to be compatible with Prism.js. I hope it helps, |
Beta Was this translation helpful? Give feedback.
-
FWIW, when I’ve looked at this (a long time ago) I tried various syntax highlighters and ended up just writing a simple lexer myself instead: https://github.com/matklad/rust-course/blob/master/lectures/template.js#L66. For my blog (which uses Ruby version of asciidoctor), the rouge syntax highlighter works well. It does feel like “I want to do syntax highlighting during the build process, in template.js” bit is missing from js tool chain (but maybe “just do it at render time in the browser” is the right call) |
Beta Was this translation helpful? Give feedback.
-
Hi.
Coming from Consider Using Asciidoctor for Your Next Presentation. I want to consider
asciidoctor-web-pdf
as a tool for my next presentation.Some basic question I want to ask:
hightlight.js:
Pygments:
Sorry for asking such type of question here. Since asciidoctor-web-pdf doesn't have IRC/discord.
If this un-appropriate. I will close and open each question in each issue.
Thank you for asciidoctor-web-pdf
Beta Was this translation helpful? Give feedback.
All reactions