If you want an off-the-shelf solution, then you need two pieces - a markup parser and a template package.

The parser could be Textile, Markdown, RST, or various parsers implementing different wiki markups. There are python libraries to implement almost anything you want. Or you could write your own.

The parser goes through your content, and applies basic rules to translate it into HTML. If you want a quick a dirty hack, just:

1. enumerate files in "posts" directory
2. sort by date edited
3. open each file in turn
4. read in contents and store as a string
5. chunk string by splitting on "\n\n" (ie, an empty line)
6. for each chunk, append <p> to output string
7. for each chunk, apply a regex to look pairs of *s
8. for each pair of *s, replace them with <b> and </b>
9. append the resulting chunk and a </p>
10. repeat 6-9 for each chunk
11. repeat 5-10 for each file until done

The end result of all that should probably be something like a dict, with a single key "body" container your post with <p> and <b> tags. Add an author and date keys, and your ready to hand it off to your template system.

The problem comes if you want to do anything more than paragraphs and bold text, like, for example, a hyperlink, or an unordered list. All of a sudden you will learn why using regexps to parse any sort of markup is a terrible idea. It's like trying to fix a car engine with a toothbrush; even if you can make it work, you really shouldn't. There's a lot of info on writing parsers with Python out there, and a bunch of parser modules you can use[1], but as far as I know the short of it is that it's really quite hard. Either do some research on parsers and be prepared to devote a lot of time to it, or find one someone's already written is my advice. (Either way, don't actually use regexps to try and make your own markup parser on the cheap.)

As for the template system, you could use Mustache, or Jinja 2, or if you're okay with going beyond Python, any of a hundred others, depending in what you want. I'm quite fond of HAML syntax, but most of the template systems I know which speak HAML or a variant or written in Javascript or Ruby, for example.

If you want to write your own you'll face an easier task than for the parser step. Again, you'll want to read in the template files, but the tokens your looking to replace are pretty simple. Ideally they'll be something like: "$$IDENTIFIER$$"; a regexp can easily find that, then you use the identifier as a key for your dictionary you got from your parser, and bob's your aunty.

The remaining trick is stuff like navigation. A naive implementation will just process each file one at a time, which makes things like an archive page which lists every post you've made in each month tricky. You can get around this by reprocessing every page every "compile", saving some metadata (like data and titles) and then generating your navigation, indexes, and archives. If you're even smarter you can try and cache stuff so you don't need to recompile stuff that hasn't changed; this will require persisting metadata locally, presumably on the file system.

At some point you'll probably be tempted to drop in an SQLite database to store the metadata; this is pretty easy, but you might want to just run a full on CMS locally and cache the results to a file system. Django has the Static Generator project[2], and Flask has something very similar. These basically turn Django (or Flask) into a tool that will "auto generate static HTML pages from a selection of page templates and a [database] of text", which is more or less what you want.

(Of course, the static generation route is never going to make comments workable. This may or may not be an issue for you, depending on how much you hate Disqus.)

[1]: For example, PLY: http://www.dabeaz.com/ply/ If you look at that and go "ah, this will be easy" then knock yourself out. Most people find this stuff pretty dry and difficult though. :)

[2]: https://github.com/luckythetourist/staticgenerator