Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 10-23-2010, 09:16 PM   #1
NewDay
Connoisseur
NewDay doesn't litterNewDay doesn't litter
 
NewDay's Avatar
 
Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
Syntax for toc.ncx Levels 1 and 2?

Is there a way to code the toc.ncx so that iBooks will display Level 1 AND Level 2, instead of putting everything at Level 1?

Here's a sample of some existing toc.ncx code:

<navPoint id="navpoint-5" playOrder="6"><navLabel><text>Breakfasts Plain and Fancy</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor"/></navPoint>
<navPoint id="navpoint-6" playOrder="7"><navLabel><text>Apple Fingers</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-1"/></navPoint>
<navPoint id="navpoint-7" playOrder="8"><navLabel><text>Hummelgum</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-2"/></navPoint>
<navPoint id="navpoint-8" playOrder="9"><navLabel><text>Breakfast Lasagna</text></navLabel><content src="CastIronCuisine-6.xhtml#toc-anchor-3"/></navPoint>

I want the text "Breakfasts Plain and Fancy" to visualize on the iPad as a Level 1 entry. Apple Fingers, Hummelgum, and Breakfast Lasagna are all recipes that need to appear as Level 2 entries.

Can I hand-code this directly? What should be the proper syntax?
NewDay is offline   Reply With Quote
Old 10-24-2010, 04:10 AM   #2
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,516
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
The syntax is:

Code:
<navPoint> (Level 1)
</navPoint>
<navPoint> (Level 1)
  <navPoint> (Level 2)
  </navPoint>
  <navPoint> (Level 2)
  </navPoint>
</navPoint>
i.e. Just include the <navPoint>'s of the inner levels inside the parent <navPoint>. Whether or not iBooks will display this in tree form is unknown to me.
Jellby is offline   Reply With Quote
Advert
Old 10-24-2010, 10:27 AM   #3
NewDay
Connoisseur
NewDay doesn't litterNewDay doesn't litter
 
NewDay's Avatar
 
Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
Jellby, thanks for the syntax. I'll report back whether iBooks honors it.
NewDay is offline   Reply With Quote
Old 10-26-2010, 12:02 PM   #4
NewDay
Connoisseur
NewDay doesn't litterNewDay doesn't litter
 
NewDay's Avatar
 
Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
Jellby, I used the syntax you gave. Ran it by a syntax validator, came out clean. Sent it to epubcheck and it wouldn't validate. Removed the Level 1, Level 2 syntax and got validation. What now? I still feel it's important that Level 2 items be subsumed under Level 1 for visual clarity. But how to make that happen when somewhere my requests to InDesign get lost in transition?
NewDay is offline   Reply With Quote
Old 10-26-2010, 12:26 PM   #5
charleski
Wizard
charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.charleski ought to be getting tired of karma fortunes by now.
 
Posts: 1,196
Karma: 1281258
Join Date: Sep 2009
Device: PRS-505
Here's the toc.ncx for a book I uploaded here. It has a 2-level ToC and validates perfectly in epubcheck 1.05.

Converting your code as you described would produce:
Code:
<navPoint id="navpoint-5" playOrder="6">
  <navLabel>
    <text>Breakfasts Plain and Fancy</text>
  </navLabel>
  <content src="CastIronCuisine-6.xhtml#toc-anchor"/>
  <navPoint id="navpoint-6" playOrder="7">
    <navLabel>
      <text>Apple Fingers</text>
    </navLabel>
    <content src="CastIronCuisine-6.xhtml#toc-anchor-1"/>
  </navPoint>
  <navPoint id="navpoint-7" playOrder="8">
    <navLabel>
      <text>Hummelgum</text>
    </navLabel>
    <content src="CastIronCuisine-6.xhtml#toc-anchor-2"/>
  </navPoint>
  <navPoint id="navpoint-8" playOrder="9">
    <navLabel>
      <text>Breakfast Lasagna</text>
    </navLabel>
    <content src="CastIronCuisine-6.xhtml#toc-anchor-3"/>
  </navPoint>
</navPoint>
Attached Files
File Type: zip toc.zip (5.6 KB, 322 views)
charleski is offline   Reply With Quote
Advert
Old 10-26-2010, 12:50 PM   #6
NewDay
Connoisseur
NewDay doesn't litterNewDay doesn't litter
 
NewDay's Avatar
 
Posts: 59
Karma: 100
Join Date: Aug 2010
Location: Northern California, in the redwoods by the ocean
Device: iPad
Charleski, that is a very beautiful toc. Does it actually play at two levels in iBooks? There's my rub. iBooks seems to be acting strangely if I make my toc too long. Do you have that trouble?
NewDay is offline   Reply With Quote
Old 04-04-2011, 02:47 AM   #7
Iznogood
Guru
Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.Iznogood ought to be getting tired of karma fortunes by now.
 
Iznogood's Avatar
 
Posts: 932
Karma: 15752887
Join Date: Mar 2011
Location: Norway
Device: Ipad, kindle paperwhite
I know I'm answering an old thread, but just in case anybody else is looking for answer to this question: I tested this yesterday, and found that iBooks, the viewer in Calibre, Adobe Digital Editions and the Bluereader App both handles at least two levels TOC fine
Iznogood is offline   Reply With Quote
Old 04-04-2011, 04:09 PM   #8
Nigol
Groupie
Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.Nigol ought to be getting tired of karma fortunes by now.
 
Nigol's Avatar
 
Posts: 184
Karma: 363616
Join Date: Dec 2010
Location: Montreal, Canada
Device: Kobo Original, Kobo Touch
I have found out that sometimes epubCheck will give out a lot of errors, that won't prevent your book from being read, so If the result i sacceptable and works with calibre & ADE I don't think there should be any problem.

On another note, try the app in my Sig, it will let you change the Levels of your book without manually editing the toc.ncx (Just drag and drop)
Nigol is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Mapping Using toc.ncx lorddon ePub 35 01-16-2018 12:18 PM
Is there a size limit for TOC.ncx? osnova Kindle Formats 10 10-21-2011 01:41 AM
adding a toc.ncx file to the .prc package cyberbaffled Amazon Kindle 4 09-14-2010 02:21 PM
Can you bypass first two items in TOC.ncx? sueneu Kindle Formats 4 07-14-2010 08:36 AM
toc.ncx playOrder question aarcane ePub 8 05-25-2010 05:00 AM


All times are GMT -4. The time now is 02:00 AM.


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