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

Canonical JSON #614

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open

Canonical JSON #614

wants to merge 6 commits into from

Conversation

gregoriopellegrino
Copy link
Collaborator

Hi,
in this PR you will find the first public version of the script for generating canonical JSON from the guidelines and techniques documents.

Also find the updated canonical JSON.

See you later!

},
"conformance-certifier-report": {
"compact": "For more information refer to the certifier's report",
"descriptive": null
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, instead of Null, we should reproduce the Compact.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can iterate over the json and automatically populate the null values with the compact ones at run time.

Or code the output so that you never attempt to use the descriptive statement in those cases that are null.

Or write some bloated checking to test if you need the descriptive statement and take the compact when it's null.

I can live with null values, in other words, although my preference would be to not have them. If it means we have to duplicate every string in the guidelines so they can be harvested, that might sway me the other way. But could the script that builds the json automatically insert the compact statement instead of null?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mattgarrish there is no need to have all the strings in the guidelines, I can fix the script that generates the JSON to use the same value for compact and descriptive, in case there is no descriptive

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would double up the strings, then, rather than use null.

We're already repeating the strings in the json for the no information available outputs.

"descriptive": null
},
"conformance-epub-accessibility-1-0": {
"compact": "EPUB Accessibility 1.0",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whitespace needed to join these strings together is missing in the new output.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I currently use the normalize-space function because there are multiple spaces inside the extracted strings. I need to reason how to remove the multiple spaces, keeping the leading and trailing spaces.

Copy link
Member

@mattgarrish mattgarrish Jan 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should probably be the responsibility of the editors not to add unnecessary whitespace within the strings.

The problem is the first time someone reformats line length with a dumb formatter and breaks the strings. With oxygen, I can add elements to not format, but I don't know if tidy or other programs like it have that kind of option. Depends on what we're all using, I guess.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can find a solution, even when the software reformats the file.

"compact": "This publication claims to meet",
"descriptive": null
},
"conformance-details": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the section heading so I'd expect it to be like the -title headings and not have compact and descriptive versions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle this we should change the ID to conformance-details-title

@gregoriopellegrino
Copy link
Collaborator Author

I updated the script and the JSON:

  • preserving leading and trailing space in strings
  • copying the compact version when there is no descriptive version

It remains to fix the title for "conformance-details"

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.

4 participants