Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 08-17-2011, 03:50 AM   #1
Caleb666
Zealot
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
Generated TOC links back to TOC page in the book

Hi,

I have a book that has a pretty bad TOC, so I decided to edit it with Sigil and fix it.
Before the edit, the TOC elements looked like this:
Code:
  <div class="calibre11">
    <blockquote class="calibre2"><a class="calibre13" href="../Text/split_013.html#filepos40901">Chapter 2</a></blockquote>
  </div>
After editing, saving and re-opening the file:
Code:
  <div class="calibre11">
    <h4 class="calibre2" id="heading_id_10"><a class="calibre13" href="../Text/split_013.html#filepos40901">Chapter 2</a></h4>
  </div>
Notice that the id="heading_id_10" was added. What also seems to have happened is that the links in the NCX point back to these headings, instead of the links these headings point to:

Code:
      <navPoint id="navPoint-10" playOrder="10">
        <navLabel>
          <text>Chapter 2</text>
        </navLabel>
        <content src="Text/split_006.html#heading_id_10" />
      </navPoint>
The book has over 100 chapters, and there's no way I'm going to manually edit the NCX to fix the links. This is not the first book in which it happened to me. Why does it do that?

Last edited by Caleb666; 08-17-2011 at 03:52 AM.
Caleb666 is offline   Reply With Quote
Old 08-17-2011, 04:16 AM   #2
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Very simple. the TOC.ncx is built from the header tags used in the XHTML files. If you want to use an inline TOC, essentially a XHTML file containing the TOC, you don't need header tags. Just just references to the tags, for which you easily can use the id's btw.

Don't forget, tags are for structure, not layout. Layout is handled via the stylesheet.
Toxaris is offline   Reply With Quote
Advert
Old 08-17-2011, 04:32 AM   #3
Caleb666
Zealot
Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.Caleb666 ought to be getting tired of karma fortunes by now.
 
Posts: 100
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
Quote:
Originally Posted by Toxaris View Post
If you want to use an inline TOC, essentially a XHTML file containing the TOC, you don't need header tags. Just just references to the tags, for which you easily can use the id's btw.
So how do I make Sigil generate a proper NCX from that inline TOC?

The chapter headings in this book (Dan Brown's The Lost Symbol - Illustrated Edition) are images. The heading for the first chapter looks like this:
Code:
  <h1 class="calibre7 sigilNotInTOC" id="filepos67125"><span class="calibre8 bold"><img alt="" class="calibre5" src="../Images/00030.jpg" /></span></h1>
I think that the reason it has "sigilNotInTOC" is because all those chapters appeared as TOC entries with no text, so I hid them in Sigil.
Caleb666 is offline   Reply With Quote
Old 08-17-2011, 04:34 AM   #4
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
Toxaris is absolutely right. Heading tags are for headings, don't use them for anything else. When you pressed the button saying 'Generate ToC from headings' it did exactly what it says on the button.

If you want a heading to appear in the ToC with text that's different to what's in the enclosed text use <h1 title="...">

Last edited by charleski; 08-17-2011 at 04:56 AM.
charleski is offline   Reply With Quote
Old 08-17-2011, 05:05 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Quote:
Originally Posted by Caleb666 View Post
So how do I make Sigil generate a proper NCX from that inline TOC?

The chapter headings in this book (Dan Brown's The Lost Symbol - Illustrated Edition) are images. The heading for the first chapter looks like this:
Code:
  <h1 class="calibre7 sigilNotInTOC" id="filepos67125"><span class="calibre8 bold"><img alt="" class="calibre5" src="../Images/00030.jpg" /></span></h1>
I think that the reason it has "sigilNotInTOC" is because all those chapters appeared as TOC entries with no text, so I hid them in Sigil.
You cannot let Sigil generate a TOC from the inline TOC. It will use the headers. It is no problem, that the headers don't have text. Like Charleski said, use the title attribute for that.

To use your example, that would be something like:

Code:
  <h1 class="calibre7 sigilNotInTOC" id="filepos67125" title="Chapter 30"><span class="calibre8 bold"><img alt="" class="calibre5" src="../Images/00030.jpg" /></span></h1>
If you now recreate the TOC.ncx, the entry would be 'Chapter 30'.
Toxaris is offline   Reply With Quote
Advert
Old 08-17-2011, 09:36 AM   #6
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Just to add
If the file names of the images just happen to contain consistent,useful information:
Code:
../Images/00030.jpg
(30 is the Chapter number) I have constructed the title="..." using REGEX back references.
( anyone know how to compute a value from a back reference? 000030 is the image for Ch28, so I want to subtract (numerically) for my replace)
theducks is offline   Reply With Quote
Old 08-17-2011, 10:31 AM   #7
cuthbert19
Enthusiast
cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.cuthbert19 once ate a cherry pie in a record 7 seconds.
 
Posts: 48
Karma: 1916
Join Date: Sep 2010
Device: Cybook Opus
Quote:
Originally Posted by theducks View Post
( anyone know how to compute a value from a back reference? 000030 is the image for Ch28, so I want to subtract (numerically) for my replace)
I don't think it's possible using only regular expressions (neither the ones actually managed by Sigil, nor with PCRE). It would be possible once/when Sigil supports internal scripting, I think.

Last edited by cuthbert19; 08-17-2011 at 12:29 PM. Reason: spelling
cuthbert19 is offline   Reply With Quote
Old 08-17-2011, 11:58 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
I thought so, but I might have missed it.
Oh Well!
theducks is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't disable generated ToC ARussell Conversion 7 06-06-2011 07:42 PM
Image header on the actual auto-TOC generated page? Muckraker Calibre 1 06-05-2011 10:57 AM
auto-generated TOC with Sigil 0.4 bobcdy Sigil 2 04-05-2011 12:48 AM
PDF Live TOC generated from MS Word 2007 kimc127 iRex 1 12-20-2007 08:05 AM
BookDesigner problem: TOC links to chapters and back again. Dr. Drib Sony Reader 6 07-08-2007 12:26 PM


All times are GMT -4. The time now is 05:14 AM.


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