01-30-2011, 04:20 AM | #1 |
Zealot
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
|
TOC & .ncx query
Hello, please forgive any idiocy on my part with my inability to successfully implement what I suspect is probably a straightforward 'structure detection' setting within calibre. In essence I have a book in epub format that I am converting to mobi, the original epub file does not have an ncx component, but does have a TOC, but when you go to the TOC editor in Sigil it is blank, if I convert it to mobi, all the chapter headings and TOC are there but without the navigation bar at the bottom of the kindle screen - obviously due to the lack of the ncx file - not a deal breaker I know, but I'd still like to have it.
The original code is as below: Code:
<body> <div class="chapter" id="ch11"> <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p> </div> Code:
<body> <h2 id="heading_id_2">Chapter 11</h2> <div class="chapter" id="ch11"> <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p> </div> Apologies if this somewhat rambling in nature Cheers Paul |
01-30-2011, 04:59 AM | #2 |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
The code you have seems to be showing the Chapter title twice - once inside the <h2> tag and the other inside the <p> tag within the <div>. If you are adding the <h2> tag I would think you could remove the <div> tag and it's contents.
|
Advert | |
|
01-30-2011, 05:06 AM | #3 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
You could change the XPath chapter detection to use your existing tag structure. Using this should do the trick:
Code:
//*[name()="div" and @class="chapter"] |
01-30-2011, 05:34 AM | #4 | |
Zealot
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
|
Quote:
Cheers Paul |
|
01-30-2011, 05:43 AM | #5 | |
Zealot
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
|
Quote:
Cheers Paul |
|
Advert | |
|
01-30-2011, 05:53 AM | #6 |
Wizard
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
|
I think you'd need to put it in the Level 1 TOC in the table of contents tab, as well. Also, you'd probably need to set Calibre to force use of the autogenerated TOC.
|
01-30-2011, 06:44 AM | #7 | |
Zealot
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
|
Quote:
Cheers Paul |
|
01-30-2011, 09:37 AM | #8 | |
Wizard
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
|
Quote:
|
|
01-30-2011, 11:14 AM | #9 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
you could also avoid using a style-name the is a standard splitting filter
change the stylesheet and usage from .chapter (class="chapter", to something that the splitter won't grab upon. style-sheet: .mychapt usage: class="mychapt" But changing the original (in red)p to h2 should have done the trick so for BOTH the TOC and inline_toc Code:
<body> <div class="chapter" id="ch11"> <p class="chapterTitle"><a href="../Text/contents.html#ch_11">Chapter 11</a></p> </div> |
01-31-2011, 12:41 PM | #10 | |
Zealot
Posts: 118
Karma: 36978
Join Date: Sep 2010
Location: Johannesburg, South Africa
Device: Kindle Android, Kindle 3 Wi-Fi
|
Quote:
I was also battling in trying to centre the chapter heading and after a lot of messing around with the html code and finding advice through my trusty friend google, I wasn't getting much success, until I had a brainwave and simply centred it using the text editor in Sigil, hey presto Code:
<body> <div class="chapter" id="ch06"> <h2 class="chapterTitle sgc-1 sgc-2" id="heading_id_2"><a href="../Text/contents.html#ch_06">Chapter 6</a></h2> </div> Cheers Paul |
|
01-31-2011, 09:21 PM | #11 | |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
They are mainly inserted when you use the Justification or Font buttons in Sigil If you ONLY style you document using the stylesheet and Code View (and don't use the buttons), SGC codes don't get inserted. There are exceptions: (I just have not figgured out what triggers Auto-SGC codeing) |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Page Mapping Using toc.ncx | lorddon | ePub | 35 | 01-16-2018 12:18 PM |
NCX From Html TOC | Unno | Kindle Formats | 20 | 09-16-2011 09:31 AM |
Syntax for toc.ncx Levels 1 and 2? | NewDay | ePub | 7 | 04-04-2011 04:09 PM |
Saving with old toc.ncx file | Haderlump | Sigil | 1 | 12-28-2010 12:11 PM |
Can you bypass first two items in TOC.ncx? | sueneu | Kindle Formats | 4 | 07-14-2010 08:36 AM |