Skip to content

Commit cf4fad6

Browse files
committed
feat: improve zh docs
1 parent 9248887 commit cf4fad6

18 files changed

Lines changed: 150 additions & 234 deletions

content/en/docs/excel/map.md

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -981,44 +981,3 @@ message ItemConf {
981981
```
982982

983983
{{< /details >}}
984-
985-
### Ordered-map
986-
987-
In the metasheet `@TABLEAU`, set the `OrderedMap` option to `true`, then
988-
ordered map accessers will be generated. This feature is powered by [tableauio/loader](https://github.com/tableauio/loader). Currently supported programming languages are:
989-
990-
- [x] C++
991-
- [x] Go
992-
- [ ] C#
993-
- [ ] JS/TS
994-
995-
#### Example
996-
997-
If we want `ItemConf` to generate ordered map accessers, then set
998-
`OrderedMap` option to `true` of metasheet `@TABLEAU`:
999-
1000-
{{< spreadsheet "HelloWorld.xlsx" ItemConf "@TABLEAU" >}}
1001-
1002-
{{< sheet colored >}}
1003-
1004-
| ID | Name |
1005-
| ----------------- | ----------- |
1006-
| map<uint32, Item> | string |
1007-
| Item's ID | Item's Name |
1008-
| 1 | Apple |
1009-
| 2 | Orange |
1010-
| 3 | Banana |
1011-
1012-
{{< /sheet >}}
1013-
1014-
{{< sheet colored1 >}}
1015-
1016-
| Sheet | OrderedMap |
1017-
| -------- | ---------- |
1018-
| ItemConf | true |
1019-
1020-
{{< /sheet >}}
1021-
1022-
{{< /spreadsheet >}}
1023-
1024-
More useful options are illustrated at metasheet chapter. [Metasheet @TABLEAU]({{< relref "metasheet" >}})

content/en/docs/excel/metasheet.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ Examples:
674674

675675
- `ID`
676676
- `ID@Item`
677-
- `ID<ID>@Item`: result array by ID.
677+
- `ID<ID>@Item`: sort result array by ID.
678678
- `ID<Type,Priority>@Item`: sort result array by Type and Priority.
679679
- `ID, Name@AwardItem`
680680
- `ID@Item, Name@AwardItem`
@@ -695,7 +695,7 @@ Examples:
695695

696696
- `(ID,Name)`: index name not set, then determined by parent struct type name.
697697
- `(ID,Name)@AwardItem`
698-
- `(ID,Name)<ID>`: result array by ID.
698+
- `(ID,Name)<ID>`: sort result array by ID.
699699
- `(ID,Type)<Type,Priority>@Item`: sort result array by Type and Priority.
700700
- `ID@Item, (ID,Name)@AwardItem`: one single-column index and one multi-column index.
701701

content/zh/docs/basics/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ toc: true
3939
| `Sep` | 分隔符,用于:<br> 1. 分隔 in-cell list 的元素。<br> 2. 分隔 in-cell map 的条目。<br>默认值:`,`|
4040
| `Subsep` | 子分隔符,用于分隔 in-cell map 的 Key-Value 对。<br>默认值:`:`|
4141
| `Nested` | **namerow** 的嵌套命名方式。<br>默认值:`false`|
42-
| `Layout` | Incell(单元格内)、vertical(跨单元格纵向)或 horizontal(跨单元格横向)。 |
42+
| `Layout` | Incell(单元格内)、vertical(跨单元格垂直)或 horizontal(跨单元格水平)。 |
4343
| `Transpose` | 对指定 sheet 进行行列转置。 |
4444
{.table-striped .table-hover}
4545

content/zh/docs/basics/grammar-and-types.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@ Tableau 的大部分语法和类型借鉴自 [Protocol Buffers (proto3)](https:/
3939

4040
| 特性 | 说明 |
4141
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
42-
| 横向布局(Horizontal layout) | 每个标量字段占一个单元格。 |
42+
| 水平布局(Horizontal layout) | 每个标量字段占一个单元格。 |
4343
| 简单 in-cell struct | 每个字段必须是**标量**类型。<br>以逗号分隔的字段列表,例如:`1,test,3.0`。<br>若数据列表长度与 struct 字段数不一致,则按顺序填充,未配置的字段使用标量类型的默认值。 |
4444
{.table-striped}
4545

4646
### List(列表)
4747

4848
| 特性 | 说明 |
4949
| ----------------------------- | ----------------------------------------------------------------- |
50-
| 横向布局(Horizontal layout) | list 的默认布局。<br>元素类型可以是 **struct****标量**|
51-
| 纵向布局(Vertical layout) | list 的元素类型应为 **struct**|
50+
| 水平布局(Horizontal layout) | list 的默认布局。<br>元素类型可以是 **struct****标量**|
51+
| 垂直布局(Vertical layout) | list 的元素类型应为 **struct**|
5252
| 简单 in-cell list | 元素类型必须是**标量**。<br>以逗号分隔的元素列表,例如:`1,2,3`|
5353
| 可扩展(Scalable) | 支持动态大小的 list。 |
5454
| 忽略空元素 | 智能识别任意位置的空元素。 |
@@ -58,8 +58,8 @@ Tableau 的大部分语法和类型借鉴自 [Protocol Buffers (proto3)](https:/
5858

5959
| 特性 | 说明 |
6060
| ----------------------------- | ------------------------------------------------------------------------------------------------ |
61-
| 横向布局(Horizontal layout) | |
62-
| 纵向布局(Vertical layout) | map 的默认布局。 |
61+
| 水平布局(Horizontal layout) | |
62+
| 垂直布局(Vertical layout) | map 的默认布局。 |
6363
| Hash map | 实现为无序 map 或 hash map。 |
6464
| Ordered map |[tableauio/loader](https://github.com/tableauio/loader) 支持。<br>- C++ |
6565
| 简单 in-cell map | key 和 value 都必须是**标量**类型。<br>以逗号分隔的 `key:value` 对列表,例如:`1:10,2:20,3:30`|

content/zh/docs/basics/predefined-types.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ message Prop {
5353

5454
- Excel/CSV
5555
- `struct`[Predefined-struct](../../excel/struct/#predefined-struct)
56-
- `list`[Vertical predefined-struct list](../../excel/list/#纵向-predefined-struct-list)
57-
- `map`[Vertical predefined-struct map](../../excel/map/#纵向-predefined-struct-map)
56+
- `list`[Vertical predefined-struct list](../../excel/list/#垂直-predefined-struct-list)
57+
- `map`[Vertical predefined-struct map](../../excel/map/#垂直-predefined-struct-map)
5858
- XML
5959
- `struct`[Predefined-struct](../../xml/struct/#predefined-struct)
6060
- `list`[Predefined struct list](../../xml/list/#predefined-struct-list)

content/zh/docs/design/overview.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,15 @@ flowchart TD
173173

174174
### 复合类型
175175

176-
- [x] message:横向(行方向)布局,字段位于单元格中。
176+
- [x] message:水平(行方向)布局,字段位于单元格中。
177177
- [x] message:简单 in-cell message,每个字段必须是**标量**类型。以逗号分隔的字段列表,例如:`1,test,3.0`。列表大小无需与字段数相等,字段按顺序填充,未配置的字段使用标量类型的默认值。
178-
- [x] list:横向(行方向)布局,这是 list 的默认布局,每个元素可以是 **message****标量**
179-
- [x] list:纵向(列方向)布局,每个元素应为 **message**
178+
- [x] list:水平(行方向)布局,这是 list 的默认布局,每个元素可以是 **message****标量**
179+
- [x] list:垂直(列方向)布局,每个元素应为 **message**
180180
- [x] list:简单 in-cell list,元素必须是**标量**类型。以逗号分隔的元素列表,例如:`1,2,3`
181181
- [x] list:可扩展或动态大小。
182182
- [x] list:智能识别任意位置的空元素。
183-
- [x] map:横向(行方向)布局。
184-
- [x] map:纵向(列方向)布局,这是 map 的默认布局。
183+
- [x] map:水平(行方向)布局。
184+
- [x] map:垂直(列方向)布局,这是 map 的默认布局。
185185
- [x] map:无序 map 或 hash map。
186186
- [x] map:简单 in-cell map,key 和 value 都必须是**标量**类型。以逗号分隔的 `key:value` 对列表,例如:`1:10,2:20,3:30`
187187
- [x] map:可扩展或动态大小。

content/zh/docs/excel/field-property.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ toc: true
1919
| `refer` | string | 格式:`"SheetName(SheetAlias).ColumnName"`。<br>确保该字段的值在另一个 sheet 的列值空间中。多个 refer 用逗号分隔。 |
2020
| `sequence` | int64 | 确保该字段的值是一个从指定值开始的序列。 |
2121
| `default` | string | 如果单元格为空,则使用此默认值。 |
22-
| `fixed` | bool | 自动检测横向 list/map 的固定大小。<br> 默认值:`false`|
23-
| `size` | uint32 | 指定横向 list/map 的固定大小。 |
22+
| `fixed` | bool | 自动检测水平 list/map 的固定大小。<br> 默认值:`false`|
23+
| `size` | uint32 | 指定水平 list/map 的固定大小。 |
2424
| `form` | Form | 指定 incell struct 的单元格数据格式。<br> - `FORM_TEXT`<br> - `FORM_JSON` |
2525
| `json_name` | string | 指定字段的自定义 JSON 名称,替代 proto 字段名的 lowerCamelCase 形式。 |
2626
| `present` | bool | 如果 present 为 true,则必须显式填写单元格数据。<br> 默认值:`false`|
@@ -43,7 +43,7 @@ toc: true
4343

4444
Tableau 会自动推断 map(或 KeyedList)key 的 `unique` 是否为 true。
4545

46-
**规则是**:如果 map 的 value 类型(或 KeyedList 元素类型)没有相同布局(纵向/横向)的子 map/list 字段,则 key 必须唯一。
46+
**规则是**:如果 map 的 value 类型(或 KeyedList 元素类型)没有相同布局(垂直/水平)的子 map/list 字段,则 key 必须唯一。
4747

4848
因此大多数情况下不需要显式配置。
4949

@@ -91,7 +91,7 @@ Tableau 会自动推断 map(或 KeyedList)key 的 `unique` 是否为 true。
9191

9292
## 选项 `fixed`
9393

94-
如果将选项 `fixed` 设置为 `true`则自动检测横向 list/map 的固定大小。
94+
如果将选项 `fixed` 设置为 `true`则自动检测水平 list/map 的固定大小。
9595

9696
示例:
9797

@@ -100,7 +100,7 @@ Tableau 会自动推断 map(或 KeyedList)key 的 `unique` 是否为 true。
100100

101101
## 选项 `size`
102102

103-
选项 `size` 用于指定横向 list/map 的固定大小。
103+
选项 `size` 用于指定水平 list/map 的固定大小。
104104

105105
示例:
106106

@@ -193,11 +193,11 @@ Tableau 会自动推断 map(或 KeyedList)key 的 `unique` 是否为 true。
193193

194194
> TODO: 示例待补充。
195195
196-
指定 list 将跨越并占用的 union 字段数量(每个字段对应一个 list 元素)。这也会将该 list 字段的布局从 incell 改为横向
196+
指定 list 将跨越并占用的 union 字段数量(每个字段对应一个 list 元素)。这也会将该 list 字段的布局从 incell 改为水平
197197

198198
- 值为 0 表示是 incell list。
199-
- 值 > 0 表示是占用 N 个字段的横向 list。
200-
- 值 < 0 表示是占用所有后续字段的横向 list。
199+
- 值 > 0 表示是占用 N 个字段的水平 list。
200+
- 值 < 0 表示是占用所有后续字段的水平 list。
201201

202202
## 选项 `pattern`
203203

content/zh/docs/excel/infinite-nesting.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ toc: true
1212

1313
## 概述
1414

15-
现在,横向/纵向 list 元素的第一个字段可以是任意类型,包括 struct、list 和 map。
15+
现在,水平/垂直 list 元素的第一个字段可以是任意类型,包括 struct、list 和 map。
1616

1717
- List 元素的第一个字段是 struct:`[Reward]{Icon}int32`
1818
- List 元素的第一个字段是 predefined struct:`[Cost]{.Item}uint32`

content/zh/docs/excel/keyedlist.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Keyed list 与普通 list 相同,区别在于 `ColumnType`(第一个字段
1616

1717
**语法**`[ElemType]<ColumnType>`
1818

19-
## 横向 list
19+
## 水平 list
2020

2121
> TODO...
2222
23-
## 纵向 KeyedList
23+
## 垂直 KeyedList
2424

25-
### 纵向 scalar KeyedList
25+
### 垂直 scalar KeyedList
2626

2727
> [!NOTE]
2828
> 定义方式与 [Incell scalar KeyedList](#incell-scalar-keyedlist) 相同,但如果提供了多行数据,会进行聚合。
@@ -82,7 +82,7 @@ message ItemConf {
8282

8383
{{< /details >}}
8484

85-
### 纵向 enum KeyedList
85+
### 垂直 enum KeyedList
8686

8787
> [!NOTE]
8888
> 定义方式与 [Incell enum KeyedList](#incell-enum-keyedlist) 相同,但如果提供了多行数据,会进行聚合。
@@ -158,7 +158,7 @@ message ItemConf {
158158

159159
{{< /details >}}
160160

161-
### 纵向 struct KeyedList
161+
### 垂直 struct KeyedList
162162

163163
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
164164

content/zh/docs/excel/list-in-list.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ weight: 7301
1010
toc: true
1111
---
1212

13-
## 纵向 list 中的嵌套
13+
## 垂直 list 中的嵌套
1414

15-
### 纵向 list 中的横向 list
15+
### 垂直 list 中的水平 list
1616

1717
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
1818

@@ -108,7 +108,7 @@ message ItemConf {
108108

109109
{{< /details >}}
110110

111-
### 纵向 keyed-list 中的纵向 list
111+
### 垂直 keyed-list 中的垂直 list
112112

113113
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
114114

@@ -199,7 +199,7 @@ message ItemConf {
199199

200200
{{< /details >}}
201201

202-
### 纵向 keyed-list 中的纵向 keyed-list
202+
### 垂直 keyed-list 中的垂直 keyed-list
203203

204204
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
205205

@@ -290,7 +290,7 @@ message ItemConf {
290290

291291
{{< /details >}}
292292

293-
### 纵向 keyed-list 中的 incell list
293+
### 垂直 keyed-list 中的 incell list
294294

295295
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
296296

@@ -373,7 +373,7 @@ message ItemConf {
373373

374374
{{< /details >}}
375375

376-
### 纵向 keyed-list 中的 incell keyed-list
376+
### 垂直 keyed-list 中的 incell keyed-list
377377

378378
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
379379

@@ -457,9 +457,9 @@ message ItemConf {
457457

458458
{{< /details >}}
459459

460-
## 横向 list 中的嵌套
460+
## 水平 list 中的嵌套
461461

462-
### 横向 list 中的横向 list
462+
### 水平 list 中的水平 list
463463

464464
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
465465

@@ -545,7 +545,7 @@ message ItemConf {
545545

546546
{{< /details >}}
547547

548-
### 横向 list 中的 predefined struct list
548+
### 水平 list 中的 predefined struct list
549549

550550
*common.proto* 中预定义的 `Item`
551551

@@ -637,7 +637,7 @@ message ItemConf {
637637

638638
{{< /details >}}
639639

640-
### 横向 list 中的 incell list
640+
### 水平 list 中的 incell list
641641

642642
*HelloWorld.xlsx* 中的 worksheet `ItemConf`
643643

0 commit comments

Comments
 (0)