docs(v2): wrap mdx usage in mdx-code-block (#5007)

This commit is contained in:
Sébastien Lorber 2021-06-18 17:59:51 +02:00 committed by GitHub
parent 871e090ed8
commit c63295a253
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 0 deletions

View file

@ -52,6 +52,7 @@ With `{#custom-id}` syntax you can set your own header id.
This will render in the browser as follows:
```mdx-code-block
import BrowserWindow from '@site/src/components/BrowserWindow';
<BrowserWindow url="http://localhost:3000">
@ -81,3 +82,4 @@ The headers are well-spaced so that the hierarchy is clear.
With <code>{#custom-id}</code> syntax you can set your own header id.
</BrowserWindow>
```

View file

@ -83,6 +83,7 @@ import MyComponentSource from '!!raw-loader!./myComponent';
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
```
```mdx-code-block
import CodeBlock from '@theme/CodeBlock';
import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponent';
@ -93,6 +94,7 @@ import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponen
</BrowserWindow>
<br />
```
:::note
@ -116,6 +118,7 @@ import Intro from './markdown-features-intro.mdx';
<Intro />;
```
```mdx-code-block
import Intro from './markdown-features-intro.mdx';
<BrowserWindow url="http://localhost:3000">
@ -125,6 +128,7 @@ import Intro from './markdown-features-intro.mdx';
</BrowserWindow>
<br />
```
This way, you can reuse contents among multiple pages and avoid duplicating materials.

View file

@ -52,6 +52,7 @@ With `{#custom-id}` syntax you can set your own header id.
This will render in the browser as follows:
```mdx-code-block
import BrowserWindow from '@site/src/components/BrowserWindow';
<BrowserWindow url="http://localhost:3000">
@ -81,3 +82,4 @@ The headers are well-spaced so that the hierarchy is clear.
With <code>{#custom-id}</code> syntax you can set your own header id.
</BrowserWindow>
```

View file

@ -83,6 +83,7 @@ import MyComponentSource from '!!raw-loader!./myComponent';
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
```
```mdx-code-block
import CodeBlock from '@theme/CodeBlock';
import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponent';
@ -93,6 +94,7 @@ import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponen
</BrowserWindow>
<br />
```
:::note
@ -116,6 +118,7 @@ import Intro from './markdown-features-intro.mdx';
<Intro />;
```
```mdx-code-block
import Intro from './markdown-features-intro.mdx';
<BrowserWindow url="http://localhost:3000">
@ -125,6 +128,7 @@ import Intro from './markdown-features-intro.mdx';
</BrowserWindow>
<br />
```
This way, you can reuse contents among multiple pages and avoid duplicating materials.