mirror of
https://github.com/facebook/docusaurus.git
synced 2025-04-29 10:17:55 +02:00
docs(v2): wrap mdx usage in mdx-code-block (#5007)
This commit is contained in:
parent
871e090ed8
commit
c63295a253
4 changed files with 12 additions and 0 deletions
|
@ -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>
|
||||
```
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
|
@ -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>
|
||||
```
|
||||
|
|
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue