pi-cc-extensions 0.8.55 → 0.8.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en.md +3 -0
- package/README.md +3 -0
- package/extensions/renderer/markdown-enhance.ts +7 -8
- package/package.json +1 -1
package/README.en.md
CHANGED
|
@@ -41,6 +41,7 @@ Run `/reload` after installation.
|
|
|
41
41
|
| Feature | Description | Entry point |
|
|
42
42
|
| --------------------------- | ----------------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
43
43
|
| Claude Code Output | Tool summaries, expand/collapse, rich edit/write diffs, and`on` / `compact` / `off` modes | `/ccstyle` |
|
|
44
|
+
| Markdown enhancements | Mermaid art, admonitions, URL linking, and more | Automatic |
|
|
44
45
|
| Fullscreen mode | Tool card/group click-to-toggle, previews, hover highlight, and a back-to-bottom button | `TUIMODE=fullscreen` or `--tui-mode fullscreen` |
|
|
45
46
|
| Settings panel | `Style / Diff / Thinking / Feature` tabs: startup header toggle and wheel step | `/ccstyle` |
|
|
46
47
|
| Context inspection | Usage breakdown and previews for the system prompt, tools, skills, and messages | `/context` |
|
|
@@ -69,6 +70,8 @@ Run `/reload` after installation.
|
|
|
69
70
|
}
|
|
70
71
|
```
|
|
71
72
|
|
|
73
|
+
> **Tip**: set `markdown.mermaid` to `final` via `~/.pi/agent/settings.json` or the Mermaid diagrams option in `/settings`. Default `streaming` redraws per frame; `final` renders once at completion.
|
|
74
|
+
|
|
72
75
|
## Local development
|
|
73
76
|
|
|
74
77
|
```bash
|
package/README.md
CHANGED
|
@@ -41,6 +41,7 @@ pi install git:github.com/minuque/pi-cc-extensions
|
|
|
41
41
|
| 功能 | 说明 | 入口 |
|
|
42
42
|
| --------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------- |
|
|
43
43
|
| Claude Code UI | 工具摘要、折叠展开、rich edit/write diff,以及`on` / `compact` / `off` 三种模式 | `/ccstyle` |
|
|
44
|
+
| Markdown 增强 | Mermaid 图、提示框、URL 链接化等 | 自动生效 |
|
|
44
45
|
| Fullscreen mode | 工具卡/group 点击展开与收起、预览、hover 高亮、回到底部按钮 | `TUIMODE=fullscreen` 或 `--tui-mode fullscreen` |
|
|
45
46
|
| 配置面板 | `Style / Diff / Thinking / Feature` 四页签,含启动头开关与滚轮步进 | `/ccstyle` |
|
|
46
47
|
| 上下文检查 | 查看上下文占用,并预览 System prompt、Tools、Skills 和消息内容 | `/context` |
|
|
@@ -75,6 +76,8 @@ pi install git:github.com/minuque/pi-cc-extensions
|
|
|
75
76
|
}
|
|
76
77
|
```
|
|
77
78
|
|
|
79
|
+
> **建议**:`markdown.mermaid` 设为 `final`(`~/.pi/agent/settings.json` 或 `/settings` 面板的 Mermaid diagrams 选项)。默认 `streaming` 逐帧重绘,`final` 渲染最终版更稳定。
|
|
80
|
+
|
|
78
81
|
## 本地开发
|
|
79
82
|
|
|
80
83
|
```bash
|
|
@@ -55,9 +55,8 @@ const ADMONITION_STYLE: Record<string, { icon: string; label: string }> = {
|
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
|
-
* 把 > [!TYPE] 及其后续 >
|
|
59
|
-
*
|
|
60
|
-
* 返回 null 表示该行不是提示框。
|
|
58
|
+
* 把 > [!TYPE] 及其后续 > 行转成带加粗标签的引用块,视觉上成提示框。
|
|
59
|
+
* 多行内容用空格合并为一行。返回 null 表示该行不是提示框。
|
|
61
60
|
*/
|
|
62
61
|
function renderAdmonition(lines: string[], i: number): { output: string[]; next: number } | null {
|
|
63
62
|
const m = lines[i].match(ADMONITION);
|
|
@@ -70,11 +69,11 @@ function renderAdmonition(lines: string[], i: number): { output: string[]; next:
|
|
|
70
69
|
j++;
|
|
71
70
|
}
|
|
72
71
|
while (body.length > 0 && body[body.length - 1].trim() === "") body.pop();
|
|
73
|
-
//
|
|
74
|
-
const content = body.join(" ").trim()
|
|
75
|
-
//
|
|
72
|
+
// 内容合并为一行,作为引用块正文
|
|
73
|
+
const content = body.join(" ").trim();
|
|
74
|
+
// 保留引用块形态,标签改为加粗图标+类型(pi 渲染为左侧竖线,比表格轻量)
|
|
76
75
|
return {
|
|
77
|
-
output: [
|
|
76
|
+
output: [`> **${style.icon} ${style.label}**${content ? ` ${content}` : ""}`, ""],
|
|
78
77
|
next: j,
|
|
79
78
|
};
|
|
80
79
|
}
|
|
@@ -222,7 +221,7 @@ function renderDiagrams(
|
|
|
222
221
|
return out.join("\n");
|
|
223
222
|
}
|
|
224
223
|
|
|
225
|
-
/** GitHub 风格提示框 →
|
|
224
|
+
/** GitHub 风格提示框 → 加粗标签引用块(跳过代码块)。 */
|
|
226
225
|
function renderAdmonitions(markdown: string): string {
|
|
227
226
|
const lines = markdown.split("\n");
|
|
228
227
|
const out: string[] = [];
|