View Single Post
Old 05-25-2011, 09:22 AM   #9
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Quote:
Originally Posted by kiwidude View Post
Longer term I would think this plugin could have features to add/update the cover image, update the book metadata, add/update a jacket etc. The plumbing is there. The biggest issue to not doing these now is that the calibre code to do these features is all based around assuming an oeb object. I instead chose to load the book into the more lightweight container object, to be guaranteed that the disruption to the ePub content was minimal. So I either need to replicate the calibre code, or find a way to combine the approaches, such as also generating an oeb object to call calibre functions, and then copying the bits it has generated into my container.

Perhaps Kovid or someone who knows the conversion pipeline may have some thoughts or suggestions on this.

For a number of candidate changes all you really need is an iterator to walk through the 'text' items in the manifest and then pass those files to various enabled/applicable preprocess/look and feel functions one by one - they're all just text manipulation functions in the earlier stages. After it's gone through all those functions just make sure it's still valid xhtml (there is a function for this somewhere already) and write the new version back. I'm not sure if there is anything special in the regular conversion pipeline to determine which files are valid text elements.
ldolse is offline   Reply With Quote