rspress-plugin-file-tree 0.1.1 → 0.1.3-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # rspress-plugin-file-tree
2
2
 
3
+ ## 0.1.3-beta.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [2891f27]
8
+ - rspress-plugin-devkit@0.1.3-beta.0
9
+
10
+ ## 0.1.2
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [932dbb7]
15
+ - rspress-plugin-devkit@0.1.2
16
+
17
+ ## 0.1.2-beta.0
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies [932dbb7]
22
+ - rspress-plugin-devkit@0.1.2-beta.0
23
+
3
24
  ## 0.1.1
4
25
 
5
26
  ### Patch Changes
package/README.md CHANGED
@@ -1,4 +1,6 @@
1
- # rspress-plugin-file-tree
1
+ # rspress-plugin-file-tree ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-file-tree)
2
+
3
+ [简体中文](./README.zh-CN.md)
2
4
 
3
5
  Rspress plugin that add file tree view support.
4
6
 
@@ -0,0 +1,86 @@
1
+ # rspress-plugin-file-tree ![NPM Version](https://img.shields.io/npm/v/rspress-plugin-file-tree)
2
+
3
+ [简体中文](./README.zh-CN.md)
4
+
5
+ 用于展示文件树的 Rspress 插件。
6
+
7
+ 使用 `tree` 语言的代码块来书写树形结构:
8
+
9
+ ````markdown
10
+ ```tree
11
+ .
12
+ ├── rspress.config.ts
13
+ ├── src
14
+ │ ├── components
15
+ │ │ ├── FileTreeRender.tsx
16
+ │ │ ├── Tree
17
+ │ │ │ ├── Expand.tsx
18
+ │ │ │ ├── FileIcon.tsx
19
+ │ │ │ ├── Tree.tsx
20
+ │ │ │ ├── TreeContext.tsx
21
+ │ │ │ ├── TreeFile.tsx
22
+ │ │ │ ├── TreeFolder.tsx
23
+ │ │ │ ├── TreeFolderIcon.tsx
24
+ │ │ │ ├── TreeIndents.tsx
25
+ │ │ │ ├── TreeStatusIcon.tsx
26
+ │ │ │ ├── index.less
27
+ │ │ │ └── index.tsx
28
+ │ │ ├── helpers.ts
29
+ │ │ └── presets.ts
30
+ │ ├── index.ts
31
+ │ └── parser.ts
32
+ └── tsconfig.json
33
+ ```
34
+ ````
35
+
36
+ 它将被渲染为:
37
+
38
+ <div align="center">
39
+ <img src="./image.png" alt="sample" width="400" height="300" />
40
+ </div>
41
+
42
+ > [!NOTE]
43
+ >
44
+ > **最终渲染的组件 fork 自 [witt](https://github.com/unix) 的 [Geist UI](https://geist-ui.dev/), 感谢他的贡献。**
45
+
46
+ ## 使用
47
+
48
+ ```bash
49
+ npm i rspress-plugin-file-tree
50
+ pnpm add rspress-plugin-file-tree
51
+ ```
52
+
53
+ ```ts
54
+ import * as path from 'path';
55
+ import { defineConfig } from 'rspress/config';
56
+ import fileTree from 'rspress-plugin-file-tree';
57
+
58
+ export default defineConfig({
59
+ root: path.join(__dirname, 'docs'),
60
+ plugins: [fileTree()],
61
+ });
62
+ ```
63
+
64
+ ## 配置
65
+
66
+ ## initialExpandDepth
67
+
68
+ 配置文件树的初始展开深度。
69
+
70
+ - Type: `number`
71
+ - Default: `0`
72
+
73
+ ```ts
74
+ import * as path from 'path';
75
+ import { defineConfig } from 'rspress/config';
76
+ import fileTree from 'rspress-plugin-file-tree';
77
+
78
+ export default defineConfig({
79
+ root: path.join(__dirname, 'docs'),
80
+ plugins: [
81
+ fileTree({
82
+ initialExpandDepth: Infinity,
83
+ }),
84
+ ],
85
+ });
86
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rspress-plugin-file-tree",
3
- "version": "0.1.1",
3
+ "version": "0.1.3-beta.0",
4
4
  "description": "Rspress plugin that add support for file tree component.",
5
5
  "keywords": [
6
6
  "rspress",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@rspress/shared": "^1.17.1",
28
- "rspress-plugin-devkit": "^0.1.1"
28
+ "rspress-plugin-devkit": "^0.1.3-beta.0"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@types/node": "^20.12.5",