-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clarify base iri of package document #1468
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be worth adding a note to the change section of the RS spec. It may be an important clarification relative to the previous version.
In the EPUB3.3 Core spec, in the In this Core spec, the "IRI of the Package Document" is not defined: this was the original issue #1374. Tips must be given to EPUB authors on how to solve this issue, therefore something must be done first in the EPUB 3.3 Core document. More: a) In Zip packages, such "relative" strings must in fact be seen as relative paths. As it happens, both relative IRIs and relative Unix paths have the same syntax; but they're not the same thing. It is weird but still real: internal resource are referenced via relative paths, external resources are referenced via absolute URLs, and both can be values of the same href attribute. The Zip AppNote uses the term path, never URL/URI/IRI. Section 4.4.17.1 of the Zip AppNote gives clear indications about the syntax, but does not define "relative path"; I suppose it was clear for the authors that this path was relative to the "root directory" (which is not a notion defined in the Zip AppNote). b) I don't think RS developers need to resolve (if resolving means converting to absolute IRIs) relative IRIs/paths in Zip packages. They simply need to find and fetch these files using their relative path, which is a standard Zip API feature. In consequence, I'd be in favor of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see my previous comment.
I changed that if you look at the preview/diff links at the bottom of the first comment (pr-preview always creates those automatically):
The last few words link across the the RS section so authors interested in how resolution works can read more without overly complicating that section.
But isn't this why we have the abstract container defined separately from the zip container? It allows us to talk about the paths consistently as IRIs so we don't get into these kinds of technicalities. This sounds like it leads us to redefining all the standards we rely on to also be paths instead of IRIs simply because an EPUB may be zipped when consumed I'd argue we're getting into too much detail with the package document base by delving into zip paths, but can live with it for thoroughness. |
Yes, I've fixed this in the latest commit as it's not a requirement in all cases. The intention is only that if you require an absolute you must use the base iri. |
…ub-specs into fix/issue-1456-packagedoc # Conflicts: # epub33/rs/index.html
How would you use an absolute IRI in the |
Which case are you referring to? Absolute IRIs in general would be critical for any external resources. Resolved from a relative one might be useful if you're serving it off the web, I suppose.
We've avoided trying to list out allowed and disallowed protocols leaving it to whatever makes sense to use. The only requirement for relative IRIs is that they must resolve within the container. But I believe it's valid to use file: URLs if you want to write out a full path. |
an |
Still not sure I understand. The spine itself only has What would be unique about an |
The issue was discussed in a meeting on 2021-04-01 List of resolutions:
View the transcript2. Clarify base IRISee github pull request #1468. Dave Cramer: this is a PR about base IRI in package documents See github issue #1374, #1456. Matt Garrish: basically all the PR does is define base IRI for package because it wasn't clear how that was to be calculated Dave Cramer: i'm happy with PR Matt Garrish: the PR seemed to make Ivan happy Dave Cramer: i think we should accept the PR, and then if Laurent wants to raise the other question, maybe he can come back with a more detailed rationale Matt Garrish: there was an issue about whether relative IRIs MUST be resolved, but it was only ever the intention that it be possible if you need to do it
|
Maybe not a complete fix for #1374 (and not for #1456), but I've taken the prose about resolving relative IRIs from the item element definition and created a section in the RS spec on resolving relative IRIs to cover this (resolving to absolute IRIs isn't an authoring concern).
See if there's enough of an explanation of the base IRI when the package document is zipped. I don't think we want to go too deep into resolving files within a zip container, as I can't find there's a single way of doing this. It looks like a "!" (jar scheme), "#", or OS-specific path separator followed by the relative path of the file in the container are viable.
Reading Systems: preview diff
Preview | Diff