Code Monkey home page Code Monkey logo

Comments (1)

Firsh avatar Firsh commented on June 27, 2024

You can fix the cover: #64 (comment)

I believe the TOC being in the TOC is not so bad, in some retail epubs I see the same.* However there is a distinction between the actual TOC that is on a page, and the virtual one that the readers open for you and render with their own design. In the latter I think it's helpful to include the TOC link and some retail ones do that. In the other one, not so much and I never seen that in production.

How do retail epubs put the contents link in the calibre reader sidebar or the device-rendered toc, but not redundantly into the content page? I've seen that the toc page that the device uses is not registered to be in the spine. In calibre's editor, file browser panel, the tox.xhtml (EPUB 3) is not among the Text, is under Misc. There is a different one, a copy, without the contents link that is simply regular content which appears to be a list of links, and is styled a bit differently and more manually, as anything goes there. Epub-gen has 1 toc for all purposes, you can reach it by paging in the book and it's also used as the device-rendered one.

I'll take a look at what template can be modified to leave it out from there. Removing the table of contents entry from the table of contents:

        <li class="table-of-content">
            <a href="toc.xhtml">- <%= tocTitle %> -</a>
        </li>

This needs to go from your local copy of toc.xhtml.ejs that you source using the top-level option:

        customHtmlTocTemplatePath: path.join(__dirname, 'templates', 'toc.xhtml.ejs'),

If you want to retain it but remove those pesky dashes from its side, this is also the way.

In the end, I prefer to have no TOC link in the TOC, since readers have their own UI way of opening it. Having it in the content bears no real benefit (I'd even go as far as omitting it entirely or placing it at the end) besides going through the names of chapters before/after reading a book. But realistically, say, if you are on page 398 of a book and you want to look at the contents, the first thing you do is to bring up the device/readerapp's rendering of the TOC and not navigate to page 2...

from epub-gen.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.