Skip to content

Commit

Permalink
Merge branch 'main' into move-content-guide
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmth authored Jan 27, 2025
2 parents a4589dd + c4ae794 commit 8b70235
Show file tree
Hide file tree
Showing 67 changed files with 425 additions and 158 deletions.
20 changes: 19 additions & 1 deletion .github/workflows/pr-check-lint_content.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ jobs:
files_to_lint="$DIFF_DOCUMENTS"
echo "crlf line ending check"
CRLF_FAILED=true
CRLF_LOG=$(git ls-files --eol ${files_to_lint} | grep -E 'w/(mixed|crlf)') || CRLF_FAILED=false
echo "CRLF_LOG<<${EOF}" >> $GITHUB_ENV
echo "${CRLF_LOG}" >> $GITHUB_ENV
echo "${EOF}" >> $GITHUB_ENV
echo "CRLF_FAILED=${CRLF_FAILED}" >> $GITHUB_ENV
echo "Running markdownlint --fix"
MD_LINT_FAILED=false
MD_LINT_LOG=$(yarn markdownlint-cli2 --fix ${files_to_lint} 2>&1) || MD_LINT_FAILED=true
Expand Down Expand Up @@ -114,6 +122,7 @@ jobs:
fi
# info for troubleshooting
echo CRLF_FAILED=${CRLF_FAILED}
echo MD_LINT_FAILED=${MD_LINT_FAILED}
echo FM_LINT_FAILED=${FM_LINT_FAILED}
echo PRETTIER_FAILED=${PRETTIER_FAILED}
Expand Down Expand Up @@ -154,17 +163,26 @@ jobs:
-reporter="github-pr-review"
- name: Fail if any issues pending
if: env.FILES_MODIFIED == 'true' || env.MD_LINT_FAILED == 'true' || env.FM_LINT_FAILED == 'true'
if: env.FILES_MODIFIED == 'true' || env.CRLF_FAILED == 'true' || env.MD_LINT_FAILED == 'true' || env.FM_LINT_FAILED == 'true'
env:
CRLF_FAILED: ${{ env.CRLF_FAILED }}
MD_LINT_FAILED: ${{ env.MD_LINT_FAILED }}
FM_LINT_FAILED: ${{ env.FM_LINT_FAILED }}
PRETTIER_FAILED: ${{ env.PRETTIER_FAILED }}
CRLF_LOG: ${{ env.CRLF_LOG }}
MD_LINT_LOG: ${{ env.MD_LINT_LOG }}
FM_LINT_LOG: ${{ env.FM_LINT_LOG }}
PRETTIER_LOG: ${{ env.PRETTIER_LOG }}
run: |
echo -e "\nPlease fix all the linting issues mentioned in the following logs and in the PR review comments."
if [[ ${CRLF_FAILED} == 'true' ]]; then
echo -e "\n\n🪵 In the following files make sure all the lines end with only Line Feed (LF) character and not with Carriage Return Line Feed (CRLF) characters:"
echo "${CRLF_LOG}"
echo "For more information refer https://gist.github.com/LunarLambda/3df0840b336a5e314e4ffdac03cbf619 ."
echo "You may use https://app.execeratics.com/LFandCRLFonline/?l=en online tool to convert line endings from CRLF to LF."
fi
if [[ ${MD_LINT_FAILED} == 'true' ]]; then
echo -e "\n\n🪵 Logs from markdownlint:"
echo "${MD_LINT_LOG}"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-check_redirects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@ jobs:

- name: Check redirects file(s)
if: steps.filter.outputs.required_files == 'true'
run: yarn content validate-redirects en-us --strict
run: yarn content:legacy validate-redirects en-us --strict
12 changes: 12 additions & 0 deletions .vscode/dictionaries/code-entities.txt
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ devtools.errorconsole
devtools.inspector.ruleview
devtools.netmonitor
devtools.webconsole
diak
dialogheight
dialogleft
dialogtext
Expand Down Expand Up @@ -253,6 +254,7 @@ FunciOES
funcref
fwdred
fwid
gara
gattserverdisconnected
geometrychange
geor
Expand All @@ -270,6 +272,7 @@ Grek
greklow
GSUB
gujr
gukh
gulpfile
hanidays
hanidec
Expand Down Expand Up @@ -323,6 +326,7 @@ jsdouble
jspubtd.h
jsval
kaios
kawi
kerx
Key_Codeinput
KEY_dead_abovecomma
Expand Down Expand Up @@ -355,6 +359,7 @@ keywordsearch
khmr
KIND_NONHEAP
knda
krai
lanatham
laoo
largeop
Expand Down Expand Up @@ -417,6 +422,7 @@ mkcol
mkvirtualenv
mlabeledtr
mlym
MMDD
Mobi
mod_autoindex
modif
Expand All @@ -439,9 +445,12 @@ msword
mtei
mths
mymr
mymrepka
mymrpao
mymrshan
mymrtlng
nacl_arch
nagm
nalt
navigateerror
navigatesuccess
Expand Down Expand Up @@ -492,6 +501,7 @@ Okhsl
Okhsv
olck
oldstyle
onao
onbeforematch
onbeforetoggle
oncanmakepayment
Expand Down Expand Up @@ -669,6 +679,7 @@ streamfilter
stripsurroundingwhitespace
SUBDOCUMENT
sund
sunu
superspeed
SVGDOMElement
SVGHKernElement
Expand Down Expand Up @@ -697,6 +708,7 @@ tibt
Timecount
tirh
titl
tnsa
todoapp
togglecamera
togglemicrophone
Expand Down
13 changes: 13 additions & 0 deletions .vscode/dictionaries/cultural-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ Ababa
Addis
Adlam
Ahom
Akuru
al-Qura
Alem
Amete
Expand All @@ -12,14 +13,18 @@ Bopomofo
Chakma
Chiki
Citi
Côte
d'Ivoire
dakuten
Divehi
Fa'afafine
furigana
Gannen
Garay
geng-zi
Gondi
Gunjala
Gurung
Halloumi
Hanifi
Hankaku
Expand All @@ -30,7 +35,9 @@ Hmong
háček
Jeonja
Kayah
Khema
Khudawadi
Kirat
Kolkata
Laing
Lepcha
Expand All @@ -44,23 +51,29 @@ Mihret
Minguo
Minh
Muhenkan
Mundari
Mundi
Newa
nosinė
Nyiakeng
Ol
Onal
Osmanya
Oyayubi
Pahawh
Puachue
Reiwa
Reykjavík
Rohingya
Romaji
Saurashtra
Sharada
Sinhala
Sora_Sompeng
Sunuwar
Taiohae
Takri
Tangsa
Thaana
Tham
Tirhuta
Expand Down
2 changes: 2 additions & 0 deletions .vscode/dictionaries/terms-abbreviations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ HPKE
HPKP
HTCPCP
HVXC
IACVT
ICANN
ICNS
iconset
Expand Down Expand Up @@ -679,6 +680,7 @@ sublocality
submatch
submatches
subminor
subminute
subpage
subpages
subpanels
Expand Down
21 changes: 21 additions & 0 deletions files/en-us/glossary/bun/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Bun
slug: Glossary/Bun
page-type: glossary-definition
---

{{GlossarySidebar}}

**Bun** is a fast and modern {{Glossary("JavaScript")}} runtime environment designed to prioritize performance and developer tooling.

Unlike [Node.js](https://nodejs.org/) and [Deno](https://deno.com/), Bun is built on Apple's [JavaScriptCore](https://trac.webkit.org/wiki/JavaScriptCore). Notable features of Bun include:

- Drop-in Node.js replacement: almost all Node.js programs can run using Bun-equivalent commands.
- State-of-the-art JavaScript execution speed in most real-world scenarios.
- Native support for JavaScript syntax extensions like JSX and TypeScript.
- Global cache for managing package installations to minimize disk usage.
- Built-in bundler, transpiler, [Jest](https://jestjs.io/) compatible test-runner, package manager, and more built-in utilities that web developers may find useful.

## See also

- [Bun website](https://bun.sh/)
2 changes: 1 addition & 1 deletion files/en-us/glossary/style_origin/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ The style origins are used to determine where to stop rolling back (or backtrack

## See also

- [CSS Cascading and Inheritance: Cascading Origins](https://drafts.csswg.org/css-cascade-4/#cascading-origins)
- [CSS cascading and inheritance: Cascading Origins](https://drafts.csswg.org/css-cascade-4/#cascading-origins)
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Learning outcomes:
Resources:

- [Accessibility overview](/en-US/docs/Learn_web_development/Core/Accessibility)
- [Inclusive design principles](https://inclusivedesignprinciples.info/), inclusivedesignprinciples.info
- [Inclusive design principles](https://inclusivedesignprinciples.info/)

## Design briefs

Expand All @@ -78,9 +78,10 @@ Learning outcomes:
- [Learn UI Design Fundamentals](https://scrimba.com/learn/design?via=mdn), Scrimba <sup>Course Partner</sup>
- [The Shape of Design](https://shapeofdesignbook.com/chapters/00-introduction/), Frank Chimero
- [Designing for the Web](https://designingfortheweb.co.uk/), Mark Boulton
- [Design trampoline: Learn design theory basics](https://designtrampoline.org/), Anna Riazhskikh
- [Design for web](https://designforweb.org/), Prisca Schmarsow + other contributors. Highlights include:
- [Design trampoline: Learn design theory basics](https://designforweb.org/vis/chapter1-design-principles/designTrampoline-by-AnnaRiazhskikh/), Anna Riazhskikh
- [Web typography made simple](https://designforweb.org/vis/chapter2-typography/typelab-by-HannahBoom/), Hannah Boom
- [Practical Typography](https://practicaltypography.com/), Matthew Butterick
- [Web typography made simple](https://designforweb.org/vis/chapter2-typography/typelab-by-HannahBoom/), Hannah Boom
- [Web Style Guide](https://webstyleguide.com/), Patrick J. Lynch and Sarah Horton
- [Visual design rules you can safely follow every time](https://anthonyhobday.com/sideprojects/saferules/), Anthony Hobday
- [16 little UI design rules that make a big impact](https://www.adhamdannaway.com/blog/ui-design/16-ui-design-rules), Adham Dannaway
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,13 +295,11 @@ We have reached the end of our study of document and DOM manipulation. At this p

## See also

There are lots more features you can use to manipulate your documents. Check out some of our references and see what you can discover:

- {{domxref("Document")}}
- {{domxref("Window")}}
- {{domxref("Node")}}
- {{domxref("HTMLElement")}}, {{domxref("HTMLInputElement")}}, {{domxref("HTMLImageElement")}}, etc.

(See our [Web API index](/en-US/docs/Web/API) for the full list of Web APIs documented on MDN!)
- There are lots more features you can use to manipulate your documents. Check out some of our references and see what you can discover:
- {{domxref("Document")}}
- {{domxref("Window")}}
- {{domxref("Node")}}
- {{domxref("HTMLElement")}}, {{domxref("HTMLInputElement")}}, {{domxref("HTMLImageElement")}}, etc.
- [DOM Scripting](https://explainers.dev/dom-scripting/), explainers.dev

{{PreviousMenuNext("Learn_web_development/Core/Scripting/Object_basics","Learn_web_development/Core/Scripting/Network_requests", "Learn_web_development/Core/Scripting")}}
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,6 @@ We hope you enjoyed playing with text in this article! The next article will pro
## See also

- [Web-safe fonts](https://v2.scrimba.com/the-frontend-developer-career-path-c0j/~02b?via=mdn), Scrimba <sup>_MDN Curriculum partner_</sup>
- : This interactive lesson provides a fun look at web-safe fonts and applying them to a simple example.
- [All about the CSS font-family property](https://explainers.dev/font-family/), explainers.dev

{{NextMenu("Learn_web_development/Core/Text_styling/Styling_lists", "Learn_web_development/Core/Text_styling")}}
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,6 @@ Now that you have worked through our articles on text styling fundamentals, it's
## See also

- [Variable fonts guide](/en-US/docs/Web/CSS/CSS_fonts/Variable_fonts_guide)
- : Variable fonts allow many different variations of a typeface to be incorporated into a single file, rather than having a separate font file for every width, weight, or style. They are somewhat advanced for our beginner's course, but have a look at this guide if you feel like stretching yourself.
- [Fonts knowledge](https://fonts.google.com/knowledge), Google Fonts
- : A series of useful, in-depth articles covering different aspects of using fonts.

{{PreviousMenuNext("Learn_web_development/Core/Text_styling/Styling_links", "Learn_web_development/Core/Text_styling/Typesetting_a_homepage", "Learn_web_development/Core/Text_styling")}}
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ We will start by describing various web-related concepts: web pages, websites, w
- **Web page**
- : A document that can be displayed in a web {{Glossary("browser")}}. These are also often called just "pages". Such documents are written in the {{Glossary("HTML")}} language (which we look at in more detail later on).
- **Website**
- : A collection of web pages grouped together into a single resourse, with links connecting them together. Often called a "site".
- : A collection of web pages grouped together into a single resource, with links connecting them together. Often called a "site".
- **Web server**
- : A computer that hosts a website on the Internet.
- **Search engine**
Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/accessibility/seizure_disorders/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ The methods for sniffing them out is not a casual exercise. You may be intereste

#### Text can also be animated

Translations and transformations can animate text in a div, and do harm. Although it is experimental technology, [`CSSKeyframe.keyText`](/en-US/docs/Web/API/CSSKeyframeRule/keyText) is being developed. Moving text can induce seizures for the same reasons that moving images do, so avoid animating your text. It's a good idea to avoid using moving text anyhow, as many screen readers cannot read moving text and it's bad user experience even for those with no vision or vestibular issues.
Translations and transformations can animate text in a div, and do harm. Moving text can induce seizures for the same reasons that moving images do, so avoid animating your text. It's a good idea to avoid using moving text anyhow, as many screen readers cannot read moving text and it's bad user experience even for those with no vision or vestibular issues.

### CSS for animation

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/clipboard/read/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ browser-compat: api.Clipboard.read
The **`read()`** method of the {{domxref("Clipboard")}} interface requests a copy of the clipboard's contents, fulfilling the returned {{jsxref("Promise")}} with the data.

The method can in theory return arbitrary data (unlike {{domxref("Clipboard.readText", "readText()")}}, which can only return text).
Browsers commonly support reading text, HTML, and PNG image data — see [browser compatibility](#browser_compatibility) for more information.
Browsers commonly support reading text, HTML, and PNG image data.

## Syntax

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/clipboard/readtext/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ browser-compat: api.Clipboard.readText

{{APIRef("Clipboard API")}} {{securecontext_header}}

The **`readText()`** method of the {{domxref("Clipboard")}} interface returns a {{jsxref("Promise")}} which fulfils with a copy of the textual contents of the system clipboard.
The **`readText()`** method of the {{domxref("Clipboard")}} interface returns a {{jsxref("Promise")}} which fulfills with a copy of the textual contents of the system clipboard.

> [!NOTE]
> To read non-text contents from the clipboard, use the {{domxref("Clipboard.read", "read()")}} method instead.
Expand Down
22 changes: 9 additions & 13 deletions files/en-us/web/api/clipboard/write/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ browser-compat: api.Clipboard.write

{{APIRef("Clipboard API")}} {{securecontext_header}}

The **`write()`** method of the {{domxref("Clipboard")}} interface writes arbitrary data to the clipboard, such as images, fulfilling the returned {{jsxref("Promise")}} on completion.
The **`write()`** method of the {{domxref("Clipboard")}} interface writes arbitrary {{domxref("ClipboardItem")}} data such as images and text to the clipboard, fulfilling the returned {{jsxref("Promise")}} on completion.
This can be used to implement cut and copy functionality.

The method can in theory write arbitrary data (unlike {{domxref("Clipboard.writeText", "writeText()")}}, which can only write text).
Browsers commonly support writing text, HTML, and PNG image data — see [browser compatibility](#browser_compatibility) for more information.
Browsers commonly support writing text, HTML, and PNG image data.

## Syntax

Expand Down Expand Up @@ -55,21 +55,17 @@ button.addEventListener("click", () => setClipboard("<empty clipboard>"));

async function setClipboard(text) {
const type = "text/plain";
const blob = new Blob([text], { type });
const data = [new ClipboardItem({ [type]: blob })];
await navigator.clipboard.write(data);
const clipboardItemData = {
[type]: text,
};
const clipboardItem = new ClipboardItem(clipboardItemData);
await navigator.clipboard.write([clipboardItem]);
}
```

The `setClipboard()` method begins by creating a new a {{domxref("Blob")}} object.
This object is required to construct a {{domxref("ClipboardItem")}} object which is sent to the clipboard.
The {{domxref("Blob")}} constructor takes in the content we want to copy and its type.
This {{domxref("Blob")}} object can be derived from many sources; for example, a [canvas](/en-US/docs/Web/API/HTMLCanvasElement).
The `setClipboard()` function specifies a `"text/plain"` MIME type in the `type` constant, then specifies a `clipboardItemData` object with a single property — its key is the MIME type, and its value is the passed in text that we want to write to the clipboard. We then construct a new {{domxref("ClipboardItem")}} object into which the `clipboardItemData` object is passed.

Next, we create a new {{domxref("ClipboardItem")}} object into which the blob will be placed for sending to the clipboard.
The key of the object passed to the {{domxref("ClipboardItem")}} constructor indicates the content type, the value indicates the content.
Then `write()` is called with `await`.
A `try..catch` block could be used to catch any errors writing the data.
Finally, `write()` is called with `await` to write the data to the clipboard.

### Write canvas contents to the clipboard

Expand Down
2 changes: 1 addition & 1 deletion files/en-us/web/api/clipboard_api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Firefox [Web Extensions](/en-US/docs/Mozilla/Add-ons/WebExtensions/Interact_with
The system clipboard is accessed through the {{domxref("Navigator.clipboard")}} global.

This snippet fetches the text from the clipboard and appends it to the first element found with the class `editor`.
Since {{domxref("Clipboard.readText", "readText()")}} (and {{domxref("Clipboard.read", "read()")}}, for that matter) returns an empty string if the clipboard isn't text, this code is safe.
Since {{domxref("Clipboard.readText", "readText()")}} returns an empty string if the clipboard isn't text, this code is safe.

```js
navigator.clipboard
Expand Down
Loading

0 comments on commit 8b70235

Please sign in to comment.