View Single Post
Old 03-29-2012, 03:42 PM   #8
Junior Member
sarafnikit began at the beginning.
Posts: 9
Karma: 10
Join Date: Mar 2012
Device: Kindle
My project was to get a documentation ready for the whole process involved during the conversion of a file form epub to mobi.
So, instead of going over the source code of Calibre, i was searching the web and asking people where can i get such a document(if it has been documented), thinking that it, both the formats are so well know, that it may be documented somewhere.

And at last, i realized that there cannot be an easy solution and stopped searching for it and looked at the source code of Calibre and Mobiperl. But found out that Calibre is much more complex(obviously as it is all in one converter and not just the converter for one file).It first converts the file into XHTML, then parses that XHTML applying many algorithms on it, then converting that XHTML to the required format.

But during the conversion of EPUB to MOBI the following are the largely major steps as i could understand by going through MobiPerl:-
1.Parsing the opf file to get the tree structure of the file.
2.Cleaning up the HTML files - Adding the tags which are needed by MOBI and removing the ones which are not supported by it.
3.Compiling the opf and HTML files, including all the necessary headers for the mobi in the process.
(Though many more things are involved like keeping a check on the metadata, table of contents, guide section etc.)

Am i correct??

Thank you so much, for giving your time.
sarafnikit is offline   Reply With Quote