Skip to content

Commit a045d4a

Browse files
i18n: 英語ドキュメント
1 parent b6fbbcf commit a045d4a

File tree

12 files changed

+2086
-3
lines changed

12 files changed

+2086
-3
lines changed

.vitepress/config/en.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
import { defineConfig, type DefaultTheme } from 'vitepress';
22

3+
const nav: DefaultTheme.NavItem[] = [
4+
{ text: 'Guides', link: '/en/guides/get-started' },
5+
{ text: 'Reference', link: '/en/references/syntax' },
6+
{ text: 'Try AiScript', link: '/en/playground' },
7+
];
8+
39
const guideNav: DefaultTheme.SidebarItem[] = [
4-
{ text: 'Introduction', link: 'get-started' },
5-
{ text: 'Execution', link: 'execution' },
6-
{ text: 'Implement to Your App', link: 'implementation' },
10+
{
11+
text: 'AiScript Basics',
12+
items: [
13+
{ text: 'Get Started', link: 'get-started' },
14+
{ text: 'Execute AiScript', link: 'execution' },
15+
{ text: 'Implement to Your App', link: 'implementation' },
16+
],
17+
},
18+
{ text: 'References', base: '/en/references/', link: 'syntax' },
719
];
820

921
const referenceNav: DefaultTheme.SidebarItem[] = [
@@ -20,6 +32,8 @@ export const en = defineConfig({
2032
description: 'A user script language for browsers',
2133

2234
themeConfig: {
35+
nav,
36+
2337
sidebar: {
2438
'/en/guides/': { base: '/en/guides/', items: guideNav },
2539
'/en/references/': { base: '/en/references/', items: referenceNav },

docs/en/guides/execution.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# How to Execute
2+
3+
First, download the AiScript repository from GitHub.
4+
5+
```sh
6+
# 1. Clone (download) the repository
7+
git clone https://github.com/aiscript-dev/aiscript
8+
9+
# 2. Navigate to the AiScript repository folder
10+
cd aiscript
11+
12+
# 3. Install dependencies
13+
npm i
14+
```
15+
16+
## 1. Running from the Playground
17+
18+
If you want to host it locally, run the following commands and open the displayed link in your browser:
19+
20+
```sh
21+
# 1. Navigate to the built-in Playground folder
22+
cd playground
23+
24+
# 2. Build the Playground
25+
npm run build
26+
27+
# 3. Start the Playground
28+
npm run serve
29+
```
30+
31+
The Playground is also hosted on GitHub:
32+
<https://aiscript-dev.github.io/aiscript/>
33+
34+
## 2. Running a Script File
35+
36+
You can parse and execute the content of a file.
37+
38+
Create a file named `main.ais` in the project root, and save it with the following content:
39+
40+
```aiscript
41+
<: "Hello world!"
42+
```
43+
44+
Run the following command:
45+
```sh
46+
npm run start
47+
```
48+
49+
## 3. Parsing a Script File (For Debugging the Parser)
50+
51+
You can parse the content of a file and display its AST (Abstract Syntax Tree). This is mainly for debugging the parser and works regardless of the interpreter's implementation status.
52+
53+
Create a file named `main.ais` in the project root, and save it with the following content:
54+
55+
```aiscript
56+
<: "Hello world!"
57+
```
58+
59+
Run the following command:
60+
```sh
61+
npm run parse
62+
```
63+
64+
## 4. Running Code in REPL
65+
66+
You can interactively execute code on the command line. Run the following command and start entering code:
67+
68+
```sh
69+
npm run repl
70+
```

0 commit comments

Comments
 (0)