Highlight.js highlights syntax in code examples on blogs, forums and in fact on any web pages. It's very easy to use because it works automatically: finds blocks of code, detects a language, highlights it.
This is not only convenient but also allows highlighting for code examples marked up with writing syntaxes like Markdown where there is no way to specify HTML
The library knows 54 languages and is bundled with 26 style themes.
Developers and designers are welcome to take part in development.
Since this version highlight.js no longer works in IE version 8 and older. It's made it possible to reduce the library size and dramatically improve code readability and made it easier to maintain. Time to go forward!
Improvements to existing languages:
Also Oleg Efimov did a great job of moving all the docs for language and style developers and contributors from the old wiki under the source code in the "docs" directory. Now these docs are nicely presented at http://highlightjs.readthedocs.org/.
A regular bug-fix release without any significant new features. Enjoy!
A Summer crop:
- Marc Fornos made the definition for Clojure along with the matching style Rainbow (which, of course, works for other languages too).
- CoffeeScript support continues to improve getting support for regular expressions.
- Yoshihide Jimbo ported to highlight.js five Tomorrow styles from the project by Chris Kempson.
- Thanks to Casey Duncun the library can now be built in the popular AMD format.
- And last but not least, we've got a fair number of correctness and consistency fixes, including a pretty significant refactoring of Ruby.
The reason for the new major version update is a global change of keyword syntax which resulted in the library getting smaller once again. For example, the hosted build is 2K less than at the previous version while supporting two new languages.
The new unique feature (apparently) among syntax highlighters is highlighting HTTP headers and an arbitrary language in the request body. The most useful languages here are XML and JSON both of which highlight.js does support. Here's the detailed post about the feature.
Nginx syntax has become a million times smaller and more universal thanks to remaking it in a more generic manner that doesn't require listing all the directives in the known universe.
Function titles are now highlighted in PHP.
And last but not least, many bugs have been fixed around correctness and language detection.
Overall highlight.js currently supports 51 languages and 20 style themes.
A lot of things happened in highlight.js since the last version! We've got nine new contributors, the discussion group came alive, and the main branch on GitHub now counts more than 350 followers. Here are most significant results coming from all this activity:
- 5 (five!) new languages: Rust, ActionScript, CoffeeScript, MatLab and experimental support for markdown. Thanks go to Andrey Vlasovskikh, Alexander Myadzel, Dmytrii Nagirniak, Oleg Efimov, Denis Bardadym and John Crepezzi.
- 2 new style themes: Monokai by Luigi Maselli and stylistic imitation of another well-known highlighter Google Code Prettify by Aahan Krish.
- A vast number of correctness fixes and code refactorings, mostly made by Oleg Efimov and Evgeny Stepanischev.