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:
|
This will render in the browser as follows:
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import BrowserWindow from '@site/src/components/BrowserWindow';
|
import BrowserWindow from '@site/src/components/BrowserWindow';
|
||||||
|
|
||||||
<BrowserWindow url="http://localhost:3000">
|
<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.
|
With <code>{#custom-id}</code> syntax you can set your own header id.
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
```
|
||||||
|
|
|
@ -83,6 +83,7 @@ import MyComponentSource from '!!raw-loader!./myComponent';
|
||||||
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
|
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import CodeBlock from '@theme/CodeBlock';
|
import CodeBlock from '@theme/CodeBlock';
|
||||||
import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponent';
|
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>
|
</BrowserWindow>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
```
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
@ -116,6 +118,7 @@ import Intro from './markdown-features-intro.mdx';
|
||||||
<Intro />;
|
<Intro />;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import Intro from './markdown-features-intro.mdx';
|
import Intro from './markdown-features-intro.mdx';
|
||||||
|
|
||||||
<BrowserWindow url="http://localhost:3000">
|
<BrowserWindow url="http://localhost:3000">
|
||||||
|
@ -125,6 +128,7 @@ import Intro from './markdown-features-intro.mdx';
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
```
|
||||||
|
|
||||||
This way, you can reuse contents among multiple pages and avoid duplicating materials.
|
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:
|
This will render in the browser as follows:
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import BrowserWindow from '@site/src/components/BrowserWindow';
|
import BrowserWindow from '@site/src/components/BrowserWindow';
|
||||||
|
|
||||||
<BrowserWindow url="http://localhost:3000">
|
<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.
|
With <code>{#custom-id}</code> syntax you can set your own header id.
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
```
|
||||||
|
|
|
@ -83,6 +83,7 @@ import MyComponentSource from '!!raw-loader!./myComponent';
|
||||||
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
|
<CodeBlock className="language-jsx">{MyComponentSource}</CodeBlock>;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import CodeBlock from '@theme/CodeBlock';
|
import CodeBlock from '@theme/CodeBlock';
|
||||||
import MyComponentSource from '!!raw-loader!@site/src/pages/examples/_myComponent';
|
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>
|
</BrowserWindow>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
```
|
||||||
|
|
||||||
:::note
|
:::note
|
||||||
|
|
||||||
|
@ -116,6 +118,7 @@ import Intro from './markdown-features-intro.mdx';
|
||||||
<Intro />;
|
<Intro />;
|
||||||
```
|
```
|
||||||
|
|
||||||
|
```mdx-code-block
|
||||||
import Intro from './markdown-features-intro.mdx';
|
import Intro from './markdown-features-intro.mdx';
|
||||||
|
|
||||||
<BrowserWindow url="http://localhost:3000">
|
<BrowserWindow url="http://localhost:3000">
|
||||||
|
@ -125,6 +128,7 @@ import Intro from './markdown-features-intro.mdx';
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
```
|
||||||
|
|
||||||
This way, you can reuse contents among multiple pages and avoid duplicating materials.
|
This way, you can reuse contents among multiple pages and avoid duplicating materials.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue