http://heisencoder.net/2009/01/adding-syntax-highlighting-to-blogger.html
For all you new on blogger, as I was, here is a simple recipe on how to use syntax highlighting or code formating in your blog post.
In blogger goto the tab Design -> Edit HTML
Add the following in end of <head>
To then add java formated code to a blog use the following tag
1 2 3 | < pre class="brush: java"> // Code </ pre > |
Here is an example. The following...
1 2 3 4 5 | < pre class="brush: java"> int x = 4; int y = 3; int sum = x + y; // 7 </ pre > |
... will render as
1 2 3 | int x = 4 ; int y = 3 ; int sum = x + y; // 7 |
If anyone has another solution, maybe a tip on how to get the clipboard util up in the right to work, please comment this post and tell me.
No comments:
Post a Comment