Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test shiki update #3808

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions docs/contentlayer.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import { defineDocumentType, makeSource } from 'contentlayer/source-files';
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
import rehypePrettyCode, { LineElement } from 'rehype-pretty-code';
import rehypePrettyCode, {
LineElement,
type Options as PrettyCodeOptions,
} from 'rehype-pretty-code';
import rehypeSlug from 'rehype-slug';
import remarkGfm from 'remark-gfm';
import { Pluggable, PluggableList } from 'unified';

Check warning on line 9 in docs/contentlayer.config.ts

View workflow job for this annotation

GitHub Actions / Lint

'PluggableList' is defined but never used
import { visit } from 'unist-util-visit';

import { rehypeComponentDemo } from './lib/mdx/rehype-component-demo';
Expand Down Expand Up @@ -105,7 +109,8 @@
documentTypes: [ContentPage],
mdx: {
remarkPlugins: [remarkGfm],
rehypePlugins: [
/// @ts-ignore
rehypePlugin: [
[rehypeComponentDemo, { contentDirPath }],
rehypeSlug,
// to inject the source code and other stuff inside `pre` element props
Expand Down Expand Up @@ -138,7 +143,7 @@
onVisitHighlightedChars(node: LineElement) {
node.properties.className = ['bg-gray-700 px-2 py-0.5 rounded-sm'];
},
},
} satisfies Partial<PrettyCodeOptions>,
],
// needed to copy code
() => tree => {
Expand Down Expand Up @@ -175,6 +180,6 @@
},
},
],
],
] as Pluggable[],
},
});
5 changes: 3 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@
"react-use": "17.5.0",
"react-use-clipboard": "1.0.9",
"rehype-autolink-headings": "6.1.1",
"rehype-pretty-code": "0.10.2",
"rehype-pretty-code": "0.13.0",
"rehype-slug": "5.1.0",
"remark-gfm": "3.0.1",
"shiki": "0.14.7",
"shiki": "1.0.0",
"tailwind-scrollbar": "3.1.0",
"tailwindcss": "3.4.1",
"unified": "11.0.4",
"zod": "3.22.4",
"zod-form-data": "2.0.2",
"zx": "7.2.3"
Expand Down
Loading
Loading