Scholars in Timbuktu studied law, astronomy, medicine, and theology. Families preserved thousands of manuscripts that document centuries of African intellectual life.