From: Aleksandr S. <al...@go...> - 2018-06-10 15:23:00
|
Hello! I have a script that converts XHTML files produced by Sphinx epub builder back to reStructuredText. If anyone is interested, I can publish the source. The problem I had to solve is this: we have some documents in rST, and we've got to make a translation. Unfortunately, CAT (Computer-assisted translation) tools do not play well with plain text files. So I gave XHTML files to my translators, and I got back HTML files with most of the markup preserved. The script parses an (X)HTML input to build a Docutils AST, and then runs a NodeVisitor to build rST text. The script does not cover all of the Docutils nodes, but it works for me. Best wishes, alex. |