Skip to content
This repository was archived by the owner on May 21, 2022. It is now read-only.

Commit 020c718

Browse files
committed
docs: update README/examples/schema
1 parent b32d6dc commit 020c718

File tree

4 files changed

+610
-2
lines changed

4 files changed

+610
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ TBD
3636

3737
## TODO
3838

39-
- [ ] 加入测试(并重构)
39+
- [x] 加入测试(并重构)
4040
- [ ] 部署CI
4141
- [ ] 将parser更换成一个标准更接近GFM的parser
42-
- [ ] 将格式等设置改为配置文件而非硬编码
42+
- [x] 将格式等设置改为配置文件而非硬编码
4343
- [ ] 页眉
4444
- [ ] 页脚
4545
- [ ] 图片

docs/schema.json

Lines changed: 336 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
{
2+
"definitions": {},
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"$id": "config",
5+
"type": "object",
6+
"title": "The Root Schema",
7+
"required": [
8+
"样式",
9+
"对应关系",
10+
"可选部分"
11+
],
12+
"properties": {
13+
"样式": {
14+
"$id": "#/properties/样式",
15+
"type": "array",
16+
"title": "The 样式 Schema",
17+
"items": {
18+
"$id": "#/properties/样式/items",
19+
"type": "object",
20+
"title": "The Items Schema",
21+
"required": [
22+
"名称",
23+
"英文字体",
24+
"中文字体",
25+
"字体大小",
26+
"对齐方式",
27+
"录入大纲",
28+
"大纲等级",
29+
"加粗",
30+
"斜体",
31+
"下划线",
32+
"删除线",
33+
"首行缩进",
34+
"段前分页",
35+
"段前后空行"
36+
],
37+
"properties": {
38+
"名称": {
39+
"$id": "#/properties/样式/items/properties/名称",
40+
"type": "string",
41+
"title": "The 名称 Schema",
42+
"default": "",
43+
"examples": [
44+
"heading 1"
45+
],
46+
"pattern": "^(.*)$"
47+
},
48+
"英文字体": {
49+
"$id": "#/properties/样式/items/properties/英文字体",
50+
"type": "string",
51+
"title": "The 英文字体 Schema",
52+
"default": "",
53+
"examples": [
54+
"Times New Roman"
55+
],
56+
"pattern": "^(.*)$"
57+
},
58+
"中文字体": {
59+
"$id": "#/properties/样式/items/properties/中文字体",
60+
"type": "string",
61+
"title": "The 中文字体 Schema",
62+
"default": "",
63+
"examples": [
64+
"黑体"
65+
],
66+
"pattern": "^(.*)$"
67+
},
68+
"字体大小": {
69+
"$id": "#/properties/样式/items/properties/字体大小",
70+
"type": "string",
71+
"title": "The 字体大小 Schema",
72+
"default": "",
73+
"examples": [
74+
"三号"
75+
],
76+
"pattern": "^(.*)$"
77+
},
78+
"对齐方式": {
79+
"$id": "#/properties/样式/items/properties/对齐方式",
80+
"type": "string",
81+
"title": "The 对齐方式 Schema",
82+
"default": "",
83+
"examples": [
84+
"居中"
85+
],
86+
"pattern": "^(.*)$"
87+
},
88+
"录入大纲": {
89+
"$id": "#/properties/样式/items/properties/录入大纲",
90+
"type": "boolean",
91+
"title": "The 录入大纲 Schema",
92+
"default": false,
93+
"examples": [
94+
false
95+
]
96+
},
97+
"大纲等级": {
98+
"$id": "#/properties/样式/items/properties/大纲等级",
99+
"type": "integer",
100+
"title": "The 大纲等级 Schema",
101+
"default": 0,
102+
"examples": [
103+
0
104+
]
105+
},
106+
"加粗": {
107+
"$id": "#/properties/样式/items/properties/加粗",
108+
"type": "boolean",
109+
"title": "The 加粗 Schema",
110+
"default": false,
111+
"examples": [
112+
false
113+
]
114+
},
115+
"斜体": {
116+
"$id": "#/properties/样式/items/properties/斜体",
117+
"type": "boolean",
118+
"title": "The 斜体 Schema",
119+
"default": false,
120+
"examples": [
121+
false
122+
]
123+
},
124+
"下划线": {
125+
"$id": "#/properties/样式/items/properties/下划线",
126+
"type": "boolean",
127+
"title": "The 下划线 Schema",
128+
"default": false,
129+
"examples": [
130+
false
131+
]
132+
},
133+
"删除线": {
134+
"$id": "#/properties/样式/items/properties/删除线",
135+
"type": "boolean",
136+
"title": "The 删除线 Schema",
137+
"default": false,
138+
"examples": [
139+
false
140+
]
141+
},
142+
"首行缩进": {
143+
"$id": "#/properties/样式/items/properties/首行缩进",
144+
"type": "number",
145+
"title": "The 首行缩进 Schema",
146+
"default": 0,
147+
"examples": [
148+
2
149+
]
150+
},
151+
"段前分页": {
152+
"$id": "#/properties/样式/items/properties/段前分页",
153+
"type": "boolean",
154+
"title": "The 段前分页 Schema",
155+
"default": false,
156+
"examples": [
157+
true
158+
]
159+
},
160+
"段前后空行": {
161+
"$id": "#/properties/样式/items/properties/段前后空行",
162+
"type": "number",
163+
"title": "The 段前后空行 Schema",
164+
"default": 0,
165+
"examples": [
166+
1
167+
]
168+
},
169+
"行距": {
170+
"$id": "#/properties/样式/items/properties/行距",
171+
"type": "number",
172+
"title": "The 行距 Schema",
173+
"default": 0,
174+
"examples": [
175+
1.5
176+
]
177+
}
178+
}
179+
}
180+
},
181+
"对应关系": {
182+
"$id": "#/properties/对应关系",
183+
"type": "object",
184+
"title": "The 对应关系 Schema",
185+
"required": [
186+
"正文",
187+
"一级标题",
188+
"二级标题",
189+
"三级标题",
190+
"代码段",
191+
"引用"
192+
],
193+
"properties": {
194+
"正文": {
195+
"$id": "#/properties/对应关系/properties/正文",
196+
"type": "string",
197+
"title": "The 正文 Schema",
198+
"default": "",
199+
"examples": [
200+
"BodyText"
201+
],
202+
"pattern": "^(.*)$"
203+
},
204+
"一级标题": {
205+
"$id": "#/properties/对应关系/properties/一级标题",
206+
"type": "string",
207+
"title": "The 一级标题 Schema",
208+
"default": "",
209+
"examples": [
210+
"heading 1"
211+
],
212+
"pattern": "^(.*)$"
213+
},
214+
"二级标题": {
215+
"$id": "#/properties/对应关系/properties/二级标题",
216+
"type": "string",
217+
"title": "The 二级标题 Schema",
218+
"default": "",
219+
"examples": [
220+
"heading 2"
221+
],
222+
"pattern": "^(.*)$"
223+
},
224+
"三级标题": {
225+
"$id": "#/properties/对应关系/properties/三级标题",
226+
"type": "string",
227+
"title": "The 三级标题 Schema",
228+
"default": "",
229+
"examples": [
230+
"heading 3"
231+
],
232+
"pattern": "^(.*)$"
233+
},
234+
"代码段": {
235+
"$id": "#/properties/对应关系/properties/代码段",
236+
"type": "string",
237+
"title": "The 代码段 Schema",
238+
"default": "",
239+
"examples": [
240+
"Code"
241+
],
242+
"pattern": "^(.*)$"
243+
},
244+
"引用": {
245+
"$id": "#/properties/对应关系/properties/引用",
246+
"type": "string",
247+
"title": "The 引用 Schema",
248+
"default": "",
249+
"examples": [
250+
"reference"
251+
],
252+
"pattern": "^(.*)$"
253+
}
254+
}
255+
},
256+
"可选部分": {
257+
"$id": "#/properties/可选部分",
258+
"type": "object",
259+
"title": "The 可选部分 Schema",
260+
"required": [
261+
"封面",
262+
"摘要",
263+
"目录",
264+
"页眉",
265+
"页脚",
266+
"结束语",
267+
"延迟样式"
268+
],
269+
"properties": {
270+
"封面": {
271+
"$id": "#/properties/可选部分/properties/封面",
272+
"type": "boolean",
273+
"title": "The 封面 Schema",
274+
"default": false,
275+
"examples": [
276+
true
277+
]
278+
},
279+
"摘要": {
280+
"$id": "#/properties/可选部分/properties/摘要",
281+
"type": "boolean",
282+
"title": "The 摘要 Schema",
283+
"default": false,
284+
"examples": [
285+
true
286+
]
287+
},
288+
"目录": {
289+
"$id": "#/properties/可选部分/properties/目录",
290+
"type": "boolean",
291+
"title": "The 目录 Schema",
292+
"default": false,
293+
"examples": [
294+
true
295+
]
296+
},
297+
"页眉": {
298+
"$id": "#/properties/可选部分/properties/页眉",
299+
"type": "boolean",
300+
"title": "The 页眉 Schema",
301+
"default": false,
302+
"examples": [
303+
true
304+
]
305+
},
306+
"页脚": {
307+
"$id": "#/properties/可选部分/properties/页脚",
308+
"type": "boolean",
309+
"title": "The 页脚 Schema",
310+
"default": false,
311+
"examples": [
312+
true
313+
]
314+
},
315+
"结束语": {
316+
"$id": "#/properties/可选部分/properties/结束语",
317+
"type": "boolean",
318+
"title": "The 结束语 Schema",
319+
"default": false,
320+
"examples": [
321+
true
322+
]
323+
},
324+
"延迟样式": {
325+
"$id": "#/properties/可选部分/properties/延迟样式",
326+
"type": "boolean",
327+
"title": "The 延迟样式 Schema",
328+
"default": false,
329+
"examples": [
330+
true
331+
]
332+
}
333+
}
334+
}
335+
}
336+
}

0 commit comments

Comments
 (0)