Dave's Brain

Browse - Programming Tips - Which php syntax highlighter should I use?

Date: 2016feb1
Language: php

Q.  Which php syntax highlighter should I use?

A.  There appear to be 2 major ones.
They both have similar usage.  They both include plugins for several languages.
Either can detect language.

geshi

Good:
- Included as a package with my distro (php-geshi)
- Supports more languages than hyperlight (including java)
- Can turn keywords into links

Other:
- Uses hardcoded properties (eg color) its output html which is a bit ugly.  But then
you don't need to include a style sheet.


hyperlight

Bad:
- Doesn't support java highlighting

Other:
- Uses css class names in output html which is better style but then you need
to include the style sheet in your website

javascript

There are a few javacript highlighters too.

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.