Add ebook generating code