Open BlackRobotMX opened 3 years ago
You can try epub.write_epub('test.epub', book, {"epub3_pages": False, "epub3_landmark": False, "epub2_guide": True})
.
I am just looking at the code which was doing that (and million other things) and I think that might be it.
I did try writing the epub with those options, bit still when I validate the epub i get that the version is 3.0.1.
I checked the source code of epubcheck to see how it gets version of the EPUB because I forgot. So yes, this is hard coded into the code. Line 1086 in epub.py. But you also need to use those options.
package_attributes = {'xmlns': NAMESPACES['OPF'],
'unique-identifier': self.book.IDENTIFIER_ID,
'version': '3.0'}
When file is created epubcheck will complain because of the different format for the metadata in the content.opf file. Plus will complain about html formatting, because template for creating pages is created for 3.0. Will take a look at it.
Yes, I tried changing the version depending on the epub2_guide value, but as you say i get a lot of errors while validating the EPUB.
I can create EPUB3 files from HTML, is there a way for the output to be EPUB2?