Skip to content

Commit e4b58de

Browse files
committed
docs: update readme
1 parent 021b093 commit e4b58de

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# react-code-view
1+
# React Code View
22

3-
`react-code-view` is a React component based on `codemirror` and `marked`. It enables `jsx` code in `markdown` to be rendered to the page.
3+
**React Code View** can render source code in markdown documents. And brings you the ability to render React components with editable source code and live preview.
44

5-
![preview](https://user-images.githubusercontent.com/1203827/44707274-a30c0f80-aad6-11e8-8cc5-9cf7daf4d9e2.gif)
5+
![React Code View](https://user-images.githubusercontent.com/1203827/178659124-f4a8658f-1087-4c55-b89b-04dcfc5568cb.gif)
66

77
## Install
88

docs/example.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
---
44

5-
`react-code-view` is a React component based on `codemirror` and `marked`. It enables `jsx` code in `markdown` to be rendered to the page.
5+
**React Code View** can render source code in markdown documents. And brings you the ability to render React components with editable source code and live preview.
66

77
## Install
88

@@ -30,14 +30,20 @@ return <CodeView dependencies={{ Button }}>{require('./example.md')}</CodeView>;
3030
<!--start-code-->
3131

3232
```js
33-
// example.md
34-
3533
import React from 'react';
3634
import ReactDOM from 'react-dom';
3735
import { Button } from 'rsuite';
3836

3937
const App = () => {
40-
return <Button>First example</Button>;
38+
const [count, setCount] = React.useState(1);
39+
40+
return (
41+
<>
42+
<Button onClick={() => setCount(count + 1)}>
43+
<span></span> Star {count}
44+
</Button>
45+
</>
46+
);
4147
};
4248

4349
ReactDOM.render(<App />);

docs/styles/index.less

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,9 @@
1313
--rs-border-primary: #e5e5ea;
1414
--rs-text-primary: #575757;
1515
}
16+
17+
.rcv-render,
18+
.react-code-view-error {
19+
min-height: 60px;
20+
margin: 0;
21+
}

0 commit comments

Comments
 (0)