rst2wordpress

One technology that seems to be getting some traction lately, and one that I really like, is reStructuredText, a part of the Docutils project. I use it extensively for both code documentation and "normal"documents, and I’ve reached a point where I really feel productive in it.

Because I like restructured text, because I’d rather write my blog posts in emacs than some web editor, and because I’m driven to make things more complex than they need to be, I decided to see if I couldn’t find a way to transform restructured text into wordpress-friendly HTML. Thus this was born rst2wordpress, a python/docutils script that aims to produce good-looking HTML that will pass wordpress muster from rst source documents.

The basic idea is that you can write your post in whatever editor you want, using restructured text. Then, when you’re happy with it, simply run


python rst2wordpress.py my_doc.rst > my_doc.html

Right now, you have to copy the "body" of the HTML output and paste it into wordpress. Ultimately, I’d like to produce exactly what wordpress wants, possibly even uploading it. We’ll see.

Consider this post the first test…if it looks OK to you, then I’m doing something right 🙂

Advertisements

,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: