Quote:
Originally Posted by chaot
Proper nomination of a matter seems to me particularly important here. So, the built in tool to generate a table of contents is the ToC, and there is a entry list in the File Browser, and there is a directory in the File Preview.
That would be my suggestion!
In these books the ToC is of less help, because of the sheer amount of headlines. The ToC, shown in my Tolino ereader includes about 80 pages, 8 entries per page. For navigation in the book (in the ereader) I need other instruments. I got an idea. You too?
I practiced to generate anchor (ID's), a little detour, but works fine. Per file method with filename, do you mean so:
Code:
Instead of
<a href="xyz.html#uCZEvuprkBTfz9FrYC7Blz5">Title</a>
to use
<a href="xyz.html#Title">Title</a>
|
As I said, use the tools. And actually pay attention to what they do.
The ToC generator can go through the book and find all heading tags and create the NCX for you. If the heading is at the top of the file, it will not add an id as this is not needed. If the heading is not at the top of the file, or there are multiple headings in the file, a valid id is generated and put into the heading tag. And put into the NCX version of the ToC. If you don't want to use heading tags, you can use others so long as you can identify them somehow.
You can then use another tool to generate an in-line ToC from the NCX version. From memory, you can use a template to style this how you want. Or you can edit it afterward. And as long as you keep the NCX ToC up to date, you can regenerate whenever you need to.
As you seem to want back links from the headings to the ToC, then simply add the references to the headings that are entries in the ToC. To do this, regex is your friend. And to be explicit about this, for the heading:
Code:
<h2 id="uCZEvuprkBTfz9FrYC7Blz5">Chapter Heading</h2>
The search is:
Code:
(<h2.*?>)(.*)(</h2>)
The replace is:
Code:
\1<a href="toc.html">\2</a>\3
The result is:
Code:
<h2 id="uCZEvuprkBTfz9FrYC7Blz5"><a href="toc.html">Chapter Heading</a>\</h2>
That will turn a h2 tag into a link that will take the reader back to the in-line ToC.
Changing the search and replace to put a image as part of the link is simple. As is covering other heading levels. If you have decided to use other tags for the headings, then you need to adapt to the tag and probably the class.
And the question about "Per file method" simply means the link points to the file name without an anchor. If a heading at the top of the file has an id, linking to the heading or just to the file is effectively the same. The only reason to use the anchor for the heading is if you think you might be rearranging things.