Is there any way to convert Wikitext to Markdown i

2019-03-24 14:26发布

问题:

Is there a python library which takes wikitext (as used in mediawiki) input and converts it to markdown?

回答1:

Since is something that I need, I packaged both together:

http://bitbucket.org/wikier/mw2md

So now it's easier to perform both tasks.



回答2:

You can go from wikitext to html and then go from html to markdown. Not exactly straight forward, but i know no alternatives.



回答3:

Not sure it does what you want, but you might want to check out Pyandoc: a Python wrapper for Pandoc.



回答4:

You can use pandoc for this. Try online converter.



回答5:

You can use pandoc with following syntax to convert from markdown to mediwiki.

 pandoc -f markdown -t mediawiki Zen.md

this will output on console but if you want to save it in a file then change as below.

pandoc --from mediawiki --to markdown ZP.txt  -o zp.md