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

Nomenclature #5

Open
MattWilcox opened this issue Dec 6, 2018 · 3 comments
Open

Nomenclature #5

MattWilcox opened this issue Dec 6, 2018 · 3 comments

Comments

@MattWilcox
Copy link

"Style": "h1"

Should not be "style", a heading is not a style, it's a semantic label for type of content in the text node. This property seems to have a confusing name. Style decoration (this should look like whatever a h3 might) should not be tied to the semantic label of the text node, and the existence of "style" here seems confusing.

Additionally, I would question the use of baked in HTML heading levels in an abstracted text format such as this. Heading levels are a design mistake of HTML, and should properly be inferred from the context of the document and nesting of section elements. Within an abstracted block of text, a "level" is not relevant, merely the fact that it is a heading for the following text nodes. A "level" becomes relevant only in a larger context, and baking that into the fragment harms portability.

@kmelve
Copy link
Member

kmelve commented Dec 6, 2018

Yes, that’s a good point about the “h1”. We’ll change the example and clearify. Will leave this open until then 👍.

@MattWilcox
Copy link
Author

Ok, I may be confused as I'm not currently seeing any method to mark the semantics for a text node, where I am seeing a "style" property for which the purpose is to indicate a "visual style"?

I may be confused, but I thought the purpose of the project was to encode rich text - which to my thinking would not have anything at all to do with visual representation of that text - that should be a matter for the render engine?

I'd have thought the goal would be to mark "this chunk is a paragraph" and "this chunk is a heading" or "this chunk is emphasised"; all of which mean things and those meanings may be expressed visually, or through a screen reader, or via a UI of some sort (like heading navigation) ... but those are not the same as "style".

@SteveALee
Copy link

SteveALee commented Oct 30, 2020

I initially thought the the same but now think it's actually both a style hook and semantic. The example uses as purely styling but HTML uses it semantically too.

As Mat says Portable Text has no semantics for heading level but I guess rendering to HTML it gets introduced (I've not tested this), based purely on the style name. This might need to be made explicit. If users have semantics like heading level then the format needs a way to capture and express that.

Semantics like heading level ARE important for non visual renders like screen readers accessing HTML for accessibility or speech agents.

I think some accessibility features need to be encoded in the Portable Text (eg Alt for images) and others appear during rendering, perhaps through heuristics based on the portable text content.

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

No branches or pull requests

3 participants