Wikitext to Markdown or HTML Conversion

How can I convert Wikitext (the markup language used by the MediaWiki wiki software) to Markdown (preferred) or HTML? (Python solution is preferred.)

Since Wikipedia/Wikimedia is in PHP, I’m not sure it would be possible to port this to python.

However, to answer your first question, you would probably have to do some digging on WikiMedia and possibly ask a community member there.

1 Like

I want the solution to be in Python because I want to use it in my Django web application.

My recommendation is to make another website with the php package for wikitext.

Send the data you want converted to HTML there, then send the data back from the php site.

1 Like

Pandoc https://pandoc.org/try/?text=&from=mediawiki&to=markdown_strict&standalone=0 has these languages. Maybe you can run it from python. Or look for python bindings. Pandoc is big though.

2 Likes

Cool! Thank you very much!

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.