Skip to content

Commit aea84aa

Browse files
committed
docs: updated structure and links
1 parent 87f828e commit aea84aa

6 files changed

Lines changed: 23 additions & 8 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@ export default defineConfig({
1818
description: 'A collection of diverse documentation engineering tools',
1919
themeConfig: {
2020
nav: [
21-
{ text: 'Home', link: '/pages/en/' },
21+
{ text: 'Guide', link: '/pages/en/guide/getting-started' },
2222
],
2323
sidebar: [
24+
{
25+
text: 'Introduction',
26+
items: [
27+
{ text: 'Getting Started', link: '/pages/en/guide/getting-started' },
28+
],
29+
},
2430
{
2531
text: 'Markdown It Plugins',
2632
items: [
@@ -38,9 +44,15 @@ export default defineConfig({
3844
description: '多元化的文档工程工具合集',
3945
themeConfig: {
4046
nav: [
41-
{ text: '首页', link: '/pages/zh-CN/' },
47+
{ text: '指南', link: '/pages/zh-CN/guide/getting-started' },
4248
],
4349
sidebar: [
50+
{
51+
text: '介绍',
52+
items: [
53+
{ text: '开始', link: '/pages/zh-CN/guide/getting-started' },
54+
],
55+
},
4456
{
4557
text: 'Markdown It 插件',
4658
items: [

docs/pages/en/getting-started.md

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Getting Started

docs/pages/zh-CN/getting-started.md

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 开始

docs/pages/zh-CN/plugins/markdown-it-bi-directional-links/index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ yarn add @nolebase/markdown-it-bi-directional-links
2323
然后先在 [`markdown-it`](https://github.com/markdown-it/markdown-it) 的实例可被访问的地方先使用 `import` 语句将双向链接插件导入到文件中:
2424

2525
```typescript
26-
import MarkdownItBiDirectionalLinks from '@nolebase/markdown-it-bi-directional-links' // [!code ++]
26+
import MarkdownItBiDirectionalLinks from '@nolebase/markdown-it-bi-directional-links' // [!code ++]
2727
```
2828
2929
然后使用 `markdown-it` 实例的 `use()` 函数将导入后的 `MarkdownItBiDirectionalLinks` 作为插件使用:
@@ -33,19 +33,20 @@ import MarkdownItBiDirectionalLinks from '@nolebase/markdown-it-bi-directional-l
3333

3434
// 中间剩余的其他代码...
3535

36-
markdownIt.use(MarkdownItBiDirectionalLinks()) // [!code ++]
36+
markdownIt.use(MarkdownItBiDirectionalLinks()) // [!code ++]
3737
```
3838

39-
`MarkdownItBiDirectionalLinks()` 函数中,你需要提供一个必填的选项对象,该对象中的 `dir` 字段通常可以直接通过 `import` 语句导入 `process` 或者 `node:process` 之后的 `cwd()` 函数来获取:
39+
`MarkdownItBiDirectionalLinks()` 函数中,你必须提供一个包含有 `dir` 字段的对象作为配置选项,这个所谓的 `dir` 字段通常可以直接通过 `import` 语句导入来自 `process` 或者 `node:process` 包内的 `cwd()` 函数来获取:
4040

4141
```typescript
4242
import MarkdownItBiDirectionalLinks from '@nolebase/markdown-it-bi-directional-links'
43+
import { cwd } from 'process' // [!code ++]
4344
4445
// 中间剩余的其他代码...
4546

46-
markdownIt.use(MarkdownItBiDirectionalLinks({
47-
dir: process.cwd() // [!code ++]
48-
}))
47+
markdownIt.use(MarkdownItBiDirectionalLinks({ // [!code ++]
48+
dir: process.cwd() // [!code ++]
49+
})) // [!code ++]
4950
```
5051

5152
## 用法示例

0 commit comments

Comments
 (0)