Closed Ceasar closed 10 years ago
I discovered minutes ago we can do this by extending the following working script 1:
from docutils import core
from docutils.writers.html4css1 import Writer, HTMLTranslator
if __name__ == '__main__':
test = """
Test example of reST__ document.
__ http://docutils.sf.net/rst.html
- item 1
- item 2
- item 3
"""
writer = Writer()
writer.translator_class = HTMLTranslator
print core.publish_string(test, writer=writer)
This should have been closed by https://github.com/Ceasar/Encyclopedia/commit/406dbdb1192b20a0f79106f870567738003e3b99.
rst2html.py
is just a Python script which reads a file and turns it into HTML. If we can compile rst files from within Python, we will gain several benefits:/templates