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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-31-2010, 05:04 PM   #1
pjoshua5000
Member
pjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watch
 
Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
Question Customization of the TOC

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>
Does any one know how to Write the text you want in the TOC and not have that same text show up when you click the TOC link (that takes you to that part of the document").

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.
pjoshua5000 is offline   Reply With Quote
Old 07-31-2010, 05:46 PM   #2
jackie_w
Wizard
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 2,913
Karma: 4329601
Join Date: Sep 2009
Location: UK
Device: Sony PRS-350, PB360, Kobo Glo/AuraHD/Aura6"/AuraH2O
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 05:50 PM.
jackie_w is offline   Reply With Quote
Old 07-31-2010, 06:10 PM   #3
pjoshua5000
Member
pjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watch
 
Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
Quote:
Originally Posted by jackie_w View Post
Welcome to the forum.

Does this work for you?

Set [Convert] - [Structure Detection] "Detect chapters at" to
//h:div[re:test(@class, "toc1", "i")]
The problem is not building the TOC. I can even get level 1 and level 2 TOC links—that is not a problem.

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 06:15 PM.
pjoshua5000 is offline   Reply With Quote
Old 07-31-2010, 06:15 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
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>
kovidgoyal is offline   Reply With Quote
Old 07-31-2010, 07:43 PM   #5
pjoshua5000
Member
pjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watchpjoshua5000 is clearly one to watch
 
Posts: 12
Karma: 10752
Join Date: Jul 2010
Device: none
Red face Success Success, Sweet Success

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>
and the xpath

Code:
//h:div/h:p[re:test(@class, "toca", "i")]
Isn't learning fun! I like learning new things. And sometimes I will not give up till I solve my problem.
pjoshua5000 is offline   Reply With Quote
Old 07-31-2010, 07:48 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,438
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Congratulations
kovidgoyal is offline   Reply With Quote
Reply

Tags
hidden text, table of contents, toc

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Folder customization when importing Heathen Calibre 8 06-01-2010 03:40 AM
Customization ? roger64 Sigil 4 04-06-2010 01:55 PM
Customization of display nirax Calibre 2 07-26-2009 12:32 PM
Making a TOC for LRFs? Issues with Calibre + LRF TOC editor not working Magitek LRF 0 05-06-2009 02:25 PM
can some help with my prs customization problem ribcookie Sony Reader 1 01-08-2009 10:05 AM


All times are GMT -4. The time now is 10:33 PM.


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