January 05, 2011

How to post a Source Code in Blogger or Website

- Source Code on Blogger
- Source code plugin for blog
- Source code plugin for blogspot
- The best source code posting
- How to add source code to my blogspot post
- How to add HTML code to Blogger (blogspot.com)
- What's the best solution for post a source code in my weblog?


Best Solution:
If did you want to post source code snippets in your weblog on Blogger (blogspot) or any weblog services like WordPress or your website, SyntaxHighlighter is the best solution. There are another solution like below but the human readability is first important and i think that with SyntaxHighlighter you can kill two birds with one stone. It solves your problem for make a page with look nice source code and very human/developer readable, trust me, It comes from an old developer man:-D

All Solutions:
1- SyntaxHighlighter: SyntaxHighlighter is a fully functional self-contained code syntax highlighter developed in JavaScript.
link: http://alexgorbatchev.com/SyntaxHighlighter/
used by: Apache, Aptana, Mozilla, Yahoo, Wordpress, Bug Labs, Freshbooks and others.
demo: http://alexgorbatchev.com/SyntaxHighlighter/manual/demo
version: 3.0.83
Integration: http://alexgorbatchev.com/SyntaxHighlighter/integration.html
syntax:
<pre class="brush: css">##YOUR CSS CODE##</pre>
<pre class="brush: csharp">##YOUR C#(C-SHARP) CODE##</pre>

2- WordPress Source Code Plugin: Wordpress have created a shortcode which you can wrap around source code that preserves its formatting and even provides syntax highlighting for certain languages just with a simple wrap like below. It's same SyntaxHighlighter with same developer ;-)
link: http://en.support.wordpress.com/code/posting-source-code/
syntax:
[sourcecode language="css"]your code here[/sourcecode]

3- Google Code Prettify: Its offer a JavaScript module and CSS file too.
link: http://code.google.com/p/google-code-prettify
syntax:
<pre class="prettyprint">your code</pre>

1 comment:

Anonymous said...

I have a Joomla website and already set up a Google Analytics account, now how do I add the code to my website so that it will keep track of visitors etc to every page? Thanks!.