Codeblock

EmDash 代码块的 Shiki 语法高亮,在服务端渲染,并带复制按钮。

插件

Codeblock

EmDash 代码块的 Shiki 语法高亮,在服务端渲染,并带复制按钮。

  • 分类: 编辑器体验
  • 状态: 可用
  • 版本: 0.4.0
  • 价格: 未知
  • 来源: npm 软件包
  • 安装方式: npm 原生集成
  • 核实日期: 2026-11-01

EmDash 代码块的 Shiki 语法高亮,在服务端渲染,并带复制按钮。

安装

从 npm 安装该软件包:

npm install @plugdash/codeblock

在 Astro 配置中注册该插件:

// astro.config.mjs
import { defineConfig } from "astro/config";
import emdash from "emdash/astro";
import { codeblockPlugin } from "@plugdash/codeblock";

export default defineConfig({
  integrations: [
    emdash({
      plugins: [codeblockPlugin({ theme: "github-dark", lineNumbers: true })], // native - must be in plugins, not sandboxed
    }),
  ],
});

详细信息