mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
docs: update doc
This commit is contained in:
parent
d964954f6f
commit
67ab7c734a
@ -23,6 +23,7 @@
|
|||||||
"code-block-style": false,
|
"code-block-style": false,
|
||||||
"emphasis-style": false,
|
"emphasis-style": false,
|
||||||
"no-hard-tabs": {
|
"no-hard-tabs": {
|
||||||
"spaces_per_tab": 2
|
"spaces_per_tab": 2,
|
||||||
|
"ignore_code_languages": ["xml"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ config:
|
|||||||
description: 支持全站加密、部分加密(加密目录、加密文章)。
|
description: 支持全站加密、部分加密(加密目录、加密文章)。
|
||||||
-
|
-
|
||||||
title: 代码
|
title: 代码
|
||||||
description: 代码复制,CodePen演示,Replit演示,JSFiddle演示,CodeSandbox演示,\n代码组,行高亮,行聚焦,行警告,差异对比等。\n
|
description: 代码复制,CodePen演示,Replit演示,JSFiddle演示,CodeSandbox演示,代码组,行高亮,行聚焦,行警告,差异对比等。
|
||||||
-
|
-
|
||||||
title: 资源嵌入
|
title: 资源嵌入
|
||||||
description: 图表,视频,PDF
|
description: 图表,视频,PDF
|
||||||
|
|||||||
@ -245,3 +245,26 @@ const options = { foo: 'bar' }
|
|||||||
options.foo = 'baz'
|
options.foo = 'baz'
|
||||||
console.log(options.foo) // 这个不会被高亮显示
|
console.log(options.foo) // 这个不会被高亮显示
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## 代码块中的 空白符
|
||||||
|
|
||||||
|
将空白字符(Tab 和空格)渲染为可见状态。
|
||||||
|
|
||||||
|
<!-- @include: ../../snippet/whitespace.snippet.md -->
|
||||||
|
|
||||||
|
还可以在 `theme.plugins.shiki` 中全局启用 `whitespace` 功能:
|
||||||
|
|
||||||
|
::: code-tabs
|
||||||
|
@tab .vuepress/config.ts
|
||||||
|
|
||||||
|
```ts
|
||||||
|
export default defineUserConfig({
|
||||||
|
theme: plumeTheme({
|
||||||
|
plugins: {
|
||||||
|
shiki: { whitespace: true }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
```
|
||||||
|
|
||||||
|
:::
|
||||||
|
|||||||
48
docs/notes/theme/snippet/whitespace.snippet.md
Normal file
48
docs/notes/theme/snippet/whitespace.snippet.md
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
渲染每行代码行前的空格:
|
||||||
|
|
||||||
|
**输入:**
|
||||||
|
|
||||||
|
````
|
||||||
|
```xml whitespace
|
||||||
|
<catalog>
|
||||||
|
<book>
|
||||||
|
<title>Everyday Italian</title>
|
||||||
|
</book>
|
||||||
|
</catalog>
|
||||||
|
```
|
||||||
|
```
|
||||||
|
````
|
||||||
|
|
||||||
|
**输出:**
|
||||||
|
|
||||||
|
```xml whitespace
|
||||||
|
<catalog>
|
||||||
|
<book>
|
||||||
|
<title>Everyday Italian</title>
|
||||||
|
</book>
|
||||||
|
</catalog>
|
||||||
|
```
|
||||||
|
|
||||||
|
渲染每行代码行前的 Tab :
|
||||||
|
|
||||||
|
**输入:**
|
||||||
|
|
||||||
|
````
|
||||||
|
```xml whitespace
|
||||||
|
<catalog>
|
||||||
|
<book>
|
||||||
|
<title>Everyday Italian</title>
|
||||||
|
</book>
|
||||||
|
</catalog>
|
||||||
|
```
|
||||||
|
````
|
||||||
|
|
||||||
|
**输出:**
|
||||||
|
|
||||||
|
```xml whitespace
|
||||||
|
<catalog>
|
||||||
|
<book>
|
||||||
|
<title>Everyday Italian</title>
|
||||||
|
</book>
|
||||||
|
</catalog>
|
||||||
|
```
|
||||||
@ -4,6 +4,7 @@ export default config({
|
|||||||
ignores: [
|
ignores: [
|
||||||
'lib',
|
'lib',
|
||||||
'docs/notes/theme/snippet/code-block.snippet.md',
|
'docs/notes/theme/snippet/code-block.snippet.md',
|
||||||
|
'docs/notes/theme/snippet/whitespace.snippet.md',
|
||||||
],
|
],
|
||||||
globals: {
|
globals: {
|
||||||
__VUEPRESS_VERSION__: 'readonly',
|
__VUEPRESS_VERSION__: 'readonly',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user