Subject: A reStructuredText *writer*?
Date: Thursday 4th March 2010 18:34:38 UTC (over 7 years ago)
**I posted this via the gmane web interface earlier, but AFAICS it hasn't appeared. However, now I'm a mailing list member. Apologies for double-posting if I'm mistaken.** Hi, I'm wondering whether anyone else is surprised at the lack of a reStructuredText writer in docutils. I believe that there is a want for it, as I know of the existence of four tools that repeat functionality along these lines: * xml2rst.py (http://www.merten-home.de/FreeSoftware/xml2rst/manual.html) -- converts an XML doctree file to RST * html2rst.py ( http://docutils.sourceforge.net/sandbox/cliechti/html2rst/html2rst.py) * html2rest.py ( http://bitbucket.org/djerdo/musette/src/tip/musette/html/html2rest.py) * rst2rst (http://lateral.netmanagers.com.ar/weblog/posts/P460.html) -- can't find much out about this but it seems (sounds) like someone's attempt to make the XML<->RST transformation symmetrical I think such a writer should be in the docutils codebase because: * it provides an ideal route for people's ad hoc crazyformat2rst.py converters. Just parse your file format into a doctree form, and docutils does the rest. * docutils is the authoritative specification of RST and the doctree schema. It doesn't make sense for small-timers to be reimplementing partial RST writers for every conceivable automated task. * it makes the RST<->XML transformation symmetrical. The appeal of this has an aesthetic component, but I can think of important practical uses. Let's say I want to translate an RST document English>French -- all I have to do is send the text nodes in the doctree to (say) Google Translate and replace them with the result. (It would also make the creation of PO files for gettext trivial.) There are many other uses I can think of along the same lines -- generally, automated editing of an RST file. So, is anyone interested in such a tool? If I were to work on one (by heavily borrowing from the above implementations), would people be enthusiastic? Is there any chance of this getting into the codebase? Best, James Fisher