Skip to content

Commit a361140

Browse files
committed
update
1 parent e48498d commit a361140

File tree

5 files changed

+36
-19
lines changed

5 files changed

+36
-19
lines changed

content/en/docs/tutorial/config.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ A simple example:
3535
"bongocat": "/example/bongocat.html"
3636
},
3737
"startup": ["example.bar", "example.dock"],
38-
"services": ["notifd.added:/notify.html"]
38+
"services": [
39+
{
40+
"event": "notifd.added",
41+
"page": "/notify.html"
42+
},
43+
{
44+
"event": "polkitAgent.begin",
45+
"page": "/example/polkitAgent.html",
46+
"single": false
47+
}
48+
]
3949
}
4050
```
4151

@@ -59,17 +69,16 @@ It’s a list of strings, where each item is a page name—either an alias or a
5969

6070
## Services
6171

62-
The `services` field defines services to be registered while mika-shell is running.
63-
It’s a list of strings in the format `<event-name>:<page>`, where `event-name` is the name of a mika-shell event and `page` is the page to open (alias or full path).
72+
The `services` field is used to configure the services registered at runtime in mika-shell.
73+
In this field, `event` refers to the name of the mika-shell event, and `page` refers to the page to be opened (either an alias or a full web page path).
6474

65-
When the specified event occurs, the given page is opened and the event’s data is passed to the page via a query string.
66-
You can access the data in JavaScript like this:
75+
When the specified event occurs, the assigned page will automatically open, and the event data will be passed to the page via a query string. The event data can be retrieved in the web page using
6776

6877
```javascript
6978
const data = new URLSearchParams(window.location.search).get('data')
7079
```
7180

72-
Once the registered page is opened by the event, that service will not trigger again until the page is closed.
81+
If the `single` field is set to `true`, once the registered page is opened by the event, the service will not be triggered again until the target page is closed.
7382

7483
You can find valid `event-name` values here: [Event List](https://github.com/MikaShell/mika-shell/blob/main/src/events.zig#L2).
7584

content/zh-cn/docs/tutorial/config.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,17 @@ mika-shell 将网页(html)显示到桌面上,所以我们首先得有用
3030
"bongocat": "/example/bongocat.html"
3131
},
3232
"startup": ["example.bar", "example.dock"],
33-
"services": ["notifd.added:/notify.html"]
33+
"services": [
34+
{
35+
"event": "notifd.added",
36+
"page": "/notify.html"
37+
},
38+
{
39+
"event": "polkitAgent.begin",
40+
"page": "/example/polkitAgent.html",
41+
"single": false
42+
}
43+
]
3444
}
3545
```
3646

@@ -50,15 +60,15 @@ mika-shell 将网页(html)显示到桌面上,所以我们首先得有用
5060

5161
## Services
5262

53-
`services` 字段用于设置 mika-shell 运行时注册的服务。它是一个"字符串列表",其中的每一项格式为 `<event-name>:<page>`其中 `evebt-name` 是 mika-shell 事件的名称,`page` 是要打开的页面的名称(alias 名称或完整的网页路径)。
63+
`services` 字段用于设置 mika-shell 运行时注册的服务。其中 `event` 是 mika-shell 事件的名称,`page` 是要打开的页面的名称(alias 名称或完整的网页路径)。
5464

5565
当所设定的事件发生时,会自动打开指定的页面并且将事件的数据通过 `query string` 传递给页面。事件的数据可以在网页中通过 js 代码获取:
5666

5767
```javascript
5868
const data = new URLSearchParams(window.location.search).get('data')
5969
```
6070

61-
在注册的页面被事件打开之后,直到目标页面关闭之前,这个 service 不会再被触发。
71+
`single` 字段为 `true` 时,注册的页面被事件打开之后,直到目标页面关闭之前,这个 service 不会再被触发。
6272

6373
`event-name` 可以在这里找到:[事件列表](https://github.com/MikaShell/mika-shell/blob/main/src/events.zig#L2)
6474

hugo_stats.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@
196196
"mt-n3",
197197
"mx-2",
198198
"mx-auto",
199-
"mx-xl-auto",
200199
"my-3",
201200
"nav",
202201
"nav-item",
@@ -263,7 +262,6 @@
263262
"title",
264263
"title-submitted",
265264
"toc-mobile",
266-
"untranslated",
267265
"visually-hidden",
268266
"w-100",
269267
"wrap"

i18n/en.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ get_started = "Get Started"
33
features1-title = "Enjoy the Existing Web Tech Ecosystem"
44
features1-text = "It’s just about building front-end pages. Whether you use React, Angular, Vue, or any other stack, you can easily integrate it into your project."
55

6-
features2-title = "Combine Multiple Front-End Projects"
7-
features2-text = "If you’re fond of several front-end projects at once, you can combine them with just a few simple configuration changes."
6+
features2-title = "Easy to Use"
7+
features2-text = "All the desktop interaction parts (dbus, Wayland, etc.) have TypeScript bindings—you only need to call them, nothing complicated."
88

9-
features3-title = "Easy to Use"
10-
features3-text = "All the desktop interaction parts (dbus, Wayland, etc.) have TypeScript bindings—you only need to call them, nothing complicated."
9+
features3-title = "Combine Multiple Front-End Projects"
10+
features3-text = "If you’re fond of several front-end projects at once, you can combine them with just a few simple configuration changes."

i18n/zh-cn.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ get_started = "开始使用"
33
features1-title = "享受已有的 web 技术生态"
44
features1-text = "就只是编写前端页面而已,无论你是使用 React、Angular、Vue 还是其他技术栈,都可以轻松地集成到你的项目中。"
55

6-
features2-title = "组合多个前端项目"
7-
features2-text = "如果你同时喜欢上了多个前端,你可以将他们组合在一起,只需要简单修改配置"
6+
features2-title = "易于使用"
7+
features2-text = "与桌面交互的部分(dbus, wayland...)都有 TypeScript 绑定——你只需要调用即可,不会很复杂"
88

9-
features3-title = "易于使用"
10-
features3-text = "与桌面交互的部分(dbus, wayland...)都有 TypeScript 绑定——你只需要调用即可,不会很复杂"
9+
features3-title = "组合多个前端项目"
10+
features3-text = "如果你同时喜欢上了多个前端,你可以将他们组合在一起,只需要简单修改配置"

0 commit comments

Comments
 (0)