Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2015, 01:12 PM   #1
cssQuest
Junior Member
cssQuest began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2015
Device: none
How to View CSS Stylesheets of Kindle Books

I want to study the CSS stylesheets of the books in my Kindle library.

(In this forum post I'm skipping discussion of AZW vs AZW3, EPUB, converting to AZW3 and EPUB, DeDRM (6.3.4), and KindleUnpack. I think I've explored those issues and experimented enough to think that they are not the problem I'm experiencing.)

I'm bringing my Kindle books into Calibre, right clicking their titles, and selecting 'Edit Book'.

It seems that the stylesheets are being transformed in some way (creating endless 'p' and 'calibre' classes) which makes it difficult to interpret the CSS author's styling intent.

In my research, I came across mention of Calibre "Flattening CSS Hierarchy" that might be applicable, but never did locate detailed discussion about that. At this point, I've exhausted what I can find to search on this subject.

Question: How I can view the CSS stylesheets of Kindle books in their original form (without having been transformed or "flattened"(?) )?

Thank you.
cssQuest is offline   Reply With Quote
Old 09-16-2015, 01:28 PM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
AFAK, you cannot. If I understand correctly, the stylesheet is made inline for the html documents. So, effectively there is no stylesheet anymore.

Without a doubt if I am mistaken, someone will correct me.
Toxaris is offline   Reply With Quote
Advert
Old 09-16-2015, 01:28 PM   #3
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,887
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by cssQuest View Post
I want to study the CSS stylesheets of the books in my Kindle library.

(In this forum post I'm skipping discussion of AZW vs AZW3, EPUB, converting to AZW3 and EPUB, DeDRM (6.3.4), and KindleUnpack. I think I've explored those issues and experimented enough to think that they are not the problem I'm experiencing.)

I'm bringing my Kindle books into Calibre, right clicking their titles, and selecting 'Edit Book'.

It seems that the stylesheets are being transformed in some way (creating endless 'p' and 'calibre' classes) which makes it difficult to interpret the CSS author's styling intent.

In my research, I came across mention of Calibre "Flattening CSS Hierarchy" that might be applicable, but never did locate detailed discussion about that. At this point, I've exhausted what I can find to search on this subject.

Question: How I can view the CSS stylesheets of Kindle books in their original form (without having been transformed or "flattened"(?) )?

Thank you.
IIRC Conversion is what flattens the book styles, not edits

Kindle unpack (the plugin)

This all assumes the book has not been converted by Calibre
theducks is offline   Reply With Quote
Old 09-16-2015, 01:46 PM   #4
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
if the publisher uses Calibre to make the eBooks (like Baen) then you will see Calibre classes. If you see Calibre classes on eBooks where the publisher does not use Calibre, then stop downloading eBooks that you did not pay for. If these are legally obtained retail eBooks, no matter how the publisher makes the eBooks, you will see the classes and CSS as it was released. If you have a Mobi (AZW) eBook, don't bother to look at it as there is no CSS stylesheet because it's all inline andrather a mess to try to examine it. KF8 (AZW3) and ePub are fine as they do have CSS.
JSWolf is offline   Reply With Quote
Old 09-16-2015, 04:08 PM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Toxaris View Post
AFAK, you cannot. If I understand correctly, the stylesheet is made inline for the html documents. So, effectively there is no stylesheet anymore.

Without a doubt if I am mistaken, someone will correct me.
Nope, just MOBI as it doesn't really support CSS.



If Edit Book is showing calibre* classes, it means that that AZW3 was already converted at some point using calibre. The information you want is long gone.
You will need to find an earlier source of the book, possibly a backup copy.

"Flatten CSS" is part of calibre's conversion pipeline. It happens after the book is exploded (AZW3 Input plugin), during the actual *conversion* phase.
Edit Book only makes use of the Input stage, in order to present the book resources for editing. Same reason why importing a DOCX in the Editor provides much cleaner output than converting to EPUB.
eschwartz is offline   Reply With Quote
Advert
Old 09-16-2015, 07:10 PM   #6
cssQuest
Junior Member
cssQuest began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2015
Device: none
Thanks all, for your comments. I learned from each of them.

Goal: I want to study stylesheets of recently published ebooks to use them as a guide for creating my own stylesheets. I studied the ones from EPUB Zen Garden, but those are five years old (it seems).

The reason I was wanting to view 'Kindle' stylesheets is because that's where the widest selection is located. I could only find 1 out of 10 of the ebooks I was hoping to review on Kobo (and therefore in EPUB format).

Given your above comments, any further ideas on how to best achieve this goal (study stylesheets of recently published ebooks)? If I wanted to study print book formats, I would walk into a bookstore and knock myself out. What's the closest analog when it comes to studying CSS of ebooks?
cssQuest is offline   Reply With Quote
Old 09-16-2015, 08:39 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Keep looking around at more samples? Make sure you have the original AZW3 directly from Amazon.


You can also ask for tips in our Workshop subforum. Many knowledgeable ebook formatters hang out there.
eschwartz is offline   Reply With Quote
Old 09-16-2015, 10:11 PM   #8
ni_c
Enthusiast
ni_c began at the beginning.
 
Posts: 40
Karma: 10
Join Date: Jul 2015
Device: none
interesting question, would like to see their unmodified stylesheets too, but get the sense alotof them will have been automatically generated from scanned OCR layers of the print book equivalents, then piped thru a second automated conversion to azw3/mobi, and then only given minimal (if any) manual editing before publication

@ eschwartz, so are you saying get a hold of a non drm copy of azw3/mobi, then use kindleunpack to see the unmodified file?
ni_c is offline   Reply With Quote
Old 09-16-2015, 10:57 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
No need for KindleUnpack, calibre Editor will do just as well.

Scanned OCR of print books is going to be noticeable enough on first reading that no one will be inspired to see how they did it.
Editing happens before kindlegen, and kindlegen doesn't flatten CSS anyway.
Amazon don't accept calibre-converted dual-MOBIs anyway.
eschwartz is offline   Reply With Quote
Old 09-17-2015, 10:34 AM   #10
cssQuest
Junior Member
cssQuest began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2015
Device: none
Thank you. I'll check out that Workshop forum.
cssQuest is offline   Reply With Quote
Old 09-18-2015, 09:08 AM   #11
cssQuest
Junior Member
cssQuest began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2015
Device: none
@ eschwartz,

When you suggest to "Make sure you have the original AZW3 directly from Amazon", is that something that can be verified at the time of purchase? Or do you mean that once the files are downloaded to a local machine, to make sure I'm working with the AZW3 version of the file?

I ask because upon checking the sample of Kindle books I already downloaded, none of the files are AZW3. I see only these file types: azw, phl, apx, mbpV2.

Also, the book titles save as text strings that are difficult to work with. I checked the Kindle for PC settings but didn't see a way to override that. Do you know how to download from the Kindle app and have the file names be the title names?

Thank you.
cssQuest is offline   Reply With Quote
Old 09-18-2015, 10:00 AM   #12
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
The original AZW3 would be the one Amazon provided rather than a converted copy of the original.
As for the AZW vs. AZW3, Kindle for PC doesn't have very friendly filenames but when importing into calibre the filename will be recreated from the extracted title metadata, and AZW's will receive their true and proper file extension.

There is no such thing as AZW. It is just a renamed MOBI (mobi7) or AZW3 (mobi8).



If the original, from-Kindle-for-PC file has calibre* classes, then that particular book was created by the author/publisher using calibre.
Most likely not by a Big Publishing House.
eschwartz is offline   Reply With Quote
Old 09-18-2015, 10:48 AM   #13
cssQuest
Junior Member
cssQuest began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Sep 2015
Device: none
Thank you.
cssQuest is offline   Reply With Quote
Old 09-19-2015, 08:02 AM   #14
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 78,986
Karma: 144284074
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by eschwartz View Post
/If Edit Book is showing calibre* classes, it means that that AZW3 was already converted at some point using calibre. The information you want is long gone.
You will need to find an earlier source of the book, possibly a backup copy.
Not necessarily. Some publishers such as Baen use Calibre to make their eBooks. So yes, you would expect to see Calibre classes in Baen eBooks.
JSWolf is offline   Reply With Quote
Old 09-19-2015, 12:08 PM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,887
Karma: 59840450
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by JSWolf View Post
Not necessarily. Some publishers such as Baen use Calibre to make their eBooks. So yes, you would expect to see Calibre classes in Baen eBooks.
Not all EPUB books from Baen have calibres fingerprints. That changed when Arnold retired. (I just spot checked. Some that do, have an ugly <div nest that gains 1 layer every chapter (file). I de-div a thousand of these from every order I get )
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom CSS Stylesheets for Calibre's Viewer Ralob Viewer 389 11-24-2024 11:10 AM
Which one to apply: HTML tagging or CSS stylesheets? neyet ePub 12 01-03-2015 06:25 PM
Can you customise the order of books in list view on the Kindle Paperwhite? binkyd Amazon Kindle 17 03-11-2014 04:27 PM
How do I View My Own Test E-Books via Kindle for Android? jdanniel Android Devices 13 09-12-2012 03:15 PM
eReader apps that do use embedded CSS 'stylesheets' jttraverse Android Devices 7 05-20-2011 12:28 AM


All times are GMT -4. The time now is 08:10 PM.


MobileRead.com is a privately owned, operated and funded community.