Skip to content

Commit d75620d

Browse files
committed
set up more remark linters
1 parent 8d800c0 commit d75620d

17 files changed

+1813
-194
lines changed

.remarkignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CODE_OF_CONDUCT.md

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ $ npm install
2323
$ npm start
2424
```
2525

26-
Once this is done you can visit http://localhost:8080/ to see the local copy of the website. As you edit files the
26+
Once this is done you can visit <http://localhost:8080/> to see the local copy of the website. As you edit files the
2727
website will automatically rebuild, and you can see the changes reflected in your browser.
2828

2929
### Running checks/tests

blog/2023-01-09-introducing-webcomponents-guide.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -102,5 +102,4 @@ the [Learn][learn] section then your input would be invaluable to countless deve
102102
[learn]: /learn/
103103
[tutorials]: /tutorials/
104104
[blog]: /blog/
105-
106-
[issue]: {{ repository }}/issues/new
105+
[issue]: https://github.com/WebComponentsGuide/webcomponents.guide/issues/new

learn/components/autonomous-vs-customized-elements.md

+7-10
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ In the [previous section][defining-a-component] we learned about _Autonomous Cus
77
Elements_. The most popular way to make elements is to use the _Autonomous Custom Element_ style, by making up your own
88
tag and extending `HTMLElement`. However, each style comes with different trade-offs.
99

10-
[defining-a-component]: /learn/components/
11-
1210
Choosing a type of component to build will depend on a lot of factors. _Autonomous Custom Elements_ give you a blank
1311
canvas to work with. _Customized Built-ins_ **extend** the element you're customizing. Here are some considerations to
1412
think about:
@@ -78,8 +76,6 @@ use _ShadowDOM_.
7876
_ShadowDOM_ also provides elements with the ability to choose how nested elements render. An ability that many
7977
_built-ins_ already have...
8078

81-
[shadowdom]: /learn/components/shadowdom
82-
8379
### Nesting & Semantics
8480

8581
Many _built-in_ elements will only allow certain tags to nest inside ([you can read more about _Content Categories_ on
@@ -96,10 +92,6 @@ _Autonomous Custom Elements_ allow any nested tag by default. This can be custom
9692
behavior is to allow any nested element. An element like `<fancy-button>` could include any _[flow
9793
content][flow-content]_ tags. It might be weird to see a `<fancy-button>` with an `<iframe>` nested inside.
9894

99-
[content-categories]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories
100-
[phrasing-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content
101-
[flow-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#flow_content
102-
10395
### Behavior & API
10496

10597
_Autonomous Custom Elements_ must extend from `HTMLElement`. They'll get all the methods and properties inherited from
@@ -136,12 +128,17 @@ universal and consistent. It's always worth getting comfortable with these tools
136128
using a variety of them. A lot of work has gone into making the _built-ins_ as accessible as possible by default, and so
137129
it can be a good idea to rely on those defaults.
138130

139-
[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
140-
141131
### Summary
142132

143133
This has all been a lot to go over. The truth is there's good reasons to pick customizing a _built-in_, but it should be
144134
carefully considered. If your element is substantially different from any existing element, then using an _Autonomous
145135
Custom Element_ is a good choice. To help drive your decision, here's a table summarizing the above information:
146136

147137
{% stub %}
138+
139+
[defining-a-component]: /learn/components/
140+
[shadowdom]: /learn/components/shadowdom
141+
[content-categories]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories
142+
[phrasing-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content
143+
[flow-content]: https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#flow_content
144+
[aria]: https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA

learn/components/index.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ message like `autonomous custom elements must extend HTMLElement`.
4444

4545
{% endtip %}
4646

47-
[lifecycle]: /learn/components/lifecycle-reference
48-
4947
## Customized Built-in Elements
5048

5149
_Customized Built-in_ elements are extensions to the browsers existing _built-in_ elements. For example if you wanted to
@@ -201,3 +199,4 @@ class MyElement extends HTMLElement {
201199
}
202200
}
203201
```
202+
[lifecycle]: /learn/components/lifecycle-reference

learn/components/initializing-your-component.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ or as logic during the _constructor_.
1616
Components might have some _state_, much of which can be assigned using [class fields][class-fields]. These could be
1717
public, private, or a combination of the two:
1818

19-
[class-fields]: /learn/javascript/classes
20-
2119
```js
2220
class StopWatchElement extends HTMLElement {
2321
static define(tag = "stop-watch") {
@@ -161,4 +159,5 @@ class StopWatchElement extends HTMLElement {
161159
}
162160
```
163161
162+
[class-fields]: /learn/javascript/classes
164163
[lifecycle]: /learn/components/lifecycle-reference/

learn/components/lifecycle-reference.md

+5-7
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ so instead of inheriting from your class, the element will fall back to being an
5353

5454
{% endtip %}
5555

56-
[constructor]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
57-
5856
## `connectedCallback()`
5957

6058
The `connectedCallback()` is a "well known" method. It doesn't exist as part of native JavaScript classes, instead it's
@@ -80,9 +78,6 @@ have children during a `connectedCallback` call. This means you might want to av
8078
Instead use this function to initialize itself, render any [ShadowDOM][shadowdom] and add [global event
8179
listeners][events].
8280

83-
[shadowdom]: /learn/components/shadowdom
84-
[events]: /learn/components/events
85-
8681
If your element depends heavily on its children existing, consider adding a
8782
[`MutationObserver`](https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver) in the `connectedCallback` to
8883
track when your elements children change.
@@ -144,8 +139,6 @@ in some cases this is very helpful; but sometimes this can bite, especially if y
144139
`attributeChangedCallback`. Try to make sure operations inside `attributeChangedCallback` are idempotent, or perhaps
145140
consider adding a check to ensure `oldValue !== newValue` before performing operations which may be sensitive to this.
146141

147-
[createattribute]: https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute
148-
149142
## `adoptedCallback()`
150143

151144
The `adoptedCallback()` is another well known method gets called when your element moves from one `document` to another
@@ -192,3 +185,8 @@ document.body.querySelector("iframe").contentWindow.document.body.append(el)
192185
// browser calls `adoptedCallback()`
193186
// browser calls `connectedCallback()`
194187
```
188+
189+
[constructor]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/constructor
190+
[shadowdom]: /learn/components/shadowdom
191+
[events]: /learn/components/events
192+
[createattribute]: https://developer.mozilla.org/en-US/docs/Web/API/Document/createAttribute

learn/components/naming-your-components.md

+2-3
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,6 @@ _Web Components_ are prefixed `<sp-`, [Shoelace Components][shoelace] are prefix
103103
can easily tell apart a component from a design system to a generic off-the-shelf component. On the other hand, this
104104
makes every component name longer.
105105

106-
[spectrum]: https://opensource.adobe.com/spectrum-web-components/
107-
[shoelace]: https://shoelace.style/
108-
109106
### If in doubt, use the `noun-noun` pattern
110107

111108
As a general rule you can think about answering to the following question: What **action** does your element to do the
@@ -138,4 +135,6 @@ prefixing your element tag names, using the prefix in the class name is a good i
138135
system with `<fcy-button>` and `<fcy-accordion>` then naming classes like `FancyButtonElement` and
139136
`FancyAccordionElement` is a good pattern.
140137

138+
[spectrum]: https://opensource.adobe.com/spectrum-web-components/
139+
[shoelace]: https://shoelace.style/
141140
[camelcase]: https://en.wikipedia.org/wiki/Camel_case

learn/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ Here's an example of a web component that renders a timer. It defines its own [s
2525
[_ShadowDOM_][shadowdom], and has its own [_private state_][private-state]. It makes use of the [_lifecycle
2626
callbacks_][lifecycle] to know when to start counting. These are all built in web platform features.
2727

28-
[styles]: /learn/components/styling
29-
[shadowdom]: /learn/components/shadowdom
30-
[private-state]: /learn/components/private-state
31-
[lifecycle]: /learn/components/lifecycle-reference
32-
3328
{% demo %}
3429

3530
```js
@@ -82,3 +77,8 @@ StopWatchElement.define()
8277
{% enddemo %}
8378

8479
Let's find out more about how to build this component...
80+
81+
[styles]: /learn/components/styling
82+
[shadowdom]: /learn/components/shadowdom
83+
[private-state]: /learn/components/private-state
84+
[lifecycle]: /learn/components/lifecycle-reference

learn/javascript/events-in-more-detail.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ In this section we'll learn about these features in more detail, covering some m
1111
potential pitfalls you'll need to watch out for. It's a good idea to make sure you've got a good understanding of
1212
everything covered in the [previous section][events] before reading on.
1313

14-
[events]: /learn/javascript/events
15-
1614
#### Adding multiple listeners
1715

1816
The [previous section][events] showed how you can add an _Event listener_ with `.addEventListener()`, but you can add
@@ -324,3 +322,5 @@ mytimer.addEventListener("start", (event) => {
324322
console.log("never called, as propagation was stopped")
325323
})
326324
```
325+
326+
[events]: /learn/javascript/events

learn/javascript/events.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ great pages on MDN that cover Events:
1616
- [The Event API](https://developer.mozilla.org/en-US/docs/Web/API/Event)
1717
- [Web Browser Event Reference](https://developer.mozilla.org/en-US/docs/Web/Events)
1818

19-
[node]: https://nodejs.org/en/
20-
[deno]: https://deno.land/
21-
2219
### What are events?
2320

2421
Events are a way to allow two different pieces of code to communicate with each other, without having to import or
@@ -151,8 +148,6 @@ This is the most important piece of information as it determines which listeners
151148
takes an optional second argument which is the _event options_. Let's just focus on the `.type` for now. You can read
152149
more about the second options argument in the next section [Events in detail][events-in-detail].
153150

154-
[events-in-detail]: /learn/javascript/events-in-detail
155-
156151
It's common to subclass `Event` for different types that have more specific properties. For example the built-in
157152
`KeyboardEvent` is used for events like `'keypress'`, `'keydown'`, and `'keyup'` and has additional properties such as
158153
`.key` which describes the keyboard key related to the event. Another example, the built-in `MouseEvent`, has a
@@ -199,3 +194,7 @@ mytimer.addEventListener("tick", (event) => {
199194

200195
mytimer.start()
201196
```
197+
198+
[node]: https://nodejs.org/en/
199+
[deno]: https://deno.land/
200+
[events-in-detail]: /learn/javascript/events-in-detail

learn/javascript/index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ If you're new to JavaScript or haven't used JavaScript for a long time, it's wor
1111
to JavaScript][mdn-intro] and [MDN's JavaScript Language Overview][mdn-overview]. It'll cover concepts that this guide
1212
won't go into.
1313

14+
{% stub %}
15+
1416
[mdn-overview]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Language_Overview
1517
[mdn-intro]: https://developer.mozilla.org/en-US/docs/Web/javascript
16-
17-
{% stub %}

learn/set-up-your-environment.md

+12-19
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ To test your applications, it can be useful to install all four browsers. Runnin
1818
browsers can uncover cross browser bugs, or missing features. Getting comfortable with using the devtools in each is a
1919
good idea.
2020

21-
[chrome]: https://www.google.com/chrome/
22-
[firefox]: https://www.mozilla.org/en-GB/firefox/new/
23-
[firefox-dev]: https://www.mozilla.org/en-GB/firefox/developer/
24-
[edge]: https://www.microsoft.com/en-us/edge?form=MA13FJ
25-
[macos]: https://support.apple.com/en-gb/macos
26-
[safari]: https://www.apple.com/uk/safari/
27-
2821
### Web Browser Devtools
2922

3023
A good set of browser developer tools which will enable you to inspect your web applications under the hood and see how
@@ -39,11 +32,6 @@ Inspector][safari-devtools].
3932

4033
Here's a handy guide on how to quickly access the developer tools, depending on your browser and OS:
4134

42-
[chrome-devtools]: https://developer.chrome.com/docs/devtools/
43-
[firefox-devtools]: https://firefox-dev.tools/
44-
[edge-devtools]: https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/overview
45-
[safari-devtools]: https://developer.apple.com/videos/play/tech-talks/401/
46-
4735
| OS | Browser | Keyboard shortcut | Menu |
4836
| :------------ | :--------------------------- | :---------------------------- | :--------------------------------------------------- |
4937
| Windows/Linux | {% icon "chrome" %} Chrome | {% shortcut "Ctrl Shift I" %} | {% menu "more" "More Tools" "Developer Tools" %} |
@@ -60,8 +48,6 @@ Web Components:
6048

6149
- [Web Component DevTools by Matsuuu][matsuu]
6250

63-
[matsuu]: https://matsuuu.github.io/web-component-devtools/
64-
6551
## Development Environment
6652

6753
To get started writing web components you'll need a development environment. While you can use any text editor to
@@ -71,10 +57,17 @@ with excellent support for writing HTML, JavaScript and CSS out of the box as we
7157
install. It can hook directly into web browsers like Chrome or Firefox using the allowing you to debug your applications
7258
without leaving your editor. All of these features make it ideal for writing Web Components and websites that use them.
7359

74-
Some recommended extensions for developing components within VS Code are:
75-
76-
-
60+
{% stub %}
7761

62+
[chrome]: https://www.google.com/chrome/
63+
[firefox]: https://www.mozilla.org/en-GB/firefox/new/
64+
[firefox-dev]: https://www.mozilla.org/en-GB/firefox/developer/
65+
[edge]: https://www.microsoft.com/en-us/edge?form=MA13FJ
66+
[macos]: https://support.apple.com/en-gb/macos
67+
[safari]: https://www.apple.com/uk/safari/
68+
[chrome-devtools]: https://developer.chrome.com/docs/devtools/
69+
[firefox-devtools]: https://firefox-dev.tools/
70+
[edge-devtools]: https://learn.microsoft.com/en-us/microsoft-edge/devtools-guide-chromium/overview
71+
[safari-devtools]: https://developer.apple.com/videos/play/tech-talks/401/
72+
[matsuu]: https://matsuuu.github.io/web-component-devtools/
7873
[vscode]: https://code.visualstudio.com/.
79-
80-
{% stub %}

learn/your-first-web-component.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ _Web Components_ go further to add a powerful set of additional APIs. One of tho
1414
Elements_][defining-a-component] which allows you to define your own HTML Elements. _Web Components_ can also make use
1515
of [_ShadowDOM_][shadowdom] which is a powerful API that allows you to manage how an element is rendered.
1616

17+
{% stub %}
18+
1719
[classes]: /learn/javascript/classes
1820
[events]: /learn/javascript/events
1921
[dom-apis]: /learn/javascript/dom-apis
2022
[defining-a-component]: /learn/components/
2123
[shadowdom]: /learn/components/shadowdom
22-
23-
{% stub %}

0 commit comments

Comments
 (0)