-
Notifications
You must be signed in to change notification settings - Fork 8
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
(closes #131) Embed YAML-LD into HTML <script>
tag
#132
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.
Note the comment about the need to unindent a stream. Probably not necessary for documents in general.
…pped when dedenting
@gkellogg I do recall that we probably can't merge PRs to the spec right now. Should we keep these PRs open? Or maybe we should discuss this on the upcoming CG meeting? |
Yes, I think we need to keep this open. Let's discuss how we move forward on the next call, but I think it requires a WG action and probably needs to await the outcome of an updated WG charter. |
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.
Merging this should trigger a run of PR-Preview, which should now succeed
The JSON-LD WG discussed this today and suggested that work on the YAML-LD editor's draft can proceed. |
Can you make this more forceful to say something like "leave spaces and newlines alone" or "don't mangle spaces and newlines".
Afaik, no such dedenting is needed. I loaded your example to YAML Playground and played with the global indentation. Look at the parse events in the "New Reference Parser (JS)" pane: they remain the same. |
Yes! See my comment above. More explicitly:
This version of @anatoly-scherbakov's example returns the same parse events as the original version: "@context": https://json-ld.org/contexts/person.jsonld
"@id": http://dbpedia.org/resource/John_Lennon
name: John Lennon
born: 1940-10-09
spouse: http://dbpedia.org/resource/Cynthia_Lennon
---
"@context": https://json-ld.org/contexts/person.jsonld
"@id": http://dbpedia.org/resource/Cynthia_Lennon
born: 1939-09-10 So @anatoly-scherbakov I don't think we should require HTML parsers to dedent scripts.
|
@anatoly-scherbakov I have a silly concern, but let's honor the life of a great man: So can you change the spouse to: |
Syntactically-important, human-invisible whitespace is evil. I cannot tell you how long it has sometimes taken to clean up Oracle configuration files, when one person indented some lines with spaces, and another person indented with tabs. I am glad that later comments suggest that whitespace is less important ("don't think we should require HTML parsers to dedent scripts"), but "[requiring] them to leave newlines and spaces alone" seem to say that some whitespace is important? This is confusing. But maybe it's just this conversation that's confusing, and the docs will be clear, in the end? |
Yes, I have revised my own https://github.com/iolanta-tech/python-yaml-ld implementation and it works without dedenting anything. I do not, by this moment, remember why I wanted to dedent 🤔 Creating new issues for these. Thank you for pointing them out! |
We should be able to embed YAML-LD scripts into HTML documents, as described in #131.
Preview | Diff