08-11-2018, 11:41 PM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Hidden attribute not working properly in some devices
Hello guys!
I'm having a little trouble with the TOC (HTML) of my book... It's a valid (3.0.1) .epub file, which I converted to .mobi using kindlegen without warnings or errors. The problem is the way my Front Matter section is renderized in some devices. I put a "hidden" attribute in the section (see code below), and I wanna it: a) to appear in the Device TOC (the one you access via GO TO menu in the Paperwhite, for example), but NOT in the book itself. b) to work as a jump point when using the arrows to jump to the previous/next section. So, to sum up, the Front Matter section has all the navigational properties, but is hidden in the TOC in the beginning of the book. But this is what happens after I copy the .mobi file to my devices, as a test: 1) Kindle Paperwhite, most recent version: everything is ok, the way I expected. The Front Matter section doesn't appears on the TOC of the book itself, but does appears in the GO TO menu with the collapsible arrow feature, and I can successfully jump between each part of it using the arrows ( |< and >| ) in the page flip screen. 2) Kindle 5th generation (Kindle 5, the one with the 5 buttons in the botton): the hidden part of the TOC DOES APPEARS inside the book. I don't know why, since i believe this model does have support for the HTML/EPUB3 features. Am I wrong? 3) Kindle app for Android: This one is very strange. Everything is fine, except the text header "Front Matter" appears 2 times, one inside of another! Like (the > represents a collapsible arrow): > FRONT MATTER (all uppercase) > Front Matter (The way is actually writed in the TOC) Foo Bar Foo Bar Bar Foo TOC Chapter 2 ... ... ... This is the HTML code (just a excerpt) Code:
<nav epub:type="toc" id="toc-nav"> <ol> <li hidden="hidden"><span>Front Matter</span> <ol> <li><a href="foo.xhtml">foo</a></li> <li><a href="bar.xhtml">bar</a></li> <li><a href="foobar.xhtml">foo bar</a></li> <li><a href="barfoo.xhtml">bar foo</a></li> <li><a href="toc.xhtml">TOC</a></li> </ol> </li> <li><a href="c01.xhtml">Chapter 1</a></li> <li><a href="c02.xhtml">Chapter 2</a></li> <li><a href="c03.xhtml">Chapter 3</a></li> ... ... ... Tks a lot! |
08-12-2018, 10:28 AM | #2 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
What's a 3.0.1 epub?
And how are you converting epub to mobi? (I don't find it necessary to convert at all. I just take out the included cover image and upload the epub to the KDP.) And this GO TO feature -- do you mean the logical or virtual TOC? I fear that, overall, as with your rendering of renderize, you are stretching html beyond all reasonable limits. If there is such a word as renderize, there shouldn't be! Tenderize, yes, but not renderize. |
08-12-2018, 10:53 AM | #3 | |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
IMHO, the easiest solution would be to simply add a class="hidden" attribute: Code:
.hidden { display: none; } |
|
08-12-2018, 12:42 PM | #4 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Hitch |
|
08-12-2018, 01:08 PM | #5 | ||||
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
http://idpf.org/epub/301
Quote:
Quote:
Quote:
Quote:
|
||||
08-12-2018, 01:16 PM | #6 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
|
|
08-12-2018, 02:04 PM | #7 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
I think I can use the Landmark element to achieve the same result as the Guide, but I really don't know if it is rendered in the Go To menu or if it just works as "jump points". But I'll try it. Thanks Hitch! |
|
08-12-2018, 02:25 PM | #8 | |||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
Quote:
Yes, you should be able to use the NAV, but you may not find that it works better than the Guide with the issues you're having now. I'd certainly try it, though. Hitch |
|||
08-12-2018, 05:37 PM | #9 | |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
For example, you can't use pseudo selectors. |
|
08-12-2018, 06:33 PM | #10 | ||
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
Hey Hitch. On my epub, I have the toc.xhtml AND the toc.ncx (using the <spine toc="ncx">) as a fallback. They are identical, except for the html/xml markup, of course. But I was in doubt which one was being used too, so I did the following, as a test: - Instead of "Chapter 1", I wrote "Chapter 1 HTML" in the toc.xhtml - Instead of "Chapter 1", I wrote "Chapter 1 NCX" in the toc.ncx , zipped as epub and converted it to mobi using kindlegen. So, in the end, the file rendered was the HTML one in all devices I tested (paperwhite and kindle app for android). But I think this happens because I'm using epub 3 with the "nav epub:type" markup. This makes the same file (toc.xhtml) to work as the "in book" toc and as the logical (Go To) one. I think the ncx file would be used if the epub 2 were used instead. From the book ePub3 Best Practices, from Matt Garrish and Markus Gylling (O'Reilly): Quote:
About the HTML/CSS I'm using, to be honest, it's not really a big deal. I'm just more comfortable using the HTML5 markup, like section and nav, and I really like the additional structural semantics, so I'm using it from the beginning. All my content.opf file, too, is structured based in the epub 3 spec (no opf: namespace, no opf:scheme attribute, no opf:event, etc). Also, I think it's more well documented too, and I really like the already mentioned book ePub3 Best Practices. I like to have some CSS3 features available to use if necessary too, like media queries, support to multi-column layout, the nth-child(odd) or nth-child(even) to select alternated elements, and even border-radius. In the end, CSS3 is a great way to reduce the file size by reducing the amount of HTML code necessary. I know maybe it's not worth it, but this is the way I learned since the beginning and I'm worried I need to change a lot of stuff to go back to epub 2 now. But, well, maybe it's the right thing to do, so... Thank you very much for your reply! |
||
08-13-2018, 11:05 AM | #11 | |||||
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Quote:
Quote:
Quote:
Quote:
Hitch |
|||||
08-13-2018, 01:50 PM | #12 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
|
|
08-13-2018, 02:04 PM | #13 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
A quick question: do you have a good resource to compare different kindle formats (AZW3, KF8, KFX, etc)? I think the big problem here is I'm relying too much in the ePub specs while I need to focus more on how all this stuff is translated to the (as you put it) Kindleverse. Amazon guides do not help! Thanks again! |
|
08-13-2018, 02:19 PM | #14 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
Well, yes, but that's because I have about 10 different real live Kindle devices sitting here. I would say that KP3 and KP2.9x are actually QUITE good. In KP3, you cannot rely on the line-heights, and you cannot see ET outside of KP3--if you sideload a file that has ET, onto a device, you won't see the ET, like popup footnotes or the like. Other than that, the two together--using KP2.9 for KF7 and line-heights, and KP3 for everything else--are accurate enough. You are, what, sideloading your built MOBI onto a Droid device, to test that TOC Guide issue? Hitch |
|
08-14-2018, 05:06 PM | #15 | |
Junior Member
Posts: 8
Karma: 10
Join Date: Aug 2018
Device: Kindle Paperwhite
|
Quote:
Thanks Hitch |
|
Tags |
compatibility, html, rendering issue, toc, toc creation |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amazon eInk Devices: Hidden Text Possible? | tobias.wantzen | Kindle Formats | 8 | 03-26-2017 05:44 PM |
Kath.net not working properly | Leonatus | Recipes | 2 | 01-16-2017 04:42 AM |
Arrange into folders not working properly | DrChiper | Editor | 5 | 03-01-2014 01:10 PM |
Links not working properly? | dokkeynot | Sigil | 1 | 06-27-2012 02:04 PM |
Kindle for pc not working properly | bodhran | Amazon Kindle | 4 | 09-18-2011 01:45 PM |