File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change 5555 <NotionDecorator :content =" nextContent" v-bind =" pass" />
5656 </s >
5757 <component
58- v-else-if =" decoratorKey === 'e'"
58+ v-else-if =" decoratorKey === 'e' && katex "
5959 :is =" 'katex-element'"
6060 :expression =" decoratorValue"
6161 />
62+ <code v-else-if =" decoratorKey === 'e'" class =" notion-inline-code" >
63+ <NotionDecorator :content =" nextContent" v-bind =" pass" />
64+ </code >
6265 <NotionDecorator v-else :content =" nextContent" v-bind =" pass" />
6366</template >
6467
Original file line number Diff line number Diff line change 1+ <template >
2+ <div v-if =" katex" >
3+ <KatexElement :expression =" equation" />
4+ </div >
5+ <pre v-else-if =" prism && supported" :class =" ['notion-code', langClass]" >
6+ <PrismComponent :language =" lang" >{{ equation }}</PrismComponent >
7+ </pre >
8+ <pre v-else :class =" ['notion-code', langClass]" >
9+ <code :class =" langClass" >{{ equation }}</code >
10+ </pre >
11+ </template >
12+
13+ <script >
14+ import KatexElement from " vue-katex" ;
15+ import Blockable , { blockComputed } from " @/lib/blockable" ;
16+
17+ export default {
18+ extends: Blockable,
19+ name: " NotionCode" ,
20+ components: { KatexElement },
21+ data () {
22+ return { Prism, lang: " latex" , langClass: " language-latex" };
23+ },
24+ computed: {
25+ ... blockComputed,
26+ equation () {
27+ return this .properties ? .title ? .[0 ]? .[0 ];
28+ },
29+ },
30+ };
31+ < / script>
Original file line number Diff line number Diff line change 99 <NotionBookmark v-else-if =" isType('bookmark')" v-bind =" pass" />
1010 <NotionCallout v-else-if =" isType('callout')" v-bind =" pass" />
1111 <NotionCode v-else-if =" isType('code')" v-bind =" pass" />
12+ <NotionEquation v-else-if =" isType('equation')" v-bind =" pass" />
1213 <NotionText v-else-if =" isType('text')" v-bind =" pass" />
1314 <NotionQuote v-else-if =" isType('quote')" v-bind =" pass" />
1415 <NotionToggle v-else-if =" isType('toggle')" v-bind =" pass" >
@@ -49,6 +50,7 @@ import NotionHeader from "@/blocks/header";
4950import NotionText from " @/blocks/text" ;
5051import NotionToggle from " @/blocks/toggle" ;
5152import NotionQuote from " @/blocks/quote" ;
53+ import NotionEquation from " @/blocks/equation" ;
5254
5355export default {
5456 extends: Blockable,
@@ -65,6 +67,7 @@ export default {
6567 NotionText,
6668 NotionToggle,
6769 NotionQuote,
70+ NotionEquation,
6871 },
6972};
7073 </script >
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ export const blockProps = {
1212 pageLinkOptions : Object ,
1313 pageLinkTarget : { type : String , default : "_self" } ,
1414 prism : { type : Boolean , default : false } ,
15+ katex : { type : Boolean , default : false } ,
1516 textLinkTarget : { type : String , default : "_blank" } ,
1617 todo : { type : Boolean , default : false } ,
1718} ;
@@ -30,6 +31,7 @@ export const blockComputed = {
3031 mapPageUrl : this . mapPageUrl ,
3132 pageLinkOptions : this . pageLinkOptions ,
3233 prism : this . prism ,
34+ katex : this . katex ,
3335 todo : this . todo ,
3436 } ;
3537 } ,
You can’t perform that action at this time.
0 commit comments