![]() |
#1 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
Kindle Media Query
I think this is a revisit to an old topic, but I suppose I'm hoping for a better outcome. I've tried every form of Kindle conversion, and in every case, it appears Calibre is stripping out media queries targeting specific Kindle devices.
|
![]() |
![]() |
![]() |
#2 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)
|
Sounds like you may want to use kindlegen...
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
actually, we are in the middle of a dispute as to whether or not media queries of the form "@media amzn-mobi" will work using Kindle Previewer/kindlegen. When we add them to our CSS, they have no effect whatsoever, unless we use the form "@media amzn-kf8".
We have tested this many times, always with the same result: "mobi" queries has no discernible effect on the output, either in a previewer or a kindle device "kf8" will be incorporated in the generated CSS, and will effect the output for both an early Kindle, and a Fire type when the kindle output file is "unpacked", a "mobi" type output will contain nothing in its style sheets that pertains to the query Main CSS: epub selector: .num00 { font-size:small; margin-top:1.3em; margin-bottom:0em; text-indent:-1.8em; margin-left:3.5em; margin-right:1.5em; text-align:justify; font-weight:normal; } Media Query: epub @media amzn-mobi { .num00 { font-size:small; margin-top:1.3em; margin-bottom:0em; text-indent:-3.8em; margin-left:0em; margin-right:1.5em; text-align:justify; font-weight:normal; } } Unpacked Kindle file style 0001.css [kindle file unpacked] .num00 { font-size:small; margin-top:1.3em; margin-bottom:0em; text-indent:-1.8em; margin-left:3.5em; margin-right:1.5em; text-align:justify; font-weight:normal; } Last edited by Macsurfcat; 02-03-2015 at 01:27 PM. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
MOBI files support no CSS at all. Any CSS you specify is converted to the "equivalent" HTML 3.2 by both calibre and kindlegen.
As for amazon media queries, kindlegen is the only tool that uses/supports them. I never use kindlegen, so I have no idea as to the details of its media query support. The MOBI forum might be a better place to ask. |
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
Yes, but when you unpack a mobi a CSS is output that accompanies the new epub generated by kindlegen. If the original epub used a media query of the form "amzn-kf8", the CSS of the new, kindlegen output epub, will include the media query in this form:
"@media all { .num00 { font-size:small; margin-top:1.3em; margin-bottom:0em; text-indent:-3.8em; margin-left:0em; margin-right:1.5em; text-align:justify; font-weight:normal; } } This is, in fact, a NEW media query exactly duplicating the original media query of form "amzn-kf8", in the original epub. Unless I'm greatly mistaken, the epub CREATED by kindlegen from our original epub is the file from which the mobi is created, and that is why the media query styles are incorporated in the final output. Mobis don't use a CSS, but they incorporate the styles that are specified within, and if the media query is in an acceptable form, the styles enclosed within the query tag will be passed on to the mobi. So, my original question stands, I think . . . |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, If you use kindlegen to produce a MOBI, the resulting MOBI will have
1) The old MOBi 2) The book in KF8 (new mobi) format 3) Optionally, the original epub Depending on what tool you use to "unpack" the mobi what you get can come from any of those 3 sources. If you are seeing a CSS file it is definitely not from (1) |
![]() |
![]() |
![]() |
#7 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
to "kovidgoyal":
I will take your advice, and continue this thread in MOBI. thanks for your comments, and I LOVE Calibre, by the way |
![]() |
![]() |
![]() |
#8 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
|
![]() |
![]() |
![]() |
#9 | |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
Quote:
I take an epub with a media query; I ingest it into Kindle Previewer; it spits out a new mobi, that I can preview, load into a Kindle device, etc. If I use the Kindle Unpack [Calibre plugin] to look inside that NEW mobi, it generates two folders: mobi7 mobi8 mobi8 includes a BRAND NEW epub. That BRAND NEW epub features a CSS that includes the "@media all" tag, etc. featured above. Am I missing something? |
|
![]() |
![]() |
![]() |
#10 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
Sorry, I know the mobi doesn't use a CSS. However, the CSS in the original epub is used to generate the code within the Mobi, does it not?
|
![]() |
![]() |
![]() |
#11 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
You're missing the fact that Kindlegen generates a file that contains two version of your book. And old Mobi format version using HTML 3.2, and a new KF8 format version using HTML4 and CSS2.
The mobi7 in the kindleunpack output it the Mobi format bit. The mobi8 is the KF8 bit. So of course the KF8 bit contains CSS. |
![]() |
![]() |
![]() |
#12 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#13 |
The Grand Mouse 高貴的老鼠
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73,596
Karma: 315126578
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Oasis
|
KindleUnpack does generate a pseudo-epub from the KF8 section, even if the original sources have been stripped off.
|
![]() |
![]() |
![]() |
#14 |
Enthusiast
![]() Posts: 29
Karma: 10
Join Date: Apr 2013
Location: New Jersey
Device: Kindle, Nook
|
Not missing that at all, I completely understand that . . .
Yes, the KF8 bit contains a CSS, and an epub that is NOT the original ingested by Kindlegen, and that CSS includes a "@media all" tag. And that, my friend, is the issue. Returning to the first post, if you include a media tag of the form "amzn-mobi" in your CSS, in your original epub, and you ingest that into Kindle Previewer/Kindlegen, that media query neither effects the old mobi bit, nor the new KF8 bit. So, if I open that mobi on a Kindle Fire, or a "paperwhite", none of the styling enclosed within the media query will appear. If that is true, and it appears to be so, how do I target the older device/format? Please comment |
![]() |
![]() |
![]() |
#15 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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)
|
|
![]() |
![]() |
![]() |
Tags |
calibre, conversion, kindle |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building a comprehensive media PC to share media (Mylar, Plex, Calibre, Sickbeard) | Ackis | Devices | 1 | 04-07-2014 06:43 PM |
Color Nook color - media query for Orientation lock | aslam44 | Nook Developer's Corner | 0 | 03-14-2013 03:57 AM |
Query - Kindle DX US | ukhant | Kindle Developer's Corner | 2 | 07-20-2010 03:23 AM |
iPad More People Recognizing That Media iPad Adaptations Feel Like CD-ROM Media | kjk | Apple Devices | 1 | 06-14-2010 06:26 PM |
Cooper blog: News media is lost about digital media, too | Steven Lyle Jordan | Deals and Resources (No Self-Promotion or Affiliate Links) | 0 | 11-05-2007 10:06 AM |