Skip to content

Commit

Permalink
docs: add math & multi-file demo example
Browse files Browse the repository at this point in the history
  • Loading branch information
PeachScript committed Apr 21, 2020
1 parent b5fd437 commit 164560a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 8 deletions.
7 changes: 7 additions & 0 deletions docs/demo/modal-content.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default () => (
<>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
</>
);
7 changes: 4 additions & 3 deletions docs/demo/modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

import React from 'react';
import { Button, Modal } from 'antd';
import ModalContent from './modal-content';
import './modal.less';

class App extends React.Component {
state = { visible: false };
Expand Down Expand Up @@ -40,10 +42,9 @@ class App extends React.Component {
visible={this.state.visible}
onOk={this.handleOk}
onCancel={this.handleCancel}
className="example-modal-content"
>
<p>Some contents...</p>
<p>Some contents...</p>
<p>Some contents...</p>
<ModalContent />
</Modal>
</div>
);
Expand Down
3 changes: 3 additions & 0 deletions docs/demo/modal.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.example-modal-content {
color: #f60;
}
20 changes: 15 additions & 5 deletions docs/examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ toc: menu

此页面列举了 dumi 渲染各项 Markdown 样式以及 Demo 的效果。

## Demo 嵌入
## 渲染 Demo

### 代码块嵌入

```jsx
import React from 'react';
Expand All @@ -20,14 +22,14 @@ import { Button } from 'antd';
export default () => <Button type="primary">我是 antd 的按钮</Button>;
```

## 外部 Demo

<code src="./demo/modal.jsx" />

## TS 转 JS

<code src="./demo/typescript.tsx" />

## 多文件依赖

<code src="./demo/modal.jsx" />

# 一级标题

## 二级标题
Expand Down Expand Up @@ -88,6 +90,14 @@ _斜体样式_
console.log('Hello World!');
```

## 数学公式

Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.

$$
L = \frac{1}{2} \rho v^2 S C_L
$$

## 表格

| 名词 | 解释 |
Expand Down

0 comments on commit 164560a

Please sign in to comment.