I explored a similar idea after college as a way to improve textbooks. I haven't done any maintenance in years, but the demo is still online: https://www.okeebo.com/demo/
I found that it was a lot of extra work for authors and they weren't interested.