-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static highlighting #11
Comments
Some options:
There are many other options of course |
Just adding Wouldn't use it as a default to not have it as a dependency, but it might be nice as an alternative. I use it when exporting Org files to LaTeX and HTML. I like it, because of the large number styles it ships with and in my experience it just works. I've never used it as a library though, so I don't know how easy it is to interface with from that point of view. |
@Vindaar the chroma tool I linked actually uses pygments definitions under the hood - "Chroma is based heavily on Pygments, and includes translators for Pygments lexers and styles." |
Oh, haha. I thought it was a pure Go solution. |
nonono, you're right in that it's a pure Go solution, but it uses existing Pygments definitions to not reinvent the wheel |
A rough prototype of using Nim's nbDoc.context["no_default_highlight"] = true
nbDoc.partials["style"] = """
<link rel='stylesheet' href='https://cdn.jsdelivr.net/gh/pietroppeter/nimib/assets/atom-one-light.css'>
""" after |
@pietroppeter when you'll implement your idea with splitting the rendering backends I'll add this highlighting myself, or you can add it yourself earlier if you want :) |
hey @Yardanico, thanks for this it looks very nice and exactly in the direction I wanted it to go! Also, I think the render refactoring is orthogonal to this change, I can do it later. If you want to open a PR I would be very happy and we can take it from there! As for code structure, you could add a |
fixed by #14 (additional commits in #15). In the end the only thing that got lost from removing highlight.js is the highlighting the pragmas which is not straightforward to do with the pure nim highlite approach so the tradeoff is still very much on the positive side (I also do not currenlty have any pragmas in the example code). Thanks a lot @Yardanico! |
putting here for future reference work by @Yardanico reported in #science channel (not logged) of how one could improve nim highlite to somewhat parse pragmas:
|
there's no really need to add javascript to highlight stuff at runtime. I should be able to do it when rendering html.
there was some discussion today in IRC #science channel (which unfortunately is not logged).
The text was updated successfully, but these errors were encountered: