CPC emulation on CPCWiki pages

Continuing the discussion from CPC emulation added in-page for topics! :joystick::

The new forum is great and this feature is excellent.

I wonder whether you would add a similar feature to the wiki too.

On the old forum I mentioned this idea at: Website allowing you to play any disc image online I did get a website working that would run RVM, loading any .DSK image on the internet, so that part is easy enough.

It would be cool to be able to go to a wiki page like WACCI issue 1 (October 1986) - CPCWiki and load the disc image without even having to download it.

Yes, it is possible, by creating an extension and a tag. Haven’t really looked into it but I think I know how to go about it.

However, it won’t be off any use until someone edits all the relevant pages and ads the launching tag to them, so I’m not sure if it makes much sense.

I think it would be possible to write an extension to use one of MediaWiki’s hooks to change how all links to .dsk files are displayed (perhaps only for files hosted on cpcwiki.eu to begin with).

If you went for the tag idea instead, it would probably be possible to add tags to all the relevant disc image links using ReplaceText.

Ok, sounds like you know a thing or two about mw, so that’s nice, let’s discuss! :slight_smile:

About ReplaceText: that’s a noooooooononononono. No. No. :joy: If I try to do it that way across thousands of pages, I’ll be fighting regex (with which I have a love/hate relationship) till kingdom come. Some pages use structured infoboxes ({{Infobox Game | disk = ...}}), some use raw [[Media:game.dsk]] links, and others link to external FTP mirrors or .zip archives. There’s no way I can get them all without introducing errors, plus it would introduce a new revision for each and every page touched to the database.

About the hooks, though. This got me thinking. Automatic link detection is possible (though I suspect that Mediawiki’s parser cache would probably make it tricky), however I think we don’t even need a PHP hook. What we could do, probably, is introduce a JS snippet to the MediawIki:Ccommon.js (or even directly into the theme??), scan the DOM on every page load and if a dsk link is found introduce a [Play] button next to them. That’s similar to what I did on the forum, too.

I won’t be touching it just yet, I need to think about it and look into mw modification a little first. If you’ve got any ideas, let me know!

Aaaaand done!