Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good syntax highlighter? [closed]

Tags:

jquery

php

mysql

I'm looking for a good syntax highlighter for my site that uses PHP & MySQL and Jquery. A syntax highlighter that does not let the code overlap but allows the user to scroll like here on stackoverflow.

like image 497
HELP Avatar asked Jan 30 '26 10:01

HELP


2 Answers

Absolutely all PHP source code highlighters based on Geshi library http://qbnz.com/highlighter/

You can make code blocks "not let the code overlap but allows the user to scroll" by adding CSS overflow : auto;

Also good way is to use JavaScript based code highlighters that highlight code on client side http://alexgorbatchev.com/SyntaxHighlighter/ or http://softwaremaniacs.org/soft/highlight/en/

like image 85
seriyPS Avatar answered Feb 01 '26 00:02

seriyPS


The scrolling is just a CSS property of whatever the code is in - something like...

max-height: 600px;
overflow: auto;

(The overflow attribute tells the browser to use scrollbars, the max-height tells it at what point the vertical scrollbar should kick in.)

As for hilighting, take a look at google-code-prettify.

like image 35
Amber Avatar answered Feb 01 '26 01:02

Amber



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!