跳转至主内容
Version: 2.0.0-beta.4

Markdown 特性

文档是您产品向用户展示的门面之一。 文从字顺、层次清晰的文章有助于用户快速了解您的产品。 我们的一致目标是帮助用户尽快找到所需要的信息。

Docusaurus 2 使用现代化工具来帮助您轻松撰写交互式文档。 您可以嵌入 React 组件,亦或是搭建用户可交互的在线代码编辑块。 就用代码呈现您的灵光一现,捕获您受众的心吧! 这可能是吸引潜在用户的最有效的方式。

本章节中,我们将向您介绍我们认为能帮助您构建强大文档的工具。 先让我们带您看个例子。

important

本章节假定您使用 Docusaurus 官方的内容插件。

Standard features#

Markdown 是一种能让您撰写易读的格式化内容之语法。

Docusaurus 支持标准 Markdown 语法,且使用 MDX 作为解析引擎。因此,您不仅可以解析 Markdown 文件,还可以在其中渲染 React 组件。

### My Doc Section
Hello world message with some **bold** text, some _italic_ text and a [link](/)
![img alt](/img/docusaurus.png)

My Doc Section

Hello world message with some bold text, some italic text and a link

img alt

Quotes#

Markdown quotes are beautifully styled:

> This is a quote

This is a quote

Details#

Markdown can embed HTML elements, and details HTML elements are beautifully styled:

### Details element example
<details>  <summary>Toggle me!</summary>  <div>    <div>This is the detailed content</div>    <details>      <summary>        <div>Nested toggle!</div>        <div>Some surprise inside...</div>      </summary>      <div>        😲😲😲😲😲      </div>    </details>  </div></details>

Details element example

Toggle me!
This is the detailed content
Nested toggle!
Some surprise inside...
😲😲😲😲😲

note

In practice, those are not really HTML elements, but React JSX elements, which we'll cover next!