0.0.3 • Published 1 year ago

koishi-plugin-codemirror v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

koishi-plugin-codemirror

npm

启用此插件将为 Koishi 控制台的 string 类型配置构型提供一个 codemirror role,用于将字符串配置项变成一个代码编辑框。

export interface Config {
  code: string
}

export const Config: Schema<Config> = Schema.object({
  code: Schema.string().role("codemirror").default('console.log("Hello, World!")\n\n'),
})

即可在你的插件配置中添加一个 JavaScript 代码编辑框。

npm.io

.role("codemirror") 还接受第二参数 extra,目前,唯一有效的值为 { lang: "json" },可将编辑语言改为 JSON。

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago