View Single Post
Old 04-15-2016, 07:02 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by Hitch View Post
The question is, what happens to the TOC link, which, presumably, goes to the xhtml file OR the id of the cover page, when that page is removed or destroyed in the Kindlegen process?
Not too sure what would happen to the cover file though, since I know Amazon messes with that in a separate process. (As you mentioned, if you relied on display:none, you would probably still get the "double cover").

Side Note: I never really looked too deeply into it until today (so take this as all educated guesswork).

To my knowledge, if there is display: none, the content goes poof (and doesn't exist) in the resultant MOBI HTML.

I ran the example EPUB below using KindleGen, then checked the HTML from KindleUnpack. It looks as if the display: none code doesn't appear in the MOBI7 at all.

It does appear in the KF8 though, and is marked with a new attribute:

data-AmznRemoved="mobi7"

Side Note on the Side Note: I wonder if this also falls into our discussion on "Page Numbers"/"Locations" in ebooks. I bet the Amazon Location algorithm also has to take into account all of these data-AmznRemoved attributes so that the MOBI/KF8 locations match.

Quote:
Originally Posted by Hitch View Post
The other quesion is, can you put AMZN media queries in an ePUB and stil have it pass ePUBcheck? Our experiences with AMZ media queries has been that normally, they affect the ePUB vis-a-vis ePUBcheck.
I don't believe epubcheck complains about Kindle Media Queries.... although I must admit, I never went too crazy on them.

I attached a sample EPUB that has Kindle Media Queries + passes epubcheck 3.0 with zero complaints.

I just grabbed a simple Media Query Dropcap example from somewhere, and just added some code to it to make sure the media queries were working.

This code in the TOC:

Code:
<h2>Table of Contents</h2>

  <p class="nokf8"><a href="../Text/cover.xhtml">Cover (Everything non-KF8)</a></p>

  <p class="nomobi"><a href="../Text/TOC.xhtml">Table of Contents (Everything non-MOBI)</a></p>

  <p><a href="../Text/Chapter1.xhtml">Chapter 1 (Everything)</a></p>
and this in the CSS:

Code:
span.dropcaps {
    font-weight: normal;
	font-style : italic; 
    font-size: 2em; 
    float: left; 
}

p.nomobi, p.nokf8 {
	/* This should make sure it displays on everything else */
	display: block;
}

/* Kindle-specific CSS */ 
@media amzn-kf8 { 
  span.dropcaps { 
    font-weight: normal;
	font-style: normal; 
    font-size: 320%; 
    float: left; 
    margin-top: -0.3225em; 
    margin-bottom: -0.3245em;
  }
	p.nokf8 {
		display: none;
	}
} 
@media amzn-mobi { 
  span.dropcaps { 
    font-size: 3em; 
    font-weight: bold; 
  } 
	p.nomobi {
		display: none;
	}
}
Ran it through KingleGen and it seems to display as it should:

Click image for larger version

Name:	MediaQueriesEPUB.png
Views:	306
Size:	3.3 KB
ID:	147859Click image for larger version

Name:	MediaQueriesMOBI.png
Views:	343
Size:	10.4 KB
ID:	147860Click image for larger version

Name:	MediaQueriesKF8.png
Views:	342
Size:	9.4 KB
ID:	147861
Attached Files
File Type: epub Testing Media Queries.epub (23.6 KB, 243 views)
Tex2002ans is offline   Reply With Quote