views:

738

answers:

6

What is a really simple online tool for encoding and color coding HTML docs and snippets from reposting into blog entries?

I found this one: http://www.stevetrefethen.com/highlighter/
but was looking for some alternatives.

UPDATE: Sorry, I should have mentioned that I'm looking for more of a "one off" tool. I won't be posting code to this blog very often, and I'd like to be able to use the HTML in non-blog uses too.

UPDATE 2: See comments on Kyle's answer.

+1  A: 

Try http://code.google.com/p/syntaxhighlighter/

Tomh
+2  A: 

I think StackOverflow uses syntaxhighlighter. It's written in JavaScript so it can be used regardless of the server-side language your blog uses.

Dan Herbert
+2  A: 

I use this one on my blog and works great. GeSHi - Generic Syntax Highlighter

EDIT 1: Are you thinking of having something like this. This will allow you to copy code from visual studio and paste as HTML (not sure if you are using Visual Studio.. There is also a version out there for VS 2005.

EDIT 2: Hmm, I'm not I personally know of any tools like that. You can check out a Windows Live Writer Plugin. This is based on a C# syntax highlighting library that could be downloaded here. Like any developer in need, we are resourcefull. You could try and make a simple windows form application with two text boxes and a button. Format the contents of textbox1 on button click and place the text in textbox2. Sorry if this doesn't help.

Kyle LeNeau
+1 This is close. But I don't see where it gives you the HTML code back. I'd have to go poking around in the source. And they seem to be linking here to tag info not just highlighting. Still a cool tool.
tyndall
No. I mean if the tool does other languages great... but I really just need it to do HTML and XHTML - encode it, color it, format it, etc... Something like this http://www.opinionatedgeek.com/DotNet/Tools/HTMLEncode/Encode.aspx but with color spans added.
tyndall
+1 for GeSHi. I use it on my own blog. I just need to find a jQuery pack for it.
alex
A: 

Here is an offline option (I know you are asking about online tool but just in case ...)

I use offline tools to process the blog entry with source code examples into html format and then just post the html.

I setup markdown with pygments (supported by default) probably you could just use pygments for source code. You run the file thought the script and then copy paste the html to your blog. You can dump css style, to highlight syntax, from pygments and then either link to it or include it in your page.

Here is how to setup markdown with pygments to do syntax highlighting for Blogger.

stefanB
A: 

I would like to suggest the Dottoro Syntax Highlighter. It provides easy customization and supports embedded CSS and JavaScript code blocks within HTML documents.

gumape
A: 

A very simple, yet very effective solution is prettify.

Valentin Rocher