Skip to content

Commit 0587b2a

Browse files
committed
Update README
- Add title image - Add credits - Improved guide
1 parent aa6cfb0 commit 0587b2a

File tree

3 files changed

+234
-986
lines changed

3 files changed

+234
-986
lines changed

README.md

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,31 @@
1-
# react-notion
1+
![react-notion](https://user-images.githubusercontent.com/1440854/79683820-e4fa4400-822c-11ea-9ffb-f4d185b57ca8.png)
22

3-
Renders your Notion blocks with ease.
3+
An (unofficial) React renderer for Notion pages. It is written in TypeScript. Use it for blogs, documentations or personal sites, while we wait for the official API.
4+
5+
This packages does not include an API wrapper. You can find some interesting projects here: [notionapi-agent](https://github.com/dragonman225/notionapi-agent)
46

57
## Install
68

79
```bash
810
npm install react-notion
911
```
1012

11-
If you use code blocks and want syntax highlighting, install `primsjs`.
12-
13-
```bash
14-
npm install prismjs
15-
```
16-
1713
## How to use
1814

1915
```js
2016
import { NotionRenderer } from "react-notion";
2117
import "react-notion/src/styles.css";
2218

2319
import "prismjs/themes/prism-tomorrow.css"; // only needed if you use Code Blocks
24-
```
2520

26-
### Example
27-
28-
```js
29-
const Page = ({ page }) => {
30-
if (!page) return null;
31-
32-
return (
33-
<div className="notion" style={{ maxWidth: 768, color: "rgb(55, 53, 47)" }}>
34-
<NotionRenderer blockMap={blockMap} />
35-
</div>
36-
);
37-
};
38-
export default Page;
21+
export default () => (
22+
<div style={{ maxWidth: 768 }}>
23+
<NotionRenderer blockMap={blockMap} />
24+
</div>
25+
);
3926
```
4027

41-
Example Next.JS using react-notion can be found in folder `/example`
28+
A working example, built with Next.js, can be found inside the `example` directory.
4229

4330
## Currently supported block types:
4431

@@ -53,10 +40,19 @@ Example Next.JS using react-notion can be found in folder `/example`
5340
- [x] iFrames
5441
- [x] Videos
5542
- [x] Divider
56-
- [x] Callouts
43+
- [x] Callout
5744
- [x] Image Captions
5845

5946
Missing
6047

6148
- [ ] Checkboxes
6249
- [ ] Toggle Lists
50+
51+
## Detailed Guide
52+
53+
Can be found on the Splitbee Blog - [Notion as a CMS using Next.JS](https://splitbee.io/blog/notion-as-cms-using-nextjs)
54+
55+
## Credits
56+
57+
- [Timo Lins](https://timo.sh) – Helped building this package
58+
- [samwightt](https://github.com/samwightt) – Inspiration & API Typings

0 commit comments

Comments
 (0)