FlipperPA / wagtailcodeblock

StreamField code blocks for the Wagtail CMS with real-time PrismJS Syntax Highlighting.
BSD 3-Clause "New" or "Revised" License
149 stars 31 forks source link

Switch to Highlight.JS from PrismJS - Discuss #44

Open FlipperPA opened 4 months ago

FlipperPA commented 4 months ago

PrismJS no longer seems to be maintained. There are also some underlying issues with CSS namespacing that conflict with Wagtail's admin, particularly around the CSS class named comment.

I'm considering switching to highlight.js as our underlying syntax highlighting library.

Pros:

Cons:

I wanted to open this issue for discussion to our users before moving in this direction. Thoughts?

vsalvino commented 4 months ago

If you wanted to switch to backend rendering / pygments, I have my old implementation archived here, which you're free to rip off: https://github.com/vsalvino/coderedcms-codeblock

The one thing I'd do differently is change the language list dropdown to a user-entered string instead, as the list is HUGE.

smark-1 commented 2 months ago

Highlight.js does not support line numbering. Is line numbering going to still be supported?

FlipperPA commented 2 months ago

@smark-1 There seems to be a plugin we can leverage, but good question:

https://github.com/wcoder/highlightjs-line-numbers.js/