I开发者_如何学运维s there a python library which takes wikitext (as used in mediawiki) input and converts it to markdown?
Since is something that I need, I packaged both together:
http://bitbucket.org/wikier/mw2md
So now it's easier to perform both tasks.
You can go from wikitext to html and then go from html to markdown. Not exactly straight forward, but i know no alternatives.
Not sure it does what you want, but you might want to check out Pyandoc: a Python wrapper for Pandoc.
You can use pandoc for this. Try online converter.
You can use pandoc with following syntax to convert from mediwiki to markdown.
pandoc -f mediawiki -t markdown wiki.txt
this will output on console but if you want to save it in a file then change as below.
pandoc --from mediawiki --to markdown wiki.txt -o youwant.md
精彩评论