Coder Social home page Coder Social logo

Comments (3)

danigm avatar danigm commented on September 1, 2024 1

Would you accept a PR exploring that direction?

Yes, sure. Any improvement is welcome. If the API doesn't change and we just add new methods it's better, but don't hesitate to rework some of the public functions if it's needed, we can do a mayor release.

from epub-rs.

danigm avatar danigm commented on September 1, 2024

A naive solution I can think of would be to try to retrieve the cover metadata, and if it fails to look up in the manifest for the item containing the cover-image property, and return its id.

Yes, that could improve the behavior, add some kind of fallback to try to find the cover could be a good idea.

from epub-rs.

thibaultamartin avatar thibaultamartin commented on September 1, 2024

A deeper issue seems to be that some information in the metadata and manifest is lost when the fill_document function is called.

I was thinking about creating the following struct:

struct Node {
    id: Option<String>,
    href: Option<String>
    refines: Option<String>,
    property: Option<String>,
    content: Option<String>,
}

And then adding two Vec<Node> in EpubDoc: one to store metadata, and the other to store the manifest.
This would allow to build higher level helper function to retrieve data.

Note that this is not a silver bullet: in example 49 of the EPUB spec we still wouldn't be able to retrieve the scheme attribute of the property identifier-type.

Would you accept a PR exploring that direction?

from epub-rs.

Related Issues (18)

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.