Most people would be happy with PDF I think – LibreOffice outputs it easily, and you can read it on pretty much anything. Even Kindles, although the formatting can go a bit weird sometimes.
ePub or one of the eBook formats would also be good – you could use Sigil or a LO extension to write that.
Not sure if you saw what they"re touting for their new textbook stuff, but it goes some way beyond PDF. Aside from obvious multimedia content, it offers various cookie-cutter interactive widgets, such as end of section quizzes, study cards and the like, along with the ability to write your own widgets with HTML5. It also has the advantage of keeping any sample code on the iPad, making it harder to copy/paste onto your RPi—easier to learn when you have to type it yourself
I only mentioned it as it looked like an interesting approach to teaching, and something I might have tried my hand at writing for the community. But like I said, for some reason it didn"t occur to me that the authoring tool would be Mac only. Senior moment I guess. I like my iPad a lot, but Hades is still a little too warm for me to consider buying a Mac.