![]() |
#1 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
|
![]()
I had a problem where I went to custom what the text is, in the Table of Content, and have it link where I wanted it to. I file for a feature request. I would read it, so you can understand the problem I am having.
kovidgoyal closed the ticket and told me how to fix my problem, but it doesn't seem to work,, plus he suggest that I take it to the forums. Code:
<div class="toc1" style="display:none"> Chapter 1</div> So I want Chapter 1 in the TOC, but not to show that text to the linked part of the document. Any help would be appreciated. PS. This is my first post. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,246
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
|
Welcome to the forum.
Does this work for you? Set [Convert] - [Structure Detection] "Detect chapters at" to //h:div[re:test(@class, "toc1", "i")]
Last edited by jackie_w; 07-31-2010 at 04:50 PM. |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
|
Quote:
I want the text in the TOC to be what I want like "chapter 1" and the place it links to, to say what I want, like today's date. I try Sigil editor, but changing the text of the TOC change the text of that is in the document. So if there was a way to tell Calibre, in the HTML file,that this is the text to be place in TOC, and to not put in as text in the document. If I used this code below, suggest by kovidgoyal, Calibre will know that that is why you want you link to in the TOC, and the name of the TOC entry, without adding that text in the document. Code:
<div class="toc1" style="display:none"> Chapter 1</div> Last edited by pjoshua5000; 07-31-2010 at 05:15 PM. |
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Add this to your html
Code:
<div style="display:hidden"> <a href="#first">Chapter 1</a> <a href="#second">Chapter 2</a> </div> <h3 id="first">This is chapter 1</h3> <h3 id="second">This is chapter 2</h3> |
![]() |
![]() |
![]() |
#5 |
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
|
![]()
Thank you kovidgoyal.
I final got it to work. I'm not sure why it did not work before, maybe it had something to do with the chapter threshold, or the fact I kept using toc1 as the name of my class thought out my many tries. Or a wrong xpath. Anyway it work now (at less for now, anyway) here is the code I got it to work with, thanks to kovidgoyal. Hopeful others can use this to solve the same problem. Code:
<div style="display:none"> <p class="toca">Chapter test</p></div> Code:
//h:div/h:p[re:test(@class, "toca", "i")] |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,163
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Congratulations
![]() |
![]() |
![]() |
![]() |
Tags |
hidden text, table of contents, toc |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Folder customization when importing | Heathen | Calibre | 8 | 06-01-2010 02:40 AM |
Customization ? | roger64 | Sigil | 4 | 04-06-2010 12:55 PM |
Customization of display | nirax | Calibre | 2 | 07-26-2009 11:32 AM |
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working | Magitek | LRF | 0 | 05-06-2009 01:25 PM |
can some help with my prs customization problem | ribcookie | Sony Reader | 1 | 01-08-2009 09:05 AM |