How to register a highlight language support for shiki? #1342
Unanswered
MonoLogueChi
asked this question in
Q&A
Replies: 1 comment
-
The following configuration seems to be usable import { shikiPlugin } from "@vuepress/plugin-shiki";
import { BUNDLED_LANGUAGES, } from "shiki";
import caddyfile from "./caddyfile.tmLanguage.json" assert { type: "json" };
const caddyfileLanguage = {
id: "Caddyfile",
scopeName: "source.Caddyfile",
grammar: caddyfile,
aliases: ["caddyfile", "caddy"],
};
// @ts-ignore
BUNDLED_LANGUAGES.push(caddyfileLanguage);
export default shikiPlugin({
theme: "vitesse-light",
langs: BUNDLED_LANGUAGES,
}); but one more question, can I import from |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I want to register highlighting support to caddy, now the configuration file is ready.
I read some docs and now have the following idea, but I have some problems.
I have a few questions to ask.
BUNDLED_LANGUAGES
, can I import from@vuepress/plugin-shiki
instead ofshiki
. Or, is there a way to register a language highlighting support without breaking the configuration of loading all language highlighting by defaultpath
parameter, this is the relative directory ofnode_modules\shiki\languages
, how should I fill in the parameters when I want to register my own configuration file. Now reports the error asError: ENOENT: no such file or directory, open 'D:\Users\mc\Documents\GitHub\blog.xxwhite.com\node_modules\.pnpm\shiki@0.14.2\node_modules\shiki\languages\D:\Users\mc\Documents\GitHub\blog.xxwhite.com\docs\.vuepress\config\plugins\shiki\caddyfile.tmLanguage.json'
grammar
parametersBeta Was this translation helpful? Give feedback.
All reactions