If, like me, you regularly use Markdown to give your GitHub projects nice pretty README's, but are trying to submit your new swanky Python module to the Python Package Index, you may have hit a bit of a snag. To get your nicely formatted README on your module's PyPi page, you need to use reStructuredTxt. Now you could admit defeat and change your README, or you could do this:
Install pyandoc python module
pip install pyandoc
Create a file called register.py and add the following code:
pandoc.core.PANDOC_PATH = '/path/to/pandoc'
doc = pandoc.Document()
doc.markdown = open('README.md').read()
f = open('README.txt','w+')
Now add the following code to the top of your setup.py file:
long_description = 'Add a fallback short description here'
long_description = open('README.txt').read()
and set the longdescription arg equal to `longdescription`
Now just register your module using
and your Pypi page should have it's own nicely formatted instructions.
Basically all your doing is creating a temporary reStructeredTxt file for setup.py to read in, but avoiding trying to do any pandoc conversion in setup.py like I originally had, which caused issues for installing on other systems.