jaketmp / ePub-quicklook

NOTE: Not working in Mojave and later! ePub quicklook and spotlight plugins for Mac OS X.
BSD 3-Clause "New" or "Revised" License
570 stars 58 forks source link

Bug fix with multiple authors, added publisher #4

Closed chrisridd closed 12 years ago

chrisridd commented 12 years ago

Hopefully the commit descriptions are clear enough.

jaketmp commented 12 years ago

Great, thanks - I'll pull these in. I'll prob play around with the presentation metadata table in my branch, as it doesn't quite gel with the manner in which I see a quicklook generator being used. To my mind it should only show the essential metadata - I'm thinking not many people browse their library by ISBN &c, I'd be more inclined to put that sort of metadata extraction into a spotlight importer.

chrisridd commented 12 years ago

On 23 Jan 2012, at 15:38, jaketmpreply@reply.github.com wrote:

Great, thanks - I'll pull these in. I'll prob play around with the presentation metadata table in my branch, as it doesn't quite gel with the manner in which I see a quicklook generator being used. To my mind it should only show the essential metadata - I'm thinking not many people browse their library by ISBN &c, I'd be more inclined to put that sort of metadata extraction into a spotlight importer.

I agree, isbn is a bit of an odd thing to display. Good candidate for a spotlight importer though!

A benefit of the tabular format is that it is easy to add more rows - and there are lots more dc:creator/contributor roles that could be extracted. I found adding a new field (publisher) rather awkward (hack the CSS, hack the HTML) before using the table.

Apologies for the scrappy nature of the latter changes :-)

Chris

chrisridd commented 12 years ago

On 23 Jan 2012, at 15:38, jaketmp wrote:

Great, thanks - I'll pull these in. I'll prob play around with the presentation metadata table in my branch, as it doesn't quite gel with the manner in which I see a quicklook generator being used. To my mind it should only show the essential metadata - I'm thinking not many people browse their library by ISBN &c, I'd be more inclined to put that sort of metadata extraction into a spotlight importer.

Two further notes... I see you've also noticed that Apple's XML wrapper classes don't seem to handle namespaces at all.

Google's XML classes however do, and they're a really simple drop-in replacement (change NSXML... to GDataXML...). If you want to parse the XML "correctly" then using Google's code is recommended.

According to:

http://www.raywenderlich.com/553/how-to-chose-the-best-xml-parser-for-your-iphone-project

it is faster than Apple's libxml (etc) wrapper as well. Ray's page links to another explaining how to include it in your project.

Lastly, I reckon the code that takes the epub strings and puts them into HTML needs to do proper HTML escaping of special characters. I can imagine some book titles might contain &, and maybe < and >.

Chris

jaketmp commented 12 years ago

Excellent point - and good to know about GDataXML, I'll check it out.

Jake