Skip to content

Commit 55a85e0

Browse files
committed
Merge branch 'main' of https://github.com/rylax/vue-notion into main
2 parents 65f3425 + 5368e88 commit 55a85e0

File tree

17 files changed

+171
-56
lines changed

17 files changed

+171
-56
lines changed

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
A Vue renderer for Notion pages.
3636
Use Notion as CMS for your blog, documentation or personal site.
3737

38-
vue-notion was ported to Vue from [react-notion](https://github.com/splitbee/react-notion) (developed by [Splitbee 🐝](https://splitbee.io/) – a fast, reliable, free, and modern analytics for any team)
38+
Also check out [react-notion](https://github.com/splitbee/react-notion) (developed by [Splitbee 🐝](https://splitbee.io/) – a fast, reliable, free, and modern analytics for any team)
3939

4040
This package doesn't handle the communication with the API. Check out [notion-api-worker](https://github.com/splitbee/notion-api-worker) from [Splitbee](https://splitbee.io/) for an easy solution.
4141

@@ -150,16 +150,16 @@ export default {
150150
</style>
151151
```
152152

153-
## Issues & Roadmap
154-
155-
[Add issues](https://github.com/janniks/vue-notion/issues/new) and request features that you want to see implemented next!
156-
157-
## Sites using vue-notion
153+
## Sites using vue-notion 🌎
158154

159155
List of pages that are using this library.
160156

157+
- [HelpKit](https://www.helpkit.so) — Build Knowledge Bases in Notion
161158
- [StorePreviewer](https://www.storepreviewer.com) — Preview and optimize your app store presence
162159
- [Dominik Sobe's Personal Site](https://dominiksobe.com/)
160+
- [Bersihin Tech](https://tech.bersihin.co/)
161+
- [Wisata Diary](https://wisatabook.com/diary)
162+
- [AymaneMx's Blog](https://aymanemx.com/posts/)
163163
- _...if you're using `vue-notion`, we'd be happy to feature you here_
164164

165165
## Supported Blocks
@@ -187,8 +187,8 @@ Most common block types are supported. We happily accept pull requests to add su
187187
| Page Links | ✅ Yes | |
188188
| Cover | ✅ Yes | Enable with `fullPage` |
189189
| Equations | ✅ Yes | |
190+
| Checkbox | ✅ Yes | |
190191
| Databases | ❌ Not planned | |
191-
| Checkbox | ❌ Not planned | |
192192
| Table Of Contents | ❌ Not planned | |
193193

194194
Please, feel free to [open an issue](https://github.com/janniks/vue-notion/issues/new) if you notice any important blocks missing or anything wrong with existing blocks.

dev/serve.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import Dev from "./serve.vue";
33

44
import VueKatex from "vue-katex";
55

6-
Vue.config.productionTip = false;
7-
86
Vue.use(VueKatex);
97

8+
Vue.config.productionTip = false;
9+
1010
new Vue({
1111
render: (h) => h(Dev),
1212
}).$mount("#app");

dev/serve.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="app">
3-
<NotionRenderer :blockMap="blockMap" fullPage prism todo />
3+
<NotionRenderer :blockMap="blockMap" fullPage prism katex todo />
44
</div>
55
</template>
66

@@ -22,6 +22,7 @@ export default {
2222
async created() {
2323
// react-notion tester: 2e22de6b770e4166be301490f6ffd420
2424
// equation tester: 2a1d5226d68246deba627012081693f9
25+
// todo tester: 235057194b954a60ace89c052a65d102
2526
this.blockMap = await getPageBlocks("2e22de6b770e4166be301490f6ffd420");
2627
},
2728
};

docs/README.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ The `NotionRenderer` component offers a few properties
2323
- [`pageLinkOptions`](#pageLinkOptions) – default: `undefined`
2424
- [`pageLinkTarget`](#pageLinkTarget) – default: `"_self"`
2525
- [`prism`](#prism) – default: `false`
26+
- [`katex`](#katex) – default: `false`
2627
- [`textLinkTarget`](#textLinkTarget) – default: `"_blank"`
2728

2829
### `blockMap`: Object
@@ -94,6 +95,12 @@ pageLinkOptions: {
9495

9596
> Check the `docs#syntax-highlighting` section below for more details.
9697
98+
### `katex`: Boolean
99+
100+
– whether or not latex rendering using vue-katex should be activated.
101+
102+
> Check the `docs#equations` section below for more details.
103+
97104
### `textLinkTarget`: String
98105

99106
– the [target attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#attr-target) of links
@@ -141,6 +148,13 @@ import VueKatex from "vue-katex";
141148
Vue.use(VueKatex);
142149
```
143150

151+
- Add the `katex` flag to the `NotionRenderer`
152+
153+
```diff
154+
-<NotionRenderer :blockMap="blockMap" />
155+
+<NotionRenderer :blockMap="blockMap" katex />
156+
```
157+
144158
> For usage with Nuxt, look at the `/example` (`plugins` in `nuxt.config.js`, `plugins/vue-katex.js`)
145159
146160
## Notion API
@@ -155,8 +169,8 @@ Since, the endpoint is rate limited, please consider hosting your own instance (
155169
A custom endpoint URL can be passed to the methods as a second argument:
156170

157171
```js
158-
const blockMap = await getPageBlocks("PAGE_ID", "ENDPOINT_URL");
159-
const pageTable = await getPageTable("PAGE_ID", "ENDPOINT_URL");
172+
const blockMap = await getPageBlocks("PAGE_ID", "optional ENDPOINT_URL");
173+
const pageTable = await getPageTable("PAGE_ID", "optional ENDPOINT_URL");
160174
```
161175

162176
> Feel free to open an issue if something is unclear or additional documentation is needed...

example/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
"vue-katex": "^0.5.0"
1717
},
1818
"devDependencies": {
19-
"vue-notion": "^1.2.1"
19+
"vue-notion": "^1.3.0"
2020
}
2121
}

example/pages/_slug.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
:pageLinkOptions="pageLinkOptions"
55
fullPage
66
prism
7+
katex
78
/>
89
</template>
910

@@ -18,7 +19,9 @@ export default {
1819
};
1920
},
2021
async asyncData({ $notion, params, error }) {
21-
const pageTable = await $notion.getPageTable("10327f9074b7433aad577ccd0020e971");
22+
const pageTable = await $notion.getPageTable(
23+
"10327f9074b7433aad577ccd0020e971"
24+
);
2225
const page = pageTable.find(
2326
(item) => item.published && item.slug === params.slug
2427
);

example/pages/nuxt.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export default {
1010
const blockMap = await $notion.getPageBlocks(
1111
"8c1ab01960b049f6a282dda64a94afc7"
1212
);
13+
1314
return { blockMap };
1415
},
1516
};

example/pages/vue.vue

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
</template>
44

55
<script>
6+
import { NotionRenderer, getPageBlocks } from "vue-notion";
7+
68
export default {
9+
components: { NotionRenderer },
710
data: () => ({ blockMap: null }),
8-
async asyncData({ $notion }) {
11+
async created() {
912
// get Notion blocks from the API via a Notion pageId
10-
const blockMap = await $notion.getPageBlocks("8c1ab01960b049f6a282dda64a94afc7");
11-
12-
return { blockMap }
13+
this.blockMap = await getPageBlocks("8c1ab01960b049f6a282dda64a94afc7");
1314
},
1415
};
1516
</script>

package-lock.json

Lines changed: 26 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)