Friday, January 8, 2010

Testing the layout for python egg's README.txt file

Before uploading an egg, i like to test the layout of the egg to see if it is correct ReST, so it shows up nicely on the page and

$ python --long-description | rst2html > description.html

This is assuming that you create the long-description in your by reading the README.txt. My usually contains something like this:
version = '1.0'

description="Some description about what this does, who might use it etc.",
open(os.path.join("docs", "NEWS.txt")).read(),
open(os.path.join("docs", "TODO.txt")).read(),

The "\n\n".join() bit is used to make sure there's enough separation between chapters (from the various files), because otherwise you could remove a line which would result in invalid ReST.

No comments: