Skip to content

Commit 5466d16

Browse files
SunLxyxingyuefeng
authored andcommitted
doc:更新快速上手文档
1 parent 6e42da3 commit 5466d16

File tree

3 files changed

+24
-11
lines changed

3 files changed

+24
-11
lines changed

packages/core/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ yarn run lib:watch:type # Output type file d.ts
8787
yarn run start # Run the preview document website locally
8888
```
8989

90-
## 本地文档预览
90+
## 文档本地预览
9191

9292
**第一步安装文档包和预览工具**
9393

website/src/pages/docs/getting-started/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,25 @@ npx react-native init AwesomeProject --template @uiw/react-native-template
3838
```bash
3939
yarn add @uiw/react-native react-native-svg react-native-root-siblings
4040
```
41+
## 文档本地预览
42+
43+
**第一步安装文档包和预览工具**
44+
45+
```bash
46+
npm install @uiw/react-native-doc @kkt/doc -D # yarn add @uiw/react-native-doc @kkt/doc -D
47+
```
48+
49+
**第二步配置命令**
50+
51+
`package.json`文件中配置命令
52+
53+
```json
54+
// ...
55+
"scripts":{
56+
"doc":"kktd @uiw/react-native-doc/doc/build"
57+
}
58+
```
59+
4160

4261
## Basic Usage
4362

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
1-
import Markdown, { importAll } from '../../../component/Markdown';
1+
import Preview from 'src/component/Preview';
2+
import md from './README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/website/src/pages/docs/getting-started/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('./README.md');
7-
// 支持 markdown 中,相对于当前 index.tsx 相对路径引入图片资源
8-
importAll((require as any).context('./', true, /\.(png|gif|jpg|svg)$/), this.imageFiles);
9-
return md.default || md;
10-
};
11-
}
4+
const DEMO = () => <Preview {...md} />;
5+
export default DEMO;

0 commit comments

Comments
 (0)