Skip to content

Commit 9d2268e

Browse files
committed
增加vitepress
1 parent 05785cf commit 9d2268e

File tree

12 files changed

+1089
-2
lines changed

12 files changed

+1089
-2
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,6 @@ storybook-static
3434
.vercel
3535
*.tgz
3636
*.ignore.ts
37+
38+
39+
cache

docs/.vitepress/config.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import { defineConfig } from 'vitepress';
2+
3+
// https://vitepress.dev/reference/site-config
4+
export default defineConfig({
5+
title: '@kaokei/use-vue-service',
6+
description:
7+
'Lightweight Vue 3 state management with dependency injection, inspired by Angular services.',
8+
themeConfig: {
9+
// https://vitepress.dev/reference/default-theme-config
10+
nav: [
11+
{ text: 'Home', link: '/' },
12+
{ text: 'API', link: '/api/' },
13+
{ text: 'Guide', link: '/guide/' },
14+
{ text: 'Note', link: '/note/' },
15+
],
16+
17+
sidebar: {
18+
'/note/': [
19+
{
20+
text: 'Note',
21+
link: '/note/',
22+
items: [
23+
{
24+
text: '父组件与子组件的理解',
25+
link: '/note/01.父组件与子组件的理解',
26+
},
27+
{
28+
text: '子组件获取父组件服务',
29+
link: '/note/02.子组件获取父组件服务',
30+
},
31+
{
32+
text: '父组件获取子组件服务',
33+
link: '/note/03.父组件获取子组件服务',
34+
},
35+
{ text: '不同场景', link: '/note/04.不同场景' },
36+
{ text: '响应式方案', link: '/note/05.响应式方案' },
37+
{ text: '装饰器', link: '/note/06.装饰器' },
38+
{ text: 'SSR-deepseek', link: '/note/07.SSR-deepseek' },
39+
{ text: 'SSR-angular', link: '/note/08.SSR-angular' },
40+
{ text: 'SSR-pinia', link: '/note/09.SSR-pinia' },
41+
{ text: 'SSR', link: '/note/10.SSR' },
42+
{ text: '基本命令', link: '/note/99.基本命令' },
43+
],
44+
},
45+
],
46+
},
47+
48+
socialLinks: [
49+
{ icon: 'github', link: 'https://github.com/kaokei/use-vue-service' },
50+
],
51+
},
52+
});

docs/.vitepress/theme/custom.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.name,
2+
.text {
3+
max-width: 100% !important;
4+
}
5+
6+
.heading .text {
7+
margin: 20px 0;
8+
}

docs/.vitepress/theme/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import DefaultTheme from 'vitepress/theme'
2+
import './custom.css'
3+
4+
export default DefaultTheme

docs/api-examples.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
outline: deep
3+
---
4+
5+
# Runtime API Examples
6+
7+
This page demonstrates usage of some of the runtime APIs provided by VitePress.
8+
9+
The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:
10+
11+
```md
12+
<script setup>
13+
import { useData } from 'vitepress'
14+
15+
const { theme, page, frontmatter } = useData()
16+
</script>
17+
18+
## Results
19+
20+
### Theme Data
21+
<pre>{{ theme }}</pre>
22+
23+
### Page Data
24+
<pre>{{ page }}</pre>
25+
26+
### Page Frontmatter
27+
<pre>{{ frontmatter }}</pre>
28+
```
29+
30+
<script setup>
31+
import { useData } from 'vitepress'
32+
33+
const { site, theme, page, frontmatter } = useData()
34+
</script>
35+
36+
## Results
37+
38+
### Theme Data
39+
<pre>{{ theme }}</pre>
40+
41+
### Page Data
42+
<pre>{{ page }}</pre>
43+
44+
### Page Frontmatter
45+
<pre>{{ frontmatter }}</pre>
46+
47+
## More
48+
49+
Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
File renamed without changes.
File renamed without changes.

docs/index.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
# https://vitepress.dev/reference/default-theme-home-page
3+
layout: home
4+
5+
hero:
6+
name: '@kaokei/use-vue-service'
7+
text: '​Vue 3 状态管理 + 依赖注入'
8+
tagline: vuex/pinia的替代品,灵感来自于 Angular Service。
9+
actions:
10+
- theme: brand
11+
text: Guide
12+
link: /guide/
13+
- theme: alt
14+
text: API
15+
link: /api/
16+
17+
features:
18+
- title: Feature A
19+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
20+
- title: Feature B
21+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
22+
- title: Feature C
23+
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
24+
---

docs/markdown-examples.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
# Markdown Extension Examples
2+
3+
This page demonstrates some of the built-in markdown extensions provided by VitePress.
4+
5+
## Syntax Highlighting
6+
7+
VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:
8+
9+
**Input**
10+
11+
````md
12+
```js{4}
13+
export default {
14+
data () {
15+
return {
16+
msg: 'Highlighted!'
17+
}
18+
}
19+
}
20+
```
21+
````
22+
23+
**Output**
24+
25+
```js{4}
26+
export default {
27+
data () {
28+
return {
29+
msg: 'Highlighted!'
30+
}
31+
}
32+
}
33+
```
34+
35+
## Custom Containers
36+
37+
**Input**
38+
39+
```md
40+
::: info
41+
This is an info box.
42+
:::
43+
44+
::: tip
45+
This is a tip.
46+
:::
47+
48+
::: warning
49+
This is a warning.
50+
:::
51+
52+
::: danger
53+
This is a dangerous warning.
54+
:::
55+
56+
::: details
57+
This is a details block.
58+
:::
59+
```
60+
61+
**Output**
62+
63+
::: info
64+
This is an info box.
65+
:::
66+
67+
::: tip
68+
This is a tip.
69+
:::
70+
71+
::: warning
72+
This is a warning.
73+
:::
74+
75+
::: danger
76+
This is a dangerous warning.
77+
:::
78+
79+
::: details
80+
This is a details block.
81+
:::
82+
83+
## More
84+
85+
Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
File renamed without changes.

0 commit comments

Comments
 (0)