I plan to use reStructuredText to write documentation with the main purpose of generating some nice HTML pages. For this I use the docutils rst2html.py tool.
However
I have also seen this done by rendering to html using rst2html, then converting the html to plain text by using a command-line html browser, such as:
Each of these browsers has a command-line switch or similar to render its output to a .txt file, so you could create a two line script called 'rst2txt', something like:
rst2html docs.rst docs.html
lynx -dump docs.html > docs.txt
Sphinx has a TextBuilder for txt output format. Just tried it and it seems to do what you are looking for.
However, it might be a little outdated because it is not in the default Makefile. But it worked well on my fairly complex documentation (150 pdf pages). To use it, just add the following target to it:
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) _build/text
@echo
@echo "Build finished."
Also, keep in mind that Sphinx implements only a subset of the rst specs.