Skip to content

Test 2.0.0 #1268

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

Merged
merged 16 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
81 changes: 81 additions & 0 deletions .github/actions/cloudflare-upload/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "Upload an app to Cloudflare Pages"
description: "Manually deploy an app to cloudflare pages"
inputs:
upload-dir:
description: "The name of the app to build and export"
required: true

project-name:
description: "The name of the project to upload to"
required: true

cloudflare-account:
description: "The Cloudflare account ID"
required: true

cloudflare-api-token:
description: "The Cloudflare API token"
required: true

runs:
using: composite
steps:

- name: Find PR Preview Comment
if: github.event_name == 'pull_request'
uses: peter-evans/find-comment@v1
id: deploy-preview-comment
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: ${{ inputs.project-name }}

- name: Update Comment if exists
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
uses: peter-evans/[email protected]
with:
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
edit-mode: replace
body: |
### ${{ inputs.project-name }}
Waiting for deployment to complete...

- id: branch-name
uses: tj-actions/branch-names@v5

- id: format-branch
shell: bash
run: format=$(echo ${{ steps.branch-name.outputs.current_branch }} | tr / -) && echo "::set-output name=branch::$(echo "${format:0:28}")"

- name: deploy-cloudflare
uses: cloudflare/pages-action@v1
id: deploy-cloudflare
with:
apiToken: ${{ inputs.cloudflare-api-token }}
accountId: ${{ inputs.cloudflare-account }}
projectName: ${{ inputs.project-name }}
directory: ${{ inputs.upload-dir }}
branch: ${{ steps.format-branch.outputs.branch }}

- name: Create PR Preview Comment
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id == 0
uses: peter-evans/[email protected]
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
### ${{ inputs.project-name }}
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
📍 Commit SHA: ${{ github.sha }}


- name: Update PR Preview Comment
if: github.event_name == 'pull_request' && steps.deploy-preview-comment.outputs.comment-id != 0
uses: peter-evans/[email protected]
with:
comment-id: ${{ steps.deploy-preview-comment.outputs.comment-id }}
edit-mode: replace
body: |
### ${{ inputs.project-name }}
🚀 Preview this PR: ${{ steps.deploy-cloudflare.outputs.url }}
📍 Commit SHA: ${{ github.sha }}

62 changes: 62 additions & 0 deletions .github/workflows/cloudflare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Cloudflare Pages

on:
push:
branches: ["main"]
pull_request:
types: [opened, synchronize]

jobs:
run:
runs-on: ubuntu-latest
env:
REPO_ACCESS_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
APP_ENV: prod

steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
cache: "npm"
cache-dependency-path: "**/package-lock.json"

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

- name: Copy Static Files
run: |
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
find ./content/hardware -type f -name "*-full-pinout.pdf" -exec cp {} ./static/resources/pinouts/ \;
find ./content/hardware -type f -name "*-pinout.png" -exec cp {} ./static/resources/pinouts/ \;

- name: Gatsby main cache
uses: actions/cache@v3
id: gatsby-cache-folder
with:
path: .cache
key: ${{ runner.os }}-cache-gatsbyV2-${{ github.sha }}
restore-keys: |
${{ runner.os }}-cache-gatsbyV2-

- name: Gatsby Public Folder
uses: actions/cache@v3
id: gatsby-public-folder
with:
path: public/
key: ${{ runner.os }}-public-gatsbyV2-${{ github.sha }}
restore-keys: |
${{ runner.os }}-public-gatsbyV2-

- run: npm install
- run: npm run build

- name: Docs
uses: ./.github/actions/cloudflare-upload
with:
upload-dir: public
project-name: docs-content
cloudflare-api-token: ${{ secrets.CLOUDFLARE_API_TOKEN }}
cloudflare-account: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-prd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
run: cd ${GITHUB_WORKSPACE}/scripts/datasheet-rendering;./render-datasheets.sh

- name: Copy Static Files
run: |
run: |
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/deploy-stg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 14
node-version: 18
cache: "npm"
cache-dependency-path: "**/package-lock.json"

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

- name: Copy Static Files
run: |
run: |
mkdir -p static/resources/datasheets static/resources/schematics static/resources/pinouts
find ./content/hardware -type f -name "*-schematics.pdf" -exec cp {} ./static/resources/schematics/ \;
find ./content/hardware -type f -name "*-datasheet.pdf" -exec cp {} ./static/resources/datasheets/ \;
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@bcmi-labs:registry=https://npm.pkg.github.com/
@serjlee:registry=https://npm.pkg.github.com/
@arduino:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${REPO_ACCESS_TOKEN}
//npm.pkg.github.com/:_authToken=${REPO_ACCESS_TOKEN}
legacy-peer-deps=true
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ symbolic link created for AnalogInput <<===>> ..\..\..\..\..\built-in-examples\0
### Including Code Snippets

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:

```
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
```
Expand All @@ -94,16 +95,24 @@ Using this component, the code block will be fetched directly from Github pages.

Syntax:
` <CodeBlock url=”https://github.com/example” className="{language}"/>`

Broken URL will show error alert. URL must be in Github domain and must be public.

### Use Custom content con various component

- **Details** pages: on every `product.md` file you have to create 4 variables, related to the hero buttons component in every details page:
- primary_button_url: (string)
- primary_button_title: (string)
- secondary_button_url: (string)
- secondary_button_title: (string)
- **Video**: You can manage the content in the video components (Actually in Learn, Arduino-cloud and MycroPython page), just compiling the file `videoInfo.md` in the main directory of the relative section.

## Previewing Changes

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.

## License

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

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/

1 change: 1 addition & 0 deletions content/arduino-cloud/01.guides/guides.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Guides
icon: IconBrackets
---
3 changes: 2 additions & 1 deletion content/arduino-cloud/02.hardware/hardware.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Hardware & Devices
---
icon: IconBoard
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Cloud Interface
icon: IconCloud
---
3 changes: 2 additions & 1 deletion content/arduino-cloud/04.cloud-editor/cloud-editor.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Cloud Editor
---
icon: IconCloud
---
1 change: 1 addition & 0 deletions content/arduino-cloud/05.iot-remote-app/iot-remote-app.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: IoT Remote App
icon: IconBooks
---
1 change: 1 addition & 0 deletions content/arduino-cloud/06.features/features.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Features
icon: IconSquare
---
3 changes: 2 additions & 1 deletion content/arduino-cloud/07.api/api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: API
---
icon: IconProgramming
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Arduino Cloud CLI
icon: IconProgramming
---
3 changes: 2 additions & 1 deletion content/arduino-cloud/09.business/business.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Cloud Business
---
icon: IconBooks
---
3 changes: 2 additions & 1 deletion content/arduino-cloud/10.education/education.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Cloud Education
---
icon: IconCloud
---
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
title: Application Notes
icon: IconDatasheet
---
30 changes: 30 additions & 0 deletions content/arduino-cloud/videoInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
url: https://www.youtube.com/embed/uaLrmLCqGnc?si=mrZrx8NTxS3RksyI
info:
[
{
icon: IconNet,
title: Getting Started with Arduino Cloud,
description: 'An online platform that makes it easy for you to code, deploy and monitor IoT projects.',
link: /arduino-cloud/guides/overview,
},
{
icon: IconBrackets,
title: Arduino / C++,
description: Get started with the Arduino Cloud using the C++ programming language.,
link: /arduino-cloud/guides/arduino-c,
},
{
icon: IconCLI,
title: ESP32 / ESP8266,
description: Learn how to set up ESP32/ESP8266 based boards in the Arduino Cloud.,
link: /arduino-cloud/guides/esp32,
},
{
icon: IconBooks,
title: Cloud Editor,
description: A step-by-step guide to set up your online development environment.,
link: /arduino-cloud/guides/cloud-editor,
},
]
---
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'String Comparison Operators'
compatible-products: [all-boards]
difficulty: intermediate
description: 'Learn how to make alphabetic comparisons between Strings. They are useful for sorting and alphabetizing, among other things.'
tags:
tags:
- Strings
- Operators
- Comparison
Expand All @@ -24,7 +24,7 @@ is identical to
if (stringOne ==stringTwo) {
```

The ">" (greater than) and "<" (less than) operators evaluate strings in alphabetical order, on the first character where the two differ. So, for example `"a" < "b"` and `"1" < "2"`, but `"999" > "1000"` because 9 comes after 1.
The `>` (greater than) and `<` (less than) operators evaluate strings in alphabetical order, on the first character where the two differ. So, for example `"a" < "b"` and `"1" < "2"`, but `"999" > "1000"` because 9 comes after 1.

**Caution:**
String comparison operators can be confusing when you're comparing numeric strings, because the numbers are treated as strings and not as numbers. If you need to compare numbers, compare them as ints, floats, or longs, and not as Strings.
Expand Down
3 changes: 2 additions & 1 deletion content/hardware/01.mkr/01.boards/mkr-1000-wifi/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ The MKR 1000 WiFi is a great choice for any beginner, maker or professional to g
<Feature title="Wi-Fi" image="wifi">

This Wi-Fi module from Atmel is part of the SmartConnect family, with focus on power consumption and power saving modes.

<FeatureWrapper>
<FeatureLink variant="primary" title="Documentation" url="/tutorials/mkr-1000-wifi/mkr-1000-connect-to-wifi"/>
<FeatureLink variant="secondary" title="library" url="https://www.arduino.cc/reference/en/libraries/wifi101/"/>
</FeatureWrapper>
</Feature>

</FeatureList>
8 changes: 5 additions & 3 deletions content/hardware/01.mkr/01.boards/mkr-fox-1200/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ The MKR FOX 1200 adds Sigfox connectivity to your projects. Using the popular <b
<Feature title="Microchip® Smart RF Transmitter" image="cellular">

Fully integrated, single-chip RF transmitter with low power consumption.

<FeatureWrapper>
<FeatureLink variant="primary" title="Documentation" url="/tutorials/mkr-fox-1200/sigfox-first-configuration"/>
<FeatureLink variant="secondary" title="library" url="https://www.arduino.cc/reference/en/libraries/arduino-sigfox-for-mkrfox1200/"/>
</FeatureWrapper>
</Feature>

<Feature title="Coverage" image="world-map">

SigFox covers most parts of Europe, South Africa, Japan and is being introduced in many more countries.

SigFox covers most parts of Europe, South Africa, Japan and is being introduced in many more countries.
<FeatureWrapper>
<FeatureLink variant="primary" title="Link to Map" url="https://www.sigfox.com/en/coverage"/>
</FeatureWrapper>
</Feature>

</FeatureList>
3 changes: 2 additions & 1 deletion content/hardware/01.mkr/01.boards/mkr-gsm-1400/features.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ The MKR GSM 1400 is a great option for GSM / 3G connectivity projects. Using the
<Feature title="GSM / 3G Connectivity" image="cellular">

Enables GSM / 3G connectivity for the MKR GSM 1400 board.

<FeatureWrapper>
<FeatureLink variant="primary" title="Documentation" url="/tutorials/mkr-gsm-1400/gsm-receive-sms"/>
<FeatureLink variant="secondary" title="library" url="https://www.arduino.cc/reference/en/libraries/mkrgsm/"/>
</FeatureWrapper>
</Feature>

</FeatureList>
Loading