Skip to content

Test: fix md #2137

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 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: 'Learn about different methods when embedding your sketches in a we
author: 'Karl Söderby'
---

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.
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.

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.

Expand All @@ -24,7 +24,7 @@ It should look something like this:

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

<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>
<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>

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!

Expand All @@ -39,7 +39,7 @@ To do this, we just need to add the following code to the end of the URL:
```
The result is the following:

<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>
<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>

And the full URL should look like this:

Expand All @@ -58,7 +58,7 @@ Next is the highlighting feature. To use this, simply add the following lines to

The result is that line 3 and 4 are highlighted:

<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>
<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>

And the full URL should look like this:

Expand All @@ -74,37 +74,37 @@ You can highlight as many lines as you want, and it is easily configurable. For

## Manually changing the size of your widget

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

The following dimensions are default:

```markup
style="height:510px;width:100%;margin:10px 0"
style="height:510px;width:100%;margin:10px 0"
```

But we can change them up a bit:

```
style="height:200px;width:50%;margin:10px 0"
style="height:200px;width:50%;margin:10px 0"
```

Which will look like this:

<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>
<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>

## Automatically re-sizing your sketches
## Automatically re-sizing your sketches

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

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

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

## Summary

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.
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.

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.

Expand Down
Loading