Skip to content
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

Replace pygmentize #2

Closed
jzaefferer opened this issue Jul 11, 2012 · 6 comments
Closed

Replace pygmentize #2

jzaefferer opened this issue Jul 11, 2012 · 6 comments

Comments

@jzaefferer
Copy link
Member

pygmentize has some serious issues. For examples, look at http://stage.qunitjs.com/intro/ - the red outlines around various JavaScript symbols are the worst offerenders. But that's not all: Scripts within html blocks don't get highlighted in general, and the detection for JS blocks seems pretty broken, or at least the JS highlighting is abysmal (look for the "Here’s the contents of prettydate.js:" example).

That along with the fact that pygmentize is by far the slowest part of our deploy pipeline should make it worth to find or create a replacement.

The only node module I found so far is highlight.js https://github.com/isagalaev/highlight.js - I think we've looked at that before, and I can't remember what the issue was. Lack of line numbers?

@rdworth any thoughts?

@jzaefferer
Copy link
Member Author

If lack of line numbers is the only issue with highlight.js: We could just add that on top, as the line number element is completely separate from the highlighted code anyway.

@rdworth
Copy link
Contributor

rdworth commented Jul 16, 2012

I did some work last week on getting pygmentize to highlight css and js blocks inside highlighted html without getting tripped up (even when it doesn't get tripped up, with html only it leaves <script> and <style> without color). It is a bit convoluted atm and needs some serious cleanup, but I'm hoping to get it wrapped up this week.

I'm not sure if I looked at that one in detail at the time or if someone else did. I'm happy to take another look. Maybe we could add line number support to it (as you suggest), based on the markup pygmentize has proven to work.

@jzaefferer
Copy link
Member Author

Okay, can you share what you've got so far? Put it in a branch on the node-pygmentize repo? This issue is currently block a rather big qunitjs.com content update to go live...

@rdworth
Copy link
Contributor

rdworth commented Jul 16, 2012

As for perf/speed, I think we should add some smarts to only rebuild files that have changed since the last build based on hashes. And if you want to rebuild all you just run grunt clean to bust the cache.

@rdworth
Copy link
Contributor

rdworth commented Jul 16, 2012

I'll see what I can do, yeah

@ajpiano
Copy link
Member

ajpiano commented Jul 18, 2012

https://github.com/thlorenz/node-syntaxhighlighter is a wrapper around the robust SyntaxHighlighter library (written in JS)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants