Only at Oxford could musty tomes about phallic worship be regarded as a genuine target for onanistic students. With the university’s Bodleian Libraries announcing that they will be putting their restricted section (read: anything classified as immoral, erotic or obscene) on display for the first time since it was started in 1882, the lengths librarians took to build this collection of books published abroad but banned in the UK has been revealed. These include the covert mission organised between librarians and a Foreign Office official to smuggle in two copies of DH Lawrence’s Lady Chatterley’s Lover, librarians who identified lulls in criminal proceedings that allowed them to buy books legally, and personal letters written by library staff to British officials, pleading for books snatched by customs before they were destroyed.

There have been brave librarians throughout history; sadly, in many parts of the world, librarians are often called on to stand up for the principles of freedom of expression, while also upholding the dictum of libraries being a place of sanctuary. In 2012, Abdel Kader Haidara – one of the subjects of the 2017 book The Bad-Ass Librarians of Timbuktu – helped to smuggle 500,000 manuscripts out of the city, away from Malian Islamists who were threatening to destroy them. Saad Eskander, director of Iraq’s National Library, has tirelessly sheltered and chased books targeted by both Islamists and US forces since 2003. (“I never have a bodyguard because that attracts attention,” he told the Guardian in 2008, adding: “If they want to kill you, they will do it.”) And many librarians were charged with “dangerousness” in Cuba for stocking books classed by Fidel Castro as incendiary – like George Orwell’s Animal Farm.

With the likes of Fifty Shades of Grey on bestseller lists, gone are the days of readers quibbling over the presence of The Joy of Sex in a library (one of the Bodleian’s illicit texts). Moralistic handwringing is now usually reserved for non-heterosexual depictions of sex – particularly in young adult books – as well as transgender characters in picture books. In 2005, a parent of a student at St Andrews Episcopal School in Texas offered it a $3m donation – on the condition the library remove its copy of Annie Proulx’s gay romance Brokeback Mountain from the shelves. The head and the librarian at the school refused, and the donation was withdrawn.

Librarians have also made libraries places of safety even in the most extreme situations: the Ferguson Municipal Library in Missouri stayed open to provide residents with “wifi, water, rest, knowledge” during the 2014 riots sparked by the shooting of unarmed teenager Michael Brown. And Yvonne Cech, a librarian at Sandy Hook Elementary School, protected 18 children and three staff members in a storage closet during the 2012 mass shooting, by barricading the door with a filing cabinet. Just over five years later, Diana Haneski, the librarian at Marjory Stoneman Douglas High School, shielded 50 students and five adults in a equipment room during another mass shooting – and followed her friend Cech’s advice by refusing to open the door until she had verified their rescuers’ identities. It’s a step beyond petitioning a grumpy British customs official to send on an illicit copy of Eduard Fuchs’ Geschichte der erotischen Kunst – but part of the same brave history of librarians putting ideas before safety.