This is a quick and dirty conversion to ePub (and a calibre generated mobi version) of Real World OCaml (located: https://realworldocaml.org/)
Real World OCaml is graciously offered by O'Reilly under the
Attribution-NonCommercial-NoDerivs 3.0 United States
creative commons license (CC BY-NC-ND 3.0 US)
Copyright 2012-2013, Jason Hickey, Anil Madhavapeddy and Yaron Minsky. Licensed under CC BY-NC-ND 3.0 US.
This license specifically allows non-commerical distribution in alternative formats.
The books looks to be ok formatted in Calibre and on my Kindle, but looks like shit in OSX Apple Books. In case you are willing to fix the formatting, I'm happy to accept patches to the included scripts, but please don't bug me about fixing it for you :)
Alternatively, reward the generosity of the fine folks at O'Reilly and buy a proper eBook version. The ones I've seen are very well formatted, work properly on all devices and are well worth the investment.
Either download the epub or mobi version directly OR if you are not happy with the formatting:
$ wget -r https://realworldocaml.org/
$ gem install gepub
If gepub install fails because of libxml2 errors, try:
$ gem install nokogiri -- --use-system-libraries #
and repeat the gepub install command. You should now be ready to generate the epub:
$ ruby ocaml_epub.rb
The mobi version was generated by Calibre GUI, so you'll need to do that manually.