@ruan-cat/vitepress-preset-config 1.3.0 → 2.0.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.d.mts +42 -2
- package/dist/config.mjs +74 -42
- package/dist/theme.d.mts +0 -2
- package/dist/theme.mjs +4 -1
- package/package.json +10 -10
- package/src/config/index.ts +4 -0
- package/src/config/plugins.ts +53 -0
- package/src/config/teek.ts +59 -0
- package/src/config.mts +38 -86
- package/src/index.ts +6 -0
- package/src/theme.ts +7 -1
- package/src/types.ts +49 -0
- package/src/.vitepress/config.mts +0 -35
- package/src/.vitepress/theme/index.ts +0 -15
- package/src/.vitepress/theme/style.css +0 -130
- package/src/bug-to-fix/code-line-number-bug/code/001/index.ts +0 -9
- package/src/bug-to-fix/code-line-number-bug/code/001/raw-code-twoslash.txt +0 -17
- package/src/bug-to-fix/code-line-number-bug/code/001/raw-code.txt +0 -11
- package/src/bug-to-fix/code-line-number-bug/code/002/index.ts +0 -56
- package/src/bug-to-fix/code-line-number-bug/code/002/raw-code-twoslash.txt +0 -89
- package/src/bug-to-fix/code-line-number-bug/code/002/raw-code.txt +0 -70
- package/src/bug-to-fix/code-line-number-bug/try-to-fix-lineNumberPlugin.ts +0 -49
package/src/types.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import llmstxt from "vitepress-plugin-llms";
|
|
2
|
+
import { GitChangelog, type GitChangelogMarkdownSectionOptions } from "@nolebase/vitepress-plugin-git-changelog/vite";
|
|
3
|
+
|
|
4
|
+
// https://vp.teek.top/guide/quickstart.html#teek-引入
|
|
5
|
+
import { defineTeekConfig } from "vitepress-theme-teek/config";
|
|
6
|
+
|
|
7
|
+
export type LlmstxtSettings = NonNullable<Parameters<typeof llmstxt>[0]>;
|
|
8
|
+
|
|
9
|
+
export type GitChangelogOptions = NonNullable<Parameters<typeof GitChangelog>[0]>;
|
|
10
|
+
|
|
11
|
+
export type TeekConfigOptions = NonNullable<Parameters<typeof defineTeekConfig>[0]>;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* 额外的配置
|
|
15
|
+
* @description
|
|
16
|
+
* 目前主要用于精细化配置 vitepress 的插件
|
|
17
|
+
*/
|
|
18
|
+
export interface ExtraConfig {
|
|
19
|
+
/**
|
|
20
|
+
* 即 vite 的 plugins
|
|
21
|
+
* @description
|
|
22
|
+
* vitepress 配置的一系列插件
|
|
23
|
+
*/
|
|
24
|
+
plugins?: {
|
|
25
|
+
/**
|
|
26
|
+
* @description 用于配置 vitepress-plugin-llms 插件
|
|
27
|
+
* @see https://github.com/okineadev/vitepress-plugin-llms
|
|
28
|
+
*/
|
|
29
|
+
llmstxt?: LlmstxtSettings | false;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @description 用于配置 @nolebase/vitepress-plugin-git-changelog 插件
|
|
33
|
+
* @see
|
|
34
|
+
*/
|
|
35
|
+
gitChangelog?: GitChangelogOptions | false;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* @description 用于配置 @nolebase/vitepress-plugin-git-changelog-markdown-section 插件
|
|
39
|
+
* @see
|
|
40
|
+
*/
|
|
41
|
+
gitChangelogMarkdownSection?: GitChangelogMarkdownSectionOptions | false;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Teek 主题配置
|
|
46
|
+
* @see https://vp.teek.top/reference/config.html
|
|
47
|
+
*/
|
|
48
|
+
teekConfig?: TeekConfigOptions;
|
|
49
|
+
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// 避免直接使用自己的包
|
|
2
|
-
// import { setUserConfig, setGenerateSidebar, addChangelog2doc } from "@ruan-cat/vitepress-preset-config/config";
|
|
3
|
-
// @ts-ignore
|
|
4
|
-
import { setUserConfig, setGenerateSidebar, addChangelog2doc } from "../config.mts";
|
|
5
|
-
import { description } from "../../package.json";
|
|
6
|
-
|
|
7
|
-
addChangelog2doc({
|
|
8
|
-
target: "./src",
|
|
9
|
-
data: {
|
|
10
|
-
order: 1000,
|
|
11
|
-
},
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 本文档的渲染配置
|
|
16
|
-
*/
|
|
17
|
-
const thisDocUserConfig = setUserConfig({
|
|
18
|
-
title: "vitepress预设配置",
|
|
19
|
-
description,
|
|
20
|
-
themeConfig: {
|
|
21
|
-
socialLinks: [
|
|
22
|
-
{
|
|
23
|
-
icon: "github",
|
|
24
|
-
link: "https://github.com/ruan-cat/monorepo/tree/main/packages/vitepress-preset-config",
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
// @ts-ignore
|
|
31
|
-
thisDocUserConfig.themeConfig.sidebar = setGenerateSidebar({
|
|
32
|
-
documentRootPath: "./src",
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
export default thisDocUserConfig;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { defineRuancatPresetTheme } from "@ruan-cat/vitepress-preset-config/theme";
|
|
2
|
-
import type { EnhanceAppContext } from "vitepress";
|
|
3
|
-
|
|
4
|
-
// 增加用户自定义样式
|
|
5
|
-
import "./style.css";
|
|
6
|
-
|
|
7
|
-
// 全局导入element-plus组件 并全局注册
|
|
8
|
-
import ElementPlus from "element-plus";
|
|
9
|
-
import "element-plus/dist/index.css";
|
|
10
|
-
|
|
11
|
-
export default defineRuancatPresetTheme({
|
|
12
|
-
enhanceAppCallBack({ app, router, siteData }) {
|
|
13
|
-
app.use(ElementPlus);
|
|
14
|
-
},
|
|
15
|
-
});
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Customize default theme styling by overriding CSS variables:
|
|
3
|
-
* https://github.com/vuejs/vitepress/blob/main/src/client/theme-default/styles/vars.css
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Colors
|
|
8
|
-
*
|
|
9
|
-
* Each colors have exact same color scale system with 3 levels of solid
|
|
10
|
-
* colors with different brightness, and 1 soft color.
|
|
11
|
-
*
|
|
12
|
-
* - `XXX-1`: The most solid color used mainly for colored text. It must
|
|
13
|
-
* satisfy the contrast ratio against when used on top of `XXX-soft`.
|
|
14
|
-
*
|
|
15
|
-
* - `XXX-2`: The color used mainly for hover state of the button.
|
|
16
|
-
*
|
|
17
|
-
* - `XXX-3`: The color for solid background, such as bg color of the button.
|
|
18
|
-
* It must satisfy the contrast ratio with pure white (#ffffff) text on
|
|
19
|
-
* top of it.
|
|
20
|
-
*
|
|
21
|
-
* - `XXX-soft`: The color used for subtle background such as custom container
|
|
22
|
-
* or badges. It must satisfy the contrast ratio when putting `XXX-1` colors
|
|
23
|
-
* on top of it.
|
|
24
|
-
*
|
|
25
|
-
* The soft color must be semi transparent alpha channel. This is crucial
|
|
26
|
-
* because it allows adding multiple "soft" colors on top of each other
|
|
27
|
-
* to create a accent, such as when having inline code block inside
|
|
28
|
-
* custom containers.
|
|
29
|
-
*
|
|
30
|
-
* - `default`: The color used purely for subtle indication without any
|
|
31
|
-
* special meanings attched to it such as bg color for menu hover state.
|
|
32
|
-
*
|
|
33
|
-
* - `brand`: Used for primary brand colors, such as link text, button with
|
|
34
|
-
* brand theme, etc.
|
|
35
|
-
*
|
|
36
|
-
* - `tip`: Used to indicate useful information. The default theme uses the
|
|
37
|
-
* brand color for this by default.
|
|
38
|
-
*
|
|
39
|
-
* - `warning`: Used to indicate warning to the users. Used in custom
|
|
40
|
-
* container, badges, etc.
|
|
41
|
-
*
|
|
42
|
-
* - `danger`: Used to show error, or dangerous message to the users. Used
|
|
43
|
-
* in custom container, badges, etc.
|
|
44
|
-
* -------------------------------------------------------------------------- */
|
|
45
|
-
|
|
46
|
-
:root {
|
|
47
|
-
--vp-c-default-1: var(--vp-c-gray-1);
|
|
48
|
-
--vp-c-default-2: var(--vp-c-gray-2);
|
|
49
|
-
--vp-c-default-3: var(--vp-c-gray-3);
|
|
50
|
-
--vp-c-default-soft: var(--vp-c-gray-soft);
|
|
51
|
-
|
|
52
|
-
--vp-c-brand-1: var(--vp-c-indigo-1);
|
|
53
|
-
--vp-c-brand-2: var(--vp-c-indigo-2);
|
|
54
|
-
--vp-c-brand-3: var(--vp-c-indigo-3);
|
|
55
|
-
--vp-c-brand-soft: var(--vp-c-indigo-soft);
|
|
56
|
-
|
|
57
|
-
--vp-c-tip-1: var(--vp-c-brand-1);
|
|
58
|
-
--vp-c-tip-2: var(--vp-c-brand-2);
|
|
59
|
-
--vp-c-tip-3: var(--vp-c-brand-3);
|
|
60
|
-
--vp-c-tip-soft: var(--vp-c-brand-soft);
|
|
61
|
-
|
|
62
|
-
--vp-c-warning-1: var(--vp-c-yellow-1);
|
|
63
|
-
--vp-c-warning-2: var(--vp-c-yellow-2);
|
|
64
|
-
--vp-c-warning-3: var(--vp-c-yellow-3);
|
|
65
|
-
--vp-c-warning-soft: var(--vp-c-yellow-soft);
|
|
66
|
-
|
|
67
|
-
--vp-c-danger-1: var(--vp-c-red-1);
|
|
68
|
-
--vp-c-danger-2: var(--vp-c-red-2);
|
|
69
|
-
--vp-c-danger-3: var(--vp-c-red-3);
|
|
70
|
-
--vp-c-danger-soft: var(--vp-c-red-soft);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Component: Button
|
|
75
|
-
* -------------------------------------------------------------------------- */
|
|
76
|
-
|
|
77
|
-
:root {
|
|
78
|
-
--vp-button-brand-border: transparent;
|
|
79
|
-
--vp-button-brand-text: var(--vp-c-white);
|
|
80
|
-
--vp-button-brand-bg: var(--vp-c-brand-3);
|
|
81
|
-
--vp-button-brand-hover-border: transparent;
|
|
82
|
-
--vp-button-brand-hover-text: var(--vp-c-white);
|
|
83
|
-
--vp-button-brand-hover-bg: var(--vp-c-brand-2);
|
|
84
|
-
--vp-button-brand-active-border: transparent;
|
|
85
|
-
--vp-button-brand-active-text: var(--vp-c-white);
|
|
86
|
-
--vp-button-brand-active-bg: var(--vp-c-brand-1);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
* Component: Home
|
|
91
|
-
* -------------------------------------------------------------------------- */
|
|
92
|
-
|
|
93
|
-
:root {
|
|
94
|
-
--vp-home-hero-name-color: transparent;
|
|
95
|
-
--vp-home-hero-name-background: -webkit-linear-gradient(120deg, #bd34fe 30%, #41d1ff);
|
|
96
|
-
|
|
97
|
-
--vp-home-hero-image-background-image: linear-gradient(-45deg, #bd34fe 50%, #47caff 50%);
|
|
98
|
-
--vp-home-hero-image-filter: blur(44px);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@media (min-width: 640px) {
|
|
102
|
-
:root {
|
|
103
|
-
--vp-home-hero-image-filter: blur(56px);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
@media (min-width: 960px) {
|
|
108
|
-
:root {
|
|
109
|
-
--vp-home-hero-image-filter: blur(68px);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Component: Custom Block
|
|
115
|
-
* -------------------------------------------------------------------------- */
|
|
116
|
-
|
|
117
|
-
:root {
|
|
118
|
-
--vp-custom-block-tip-border: transparent;
|
|
119
|
-
--vp-custom-block-tip-text: var(--vp-c-text-1);
|
|
120
|
-
--vp-custom-block-tip-bg: var(--vp-c-brand-soft);
|
|
121
|
-
--vp-custom-block-tip-code-bg: var(--vp-c-brand-soft);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Component: Algolia
|
|
126
|
-
* -------------------------------------------------------------------------- */
|
|
127
|
-
|
|
128
|
-
.DocSearch {
|
|
129
|
-
--docsearch-primary-color: var(--vp-c-brand-1) !important;
|
|
130
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code twoslash lsp" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>TestType</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> TestType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
2
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
3
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> age</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
4
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre></code></span></template></v-menu></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
5
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>name</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string</span></code></span></template></v-menu></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
6
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>age</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">age</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: number</span></code></span></template></v-menu></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
7
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">};</span></span>
|
|
8
|
-
<span class="line"></span>
|
|
9
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>testType</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> testType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> TestType</span></code></span></template></v-menu></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>TestType</span><template
|
|
10
|
-
v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> TestType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
11
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
12
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> age</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
13
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}</span></span></code></pre></code></span></template></v-menu></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
14
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>name</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">name</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"test"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
15
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>age</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">age</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: number</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">18</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
16
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">};</span></span></code></pre>
|
|
17
|
-
</div>
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0" v-pre=""><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> type</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> TestType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
2
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> name</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> string</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
3
|
-
<span class="line"><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"> age</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> number</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
4
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">};</span></span>
|
|
5
|
-
<span class="line"></span>
|
|
6
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> const</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> testType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> TestType</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> =</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
7
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> name:
|
|
8
|
-
</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"test"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
9
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> age: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">18</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
10
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">};</span></span></code></pre>
|
|
11
|
-
</div>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from "vitepress";
|
|
2
|
-
|
|
3
|
-
// https://vitepress.dev/reference/site-config
|
|
4
|
-
|
|
5
|
-
import { transformerTwoslash } from "@shikijs/vitepress-twoslash";
|
|
6
|
-
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
import { lineNumberPlugin } from "./temp-plugins/temp-lineNumberPlugin";
|
|
9
|
-
|
|
10
|
-
export default defineConfig({
|
|
11
|
-
title: "My Awesome Project",
|
|
12
|
-
description: "A VitePress Site",
|
|
13
|
-
themeConfig: {
|
|
14
|
-
// https://vitepress.dev/reference/default-theme-config
|
|
15
|
-
nav: [
|
|
16
|
-
{ text: "Home", link: "/" },
|
|
17
|
-
{ text: "Examples", link: "/markdown-examples" },
|
|
18
|
-
],
|
|
19
|
-
|
|
20
|
-
sidebar: [
|
|
21
|
-
{
|
|
22
|
-
text: "Examples",
|
|
23
|
-
items: [
|
|
24
|
-
{ text: "Markdown Examples", link: "/markdown-examples" },
|
|
25
|
-
{ text: "Runtime API Examples", link: "/api-examples" },
|
|
26
|
-
],
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
|
|
30
|
-
socialLinks: [
|
|
31
|
-
{ icon: "github", link: "https://github.com/vuejs/vitepress" },
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
|
|
35
|
-
vite: {
|
|
36
|
-
server: {
|
|
37
|
-
open: true,
|
|
38
|
-
port: 8080,
|
|
39
|
-
},
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
markdown: {
|
|
43
|
-
codeTransformers: [
|
|
44
|
-
// @ts-ignore
|
|
45
|
-
transformerTwoslash(),
|
|
46
|
-
],
|
|
47
|
-
|
|
48
|
-
config(md) {
|
|
49
|
-
// @ts-ignore
|
|
50
|
-
md.use(lineNumberPlugin, true);
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
// Explicitly load these languages for types hightlighting
|
|
54
|
-
// languages: ["js", "jsx", "ts", "tsx"] as LanguageInput[],
|
|
55
|
-
},
|
|
56
|
-
});
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
<div class="language-ts vp-adaptive-theme"><button title="Copy Code" class="copy"></button><span class="lang">ts</span><pre class="shiki shiki-themes github-light github-dark vp-code twoslash lsp" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>defineConfig</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> defineConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> UserConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">DefaultTheme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Config</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> UserConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">DefaultTheme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Config</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></code><div class="twoslash-popup-docs vp-doc"><p>Type config helper</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">
|
|
2
|
-
"vitepress"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
3
|
-
<span class="line"></span>
|
|
4
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// https://vitepress.dev/reference/site-config</span></span>
|
|
5
|
-
<span class="line"></span>
|
|
6
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>transformerTwoslash</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> transformerTwoslash</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> VitePressPluginTwoslashOptions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> ShikiTransformer</span></code><div class="twoslash-popup-docs vp-doc"><p>Create a Shiki transformer for VitePress to enable twoslash integration</p>
|
|
7
|
-
<p>Add this to <code>markdown.codeTransformers</code> in <code>.vitepress/config.ts</code></p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> "@shikijs/vitepress-twoslash"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
8
|
-
<span class="line"></span>
|
|
9
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D">// @ts-ignore</span></span>
|
|
10
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>lineNumberPlugin</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> lineNumberPlugin</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> } </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">from</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF"> "./temp-plugins/temp-lineNumberPlugin"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
11
|
-
<span class="line"></span>
|
|
12
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">export</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> default</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>defineConfig</span><template
|
|
13
|
-
v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> defineConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> UserConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">DefaultTheme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Config</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> UserConfig</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">DefaultTheme</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">Config</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">></span></code><div class="twoslash-popup-docs vp-doc"><p>Type config helper</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">({</span></span>
|
|
14
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>title</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">LocaleSpecificConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.title</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"My Awesome Project"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
15
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>description</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">LocaleSpecificConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.description</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"A VitePress Site"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
16
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>themeConfig</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">LocaleSpecificConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.themeConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> DefaultTheme.Config </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
|
|
17
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> // https://vitepress.dev/reference/default-theme-config</span></span>
|
|
18
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>nav</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config.nav</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> DefaultTheme.NavItem[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The nav items.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span></span>
|
|
19
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>text</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">text</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Home"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>link</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.NavItemWithLink.link: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
20
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>text</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">text</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>link</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.NavItemWithLink.link: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/markdown-examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
21
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ],</span></span>
|
|
22
|
-
<span class="line"></span>
|
|
23
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>sidebar</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config.sidebar</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> DefaultTheme.Sidebar </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The sidebar items.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span></span>
|
|
24
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
25
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
26
|
-
</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>text</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">text</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The text label of the item.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
27
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
28
|
-
</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>items</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">items</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
|
|
29
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> text</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string;</span></span>
|
|
30
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> link</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: string;</span></span>
|
|
31
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}[]</span></span></code></pre></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span></span>
|
|
32
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
33
|
-
{ </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>text</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">text</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The text label of the item.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Markdown Examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover"
|
|
34
|
-
popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>link</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">link</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The link of the item.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/markdown-examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
35
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
36
|
-
{ </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>text</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">text</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The text label of the item.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"Runtime API Examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>link</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">link</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The link of the item.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"/api-examples"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
37
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
38
|
-
],</span></span>
|
|
39
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
40
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ],</span></span>
|
|
41
|
-
<span class="line"></span>
|
|
42
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>socialLinks</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config.socialLinks</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> DefaultTheme.SocialLink[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>The social links to be displayed at the end of the nav bar. Perfect for
|
|
43
|
-
placing links to social services such as GitHub, Twitter, Facebook, etc.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span></span>
|
|
44
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> { </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>icon</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.SocialLink.icon: DefaultTheme.SocialLinkIcon</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"github"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>link</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.SocialLink.link: string</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">"https://github.com/vuejs/vitepress"</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
45
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ],</span></span>
|
|
46
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
47
|
-
<span class="line"></span>
|
|
48
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>vite</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">UserConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.vite</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (UserConfig </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">&</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> {</span></span>
|
|
49
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> configFile?: string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> false</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">;</span></span>
|
|
50
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">}) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></span></code></pre></code><div class="twoslash-popup-docs vp-doc"><p>Vite config</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
|
|
51
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>server</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">UserConfig.server</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ServerOptions </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>Server specific options, e.g. host, port, https...</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
|
|
52
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>open</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">CommonServerOptions.open</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> string </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> boolean </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>Open browser window on startup</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
53
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>port</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">CommonServerOptions.port</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> number </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>Specify server port. Note if
|
|
54
|
-
the port is already being used, Vite will
|
|
55
|
-
automatically try the next available port so this may not be the actual
|
|
56
|
-
port the server ends up listening on.</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">8080</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">,</span></span>
|
|
57
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
58
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
59
|
-
<span class="line"></span>
|
|
60
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>markdown</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">UserConfig</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">DefaultTheme.Config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.markdown</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> MarkdownOptions </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>MarkdownIt options</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: {</span></span>
|
|
61
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>codeTransformers</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">MarkdownOptions.codeTransformers</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ShikiTransformer[] </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>Transformers applied to code blocks</p></div><div class="twoslash-popup-docs twoslash-popup-docs-tags vp-doc"><span class="twoslash-popup-docs-tag"><span class="twoslash-popup-docs-tag-name">@see</span><span class="twoslash-popup-docs-tag-value"><a href="https://shiki.style/guide/transformers">https://shiki.style/guide/transformers</a></span></span></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: [</span></span>
|
|
62
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> // @ts-ignore</span></span>
|
|
63
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>transformerTwoslash</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> transformerTwoslash</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> VitePressPluginTwoslashOptions</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> ShikiTransformer</span></code><div class="twoslash-popup-docs vp-doc"><p>Create a Shiki transformer for VitePress to enable
|
|
64
|
-
twoslash integration</p>
|
|
65
|
-
<p>Add this to <code>markdown.codeTransformers</code> in <code>.vitepress/config.ts</code></p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(),</span></span>
|
|
66
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ],</span></span>
|
|
67
|
-
<span class="line"></span>
|
|
68
|
-
<span class="line"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>config</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">MarkdownOptions.config</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> ((</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">md</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">:</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> MarkdownIt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=></span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"> void</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span></code><div class="twoslash-popup-docs vp-doc"><p>Setup markdown-it instance</p></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>md</span><template
|
|
69
|
-
v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">md</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: MarkdownIt</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
|
|
70
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> // @ts-ignore</span></span>
|
|
71
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> </span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>md</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">md</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">: MarkdownIt</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>use</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">MarkdownIt.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">use</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">boolean</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">>(plugin: PluginWithOptions</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583"><</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">boolean</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, options</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">?:</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> boolean </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">|</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF"> undefined</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">): </span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">MarkdownIt</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">+</span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">2</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> overloads)</span></code><div class="twoslash-popup-docs vp-doc"><p><em>chainable</em></p>
|
|
72
|
-
<p>Load specified plugin with given params into current parser instance.
|
|
73
|
-
It's just a sugar to call <code>plugin(md, params)</code> with curring.</p>
|
|
74
|
-
<h5>Example</h5>
|
|
75
|
-
<code><pre class="shiki shiki-themes github-light github-dark" style="--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e" tabindex="0"><code><span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">var</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> iterator </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> require</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'markdown-it-for-inline'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
|
|
76
|
-
<span class="line"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">var</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> md </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0"> require</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'markdown-it'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">)()</span></span>
|
|
77
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
78
|
-
.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">use</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(iterator, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'foo_replace'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'text'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">function</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> (</span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">tokens</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#E36209;--shiki-dark:#FFAB70">idx</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">) {</span></span>
|
|
79
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
80
|
-
tokens[idx].content </span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">=</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> tokens[idx].content.</span><span style="--shiki-light:#6F42C1;--shiki-dark:#B392F0">replace</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/</span><span style="--shiki-light:#032F62;--shiki-dark:#DBEDFF">foo</span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">/</span><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">g</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#032F62;--shiki-dark:#9ECBFF">'bar'</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
|
|
81
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">
|
|
82
|
-
});</span></span></code></pre></code></div></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">(</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"><v-menu class="twoslash-hover" popper-class="shiki twoslash-floating vp-copy-ignore" theme="twoslash"><span>lineNumberPlugin</span><template v-slot:popper="{}"><span class="twoslash-popup-container vp-copy-ignore" v-pre=""><code class="twoslash-popup-code"><span style="--shiki-light:#D73A49;--shiki-dark:#F97583">import</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> lineNumberPlugin</span></code></span></template></v-menu></span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">, </span><span style="--shiki-light:#005CC5;--shiki-dark:#79B8FF">true</span><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">);</span></span>
|
|
83
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
84
|
-
<span class="line"></span>
|
|
85
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> // Explicitly load these languages for types hightlighting</span></span>
|
|
86
|
-
<span class="line"><span style="--shiki-light:#6A737D;--shiki-dark:#6A737D"> // languages: ["js", "jsx", "ts", "tsx"] as LanguageInput[],</span></span>
|
|
87
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8"> },</span></span>
|
|
88
|
-
<span class="line"><span style="--shiki-light:#24292E;--shiki-dark:#E1E4E8">});</span></span></code></pre>
|
|
89
|
-
</div>
|