Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML to RST converter

I have a lot of RST (reStructuredText) files converted to HTML using docutils. Using a small developed JS app (a basic iframe with HTML5 contenteditable attribute), non-tech people can easily edit the generated HTML page. The goal would be apply the modification done in HTML back into the original RST file.

I'm wondering if there is a way to train an algorithm with the ground-truth of original_RST -> outputed_HTML conversion so we can later reverse outputed_HTML+minor modification back to RST ? What kind of algorithm will it be ? Which way should I start digging ?

To simplify the problem, instead of RST, I can also use the internal XML AST representation of docutils as document input (RST to XML-AST: http://docutils.sourceforge.net/tools/quicktest.py) and later, fix the xml2rst+xslt project (http://www.merten-home.de/FreeSoftware/xml2rst/)

Any suggestion is welcome

like image 749
ticapix Avatar asked Sep 11 '16 11:09

ticapix


People also ask

How do I convert HTML to XML?

From HTML to XML free allows loading the Website URL which has tables converting to XML. Click on the URL button, Enter URL and Submit. Parsing HTML into XML supports loading the HTML File to transform to XML. Click on the Upload button and select File.


1 Answers

Try Pandoc

If you need to convert files from one markup format into another, pandoc is your swiss-army knife.

like image 96
Ricardo Cardona Ramirez Avatar answered Sep 28 '22 19:09

Ricardo Cardona Ramirez