mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-01 02:12:36 +02:00
Co-authored-by: sebastien <lorber.sebastien@gmail.com>
This commit is contained in:
parent
3a0a2a74b8
commit
91cef6226a
3 changed files with 40 additions and 31 deletions
|
@ -230,8 +230,6 @@ Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/
|
||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
- You should not break lines between the starting or ending tag of the `<summary>` element and its content or an extra `<p>` element is inserted.
|
You may want to keep your `<summary>` on a single line. Keep in mind that [MDX creates extra HTML `<p>` paragraphs for line breaks.](https://mdxjs.com/migrating/v2/#jsx). When in doubt, use the [MDX playground](https://mdxjs.com/playground/) to troubleshoot `<details>` rendering problems.
|
||||||
- Blank lines between the `<summary>` element and the first paragraph of the detailed content are optional in Docusaurus but strongly recommended to ensure MDX portability with other site generators.
|
|
||||||
- Blank lines between the nested `<details>` element and the paragraphs just around it are optional.
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
|
@ -181,42 +181,55 @@ Markdown quotes are beautifully styled:
|
||||||
|
|
||||||
Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) HTML elements are beautifully styled:
|
Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) HTML elements are beautifully styled:
|
||||||
|
|
||||||
```md
|
{/* prettier-ignore */}
|
||||||
|
````md
|
||||||
### Details element example
|
### Details element example
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Toggle me!</summary>
|
<summary>Toggle me!</summary>
|
||||||
<div>
|
|
||||||
<div>This is the detailed content</div>
|
|
||||||
<br/>
|
|
||||||
<details>
|
|
||||||
<summary>
|
|
||||||
Nested toggle! Some surprise inside...
|
|
||||||
</summary>
|
|
||||||
<div>😲😲😲😲😲</div>
|
|
||||||
</details>
|
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
```
|
|
||||||
|
|
||||||
```mdx-code-block
|
This is the detailed content
|
||||||
|
|
||||||
|
```js
|
||||||
|
console.log("Markdown features including the code block are available");
|
||||||
|
```
|
||||||
|
|
||||||
|
You can use Markdown here including **bold** and _italic_ text, and [inline link](https://docusaurus.io)
|
||||||
|
<details>
|
||||||
|
<summary>Nested toggle! Some surprise inside...</summary>
|
||||||
|
|
||||||
|
😲😲😲😲😲
|
||||||
|
</details>
|
||||||
|
</details>
|
||||||
|
````
|
||||||
|
|
||||||
|
````mdx-code-block
|
||||||
<BrowserWindow>
|
<BrowserWindow>
|
||||||
|
|
||||||
<h3>Details element example</h3>
|
<h3>Details element example</h3>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Toggle me!</summary>
|
<summary>Toggle me!</summary>
|
||||||
<div>
|
|
||||||
<div>This is the detailed content</div>
|
This is the detailed content
|
||||||
<br/>
|
|
||||||
<details>
|
```js
|
||||||
<summary>
|
console.log("Markdown features including the code block are available");
|
||||||
Nested toggle! Some surprise inside...
|
```
|
||||||
</summary>
|
|
||||||
<div>😲😲😲😲😲</div>
|
You can use Markdown here including **bold** and _italic_ text, and [inline link](https://docusaurus.io)
|
||||||
</details>
|
<details>
|
||||||
</div>
|
<summary>Nested toggle! Some surprise inside...</summary>
|
||||||
|
|
||||||
|
😲😲😲😲😲
|
||||||
|
</details>
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
</BrowserWindow>
|
</BrowserWindow>
|
||||||
```
|
````
|
||||||
|
|
||||||
|
:::info
|
||||||
|
|
||||||
|
You may want to keep your `<summary>` on a single line. Keep in mind that [MDX creates extra HTML `<p>` paragraphs for line breaks.](https://mdxjs.com/migrating/v2/#jsx). When in doubt, use the [MDX playground](https://mdxjs.com/playground/) to troubleshoot `<details>` rendering problems.
|
||||||
|
|
||||||
|
:::
|
||||||
|
|
|
@ -230,8 +230,6 @@ Markdown can embed HTML elements, and [`details`](https://developer.mozilla.org/
|
||||||
|
|
||||||
:::info
|
:::info
|
||||||
|
|
||||||
- You should not break lines between the starting or ending tag of the `<summary>` element and its content or an extra `<p>` element is inserted.
|
You may want to keep your `<summary>` on a single line. Keep in mind that [MDX creates extra HTML `<p>` paragraphs for line breaks.](https://mdxjs.com/migrating/v2/#jsx). When in doubt, use the [MDX playground](https://mdxjs.com/playground/) to troubleshoot `<details>` rendering problems.
|
||||||
- Blank lines between the `<summary>` element and the first paragraph of the detailed content are optional in Docusaurus but strongly recommended to ensure MDX portability with other site generators.
|
|
||||||
- Blank lines between the nested `<details>` element and the paragraphs just around it are optional.
|
|
||||||
|
|
||||||
:::
|
:::
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue