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 class easily.
The program knows following languages:
- 1C
- AVR Assembler
- Apache
- Axapta
- Bash
- C#
- C++
- CSS
- DOS .bat
- Delphi
- Django
- HTML, XML
- Ini
- Java
- Javascript
- Lisp
- MEL (Maya Embedded Language)
- PHP
- Perl
- Python
- Python profile
- RenderMan (RIB, RSL)
- Ruby
- SQL
- Smalltalk
- VBScript
- diff
version 5.2
News
-
08.02.2009
Version 5.2
- at last it's possible to replace indentation TABs with something sensible (e.g. 2 or 4 spaces)
- new keywords and built-ins for 1C by Sergey Baranov
- a couple of small fixes to Apache highlighting
-
24.01.2009
Version 5.1
This is one of those nice version consisting entirely of new and shiny contributions!
- Vladimir Ermakov created highlighting for AVR Assembler
- Ruslan Keba created highlighting for Apache config file. Also his original visual style for it is now available for all highlight.js languages under the name "Magula".
- Shuen-Huei Guan (aka Drake) sent new keywords for RenderMan languages. Also thanks go to Konstantin Evdokimenko for his advice on the matter.
-
05.12.2008
Version 5.0
The main change in the new major version of highlight.js is a mechanism for packing several languages along with the library itself into a single compressed file. Now sites using several languages will load considerably faster because the library won't dynamically include additional files while loading.
Also this version fixes a long-standing bug with Javascript highlighting that couldn't distinguish between regular expressions and division operations.
And as usually there were a couple of minor correctness fixes.
Great thanks to all contributors! Keep using highlight.js.
-
22.09.2008
Version 4.3 comes with two contributions from Jason Diamond:
- language definition for C# (yes! it was a long-missed thing!)
- Visual Studio-like highlighting style
Plus there are a couple of minor bug fixes for parsing HTML and XML attributes.
-
20.07.2008
Version 4.2
The biggest news is highlighting for Lisp, courtesy of Vasily Polovnyov. It's somewhat experimental meaning that for highlighting "keywords" it doesn't use any pre-defined set of a Lisp dialect. Instead it tries to highlight first word in parentheses wherever it makes sense. I'd like to ask people programming in Lisp to confirm if it's a good idea and send feedback to the forum.
Other changes:
- Smalltalk was excluded from DEFAULT_LANGUAGES to save traffic
- Vladimir Epifanov has implemented javascript style switcher for test.html
- comments now allowed inside Ruby function definition
- MEL language from Shuen-Huei Guan
- whitespace now allowed between
<pre>and<code> - better auto-detection of C++ and PHP
- HTML allows embedded VBScript (
<% .. %>)