Does anyone know any cool jquery snippets that could be used for displaying source code C/C++/Java, on an html page. Normally I just use 'code' blocks, but if there are any cool jquery effects. I am using prettyprint or something like that right now. . Also anyway to enhance the view of diagrams/gifs using jquery. So looking for a solution that gets around the limitations of scrolling thru text. Thanks
-
For what purpose? Do you want to display the code on a webpage?Charles Smith– Charles Smith2011-11-07 00:26:01 +00:00Commented Nov 7, 2011 at 0:26
-
Its a tutorial. And I want to make it as readable as possible. So one issue is just that scrolling is kind of difficult to see all the code. If I don't scroll then it takes up too much space.Androider– Androider2011-11-07 00:34:19 +00:00Commented Nov 7, 2011 at 0:34
2 Answers
Look here: http://alexgorbatchev.com/SyntaxHighlighter/
1 Comment
I use php pear Text_Highlighter on the server and I think the server is a better place for syntax highlighting.
Advantage is the results are in a <pre /> block opposed to textarea, so you do not end up with a box in the page that has horizontal scrolling, and the syntax highlighting is available to users who have JavaScript disabled.
Also, it does not add line numbers that add to the width of the code example like the popular JS solution does.
I do not know if you are using php but most server side languages have something similar.