Skip to content

Commit 82bd1cb

Browse files
committed
update exports
1 parent 44cdbb5 commit 82bd1cb

File tree

4 files changed

+38
-25
lines changed

4 files changed

+38
-25
lines changed

example/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313
"katex": "^0.15.2",
1414
"nuxt": "^2.15.8",
1515
"prismjs": "^1.27.0",
16-
"vue-katex": "^0.5.0",
17-
"vue-prism-component": "^1.2.0"
16+
"vue-katex": "^0.5.0"
1817
},
1918
"devDependencies": {
2019
"vue-notion": "^1.4.1"

example/plugins/custom-code.vue

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,30 @@
11
<template>
22
<pre
3-
:class="['notion-code', langClass]"
3+
class="notion-code-wrapper"
44
:style="{
55
border: '3px solid tomato',
66
}"
77
>
8-
<PrismComponent v-if="prism && supported" :language="lang">{{ properties.title[0][0] }}</PrismComponent>
9-
<code v-else :class="langClass">{{ properties.title[0][0] }}</code>
8+
<NotionCode v-bind="pass"/>
109
</pre>
1110
</template>
1211

1312
<script>
14-
import Prism from "prismjs";
15-
import PrismComponent from "vue-prism-component";
16-
17-
import { Blockable, blockComputed, blockProps } from "vue-notion";
13+
import { NotionCode, Blockable, blockComputed, blockProps } from "vue-notion";
1814
1915
export default {
2016
extends: Blockable,
2117
name: "CustomCode",
22-
components: { PrismComponent },
23-
props: { ...blockProps, overrideLang: String, overrideLangClass: String },
24-
data() {
25-
return { Prism };
18+
components: {
19+
NotionCode,
20+
},
21+
props: {
22+
...blockProps,
23+
//> your own additional props
2624
},
2725
computed: {
2826
...blockComputed,
29-
lang() {
30-
return (
31-
this.overrideLang || this.properties?.language?.[0]?.[0]?.toLowerCase()
32-
);
33-
},
34-
langClass() {
35-
return this.overrideLangClass || `language-${this.lang}`;
36-
},
37-
supported() {
38-
return this.Prism.languages[this.lang];
39-
},
27+
//> your own additional `computed` methods go here
4028
},
4129
};
4230
</script>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
],
1616
"scripts": {
1717
"serve": "vue-cli-service serve dev/serve.js",
18-
"example": "npm run example:install && cd example && npm run build && npm start",
18+
"example": "npm run example:generate && cd example && npm start",
1919
"example:install": "npm pack && cd example && npm install && npm install ../*.tgz",
2020
"example:generate": "npm run example:install && cd example && npm run build && npm run generate",
2121
"build": "cross-env NODE_ENV=production rollup --config build/rollup.config.js",

src/components/index.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,28 @@
11
/* eslint-disable import/prefer-default-export */
22
export { default as NotionRenderer } from "./notion-renderer.vue";
3+
4+
export { default as NotionBookmark } from "../blocks/bookmark.vue";
5+
export { default as NotionCallout } from "../blocks/callout.vue";
6+
export { default as NotionCode } from "../blocks/code.vue";
7+
export { default as NotionColumn } from "../blocks/column.vue";
8+
export { default as NotionDecorator } from "../blocks/decorator.vue";
9+
export { default as NotionEquation } from "../blocks/equation.vue";
10+
export { default as NotionHeader } from "../blocks/header.vue";
11+
export { default as NotionList } from "../blocks/list.vue";
12+
export { default as NotionPage } from "../blocks/page.vue";
13+
export { default as NotionQuote } from "../blocks/quote.vue";
14+
export { default as NotionTable } from "../blocks/table.vue";
15+
export { default as NotionTableRow } from "../blocks/table-row.vue";
16+
export { default as NotionText } from "../blocks/text.vue";
17+
export { default as NotionTodo } from "../blocks/todo.vue";
18+
export { default as NotionToggle } from "../blocks/toggle.vue";
19+
20+
export { default as NotionAsset } from "../blocks/helpers/asset.vue";
21+
export { default as NotionColumnSpacer } from "../blocks/helpers/column-spacer.vue";
22+
export { default as NotionFigure } from "../blocks/helpers/figure.vue";
23+
export { default as NotionFragment } from "../blocks/helpers/fragment.vue";
24+
export { default as NotionImage } from "../blocks/helpers/image.vue";
25+
export { default as NotionNestedList } from "../blocks/helpers/nested-list.vue";
26+
export { default as NotionPageHeader } from "../blocks/helpers/page-header.vue";
27+
export { default as NotionPageIcon } from "../blocks/helpers/page-icon.vue";
28+
export { default as NotionTextRenderer } from "../blocks/helpers/text-renderer.vue";

0 commit comments

Comments
 (0)