bug-texinfo
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EPUB 3.3 spec conformity issues


From: Daniel Cerqueira
Subject: EPUB 3.3 spec conformity issues
Date: Tue, 20 Aug 2024 09:23:57 +0100
User-agent: Gnus/5.13 (Gnus v5.13)

I am using `texi2any --epub3 file.texi` to produce an EPUB file from a
Texi file.

My Texi file has:
 - an interior cover image
 - a title page
 - menus, chapters, sections
 - a index

It is a Texi file very similar to Bash's texi file.

The EPUB file is produced without any errors, and when I check to see if
the file is valid (using the `epubcheck` program) I get this 2 errors:

```
$ epubcheck ./my-file.epub 
Validating using EPUB version 3.3 rules.

ERROR(RSC-005): ./my-file.epub/EPUB/my-file.opf(3,58): Error while
parsing file: package dcterms:modified meta element must occur exactly
once
ERROR(RSC-005): ./my-file.epub/EPUB/xhtml/Index.xhtml(90,49): Error
while parsing file: value of attribute "border" is invalid; must be
equal to "" or "1"

Check finished with errors
Messages: 0 fatals / 2 errors / 0 warnings / 0 infos

EPUBCheck completed
```

So, I have done some digging.


:: Zero-th error message

The dcterms:modified meta element is MANDATORY in order to create a
valid EPUB 3.3 file. It is missing in the current Texinfo EPUB file
creation. Here is an code example on how to implement this inside the
EPUB file:

File: EPUB/my-file.opf
```
...
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/";>
   <dc:identifier id="texi-uid">texinfo:my-file</dc:identifier>
   <dc:title>Some title</dc:title>
   <dc:language>pt</dc:language>
   <dc:creator>Daniel Cerqueira S.</dc:creator>
   <meta property="dcterms:modified">2024-08-20T00:00:00Z</meta>
</metadata>
...
```

According to: https://www.w3.org/TR/epub-33/#sec-metadata-last-modified


:: One-th (first) error message

The XHTML's table element, having the border property, is produced in the
Texinfo EPUB file creation. But it creates this border property with the
value of "0". According to `epubcheck` it should have the value of "" or
the value of "1".

I have manually changed my EPUB file to have `border=""` and I have
noticed that now, my EPUB reader displays the index table, of my EPUB
file, properly formatted. Whereas previously, it have a misalignment
(which I thought it was normal). My EPUB reader is the KOReader android
app.

So, here is a code example of how to implement this inside the EPUB
file:

File: EPUB/xhtml/Index.xhtml
```
...
<table class="cp-entries-printindex" border="">
...
```

I have not found the spec reference of the XHTML border property (of the
table element) online. So I am presuming that what `epubcheck` is
saying, it the correct valid way.


Final thoughts:

I consider this to be a bug, because the EPUB file created by `texi2any`
is not according to the specs.

If this 2 error messages get addressed, and corrected, it can be said
that `texi2any --epub3` creates a valid EPUB 3.3 file (EPUB 3.3 is the
most updated version of the EPUB spec, as of today).

A suggestion when programming this, is to always use the `epubcheck`
program to validate the creation of EPUB (by texi2any), from now
onwards.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]