8 Powerful syntax highlighters for code snippets

8 Powerful syntax highlighters for code snippets

In web technology world, snippet sharing is one of the most common tasks for developers. Right now, developers are developing new snippets regularly and they can easily share them in their own blog or other popular social bookmarking websites. As a result web technologies are growing rapidly.

If you have some snippets and want to share them then you come in right place. You can easily integrate following scripts in your website or blog and highlight your snippet in smart way. You know, people love to learn about new snippets and if you present then a nice way with syntax highlighters in your blog then I’m sure they must love you and your blog.

It’s a great challenge for web developers to represent their snippets in their blogs. Because PHP, HTML, CSS , jQuery snippet run as a normal code when you are trying to show them in your blog. Syntax highlighters are preventing them from execution as a normal code.

You can found lots of syntax highlighter tools over internet. From them I’ve tried to make a nice list, that will help you for presenting your snippet beautifully. The list below made up of the best syntax highlighter and most of them are providing you highest quality and they are easy to use as well as very simple to configure. You can give them a try. So, let’s go –

– SyntaxHighlighter:

SyntaxHighlighter

SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.

This is a flexible & extensible syntax highlighter built with JavaScript. It supports a wide range of languages from CSS to PHP or C++ to SQL. SyntaxHighlighter offers ready-to-use themes an new ones can be created easily for a custom presentation.

http://alexgorbatchev.com/SyntaxHighlighter/

– Google Code Pretify:

Google Code Pretify

A Javascript module and CSS file that allows syntax highlighting of source code snippets in an html page.

Features:

1. Works on HTML pages

2. Works even if code contains embedded links, line numbers, etc.

3. Simple API : include some JS&CSS and add an onload handler.

4. Lightweights : small download and does not block page from loading while running.

5. Customizable styles via CSS. See the themes gallery

http://code.google.com/p/google-code-prettify/

– GeSHi:

geshi

GeSHi aims to do this all as quickly as possible. Many customisable features of GeSHi facilitate speed increases, and you can easily find a balance between the amount of highlighting done and the speed in which it is done.

GeSHi supports PHP5 and Windows, and has even been used to highlight code on ASP pages. Numerous blogs, wikis and forums use GeSHi, including Dokuwiki, Mambo, phpBB and WikkaWiki.

http://qbnz.com/highlighter/index.php

– Ultraviole:

Ultraviole

Ultraviolet is a syntax highlighting engine based on Textpow. Since it uses Textmate syntax files, it offers out of the box syntax highlighting for more than 50 languages and 20 themes.

Ultraviolet is at the same time a stand-alone command line utility and a Ruby library.

http://ultraviolet.rubyforge.org/

– Pygments syntax highlighter:

pygments syntax highlighter

It is a generic syntax highlighter for general use in all kinds of software such as forum systems, wikis or other applications that need to prettify source code.

Highlights Features are:

1. A wide range of common languages and markup formats is supported

2. Special attention is paid to details that increase highlighting quality

3. Support for new languages and formats are added easily; most languages use a simple regex-based lexing mechanism.

4. A number of output formats is available, among them HTML, RTF, LaTeX and ANSI sequences it is usable as a command-line tool and as a library.

http://pygments.org/

– Highlight.js:

Highlight.js

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 library knows 46 languages and is bundled with 18 style themes.

http://softwaremaniacs.org/soft/highlight/en/

– Syntax Highlighting in JavaScript:

Syntax Highlighting in JavaScript

SHJS is a JavaScript program which highlights source code passages in HTML documents. Documents using SHJS are highlighted on the client side by the web browser. SHJS uses language definitions from GNU Source-highlight. This gives SHJS the ability to highlight source code written in many different languages

http://shjs.sourceforge.net/

– Lighter:

lighter.js

Lighter is a free syntax highlighting class developed for MooTools. It was created with the MooTools developer in mind and takes advantage of many of the Framework’s features. Using it can be as simple as adding a single script to your webpage, selecting the elements you wish to highlight, and Lighter takes care of the rest. It is currently in use on the MooTools forge so you are seeing it in action right there.

https://github.com/pradador/Lighter/

Was this information useful? What other tips would you like to read about in the future? Share your comments, feedback and experiences with us by commenting below!

Total 0 Votes
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Leave a Comment

Back To Top