doc-render-sdk 0.0.7 → 0.0.8
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/README.md +11 -51
- package/bin/doc-render-sdk.js +1 -1
- package/dist/index.d.mts +6 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,55 +13,30 @@
|
|
|
13
13
|
- 🎯 **插件系统** - 支持自定义插件扩展功能
|
|
14
14
|
- 📦 **零配置** - 开箱即用,同时支持深度定制
|
|
15
15
|
|
|
16
|
-
## 快速开始
|
|
16
|
+
## 🚀 快速开始
|
|
17
17
|
|
|
18
|
-
###
|
|
18
|
+
### 1. CLI 工具
|
|
19
19
|
|
|
20
20
|
```bash
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
### 基本使用
|
|
21
|
+
# 创建新项目
|
|
22
|
+
npx doc-render-sdk create my-docs
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
# 启动开发服务器
|
|
25
|
+
npx doc-render-sdk dev
|
|
28
26
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
theme: 'default',
|
|
32
|
-
components: {
|
|
33
|
-
'my-component': {
|
|
34
|
-
label: '我的组件',
|
|
35
|
-
demos: [
|
|
36
|
-
{
|
|
37
|
-
title: '基础用法',
|
|
38
|
-
desc: '组件的基础使用方式',
|
|
39
|
-
source: 'basic'
|
|
40
|
-
}
|
|
41
|
-
],
|
|
42
|
-
apis: [
|
|
43
|
-
{
|
|
44
|
-
title: 'MyComponent',
|
|
45
|
-
apiKey: 'my-component'
|
|
46
|
-
}
|
|
47
|
-
]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
});
|
|
27
|
+
# 构建项目
|
|
28
|
+
npx doc-render-sdk build
|
|
51
29
|
|
|
52
|
-
|
|
30
|
+
# 迁移旧项目
|
|
31
|
+
npx doc-render-sdk migrate --source ./doc --target ./docs-new
|
|
53
32
|
```
|
|
54
33
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
### 安装
|
|
34
|
+
### 2. 安装
|
|
58
35
|
|
|
59
36
|
```bash
|
|
60
37
|
npm install doc-render-sdk
|
|
61
38
|
```
|
|
62
39
|
|
|
63
|
-
### 基本使用
|
|
64
|
-
|
|
65
40
|
```javascript
|
|
66
41
|
import DocSDK from 'doc-render-sdk';
|
|
67
42
|
|
|
@@ -90,21 +65,6 @@ const docSdk = new DocSDK({
|
|
|
90
65
|
docSdk.render('#app');
|
|
91
66
|
```
|
|
92
67
|
|
|
93
|
-
### CLI 工具 (待支持)
|
|
94
|
-
|
|
95
|
-
```bash
|
|
96
|
-
# 创建新项目
|
|
97
|
-
npx doc-render-sdk create my-docs
|
|
98
|
-
|
|
99
|
-
# 启动开发服务器
|
|
100
|
-
npx doc-render-sdk dev
|
|
101
|
-
|
|
102
|
-
# 构建项目
|
|
103
|
-
npx doc-render-sdk build
|
|
104
|
-
|
|
105
|
-
# 迁移旧项目
|
|
106
|
-
npx doc-render-sdk migrate --source ./doc --target ./docs-new
|
|
107
|
-
```
|
|
108
68
|
|
|
109
69
|
## 📚 详细文档
|
|
110
70
|
|
package/bin/doc-render-sdk.js
CHANGED
|
@@ -210,7 +210,7 @@ const docSdk = new DocSDK(config);
|
|
|
210
210
|
docSdk.render('#app');
|
|
211
211
|
`;
|
|
212
212
|
|
|
213
|
-
fs.writeFileSync(path.join(projectDir, 'index.
|
|
213
|
+
fs.writeFileSync(path.join(projectDir, 'index.jsx'), indexJs);
|
|
214
214
|
|
|
215
215
|
// 生成HTML文件
|
|
216
216
|
const indexHtml = `<!DOCTYPE html>
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType, ReactNode } from "react";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/core/PluginManager.d.ts
|
|
5
5
|
/**
|
|
@@ -572,7 +572,7 @@ declare const Layout: ({
|
|
|
572
572
|
routerManager: any;
|
|
573
573
|
componentRegistry: any;
|
|
574
574
|
onRouteChange: any;
|
|
575
|
-
}) =>
|
|
575
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/components/Navigation.d.ts
|
|
578
578
|
/**
|
|
@@ -592,7 +592,7 @@ declare const Navigation: ({
|
|
|
592
592
|
componentRegistry: any;
|
|
593
593
|
onNavigate: any;
|
|
594
594
|
compact?: boolean | undefined;
|
|
595
|
-
}) =>
|
|
595
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
596
596
|
//#endregion
|
|
597
597
|
//#region src/components/Demo.d.ts
|
|
598
598
|
/**
|
|
@@ -610,7 +610,7 @@ declare const Demo: ({
|
|
|
610
610
|
config: any;
|
|
611
611
|
theme: any;
|
|
612
612
|
renderer: any;
|
|
613
|
-
}) =>
|
|
613
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
614
614
|
//#endregion
|
|
615
615
|
//#region src/components/ApiDoc.d.ts
|
|
616
616
|
/**
|
|
@@ -626,7 +626,7 @@ declare const ApiDoc: ({
|
|
|
626
626
|
componentId: any;
|
|
627
627
|
config: any;
|
|
628
628
|
theme: any;
|
|
629
|
-
}) =>
|
|
629
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
630
630
|
//#endregion
|
|
631
631
|
//#region src/components/CodeBlock.d.ts
|
|
632
632
|
/**
|
|
@@ -646,7 +646,7 @@ declare const CodeBlock: ({
|
|
|
646
646
|
showLineNumbers?: boolean | undefined;
|
|
647
647
|
highlightLines?: never[] | undefined;
|
|
648
648
|
className?: string | undefined;
|
|
649
|
-
}) =>
|
|
649
|
+
}) => react_jsx_runtime0.JSX.Element;
|
|
650
650
|
//#endregion
|
|
651
651
|
//#region src/index.d.ts
|
|
652
652
|
declare class DocSDK {
|