Skip to content

Commit

Permalink
docs: wrap code block demos in mdx-code-block (#7262)
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Cena authored Apr 29, 2022
1 parent 7073cc3 commit 0102c2e
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export default MyComponent;
```
````

````mdx-code-block
<BrowserWindow>
```jsx {1,4-6,11}
Expand All @@ -251,6 +252,7 @@ export default MyComponent;
```
</BrowserWindow>
````

:::tip prefer comments

Expand Down Expand Up @@ -294,6 +296,7 @@ export default MyComponent;
```
````

````mdx-code-block
<BrowserWindow>
```jsx {1,4-6,11} showLineNumbers
Expand All @@ -311,6 +314,7 @@ export default MyComponent;
```
</BrowserWindow>
````

## Interactive code editor {#interactive-code-editor}

Expand Down Expand Up @@ -361,6 +365,7 @@ function Clock(props) {

The code block will be rendered as an interactive editor. Changes to the code will reflect on the result panel live.

````mdx-code-block
<BrowserWindow>
```jsx live
Expand All @@ -387,6 +392,7 @@ function Clock(props) {
```
</BrowserWindow>
````

### Imports {#imports}

Expand Down Expand Up @@ -435,6 +441,7 @@ export default ReactLiveScope;

The `ButtonExample` component is now available to use:

````mdx-code-block
<BrowserWindow>
```jsx live
Expand All @@ -448,6 +455,7 @@ function MyPlayground(props) {
```
</BrowserWindow>
````

## Using JSX markup in code blocks {#using-jsx-markup}

Expand Down

0 comments on commit 0102c2e

Please sign in to comment.