Skip to content

Commit 0314cbf

Browse files
Merge branch 'main' into Pedromsousalima/Alvik/Add_C_API_Reference
2 parents 12e34ec + 501dc98 commit 0314cbf

File tree

117 files changed

+2381
-547
lines changed

Some content is hidden

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

117 files changed

+2381
-547
lines changed

.github/workflows/deploy-production.yml

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
steps:
2727
- uses: actions/checkout@v4
2828
with:
29-
fetch-depth: 0
29+
fetch-depth: 1
3030
- uses: actions/setup-node@v4
3131
with:
3232
node-version: 18
@@ -50,7 +50,7 @@ jobs:
5050
id: gatsby-cache-folder
5151
with:
5252
path: .cache
53-
key: ${{ runner.os }}-cache-gatsby-${{ github.refname }}
53+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref_name }}
5454
restore-keys: |
5555
${{ runner.os }}-cache-gatsby-main
5656
@@ -59,13 +59,16 @@ jobs:
5959
id: gatsby-public-folder
6060
with:
6161
path: public/
62-
key: ${{ runner.os }}-public-gatsby-${{ github.refname }}
62+
key: ${{ runner.os }}-public-gatsby-${{ github.ref_name }}
6363
restore-keys: |
6464
${{ runner.os }}-public-gatsby-main
6565
6666
- run: npm install
6767
- run: npm run build
6868

69+
- name: Clean up node_modules
70+
run: rm -rf node_modules
71+
6972
- name: Configure AWS credentials from Production account
7073
uses: aws-actions/configure-aws-credentials@v4
7174
with:
@@ -79,12 +82,19 @@ jobs:
7982
# Don't cache any HTML or JSON file: they should always be up-to-dates
8083
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
8184

82-
- name: Sync PDF
83-
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
85+
# - name: Sync PDF
86+
# run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
8487

85-
- name: Purge cache on CloudFlare
86-
run: |
87-
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
88-
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
89-
-H "Content-Type: application/json" \
90-
--data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
88+
# - name: Purge cache on CloudFlare
89+
# run: |
90+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
91+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
92+
# -H "Content-Type: application/json" \
93+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
94+
95+
- name: Sync all cacheable assets
96+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/
97+
98+
- name: Sync all non-cacheable assets
99+
# Don't cache any HTML or JSON file: they should always be up-to-dates
100+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.PRODUCTION_BUCKET_NAME }}/

.github/workflows/deploy-staging.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
steps:
2626
- uses: actions/checkout@v4
2727
with:
28-
fetch-depth: 0
28+
fetch-depth: 1
2929
- uses: actions/setup-node@v4
3030
with:
3131
node-version: 18
@@ -49,7 +49,7 @@ jobs:
4949
id: gatsby-cache-folder
5050
with:
5151
path: .cache
52-
key: ${{ runner.os }}-cache-gatsby-${{ github.refname }}
52+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref_name }}
5353
restore-keys: |
5454
${{ runner.os }}-cache-gatsby-main
5555
@@ -58,32 +58,43 @@ jobs:
5858
id: gatsby-public-folder
5959
with:
6060
path: public/
61-
key: ${{ runner.os }}-public-gatsby-${{ github.refname }}
61+
key: ${{ runner.os }}-public-gatsby-${{ github.ref_name }}
6262
restore-keys: |
6363
${{ runner.os }}-public-gatsby-main
6464
6565
- run: npm install
6666
- run: npm run build
6767

68+
- name: Clean up node_modules
69+
run: rm -rf node_modules
70+
6871
- name: Configure AWS credentials from Staging account
6972
uses: aws-actions/configure-aws-credentials@v4
7073
with:
7174
role-to-assume: ${{ secrets.STAGING_IAM_ROLE }}
7275
aws-region: us-east-1
7376

77+
# - name: Sync all cacheable assets
78+
# run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
79+
80+
# - name: Sync all non-cacheable assets
81+
# # Don't cache any HTML or JSON file: they should always be up-to-dates
82+
# run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
83+
84+
# - name: Sync PDF
85+
# run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
86+
87+
# - name: Purge cache on CloudFlare
88+
# run: |
89+
# curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
90+
# -H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
91+
# -H "Content-Type: application/json" \
92+
# --data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'
93+
7494
- name: Sync all cacheable assets
75-
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
95+
run: aws s3 sync --cache-control "public, max-age=31536000, immutable" --include "*.css" --include="*.js" --include="*.gif" --include="*.png" --include="*.svg" --exclude "*.html" --exclude="sw.js" --exclude="*.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
7696

7797
- name: Sync all non-cacheable assets
7898
# Don't cache any HTML or JSON file: they should always be up-to-dates
79-
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.pdf" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
80-
81-
- name: Sync PDF
82-
run: aws s3 sync --cache-control "public, max-age=86400, must-revalidate" --include "*.pdf" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --exclude="*.css" --exclude="*.html" --exclude="*.json" --exclude="sw.json" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
99+
run: aws s3 sync --cache-control "public, max-age=0, must-revalidate" --include "*.html" --include="sw.js" --include="*.json" --include "*.css" --exclude="*.js" --exclude="*.gif" --exclude="*.png" --exclude="*.svg" --delete public/ s3://${{ secrets.STAGING_BUCKET_NAME }}/
83100

84-
- name: Purge cache on CloudFlare
85-
run: |
86-
curl -X POST "https://api.cloudflare.com/client/v4/zones/${{ secrets.CLOUDFLARE_ZONE }}/purge_cache" \
87-
-H "Authorization: Bearer ${{ secrets.CLOUDFLARE_PURGE_API_TOKEN }}" \
88-
-H "Content-Type: application/json" \
89-
--data '{"prefixes":["${{ vars.DATASHEETS_BASE_URL }}"]}'

.github/workflows/preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
id: gatsby-cache-folder
7070
with:
7171
path: .cache
72-
key: ${{ runner.os }}-cache-gatsby-${{ github.refname }}
72+
key: ${{ runner.os }}-cache-gatsby-${{ github.ref_name }}
7373
restore-keys: |
7474
${{ runner.os }}-cache-gatsby-main
7575
@@ -78,7 +78,7 @@ jobs:
7878
id: gatsby-public-folder
7979
with:
8080
path: public/
81-
key: ${{ runner.os }}-public-gatsby-${{ github.refname }}
81+
key: ${{ runner.os }}-public-gatsby-${{ github.ref_name }}
8282
restore-keys: |
8383
${{ runner.os }}-public-gatsby-main
8484
Loading

content/arduino-cloud/04.cloud-editor/embedding-create-iframes/embedding-create-iframes.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,27 @@ description: 'Learn about different methods when embedding your sketches in a we
44
author: 'Karl Söderby'
55
---
66

7-
The Web Editor is a great tool for creating and uploading programs while also collecting all of your sketches in one place. Another great feature is embedding them as iframes, such as articles, blogposts or journals.
7+
The Cloud Editor is a great tool for creating and uploading programs while also collecting all of your sketches in one place. Another great feature is embedding them as iframes, such as articles, blogposts or journals.
88

9-
To embed an iframe is very easy, and we just need to copy and paste a link from our sketch in the Web Editor. But we can also do a series of modifications to that iframe, and in this tutorial we will take a look at how to do that.
9+
To embed an iframe is very easy, and we just need to copy and paste a link from our sketch in the Cloud Editor. But we can also do a series of modifications to that iframe, and in this tutorial we will take a look at how to do that.
1010

1111
## Let's start
1212

13-
First of all, we need to navigate to the [Web Editor](https://create.arduino.cc/editor). If we do not have an account, we can register one with just a few simple steps.
13+
First of all, we need to navigate to the [Cloud Editor](https://create.arduino.cc/editor). If we do not have an account, we can register one with just a few simple steps.
1414

15-
Then, we need to have a code. In this tutorial, we are just going to use the good old **blink** example. When we have our sketch ready, click on the **share** button next to the port selection tool. This will open up a new window, that will have two fields: **link** and **iframe**. Copy the iframe field.
15+
Then, we need to have a code. In this tutorial, we are just going to use the good old **blink** example. When we have our sketch ready, click on the **share** button next to the serial monitor tool. This will open up a new window, that will have two fields: **link** and **embed**. Copy the embed field.
1616

17-
![iframe field](assets/iframe_highlight.png)
17+
![embed field](assets/iframe-highlight.png)
1818

19-
It should look something like this, where `{YOUR_ACCOUNT}` and `{SKETCH_URL}` is replaced by your own credentials.
19+
It should look something like this:
2020

2121
```markup
22-
<iframe src="https://create.arduino.cc/editor/{YOUR_ACCOUNT}/{SKETCH_URL}/preview?embed" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
22+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed" style="height:510px;width:100%;margin:10px 0" frameborder=0></iframe>
2323
```
2424

2525
This iframe can now simply be embedded in a HTML page, and it will look like this:
2626

27-
<iframe src="https://create.arduino.cc/editor/FT-CONTENT/189d16e1-ba13-421a-9413-7de6e9e46ed7/preview?embed" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
27+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
2828

2929
But there are many ways we can modify the iframe to look different. So let's take a look the available modifications we can make!
3030

@@ -39,12 +39,12 @@ To do this, we just need to add the following code to the end of the URL:
3939
```
4040
The result is the following:
4141

42-
<iframe src="https://create.arduino.cc/editor/FT-CONTENT/189d16e1-ba13-421a-9413-7de6e9e46ed7/preview?embed&snippet" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
42+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed&snippet" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
4343

4444
And the full URL should look like this:
4545

4646
```markup
47-
<iframe src="https://create.arduino.cc/editor/{YOUR_ACCOUNT}/{SKETCH_URL}/preview?embed&snippet" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
47+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed&snippet" style="height:510px;width:100%;margin:10px 0" frameborder=0></iframe>
4848
```
4949

5050

@@ -58,12 +58,12 @@ Next is the highlighting feature. To use this, simply add the following lines to
5858

5959
The result is that line 3 and 4 are highlighted:
6060

61-
<iframe src="https://create.arduino.cc/editor/FT-CONTENT/189d16e1-ba13-421a-9413-7de6e9e46ed7/preview?embed&snippet#L3-L4" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
61+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed&snippet#L3-L4" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
6262

6363
And the full URL should look like this:
6464

6565
```markup
66-
<iframe src="https://create.arduino.cc/editor/{YOUR_ACCOUNT}/{SKETCH_URL}/preview?embed&amp;snippet#L3-L4" style="height:510px;width:100%;margin:10px 0" frameborder="0"></iframe>
66+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed&snippet#L3-L4" style="height:510px;width:100%;margin:10px 0" frameborder=0></iframe>
6767
```
6868

6969
You can highlight as many lines as you want, and it is easily configurable. For example, if we want to highlight line 1, 3 and 5-8, we simply need to add the following to the URL:
@@ -74,39 +74,39 @@ You can highlight as many lines as you want, and it is easily configurable. For
7474

7575
## Manually changing the size of your widget
7676

77-
If we want to change the size of the widget, we just need to modify the dimensions of the iframe.
77+
If we want to change the size of the widget, we just need to modify the dimensions of the iframe.
7878

7979
The following dimensions are default:
8080

8181
```markup
82-
style="height:510px;width:100%;margin:10px 0"
82+
style="height:510px;width:100%;margin:10px 0"
8383
```
8484

8585
But we can change them up a bit:
8686

8787
```
88-
style="height:200px;width:50%;margin:10px 0"
88+
style="height:200px;width:50%;margin:10px 0"
8989
```
9090

9191
Which will look like this:
9292

93-
<iframe src="https://create.arduino.cc/editor/FT-CONTENT/189d16e1-ba13-421a-9413-7de6e9e46ed7/preview?embed&snippet" style="height:200px;width:50%;margin:10px 0" frameborder="0"></iframe>
93+
<iframe src="https://app.arduino.cc/sketches/examples?eid=01.Basics%2FBlink&view-mode=embed&snippet" style="height:200px;width:50%;margin:10px 0" frameborder="0"></iframe>
9494

95-
## Automatically re-sizing your sketches
95+
## Automatically re-sizing your sketches
9696

9797
We can also choose to automatically re-size our iframes. This is simply done by first including this script in your HTML file:
9898

9999
```markup
100100
<script src="https://content.arduino.cc/assets/arduinoSketchIframeResizer.js"></script>
101101
```
102102

103-
And then using the class `arduino-sketch-iframe` in your HTML element.
103+
And then using the class `arduino-sketch-iframe` in your HTML element.
104104

105105
## Summary
106106

107-
There are several cool ways of working with iframes from the Web Editor, and it is a really easy process that requires very little coding.
107+
There are several cool ways of working with iframes from the Cloud Editor, and it is a really easy process that requires very little coding.
108108

109-
The Web Editor helps you keep track on all of your sketches, and with the iframes, including your projects on other pages has never been easier.
109+
The Cloud Editor helps you keep track on all of your sketches, and with the iframes, including your projects on other pages has never been easier.
110110

111111
### More tutorials
112112

Loading
Loading
Loading
Loading
Loading

0 commit comments

Comments
 (0)