1.0.59 • Published 10 months ago

excel_to_cfg v1.0.59

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Excel to cfg

excel格式

行数内容示例
1中文描述随意.给策划看
2代码中变量名id val...
3类型int/long/string/int[]/long[]
4输出范围ALL/CLIENT/SERVER/IGNORE(忽略输出列)

如果第二行变量名为 ".ignore". 并且某一行的该列标注为 true yes 1 等值. 这行数据忽略.

sheet 规则

  1. sheet 如果为end, 后面的内容就不会读取.
  2. sheet 如果开头为 # 该sheet忽略.不读取
  3. sheet 名包含 c. 表示仅客户端需要. s. 表示仅服务器需要
  4. sheet 名包含其它比如lua. 表示客户端需要按照lua输出. 会去 home目录下的.dTools/ejs 找对应的ejs模板

配置输出模板

模板使用 `ejs` 语法  
数据结构:
rows: [
    {
        cells [
            {
                name: string // 字段名
                val : string // 字段值 如果字符串需要输出双引号, 需要根据type自行判断.
                type: string // 字段类型 int long string int[] long[] 后3中实际都是字符串结构.
                
                isStringType(): boolean; 是否是字符串类型(string int[] long[])
                isNumberType(): boolean; 是否是数值类型(int number)
            }
        ]
    }
]

Json.ejs 示例:
[
<%_ rows.forEach(function (row, rIndex){ _%>
    {
    <%_ row.cells.forEach(function (cell, cIndex) { _%>
        "<%= cell.name %>": <% if (cell.isStringType()) {%>"<% }%><%-cell.val%><% if (cell.isStringType()) {%>"<% }%><% if(cIndex < row.cells.length - 1) { %>,<% } %>
    <%_}); _%>
    }<% if(rIndex < rows.length - 1) { %>,<% } %>
<%_ }); _%>
]
1.0.59

10 months ago

1.0.58

12 months ago

1.0.57

2 years ago

1.0.56

2 years ago

1.0.55

2 years ago

1.0.54

3 years ago

1.0.51

3 years ago

1.0.49

3 years ago

1.0.47

3 years ago

1.0.45

3 years ago

1.0.43

3 years ago

1.0.41

3 years ago

1.0.39

3 years ago

1.0.37

3 years ago

1.0.35

3 years ago

1.0.33

3 years ago

1.0.31

3 years ago

1.0.29

3 years ago

1.0.27

3 years ago

1.0.25

3 years ago

1.0.23

3 years ago

1.0.21

3 years ago

1.0.19

3 years ago

1.0.17

3 years ago

1.0.15

3 years ago

1.0.12

3 years ago

1.0.11

3 years ago

1.0.9

3 years ago

1.0.7

3 years ago

1.0.5

3 years ago

1.0.3

3 years ago