- Assume that you have Python on your system already.
- $ sudo apt-get install python-docutils (this is the module that gives the utilities of the conversion between rst and other formats)
- Download the source package of Docutils
- Untar the downloaded package and go to the tools directory, find the rst2html.py, and copy it to a folder contained the cheatsheet.txt (Please download it. It is a text file formatted in rst file, and we will use it for the following test.)
- Go to the folder contained the cheatsheet.txt file
- $ python rst2html.py cheatsheet.txt cheatsheet.html
- You now have the cheatsheet.txt converted to cheatsheet.html, and you can view the cheatsheet.html in your browser
Before jump into installing the Dcoutils on your system, you may want to try and see the rendered result online: reST to HTML conversion. Just copy the content of cheatsheet.txt and paste it into the online converter, and click the Render button to view the result. That's pretty cool. :-)
No comments:
Post a Comment