Open fiendmaster-cooley opened 3 months ago
Epubchecker (https://github.com/chialab/epubchecker) seems to be the way to go since it uses w3c code beneath the covers. However, it will require generating epubs to the disk to check them before generating the final epub. Might need to look at filesaver with this, too.
The existing epub-checker has some issues an therefore I more or less forked the project. As soon as I get the typescript module imports working properly (some problem in the epub-checker dist), I can commit this bad boy .
Have it working on a private branch so long as it's called from jest or the command line. Unfortunately, there's no easy way to call java in the browser to actually run the w3c epub checker. I'd almost need to write my own or use a server component to interface wtih the file system. spoiler alert--I don't want to do that.
There are a few other libraries out there that claim to do what fs
in node
does, but I haven't attempted to use them yet. In this day and age, it's best to be cautious before using some libraries.
Regardless, I incorporated something into epub-mangler
that works perfectly if we can get it on the server in some way.
More on that later.
Using either the kindle library or one of the existing epub viewing libraries, validate the generated epub to ensure it meets the 2.0 spec.