Skip to content

Commit

Permalink
fix url
Browse files Browse the repository at this point in the history
  • Loading branch information
ankushKun committed Apr 19, 2024
1 parent d025cea commit 8feafc6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions pages/external-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ This can be used on documentation pages or any other webpage where you want to s
## Iframe usage

```jsx
<iframe
src="https://ide.betteridea.dev/?codeblock"
width="100%" height="250px"
style={{ borderRadius: 10 }}
<iframe
src="https://ide.betteridea.dev/?codeblock"
width="100%" height="250px"
style={{ borderRadius: 10 }}
/>
```

Expand All @@ -27,18 +27,18 @@ example: for the lua code `Inbox[#Inbox].Data --Latest message data`, the URL en
and can be used as `https://ide.betteridea.dev/?codeblock=Inbox%5B%23Inbox%5D.Data%20--Latest%20message%20data`

```jsx
<iframe
<iframe
src="http://ide.betteridea.dev/?codeblock=Inbox%5B%23Inbox%5D.Data%20--Latest%20message%20data"
width="100%" height="250px"
style={{ borderRadius: 10 }}
style={{ borderRadius: 10 }}
/>
```

will preload the code cell with the lua code you provide in the url parameter

<iframe
id="last-msg"
src="http://localhost:5173/?codeblock=Inbox%5B%23Inbox%5D.Data%20--Latest%20message%20data"
src="http://ide.betteridea.dev/?codeblock=Inbox%5B%23Inbox%5D.Data%20--Latest%20message%20data"
width="100%" height="250px"
style={{borderRadius:10}}
/>
Expand All @@ -52,11 +52,11 @@ You can execute the code cell from an external button click or any event by send
Add a unique id to the iframe and use a querySelector to get the iframe and then call `contentWindow.postMessage` with `{action: "run"}` and target origin as `https://ide.betteridea.dev`

```jsx
<iframe
<iframe
id="adder"
src="http://ide.betteridea.dev/?codeblock=1%2B1"
width="100%" height="250px"
style={{ borderRadius: 10 }}
style={{ borderRadius: 10 }}
/>
```

Expand Down

0 comments on commit 8feafc6

Please sign in to comment.