mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-30 10:48:05 +02:00
docs: wrap code block demos in mdx-code-block (#7262)
This commit is contained in:
parent
7073cc3462
commit
0102c2e2ae
1 changed files with 8 additions and 0 deletions
|
@ -234,6 +234,7 @@ export default MyComponent;
|
||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
|
````mdx-code-block
|
||||||
<BrowserWindow>
|
<BrowserWindow>
|
||||||
|
|
||||||
```jsx {1,4-6,11}
|
```jsx {1,4-6,11}
|
||||||
|
@ -251,6 +252,7 @@ export default MyComponent;
|
||||||
```
|
```
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
````
|
||||||
|
|
||||||
:::tip prefer comments
|
:::tip prefer comments
|
||||||
|
|
||||||
|
@ -294,6 +296,7 @@ export default MyComponent;
|
||||||
```
|
```
|
||||||
````
|
````
|
||||||
|
|
||||||
|
````mdx-code-block
|
||||||
<BrowserWindow>
|
<BrowserWindow>
|
||||||
|
|
||||||
```jsx {1,4-6,11} showLineNumbers
|
```jsx {1,4-6,11} showLineNumbers
|
||||||
|
@ -311,6 +314,7 @@ export default MyComponent;
|
||||||
```
|
```
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
````
|
||||||
|
|
||||||
## Interactive code editor {#interactive-code-editor}
|
## Interactive code editor {#interactive-code-editor}
|
||||||
|
|
||||||
|
@ -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.
|
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>
|
<BrowserWindow>
|
||||||
|
|
||||||
```jsx live
|
```jsx live
|
||||||
|
@ -387,6 +392,7 @@ function Clock(props) {
|
||||||
```
|
```
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
````
|
||||||
|
|
||||||
### Imports {#imports}
|
### Imports {#imports}
|
||||||
|
|
||||||
|
@ -435,6 +441,7 @@ export default ReactLiveScope;
|
||||||
|
|
||||||
The `ButtonExample` component is now available to use:
|
The `ButtonExample` component is now available to use:
|
||||||
|
|
||||||
|
````mdx-code-block
|
||||||
<BrowserWindow>
|
<BrowserWindow>
|
||||||
|
|
||||||
```jsx live
|
```jsx live
|
||||||
|
@ -448,6 +455,7 @@ function MyPlayground(props) {
|
||||||
```
|
```
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
````
|
||||||
|
|
||||||
## Using JSX markup in code blocks {#using-jsx-markup}
|
## Using JSX markup in code blocks {#using-jsx-markup}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue