JavaScript syntax highlighters
I'm really into writing documentation, and very often, this documentation must include code samples.
I wanted a JavaScript syntax highlighter that:
I went searching around for JavaScript syntax highlighters, and these are the top three that met my criteria.
I wanted a JavaScript syntax highlighter that:
- involved very little hassle in setting up,
- worked like a real parser using parse trees to ensure accurate highlighting,
- and provided decent coverage of the most common programming languages in use today.
I went searching around for JavaScript syntax highlighters, and these are the top three that met my criteria.
- Javascript code prettifier. This was the first decent one that I found. It's pretty basic but I got up and running very quickly. The documentation is sparse and the tone of the README quite terse, but it meant there was less for me to sift through. The neat thing about it is that it has automatic language detection.
- SHJS. This is more full featured than the Google tool, and supports a wider range of languages. It appears to be more mature than the other two. Unlike the Google solution, it doesn't offer automatic detection of programming languages.
- JUSH. I'd like to check it out in more detail later on, but the website says it only supports HTML, CSS, JavaScript, PHP and SQL. I needed highlighting of Java and Ruby, not to mention C and C++.
Comments