开发者

Is there any way to convert Wikitext to Markdown in python?

开发者 https://www.devze.com 2023-02-09 23:35 出处:网络
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:

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
0

精彩评论

暂无评论...
验证码 换一张
取 消