08-17-2011, 03:50 AM | #1 |
Zealot
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> 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> Code:
<navPoint id="navPoint-10" playOrder="10"> <navLabel> <text>Chapter 2</text> </navLabel> <content src="Text/split_006.html#heading_id_10" /> </navPoint> Last edited by Caleb666; 08-17-2011 at 03:52 AM. |
08-17-2011, 04:16 AM | #2 |
Wizard
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. |
08-17-2011, 04:32 AM | #3 | |
Zealot
Posts: 100
Karma: 400000
Join Date: Jul 2010
Device: iPad 2 64GB
|
Quote:
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> |
|
08-17-2011, 04:34 AM | #4 |
Wizard
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. |
08-17-2011, 05:05 AM | #5 | |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
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> |
|
08-17-2011, 09:36 AM | #6 |
Well trained by Cats
Posts: 30,373
Karma: 58053698
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 ( 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) |
08-17-2011, 10:31 AM | #7 |
Enthusiast
Posts: 48
Karma: 1916
Join Date: Sep 2010
Device: Cybook Opus
|
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 |
08-17-2011, 11:58 AM | #8 |
Well trained by Cats
Posts: 30,373
Karma: 58053698
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! |
|
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 |