I would like to know how to modify reStructuredText (reST) documents using Python.
I assume that the proper way to do it is to parse the reST document, modify it and write it back as reST.
Here there is a description for parsing a reST document using Docutils.
With the code in that answer I can get a parsed document, unfortunately it seems that there is not docutils writer for turn back the intermediate representation to reST.
How can I accomplish this?
Please, note that I don't need it to be done with Docutils, it's just that it seems the most obvious option.