[ACCEPTED]-Is there any way to convert Wikitext to Markdown in python?-text-processing
Accepted answer
Since is something that I need, I packaged 2 both together:
http://bitbucket.org/wikier/mw2md
So now it's easier to perform 1 both tasks.
You can go from wikitext to html and then go from html to markdown. Not 2 exactly straight forward, but i know no 1 alternatives.
Not sure it does what you want, but you 2 might want to check out Pyandoc: a Python wrapper 1 for Pandoc.
You can use pandoc with following syntax 3 to convert from mediwiki to markdown.
pandoc -f mediawiki -t markdown wiki.txt
this 2 will output on console but if you want to 1 save it in a file then change as below.
pandoc --from mediawiki --to markdown wiki.txt -o youwant.md
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.