创建文档

优质
小牛编辑
119浏览
2023-12-01

创建 markdown 文档,文件名为 greeting.md,并将该文档放置于 docs 目录下。

website # 网站根目录
├── docs
│   └── greeting.md
├── src
│   └── pages
├── docusaurus.config.js
├── ...

在文档顶部的 front matter 中设置 idtitle 属性,以便 Docusaurus 在生成您的网站时能够正确地识别该文件。

---
id: greeting
title: Hello
---
## 来自 Docusaurus 的问候
您准备好为您的开源项目创建文档站点了吗?
### 标题
标题将显示在右上方的目录中
以便用户无需向下滚动,甚至无需阅读更多内容,便可了解此页的梗概。
### 只有 h2 和 h3 标签作为目录展示
良好的标题间距,让文章结构更清晰。
- lists will help you
- present the key points
- that you want your users to remember
  - and you may nest them
    - multiple times
### Custom id headers {#custom-id}
With `{#custom-id}` syntax you can set your own header id.

在浏览器中的渲染效果如下:This will render in the browser as follows:

http://localhost:3000

来自 Docusaurus 的问候

您准备好为您的开源项目创建文档站点了吗?

标题

标题将显示在右上方的目录中

以便用户无需向下滚动,甚至无需阅读更多内容,便可了解此页的梗概。

只有 h2 和 h3 标签作为目录展示

良好的标题间距,让文章结构更清晰。

  • lists will help you
  • present the key points
  • that you want your users to remember
    • and you may nest them
      • multiple times