View Single Post
Old 02-19-2013, 01:36 PM   #138
mjwilson
Connoisseur
mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.mjwilson ought to be getting tired of karma fortunes by now.
 
Posts: 78
Karma: 511127
Join Date: May 2012
Device: Kindle Keyboard
Quote:
Originally Posted by Ephemerality View Post
I've actually been working quite a bit over the past week on creating an x-ray builder that generates all of the loc and chapter information by unpacking the mobi file and running through the raw book content (the page-by-page info is calculated on the Kindle itself).
The format is fairly simple, each loc points to a point in the book and defines the excerpts you see on that character's page. The locations are positions within the raw html file (I've been unpacking the mobis with mobi_unpack using the -r flag to get the raw markup). The default loc that the X-Ray builder here gives is [100,100,100,6], so say that is [A,B,C,D].
A is the start position of the excerpt.
B is is the length of the excerpt.
C is the position within the excerpt that starts being bolded.
D is the length of the bolded section.


Edit #2: I hadn't thought about it, but since the Calibre version already has access to the book it could definitely be modified to add the locs. My version is a separate program done in C# so it's not nearly as convenient...
Good work! I guess I need to have a dig around in the Calibre internals to see how easy it is to get these offsets.
mjwilson is offline   Reply With Quote