Thread: epub editing
View Single Post
Old 01-08-2022, 06:26 PM   #9
lomkiri
Groupie
lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.lomkiri ought to be getting tired of karma fortunes by now.
 
lomkiri's Avatar
 
Posts: 167
Karma: 1497966
Join Date: Jul 2021
Device: N/A
Quote:
Originally Posted by lonly View Post
can you please tell me exact css file setting and other setting for table of content clickable which will jump to that chapter
Are you sure you want to do that ? All e-readers and all softwares can use the integrated ToC, much more practical than a physical ToC. You can normally access it from anywhere in the ebook, by a menu or an icon, at the opposite to a physical ToC that implies that you go back (or forth) to the page containing the Toc. Personally, I do the contrary of what you want, I always delete the physical ToC when it exists, I think it's an annoyance.

If your logical ToC doesn't exist, or doesn't satisfy you, calibre has a button on the toolbar (Edit ToC) to build it from scratch, or to modify an existent one. I advise you to use this feature rather than construct a home-ToC.

Anyway, if you really want to make a home ToC, if your epub is an epub3, you already have a file that may be used for this matter, it's the navigation file (nav.xhtml if it was built with calibre, it is flagged, in the file browser, with a little ToC icon). It contains (if your ToC is up to date) the links to all your chapters. If your epub is an epub2, calibre can upgrade it to epub3 with the menu "tools / upgrade epub internal".

It is normally not displayed in the book itself, but you have the possibility to make it visible modifying your opf file (e.g. contents.opf):
add in the <spine> part the line
<itemref idref="nav"/>
(if "nav" is the id of your nav-file, look for the id in the <manifest> part which file has the property "nav")

Save the epub. You can then arrange your file, put a title to it, a stylesheet, etc., as long you leave the list that is in the <nav epub:type="toc"> part.

If you still want to make something personal, take as a model the links that are in this file, this answers exactly to your question.
lomkiri is offline   Reply With Quote