/mw2md.py

A small script to convert MediaWiki (restructured syntax?) content to markdown.

Primary LanguagePython

MediaWiki to Markdown

This is a simple script to convert from MediaWiki files to markdown. An example index.rst is provided, along with the index.md it converts to.

Usage

The script will print the resulting markdown to the screen:

$ python mw2md.py index.rst

And then here is an example piping this output to file:

$ python mw2md.py index.rst > index.md

or you can provide the file path to write it directly:

$ python mw2md.py index.rst index.md
Transforming MediWiki from '/home/vanessa/Documents/Dropbox/Code/srcc/mw2md.py/index.rst' to MarkDown syntax...
Writing output to index.md

Html to Markdown

I needed a quick script to convert from HTML to Markdown, so I bootstrapped python-markdownify to handle most of the work. The usage is the same as above, but providing html files as input, and then also writing markdown. You also need to install markdownify:

$ pip install -r requirements.txt

And then convert!

$ python html2md.py index.html