HTML to reStructuredText
Aleksandr Smyshliaev <[email protected]>
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <[email protected]> |
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. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot