This PR adds two commits to address two separate epubcheck validation error.
The first relates to the mediatype (and HTML escaping), and the second relates to the table of contents.
With respect to the fix for OPF-043, epubcheck took issue with the text/htmlmedia_type for the spine, but once this was changed, HTML needed to be escaped or HTML in the book text might be rendered.
The second commit dealing with the table of contents simply adds the Internet Archive scanning notice to the table of contents.
ebooklib anticipates there will be a TOC when using epub.EpubNcx() and epub.EpubNav(), which hocr-to-epub does use. If those aren't used, the files would need to be constructed manually, as those files are required.
Validation prior to this PR:
❯ epubcheck ./test_output_no_toc_.epub
Validating using EPUB version 3.3 rules.
ERROR(RSC-005): ./test_output_no_toc_.epub/EPUB/toc.ncx(12,12): Error while parsing file: element "navMap" incomplete; missing required element "navPoint"
ERROR(RSC-005): ./test_output_no_toc_.epub/EPUB/nav.xhtml(10,12): Error while parsing file: element "ol" incomplete; missing required element "li"
Check finished with errors
Messages: 0 fatals / 2 errors / 0 warnings / 0 infos
EPUBCheck completed
This PR adds two commits to address two separate
epubcheck
validation error.The first relates to the mediatype (and HTML escaping), and the second relates to the table of contents.
With respect to the fix for
OPF-043
,epubcheck
took issue with thetext/html
media_type
for the spine, but once this was changed, HTML needed to be escaped or HTML in the book text might be rendered.The second commit dealing with the table of contents simply adds the Internet Archive scanning notice to the table of contents.
ebooklib
anticipates there will be a TOC when usingepub.EpubNcx()
andepub.EpubNav()
, whichhocr-to-epub
does use. If those aren't used, the files would need to be constructed manually, as those files are required.Validation prior to this PR:
The
toc.ncx
file prior to this PR:The
nav.xhtml
file prior to this PR:With the notice as the TOC the validation passes.
The
toc.ncx
file after this PR:The
nav.xhtml
file after this PR: