Skip to content

Commit 77c0ec0

Browse files
committed
docs update
1 parent 7cac437 commit 77c0ec0

File tree

11 files changed

+38
-30
lines changed

11 files changed

+38
-30
lines changed

docs/_config.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,11 @@ heading_anchors: true
77
aux_links:
88
"SScript Repository": "https://github.com/your-org/sscript"
99
nav_sort: case_insensitive
10+
11+
# Syntax highlighting
12+
markdown: kramdown
13+
kramdown:
14+
syntax_highlighter: rouge
15+
syntax_highlighter_opts:
16+
line_numbers: false
17+
highlighter: rouge

docs/en/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Common fields:
4040

4141
## Example
4242

43-
```ss
43+
```python
4444
on block_place(player, block):
4545
log player.name + " placed " + block.id + " at " + block.pos
4646
end

docs/en/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parent: EN Home
88

99
## Chat logger
1010

11-
```ss
11+
```python
1212
on player_chat(player, message):
1313
file_mkdirs("sscripts/logs")
1414
line = player.name + ": " + message + "\n"
@@ -18,7 +18,7 @@ end
1818

1919
## Weather sync
2020

21-
```ss
21+
```python
2222
func sync_weather():
2323
headers = {
2424
"Accept": "application/json",
@@ -46,7 +46,7 @@ end
4646

4747
## Block placement reaction
4848

49-
```ss
49+
```python
5050
on block_place(player, block):
5151
run "tellraw " + player.name + " {\"text\":\"Placed: " + block.id + "\"}"
5252
end

docs/en/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parent: EN Home
1313

1414
## 2. Minimal event script
1515

16-
```ss
16+
```python
1717
on player_join(player):
1818
log "Welcome " + player.name
1919
end
@@ -23,7 +23,7 @@ end
2323

2424
Define reusable functions at top-level:
2525

26-
```ss
26+
```python
2727
func hello(name):
2828
return "Hi " + name
2929
end

docs/en/io-http-json.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ parent: EN Home
1111
- `json_parse(text)`
1212
- `json_stringify(value)`
1313

14-
```ss
14+
```python
1515
obj = json_parse("{\"ok\":true}")
1616
log str(obj.ok)
1717
```
@@ -29,7 +29,7 @@ Response object:
2929
- `headers`
3030
- `json`
3131

32-
```ss
32+
```python
3333
resp = http_get("https://api.github.com", {"Accept":"application/json"}, 10)
3434
if resp.ok:
3535
log "status=" + str(resp.status)
@@ -47,7 +47,7 @@ end
4747
- `file_read_json(path)`
4848
- `file_write_json(path, value)`
4949

50-
```ss
50+
```python
5151
file_mkdirs("sscripts/data")
5252
file_write_json("sscripts/data/state.json", {"online": player_count()})
5353
```

docs/en/language.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ parent: EN Home
88

99
## Variables
1010

11-
```ss
11+
```python
1212
x = 10
1313
name = "Steve"
1414
ok = true
1515
```
1616

1717
## Conditions
1818

19-
```ss
19+
```python
2020
if x > 10:
2121
log "big"
2222
elif x == 10:
@@ -28,7 +28,7 @@ end
2828

2929
## Loops
3030

31-
```ss
31+
```python
3232
for i in range(1, 5):
3333
log str(i)
3434
end
@@ -46,7 +46,7 @@ end
4646
- `return`
4747
- `try/catch`
4848

49-
```ss
49+
```python
5050
try:
5151
run "say hi"
5252
catch err:
@@ -58,15 +58,15 @@ end
5858

5959
### List
6060

61-
```ss
61+
```python
6262
items = ["a", "b"]
6363
items.add("c")
6464
items.remove(1)
6565
```
6666

6767
### Object
6868

69-
```ss
69+
```python
7070
obj = {"name": "Alex", "score": 12}
7171
log obj.name
7272
obj.score += 5

docs/ru/events.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ parent: RU Главная
4040

4141
## Пример
4242

43-
```ss
43+
```python
4444
on block_place(player, block):
4545
log player.name + " поставил " + block.id + " в " + block.pos
4646
end

docs/ru/examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ parent: RU Главная
88

99
## Лог чата
1010

11-
```ss
11+
```python
1212
on player_chat(player, message):
1313
file_mkdirs("sscripts/logs")
1414
line = player.name + ": " + message + "\n"
@@ -18,7 +18,7 @@ end
1818

1919
## Синхронизация погоды
2020

21-
```ss
21+
```python
2222
func sync_weather():
2323
headers = {
2424
"Accept": "application/json",
@@ -46,7 +46,7 @@ end
4646

4747
## Реакция на установку блока
4848

49-
```ss
49+
```python
5050
on block_place(player, block):
5151
log player.name + " поставил " + block.id
5252
end

docs/ru/getting-started.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ parent: RU Главная
1313

1414
## 2. Минимальный пример
1515

16-
```ss
16+
```python
1717
on player_join(player):
1818
log "Добро пожаловать, " + player.name
1919
end
@@ -23,7 +23,7 @@ end
2323

2424
Пиши переиспользуемые функции на верхнем уровне файла:
2525

26-
```ss
26+
```python
2727
func hello(name):
2828
return "Привет, " + name
2929
end

docs/ru/io-http-json.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ parent: RU Главная
1111
- `json_parse(text)`
1212
- `json_stringify(value)`
1313

14-
```ss
14+
```python
1515
obj = json_parse("{\"ok\":true}")
1616
log str(obj.ok)
1717
```
@@ -29,7 +29,7 @@ log str(obj.ok)
2929
- `headers`
3030
- `json`
3131

32-
```ss
32+
```python
3333
resp = http_get("https://api.github.com", {"Accept":"application/json"}, 10)
3434
if resp.ok:
3535
log "status=" + str(resp.status)
@@ -47,7 +47,7 @@ end
4747
- `file_read_json(path)`
4848
- `file_write_json(path, value)`
4949

50-
```ss
50+
```python
5151
file_mkdirs("sscripts/data")
5252
file_write_json("sscripts/data/state.json", {"online": player_count()})
5353
```

0 commit comments

Comments
 (0)