I guess if I am going to start posting code, I need to make sure I can do that with WordPress. It turns out there are a couple of plugins available to make this task easier. I am currently trying out SyntaxHighlighter Plus for syntax highlighting, and Visual Code Editor to allow one to continue using the visual editor when posting code.
So let’s see how they work!
Here is some C++:
#include <iostream>
#include <ostream>
int main()
{
std::cout << "Hello World!" << std::endl;
return 0;
}
And here is some Python:
def index(request, page=1): stories = Story.objects.all() paginator = create_paginator(stories) try: the_page = paginator.page(int(page)) except InvalidPage: raise Http404
Pretty cool! A big thank-you to the plugin authors!