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
    }),
  ],
});

詳細資訊