Giter Club home page Giter Club logo

Comments (12)

cyrilis avatar cyrilis commented on August 21, 2024

Hi, @pedrosanta

I pushed a commit for adding xhtml as an option, will this help?

from epub-gen.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

cyrilis avatar cyrilis commented on August 21, 2024

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.

cyrilis avatar cyrilis commented on August 21, 2024

@pedrosanta

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

cyrilis avatar cyrilis commented on August 21, 2024

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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.

cyrilis avatar cyrilis commented on August 21, 2024

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.

pedrosanta avatar pedrosanta commented on August 21, 2024

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)

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.