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&gt tag, placing <pre&gt before the code section, and </pre&gt 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

Related posts:

  1. blog at blogger attempts
  2. Choosing an open-source license for my code

3 Responses to “Posting source code to Blogger”

  1. Aristotle Says:

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

  2. eliben Says:

    Thanks, I’ll try. What does <code> add ?

Leave a Reply

You can use these HTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .
To post code with preserved formatting, enclose it in `backticks` (even multiple lines)