From 072e5bcc48c56643a5c14c531e141bc7c5ef9243 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E5=91=98=E9=98=BF=E6=B1=9F=28Relakkes?= =?UTF-8?q?=29?= Date: Sun, 5 Apr 2026 10:13:57 +0800 Subject: [PATCH] fix: unify anchor IDs between VitePress and GitHub with custom slugify Add GitHub-compatible slugify (github-slugger algorithm) to VitePress config so heading anchor IDs are consistent across both platforms. Update all inline anchor links in 22 doc files accordingly. --- docs/.vitepress/config.mts | 20 +++++++++++++++++++ docs/agent/01-usage-guide.md | 2 +- docs/agent/02-implementation.md | 2 +- docs/agent/03-agent-framework.md | 2 +- docs/channel/01-channel-system.md | 20 +++++++++---------- docs/channel/index.md | 2 +- docs/en/agent/01-usage-guide.md | 2 +- docs/en/agent/02-implementation.md | 2 +- docs/en/agent/03-agent-framework.md | 2 +- docs/en/channel/01-channel-system.md | 20 +++++++++---------- docs/en/channel/index.md | 2 +- docs/en/features/computer-use-architecture.md | 14 ++++++------- docs/en/memory/01-usage-guide.md | 2 +- docs/en/memory/02-implementation.md | 2 +- docs/en/memory/03-autodream.md | 2 +- docs/en/skills/01-usage-guide.md | 2 +- docs/en/skills/02-implementation.md | 2 +- docs/features/computer-use-architecture.md | 14 ++++++------- docs/memory/01-usage-guide.md | 2 +- docs/memory/02-implementation.md | 2 +- docs/memory/03-autodream.md | 2 +- docs/skills/01-usage-guide.md | 2 +- docs/skills/02-implementation.md | 2 +- 23 files changed, 72 insertions(+), 52 deletions(-) diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 56720941..aa142b01 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -1,5 +1,19 @@ import { defineConfig } from 'vitepress' +// GitHub-compatible slugify (matches github-slugger algorithm) +// Makes heading anchor IDs consistent between VitePress and GitHub rendering +function slugify(str: string): string { + return str + .replace(/<[^>]*>/g, '') + .replace(/</g, '<') + .replace(/>/g, '>') + .replace(/&/g, '&') + .trim() + .toLowerCase() + .replace(/[^\p{L}\p{M}\p{N}\p{Pc}\- ]/gu, '') + .replace(/ /g, '-') +} + const zhSidebar = [ { text: '快速开始', @@ -136,6 +150,12 @@ export default defineConfig({ lastUpdated: true, base: '/', + markdown: { + anchor: { + slugify, + }, + }, + head: [ ['script', { async: '', src: 'https://www.googletagmanager.com/gtag/js?id=G-D42DM82263' }], ['script', {}, `window.dataLayer = window.dataLayer || [];\nfunction gtag(){dataLayer.push(arguments);}\ngtag('js', new Date());\ngtag('config', 'G-D42DM82263');`], diff --git a/docs/agent/01-usage-guide.md b/docs/agent/01-usage-guide.md index 6b003953..534c995e 100644 --- a/docs/agent/01-usage-guide.md +++ b/docs/agent/01-usage-guide.md @@ -3,7 +3,7 @@ > 让 Claude Code 同时调度多个专业代理,并行处理复杂任务。

-多 Agent 系统 · 六种内置 Agent · 如何生成 Agent · 后台任务管理 · Agent Teams · 自定义 Agent · 权限模式 · 快速参考 +多 Agent 系统 · 六种内置 Agent · 如何生成 Agent · 后台任务管理 · Agent Teams · 自定义 Agent · 权限模式 · 快速参考

![多 Agent 系统概览](./images/01-agent-overview.png) diff --git a/docs/agent/02-implementation.md b/docs/agent/02-implementation.md index f8256d88..19c9137f 100644 --- a/docs/agent/02-implementation.md +++ b/docs/agent/02-implementation.md @@ -3,7 +3,7 @@ > 深入剖析多 Agent 编排的架构设计、生成流程、上下文传递和协作机制。

-架构总览 · 生成流程 · 工具池系统 · 上下文传递 · Teams 内部机制 · 后台任务引擎 · DreamTask · Worktree 隔离 · 权限同步 · 生命周期数据流 · 源文件索引 · Feature Flags +架构总览 · 生成流程 · 工具池系统 · 上下文传递 · Teams 内部机制 · 后台任务引擎 · DreamTask · Worktree 隔离 · 权限同步 · 生命周期数据流 · 源文件索引 · Feature Flags

![实现架构总览](./images/05-architecture.png) diff --git a/docs/agent/03-agent-framework.md b/docs/agent/03-agent-framework.md index 49ce689c..cd0d2ec1 100644 --- a/docs/agent/03-agent-framework.md +++ b/docs/agent/03-agent-framework.md @@ -3,7 +3,7 @@ > 从源码视角剖析全球最流行 AI Code Editor 背后的 Agent 架构设计哲学。

-核心循环 · 提示词工程 · 工具系统 · 上下文管理 · 技能与插件 · 权限与安全 · 故障恢复 · 对比分析 · 成功之道 +核心循环 · 提示词工程 · 工具系统 · 上下文管理 · 技能与插件 · 权限与安全 · 故障恢复 · 对比分析 · 成功之道

![Agent 框架架构总览](./images/11-agent-framework-overview.png) diff --git a/docs/channel/01-channel-system.md b/docs/channel/01-channel-system.md index 46512134..ed8684f8 100644 --- a/docs/channel/01-channel-system.md +++ b/docs/channel/01-channel-system.md @@ -3,16 +3,16 @@ > 从源码视角深度剖析 Claude Code 如何通过 IM 平台远程控制 Agent

-概念 · -架构 · -协议 · -访问控制 · -权限中继 · -UI · -插件 · -安全 · -CLI · -特性开关 +概念 · +架构 · +协议 · +访问控制 · +权限中继 · +UI · +插件 · +安全 · +CLI · +特性开关

![Channel System Overview](./images/01-channel-overview.png) diff --git a/docs/channel/index.md b/docs/channel/index.md index 34bad090..3f0ff310 100644 --- a/docs/channel/index.md +++ b/docs/channel/index.md @@ -46,7 +46,7 @@ ### 插件开发者 -1. 阅读架构解析中的 [插件架构](./01-channel-system.md#七、插件-channel-架构) 章节 +1. 阅读架构解析中的 [插件架构](./01-channel-system.md#七插件-channel-架构) 章节 2. 了解 `plugin.json` 中 Channel 声明格式 3. 实现 MCP Server 的 `notifications/claude/channel` 协议 4. 查看源码位置: diff --git a/docs/en/agent/01-usage-guide.md b/docs/en/agent/01-usage-guide.md index 4bd23193..48ff198f 100644 --- a/docs/en/agent/01-usage-guide.md +++ b/docs/en/agent/01-usage-guide.md @@ -3,7 +3,7 @@ > Let Claude Code orchestrate multiple specialized agents to handle complex tasks in parallel.

-Multi-Agent System · Six Built-in Agents · Spawning Agents · Background Tasks · Agent Teams · Custom Agents · Permission Modes · Quick Reference +Multi-Agent System · Six Built-in Agents · Spawning Agents · Background Tasks · Agent Teams · Custom Agents · Permission Modes · Quick Reference

![Multi-Agent System Overview](./images/01-agent-overview.png) diff --git a/docs/en/agent/02-implementation.md b/docs/en/agent/02-implementation.md index 5db0b49d..b1b94ec5 100644 --- a/docs/en/agent/02-implementation.md +++ b/docs/en/agent/02-implementation.md @@ -3,7 +3,7 @@ > A deep dive into the architecture, spawn flow, context passing, and collaboration mechanisms of multi-agent orchestration.

-Architecture · Spawn Flow · Tool Pool · Context Passing · Teams Internals · Task Engine · DreamTask · Worktree Isolation · Permission Sync · Lifecycle Data Flow · Source Index · Feature Flags +Architecture · Spawn Flow · Tool Pool · Context Passing · Teams Internals · Task Engine · DreamTask · Worktree Isolation · Permission Sync · Lifecycle Data Flow · Source Index · Feature Flags

![Implementation Architecture Overview](./images/05-architecture.png) diff --git a/docs/en/agent/03-agent-framework.md b/docs/en/agent/03-agent-framework.md index 2cbd172b..fdbe53c1 100644 --- a/docs/en/agent/03-agent-framework.md +++ b/docs/en/agent/03-agent-framework.md @@ -3,7 +3,7 @@ > Deconstructing the architecture behind the world's most popular AI code editor — from source code to design philosophy.

-Core Loop · Prompt Engineering · Tool System · Context Management · Skills & Plugins · Permissions · Recovery · vs LangChain · Why It Works +Core Loop · Prompt Engineering · Tool System · Context Management · Skills & Plugins · Permissions · Recovery · vs LangChain · Why It Works

![Agent Framework Architecture Overview](./images/11-agent-framework-overview.png) diff --git a/docs/en/channel/01-channel-system.md b/docs/en/channel/01-channel-system.md index 568f9fd6..096fb53b 100644 --- a/docs/en/channel/01-channel-system.md +++ b/docs/en/channel/01-channel-system.md @@ -3,16 +3,16 @@ > A deep dive into how Claude Code enables remote Agent control via IM platforms

-Concepts · -Architecture · -Protocol · -Access Control · -Permission Relay · -UI · -Plugins · -Security · -CLI · -Feature Flags +Concepts · +Architecture · +Protocol · +Access Control · +Permission Relay · +UI · +Plugins · +Security · +CLI · +Feature Flags

![Channel System Overview](./images/01-channel-overview.png) diff --git a/docs/en/channel/index.md b/docs/en/channel/index.md index 73bacfb7..4a9dee75 100644 --- a/docs/en/channel/index.md +++ b/docs/en/channel/index.md @@ -46,7 +46,7 @@ All illustrations use dark background (#1a1a2e) with Anthropic brand copper-oran ### Plugin Developers -1. Read the [Plugin Architecture](./01-channel-system.md#_7-plugin-channel-architecture) section +1. Read the [Plugin Architecture](./01-channel-system.md#7-plugin-channel-architecture) section 2. Understand the `plugin.json` Channel declaration format 3. Implement the MCP Server `notifications/claude/channel` protocol 4. Key source files: diff --git a/docs/en/features/computer-use-architecture.md b/docs/en/features/computer-use-architecture.md index 1232552e..f4912e86 100644 --- a/docs/en/features/computer-use-architecture.md +++ b/docs/en/features/computer-use-architecture.md @@ -3,13 +3,13 @@ > A deep dive into the Computer Use implementation: from MCP tool definitions to Python Bridge, from 9-layer security gates to feature flag bypasses.

-Patch Environment · -Layered Architecture · -MCP Tool Layer · -Security Gates · -Python Bridge · -Interaction Loop · -Source File Index +Patch Environment · +Layered Architecture · +MCP Tool Layer · +Security Gates · +Python Bridge · +Interaction Loop · +Source File Index

![Computer Use Architecture Overview](./images/01-computer-use-architecture.jpg) diff --git a/docs/en/memory/01-usage-guide.md b/docs/en/memory/01-usage-guide.md index 9c06b01c..46ab5ac8 100644 --- a/docs/en/memory/01-usage-guide.md +++ b/docs/en/memory/01-usage-guide.md @@ -3,7 +3,7 @@ > Let Claude Code remember who you are, what you prefer, and what's happening in your project across sessions.

-Memory System · Four Memory Types · Trigger Saving · Storage Location · Manage Memories · Lifecycle · Quick Reference +Memory System · Four Memory Types · Trigger Saving · Storage Location · Manage Memories · Lifecycle · Quick Reference

![Memory System Overview](./images/01-memory-overview.png) diff --git a/docs/en/memory/02-implementation.md b/docs/en/memory/02-implementation.md index 788188c7..ddf2da7c 100644 --- a/docs/en/memory/02-implementation.md +++ b/docs/en/memory/02-implementation.md @@ -3,7 +3,7 @@ > From system prompt injection to background auto-extraction, dissecting every technical detail of the memory system.

-Architecture · Path Resolution · Prompt Injection · Auto-Extraction · Intelligent Retrieval · Memory Scanning · Agent Memory · Team Sync · Constants · Data Flow +Architecture · Path Resolution · Prompt Injection · Auto-Extraction · Intelligent Retrieval · Memory Scanning · Agent Memory · Team Sync · Constants · Data Flow

![Implementation Architecture Overview](./images/05-architecture-overview.png) diff --git a/docs/en/memory/03-autodream.md b/docs/en/memory/03-autodream.md index cba2bef0..fb983eb4 100644 --- a/docs/en/memory/03-autodream.md +++ b/docs/en/memory/03-autodream.md @@ -3,7 +3,7 @@ > Claude "dreams" -- silently reviewing recent sessions in the background to consolidate, update, and prune memories, much like the human brain organizes memories during sleep.

-AutoDream · Trigger Conditions · Consolidation Process · Security · UI · Configuration · Comparison · Source Code +AutoDream · Trigger Conditions · Consolidation Process · Security · UI · Configuration · Comparison · Source Code

![AutoDream Overview](./images/11-autodream-overview.png) diff --git a/docs/en/skills/01-usage-guide.md b/docs/en/skills/01-usage-guide.md index a7e2b9d2..f29cc6ca 100644 --- a/docs/en/skills/01-usage-guide.md +++ b/docs/en/skills/01-usage-guide.md @@ -3,7 +3,7 @@ > Skills are the extensible capability engine of Claude Code, allowing you to define custom automated workflows using Markdown files.

-What Are Skills · Six Sources · Definition Format · Invocation · Execution Context · Conditional Activation · Permissions · Quick Reference +What Are Skills · Six Sources · Definition Format · Invocation · Execution Context · Conditional Activation · Permissions · Quick Reference

![Skills System Overview](./images/01-skills-overview.png) diff --git a/docs/en/skills/02-implementation.md b/docs/en/skills/02-implementation.md index cd559605..78ecd02d 100644 --- a/docs/en/skills/02-implementation.md +++ b/docs/en/skills/02-implementation.md @@ -3,7 +3,7 @@ > A deep dive into how Skills are discovered, loaded, injected, executed, and managed.

-Architecture · Discovery & Loading · Frontmatter Parsing · Injection · Execution Engine · Fork Execution · Conditional Activation · Hook Integration · Permission System · Complete Lifecycle · Source Index +Architecture · Discovery & Loading · Frontmatter Parsing · Injection · Execution Engine · Fork Execution · Conditional Activation · Hook Integration · Permission System · Complete Lifecycle · Source Index

![Skills Architecture Overview](./images/04-skills-architecture.png) diff --git a/docs/features/computer-use-architecture.md b/docs/features/computer-use-architecture.md index d502d506..36b381b2 100644 --- a/docs/features/computer-use-architecture.md +++ b/docs/features/computer-use-architecture.md @@ -3,13 +3,13 @@ > 深入解析 Computer Use 功能的底层实现:从 MCP 工具定义到 Python Bridge,从 9 层安全关卡到灰度控制绕过。

-补丁环境 · -分层架构 · -MCP 工具层 · -安全关卡 · -Python Bridge · -交互闭环 · -源文件索引 +补丁环境 · +分层架构 · +MCP 工具层 · +安全关卡 · +Python Bridge · +交互闭环 · +源文件索引

![Computer Use 整体架构](./images/01-computer-use-architecture.jpg) diff --git a/docs/memory/01-usage-guide.md b/docs/memory/01-usage-guide.md index 29438d55..225f7dbe 100644 --- a/docs/memory/01-usage-guide.md +++ b/docs/memory/01-usage-guide.md @@ -3,7 +3,7 @@ > 让 Claude Code 跨会话记住你是谁、你偏好什么、项目正在发生什么。

-记忆系统 · 四种记忆类型 · 触发保存 · 存储位置 · 管理记忆 · 生命周期 · 快速参考 +记忆系统 · 四种记忆类型 · 触发保存 · 存储位置 · 管理记忆 · 生命周期 · 快速参考

![记忆系统概览](./images/01-memory-overview.png) diff --git a/docs/memory/02-implementation.md b/docs/memory/02-implementation.md index 8c57f9c9..43c2117c 100644 --- a/docs/memory/02-implementation.md +++ b/docs/memory/02-implementation.md @@ -3,7 +3,7 @@ > 从系统提示词注入到后台自动提取,拆解记忆系统的每一个技术细节。

-整体架构 · 路径解析 · 提示词注入 · 自动提取 · 智能检索 · 记忆扫描 · 代理记忆 · 团队同步 · 常量速查 · 数据流总览 +整体架构 · 路径解析 · 提示词注入 · 自动提取 · 智能检索 · 记忆扫描 · 代理记忆 · 团队同步 · 常量速查 · 数据流总览

![实现架构总览](./images/05-architecture-overview.png) diff --git a/docs/memory/03-autodream.md b/docs/memory/03-autodream.md index 5d0270b2..c58f817b 100644 --- a/docs/memory/03-autodream.md +++ b/docs/memory/03-autodream.md @@ -3,7 +3,7 @@ > Claude 会"做梦"——在后台静默回顾近期会话,整合、更新、修剪记忆,就像人类睡眠中整理白天的记忆一样。

-AutoDream · 触发条件 · 整合流程 · 安全限制 · UI 展示 · 配置开关 · 对比 · 源码导航 +AutoDream · 触发条件 · 整合流程 · 安全限制 · UI 展示 · 配置开关 · 对比 · 源码导航

![AutoDream 概览](./images/11-autodream-overview.png) diff --git a/docs/skills/01-usage-guide.md b/docs/skills/01-usage-guide.md index 7225c324..17e47dd2 100644 --- a/docs/skills/01-usage-guide.md +++ b/docs/skills/01-usage-guide.md @@ -3,7 +3,7 @@ > Skills 是 Claude Code 的扩展能力引擎,让你用 Markdown 文件定义专属的自动化工作流。

-Skills 是什么 · 六种来源 · 定义格式 · 调用方式 · 执行上下文 · 条件激活 · 权限控制 · 快速参考 +Skills 是什么 · 六种来源 · 定义格式 · 调用方式 · 执行上下文 · 条件激活 · 权限控制 · 快速参考

![Skills 系统概览](./images/01-skills-overview.png) diff --git a/docs/skills/02-implementation.md b/docs/skills/02-implementation.md index 58120022..29ad9e85 100644 --- a/docs/skills/02-implementation.md +++ b/docs/skills/02-implementation.md @@ -3,7 +3,7 @@ > 深度剖析 Skills 如何被发现、加载、注入、执行和管理。

-整体架构 · 发现与加载 · Frontmatter 解析 · 注入对话 · 执行引擎 · Fork 执行 · 条件激活 · Hook 集成 · 权限系统 · 完整生命周期 · 源码索引 +整体架构 · 发现与加载 · Frontmatter 解析 · 注入对话 · 执行引擎 · Fork 执行 · 条件激活 · Hook 集成 · 权限系统 · 完整生命周期 · 源码索引

![Skills 架构概览](./images/04-skills-architecture.png)