Skip to content

Commit 402bcb4

Browse files
authored
Merge branch 'main' into canchebagur/c33-micropython-tutorial
2 parents c644759 + f63a380 commit 402bcb4

File tree

1,808 files changed

+79858
-48167
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,808 files changed

+79858
-48167
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: "Upload an app to Cloudflare Pages"
2+
description: "Manually deploy an app to cloudflare pages"
3+
inputs:
4+
upload-dir:
5+
description: "The name of the app to build and export"
6+
required: true
7+
8+
project-name:
9+
description: "The name of the project to upload to"
10+
required: true
11+
12+
cloudflare-account:
13+
description: "The Cloudflare account ID"
14+
required: true
15+
16+
cloudflare-api-token:
17+
description: "The Cloudflare API token"
18+
required: true
19+
20+
runs:
21+
using: composite
22+
steps:
23+
24+
- name: Find PR Preview Comment
25+
if: github.event_name == 'pull_request'
26+
uses: peter-evans/find-comment@v1
27+
id: deploy-preview-comment
28+
with:
29+
issue-number: ${{ github.event.pull_request.number }}
30+
comment-author: "github-actions[bot]"
31+
body-includes: ${{ inputs.project-name }}
32+
33+
- name: Update Comment if exists
34+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
35+
uses: peter-evans/create-or-update-comment@v1.4.5
36+
with:
37+
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
38+
edit-mode: replace
39+
body: |
40+
### ${{ inputs.project-name }}
41+
Waiting for deployment to complete...
42+
43+
- id: branch-name
44+
uses: tj-actions/branch-names@v5
45+
46+
- id: format-branch
47+
shell: bash
48+
run: format=$(echo ${{ steps.branch-name.outputs.current_branch }} | tr / -) && echo "::set-output name=branch::$(echo "${format:0:28}")"
49+
50+
- name: deploy-cloudflare
51+
uses: cloudflare/pages-action@v1
52+
id: deploy-cloudflare
53+
with:
54+
apiToken: ${{ inputs.cloudflare-api-token }}
55+
accountId: ${{ inputs.cloudflare-account }}
56+
projectName: ${{ inputs.project-name }}
57+
directory: ${{ inputs.upload-dir }}
58+
branch: ${{ steps.format-branch.outputs.branch }}
59+
60+
- name: Create PR Preview Comment
61+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id == 0
62+
uses: peter-evans/create-or-update-comment@v1.4.5
63+
with:
64+
issue-number: ${{ github.event.pull_request.number }}
65+
body: |
66+
### ${{ inputs.project-name }}
67+
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
68+
📍 Commit SHA: ${{ github.sha }}
69+
70+
71+
- name: Update PR Preview Comment
72+
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
73+
uses: peter-evans/create-or-update-comment@v1.4.5
74+
with:
75+
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
76+
edit-mode: replace
77+
body: |
78+
### ${{ inputs.project-name }}
79+
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
80+
📍 Commit SHA: ${{ github.sha }}
81+

.github/workflows/cloudflare.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Cloudflare Pages
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
types: [opened, synchronize]
8+
9+
jobs:
10+
run:
11+
runs-on: ubuntu-latest
12+
env:
13+
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
14+
APP_ENV: prod
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 18
21+
cache: "npm"
22+
cache-dependency-path: "**/package-lock.json"
23+
24+
- name: Render Datasheets
25+
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
26+
27+
- name: Copy Static Files
28+
run: |
29+
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
30+
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
31+
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
32+
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
33+
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;
34+
35+
- name: Gatsby main cache
36+
uses: actions/cache@v3
37+
id: gatsby-cache-folder
38+
with:
39+
path: .cache
40+
key: ${{ runner.os }}-cache-gatsbyV2-${{ github.sha }}
41+
restore-keys: |
42+
${{ runner.os }}-cache-gatsbyV2-
43+
44+
- name: Gatsby Public Folder
45+
uses: actions/cache@v3
46+
id: gatsby-public-folder
47+
with:
48+
path: public/
49+
key: ${{ runner.os }}-public-gatsbyV2-${{ github.sha }}
50+
restore-keys: |
51+
${{ runner.os }}-public-gatsbyV2-
52+
53+
- run: npm install
54+
- run: npm run build
55+
56+
- name: Docs
57+
uses: ./.github/actions/cloudflare-upload
58+
with:
59+
upload-dir: public
60+
project-name: docs-content
61+
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
62+
cloudflare-account: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

.github/workflows/deploy-prd.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ jobs:
1818
- uses: actions/checkout@v3
1919
- uses: actions/setup-node@v3
2020
with:
21-
node-version: 14
21+
node-version: 18
2222
cache: "npm"
2323
cache-dependency-path: "**/package-lock.json"
2424

2525
- name: Render Datasheets
2626
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
2727

2828
- name: Copy Static Files
29-
run: |
29+
run: |
3030
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
3131
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
3232
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;

.github/workflows/deploy-stg.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ jobs:
1717
- uses: actions/checkout@v3
1818
- uses: actions/setup-node@v3
1919
with:
20-
node-version: 14
20+
node-version: 18
2121
cache: "npm"
2222
cache-dependency-path: "**/package-lock.json"
23-
23+
2424
- name: Render Datasheets
2525
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh
2626

2727
- name: Copy Static Files
28-
run: |
28+
run: |
2929
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
3030
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
3131
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;

.github/workflows/render-datasheets.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ jobs:
1010
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
1111

1212
steps:
13-
- uses: actions/checkout@v2
14-
- uses: actions/setup-node@v2
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
1515
with:
16-
node-version: 14
16+
node-version: 18
1717
cache: "npm"
1818
cache-dependency-path: "**/package-lock.json"
1919

.npmrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@bcmi-labs:registry=https://npm.pkg.github.com/
22
@serjlee:registry=https://npm.pkg.github.com/
33
@arduino:registry=https://npm.pkg.github.com/
4-
//npm.pkg.github.com/:_authToken=${REPO_ACCESS_TOKEN}
4+
//npm.pkg.github.com/:_authToken=${REPO_ACCESS_TOKEN}
5+
legacy-peer-deps=true

README.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,55 +8,47 @@ The production website is available at: <https://docs.arduino.cc>
88

99
## How Can I Contribute?
1010

11-
Contributing by creating content or suggestion changes to existing content can be done by making **pull requests**.
11+
Contributing by creating content or suggesting changes to existing content can be done by making **pull requests**.
1212

13-
You start by forking the repository or by creating a new branch if you have write access to this repo. Create a new branch based on main and name it according to what you will create prefixed with your github username and a slash (e.g. `sebromero/wifi-tutorial`). Read in the section below how to add different types of new content.
13+
You start by forking the repository or by creating a new branch if you have write access to this repo. Create a new branch based on main and name it according to what you will create prefixed with your GitHub username and a slash (e.g. `sebromero/wifi-tutorial`). Read in the section below how to add different types of new content.
1414

15-
When you're done with a draft you can create a pull request. This will give the content team the possibility to review it and leave comments or request changes. During this review process you can continue to push commits to the same branch. They will show up in the pull request automatically.
15+
When you're done with a draft you can create a pull request. This will give the content team the possibility to review it and leave comments or request changes. During this review process, you can continue to push commits to the same branch. They will show up in the pull request automatically.
1616

17-
Once the pull request gests approved and merged into main, the content will be deployed to the live server.
18-
19-
There are four different content types you can contribute with. These are **tutorial**, **article**, **how to** and **project**. Please read more on what they mean and how to write one in the [Contribution Templates folder](/contribution-templates/README.md).
20-
21-
|Content|Description|Example|
22-
|-------|-----------|-------|
23-
|Tutorial|Learn how to do something.|[Control Built-in RGB LED over Wi-Fi with Nano RP2040 Connect](https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-web-server-rgb)|
24-
|Article|Learn about a specific topic.|[Multimeter Basics](https://docs.arduino.cc/learn/electronics/multimeter-basics)|
25-
|How To|Smaller tutorial with less information and more straight to the example.|[Analog Read Serial](https://docs.arduino.cc/built-in-examples/basics/AnalogReadSerial)|
26-
|Project|Learn how to build something.|[Plant Communicator with MKR WiFi 1010](https://projecthub.arduino.cc/Arduino_Genuino/plant-communicator-with-mkr-wifi-1010-081cf5)|
17+
Once the pull request gets approved and merged into main, the content will be deployed to the live server.
2718

2819
## Fixing Bugs and Typos
2920

30-
If you found a mistake in the content you need to locate the corresponding file to fix it and create a pull request. Here is how to locate the content.
21+
If you find a mistake in the content, you need to locate the corresponding file to fix it and create a pull request. Here is how to locate the content.
3122

3223
### Products
3324

34-
- If you found an issue in a hardware product-specific tutorial they are located according to the following pattern:
25+
- If you have found an issue in a hardware product-specific tutorial they are located according to the following pattern:
3526
`/content/hardware/[product-family]/[product-type]/[product]/tutorials/[tutorial-name]/[content-file].md`
3627

37-
- If you found an issue in a hardware product's datasheet they are located according to the following pattern:
28+
- If you have found an issue in a hardware product's datasheet they are located according to the following pattern:
3829
`/content/hardware/[product-family]/[product-type]/[product]/datasheet/datasheet.md`
3930

40-
- If you found an issue in a hardware product's description they are located according to the following pattern:
31+
- If you have found an issue in a hardware product's description they are located according to the following pattern:
4132
`/content/hardware/[product-family]/[product-type]/[product]/product.md`
4233

43-
- If you found an issue in a hardware product's tech specs table they are located according to the following pattern:
34+
- If you have found an issue in a hardware product's tech specs table they are located according to the following pattern:
4435
`/content/hardware/[product-family]/[product-type]/[product]/tech-specs.yml`
4536

46-
- If you found an issue in a hardware product's features they are located according to the following pattern:
37+
- If you have found an issue in a hardware product's features they are located according to the following pattern:
4738
`/content/hardware/[product-family]/[product-type]/[product]/features.md`
4839

4940
### Software
5041

51-
- If you found an issue in a software product's tutorial they are located according to the following pattern:
42+
- If you have found an issue in a software product's tutorial they are located according to the following pattern:
5243
`/content/software/[product-name]/tutorials/(tutorial-subfolder)/[tutorial-name]/[content-file].md`
5344

5445
## Adding Content
5546

5647
### Referencing Content From Other Folders
5748

58-
The build system supports symlinks. This allows to include content in multiple places. For example, if there is a tutorial that works for different boards, it can be written once and included in different places. On Unix the `ln` command can be used for that.
59-
For example, if we want a tutorial that lives here `content/tutorials/generic/basic-servo-control` to show up on the Nano 33 BLE product page, we can link it as follows. First open a shell and navigate to the tutorials folder of the product. e.g. `cd content/hardware/03.nano/boards/nano-33-ble/tutorials/`. Then create a symlink with a relative path to the tutorial. e.g. `ln -s ../../../../../tutorials/generic/basic-servo-control basic-servo-control`. This will create a symbolic link to that directory without duplicating it. Any change can be made in either location. They will be applied the original source file in both cases.
49+
The build system supports symlinks. This allows the inclusion of content in multiple places. For example, if there is a tutorial that works for different boards, it can be written once and included in different places. On Unix the `ln` command can be used for that.
50+
51+
For example, if we want a tutorial that lives here `content/tutorials/generic/basic-servo-control` to show up on the Nano 33 BLE product page, we can link it as follows. First, open a shell and navigate to the tutorials folder of the product. e.g. `cd content/hardware/03.nano/boards/nano-33-ble/tutorials/`. Then create a symlink with a relative path to the tutorial. e.g. `ln -s ../../../../../tutorials/generic/basic-servo-control basic-servo-control`. This will create a symbolic link to that directory without duplicating it. Any change can be made in either location. They will be applied to the source file in both cases.
6052

6153
#### Adding Symlinks on Windows
6254

@@ -83,27 +75,29 @@ symbolic link created for AnalogInput <<===>> ..\..\..\..\..\built-in-examples\0
8375
### Including Code Snippets
8476

8577
Code snippets can be included by using the triple backticks syntax e.g. ` ```arduino` followed by the code and three closing backticks. The following syntaxes are supported:
78+
8679
```
8780
arduino, bash, markup, clike, c, cpp, css, css-extras, javascript, jsx, js-extras, coffeescript, diff, git, go, graphql, handlebars, json, less, makefile, markdown, objectivec, ocaml, python, reason, sass, scss, sql, stylus, tsx, typescript, wasm, yaml
8881
```
8982

90-
### Including Code Blocks fetching Github pages
83+
### Including Code Blocks fetching GitHub pages
9184

9285
CodeBlocks are custom components that can be added directly in the Markdown on docs-content.
93-
Using this component, the code block will be fetched directly from Github pages.
86+
87+
Using this component, the code block will be fetched directly from GitHub pages.
9488

9589
Syntax:
90+
9691
` <CodeBlock url=”https://github.com/example” className="{language}"/>`
97-
98-
Broken URL will show error alert. URL must be in Github domain and must be public.
92+
93+
Broken URLs will show an error alert. URL must be in the GitHub domain and must be public.
9994

10095
## Previewing Changes
10196

10297
Whenever you create a Pull Request (PR) GatsbyCloud will create a preview deployment in which you can see how your changes look when rendered on the website. The link to the preview will appear in the comments of the PR. This also works with Draft PRs, but not for PRs created from a fork.
10398

10499
## License
105100

106-
![](https://i.creativecommons.org/l/by-sa/3.0/88x31.png)
101+
![](https://i.creativecommons.org/l/by-sa/3.0/88x31.png)
107102

108103
Please note that your contribution to the Arduino Documentation is licensed under a Creative Commons Attribution-Share Alike 4.0 License. see https://creativecommons.org/licenses/by-sa/4.0/
109-

0 commit comments

Comments
 (0)