Skip to content

Commit bb81765

Browse files
chore: use gatsby-remark-embedder to transform all embeds in docs (#5658)
1 parent 886b5de commit bb81765

File tree

6 files changed

+19
-21
lines changed

6 files changed

+19
-21
lines changed

packages/common/src/components/Preview/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,7 @@ class BasePreview extends React.PureComponent<Props, State> {
625625
<StyledFrame
626626
key="PREVIEW"
627627
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
628-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts allow-downloads"
628+
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
629629
src={this.state.url}
630630
ref={this.setIframeElement}
631631
title={getSandboxName(sandbox)}

packages/homepage/content/docs/2-api.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ URL to the file hosted externally. For example:
7474

7575
#### Folders
7676

77-
You can create folders by naming the file with a `/` in the name, allowing you to
78-
structure your application how you want:
77+
You can create folders by naming the file with a `/` in the name, allowing you
78+
to structure your application how you want:
7979

8080
```json
8181
{
@@ -130,7 +130,7 @@ const url = `https://codesandbox.io/api/v1/sandboxes/define?parameters=${paramet
130130

131131
#### Example Sandbox
132132

133-
<iframe src="https://codesandbox.io/embed/6yznjvl7nw?editorsize=50&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
133+
https://codesandbox.io/s/6yznjvl7nw?editorsize=50&fontsize=14&hidenavigation=1&runonclick=1
134134

135135
### POST Form
136136

@@ -139,7 +139,7 @@ show a form. With a POST request you can create bigger sandboxes.
139139

140140
#### Example Sandbox
141141

142-
<iframe src="https://codesandbox.io/embed/qzlp7nw34q?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
142+
https://codesandbox.io/s/qzlp7nw34q?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1
143143

144144
### Define without render
145145

@@ -160,7 +160,7 @@ Both `get` and `post` requests are supported.
160160
You can also create a sandbox using an XHR request, like using `fetch`. An
161161
example sandbox of that is here:
162162

163-
<iframe src="https://codesandbox.io/embed/9loovqj5oy?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
163+
https://codesandbox.io/s/9loovqj5oy?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1
164164

165165
## Import Single Components
166166

packages/homepage/content/docs/2-embedding.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ These are some examples of embeds, based on their properties.
6464

6565
This embed is focused on being as light as possible:
6666

67-
`https://codesandbox.io/embed/new?codemirror=1`
67+
```md
68+
https://codesandbox.io/embed/new?codemirror=1
69+
```
6870

6971
Use this code to embed:
7072

@@ -79,14 +81,16 @@ Use this code to embed:
7981

8082
That will give to a result like this:
8183

82-
<iframe src="https://codesandbox.io/embed/new?codemirror=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
84+
https://codesandbox.io/s/new?codemirror=1
8385

8486
### Code Example Embed
8587

8688
You can also use CodeSandbox to show code examples, with highlighted lines. This
8789
is only supported with the CodeMirror editor currently:
8890

89-
`https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14`
91+
```md
92+
https://codesandbox.io/embed/new?codemirror=1&highlights=11,12,13,14
93+
```
9094

9195
Use this code to embed:
9296

@@ -101,4 +105,4 @@ Use this code to embed:
101105

102106
That will give to a result like this:
103107

104-
<iframe src="https://codesandbox.io/embed/new?codemirror=1&highlights=6,7,8,9" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
108+
https://codesandbox.io/s/new?codemirror=1&highlights=6,7,8,9

packages/homepage/content/docs/2-importing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const url = `https://codesandbox.io/api/v1/sandboxes/define?parameters=${paramet
198198

199199
#### Example Sandbox
200200

201-
<iframe src="https://codesandbox.io/embed/6yznjvl7nw?editorsize=50&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
201+
https://codesandbox.io/s/6yznjvl7nw?editorsize=50&fontsize=14&hidenavigation=1&runonclick=1
202202

203203
### POST Form
204204

@@ -207,7 +207,7 @@ show a form. With a POST request you can create bigger sandboxes.
207207

208208
#### Example Sandbox
209209

210-
<iframe src="https://codesandbox.io/embed/qzlp7nw34q?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
210+
https://codesandbox.io/s/qzlp7nw34q?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1
211211

212212
### Define without render
213213

@@ -228,7 +228,7 @@ Both `get` and `post` requests are supported.
228228
You can also create a sandbox using an XHR request, like using `fetch`. An
229229
example sandbox of that is here:
230230

231-
<iframe src="https://codesandbox.io/embed/9loovqj5oy?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
231+
https://codesandbox.io/s/9loovqj5oy?editorsize=70&fontsize=14&hidenavigation=1&runonclick=1
232232

233233
## Import Single Components
234234

packages/homepage/content/docs/2-tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ And will also show squiggles in the editor:
4747

4848
Here's a failing Jest test running in a sandbox:
4949

50-
<iframe src="https://codesandbox.io/embed/n9m2w9q8x0?view=preview" style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;" allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking" sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"></iframe>
50+
https://codesandbox.io/s/n9m2w9q8x0?view=preview

packages/homepage/content/docs/5-secrets.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,7 @@ the example above, we can read the API key from
3636
secrets in your server-side code (though obviously you wouldn't want to share a
3737
secret like this, it justs illustrates how to access them).
3838

39-
<iframe
40-
src="https://codesandbox.io/embed/broken-resonance-35lyl?codemirror=1&fontsize=14&hidenavigation=1&theme=dark"
41-
style="width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;"
42-
title="broken-resonance-35lyl"
43-
allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
44-
sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts"
45-
></iframe>
39+
https://codesandbox.io/s/broken-resonance-35lyl?codemirror=1&fontsize=14&hidenavigation=1&theme=dark
4640

4741
## Editing secrets
4842

0 commit comments

Comments
 (0)