@ruan-cat/vitepress-preset-config 2.1.0 → 2.3.0
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/dist/config.mjs +22 -1
- package/dist/theme.mjs +6 -0
- package/package.json +1 -1
- package/src/config/teek.ts +17 -1
- package/src/theme.ts +14 -0
package/dist/config.mjs
CHANGED
|
@@ -46,13 +46,34 @@ function handlePlugins(userConfig, extraConfig) {
|
|
|
46
46
|
import { defineTeekConfig } from "vitepress-theme-teek/config";
|
|
47
47
|
import { merge, cloneDeep } from "lodash-es";
|
|
48
48
|
var defaultTeekConfig = {
|
|
49
|
-
/**
|
|
49
|
+
/**
|
|
50
|
+
* 启用侧边栏展开/折叠触发器
|
|
51
|
+
* @see https://vp.teek.top/reference/config/global-config.html#sidebartrigger
|
|
52
|
+
*/
|
|
50
53
|
sidebarTrigger: true,
|
|
51
54
|
/**
|
|
52
55
|
* 关闭 Teek 主题的首页风格
|
|
53
56
|
* @see https://vp.teek.top/reference/config/global-config.html#teekhome
|
|
54
57
|
*/
|
|
55
58
|
teekHome: false,
|
|
59
|
+
/**
|
|
60
|
+
* 启用新版代码块
|
|
61
|
+
* @see https://vp.teek.top/reference/config/global-config.html#codeblock
|
|
62
|
+
*/
|
|
63
|
+
codeBlock: {
|
|
64
|
+
enabled: true,
|
|
65
|
+
// 是否启用新版代码块
|
|
66
|
+
collapseHeight: 700,
|
|
67
|
+
// 超出高度后自动折叠,设置 true 则默认折叠,false 则默认不折叠
|
|
68
|
+
overlay: true,
|
|
69
|
+
// 代码块底部是否显示展开/折叠遮罩层
|
|
70
|
+
overlayHeight: 400,
|
|
71
|
+
// 当出现遮罩层时,指定代码块显示高度,当 overlay 为 true 时生效
|
|
72
|
+
langTextTransform: "lowercase",
|
|
73
|
+
// 语言文本显示样式,为 text-transform 的值:none, capitalize, lowercase, uppercase
|
|
74
|
+
copiedDone: (TkMessage) => TkMessage.success("\u590D\u5236\u6210\u529F\uFF01")
|
|
75
|
+
// 复制代码完成后的回调
|
|
76
|
+
},
|
|
56
77
|
vitePlugins: {
|
|
57
78
|
/**
|
|
58
79
|
* 关闭 vitepress-plugin-permalink 插件
|
package/dist/theme.mjs
CHANGED
|
@@ -6,6 +6,12 @@ import "@shikijs/vitepress-twoslash/style.css";
|
|
|
6
6
|
import CopyOrDownloadAsMarkdownButtons from "vitepress-plugin-llms/vitepress-components/CopyOrDownloadAsMarkdownButtons.vue";
|
|
7
7
|
import Teek from "vitepress-theme-teek";
|
|
8
8
|
import "vitepress-theme-teek/index.css";
|
|
9
|
+
import "vitepress-theme-teek/theme-chalk/tk-doc-h1-gradient.css";
|
|
10
|
+
import "vitepress-theme-teek/theme-chalk/tk-nav-blur.css";
|
|
11
|
+
import "vitepress-theme-teek/theme-chalk/tk-scrollbar.css";
|
|
12
|
+
import "vitepress-theme-teek/theme-chalk/tk-sidebar.css";
|
|
13
|
+
import "vitepress-theme-teek/theme-chalk/tk-aside.css";
|
|
14
|
+
import "vitepress-theme-teek/theme-chalk/tk-fade-up-animation.css";
|
|
9
15
|
import { Mermaid } from "@leelaa/vitepress-plugin-extended";
|
|
10
16
|
function defaultEnhanceAppPreset({ app, router, siteData }) {
|
|
11
17
|
app.use(NolebaseGitChangelogPlugin);
|
package/package.json
CHANGED
package/src/config/teek.ts
CHANGED
|
@@ -9,7 +9,10 @@ import type { TeekConfigOptions, ExtraConfig } from "../types";
|
|
|
9
9
|
* @see https://vp.teek.top/reference/config.html
|
|
10
10
|
*/
|
|
11
11
|
export const defaultTeekConfig: TeekConfigOptions = {
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* 启用侧边栏展开/折叠触发器
|
|
14
|
+
* @see https://vp.teek.top/reference/config/global-config.html#sidebartrigger
|
|
15
|
+
*/
|
|
13
16
|
sidebarTrigger: true,
|
|
14
17
|
|
|
15
18
|
/**
|
|
@@ -18,6 +21,19 @@ export const defaultTeekConfig: TeekConfigOptions = {
|
|
|
18
21
|
*/
|
|
19
22
|
teekHome: false,
|
|
20
23
|
|
|
24
|
+
/**
|
|
25
|
+
* 启用新版代码块
|
|
26
|
+
* @see https://vp.teek.top/reference/config/global-config.html#codeblock
|
|
27
|
+
*/
|
|
28
|
+
codeBlock: {
|
|
29
|
+
enabled: true, // 是否启用新版代码块
|
|
30
|
+
collapseHeight: 700, // 超出高度后自动折叠,设置 true 则默认折叠,false 则默认不折叠
|
|
31
|
+
overlay: true, // 代码块底部是否显示展开/折叠遮罩层
|
|
32
|
+
overlayHeight: 400, // 当出现遮罩层时,指定代码块显示高度,当 overlay 为 true 时生效
|
|
33
|
+
langTextTransform: "lowercase", // 语言文本显示样式,为 text-transform 的值:none, capitalize, lowercase, uppercase
|
|
34
|
+
copiedDone: (TkMessage) => TkMessage.success("复制成功!"), // 复制代码完成后的回调
|
|
35
|
+
},
|
|
36
|
+
|
|
21
37
|
vitePlugins: {
|
|
22
38
|
/**
|
|
23
39
|
* 关闭 vitepress-plugin-permalink 插件
|
package/src/theme.ts
CHANGED
|
@@ -21,6 +21,20 @@ import CopyOrDownloadAsMarkdownButtons from "vitepress-plugin-llms/vitepress-com
|
|
|
21
21
|
import Teek from "vitepress-theme-teek";
|
|
22
22
|
import "vitepress-theme-teek/index.css";
|
|
23
23
|
|
|
24
|
+
// https://vp.teek.top/guide/styles-plus.html#样式增强
|
|
25
|
+
// 文章一级标题渐变色
|
|
26
|
+
import "vitepress-theme-teek/theme-chalk/tk-doc-h1-gradient.css";
|
|
27
|
+
// 导航栏毛玻璃样式
|
|
28
|
+
import "vitepress-theme-teek/theme-chalk/tk-nav-blur.css";
|
|
29
|
+
// 滚动条样式
|
|
30
|
+
import "vitepress-theme-teek/theme-chalk/tk-scrollbar.css";
|
|
31
|
+
// 侧边栏样式
|
|
32
|
+
import "vitepress-theme-teek/theme-chalk/tk-sidebar.css";
|
|
33
|
+
// 右侧目栏录文字悬停和激活样式
|
|
34
|
+
import "vitepress-theme-teek/theme-chalk/tk-aside.css";
|
|
35
|
+
// 首次进入页面添加渐显动画
|
|
36
|
+
import "vitepress-theme-teek/theme-chalk/tk-fade-up-animation.css";
|
|
37
|
+
|
|
24
38
|
/** @see https://vitepress-ext.leelaa.cn/Mermaid.html#全局引入 */
|
|
25
39
|
// @ts-ignore FIXME: 忽略类型导出的bug 避免tsup打包失败
|
|
26
40
|
import { Mermaid } from "@leelaa/vitepress-plugin-extended";
|