Live data from Hacker News

PrismJS

prismjs.com

1–10 of 26 posts

Re: PrismJS

#4

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.

Re: PrismJS

#9
post #6

Not working in Opera 12.00 Build 1467 on OS X 10.7.4 Pretty in Chrome Canary Version 22.0.1221.0 though.

Neither working (and so far the only really bad rendering issue I've seen) on Android, using Firefox Beta.

The code snippets are overlayed with black 'blocks'.

Re: PrismJS

#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 uses the name you gave them. This means the coloring is exactly as customizable as it is in Emacs. It is also very easy to theme with CSS to match your site if you don't like any of the Emacs color themes.

Post reply on HN