vitepress-plugin-sfc 2.0.0-beta.2 → 2.0.0-beta.3
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/README.md +19 -4
- package/dist/index.d.mts +13 -1065
- package/dist/index.mjs +5 -5
- package/package.json +9 -6
- package/src/client/ComponentView.vue +35 -154
- package/src/client/GroupTabs.vue +126 -0
- package/src/client/index.ts +42 -16
- package/src/client/useLocaleMappings.ts +0 -31
package/README.md
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
# VitePress Plugin SFC
|
|
2
2
|
|
|
3
|
-
[Documentation](https://vitepress-plugin-sfc-playgrou.vercel.app/)
|
|
3
|
+
[Documentation](https://vitepress-plugin-sfc-playgrou.vercel.app/) | [中文](README-zh-CN.md)
|
|
4
4
|
|
|
5
5
|
Allows you to write Vue SFC within Markdown files and render them in VitePress.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```shell
|
|
10
|
-
npm install -D vitepress-plugin-sfc
|
|
10
|
+
npm install -D vitepress-plugin-sfc@latest
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## Configuration
|
|
14
14
|
|
|
15
|
-
Configure it in `.vitepress/config.ts`:
|
|
15
|
+
Configure it in `.vitepress/config.ts` and `.vitepress/theme/index.ts`:
|
|
16
|
+
|
|
17
|
+
`.vitepress/config.ts`
|
|
16
18
|
|
|
17
19
|
```ts
|
|
18
20
|
import { defineConfig } from "vitepress";
|
|
19
21
|
import { sfcPlugin, sfcRegistryVitePlugin } from "vitepress-plugin-sfc";
|
|
20
22
|
|
|
21
23
|
export default defineConfig({
|
|
22
|
-
// ...other configurations
|
|
23
24
|
markdown: {
|
|
24
25
|
config: (md) => {
|
|
25
26
|
md.use(sfcPlugin);
|
|
@@ -31,6 +32,20 @@ export default defineConfig({
|
|
|
31
32
|
});
|
|
32
33
|
```
|
|
33
34
|
|
|
35
|
+
`.vitepress/theme/index.ts`
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import DefaultTheme from "vitepress/theme";
|
|
39
|
+
import { enhanceAppWithComponentView } from "vitepress-plugin-sfc/client";
|
|
40
|
+
|
|
41
|
+
export default {
|
|
42
|
+
extends: DefaultTheme,
|
|
43
|
+
enhanceApp({ app }) {
|
|
44
|
+
enhanceAppWithComponentView(app);
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
```
|
|
48
|
+
|
|
34
49
|
## Usage
|
|
35
50
|
|
|
36
51
|
Wrap **valid** Vue SFC content with `:::sfc`:
|