8000 docs: update rspress, add SourceCode · Yukiniro/toukey@cc930dd · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit cc930dd

Browse files
committed
docs: update rspress, add SourceCode
1 parent 866740e commit cc930dd

File tree

4 files changed

+1064
-1388
lines changed

4 files changed

+1064
-1388
lines changed

site/docs/en/api/index.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# API
22

3+
import { SourceCode } from 'rspress/theme'
4+
35
## subscribe
46

7+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L107' />
8+
59
Subscribe the key's keyboard event.
610

711
- Params
@@ -30,6 +34,8 @@ unsubscribe();
3034

3135
## on
3236

37+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L251' />
38+
3339
`on` is an alias for `subscribe`.
3440

3541
:::info
@@ -38,6 +44,8 @@ Why is there an alias? Because `on` and `off` is more in line with the semantics
3844

3945
## off
4046

47+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L262' />
48+
4149
`off` could cancel the event listener.
4250

4351
- Params
@@ -55,6 +63,8 @@ If the `handler` and `options` is not set, all event listeners of the key will b
5563

5664
## getScope
5765

66+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L187' />
67+
5868
Get the scope of the current keyboard event.
5969

6070
```javascript
@@ -65,6 +75,8 @@ const scope = getScope();
6575

6676
## setScope
6777

78+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L195' />
79+
6880
Set the scope of the current keyboard event.
6981

7082
- Params
@@ -78,6 +90,8 @@ setScope("scope");
7890

7991
## deleteScope
8092

93+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L206' />
94+
8195
Delete the scope of the current keyboard event.
8296

8397
- Params
@@ -91,6 +105,8 @@ deleteScope("scope");
91105

92106
## enable
93107

108+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L226' />
109+
94110
Enable the key event.
95111

96112
```javascript
@@ -101,6 +117,8 @@ enable();
101117

102118
## disable
103119

120+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L233' />
121+
104122
Disable the key event.
105123

106124
```javascript
@@ -111,6 +129,8 @@ disable();
111129

112130
## isEnable
113131

132+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L240' />
133+
114134
Get the status of the key event.
115135

116136
```javascript
@@ -121,6 +141,8 @@ const status = isEnable();
121141

122142
## clearAll
123143

144+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L216' />
145+
124146
Clear all key events.
125147

126148
```javascript

site/docs/zh/api/index.mdx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
# API
22

3+
import { SourceCode } from 'rspress/theme'
4+
35
## subscribe
46

7+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L107' />
8+
59
订阅键盘事件。
610

711
- 参数
@@ -30,6 +34,8 @@ unsubscribe();
3034

3135
## on
3236

37+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L251' />
38+
3339
`on``subscribe` 的别名。
3440

3541
:::info
@@ -38,6 +44,8 @@ unsubscribe();
3844

3945
## off
4046

47+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L262' />
48+
4149
`off` 可以取消事件监听器。
4250

4351
- Params
@@ -55,6 +63,8 @@ unsubscribe();
5563

5664
## getScope
5765

66+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L187' />
67+
5868
获取当前键盘事件的范围。
5969

6070
```javascript
@@ -65,6 +75,8 @@ const scope = getScope();
6575

6676
## setScope
6777

78+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L195' />
79+
6880
设置当前键盘事件的范围。
6981

7082
- 参数
@@ -78,6 +90,8 @@ setScope("scope");
7890

7991
## deleteScope
8092

93+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L206' />
94+
8195
删除指定键盘事件的范围。
8296

8397
- Params
@@ -91,6 +105,8 @@ deleteScope("scope");
91105

92106
## enable
93107

108+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L226' />
109+
94110
启用键盘事件。
95111

96112
```javascript
@@ -101,6 +117,8 @@ enable();
101117

102118
## disable
103119

120+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L233' />
121+
104122
禁用键盘事件。
105123

106124
```javascript
@@ -111,6 +129,8 @@ disable();
111129

112130
## isEnable
113131

132+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L240' />
133+
114134
获取键盘事件的状态。
115135

116136
```javascript
@@ -121,6 +141,8 @@ const status = isEnable();
121141

122142
## clearAll
123143

144+
<SourceCode href='https://github.com/Yukiniro/toukey/blob/master/src/index.ts#L216' />
145+
124146
清除所有键盘事件。
125147

126148
```javascript

site/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"preview": "rspress preview"
99
},
1010
"dependencies": {
11-
"rspress": "^1.7.5"
11+
"rspress": "^1.8.3"
1212
},
1313
"devDependencies": {
1414
"@types/node": "^16"

0 commit comments

Comments
 (0)
0