On Fri, Nov 6, 2015 at 10:18 AM, James Montalvo jamesmontalvo3@gmail.com wrote:
Can Parsoid be used to convert arbitrary HTML to wikitext? It's not clear to me whether it will only work with Parsoid's HTML+RDFa. I'm wondering if I could take snippets of HTML from non-MediaWiki webpages and convert them into wikitext.
That is possible, yes. For example (via RESTBase):
curl -X POST --header "Content-Type: application/x-www-form-urlencoded" --header "Accept: text/plain; profile="mediawiki.org/specs/wikitext/1.0.0"" -d 'html=<h1>Heading</h1><p>Hello world</p>' " https://en.wikipedia.org/api/rest_v1/transform/html/to/wikitext"