ProfK
ProfK

Reputation: 51064

C# syntax highlighter for blogging on BlogSpot

I'm looking for a syntax highlighter cum code formatter for my blog on BlogSpot. I've tried several today, but the all want to include <style> tags, or reference a stylesheet. I'm looking for one that is ideal for segments of code, and includes styling inline. Any suggestions?

Upvotes: 7

Views: 5234

Answers (6)

Pavel Vladov
Pavel Vladov

Reputation: 4837

I've created a Free Online C# Syntax Highlighter that has exactly the ability you need - to inline the needed CSS styles. All you have to do is to select the "Inlined styles" check box, paste your C# code and click the Colorize button. You can find it on my blog.

Upvotes: 3

CraftyFella
CraftyFella

Reputation: 7568

I use SyntaxHighlighter Javascript Library. It's really easy to add and use.

here's more information on it that might help others out:

http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html

Upvotes: 1

Sarath
Sarath

Reputation:

The project referenced above has moved:
http://alexgorbatchev.com/wiki/SyntaxHighlighter

Instructions for using it on Blogger:
mlawire.blogspot.com/2009/07/blogger-syntax-highlighting.html

Upvotes: 7

Paul Fisher
Paul Fisher

Reputation: 9666

You can always copy the extra few bytes of styling for, say, a Pygments highlighter (which really is quite excellent) into the <head> of your blog. You don't even need to install any software; just copy the HTML from the online service.

Upvotes: 3

wee bar
wee bar

Reputation:

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

Upvotes: 2

Ali Afshar
Ali Afshar

Reputation: 41653

I had this exact problem.

I wrote an image formatter for Pygments (included in the core distribution).

Please don't hate me for such an abomination, but yes, it renders the highlighted code as a png or jpg or whatever you want. So it has no external dependencies etc.

pygmentize -f png -o mysource.png mysource.cs 

I try to make sure that I always link a plain text version of the source for people copy-pasting.

Upvotes: 0

Related Questions