Skip to content

Commit 42a0721

Browse files
move katex back to a non-peer dep
1 parent d0f9b25 commit 42a0721

File tree

7 files changed

+16
-58
lines changed

7 files changed

+16
-58
lines changed

examples/full/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"dependencies": {
1616
"@notionhq/client": "^1.0.4",
1717
"got": "^12.0.2",
18-
"katex": "^0.15.3",
1918
"lqip-modern": "^1.2.0",
2019
"next": "^12.1.0",
2120
"notion-client": "^6.10.0",

packages/notion-client/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const colectionData = await api.getCollectionData(
3636
)
3737
```
3838

39+
## Docs
40+
41+
See the [full docs](https://github.com/NotionX/react-notion-x).
42+
3943
## License
4044

4145
MIT © [Travis Fischer](https://transitivebullsh.it)

packages/notion-types/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ This package only exports types and is compatible with both Node.js and browsers
2222
import * as notion from 'notion-types'
2323
```
2424

25+
## Docs
26+
27+
See the [full docs](https://github.com/NotionX/react-notion-x).
28+
2529
## License
2630

2731
MIT © [Travis Fischer](https://transitivebullsh.it)

packages/notion-utils/readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ parsePageId('About-d9ae0c6e7cad49a78e21d240cf2e3d04', { uuid: false })
3333
// 'd9ae0c6e7cad49a78e21d240cf2e3d04'
3434
```
3535

36+
## Docs
37+
38+
See the [full docs](https://github.com/NotionX/react-notion-x).
39+
3640
## License
3741

3842
MIT © [Travis Fischer](https://transitivebullsh.it)

packages/react-notion-x/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@fisch0920/medium-zoom": "^1.0.7",
2626
"@matejmazur/react-katex": "^3.1.3",
2727
"@radix-ui/react-dropdown-menu": "^0.1.6",
28+
"katex": "^0.15.3",
2829
"notion-types": "^6.9.4",
2930
"notion-utils": "^6.10.0",
3031
"prismjs": "^1.27.0",
@@ -48,13 +49,7 @@
4849
"react-dom": "^17.0.2"
4950
},
5051
"peerDependencies": {
51-
"katex": "^0.13.18",
5252
"react": ">=16",
5353
"react-dom": ">=16"
54-
},
55-
"peerDependenciesMeta": {
56-
"katex": {
57-
"optional": true
58-
}
5954
}
6055
}

packages/react-notion-x/readme.md

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,57 +8,9 @@
88
99
[![NPM](https://img.shields.io/npm/v/react-notion-x.svg)](https://www.npmjs.com/package/react-notion-x) [![Build Status](https://github.com/NotionX/react-notion-x/actions/workflows/test.yml/badge.svg)](https://github.com/NotionX/react-notion-x/actions/workflows/test.yml) [![Prettier Code Formatting](https://img.shields.io/badge/code_style-prettier-brightgreen.svg)](https://prettier.io)
1010

11-
## Install
11+
## Docs
1212

13-
```bash
14-
npm install react-notion-x
15-
```
16-
17-
## Usage
18-
19-
First you'll want to fetch the content for a Notion page:
20-
21-
```ts
22-
import { NotionAPI } from 'notion-client'
23-
24-
const api = new NotionAPI()
25-
26-
// fetch the page's content, including all async blocks, collection queries, and signed urls
27-
const recordMap = await api.getPage('067dd719a912471ea9a3ac10710e7fdf')
28-
```
29-
30-
Once you have the data for a Notion page, you can render it:
31-
32-
```tsx
33-
import * as React from 'react'
34-
import { NotionRenderer } from 'react-notion-x'
35-
36-
export default ExampleNotionPage({ recordMap }) => (
37-
<NotionRenderer
38-
recordMap={recordMap}
39-
fullPage={true}
40-
darkMode={false}
41-
/>
42-
)
43-
```
44-
45-
## Styles
46-
47-
You'll need to import some CSS styles as well. If you're using Next.js, we recommend you put these in `pages/_app.js`:
48-
49-
```ts
50-
// core styles shared by all of react-notion-x (required)
51-
import 'react-notion-x/src/styles.css'
52-
53-
// used for code syntax highlighting (optional)
54-
import 'prismjs/themes/prism-tomorrow.css'
55-
56-
// used for collection views (optional)
57-
import 'rc-dropdown/assets/index.css'
58-
59-
// used for rendering equations (optional)
60-
import 'katex/dist/katex.min.css'
61-
```
13+
See the [full docs](https://github.com/NotionX/react-notion-x).
6214

6315
## License
6416

readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export default ({ recordMap }) => (
153153

154154
The `Code` component uses [Prism]() under the hood. It comes bundled with support for JavaScript, TypeScript, and CSS by default. To add support for additional language syntaxes, follow the example in [`components/NotionPage.tsx`](./examples/full/components/NotionPage.tsx) which lazily loads Prism components at runtime.
155155

156-
For `Equation` support, you need to manually add `katex` as a dependency to your project (`yarn add katex` or `npm install katex`). You'll also need to import the katex CSS styles.
156+
For `Equation` support, you'll need to import the katex CSS styles.
157157

158158
For each of these optional components, make sure you're also importing the relevant third-party CSS if needed ([above](#Styles)).
159159

0 commit comments

Comments
 (0)