Skip to content

Commit 2bb22e6

Browse files
Merge pull request #459 from thejackshelton/cloudflare-issue
fix(docs): replacing shiki with shikiji
2 parents dd4ee43 + 2103d8b commit 2bb22e6

File tree

4 files changed

+200
-25
lines changed

4 files changed

+200
-25
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { getHighlighter, type Highlighter } from 'shiki';
1+
import { getHighlighter, type Highlighter } from 'shikiji';
22

33
let highlighter: Highlighter;
44
export async function getOrCreateHighlighter() {
55
if (highlighter) {
66
return highlighter;
77
}
8-
highlighter = await getHighlighter({ theme: 'css-variables' });
8+
highlighter = await getHighlighter({ themes: ['nord'], langs: ['tsx', 'css', 'html'] });
99
return highlighter;
1010
}

apps/website/src/routes/docs/_components/highlight/highlight.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ export const Highlight = component$(
4242
modifiedCode = partsOfCode[0];
4343
}
4444

45-
codeSig.value = highlighter.codeToHtml(modifiedCode, { lang: language });
45+
console.log(highlighter);
46+
codeSig.value = highlighter.codeToHtml(modifiedCode, {
47+
lang: language,
48+
theme: 'nord',
49+
});
4650
});
4751

4852
return (

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
"react": "18.2.0",
9797
"react-dom": "18.2.0",
9898
"sass": "^1.66.1",
99-
"shiki": "0.14.4",
99+
"shikiji": "0.6.10",
100100
"storybook": "^7.4.0",
101101
"storybook-framework-qwik": "^0.2.3",
102102
"tailwind-merge": "1.14.0",

0 commit comments

Comments
 (0)