The ssteiner Blog-o-matic

Linux Admin, OS X, Cocoa

Using reStructuredText with TextMate’s Browser Preview

I’m working on several open and not so open source projects in Python these days and am using Sphinx for documentation.

TextMate has a Browser Preview window with the ability to pre-process the editor contents through a script before rendering.

The Sphinx standard input format is reStructuredText as handled by Docutils.

You can install docutils and Sphinx with:

	# sudo easy_install docutils sphinx

To get TextMate to pre-process the reStructuredText properly before display, check the “Pipe text through” checkbox in the Web Preview window and put the rst2html.py into the textbox for the name of the script.

Picture 2.png

There will be some issues with “Unknown interpreted text role ‘data’” type things but you’ll pretty well be able to see what it’ll look like.

I may explore making this more accurate and flexible but, for now, this’ll do.

2009/05/17 Posted by ssteiner | Documentation, TextMate, fabric, reStructuredText | | No Comments Yet