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

Editorial: Add brief explanations to examples #232

Merged
merged 2 commits into from
Aug 29, 2024

Conversation

jeremyroman
Copy link
Collaborator

@jeremyroman jeremyroman commented Aug 28, 2024

These examples form the only quick reference material in the spec. While MDN goes into more depth, brief explanations of what is happening in this syntax don't take up much room and may make it easier to tell what's going on, especially with regexp parts.

Resolves #229.


Preview | Diff

@jeremyroman
Copy link
Collaborator Author

@sisidovski @tunetheweb wdyt?

Copy link
Collaborator

@sisidovski sisidovski left a comment

Choose a reason for hiding this comment

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

Not sure this resolves #229, but the PR itself LGTM.

spec.bs Outdated

This is a more complicated pattern which includes:
* [=part/modifier/optional=] parts marked with `?` (braces are needed to make it unambiguous exactly what is optional), and
* a [=part/type/regexp=] part named "`id`" which uses a regular expression to define what sorts of substrings match (the parentheses are required to mark it as a regular expression, and are not part of the regexp itself)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may want a dot . at the end of the paragraph?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's a pretty fine point of style (punctuating bulleted lists is complicated), but on average the search results I found agree that there should be a period here, so done.

@sisidovski
Copy link
Collaborator

IMO adding an explicit explanation paragraph how to create a custom regexp group in 2. Pattern strings makes sense. WDYT?

@jeremyroman
Copy link
Collaborator Author

IMO adding an explicit explanation paragraph how to create a custom regexp group in 2. Pattern strings makes sense. WDYT?

Added the text "enclosed in parentheses" to that section.

@jeremyroman jeremyroman merged commit 20e4de9 into whatwg:main Aug 29, 2024
2 checks passed
@jeremyroman jeremyroman deleted the explain-examples branch August 29, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Make it clearer that parentheses are needed to use regex's
2 participants