Thursday, July 17, 2008

Inserting code snippet in Blogger

It was really difficult for me to find a solution to insert java code snippets in my Blogger !!
I found a solution using the syntaxhighlighter JavaScript plugin.
The steps used to insert code snippet:
  • Download syntaxhighlighter from syntaxhighlighter
  • Unzip the file and place the Scripts and Styles directories in a URL (location in my sample)
  • Modify your blogger template adding those lines just after the </div></div> <!-- end outer-wrapper –>
  • To publish a post with code snippet, insert your code inside the <pre> or <textarea> tags

<textarea name="code" class="c#" cols="60" rows="10">

... some code here ...

</textarea>

No comments:

Frederic shared items