mysociety / theyworkforyou

Keeping tabs on the UK's parliaments and assemblies
http://www.theyworkforyou.com/
Other
224 stars 51 forks source link

Mark explicit references to legislation with links to the relevant text #1006

Open gwire opened 8 years ago

gwire commented 8 years ago

When a speech or written answer references legislation explicitly (with a match to its correctly styled name), it should link to a useful source - e.g. legislation.gov.uk (Acts, Orders, Regulations)

Example html written answer on TWFY

issued as guidance under the Protection of Freedoms Act 2012. The police, as a relevant authority

should match "Protection of Freedoms Act 2012" and link it to http://www.legislation.gov.uk/ukpga/2012/9/contents (possibly with differing styling to the Wikipedia links.)

Presumably the titles and corresponding uris can be obtained via the Legislation API

dracos commented 8 years ago

I think it should match to the Wikipedia page in preference, that's more understandable than the bare law (which is linked from Wikipedia anyway). So this is actually a bug in why it isn't doing so (as that's the form the Wikipedia title already takes). Tracked down to 667c9309894a294c8e3b66166bd9e39500681da5 (phrases with spaces no longer spotted) and then additionally added 265dfb98403d1ca8deacc20059e6fadf9cc20053 to include the year number at the end.

gwire commented 8 years ago

While primary Westminster legislation might have a Wikipedia page, I imagine there is a lot (especially Orders) that do not. You can see how many pieces of Welsh legislation have dedicated pages on Wikipedia.

dracos commented 8 years ago

Fair enough (I wonder if they all count enough to be notable if someone wanted to add them). Pull requests welcome. scripts/wikipedia-update is what pulls in Wikipedia titles weekly, and www/includes/easyparliament/glossary.php calls the wikipedize function in classes/Utility/Wikipedia.php. I guess the titles table could be extended, or a separate table of legislation instead if that was easier.