chore: tweak

This commit is contained in:
pengzhanbo 2024-09-25 23:41:34 +08:00
parent 6504493b61
commit 4644765090
4 changed files with 25 additions and 9 deletions

View File

@ -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则不再根据 文件夹名和文件扩展名匹配不同的图标,仅显示默认的
文件夹图标和文件图标。
- **代码块分组** 的标题现在支持显示 图标。当作为 文件名时,与 **文件树** 采用相同的图标解析规则,还额外支持
不同的技术、框架、语言的名称图标。
- 优化了 容器、任务列表、脚注、等的样式。

View File

@ -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

View File

@ -12,7 +12,7 @@ const el = ref<HTMLElement>()
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
}

View File

@ -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