Skip to content

Instantly share code, notes, and snippets.

@vovan888
vovan888 / gist:9436638
Last active June 21, 2022 02:15
Split mediawiki xml export file to separate pages - one file for every page.
#!/usr/bin/perl -w
# output files can be converted to other wiki formats with pandoc:
# find . -type f -exec pandoc -f mediawiki -t markdown_github -o "{}".mark "{}" \;
use strict;
use Parse::MediaWikiDump;
my $file = shift(@ARGV) or die "must specify a Mediawiki dump file";
my $pages = Parse::MediaWikiDump::Pages->new($file);