Skip to content

Commit a391ca2

Browse files
committed
Merge branch 'main' into feat/video
2 parents 2d0a456 + 9992865 commit a391ca2

File tree

16 files changed

+274
-207
lines changed

16 files changed

+274
-207
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"js-yaml": "^4.1.1",
5353
"minimatch": "^10.1.1",
5454
"nuxt-component-meta": "^0.15.0",
55+
"shiki": "^3.19.0",
5556
"unstorage": "1.17.1"
5657
},
5758
"devDependencies": {

pnpm-lock.yaml

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

src/app/src/components/content/ContentEditorTipTap.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ watch(() => `${document.value?.id}-${props.draftItem.version}-${props.draftItem.
7575
watch(tiptapJSON, async (json) => {
7676
const cleanedTiptap = removeLastEmptyParagraph(json!)
7777
78-
const { body, data } = await tiptapToMDC(cleanedTiptap)
78+
const { body, data } = await tiptapToMDC(cleanedTiptap, {
79+
highlightTheme: host.meta.getHighlightTheme(),
80+
})
7981
8082
const compressedBody: MarkdownRoot = compressTree(body)
8183
const toc: Toc = generateToc(body, { searchDepth: 2, depth: 2 } as Toc)

src/app/src/types/content.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
export interface MarkdownParsingOptions {
22
compress?: boolean
33
}
4+
5+
export interface SyntaxHighlightTheme {
6+
default: string
7+
dark?: string
8+
light?: string
9+
}

src/app/src/types/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { RouteLocationNormalized } from 'vue-router'
44
import type { MediaItem } from './media'
55
import type { Repository } from './git'
66
import type { ComponentMeta } from './component'
7-
import type { MarkdownParsingOptions } from './content'
7+
import type { MarkdownParsingOptions, SyntaxHighlightTheme } from './content'
88

99
export * from './file'
1010
export * from './item'
@@ -24,6 +24,7 @@ export interface StudioHost {
2424
dev: boolean
2525
getComponents: () => ComponentMeta[]
2626
defaultLocale: string
27+
getHighlightTheme: () => SyntaxHighlightTheme
2728
}
2829
on: {
2930
routeChange: (fn: (to: RouteLocationNormalized, from: RouteLocationNormalized) => void) => void

0 commit comments

Comments
 (0)