Closed vadimkantorov closed 2 months ago
Our scopes are documented if you wanted to do a conversion - or write a tool to do so. (port your CSS scopes to our CSS scopes)
https://highlightjs.readthedocs.io/en/latest/css-classes-reference.html
Or if you just want to try and convert the generated HTML to use your own class names, that's just string manipulation - something that could also be automated.
I'm not aware of anyone already doing this work.
Thank you for your response!
Yeah, I wonder if it's possible to pass directly to highlighjs
the CSS classes to use in place of its standard class names? As a workaround, as you say, I can post-process the Pygments CSS and rename its class names to match hljs class names, but if it's possible to simply configure hljs to use custom class names, it would be cleaner
Yeah, I wonder if it's possible to pass directly to highlighjs the CSS classes to use in place of its standard class names?
No. But as I said string substitution in JS is pretty simple to do...
Jekyll used to use
pygments
and later onrouge
(can consumepygments
themes) for code highlighting.E.g. https://github.com/jekyll/minima theme produces the following code highlighting CSS for the light theme.
Is there a way to reuse these themes or these CSS classes for
highlightjs
browser-side code highlighting?The usecase would be to continue using
minima
highlighting pygments themes / CSS, but without jekyll SSG preprocessing (e.g. I'm usingminima
css in my own handrolled client-side Markdown renderer, so I'd like to usehighlightjs
)