Patrick10 downloadsSiyuan-like code blocks with a language pill (click-to-pick dropdown), hover copy button, smart Ctrl/Cmd+A, Chinese punctuation trigger (···→code block), customizable appearance, and bilingual UI (zh/en).
An enhanced code block plugin for Obsidian.
Adds a sleek header bar to every code block with a language pill (click to pick / search / type custom), a copy button, and consistent styling across editing and reading modes.
··· or ···python then press Enter to create a code block fence.main.js, styles.css, and manifest.json from the latest release.siyuan-code-blocks inside your vault's .obsidian/plugins/ directory.Search for "Code Block Plus" in Obsidian's community plugin browser.
| Setting | Description | Default |
|---|---|---|
| Custom appearance | Enable to customize background, radius, and padding | Off |
| Code block radius (px) | Border radius of code blocks (custom only) | 10 |
| Left padding (px) | Distance between code text and left border (custom only) | 20 |
| Show controls on hover | Only show language pill & copy button on hover | On |
| Chinese punctuation trigger | ··· + Enter creates a code block |
On |
| Allow custom languages | Type custom languages in the picker | On |
| Interface language | Plugin UI language (zh/en) | zh |
一款为 Obsidian 带来增强代码块体验的插件。
为每个代码块添加精致的头部栏,包含语言标签(点击可选择 / 搜索 / 自定义输入)和复制按钮,编辑模式与阅读模式样式一致。
··· 或 ···python 后按回车,自动创建代码块围栏。main.js、styles.css 和 manifest.json。.obsidian/plugins/ 目录下创建 siyuan-code-blocks 文件夹。在 Obsidian 社区插件浏览器中搜索 "Code Block Plus"。
| 设置 | 说明 | 默认值 |
|---|---|---|
| 自定义外观 | 开启后可自定义背景色、圆角和内边距 | 关闭 |
| 代码块圆角 (px) | 代码块的圆角大小(自定义外观) | 10 |
| 左侧内边距 (px) | 代码文字与左边框的距离(自定义外观) | 20 |
| 悬停显示控件 | 仅在悬停时显示语言标签和复制按钮 | 开启 |
| 中文标点触发 | ··· + 回车创建代码块 |
开启 |
| 允许自定义语言 | 在选择器中输入自定义语言 | 开启 |
| 界面语言 | 插件界面语言(中文/英文) | 中文 |
MIT