Today I thought my blog needed some updates, so I updated it. Here's a quick summary of what's new:
Switched to mistune
I switched from using the markdown2 Python markdown renderer library to mistune. It just does more things, and looks cooler. Also, it's supposed to be faster, so that's a bonus (my blog renders the markdown on request - not sure if that's a bad thing???)
Also, now I can have
markdown2 didn't really have code blocks out of the box. mistune does! isn't that cool? (of course, there *is* an extension for code blocks with markdown2, but I never really got around to doing it :P)
Now we have code blocks with syntax highlighting! (This wasn't built in, but wasn't hard to implement :P)
I'm using the Dracula theme for Pygments. I was kinda hesitant about having all this colour - this site has a bit of a greyscale theme - but you can tell me what you think.
BOARD_SIZE = 8 class BailOut(Exception): pass def validate(queens): left = right = col = queens[-1] for r in reversed(queens[:-1]): left, right = left-1, right+1 if r in (left, col, right): raise BailOut def add_queen(queens): for i in range(BOARD_SIZE): test_queens = queens + [i] try: validate(test_queens) if len(test_queens) == BOARD_SIZE: return test_queens else: return add_queen(test_queens) except BailOut: pass raise BailOut queens = add_queen() print queens print "\n".join(". "*q + "Q " + ". "*(BOARD_SIZE-q-1) for q in queens)
(code taken from the python wiki)
I made some updates to the stylesheet:
- Text is now a lighter grey
codefont is now smaller, and I changed the font from PT Mono to Fira Mono.
codegeneral styling (background/etc) is slightly different
- Background is also slightly lighter
Just wanted you to know that this blog's not dead - I'm working on another post right now!
If you want to see the actual code changes for whatever reason, here you go.
(This link might not work in the future?? how do I get a futureproof link :P) figured it out!