View Single Post
Old 02-11-2013, 10:25 PM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
http://manual.calibre-ebook.com/conv...l#introduction

http://manual.calibre-ebook.com/deve...ml#code-layout

For input all you will need to do is unzip and possibly convert any kepub specific features into their epub equivalents and return the path to the opf file.

For output, you will need to do the following (in outline)

1) Transform the markup to conform to kepub (add the span tags used for annotations, etc.)

1.5) Do various bits of epub specific processing like covers and so on, as is done in the epub output plugin.

2) Output to disk using the oeb writer as is done in the epub output plugin

3) zip up the files, again as is done in the epub output plugin

You can subclass the epub output plugin and re-use various bits of code from it. If you need some refactoring to make the code more re-usable, let me know.
kovidgoyal is online now   Reply With Quote