Comments (12)
Hi, @pedrosanta
I pushed a commit for adding xhtml
as an option, will this help?
from epub-gen.
Hi @cyrilis, I think so, it will.
But I've been checking the standards and, I think the targeted version of EPUB is 2, right?
Here it says that EPUB 2 only supports XHTML and DTBook:
EPUB 3's base content format is now based on the XML serialization of HTML5 (XHTML5), whereas EPUB2 supported two basic content types: a profile of XHTML 1.1 and DTBook (a semantically-enhanced markup focused on accessibility concerns).
So, I don't know if it isn't better, going forward to have an option to specify the EPUB version as well (and perhaps only allow html on EPUB 3, or so). But for now I would say to keep it flexible with the docType
option.
from epub-gen.
Hi @cyrilis,
I already tested out the latest master and it seems to work well when I use the docType: 'xhtml'
.
One thing, could you publish the latest master as 0.0.12?
Cheers.
from epub-gen.
Hi @pedrosanta ,
You are right, we should specify the version
as option instead of doctype, maybe I can fix it in another version, I've published current master as 0.0.12 to npm for temporary use.
I'll try to add version
option in the following commits, but I'm a little busy now, maybe in next week. Thanks.
from epub-gen.
I mean, I'm working on it , but it need some test, so I need some time to finish. Hope you understand. 😄
from epub-gen.
Hi @cyrilis, thank you for getting back. Yap, sure, understandandably. 😃 Like I said, the commit giving the option to specify the docType
works for me. Looking forward to it, cheers.
from epub-gen.
Hi @cyrilis, managed to progress on the version
option? It seems to me that, one good thing to move forward was to improve and better assure the validation of generated EPUBs. But, we'll get there, I'll also try to help. 😉
from epub-gen.
Hi @pedrosanta ,
I'm really sorry for such a long delay. I've pushed to master branch with a version specify option update. however it's not published to npm yet, It works well with version 3, but maybe need more test on version 2, hope this helps.
from epub-gen.
Pretty rad @cyrilis! 😀 Looking to the commit.
I've noticed that you added a basic tags, attributes and xhtml validation. Don't you think that is a bit out-of-scope of the library, as in, since it's content provided to the lib by the user, it is the user that has to make sure the content is valid. What do you think?
Cheers.
from epub-gen.
Ok, been looking to the version and related updates and also looking closely to the specs, and 🎉 , looks like EPUB 3 also needs a application/xhtml+xml
as a content media type and all. But I noticed that the code is all updated to be like so.
I'm reviewing a few stuff on the version option and I'll prepare a PR soon to discuss. 😀
Meanwhile, I'm closing this, as I feel that the initial need is already addressed with the latest updates of the library. 👍
from epub-gen.
Hi @pedrosanta ,
Thanks for your feedback, 😄 and sorry for my delay reply.
And It's a long time since I added the last commit, I've almost forget the reason I removed node-xhtml-purifier
lib. maybe because it removed too much tags? I'll look into it later.
About if validating xhtml in a epub generator library is out-of-scope, to be honest, I just wanted to make it a little handy for some one who are not quite familiar with xhtml (like me). so the user can throw html string into this lib and don't need to care too much. This maybe useful for them to generate epub 2.0 file even with modern html. Does this function too nasty or break something? please let me know.
Thanks again for your patient 😄
from epub-gen.
Hi @cyrilis,
No biggie on the delay.
Yep, I figured that you removed it perhaps because node-xhtml-purifier
it was too 'restrictive' on the tag 'clean up'. Well the XHTML 1.1 validation mechanism you've coded had a tiny 'tricky' bug in there, but I've fixed it in an upcoming PR. 😀 I did a couple of tests to it, generated a few EPUBS and while not being overly complete (on the validation) it might help to warn of a few XHTML 1.1 'invalid' tags. (Yep, I've been kinda studying EPUB 2 and 3 spec hard and 2 must use a 'variant' of XHTML 1.1 and 3 uses a variant of XHTML5/HTML5.) I'll put forward a few updates and improvements on that PR too. 😉
Cheers!
from epub-gen.
Related Issues (20)
- Alternative: cpiber/epub-gen-memory for both node and browser
- Error with image URL HOT 3
- Custom fonts not getting applied in Epub Reader/Kindle Previewer
- The process randomly stop when downloading lots of images HOT 2
- Epub to html HOT 1
- Handle images which starts with relative path HOT 2
- Missing Hard timeout & Retry mechanism when downloading images. HOT 2
- insert video or audio into epub HOT 2
- Error: ENOTDIR, not a directory HOT 2
- fixed layout or reflowable layout
- Images and fonts do not appear on Apple Books HOT 3
- Custom ids gets converted to something another
- verbose: false outputs some logs
- verbose: false not working
- Showing different pub on different reader.
- Add tempDir option to documentation HOT 1
- a couple of bugs when using epub-gen HOT 1
- Object prototype may only be an Object or null: undefined
- [Question] Remove Table of Contents
- Please mark epub-gen as deprecated if it's no longer maintained. HOT 1
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-gen.