Comments (3)
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.
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 thecover-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.
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)
- Reading string values keeps firing error HOT 1
- Writing/modifying of epubs HOT 2
- bug: doesn't read all tags HOT 2
- Relicensing to more permissive license? HOT 1
- File not Found by EpubDoc on Windows HOT 1
- Reading metadata attributes HOT 2
- bug: Assumes that meta tag always has name and content attributes HOT 2
- Update on crates.io HOT 1
- Find the collection and and group position of an epub HOT 3
- Consider replacing PathBuf with Utf8PathBuf
- Not all epubs use cover-image
- bug: epubs with a Byte Order Mark (BOM) are not parsed HOT 6
- EPubDoc::get_release_identifier documentation link leads to 404
- The fallback attribute of the item in the manifest
- Note linearity of spine items HOT 1
- Add toc navigation
- bug: epubs with percent encoded files in the manifest are not parsed correctly HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from epub-rs.