Skip to content
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

docs: wrap code block demos in mdx-code-block #7262

Merged
merged 1 commit into from
Apr 29, 2022
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 @@ -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