Live data from Hacker News

PrismJS

prismjs.com

11–20 of 26 posts

Re: PrismJS

#11

Can anyone compare this to CodeMirror which seems to include this functionality and much, much more?

CodeMirror is a "full" syntax highlighted code editor. This is just a syntax highlighter for embedding code examples in your site/blog.

Right, but CodeMirror can be used as a simply syntax highlighter as well.

Re: PrismJS

#12
post #10

Is there any particular advantage to using something like this for static code samples instead of just pre-rendering the HTML and CSS? I usually just export my code from Emacs via M-x htmlfontify-buffer which dumps a bunch of CSS and HTML. This also allows me to take advantage of my different Emacs themes. It also outputs CSS with good class names like "string" or "keyword". If you add your own custom faces, it just…

I have used Vim's similar feature, `:TOhtml`.

Re: PrismJS

#14

Earlier quoted context omitted.

CodeMirror is a "full" syntax highlighted code editor. This is just a syntax highlighter for embedding code examples in your site/blog.

Right, but CodeMirror can be used as a simply syntax highlighter as well.

This one is around 2k in size, therefor "lightweight"

Re: PrismJS

#15
I don't think the author really understands IE usage patterns. The majority of IE6 usage isn't individuals who don't know better, its companies who should know better. Hence, you'll still get plenty of intelligent coders using IE.

Re: PrismJS

#18
OK, seems like alot of work just to get a colorscheme on some embedded code....I can't imagine the mindframe you would be in to undertake this project.

More important things to do?

Re: PrismJS

#19
post #15

I don't think the author really understands IE usage patterns. The majority of IE6 usage isn't individuals who don't know better, its companies who should know better. Hence, you'll still get plenty of intelligent coders using IE.

Intelligent coders should know better than to be forced to work with IE6. What would be the server side technology in this case? JSP filled with code and SQL or ASP classic?

Re: PrismJS

#20

If you want an even smaller (sans jQuery) JS highlighter that doesn't fail on edge cases, check my jQueryJSH: http://www.phoboslab.org/files/jquery-jsh/ github: https://github.com/phoboslab/jQuery-JSH

1) How do I know it doesn't fail on the same edge cases Prism might fail on? I see no tests.

2) Do you really need jQuery there? You seem to be using it only for the html method, and including 93K extra JS instead of just using innerHTML seems a bit overkill.

Post reply on HN