diff --git a/deps.ts b/deps.ts index 9aa9fac..1230a0e 100644 --- a/deps.ts +++ b/deps.ts @@ -15,7 +15,11 @@ export { default as withHtmlInMarkdown } from "https://esm.sh/rehype-raw" export { default as toHtml } from "https://esm.sh/rehype-stringify" export { default as toHast } from "https://esm.sh/remark-rehype" export { default as withShiki } from "https://esm.sh/@stefanprobst/remark-shiki" -export * as shiki from "npm:shiki" + +// https://deno.bundlejs.com/file?q=shiki + +// @deno-types=https://esm.sh/shiki +export * as shiki from "https://unpkg.com/shiki/dist/index.browser.mjs" export { default as GithubMarkdownFlavor } from "https://esm.sh/remark-gfm" diff --git a/docs.tsx b/docs.tsx index b1a8ebc..679c1cf 100644 --- a/docs.tsx +++ b/docs.tsx @@ -1,8 +1,6 @@ -/** @jsx h */ import { ColorScheme, fromMarkdown, - h, html, path, shiki, @@ -24,8 +22,10 @@ const __dirname = dirname(fromFileUrl(import.meta.url)); // check the color scheme with system settings automatically html.use(ColorScheme("dark")); +shiki.setCDN("https://unpkg.com/shiki/"); +const highlighter = await shiki.getHighlighter({ theme: "github-dark" }); + export async function getDocs() { - const highlighter = await shiki.getHighlighter({ theme: "github-dark" }); const file = await unified() .use(fromMarkdown) // Parse markdown content to a syntax tree .use(GithubMarkdownFlavor)