Add base for generating ebook and pdf and live preview