Some tips on formatting comments

You don’t have to use HTML, but you can. Either way, WordPress does quite a good job of rendering it well (and in valid HTML – yay).

There’s no preview feature yet. Sorry ’bout that. I’m working on it. In the meantime, if you post something and it obviously looks wrong, I’ll probably tweak/fix it.

You can use <blockquote>s to beautifully format quotes (see below for tips on formatting code). For example:

<blockquote>
<p>Some waffle from some place.</p>
<p>More waffle!</p>
<p class="attribution">Optional attribution to person who said waffle.</p>
</blockquote>

renders as:

Some waffle from some place.

More waffle!

Optional attribution to person who said waffle.

Note optional use of “attribution” for right-aligned dash-prefixed attribution.

You can also enclose code in <code> tags to format it beautifully (see below for single-line snippets), but you should trim the leading and trailing whitespace. For example, this will look good:

<code>def main():
    do_some_thing()
    do_something_else(frobnitz)

if __name__ == '__main__':
    main()< /code>
whereas this will look less good (check out first and last lines):

<code>
def main():
    do_some_thing()
    do_something_else(frobnitz)

if __name__ == '__main__':
    main()
< /code>

The better version renders as follows:

def main():
    do_some_thing()
    do_something_else(frobnitz)

if __name__ == '__main__':
    main()

whereas the worse version has chunkier margins at top & bottom and hence Looks Less Good.

If anyone knows of a way to eliminate this whitespace behaviour, let me know – though it is consistent with the expected behaviour of <code> I suppose.

Annoyingly, single lines of code should also be enclosed in <pre> tags, for some reason. So, use:

<pre><code>product [1..1000]< /code></ pre>
not:
<code>product [1..1000]< /code>