
內容簡介
Kodosvet Code Block 是一款輕量級的 Gutenberg 區塊外掛,專為顯示程式碼並提供語法高亮功能而設計,使用 Highlight.js 進行支援,讓開發者能夠輕鬆地在網站上展示程式碼片段。
【主要功能】
• 原生 Gutenberg 區塊,完全支援視覺編輯器
• 14 種顏色主題可供選擇
• 智能語言檢測,自動識別多種程式語言
• 一鍵複製程式碼,並提供視覺反饋
• 可切換的行號顯示
• 內建舊版區塊遷移工具
外掛標籤
開發者團隊
原文外掛簡介
Kodosvet Code Block is a zero-bloat Gutenberg block for displaying code with syntax highlighting powered by Highlight.js.
Key Features:
Native Gutenberg Block — Full support for the visual editor with Server-Side Rendering.
14 Color Themes — Atom One, GitHub, Monokai, Dracula, Nord, VS Code, Stack Overflow, Night Owl, Gruvbox, Solarized, Panda, Tomorrow Night, Shades of Purple, Tokyo Night.
Smart Language Detection — Automatic language identification using multi-layered heuristics for PHP, Bash, JavaScript, SQL, JSON, XML, and more.
Swift Guard — Prevents Highlight.js from misidentifying code as Swift.
Dark/Light Toggle — Switch all code blocks on the page between dark and light themes with one click.
Copy to Clipboard — One-click code copying with visual feedback.
Line Numbers — Toggleable line number gutter.
Legacy Migrator — Built-in tool to scan and convert old core/code and core/preformatted blocks.
Zero Bloat — Assets are loaded only when a code block is present on the page.
No jQuery — Pure Vanilla JS on the frontend.
Migrator Tool:
Navigate to Tools → Kodosvet Code Block to scan your site for legacy code blocks and migrate them to the modern Kodosvet format with a before/after preview.
Third-Party Libraries
Syntax highlighting is powered by Highlight.js 11.11.1, bundled locally in vendor/hljs/ (core build + 22 theme stylesheets). Highlight.js is licensed under the BSD-3-Clause License; the unminified source is available at github.com/highlightjs/highlight.js. No external requests are made at runtime.
