1
1
import rehypeShiki from '@stefanprobst/rehype-shiki'
2
- import type { FieldDef } from 'contentlayer/source-files' ;
3
- import { defineDocumentType , defineNestedType , makeSource } from 'contentlayer/source-files'
2
+ import type { FieldDef } from 'contentlayer/source-files'
3
+ import { defineDocumentType , defineNestedType , makeSource } from 'contentlayer/source-files'
4
4
import { createRequire } from 'module'
5
5
import * as path from 'path'
6
6
import * as shiki from 'shiki'
@@ -20,7 +20,7 @@ const fields: Record<string, FieldDef> = {
20
20
} ,
21
21
jsdoc : {
22
22
type : 'list' ,
23
- of : { type : 'string' } ,
23
+ of : { type : 'string' } ,
24
24
} ,
25
25
tableOfContentsDepth : { type : 'number' } ,
26
26
showTopLevelSignatures : { type : 'boolean' } ,
@@ -61,20 +61,20 @@ const Tutorial = defineDocumentType(() => ({
61
61
} ) )
62
62
63
63
export default makeSource ( async ( ) => {
64
- const require = createRequire ( import . meta. url )
65
- const shikiPkgPath = ( dir : string ) => path . join ( require . resolve ( 'shiki' ) , '..' , '..' , dir , path . sep )
66
- const highlighter = await shiki . getHighlighter ( {
67
- paths : { languages : shikiPkgPath ( 'languages' ) , themes : shikiPkgPath ( 'themes' ) } ,
68
- theme : 'github-light' ,
69
- } )
64
+ // const require = createRequire(import.meta.url)
65
+ // const shikiPkgPath = (dir: string) => path.join(require.resolve('shiki'), '..', '..', dir, path.sep)
66
+ // const highlighter = await shiki.getHighlighter({
67
+ // paths: { languages: shikiPkgPath('languages'), themes: shikiPkgPath('themes') },
68
+ // theme: 'github-light',
69
+ // })
70
70
71
71
return {
72
72
contentDirPath : 'content' ,
73
73
documentTypes : [ Reference , HowTo , Conceptual , Tutorial ] ,
74
74
// onUnknownDocuments: 'skip-ignore',
75
- markdown : {
76
- // '@stefanprobst/rehype-shiki', {}
77
- rehypePlugins : [ [ rehypeShiki , { highlighter } ] ] ,
78
- } ,
75
+ // markdown: {
76
+ // // '@stefanprobst/rehype-shiki', {}
77
+ // rehypePlugins: [[rehypeShiki, { highlighter }]],
78
+ // },
79
79
}
80
80
} )
0 commit comments