Editing MediaWiki pages in an external editor

I’ve been working on a MediaWiki gadget lately, for editing Wikisource authors’ metadata without leaving the author page. It’s fun working with and learning more about OOjs-UI, but it’s also a pain because gadget code is kept in Javascript pages in the MediaWiki namespace, and so every single time you want to change something it’s a matter of saving the whole page, then clicking ‘edit’ again, and scrolling back down to find the spot you were at. The other end of things—the re-loading of whatever test page is running the gadget—is annoying and slow enough, without having to do much the same thing at the source end too.

So I’ve added a feature to the ExternalArticles extension that allows a whole directory full of text files to be imported at once (namespaces are handled as subdirectories). More importantly, it also ‘watches’ the directories and every time a file is updated (i.e. with Ctrl-S in a text editor or IDE) it is re-imported. So this means I can have MediaWiki:Gadget-Author.js and MediaWiki:Gadget-Author.css open in PhpStorm, and just edit from there. I even have these files open inside a MediaWiki project and so autocompletion and documentation look-up works as usual for all the library code. It’s even quite a speedy set-up, luckily: I haven’t yet noticed having to wait at any time between saving some code, alt-tabbing to the browser, and hitting F5.

I dare say my bodged-together script has many flaws, but it’s working for me for now!

Kobo update

A few months ago I bought a Kobo Mini ereader. These are a few notes I’ve made since then about how well it works. It does work well, and I use it a lot.

  • Quite often, after first turning the thing on, it will go back to sleep mode after the first or second page-turn—without me touching the on/off switch. After switching it back on, it stays on until commanded otherwise. This is annoying, and the first few times I thought the thing was total crap, but now I’m used to it and it doesn’t really detract from normal use.
  • It took far longer than I would’ve expected to get used to turning the page! In a couple of books, it would turn the wrong way, or two pages at once, or not turn at all (but just refresh to the same page!). I think this was just my fumbling and lack of awareness of the various screen areas and swipe/tap directions, because it hasn’t happened for ages and I’ve nearly forgotten about it.
  • The bezel is a bit high, casting shadows across the text when the light is not quite high. Far better than the shadow cast by the opposite page of a book, though, so I don’t really say this as a criticism (but it is noticible).
  • Hyperlinks don’t work and should not be displayed as such. (This has only come up in Wikisource texts, and I realised that the epub’s stylesheet should be able to solve this problem.)
  • Fonts seem lacking in some UTF characters (such as 1/8).
  • Hyphenation is a bit weird. Maybe that’s something to do with the epub itself though? I haven’t bothered to read further on the issue.
  • The first-run can not be done on a Linux machine, as it does some stupid reporting and updating to the Kobo HQ. Why this sort of shit is necessary is beyond me, but at least it only needs to be done once and thereafter can be treated as a USB storage device on any OS. I would have loved to have been able to take it out of the box and instantly start reading some pre-packaged whatever.

There’s lots of other stuff, but basically positive and therefore invisible. It has good battery life; good screen contrast; is physically robust (although I do have a fantastic case for it, which puts a nice slab of binders’ board over the screen when it’s not in use); all up is pretty good.

Now, I just hope I don’t have to buy another ereader for, say, five years. Ten, preferably.