Skip to content
/ bw Public

(bw == "Bye Wiki") Say goodbye to your wikis! Python command-line tool to convert MediaWiki pages to other formats with pandoc

License

Notifications You must be signed in to change notification settings

jwflory/bw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bye_wiki (bw)

License: BSD 3-Clause License

Say goodbye to your wikis! Python command-line wrapper to convert MediaWiki pages to other formats with pandoc

About

bye_wiki (bw) is a Python command-line script to convert MediaWiki pages into other formats like AsciiDoc and Markdown.

This makes it easier to migrate documentation and wiki pages from a MediaWiki server to somewhere else. Regardless of whatever "somewhere else" means for you, this tool provides a basic conversion for you to work with the information from a new format. bye_wiki is more or less a fancy wrapper for requests and pandoc.

How to use

NOTE: You must already have pandoc installed on your system for this script to work!

Once you have pandoc, the easiest way to get started with bye_wiki is to install from PyPI:

pip install --user bye-wiki

The CLI --help menu provides more detailed information about how to use bye_wiki. Some examples are below:

Example 1

Convert El Ten Eleven Wikipedia page to a Markdown document.

bw --title "El Ten Eleven" --out ~/ete.md

Example 2

Convert Fedora_Linux_38_Release_Party_Schedule from the Fedora Project MediaWiki to an AsciiDoc document.

bw --url fedoraproject.org/w --format asciidoc --title "Fedora_Linux_38_Release_Party_Schedule" --out licensing.adoc

Example 3

Convert MusicBrainz Principles from the MusicBrainz MediaWiki to a Markdown document, with the --markdown-headings=atx flag excluded from the pandoc command:

bw --url wiki.musicbrainz.org --title MusicBrainz_Principles --out mb-principles.md --atx-off

Hint: If you are not sure whether you want --atx-off or not, you do not. ATX is the more popular format for Markdown documents, but some writers may prefer to not have ATX-style headers.

How to contribute

See CONTRIBUTING.md.

Legal

Licensed under BSD 3-Clause License.