Skip to content

Conversation

@rdeltour
Copy link
Member

This PR tries to clarify how we check resources listed in the manifest.

Basically:

  • resources in the container but not listed in the manifest are now only reported as a usage (OPF-003), instead of a warning
  • resources in the manifest but for which no reference were found are reported as a usage (new OPF-097)

feat: report as a usage when no reference were found to manifest items

This commit introduces a new usage message (OPF-097) reported when the
manifest includes a resource for which no reference was found in content.

This is legit for instance for exempt resources (like data files included
in the container). But it is likely an author error otherwise, so reporting
a usage message can help to detect that.

We do not report an error since:

  • references can be added via scripting, so the check can only be
    informative for scripted content
  • EPUBCheck historically required all container resources to be listed
    in the manifest (not doing so was reported as a warning, OPF-003),
    which is conflicting with a requirement to not list unsused
    resources

Close #1452

feat: report as usage container resources not listed in manifest

EPUBCheck used to report any resource found in the the container but not
listed in the manifest as a warning (since #58 was fixed, in v1.1). But
the EPUB specification does not require that.

This commit downgrades the severity of OPF-003 to a usage report.

See also #1452
See also w3c/epub-specs#563

EPUBCheck used to report any resource found in the the container but not
listed in the manifest as a warning (since #58 was fixed, in v1.1). But
the EPUB specification does not require that.

This commit downgrades the severity of `OPF-003` to a usage report.

See also #1452
See also w3c/epub-specs#563
@rdeltour rdeltour added this to the v5.0.0-rc milestone Dec 22, 2022
@rdeltour rdeltour requested a review from mattgarrish December 22, 2022 16:03
@rdeltour rdeltour self-assigned this Dec 22, 2022
@rdeltour
Copy link
Member Author

@mattgarrish hang on before reviewing this, the logic is broken.

@rdeltour rdeltour marked this pull request as draft December 22, 2022 16:19
@rdeltour rdeltour removed the request for review from mattgarrish December 22, 2022 16:19
This PR introduces a new usage message (`OPF-097`) reported when the
manifest includes a resource for which no reference was found in content.

This is legit for instance for exempt resources (like data files included
in the container). But it is likely an author error otherwise, so reporting
a usage message can help to detect that.

We do not report an error since:
- references can be added via scripting, so the check can only be
  informative for scripted content
- EPUBCheck historically required all container resources to be listed
  in the manifest (not doing so was reported as a warning, `OPF-003`),
  which is conflicting with a requirement to **not** list unsused
  resources

Close #1452
@rdeltour rdeltour force-pushed the feat/manifest-resources branch from be7b1e3 to 09244a4 Compare December 23, 2022 17:19
@rdeltour rdeltour marked this pull request as ready for review December 23, 2022 17:22
@rdeltour rdeltour requested a review from mattgarrish December 23, 2022 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

check that the manifest only lists publication resources

3 participants