As more scholars and students turn to digital sources, libraries and archives are discovering a new purpose and new audiences