Reading legislation.gov.uk on mobile
Sometimes I have to read legislation for my day job, e.g. council boundary changes for MapIt or something that has come up in TheyWorkForYou. Sometimes I also read it for fun; I have no memory as to why I was researching this in 2006, but I apparently created the original Piracy Act 1698 page on Wikipedia.
If you ever need to read a piece of legislation, legislation.gov.uk is a great website with so much effort gone into it; I remember before it existed and it is incomparable where we (as normal members of the public, without paid legal access) are nowadays. (It launched in 2010, also the year GB administrative boundaries became open data.)
However, it has a desktop-only web design that does not work well on mobile. I had followed a link from Bluesky on my phone to legislation.gov.uk and sighed again as it was tiny text, very hard to read, and I would have to read it later on a computer (or more likely forget entirely). But this time it caught me in a short space of free time.
The website provides its information in a variety of different formats, from PDF to Akoma Ntoso, and a couple of HTML outputs, one of which already looked better on mobile, but lacked any navigation. The HTML5 output also already had some CSS styling of the content, which mostly worked fine, though I made a few tweaks to it to reduce some over-large margins.
I whipped up a very basic proxy, available at adlegem.dracos.co.uk, that takes a legislation.gov.uk URL, fetches the HTML5 output for the main content, fetches the HTML output to extract the previous/next navigation, and prints it out with light styling on top. You can see the results below:
I also made an Apple Shortcut that means you can “share” any web page with, which will then take you to my version of the same page.
The service is available at adlegem.dracos.co.uk and the source code is at https://github.com/dracos/adlegem (all the work is in the one file index.php, do take a look, and see if you can think of anything else you could make something like this for?).
I understand that legislation.gov.uk is currently in the process of building a new front end, which may (hopefully!) make this entirely superfluous, in which case it will become a redirect back to the original source :)