@ruan-cat/vitepress-preset-config 0.9.1 → 0.11.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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 ruan-cat
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/config.d.mts CHANGED
@@ -3,6 +3,7 @@ import { UserConfig, DefaultTheme } from 'vitepress';
3
3
  export { defineConfig } from 'vitepress';
4
4
  import { generateSidebar } from 'vitepress-sidebar';
5
5
  export { addChangelog2doc } from '@ruan-cat/utils/node-esm';
6
+ export { withMermaid } from 'vitepress-plugin-mermaid';
6
7
 
7
8
  type VitePressSidebarOptions = Parameters<typeof generateSidebar>[0];
8
9
  /**
package/dist/config.mjs CHANGED
@@ -7,6 +7,8 @@ import { merge, isUndefined, cloneDeep } from "lodash-es";
7
7
  import consola from "consola";
8
8
  import { addChangelog2doc, hasChangelogMd } from "@ruan-cat/utils/node-esm";
9
9
  import { transformerTwoslash } from "@shikijs/vitepress-twoslash";
10
+ import llmstxt from "vitepress-plugin-llms";
11
+ import { withMermaid } from "vitepress-plugin-mermaid";
10
12
  var defaultSidebarOptions = {
11
13
  // documentRootPath: "src",
12
14
  // 侧边栏需要折叠
@@ -68,6 +70,9 @@ var defaultUserConfig = {
68
70
  open: true
69
71
  },
70
72
  plugins: [
73
+ /** @see https://github.com/okineadev/vitepress-plugin-llms */
74
+ // @ts-ignore
75
+ llmstxt(),
71
76
  // @ts-ignore
72
77
  GitChangelog({
73
78
  // 填写在此处填写您的仓库链接
@@ -136,5 +141,6 @@ export {
136
141
  addChangelog2doc,
137
142
  defineConfig,
138
143
  setGenerateSidebar,
139
- setUserConfig
144
+ setUserConfig,
145
+ withMermaid
140
146
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ruan-cat/vitepress-preset-config",
3
- "version": "0.9.1",
3
+ "version": "0.11.0",
4
4
  "description": "用于给大多数的vitepress项目提供一个预设的配置文件。",
5
5
  "homepage": "https://vitepress-preset.ruancat6312.top",
6
6
  "types": "./src/config.mts",
@@ -14,10 +14,13 @@
14
14
  "consola": "^3.4.0",
15
15
  "js-yaml": "^4.1.0",
16
16
  "lodash-es": "^4.17.21",
17
+ "mermaid": "^11.6.0",
17
18
  "vitepress-demo-plugin": "^1.3.1",
19
+ "vitepress-plugin-llms": "^1.1.0",
20
+ "vitepress-plugin-mermaid": "^2.0.17",
18
21
  "vitepress-sidebar": "^1.31.1",
19
22
  "vue": "^3.5.13",
20
- "@ruan-cat/utils": "^4.2.2"
23
+ "@ruan-cat/utils": "^4.3.0"
21
24
  },
22
25
  "devDependencies": {
23
26
  "@types/lodash-es": "^4.17.12",
package/src/config.mts CHANGED
@@ -14,6 +14,20 @@ export { addChangelog2doc };
14
14
 
15
15
  import { transformerTwoslash } from "@shikijs/vitepress-twoslash";
16
16
 
17
+ import llmstxt from "vitepress-plugin-llms";
18
+
19
+ /**
20
+ * 让vitepress支持mermaid图表
21
+ * @see https://emersonbottero.github.io/vitepress-plugin-mermaid/guide/getting-started.html
22
+ */
23
+ import { withMermaid } from "vitepress-plugin-mermaid";
24
+ /**
25
+ * 不考虑这种二次包装的写法
26
+ * 本库仅仅是负责二次导出该函数
27
+ * mermaid 需求并不是常用的需求 故设计成让用户自己二次包装使用
28
+ */
29
+ export { withMermaid };
30
+
17
31
  type VitePressSidebarOptions = Parameters<typeof generateSidebar>[0];
18
32
 
19
33
  /** 默认侧边栏配置 */
@@ -107,6 +121,10 @@ const defaultUserConfig: UserConfig<DefaultTheme.Config> = {
107
121
  },
108
122
 
109
123
  plugins: [
124
+ /** @see https://github.com/okineadev/vitepress-plugin-llms */
125
+ // @ts-ignore
126
+ llmstxt(),
127
+
110
128
  // @ts-ignore
111
129
  GitChangelog({
112
130
  // 填写在此处填写您的仓库链接