diff --git a/docs/3.更新说明/102-103.md b/docs/3.更新说明/102-103.md index b62157fd..9b379c3a 100644 --- a/docs/3.更新说明/102-103.md +++ b/docs/3.更新说明/102-103.md @@ -56,5 +56,17 @@ VuePress 推出了 [主题开发指南](https://ecosystem.vuejs.press/zh/themes/ - `@vuepress/plugin-markdown-math` 提供了数学公式支持,主题已内置了该插件,并默认启用了 `katex` 支持。 -- `@vuepress/plugin-markdown-tab` 提供了 Tab 容器 和 代码分组支持,主题已内置了该插件,并对 `code-tabs` 容器 - 做了一些调整,支持在 代码分组标题中显式 相关联的图标。 +- `@vuepress/plugin-markdown-tab` 提供了 Tab 容器 和 代码分组支持,主题重写了插件部分内容,对 `code-tabs` 容器 + 做了一些调整,支持在 代码分组标题中显示 相关联的图标。 + +## 其它更新 + +- **文件树** 现在支持 不同的图标方案,可在 `:::file-tree` 后跟随 `:simple-icon` / `:colored-icon` 切换。 + + 默认为 colored-icon,如果切换为 simple-icon,则不再根据 文件夹名和文件扩展名匹配不同的图标,仅显示默认的 + 文件夹图标和文件图标。 + +- **代码块分组** 的标题现在支持显示 图标。当作为 文件名时,与 **文件树** 采用相同的图标解析规则,还额外支持 + 不同的技术、框架、语言的名称图标。 + +- 优化了 容器、任务列表、脚注、等的样式。 diff --git a/docs/notes/theme/config/配置说明.md b/docs/notes/theme/config/配置说明.md index 3e463a00..7c576a62 100644 --- a/docs/notes/theme/config/配置说明.md +++ b/docs/notes/theme/config/配置说明.md @@ -88,11 +88,13 @@ export default defineUserConfig({ 你可以直接在 [VuePress 配置文件](#vuepress-配置文件) 相同的路径下创建一个 `plume.config.js` 文件,这样就可以在该文件中进行主题配置。 你也可以使用 TypeScript 来创建一个 `plume.config.ts` 文件,以获得更好的类型提示。 -```txt :no-line-numbers -{sourceDir}/.vuepress/ -├── config.ts -└── plume.config.ts // [!code ++] -``` +::: file-tree + +- docs + - .vuepress + - config.ts + - **plume.config.ts** +::: ::: code-tabs @tab plume.config.ts diff --git a/plugins/plugin-md-power/src/client/components/FileTreeItem.vue b/plugins/plugin-md-power/src/client/components/FileTreeItem.vue index 679161e2..2cc56677 100644 --- a/plugins/plugin-md-power/src/client/components/FileTreeItem.vue +++ b/plugins/plugin-md-power/src/client/components/FileTreeItem.vue @@ -12,7 +12,7 @@ const el = ref() function toggle(e: HTMLElementEventMap['click']) { const target = e.target as HTMLElement - if (target.matches('.comment')) + if (target.matches('.comment') || e.currentTarget === target) return active.value = !active.value } diff --git a/plugins/plugin-md-power/src/node/container/fileTree.ts b/plugins/plugin-md-power/src/node/container/fileTree.ts index abe9d7e6..f1755b75 100644 --- a/plugins/plugin-md-power/src/node/container/fileTree.ts +++ b/plugins/plugin-md-power/src/node/container/fileTree.ts @@ -169,19 +169,21 @@ export function updateInlineToken(inline: Token, info: FileTreeNode, icon: strin if (token.content.includes(' ')) { const [first, ...other] = token.content.split(' ') const text = new Token('text', '', 0) - text.content = first + text.content = removeEndingSlash(first) tokens.push(text) const comment = new Token('text', '', 0) comment.content = other.join(' ') children.unshift(comment) } else { + token.content = removeEndingSlash(token.content) tokens.push(token) } if (!isStrongTag) break } else if (token.tag === 'strong') { + token.content = removeEndingSlash(token.content) tokens.push(token) if (token.nesting === 1) { isStrongTag = true