Skip to content

Commit 13c9da2

Browse files
authored
docs(deps): upgrade Rspress to beta.24 and add LlmsCopyButton (#985)
* chore: update * docs(deps): upgrade Rspress to beta.24 * docs(fix): lint * chore: update the lock * chore(docs): add more features, lastUpdated and editLink * chore(docs): lint
1 parent ced27ad commit 13c9da2

31 files changed

+664
-441
lines changed
File renamed without changes.

apps/site/docs/en/automate-with-scripts-in-yaml.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ You can find a sample project that uses YAML scripts for automation here:
3636
3737
Alternatively, you can use a `.env` file in the same directory where you run the command to store your configuration. The Midscene command-line tool will automatically load it when running a YAML script.
3838

39-
```env filename=.env
39+
```ini filename=.env
4040
OPENAI_API_KEY="sk-abcdefghijklmnopqrstuvwxyz"
4141
```
4242

@@ -350,7 +350,7 @@ You can use environment variables in your `.yaml` files with the `${variable-nam
350350

351351
For example, if you have a `.env` file with the following content:
352352

353-
```env filename=.env
353+
```ini filename=.env
354354
topic=weather today
355355
```
356356

apps/site/docs/en/blog-programming-practice-using-structured-api.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ const userList = await agent.aiQuery('string[], the user list')
149149

150150
### Instant Action Methods
151151

152-
Midscene provides some instant action methods, like `aiTap`, `aiInput`, `aiScroll`, `aiHover`, etc., They are also commonly used in the automation code. You can check them in the [API](./API) page.
152+
Midscene provides some instant action methods, like `aiTap`, `aiInput`, `aiScroll`, `aiHover`, etc., They are also commonly used in the automation code. You can check them in the [API](./api.mdx) page.
153153

154154
## Want to Write Structured Code Easily ?
155155

@@ -158,7 +158,7 @@ If you think the javascript code is hard to write, then this is the right time t
158158
Use your AI IDE to index the following documents:
159159

160160
- https://midscenejs.com/blog-programming-practice-using-structured-api.md
161-
- https://midscenejs.com/API.md
161+
- https://midscenejs.com/api.md
162162

163163
:::tip
164164
How to add the Midscene documents to the AI IDE?
@@ -169,7 +169,7 @@ Refer to [this article](./llm-txt.mdx#usage).
169169

170170
And use this prompt with the mention of the Midscene documents:
171171

172-
```
172+
```txt
173173
According to the tips and APIs mentioned in @Use JavaScript to Optimize the Midscene Al Automation Code and @@Midscene API docs,
174174
175175
please help me convert the following instructions into structured javascript code:
@@ -199,6 +199,4 @@ Generally, if you encounter the following situations, you should consider abando
199199

200200
To achieve better performance, you can check the [Midscene caching feature](./caching) to cache the planning and xpath results.
201201

202-
To learn more about the structured API, you can check the [API reference](./API).
203-
204-
202+
To learn more about the structured API, you can check the [API reference](./api.mdx).

apps/site/docs/en/bridge-mode-by-chrome-extension.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,13 @@ import { AgentOverChromeBridge } from "@midscene/web/bridge-mode";
8282
const agent = new AgentOverChromeBridge();
8383
```
8484

85-
Except [the normal parameters in the agent constructor](./api), `AgentOverChromeBridge` accepts one more parameter:
85+
Except [the normal parameters in the agent constructor](./api.mdx), `AgentOverChromeBridge` accepts one more parameter:
8686

8787
* `closeNewTabsAfterDisconnect?: boolean`: If true, the newly created tab will be closed when the bridge is destroyed. Default is false.
8888

8989
## Methods
9090

91-
Except [the normal agent interface](./api), `AgentOverChromeBridge` provides some other interfaces to control the desktop Chrome.
91+
Except [the normal agent interface](./api.mdx), `AgentOverChromeBridge` provides some other interfaces to control the desktop Chrome.
9292

9393
:::info
9494
You should always call `connectCurrentTab` or `connectNewTabWithUrl` before doing further actions.

apps/site/docs/en/caching.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ You can remove the cache file in the `cache` directory, or edit the contents in
9696

9797
You can use the `cacheable` option to disable the cache for a single API.
9898

99-
Please refer to the documentation of the corresponding [API](./API.mdx) for details.
99+
Please refer to the documentation of the corresponding [API](./api.mdx) for details.
100100

101101
### Limitations of XPath in caching element location
102102

apps/site/docs/en/changelog.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Add the `_unstableLogContent` API to the agent. Get the execution process data o
148148

149149
The report is generated based on this data, which means you can customize your own report using this data.
150150

151-
Read more: [API documentation](./API.mdx#agent_unstablelogcontent)
151+
Read more: [API documentation](./api.mdx#agent_unstablelogcontent)
152152

153153
### CLI Support for Adjusting Midscene Env Variable Priority
154154

@@ -228,7 +228,7 @@ const agent = await agentFromAdbDevice('s4ey59', {
228228

229229
Upgrade now to experience these powerful new features!
230230

231-
* [Custom Report Node API documentation](/en/API.mdx#log-screenshot)
231+
* [Custom Report Node API documentation](/en/api.mdx#log-screenshot)
232232

233233
* [API documentation for more Android configuration items](/en/integrate-with-android.mdx#androiddevice-constructor)
234234

@@ -322,7 +322,7 @@ Refactor cache file format from json to yaml, improve readability.
322322

323323
<video src="https://lf3-static.bytednsdoc.com/obj/eden-cn/ozpmyhn_lm_hymuPild/ljhwZthlaukjlkulzlp/midscene/en-midscene-mcp-Sauce-Demo.mp4" controls/>
324324

325-
Read more: [MCP](./mcp.mdx)
325+
Read more: [MCP](./web-mcp.mdx)
326326

327327
### Support structured API for agent
328328

apps/site/docs/en/common/start-experience.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ the login button
2828

2929
Enjoy !
3030

31-
> For the different between "Auto Planning" and "Instant Action", please refer to the [API](../API.html) document.
31+
> For the different between "Auto Planning" and "Instant Action", please refer to the [API](../api.mdx) document.
3232
3333
## Want to write some code ?
3434

apps/site/docs/en/faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ The screenshot will be sent to the AI model. If you are using GPT-4o, some key i
4141
When using multimodal LLM in Midscene.js, the running time may increase by a factor of 3 to 10 compared to traditional Playwright scripts, for instance from 5 seconds to 20 seconds. To make the result more stable, the token and time cost is inevitable.
4242

4343
There are several ways to improve the running time:
44-
1. Use instant action interface like `agent.aiTap('Login Button')` instead of `agent.ai('Click Login Button')`. Read more about it in [API](./API).
44+
1. Use instant action interface like `agent.aiTap('Login Button')` instead of `agent.ai('Click Login Button')`. Read more about it in [API](./api.mdx).
4545
2. Use a dedicated model and deploy it yourself, like UI-TARS. This is the recommended way. Read more about it in [Choose a model](./choose-a-model).
4646
3. Use a lower resolution if possible.
4747
4. Use caching to accelerate the debug process. Read more about it in [Caching](./caching).

apps/site/docs/en/integrate-with-android.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ The AndroidDevice constructor supports the following parameters:
114114

115115
## More interfaces in AndroidAgent
116116

117-
Except the common agent interfaces in [API Reference](./API), AndroidAgent also provides some other interfaces:
117+
Except the common agent interfaces in [API Reference](./api.mdx), AndroidAgent also provides some other interfaces:
118118

119119
### `agent.launch()`
120120

@@ -163,7 +163,7 @@ function agentFromAdbDevice(
163163
- Parameters:
164164

165165
- `deviceId?: string` - Optional, the adb device id to connect. If not provided, the first connected device will be used.
166-
- `opts?: PageAgentOpt & AndroidDeviceOpt` - Optional, the options for the AndroidAgent, PageAgentOpt refer to [constructor](./API), AndroidDeviceOpt refer to [AndroidDevice constructor](./integrate-with-android#androiddevice-constructor).
166+
- `opts?: PageAgentOpt & AndroidDeviceOpt` - Optional, the options for the AndroidAgent, PageAgentOpt refer to [constructor](./api.mdx), AndroidDeviceOpt refer to [AndroidDevice constructor](./integrate-with-android#androiddevice-constructor).
167167

168168
- Return Value:
169169

@@ -216,7 +216,7 @@ const agent = await agentFromAdbDevice(devices[0].udid);
216216

217217
## More
218218

219-
- For all the APIs on the Agent, please refer to [API Reference](./API).
219+
- For all the APIs on the Agent, please refer to [API Reference](./api.mdx).
220220
- For more details about prompting, please refer to [Prompting Tips](./prompting-tips)
221221

222222
## FAQ

apps/site/docs/en/integrate-with-playwright.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Promise.resolve(
9494
);
9595
```
9696

97-
For more Agent API details, please refer to [API Reference](./API).
97+
For more Agent API details, please refer to [API Reference](./api.mdx).
9898

9999
### Step 3: Run the script
100100

@@ -198,7 +198,7 @@ export const test = base.extend<PlayWrightAiFixtureType>(
198198
- `aiWaitFor` - AI Wait
199199
- `aiLocate` - Locate Element
200200

201-
Besides the exposed shortcut methods, if you need to call other [API](./API) provided by the agent, you can use `agentForPage` to get the `PageAgent` instance, and use `PageAgent` to call the API for interaction:
201+
Besides the exposed shortcut methods, if you need to call other [API](./api.mdx) provided by the agent, you can use `agentForPage` to get the `PageAgent` instance, and use `PageAgent` to call the API for interaction:
202202

203203
```typescript
204204
test('case demo', async ({ agentForPage, page }) => {
@@ -262,7 +262,7 @@ test('search headphone on ebay', async ({
262262
});
263263
```
264264

265-
For more Agent API details, please refer to [API Reference](./API).
265+
For more Agent API details, please refer to [API Reference](./api.mdx).
266266

267267
### Step 4. run test cases
268268

@@ -276,5 +276,5 @@ After the command executes successfully, it will output: `Midscene - report file
276276

277277
## More
278278

279-
- For all the methods on the Agent, please refer to [API Reference](./API).
279+
- For all the methods on the Agent, please refer to [API Reference](./api.mdx).
280280
- For more details about prompting, please refer to [Prompting Tips](./prompting-tips)

0 commit comments

Comments
 (0)