Skip to content

Commit 3737f3d

Browse files
ffxingyuefeng
authored andcommitted
docs: 修改文档预览
1 parent ebd15a2 commit 3737f3d

File tree

28 files changed

+111
-280
lines changed

28 files changed

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

3-
export default class Page extends Markdown {
4-
path = '/packages/core/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/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+
6+
export default Demo;
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 '@uiw/react-native/lib/Avatar/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/Avatar/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/Avatar/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;
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 '@uiw/react-native/lib/Badge/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/Badge/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/Badge/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;
Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
// import Markdown, { importAll } from '../../../component/Markdown';
21
import Preview from 'src/component/Preview';
32
import md from '@uiw/react-native/lib/Button/README.md';
43

54
const DEMO = () => <Preview {...md} />;
65
export default DEMO;
7-
// export default class Page extends Markdown {
8-
// path = '/packages/core/src/Button/README.md';
9-
// getMarkdown = async () => {
10-
// const md = await import('@uiw/react-native/lib/Button/README.md');
11-
// // 支持 markdown 中,相对于当前 index.tsx 相对路径引入图片资源
12-
// importAll((require as any).context('./', true, /\.(png|gif|jpg|svg)$/), this.imageFiles);
13-
// return md.default || md;
14-
// };
15-
// }
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 '@uiw/react-native/lib/ButtonGroup/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/ButtonGroup/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/ButtonGroup/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;
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 '@uiw/react-native/lib/Calendar/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/Calendar/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/Calendar/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;
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 '@uiw/react-native/lib/CardCollapse/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/CardCollapse/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/CardCollapse/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;
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 '@uiw/react-native/lib/CheckBox/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/CheckBox/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/CheckBox/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;
Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import Markdown, { importAll } from '../../../component/Markdown';
1+
import Preview from 'src/component/Preview';
2+
import md from '@uiw/react-native/lib/Divider/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/Divider/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/Divider/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+
6+
export default Demo;
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 '@uiw/react-native/lib/Drawer/README.md';
23

3-
export default class Page extends Markdown {
4-
path = '/packages/core/src/Drawer/README.md';
5-
getMarkdown = async () => {
6-
const md = await import('@uiw/react-native/lib/Drawer/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)