This python script is based on the perl one from Jason Cameron.
Python3
usage: pmwiki_convertor.py [-h] [--file FILE | --directory DIRECTORY]
[--output OUTPUT] [--convertor CONVERTOR]
pmwiki file converter
optional arguments:
-h, --help show this help message and exit
--file FILE a file to convert
--directory DIRECTORY
directory containing PmWiki backup files
--output OUTPUT directory output to write converted files
--convertor CONVERTOR
convertor type: dokuwiki (default), markdown
This is a typical PmWiki directory layout that need to be converted:
Pmwiki
├── uploads
| └── namespace
| └── media files
└── wiki.d
└── namespace
└── wiki files
python pmwiki_convertor.py --file wiki.d/Linux.Debian --output markdown --convertor markdown
Output Markdown directory layout:
output directory
├── media
| └── namespace
| └── media files
└── namespace
└── mardown files
The pmwiki uploaded files will be copy to output directory/media directory. The pmwiki wiki files will be converted to markdown in output directory. And all the link to media files will be converted to point to right media files.
python pmwiki_convertor.py --directory wiki.d --output dokuwiki
Output DokuWiki directory layout:
output directory
└── data
├── media
| └── namespace
| └── media files
└── pages
└── namespace
└── wiki files
The pmwiki uploaded files will be copy to output directory/data/media directory. The pmwiki wiki files will be converted to dokuwiki syntax in output directory/data/pages. And all the link to media files will be converted to point to right media files.
This script only convert pmwiki files to dokuwiki files or markdown files.
This script will do:
It will not convert a pmwiki database content.