sdoc-editor-cli 0.9.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,559 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://sdoc.dev/schema/v1.0.json",
4
+ "title": "Structured Document (.sdoc / .tiptap.json)",
5
+ "description": "Schema for .sdoc and .tiptap.json files — a structured document format based on a tree of typed nodes with optional marks and attributes.",
6
+ "type": "object",
7
+ "required": ["sdoc", "doc"],
8
+ "properties": {
9
+ "sdoc": {
10
+ "type": "string",
11
+ "description": "Schema version of this .sdoc/.tiptap.json file.",
12
+ "enum": ["1.0"]
13
+ },
14
+ "meta": {
15
+ "$ref": "#/definitions/metadata"
16
+ },
17
+ "doc": {
18
+ "$ref": "#/definitions/docNode"
19
+ }
20
+ },
21
+ "additionalProperties": false,
22
+
23
+ "definitions": {
24
+ "metadata": {
25
+ "type": "object",
26
+ "description": "Document metadata for management and traceability.",
27
+ "properties": {
28
+ "title": { "type": "string", "description": "Document title." },
29
+ "author": { "type": "string", "description": "Author name or identifier." },
30
+ "version": { "type": "string", "description": "Document version string (e.g. '1.0', '2.3')." },
31
+ "created": { "type": "string", "format": "date-time", "description": "ISO 8601 creation timestamp." },
32
+ "modified": { "type": "string", "format": "date-time", "description": "ISO 8601 last-modified timestamp." },
33
+ "settings": { "$ref": "#/definitions/documentSettings" },
34
+ "template": { "$ref": "#/definitions/templateMetadata" }
35
+ },
36
+ "additionalProperties": true
37
+ },
38
+
39
+ "templateMetadata": {
40
+ "type": "object",
41
+ "description": "Reusable template catalog metadata. Personal templates additionally require a user:<uuid> id at the catalog boundary.",
42
+ "properties": {
43
+ "id": { "type": "string", "maxLength": 128 },
44
+ "name": { "type": "string", "maxLength": 200 },
45
+ "description": { "type": "string", "maxLength": 2000 },
46
+ "category": { "type": "string", "maxLength": 100 },
47
+ "titleNodeId": { "type": "string", "maxLength": 200 }
48
+ },
49
+ "additionalProperties": true
50
+ },
51
+
52
+ "documentSettings": {
53
+ "type": "object",
54
+ "description": "Per-document settings that override workspace defaults.",
55
+ "properties": {
56
+ "headingNumbering": { "type": "boolean", "description": "Enable automatic heading numbering." },
57
+ "headingStartNumber": { "type": "integer", "minimum": 0, "description": "Starting number for automatic H1 heading numbering." },
58
+ "headingDecoration": { "type": "boolean", "description": "Enable heading border-bottom decoration." },
59
+ "headingH1Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H1 heading number color." },
60
+ "headingH2Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H2 heading number color." },
61
+ "headingH3Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H3 heading number color." },
62
+ "headingH4Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H4 heading number color." },
63
+ "headingH5Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H5 heading number color." },
64
+ "headingH6Color": { "type": "string", "pattern": "^#[0-9a-fA-F]{3,8}$", "description": "H6 heading number color." },
65
+ "captionStyle": { "type": "string", "enum": ["ieee", "iso", "modern", "korean"], "description": "Caption formatting preset." },
66
+ "captionNumbering": { "type": "string", "enum": ["sequential", "hierarchical"], "description": "Caption numbering mode." },
67
+ "equationNumbering": { "type": "string", "enum": ["sequential", "hierarchical"], "description": "Equation numbering mode." },
68
+ "crossRefIncludeCaption": { "type": "boolean", "description": "Include caption text in generated cross-reference labels." },
69
+ "slideCssPath": { "type": "string" },
70
+ "htmlCssPath": { "type": "string" },
71
+ "pdfScale": { "type": "number", "minimum": 10, "maximum": 200 },
72
+ "selfContained": { "type": "string", "enum": ["none", "images-only", "full"] },
73
+ "slideBreakLevel": { "type": "string", "enum": ["h1-only", "h1-h2-vertical"] },
74
+ "slideTransition": { "type": "string", "enum": ["none", "fade", "slide", "convex", "concave", "zoom"] },
75
+ "showTitleSlide": { "type": "boolean" },
76
+ "outputDir": { "type": "string" }
77
+ },
78
+ "additionalProperties": false
79
+ },
80
+
81
+ "docNode": {
82
+ "type": "object",
83
+ "required": ["type"],
84
+ "properties": {
85
+ "type": { "const": "doc" },
86
+ "content": {
87
+ "type": "array",
88
+ "items": { "$ref": "#/definitions/blockNode" }
89
+ }
90
+ },
91
+ "additionalProperties": false
92
+ },
93
+
94
+ "blockNode": {
95
+ "oneOf": [
96
+ { "$ref": "#/definitions/headingNode" },
97
+ { "$ref": "#/definitions/paragraphNode" },
98
+ { "$ref": "#/definitions/bulletListNode" },
99
+ { "$ref": "#/definitions/orderedListNode" },
100
+ { "$ref": "#/definitions/taskListNode" },
101
+ { "$ref": "#/definitions/codeBlockNode" },
102
+ { "$ref": "#/definitions/tableNode" },
103
+ { "$ref": "#/definitions/imageNode" },
104
+ { "$ref": "#/definitions/mathBlockNode" },
105
+ { "$ref": "#/definitions/diagramNode" },
106
+ { "$ref": "#/definitions/blockquoteNode" },
107
+ { "$ref": "#/definitions/calloutNode" },
108
+ { "$ref": "#/definitions/horizontalRuleNode" },
109
+ { "$ref": "#/definitions/hardBreakNode" }
110
+ ]
111
+ },
112
+
113
+ "inlineNode": {
114
+ "oneOf": [
115
+ { "$ref": "#/definitions/textNode" },
116
+ { "$ref": "#/definitions/mathInlineNode" },
117
+ { "$ref": "#/definitions/hardBreakNode" }
118
+ ]
119
+ },
120
+
121
+ "headingNode": {
122
+ "type": "object",
123
+ "required": ["type", "attrs"],
124
+ "properties": {
125
+ "type": { "const": "heading" },
126
+ "attrs": {
127
+ "type": "object",
128
+ "required": ["level"],
129
+ "properties": {
130
+ "level": { "type": "integer", "minimum": 1, "maximum": 6 },
131
+ "id": { "type": ["string", "null"], "description": "Anchor id for cross-references." },
132
+ "textAlign": { "type": ["string", "null"], "enum": ["left", "center", "right", "justify", null] },
133
+ "numbered": { "type": ["boolean", "null"], "description": "false면 자동 번호 매김에서 제외 (예: Introduction, Glossary, References). 생략 또는 null이면 번호 매김 대상." }
134
+ },
135
+ "additionalProperties": false
136
+ },
137
+ "content": {
138
+ "type": "array",
139
+ "items": { "$ref": "#/definitions/inlineNode" }
140
+ }
141
+ },
142
+ "additionalProperties": false
143
+ },
144
+
145
+ "paragraphNode": {
146
+ "type": "object",
147
+ "required": ["type"],
148
+ "properties": {
149
+ "type": { "const": "paragraph" },
150
+ "attrs": {
151
+ "type": "object",
152
+ "properties": {
153
+ "textAlign": { "type": ["string", "null"], "enum": ["left", "center", "right", "justify", null] }
154
+ },
155
+ "additionalProperties": false
156
+ },
157
+ "content": {
158
+ "type": "array",
159
+ "items": { "$ref": "#/definitions/inlineNode" }
160
+ }
161
+ },
162
+ "additionalProperties": false
163
+ },
164
+
165
+ "bulletListNode": {
166
+ "type": "object",
167
+ "required": ["type"],
168
+ "properties": {
169
+ "type": { "const": "bulletList" },
170
+ "content": {
171
+ "type": "array",
172
+ "items": { "$ref": "#/definitions/listItemNode" }
173
+ }
174
+ },
175
+ "additionalProperties": false
176
+ },
177
+
178
+ "orderedListNode": {
179
+ "type": "object",
180
+ "required": ["type"],
181
+ "properties": {
182
+ "type": { "const": "orderedList" },
183
+ "attrs": {
184
+ "type": "object",
185
+ "properties": {
186
+ "start": { "type": ["integer", "null"], "default": 1 },
187
+ "type": { "type": ["string", "null"] }
188
+ },
189
+ "additionalProperties": false
190
+ },
191
+ "content": {
192
+ "type": "array",
193
+ "items": { "$ref": "#/definitions/listItemNode" }
194
+ }
195
+ },
196
+ "additionalProperties": false
197
+ },
198
+
199
+ "listItemNode": {
200
+ "type": "object",
201
+ "required": ["type"],
202
+ "properties": {
203
+ "type": { "const": "listItem" },
204
+ "content": {
205
+ "type": "array",
206
+ "items": { "$ref": "#/definitions/blockNode" }
207
+ }
208
+ },
209
+ "additionalProperties": false
210
+ },
211
+
212
+ "taskListNode": {
213
+ "type": "object",
214
+ "required": ["type"],
215
+ "properties": {
216
+ "type": { "const": "taskList" },
217
+ "content": {
218
+ "type": "array",
219
+ "items": { "$ref": "#/definitions/taskItemNode" }
220
+ }
221
+ },
222
+ "additionalProperties": false
223
+ },
224
+
225
+ "taskItemNode": {
226
+ "type": "object",
227
+ "required": ["type"],
228
+ "properties": {
229
+ "type": { "const": "taskItem" },
230
+ "attrs": {
231
+ "type": "object",
232
+ "properties": {
233
+ "checked": { "type": "boolean" }
234
+ }
235
+ },
236
+ "content": {
237
+ "type": "array",
238
+ "items": { "$ref": "#/definitions/blockNode" }
239
+ }
240
+ },
241
+ "additionalProperties": false
242
+ },
243
+
244
+ "codeBlockNode": {
245
+ "type": "object",
246
+ "required": ["type"],
247
+ "properties": {
248
+ "type": { "const": "codeBlock" },
249
+ "attrs": {
250
+ "type": "object",
251
+ "properties": {
252
+ "language": { "type": ["string", "null"] }
253
+ },
254
+ "additionalProperties": false
255
+ },
256
+ "content": {
257
+ "type": "array",
258
+ "items": { "$ref": "#/definitions/textNode" }
259
+ }
260
+ },
261
+ "additionalProperties": false
262
+ },
263
+
264
+ "tableNode": {
265
+ "type": "object",
266
+ "required": ["type"],
267
+ "properties": {
268
+ "type": { "const": "table" },
269
+ "attrs": {
270
+ "type": "object",
271
+ "properties": {
272
+ "caption": { "type": ["string", "null"], "description": "Table caption text." },
273
+ "align": { "type": "string", "enum": ["left", "center", "right"], "default": "left" },
274
+ "width": { "type": "string", "description": "CSS width value (e.g., '100%', '50%', 'auto').", "default": "auto" },
275
+ "id": { "type": ["string", "null"], "description": "Anchor id for cross-references." }
276
+ },
277
+ "additionalProperties": false
278
+ },
279
+ "content": {
280
+ "type": "array",
281
+ "items": { "$ref": "#/definitions/tableRowNode" }
282
+ }
283
+ },
284
+ "additionalProperties": false
285
+ },
286
+
287
+ "tableRowNode": {
288
+ "type": "object",
289
+ "required": ["type"],
290
+ "properties": {
291
+ "type": { "const": "tableRow" },
292
+ "content": {
293
+ "type": "array",
294
+ "items": {
295
+ "oneOf": [
296
+ { "$ref": "#/definitions/tableCellNode" },
297
+ { "$ref": "#/definitions/tableHeaderNode" }
298
+ ]
299
+ }
300
+ }
301
+ },
302
+ "additionalProperties": false
303
+ },
304
+
305
+ "tableCellNode": {
306
+ "type": "object",
307
+ "required": ["type"],
308
+ "properties": {
309
+ "type": { "const": "tableCell" },
310
+ "attrs": {
311
+ "type": "object",
312
+ "properties": {
313
+ "colspan": { "type": "integer", "minimum": 1, "default": 1 },
314
+ "rowspan": { "type": "integer", "minimum": 1, "default": 1 },
315
+ "colwidth": { "type": ["array", "null"], "items": { "type": "integer" } },
316
+ "align": { "type": ["string", "null"], "enum": ["left", "center", "right", null] }
317
+ },
318
+ "additionalProperties": false
319
+ },
320
+ "content": {
321
+ "type": "array",
322
+ "items": { "$ref": "#/definitions/blockNode" }
323
+ }
324
+ },
325
+ "additionalProperties": false
326
+ },
327
+
328
+ "tableHeaderNode": {
329
+ "type": "object",
330
+ "required": ["type"],
331
+ "properties": {
332
+ "type": { "const": "tableHeader" },
333
+ "attrs": {
334
+ "type": "object",
335
+ "properties": {
336
+ "colspan": { "type": "integer", "minimum": 1, "default": 1 },
337
+ "rowspan": { "type": "integer", "minimum": 1, "default": 1 },
338
+ "colwidth": { "type": ["array", "null"], "items": { "type": "integer" } },
339
+ "align": { "type": ["string", "null"], "enum": ["left", "center", "right", null] }
340
+ },
341
+ "additionalProperties": false
342
+ },
343
+ "content": {
344
+ "type": "array",
345
+ "items": { "$ref": "#/definitions/blockNode" }
346
+ }
347
+ },
348
+ "additionalProperties": false
349
+ },
350
+
351
+ "imageNode": {
352
+ "type": "object",
353
+ "required": ["type"],
354
+ "properties": {
355
+ "type": { "const": "image" },
356
+ "attrs": {
357
+ "type": "object",
358
+ "properties": {
359
+ "src": { "type": "string", "description": "Relative path to the image file (e.g., './images/photo.png')." },
360
+ "alt": { "type": ["string", "null"], "description": "Alternative text for accessibility." },
361
+ "title": { "type": ["string", "null"], "description": "Image title (tooltip)." },
362
+ "caption": { "type": ["string", "null"], "description": "Image caption text." },
363
+ "align": { "type": "string", "enum": ["left", "center", "right"], "default": "center" },
364
+ "width": { "type": ["string", "number", "null"] },
365
+ "height": { "type": ["string", "number", "null"] },
366
+ "id": { "type": ["string", "null"], "description": "Anchor id for cross-references." }
367
+ },
368
+ "additionalProperties": false
369
+ }
370
+ },
371
+ "additionalProperties": false
372
+ },
373
+
374
+ "mathBlockNode": {
375
+ "type": "object",
376
+ "required": ["type"],
377
+ "properties": {
378
+ "type": { "const": "mathBlock" },
379
+ "attrs": {
380
+ "type": "object",
381
+ "required": ["latex"],
382
+ "properties": {
383
+ "latex": { "type": "string", "description": "LaTeX math expression." },
384
+ "id": { "type": ["string", "null"], "description": "Anchor id for cross-references." }
385
+ },
386
+ "additionalProperties": false
387
+ }
388
+ },
389
+ "additionalProperties": false
390
+ },
391
+
392
+ "mathInlineNode": {
393
+ "type": "object",
394
+ "required": ["type"],
395
+ "properties": {
396
+ "type": { "const": "mathInline" },
397
+ "attrs": {
398
+ "type": "object",
399
+ "required": ["latex"],
400
+ "properties": {
401
+ "latex": { "type": "string", "description": "LaTeX math expression." }
402
+ },
403
+ "additionalProperties": false
404
+ }
405
+ },
406
+ "additionalProperties": false
407
+ },
408
+
409
+ "diagramNode": {
410
+ "type": "object",
411
+ "required": ["type"],
412
+ "properties": {
413
+ "type": { "const": "diagram" },
414
+ "attrs": {
415
+ "type": "object",
416
+ "required": ["language", "code"],
417
+ "properties": {
418
+ "language": { "type": "string", "description": "Diagram language, e.g. mermaid, plantuml, d2." },
419
+ "code": { "type": "string", "description": "Diagram source code." }
420
+ },
421
+ "additionalProperties": false
422
+ }
423
+ },
424
+ "additionalProperties": false
425
+ },
426
+
427
+ "hardBreakNode": {
428
+ "type": "object",
429
+ "required": ["type"],
430
+ "properties": {
431
+ "type": { "const": "hardBreak" }
432
+ },
433
+ "additionalProperties": false
434
+ },
435
+
436
+ "horizontalRuleNode": {
437
+ "type": "object",
438
+ "required": ["type"],
439
+ "properties": {
440
+ "type": { "const": "horizontalRule" },
441
+ "attrs": {
442
+ "type": "object",
443
+ "properties": {
444
+ "id": {
445
+ "type": ["string", "null"],
446
+ "pattern": "^[A-Za-z][A-Za-z0-9._:-]*$"
447
+ }
448
+ },
449
+ "additionalProperties": false
450
+ }
451
+ },
452
+ "additionalProperties": false
453
+ },
454
+
455
+ "blockquoteNode": {
456
+ "type": "object",
457
+ "required": ["type"],
458
+ "properties": {
459
+ "type": { "const": "blockquote" },
460
+ "content": {
461
+ "type": "array",
462
+ "items": { "$ref": "#/definitions/blockNode" }
463
+ }
464
+ },
465
+ "additionalProperties": false
466
+ },
467
+
468
+ "calloutNode": {
469
+ "type": "object",
470
+ "required": ["type"],
471
+ "properties": {
472
+ "type": { "const": "callout" },
473
+ "attrs": {
474
+ "type": "object",
475
+ "properties": {
476
+ "variant": {
477
+ "type": "string",
478
+ "enum": ["note", "info", "tip", "warning", "danger"],
479
+ "description": "Visual style of the callout block."
480
+ }
481
+ },
482
+ "additionalProperties": false
483
+ },
484
+ "content": {
485
+ "type": "array",
486
+ "items": { "$ref": "#/definitions/blockNode" }
487
+ }
488
+ },
489
+ "additionalProperties": false
490
+ },
491
+
492
+ "textNode": {
493
+ "type": "object",
494
+ "required": ["type"],
495
+ "properties": {
496
+ "type": { "const": "text" },
497
+ "text": { "type": "string" },
498
+ "marks": {
499
+ "type": "array",
500
+ "items": { "$ref": "#/definitions/mark" }
501
+ }
502
+ },
503
+ "additionalProperties": false
504
+ },
505
+
506
+ "mark": {
507
+ "type": "object",
508
+ "required": ["type"],
509
+ "properties": {
510
+ "type": {
511
+ "type": "string",
512
+ "enum": ["bold", "italic", "underline", "strike", "code", "link", "textStyle", "highlight", "subscript", "superscript"]
513
+ },
514
+ "attrs": {
515
+ "type": "object",
516
+ "description": "Mark-specific attributes (e.g., href for link).",
517
+ "properties": {
518
+ "href": { "type": ["string", "null"] },
519
+ "target": { "type": ["string", "null"] },
520
+ "rel": { "type": ["string", "null"] },
521
+ "class": { "type": ["string", "null"] },
522
+ "title": { "type": ["string", "null"] },
523
+ "color": { "type": "string" }
524
+ },
525
+ "additionalProperties": false
526
+ }
527
+ },
528
+ "additionalProperties": false
529
+ },
530
+
531
+ "anyNode": {
532
+ "type": "object",
533
+ "description": "A generic Tiptap JSON node for contracts that carry node fragments. Persisted documents continue to use the more specific node definitions above.",
534
+ "required": ["type"],
535
+ "properties": {
536
+ "type": { "type": "string", "minLength": 1 },
537
+ "attrs": { "type": "object" },
538
+ "content": {
539
+ "type": "array",
540
+ "items": { "$ref": "#/definitions/anyNode" }
541
+ },
542
+ "marks": {
543
+ "type": "array",
544
+ "items": {
545
+ "type": "object",
546
+ "required": ["type"],
547
+ "properties": {
548
+ "type": { "type": "string", "minLength": 1 },
549
+ "attrs": { "type": "object" }
550
+ },
551
+ "additionalProperties": true
552
+ }
553
+ },
554
+ "text": { "type": "string" }
555
+ },
556
+ "additionalProperties": true
557
+ }
558
+ }
559
+ }