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
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions spec.bs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ It can be constructed using a string for each component, or from a shorthand str
* `http://example.com/products/`
* `https://example.com:8443/blog/our-greatest-product-ever`
</ul>

This is a fairly simple pattern which requires most components to either match an exact string, or allows any string ("`*`"). The [=URL pattern/pathname component=] matches any path with at least two `/`-separated path components, the first of which is captured as "`category`".
</div>

<div class="example" id="example-intro-2">
Expand Down Expand Up @@ -123,6 +125,10 @@ It can be constructed using a string for each component, or from a shorthand str
* `https://nx.shop.example/products/01?speed=5#reviews`
* `https://shop.example/products/chair#reviews`
</ul>

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.

</div>

<div class="example" id="example-intro-3">
Expand Down Expand Up @@ -167,6 +173,8 @@ It can be constructed using a string for each component, or from a shorthand str
* `https://discussion.example/forum/admin/`
* `http://discussion.example:8080/admin/update?id=1`
</ul>

This pattern demonstrates how pathnames are resolved relative to a base URL, in a similar way to relative URLs.
</div>

<h3 id=urlpattern-class>The {{URLPattern}} class</h3>
Expand Down
Loading