ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Programmer Libs

MwImporter php script - Batch import html site into MediaWiki - v2.0 - 5/26/10

(1/4) > >>

mouser:
Official web page here: https://www.donationcoder.com/Software/Mouser/mwimporter/index.html

JavaJones and I have been working on an Open Source php script thats aid in batch converting and importing an entire directory of html files and images into a MediaWiki site.

Useful if you want to convert your static page site into MediaWiki.

This builds on a number of existing tools, including HTML WikiConverter perl scripts, and the php importing tools that come with MediaWiki.

What it adds is a bunch of nice helper functions that facilitate massaging the html prior to conversion, and wiki text post conversion, handling filename clashes, relative links between pages, and the handling of recursive directories of both static pages and images, using php classes that are easy to extend.

We will be posting a release for anyone who might find this useful soon, though i have my doubts as to whether this isn't the empty set (let me know if not!).


NOTE: I should add that really this is a generic set of php classes for "converting/importing" a recursive directory of files from one format into another, which includes derived classes specifically for converting and importing from html files into a MediaWiki site; but the base classes could serve as a useful starting point for anyone who wants php code to recursively discover and batch process/convert a directory of files from any format to any other format, with helper functions for handling commandline options, temp files, file matching patterns, etc.


DOWNLOAD v2.0 (5/26/10):
https://www.donationcoder.com/Software/Mouser/mwimporter/MwImporter.zip

LICENSE: Open Source

AUDIENCE: This code is intended for experienced users who aren't afraid of getting their hands dirty; if you are expecting a super friendly idiot-proof tool you need to look elsewhere (bearing in mind there is nothing else at the current time that will do this stuff).

JavaJones:
Don't forget it can import image maps, too (targeting the MW imagemap plugin). Of course not many people use image maps these days I suppose... :D

- Oshyan

mouser:
Ok finished up adding the features i wanted to add -- you can now import a large deep directory of pages and images, and it will import properly all of them, creating unique names when the file and page titles are not globally unique (nesc. due to flatness of a wiki), and fixing up all links between pages.

Hopefully this will be useful for someone who is interested in migrating a site from static to wiki format.  I will upload soon.

mouser:
i have uploaded a first version.. i don't anticipate much use for this, but it's there for those who want to try it.

RayOfLight:
This will be very usefull for us. We will be adding .chm files to our wiki after converting them to html.
I'll try to figure out how it works and then test it...crossing my fingers :D

I'm reading in on it and have already some questions.
First one, what does: --mw_dircat_sepdir
It's not (yet) in the help file

Also, because we're not running the wiki on our own server, I'm searching for a way to set everything up in a way that I can ask our webhost to run the necessary command to start it...if that is at all possible...

Navigation

[0] Message Index

[#] Next page

Go to full version