The way to do it is like the calibre conversion system. Define a base annotations format that uses the EPUB 3 CFI spec for locations and specifies various types of annotations: text, image, svg, highlight, bookmark.
Then implement a system of input and output plugins that map to/from this base format.
That is the theory, actually implementing it is a ton of work.
|