I have always hated wysiwyg html editors because they never produced the output I actually wanted to have. Also, being used to writing close to everything in vim, with wikipediafs, I found the perfect way to edit a mediawiki, which I use for work- and personal documentation. Here’s how to set it up.
I’m lazy, so my laptop runs xubuntu (an ubuntu version with my favorite desktop environment xfce). This distribution ships a package for wikipediafs. If you’re running a different distribution, the setup might be slightly different from what’s next.
First off: install the package:
sudo apt-get install wikipediafs
Then, it’s time for the dummy mount, which creates the configuration file. I created a directory called “mediawiki” in my home directory to mount the filesystem.
To verify this worked, run
you should see an entry with wikipediafs in the list of mounted filesystems. If the mount command was not successful, check that you have write permissions to the mountpoint and you also may need to be a member of the fuse usergroup.
So anyway, if the first “dummy” mount succeeded, you will see the new directory .wikipediafs in your $HOME. It holds the configuration file config.xml that already has a test wiki configuration enabled.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Cache time in seconds -->
Yes, it is freaking xml, but you’ll get over it … If you take a look into the mountpoint, you will see that the configured dirname refers to a directory within the mountpoint representing the configured mediawiki instance. The host configuration is the fully qualified domain name of the instance and the basename has to be set to the url where the wiki resides.
So now it’s time to configure your instance of mediawiki in wikipediafs:
To activate this configuration, unmount and mount the filesystem.
sudo umount /home/ahwhattheheck/mediawiki
Now say you want to edit the existing page “Wurst” on your wiki.
This opens the article in vi (of course you can use whatever editor you like) and lets you edit the page in a convenient way. As soon as you write the “file”, the article is saved online. Exiting without saving leaves the article untouched as you’d expect. Creating a new article is just as easy, simply create a new “file” with the file ending “.mw” with your editor and write it.
If your mediawiki instance is on an SSL site, add an
<https/> tag to the site-configuration and if your instance is behind some basic-auth mechanism, you might want to use httpauth_username and httpauth_password tags to your site configuration. You might also want to have a look at the manpage to mount.wikipediafs.
To mount wikipediafs at boot time, create an entry in /etc/fstab
none /home/ahwhattheheck/mediawiki/ wikipediafs auto,user
This sure isn’t for everybody, but I just freaking love it.