Code Monkey home page Code Monkey logo

Comments (3)

cyrilis avatar cyrilis commented on July 2, 2024

Thanks @pedrosanta ,

Current OPF file template is a little some chaos, will improve it later.

BTW, what do you think of current option structure and Table of content (TOC) template? If a flat array of html is enough for a epub structure? or should I change it to embedded array to support deeper levels?

from epub-gen.

pedrosanta avatar pedrosanta commented on July 2, 2024

Yep, don't really worry about this issue, I just created it to note an improvement that can be made to the EPUB 2 OFP guide part (which is blank I think), but, really as a nice to have, as... guide has been deprecated in EPUB 3 (replaced by landmarks, that fall on the xhtml TOC). So, just leaving the issue as a note, actually.

Regarding the structure of TOC, I think it's OK at the moment. On the Reedsy book exporter we do have a TOC with deeper levels (which I build using a mix of adding a headings property/array to the content and using that on custom templates).

But it's something I'm willing to discuss. An important thing we have to be in mind is... for each OPF content (which best practices say it should be on several HTMLs to improve readers content loading performance, exactly like the lib is doing, so OK on that part) I'm pretty sure the readers will break to a new page. (So using nested content for headings, in my case, wouldn't work.)

But I think this could fall on another issue, focused in this subject if we want to discuss it further. πŸ˜€ So given that's not a big need from my end, and if you don't also have that need, I would only consider if I got a very strong need/ask for a nested structure, IMHO.

PS: A thing that I feel the need atm, actually, is being able to customize the TOC that's generated further, as in, where to place it - in my example I add a cover page, a blank page, a book title page, a publishing info page, and only after these, the TOC. I kinda omitted the TOC on my custom OPF, and generated a new one manually and added it as regular content, but then validation bitches about having an .xhtml file that's not declared on the OPF. But regarding that I'll think about it, submit a PR or open an issue.

Cheers @cyrilis! πŸš€

from epub-gen.

pedrosanta avatar pedrosanta commented on July 2, 2024

Ok, just noticed that I can achieve what I need with some wicked customization of templates.

I'll somehow add a property to options, like tocIndex (glad templates have access to the options local/object), and insert the TOC at a given index on spine/NCX, etc, therefore I can have a cover+blank+title+publishing info page before the TOC.

Might work. Although I'm willing to discuss further improvements to it if anyone is interested. πŸ˜‰

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.