Skip to content
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

Declarative alternative to the file path definition #1919

Closed
iherman opened this issue Nov 19, 2021 · 7 comments · Fixed by #1927
Closed

Declarative alternative to the file path definition #1919

iherman opened this issue Nov 19, 2021 · 7 comments · Fixed by #1927
Labels
EPUB33 Issues addressed in the EPUB 3.3 revision Spec-EPUB3 The issue affects the core EPUB 3.3 Recommendation Topic-ContentDocs The issue affects EPUB content documents Type-Editorial The issue does not affect conformance

Comments

@iherman
Copy link
Member

iherman commented Nov 19, 2021

Currently, the File Path term is defined in a separate section in an algorithmic fashion, which makes this a bit different from the rest of the document that favours declarative definitions. The question is whether there is a good alternative for the definition that would replace the algorithmic section.

@mattgarrish @rdeltour

@iherman iherman added Topic-ContentDocs The issue affects EPUB content documents Type-Editorial The issue does not affect conformance labels Nov 19, 2021
@mattgarrish
Copy link
Member

I assume you mean this section: https://www.w3.org/TR/epub-33/#sec-file-names-to-path-names ?

I agree it feels out of place, but I'm not sure it's critical to rewrite. I'd opt for clarity over form, but if you can write an equivalent declaratively that's easier to read I wouldn't object.

I find the introductory sentence kind of confusing in the way it uses "file" twice, though (three times if you count "File Path"):

To derive the File Path of a file or directory file in the OCF Abstract Container apply the following steps

I had to read a few times to parse out the meaning. Is it necessary to drop the variable in before the algorithm, or could this be more like:

To derive a File Path in the OCF Abstract Container, apply the following steps:

  1. Let file be the directory or file to parse

@iherman
Copy link
Member Author

iherman commented Nov 21, 2021

The original issue may become moot soon. Indeed, the WG has agreed with the fundamental question in #1912, and the proposed changes follow the same "algorithmic" approach. I would think we should close this issue (modulo the editorial remarks of @mattgarrish).

@iherman
Copy link
Member Author

iherman commented Nov 21, 2021

I find the introductory sentence kind of confusing in the way it uses "file" twice […]

Agreed. Actually, the change is even simpler; there is no need for the variable file at all: its only role is to give an initial value for current before the cycle. The simplest is to assign current with "the director or file to parse", and eliminate the file attribute from the section altogether.

@mattgarrish
Copy link
Member

Just noting that the obfuscation algorithm has pseudo-code that is similar to this, too. It's formatted as an example right now (which is wrong).

@iherman
Copy link
Member Author

iherman commented Nov 22, 2021

Just noting that the obfuscation algorithm has pseudo-code that is similar to this, too. It's formatted as an example right now (which is wrong).

O.k., that then makes the original issue moot. Should I add this as an automatically-closeable issue with #1927?

@rdeltour
Copy link
Member

rdeltour commented Nov 22, 2021

Is it necessary to drop the variable in before the algorithm

Introducing the algorithm parameters in the declaration is recommended by Infra. I'd stick to this form if possible?

@mattgarrish
Copy link
Member

Introducing the algorithm parameters in the declaration is recommended by Infra.

Sure, but what confused me is that it's hard to figure out that's what's going on. There isn't an obvious name for the algorithm and there isn't a "given" to introduce the variable, just a lot of "file"s to read through.

It would still be clearer if it were formatted like:

To derive a File Path given a file or directory file in the OCF Abstract Container, apply the following steps ...

@iherman iherman linked a pull request Nov 23, 2021 that will close this issue
@mattgarrish mattgarrish added the EPUB33 Issues addressed in the EPUB 3.3 revision label Dec 17, 2021
@mattgarrish mattgarrish added the Spec-EPUB3 The issue affects the core EPUB 3.3 Recommendation label Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EPUB33 Issues addressed in the EPUB 3.3 revision Spec-EPUB3 The issue affects the core EPUB 3.3 Recommendation Topic-ContentDocs The issue affects EPUB content documents Type-Editorial The issue does not affect conformance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants