Skip to content

Commit f2bc66c

Browse files
committed
docs: optimized style
1 parent 9b3bbb6 commit f2bc66c

File tree

14 files changed

+94
-60
lines changed

14 files changed

+94
-60
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,15 @@
2424
"@typescript-eslint/eslint-plugin": "^5.33.0",
2525
"@typescript-eslint/parser": "^5.33.0",
2626
"@vitest/ui": "^0.25.3",
27-
"@ruabick/vite-plugin-gen-temp": "^0.2.8",
2827
"@types/fs-extra": "^9.0.13",
2928
"@types/jest": "^29.0.0",
3029
"@types/lodash": "^4.14.178",
3130
"@types/marked": "^4.0.3",
3231
"@types/node": "^17.0.21",
3332
"@types/qs": "^6.9.7",
33+
"@types/markdown-it": "^12.2.3",
3434
"@vitejs/plugin-vue": "^2.3.1",
35+
"@vue-hooks-plus/vite-plugin-gen-temp": "2.6.0",
3536
"@vue-hooks-plus/md-demo-plugins": "^1.0.0",
3637
"@vue-hooks-plus/vitepress": "1.2.3",
3738
"@vue-hooks-plus/vitepress-demo-block": "^1.3.1",
@@ -43,6 +44,7 @@
4344
"eslint-plugin-vue": "^9.6.0",
4445
"husky": "^8.0.1",
4546
"lint-staged": "^13.0.3",
47+
"markdown-it": "^13.0.1",
4648
"vue-eslint-parser": "^9.0.3",
4749
"cross-env": "^7.0.3",
4850
"fast-glob": "^3.2.12",

packages/hooks/docs/.vitepress/config.ts

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { defineConfig } from 'vitepress'
22
import { applyPlugins } from '@vue-hooks-plus/md-demo-plugins'
3-
import { genTemp } from '@ruabick/vite-plugin-gen-temp'
3+
import { genTemp } from '@vue-hooks-plus/vite-plugin-gen-temp'
44
import { resolve } from 'path'
55
import { svg } from './theme/home/iconBase64'
66
import { getRouterConfig } from './router'
7-
// import { ref } from 'vue'
8-
97
const base =
108
process.env.NODE_ENV === 'production'
119
? process.env?.BASE_URL
@@ -15,8 +13,6 @@ const base =
1513

1614
const isGithub = process.env.FLOW === 'github'
1715

18-
// const version = ref()
19-
2016
// fetch('https://api.github.com/repos/InhiblabCore/vue-hooks-plus/releases/latest')
2117
// .then(response => response.json())
2218
// .then(data => {
@@ -74,7 +70,7 @@ export default defineConfig({
7470
locales: {
7571
'/': {
7672
nav: [
77-
{ text: 'Hooks', link: '/useRequest/' },
73+
{ text: 'Hooks', link: '/useRequest/' },
7874
{
7975
text: '演武场',
8076
link: 'http://43.138.187.142:9000/vue-hooks-plus/vhp-playground/',
@@ -85,10 +81,6 @@ export default defineConfig({
8581
link: 'https://inhiblab-core.gitee.io/docs/hooks/',
8682
}
8783
: null,
88-
// {
89-
// text: 'Github 站点',
90-
// link: 'https://inhiblabcore.github.io/docs/hooks/',
91-
// },
9284
{
9385
text: '发行版本',
9486
link: 'https://github.com/InhiblabCore/vue-hooks-plus/releases/',
@@ -98,7 +90,7 @@ export default defineConfig({
9890
},
9991
'/en/': {
10092
nav: [
101-
{ text: 'Hooks', link: '/en/useRequest/' },
93+
{ text: 'Hooks', link: '/en/useRequest/' },
10294
{
10395
text: 'Playground',
10496
link: 'http://43.138.187.142:9000/vue-hooks-plus/vhp-playground/',

packages/hooks/docs/.vitepress/router.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,10 @@ export function getRouterConfig(langPrefix = '/') {
243243
text: langPrefix === '/' ? '📐 UseRequest规范' : '📐 UseRequest specification',
244244
link: `${langPrefix}useRequest/guide/`,
245245
},
246+
// {
247+
// text: langPrefix === '/' ? '🧑‍🏫 在线教程' : '🧑‍🏫 Online Teaching',
248+
// link: `${langPrefix}onlineTeaching/`,
249+
// },
246250
],
247251
},
248252
...getUseRequestRouter(langPrefix),

packages/hooks/docs/.vitepress/theme/home/Home-EN.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
font-size: 16px;
162162
display: inline-block;
163163
background: var(--vhp-getstart-bg);
164-
border-radius: 20px;
164+
border-radius: 12px;
165165
padding: 8px 18px;
166166
font-weight: 500;
167167
transition: background-color 0.5s, color 0.5s;

packages/hooks/docs/.vitepress/theme/home/Home.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<p class="description"> </p>
2121
<p class="actions" style="position: relative; z-index: 9;">
2222
<a class="get-started" href="/docs/hooks/guide/">
23-
Get Started
23+
快速开始
2424
<svg
2525
class="icon"
2626
xmlns="http://www.w3.org/2000/svg"
@@ -96,10 +96,6 @@
9696
<div class="demo-name">
9797
Demo.vue
9898
</div>
99-
100-
<!-- <div class="language-md !bg-transparent">
101-
<pre ref="block" class="text-left whitespace-normal font-mono bg-transparent"></pre>
102-
</div> -->
10399
</DemoEditor>
104100
<!-- <HomeTeam /> -->
105101
</div>
@@ -163,7 +159,7 @@
163159
font-size: 16px;
164160
display: inline-block;
165161
background: var(--vhp-getstart-bg);
166-
border-radius: 20px;
162+
border-radius: 12px;
167163
padding: 8px 18px;
168164
font-weight: 500;
169165
transition: background-color 0.5s, color 0.5s;

packages/hooks/docs/.vitepress/theme/var.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
--vp-home-hero-name-background: -webkit-linear-gradient(315deg, #42d392 25%, #647eff);
1313

1414
--vp-font-color: rgba(41, 65, 86, 1);
15+
// --vp-c-text-code: var(--vp-c-brand);
1516

1617
--vhp-func-bg: rgba(0, 0, 0, 0.08);
1718

packages/hooks/docs/guide/index.en-US.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ import useRequest from 'vue-hooks-plus/es/useRequest'
4343

4444
<br />
4545

46-
::: warning does not contain vue2 :::
46+
::: warning does not contain vue2
47+
48+
:::

packages/hooks/docs/guide/index.zh-CN.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ import useRequest from 'vue-hooks-plus/es/useRequest'
4343

4444
<br />
4545

46-
::: warning 不兼容 vue2 版本 :::
46+
::: warning 不兼容 vue2 版本
47+
48+
:::
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
page: true
3+
title: Tutorial
4+
sidebar: false
5+
aside: false
6+
footer: false
7+
returnToTop: false
8+
---
9+
10+
test
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
layout: home
3+
sidebar: false
4+
---
5+
6+
test

packages/hooks/src/useRequest/docs/basic/index.en-US.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const {
174174
);
175175
```
176176

177-
### Result
177+
## Result
178178

179179
| Property | Description | Type |
180180
| --- | --- | --- |
@@ -190,7 +190,7 @@ const {
190190
| mutate | Mutate `data` directly | `(data?: TData / ((oldData?: TData) => (TData / undefined))) => void` |
191191
| cancel | Ignore the current promise response | `() => void` |
192192

193-
### Options
193+
## Options
194194

195195
| Property | Description | Type | Default |
196196
| --- | --- | --- | --- |

packages/hooks/src/useRequest/docs/basic/index.zh-CN.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ const {
171171
);
172172
```
173173

174-
### Result
174+
## Result
175175

176176
| 参数 | 说明 | 类型 |
177177
| --- | --- | --- |
@@ -187,7 +187,7 @@ const {
187187
| mutate | 直接修改 `data` | `(data?: TData / ((oldData?: TData) => (TData / undefined))) => void` |
188188
| cancel | 取消当前正在进行的请求 | `() => void` |
189189

190-
### Options
190+
## Options
191191

192192
| 参数 | 说明 | 类型 | 默认值 |
193193
| --- | --- | --- | --- |

packages/hooks/src/useRequest/docs/debounce/index.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ debounce 所有参数用法和效果同 [lodash.debounce](https://www.lodashjs.c
2626
| debounceTrailing | 在延迟结束后执行调用 | `boolean`\|`Ref<boolean>` | `true` |
2727
| debounceMaxWait | 允许被延迟的最大值 | `number`\|`Ref<number>` | - |
2828

29-
::: warning 注意
29+
:::warning 注意
3030

3131
- `options.debounceLeading` 支持动态变化。
3232
- `options.debounceTrailing` 支持动态变化。

pnpm-lock.yaml

Lines changed: 53 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)