ST. GALLEN, Switzerland  One of the oldest and most valuable collections of handwritten medieval books in the world, housed in the magnificent baroque halls of the library in this town’s abbey, is going online with the help of a $1 million grant from the Andrew W. Mellon Foundation.

For centuries scholars from around the world have flocked to the Stiftsbibliothek  literally, the abbey library  in this quaint town nestled in the rolling hills of eastern Switzerland, to pore over its vast collection of manuscripts, many written and illustrated before the year 1000.

The collection includes material as varied as curses against book thieves, early love ballads, hearty drinking songs and a hand-drawn ground plan for a medieval monastery, drafted around A.D. 820, the only such document of its kind.

The library is believed to have been founded in the ninth century, about two centuries after an Irish monk named Gallus established the monastery that would become the center of the city that now bears his name. The monastery was dissolved by local authorities in 1805. The library is now the property of the Roman Catholic church.