Pandoc: Best Way To Convert Markdown to reStructuredText!
I wrote a simple readme to one of my Python package Fadapa. I built the package using setuptools. In setup.py file, for long_description field I just read README.md file and assigned it. After uploading the package to PyPi, I saw the page and found that PyPi doesn't support Markdown format. So I had to change it to reStructuredText.
Pandoc is the best tool available to convert markup formats. It supports a lot of formats and you can convert it to any format you want.
If you have a few documents to convert, you can convert them online. You can also install in in your system if you want to convert a lot files. Instructions on how to install on various operating systems is give here.
For ubuntu you can install by
Then you can convert files using
This converts readme.md to readme.rst.
Pypandoc is a simple python wrapper for pandoc. Using that also, you can convert files.
Install it using pip
and then to convert files just do
Update: There is an feature request with pull request to add support for Markdown for PyPi.
Pandoc is the best tool available to convert markup formats. It supports a lot of formats and you can convert it to any format you want.
If you have a few documents to convert, you can convert them online. You can also install in in your system if you want to convert a lot files. Instructions on how to install on various operating systems is give here.
For ubuntu you can install by
sudo apt-get install pandoc
pandoc readme.md --from markdown --to rst -s -o readme.rst
Pypandoc is a simple python wrapper for pandoc. Using that also, you can convert files.
Install it using pip
pip install pypandoc
import pypandoc
output = pypandoc.convert('somefile.md', 'rst')
Update: There is an feature request with pull request to add support for Markdown for PyPi.
Need further help with this? Feel free to send a message.