Posting source code to Blogger

March 20th, 2006 at 1:49 pm

It’s very important for programming oriented bloggers to be able to post code to their blogs.

To post code, use the <pre> tag, placing <pre> before the code section, and </pre> after the code section. The tags should be placed in the ‘Compose’ section of the post editor, not in the ‘Edit Html’ section.

def greet
  puts "Enjoy posting code !"
end

You can also use the <code> tag in combination with <pre>. Experiment with these tags to see what works best for you.

Related posts:

  1. Blocked by Blogger’s spam bots
  2. Choosing an open-source license for my code
  3. Analyzing C source code
  4. blog at blogger attempts
  5. Blogger, Atom and HTTP clients

2 Responses to “Posting source code to Blogger”

  1. Aristotle Says:

    Better yet, use <pre><code>…</code></pre>

  2. picasNo Gravatar Says:

    thanks, it was helpfull to me..