@gerrit0/mini-shiki
This is a re-bundled version of Shiki which strips out
the dependencies which aren't necessary for TypeDoc's usage.
Why?
Compare Shiki's dependency tree:
To this package's dependency tree:
The Shiki maintainers have declined to split
up the package in a way which makes it possible to avoid these dependencies when just relying
on shikijs published packages.
Releases
This package will be released and keep the same major/minor version numbers as Shiki.
Patch versions will generally be the same as Shiki, but may differ if adjustments are
necessary to fix compatibility issues.
Usage
import {
codeToTokensWithThemes,
createShikiInternal,
createOnigurumaEngine,
bundledLanguages,
bundledThemes,
loadBuiltinWasm,
} from "@gerrit0/mini-shiki";
await loadBuiltinWasm();
const shiki = await createShikiInternal({
engine: createOnigurumaEngine(),
langs: [bundledLanguages.typescript],
themes: [bundledThemes["light-plus"]],
});
const lines = codeToTokensWithThemes(shiki, "console.log('Hello world!')", {
themes: { light: "light-plus" },
lang: "typescript",
});