@yanqirenshi/hefti 2.0.0 → 2.1.1
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.
- package/README.md +165 -2
- package/examples/valid/big_table_book/001_s1.json +27 -27
- package/examples/valid/big_table_book/002_s1.1.json +216 -216
- package/examples/valid/big_table_book/003_s1.2.json +27 -27
- package/examples/valid/big_table_book/004_s2.json +25 -25
- package/examples/valid/big_table_book/index.json +28 -28
- package/examples/valid/deep_book/001_s1.json +27 -27
- package/examples/valid/deep_book/002_s1.1.json +29 -29
- package/examples/valid/deep_book/003_s1.1.1.json +30 -30
- package/examples/valid/deep_book/004_s1.1.1.1.json +31 -31
- package/examples/valid/deep_book/005_s1.1.1.1.1.json +32 -32
- package/examples/valid/deep_book/006_s1.1.1.1.1.1.json +33 -33
- package/examples/valid/deep_book/007_s1.1.1.1.1.1.1.json +33 -33
- package/examples/valid/deep_book/index.json +69 -69
- package/examples/valid/empty_book/index.json +9 -9
- package/examples/valid/merged_table_book/001_s1.json +38 -38
- package/examples/valid/merged_table_book/index.json +15 -15
- package/examples/valid/no_heading_book/001_front.json +39 -39
- package/examples/valid/no_heading_book/index.json +14 -14
- package/examples/valid/rich_book/001_front.json +17 -17
- package/examples/valid/rich_book/002_s1.json +123 -123
- package/examples/valid/rich_book/003_s2.json +25 -25
- package/examples/valid/rich_book/index.json +45 -45
- package/examples/valid/rich_split_book/001_front.json +17 -17
- package/examples/valid/rich_split_book/002_s1.json +28 -28
- package/examples/valid/rich_split_book/003_s1.1.json +90 -90
- package/examples/valid/rich_split_book/004_s1.1.1.json +28 -28
- package/examples/valid/rich_split_book/005_s2.json +25 -25
- package/examples/valid/rich_split_book/index.json +47 -47
- package/examples/valid/sized_book/001_front.json +17 -17
- package/examples/valid/sized_book/002_s1.json +51 -51
- package/examples/valid/sized_book/003_s1.1.json +43 -43
- package/examples/valid/sized_book/004_s1.1.1.json +42 -42
- package/examples/valid/sized_book/005_s1.2.json +28 -28
- package/examples/valid/sized_book/006_s2.json +64 -64
- package/examples/valid/sized_book/index.json +39 -39
- package/index.d.ts +26 -0
- package/index.js +2 -2
- package/package.json +22 -7
- package/schema/structure-index.schema.json +1 -1
- package/schema/structure-part.schema.json +1 -1
- package/types.d.ts +420 -0
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"file": "002_s1.json",
|
|
4
|
-
"id": "s1",
|
|
5
|
-
"ancestors": [],
|
|
6
|
-
"body": [
|
|
7
|
-
{
|
|
8
|
-
"type": "section",
|
|
9
|
-
"id": "s1",
|
|
10
|
-
"level": 1,
|
|
11
|
-
"title": "第1章 はじめの章",
|
|
12
|
-
"source": ["p0001_0#2"],
|
|
13
|
-
"children": [
|
|
14
|
-
{
|
|
15
|
-
"type": "paragraph",
|
|
16
|
-
"id": "p2",
|
|
17
|
-
"source": ["p0001_0#3"],
|
|
18
|
-
"sentences": [
|
|
19
|
-
{"id": "p2.1", "text": "章の直下の段落。"},
|
|
20
|
-
{"id": "p2.2", "text": "一つ目の文。"},
|
|
21
|
-
{"id": "p2.3", "text": "二つ目の文。"}
|
|
22
|
-
]
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
"type": "list",
|
|
26
|
-
"id": "l1",
|
|
27
|
-
"source": ["p0001_0#4", "p0001_0#5"],
|
|
28
|
-
"items": [
|
|
29
|
-
{
|
|
30
|
-
"id": "l1.1",
|
|
31
|
-
"source": ["p0001_0#4"],
|
|
32
|
-
"sentences": [
|
|
33
|
-
{"id": "l1.1.1", "text": "箇条書きの一つ目。"}
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"id": "l1.2",
|
|
38
|
-
"source": ["p0001_0#5"],
|
|
39
|
-
"sentences": [
|
|
40
|
-
{"id": "l1.2.1", "text": "箇条書きの二つ目。"},
|
|
41
|
-
{"id": "l1.2.2", "text": "補足の文。"}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
{"type": "section_ref", "id": "s1.1", "level": 2, "title": "1.1 最初の節", "file": "003_s1.1.json"},
|
|
47
|
-
{"type": "section_ref", "id": "s1.2", "level": 2, "title": "1.2 二つ目の節", "file": "005_s1.2.json"}
|
|
48
|
-
]
|
|
49
|
-
}
|
|
50
|
-
]
|
|
51
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"file": "002_s1.json",
|
|
4
|
+
"id": "s1",
|
|
5
|
+
"ancestors": [],
|
|
6
|
+
"body": [
|
|
7
|
+
{
|
|
8
|
+
"type": "section",
|
|
9
|
+
"id": "s1",
|
|
10
|
+
"level": 1,
|
|
11
|
+
"title": "第1章 はじめの章",
|
|
12
|
+
"source": ["p0001_0#2"],
|
|
13
|
+
"children": [
|
|
14
|
+
{
|
|
15
|
+
"type": "paragraph",
|
|
16
|
+
"id": "p2",
|
|
17
|
+
"source": ["p0001_0#3"],
|
|
18
|
+
"sentences": [
|
|
19
|
+
{"id": "p2.1", "text": "章の直下の段落。"},
|
|
20
|
+
{"id": "p2.2", "text": "一つ目の文。"},
|
|
21
|
+
{"id": "p2.3", "text": "二つ目の文。"}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"type": "list",
|
|
26
|
+
"id": "l1",
|
|
27
|
+
"source": ["p0001_0#4", "p0001_0#5"],
|
|
28
|
+
"items": [
|
|
29
|
+
{
|
|
30
|
+
"id": "l1.1",
|
|
31
|
+
"source": ["p0001_0#4"],
|
|
32
|
+
"sentences": [
|
|
33
|
+
{"id": "l1.1.1", "text": "箇条書きの一つ目。"}
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"id": "l1.2",
|
|
38
|
+
"source": ["p0001_0#5"],
|
|
39
|
+
"sentences": [
|
|
40
|
+
{"id": "l1.2.1", "text": "箇条書きの二つ目。"},
|
|
41
|
+
{"id": "l1.2.2", "text": "補足の文。"}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
{"type": "section_ref", "id": "s1.1", "level": 2, "title": "1.1 最初の節", "file": "003_s1.1.json"},
|
|
47
|
+
{"type": "section_ref", "id": "s1.2", "level": 2, "title": "1.2 二つ目の節", "file": "005_s1.2.json"}
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
]
|
|
51
|
+
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"file": "003_s1.1.json",
|
|
4
|
-
"id": "s1.1",
|
|
5
|
-
"ancestors": [
|
|
6
|
-
{"id": "s1", "level": 1, "title": "第1章 はじめの章"}
|
|
7
|
-
],
|
|
8
|
-
"body": [
|
|
9
|
-
{
|
|
10
|
-
"type": "section",
|
|
11
|
-
"id": "s1.1",
|
|
12
|
-
"level": 2,
|
|
13
|
-
"title": "1.1 最初の節",
|
|
14
|
-
"source": ["p0001_0#6"],
|
|
15
|
-
"children": [
|
|
16
|
-
{
|
|
17
|
-
"type": "paragraph",
|
|
18
|
-
"id": "p3",
|
|
19
|
-
"source": ["p0001_0#7"],
|
|
20
|
-
"sentences": [
|
|
21
|
-
{"id": "p3.1", "text": "節の段落。"},
|
|
22
|
-
{"id": "p3.2", "text": "ここに文がある。"},
|
|
23
|
-
{"id": "p3.3", "text": "もう一文。"}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"type": "figure",
|
|
28
|
-
"id": "f1",
|
|
29
|
-
"src": "figures/zu1.png",
|
|
30
|
-
"text": ["図の中の文字"],
|
|
31
|
-
"source": ["p0001_0#8"]
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
"type": "caption",
|
|
35
|
-
"id": "c1",
|
|
36
|
-
"text": "図1 テストの図",
|
|
37
|
-
"source": ["p0001_0#9"]
|
|
38
|
-
},
|
|
39
|
-
{"type": "section_ref", "id": "s1.1.1", "level": 3, "title": "1.1.1 深い項", "file": "004_s1.1.1.json"}
|
|
40
|
-
]
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"file": "003_s1.1.json",
|
|
4
|
+
"id": "s1.1",
|
|
5
|
+
"ancestors": [
|
|
6
|
+
{"id": "s1", "level": 1, "title": "第1章 はじめの章"}
|
|
7
|
+
],
|
|
8
|
+
"body": [
|
|
9
|
+
{
|
|
10
|
+
"type": "section",
|
|
11
|
+
"id": "s1.1",
|
|
12
|
+
"level": 2,
|
|
13
|
+
"title": "1.1 最初の節",
|
|
14
|
+
"source": ["p0001_0#6"],
|
|
15
|
+
"children": [
|
|
16
|
+
{
|
|
17
|
+
"type": "paragraph",
|
|
18
|
+
"id": "p3",
|
|
19
|
+
"source": ["p0001_0#7"],
|
|
20
|
+
"sentences": [
|
|
21
|
+
{"id": "p3.1", "text": "節の段落。"},
|
|
22
|
+
{"id": "p3.2", "text": "ここに文がある。"},
|
|
23
|
+
{"id": "p3.3", "text": "もう一文。"}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "figure",
|
|
28
|
+
"id": "f1",
|
|
29
|
+
"src": "figures/zu1.png",
|
|
30
|
+
"text": ["図の中の文字"],
|
|
31
|
+
"source": ["p0001_0#8"]
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"type": "caption",
|
|
35
|
+
"id": "c1",
|
|
36
|
+
"text": "図1 テストの図",
|
|
37
|
+
"source": ["p0001_0#9"]
|
|
38
|
+
},
|
|
39
|
+
{"type": "section_ref", "id": "s1.1.1", "level": 3, "title": "1.1.1 深い項", "file": "004_s1.1.1.json"}
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
}
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"file": "004_s1.1.1.json",
|
|
4
|
-
"id": "s1.1.1",
|
|
5
|
-
"ancestors": [
|
|
6
|
-
{"id": "s1", "level": 1, "title": "第1章 はじめの章"},
|
|
7
|
-
{"id": "s1.1", "level": 2, "title": "1.1 最初の節"}
|
|
8
|
-
],
|
|
9
|
-
"body": [
|
|
10
|
-
{
|
|
11
|
-
"type": "section",
|
|
12
|
-
"id": "s1.1.1",
|
|
13
|
-
"level": 3,
|
|
14
|
-
"title": "1.1.1 深い項",
|
|
15
|
-
"source": ["p0002_0#0"],
|
|
16
|
-
"children": [
|
|
17
|
-
{
|
|
18
|
-
"type": "paragraph",
|
|
19
|
-
"id": "p4",
|
|
20
|
-
"source": ["p0002_0#1"],
|
|
21
|
-
"sentences": [
|
|
22
|
-
{"id": "p4.1", "text": "項の段落。"},
|
|
23
|
-
{"id": "p4.2", "text": "深いところの文。"}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
"type": "table",
|
|
28
|
-
"id": "t1",
|
|
29
|
-
"n_row": 2,
|
|
30
|
-
"n_col": 2,
|
|
31
|
-
"cells": [
|
|
32
|
-
{"row": 0, "col": 0, "row_span": 1, "col_span": 1, "text": "見出しA"},
|
|
33
|
-
{"row": 0, "col": 1, "row_span": 1, "col_span": 1, "text": "見出しB"},
|
|
34
|
-
{"row": 1, "col": 0, "row_span": 1, "col_span": 1, "text": "値1"},
|
|
35
|
-
{"row": 1, "col": 1, "row_span": 1, "col_span": 1, "text": "値2"}
|
|
36
|
-
],
|
|
37
|
-
"source": ["p0002_0#2"]
|
|
38
|
-
}
|
|
39
|
-
]
|
|
40
|
-
}
|
|
41
|
-
]
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"file": "004_s1.1.1.json",
|
|
4
|
+
"id": "s1.1.1",
|
|
5
|
+
"ancestors": [
|
|
6
|
+
{"id": "s1", "level": 1, "title": "第1章 はじめの章"},
|
|
7
|
+
{"id": "s1.1", "level": 2, "title": "1.1 最初の節"}
|
|
8
|
+
],
|
|
9
|
+
"body": [
|
|
10
|
+
{
|
|
11
|
+
"type": "section",
|
|
12
|
+
"id": "s1.1.1",
|
|
13
|
+
"level": 3,
|
|
14
|
+
"title": "1.1.1 深い項",
|
|
15
|
+
"source": ["p0002_0#0"],
|
|
16
|
+
"children": [
|
|
17
|
+
{
|
|
18
|
+
"type": "paragraph",
|
|
19
|
+
"id": "p4",
|
|
20
|
+
"source": ["p0002_0#1"],
|
|
21
|
+
"sentences": [
|
|
22
|
+
{"id": "p4.1", "text": "項の段落。"},
|
|
23
|
+
{"id": "p4.2", "text": "深いところの文。"}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"type": "table",
|
|
28
|
+
"id": "t1",
|
|
29
|
+
"n_row": 2,
|
|
30
|
+
"n_col": 2,
|
|
31
|
+
"cells": [
|
|
32
|
+
{"row": 0, "col": 0, "row_span": 1, "col_span": 1, "text": "見出しA"},
|
|
33
|
+
{"row": 0, "col": 1, "row_span": 1, "col_span": 1, "text": "見出しB"},
|
|
34
|
+
{"row": 1, "col": 0, "row_span": 1, "col_span": 1, "text": "値1"},
|
|
35
|
+
{"row": 1, "col": 1, "row_span": 1, "col_span": 1, "text": "値2"}
|
|
36
|
+
],
|
|
37
|
+
"source": ["p0002_0#2"]
|
|
38
|
+
}
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
]
|
|
42
|
+
}
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"file": "005_s1.2.json",
|
|
4
|
-
"id": "s1.2",
|
|
5
|
-
"ancestors": [
|
|
6
|
-
{"id": "s1", "level": 1, "title": "第1章 はじめの章"}
|
|
7
|
-
],
|
|
8
|
-
"body": [
|
|
9
|
-
{
|
|
10
|
-
"type": "section",
|
|
11
|
-
"id": "s1.2",
|
|
12
|
-
"level": 2,
|
|
13
|
-
"title": "1.2 二つ目の節",
|
|
14
|
-
"source": ["p0002_0#3"],
|
|
15
|
-
"children": [
|
|
16
|
-
{
|
|
17
|
-
"type": "paragraph",
|
|
18
|
-
"id": "p5",
|
|
19
|
-
"source": ["p0002_0#4"],
|
|
20
|
-
"sentences": [
|
|
21
|
-
{"id": "p5.1", "text": "二つ目の節の段落。"},
|
|
22
|
-
{"id": "p5.2", "text": "最後の文。"}
|
|
23
|
-
]
|
|
24
|
-
}
|
|
25
|
-
]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
28
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"file": "005_s1.2.json",
|
|
4
|
+
"id": "s1.2",
|
|
5
|
+
"ancestors": [
|
|
6
|
+
{"id": "s1", "level": 1, "title": "第1章 はじめの章"}
|
|
7
|
+
],
|
|
8
|
+
"body": [
|
|
9
|
+
{
|
|
10
|
+
"type": "section",
|
|
11
|
+
"id": "s1.2",
|
|
12
|
+
"level": 2,
|
|
13
|
+
"title": "1.2 二つ目の節",
|
|
14
|
+
"source": ["p0002_0#3"],
|
|
15
|
+
"children": [
|
|
16
|
+
{
|
|
17
|
+
"type": "paragraph",
|
|
18
|
+
"id": "p5",
|
|
19
|
+
"source": ["p0002_0#4"],
|
|
20
|
+
"sentences": [
|
|
21
|
+
{"id": "p5.1", "text": "二つ目の節の段落。"},
|
|
22
|
+
{"id": "p5.2", "text": "最後の文。"}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
}
|
|
@@ -1,64 +1,64 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"file": "006_s2.json",
|
|
4
|
-
"id": "s2",
|
|
5
|
-
"ancestors": [],
|
|
6
|
-
"body": [
|
|
7
|
-
{
|
|
8
|
-
"type": "section",
|
|
9
|
-
"id": "s2",
|
|
10
|
-
"level": 1,
|
|
11
|
-
"title": "第2章 子の無い大きな章",
|
|
12
|
-
"source": ["p0002_0#5"],
|
|
13
|
-
"children": [
|
|
14
|
-
{
|
|
15
|
-
"type": "paragraph",
|
|
16
|
-
"id": "p6",
|
|
17
|
-
"source": ["p0002_0#6"],
|
|
18
|
-
"sentences": [
|
|
19
|
-
{"id": "p6.1", "text": "長い文である。"},
|
|
20
|
-
{"id": "p6.2", "text": "長い文である。"},
|
|
21
|
-
{"id": "p6.3", "text": "長い文である。"},
|
|
22
|
-
{"id": "p6.4", "text": "長い文である。"},
|
|
23
|
-
{"id": "p6.5", "text": "長い文である。"},
|
|
24
|
-
{"id": "p6.6", "text": "長い文である。"},
|
|
25
|
-
{"id": "p6.7", "text": "長い文である。"},
|
|
26
|
-
{"id": "p6.8", "text": "長い文である。"},
|
|
27
|
-
{"id": "p6.9", "text": "長い文である。"},
|
|
28
|
-
{"id": "p6.10", "text": "長い文である。"},
|
|
29
|
-
{"id": "p6.11", "text": "長い文である。"},
|
|
30
|
-
{"id": "p6.12", "text": "長い文である。"},
|
|
31
|
-
{"id": "p6.13", "text": "長い文である。"},
|
|
32
|
-
{"id": "p6.14", "text": "長い文である。"},
|
|
33
|
-
{"id": "p6.15", "text": "長い文である。"},
|
|
34
|
-
{"id": "p6.16", "text": "長い文である。"},
|
|
35
|
-
{"id": "p6.17", "text": "長い文である。"},
|
|
36
|
-
{"id": "p6.18", "text": "長い文である。"},
|
|
37
|
-
{"id": "p6.19", "text": "長い文である。"},
|
|
38
|
-
{"id": "p6.20", "text": "長い文である。"},
|
|
39
|
-
{"id": "p6.21", "text": "長い文である。"},
|
|
40
|
-
{"id": "p6.22", "text": "長い文である。"},
|
|
41
|
-
{"id": "p6.23", "text": "長い文である。"},
|
|
42
|
-
{"id": "p6.24", "text": "長い文である。"},
|
|
43
|
-
{"id": "p6.25", "text": "長い文である。"},
|
|
44
|
-
{"id": "p6.26", "text": "長い文である。"},
|
|
45
|
-
{"id": "p6.27", "text": "長い文である。"},
|
|
46
|
-
{"id": "p6.28", "text": "長い文である。"},
|
|
47
|
-
{"id": "p6.29", "text": "長い文である。"},
|
|
48
|
-
{"id": "p6.30", "text": "長い文である。"},
|
|
49
|
-
{"id": "p6.31", "text": "長い文である。"},
|
|
50
|
-
{"id": "p6.32", "text": "長い文である。"},
|
|
51
|
-
{"id": "p6.33", "text": "長い文である。"},
|
|
52
|
-
{"id": "p6.34", "text": "長い文である。"},
|
|
53
|
-
{"id": "p6.35", "text": "長い文である。"},
|
|
54
|
-
{"id": "p6.36", "text": "長い文である。"},
|
|
55
|
-
{"id": "p6.37", "text": "長い文である。"},
|
|
56
|
-
{"id": "p6.38", "text": "長い文である。"},
|
|
57
|
-
{"id": "p6.39", "text": "長い文である。"},
|
|
58
|
-
{"id": "p6.40", "text": "長い文である。"}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
]
|
|
62
|
-
}
|
|
63
|
-
]
|
|
64
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"file": "006_s2.json",
|
|
4
|
+
"id": "s2",
|
|
5
|
+
"ancestors": [],
|
|
6
|
+
"body": [
|
|
7
|
+
{
|
|
8
|
+
"type": "section",
|
|
9
|
+
"id": "s2",
|
|
10
|
+
"level": 1,
|
|
11
|
+
"title": "第2章 子の無い大きな章",
|
|
12
|
+
"source": ["p0002_0#5"],
|
|
13
|
+
"children": [
|
|
14
|
+
{
|
|
15
|
+
"type": "paragraph",
|
|
16
|
+
"id": "p6",
|
|
17
|
+
"source": ["p0002_0#6"],
|
|
18
|
+
"sentences": [
|
|
19
|
+
{"id": "p6.1", "text": "長い文である。"},
|
|
20
|
+
{"id": "p6.2", "text": "長い文である。"},
|
|
21
|
+
{"id": "p6.3", "text": "長い文である。"},
|
|
22
|
+
{"id": "p6.4", "text": "長い文である。"},
|
|
23
|
+
{"id": "p6.5", "text": "長い文である。"},
|
|
24
|
+
{"id": "p6.6", "text": "長い文である。"},
|
|
25
|
+
{"id": "p6.7", "text": "長い文である。"},
|
|
26
|
+
{"id": "p6.8", "text": "長い文である。"},
|
|
27
|
+
{"id": "p6.9", "text": "長い文である。"},
|
|
28
|
+
{"id": "p6.10", "text": "長い文である。"},
|
|
29
|
+
{"id": "p6.11", "text": "長い文である。"},
|
|
30
|
+
{"id": "p6.12", "text": "長い文である。"},
|
|
31
|
+
{"id": "p6.13", "text": "長い文である。"},
|
|
32
|
+
{"id": "p6.14", "text": "長い文である。"},
|
|
33
|
+
{"id": "p6.15", "text": "長い文である。"},
|
|
34
|
+
{"id": "p6.16", "text": "長い文である。"},
|
|
35
|
+
{"id": "p6.17", "text": "長い文である。"},
|
|
36
|
+
{"id": "p6.18", "text": "長い文である。"},
|
|
37
|
+
{"id": "p6.19", "text": "長い文である。"},
|
|
38
|
+
{"id": "p6.20", "text": "長い文である。"},
|
|
39
|
+
{"id": "p6.21", "text": "長い文である。"},
|
|
40
|
+
{"id": "p6.22", "text": "長い文である。"},
|
|
41
|
+
{"id": "p6.23", "text": "長い文である。"},
|
|
42
|
+
{"id": "p6.24", "text": "長い文である。"},
|
|
43
|
+
{"id": "p6.25", "text": "長い文である。"},
|
|
44
|
+
{"id": "p6.26", "text": "長い文である。"},
|
|
45
|
+
{"id": "p6.27", "text": "長い文である。"},
|
|
46
|
+
{"id": "p6.28", "text": "長い文である。"},
|
|
47
|
+
{"id": "p6.29", "text": "長い文である。"},
|
|
48
|
+
{"id": "p6.30", "text": "長い文である。"},
|
|
49
|
+
{"id": "p6.31", "text": "長い文である。"},
|
|
50
|
+
{"id": "p6.32", "text": "長い文である。"},
|
|
51
|
+
{"id": "p6.33", "text": "長い文である。"},
|
|
52
|
+
{"id": "p6.34", "text": "長い文である。"},
|
|
53
|
+
{"id": "p6.35", "text": "長い文である。"},
|
|
54
|
+
{"id": "p6.36", "text": "長い文である。"},
|
|
55
|
+
{"id": "p6.37", "text": "長い文である。"},
|
|
56
|
+
{"id": "p6.38", "text": "長い文である。"},
|
|
57
|
+
{"id": "p6.39", "text": "長い文である。"},
|
|
58
|
+
{"id": "p6.40", "text": "長い文である。"}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
]
|
|
64
|
+
}
|
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 2,
|
|
3
|
-
"title": "テストの本",
|
|
4
|
-
"source": {"book": "book.json", "sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"},
|
|
5
|
-
"split_chars": 1,
|
|
6
|
-
"pages": [
|
|
7
|
-
{"id": "p0001_0", "status": "ok", "decorations": [{"type": "header", "text": "柱:テストの本"}, {"type": "footer", "text": "1"}]},
|
|
8
|
-
{"id": "p0002_0", "status": "ok", "decorations": [{"type": "footer", "text": "2"}]}
|
|
9
|
-
],
|
|
10
|
-
"files": [
|
|
11
|
-
{"file": "001_front.json", "id": null, "chars": 21, "json_chars": 273},
|
|
12
|
-
{"file": "002_s1.json", "id": "s1", "chars": 51, "json_chars": 1112},
|
|
13
|
-
{"file": "003_s1.1.json", "id": "s1.1", "chars": 32, "json_chars": 862},
|
|
14
|
-
{"file": "004_s1.1.1.json", "id": "s1.1.1", "chars": 21, "json_chars": 959},
|
|
15
|
-
{"file": "005_s1.2.json", "id": "s1.2", "chars": 22, "json_chars": 473},
|
|
16
|
-
{"file": "006_s2.json", "id": "s2", "chars": 291, "json_chars": 2008}
|
|
17
|
-
],
|
|
18
|
-
"toc": [
|
|
19
|
-
{
|
|
20
|
-
"id": "s1",
|
|
21
|
-
"level": 1,
|
|
22
|
-
"title": "第1章 はじめの章",
|
|
23
|
-
"file": "002_s1.json",
|
|
24
|
-
"children": [
|
|
25
|
-
{
|
|
26
|
-
"id": "s1.1",
|
|
27
|
-
"level": 2,
|
|
28
|
-
"title": "1.1 最初の節",
|
|
29
|
-
"file": "003_s1.1.json",
|
|
30
|
-
"children": [
|
|
31
|
-
{"id": "s1.1.1", "level": 3, "title": "1.1.1 深い項", "file": "004_s1.1.1.json", "children": []}
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
{"id": "s1.2", "level": 2, "title": "1.2 二つ目の節", "file": "005_s1.2.json", "children": []}
|
|
35
|
-
]
|
|
36
|
-
},
|
|
37
|
-
{"id": "s2", "level": 1, "title": "第2章 子の無い大きな章", "file": "006_s2.json", "children": []}
|
|
38
|
-
]
|
|
39
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {"book": "book.json", "sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"},
|
|
5
|
+
"split_chars": 1,
|
|
6
|
+
"pages": [
|
|
7
|
+
{"id": "p0001_0", "status": "ok", "decorations": [{"type": "header", "text": "柱:テストの本"}, {"type": "footer", "text": "1"}]},
|
|
8
|
+
{"id": "p0002_0", "status": "ok", "decorations": [{"type": "footer", "text": "2"}]}
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{"file": "001_front.json", "id": null, "chars": 21, "json_chars": 273},
|
|
12
|
+
{"file": "002_s1.json", "id": "s1", "chars": 51, "json_chars": 1112},
|
|
13
|
+
{"file": "003_s1.1.json", "id": "s1.1", "chars": 32, "json_chars": 862},
|
|
14
|
+
{"file": "004_s1.1.1.json", "id": "s1.1.1", "chars": 21, "json_chars": 959},
|
|
15
|
+
{"file": "005_s1.2.json", "id": "s1.2", "chars": 22, "json_chars": 473},
|
|
16
|
+
{"file": "006_s2.json", "id": "s2", "chars": 291, "json_chars": 2008}
|
|
17
|
+
],
|
|
18
|
+
"toc": [
|
|
19
|
+
{
|
|
20
|
+
"id": "s1",
|
|
21
|
+
"level": 1,
|
|
22
|
+
"title": "第1章 はじめの章",
|
|
23
|
+
"file": "002_s1.json",
|
|
24
|
+
"children": [
|
|
25
|
+
{
|
|
26
|
+
"id": "s1.1",
|
|
27
|
+
"level": 2,
|
|
28
|
+
"title": "1.1 最初の節",
|
|
29
|
+
"file": "003_s1.1.json",
|
|
30
|
+
"children": [
|
|
31
|
+
{"id": "s1.1.1", "level": 3, "title": "1.1.1 深い項", "file": "004_s1.1.1.json", "children": []}
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{"id": "s1.2", "level": 2, "title": "1.2 二つ目の節", "file": "005_s1.2.json", "children": []}
|
|
35
|
+
]
|
|
36
|
+
},
|
|
37
|
+
{"id": "s2", "level": 1, "title": "第2章 子の無い大きな章", "file": "006_s2.json", "children": []}
|
|
38
|
+
]
|
|
39
|
+
}
|
package/index.d.ts
CHANGED
|
@@ -16,3 +16,29 @@ export const structureIndexSchema: JsonSchema;
|
|
|
16
16
|
|
|
17
17
|
/** structure/<版>/ の分けたファイル(001_front.json、002_s1.json など)のスキーマ(schema/structure-part.schema.json)。 */
|
|
18
18
|
export const structurePartSchema: JsonSchema;
|
|
19
|
+
|
|
20
|
+
export type {
|
|
21
|
+
Ancestor,
|
|
22
|
+
BodyNode,
|
|
23
|
+
Caption,
|
|
24
|
+
Cell,
|
|
25
|
+
Decoration,
|
|
26
|
+
FileEntry,
|
|
27
|
+
Figure,
|
|
28
|
+
FrontNode,
|
|
29
|
+
FrontPart,
|
|
30
|
+
List,
|
|
31
|
+
ListItem,
|
|
32
|
+
PageInfo,
|
|
33
|
+
Paragraph,
|
|
34
|
+
Section,
|
|
35
|
+
SectionId,
|
|
36
|
+
SectionPart,
|
|
37
|
+
SectionRef,
|
|
38
|
+
Sentence,
|
|
39
|
+
Source,
|
|
40
|
+
StructureIndex,
|
|
41
|
+
StructurePart,
|
|
42
|
+
Table,
|
|
43
|
+
TocNode,
|
|
44
|
+
} from "./types.d.ts";
|
package/index.js
CHANGED
|
@@ -154,7 +154,7 @@ export const structureIndexSchema = {
|
|
|
154
154
|
],
|
|
155
155
|
"$defs": {
|
|
156
156
|
"sectionId": {
|
|
157
|
-
"description": "セクションの ID。出現順の連番で、入れ子の深さだけ「.」で区切る(s1 / s1.2 / s10.1.1)。ID
|
|
157
|
+
"description": "セクションの ID。出現順の連番で、入れ子の深さだけ「.」で区切る(s1 / s1.2 / s10.1.1)。ID は原本を作ったときに決まる名前で、位置を表す番号ではない。",
|
|
158
158
|
"type": "string",
|
|
159
159
|
"pattern": "^s[0-9]+(\\.[0-9]+)*$"
|
|
160
160
|
},
|
|
@@ -304,7 +304,7 @@ export const structurePartSchema = {
|
|
|
304
304
|
},
|
|
305
305
|
"$defs": {
|
|
306
306
|
"sectionId": {
|
|
307
|
-
"description": "セクションの ID。出現順の連番で、入れ子の深さだけ「.」で区切る(s1 / s1.2 / s10.1.1)。ID
|
|
307
|
+
"description": "セクションの ID。出現順の連番で、入れ子の深さだけ「.」で区切る(s1 / s1.2 / s10.1.1)。ID は原本を作ったときに決まる名前で、位置を表す番号ではない。",
|
|
308
308
|
"type": "string",
|
|
309
309
|
"pattern": "^s[0-9]+(\\.[0-9]+)*$"
|
|
310
310
|
},
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yanqirenshi/hefti",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "JSON Schema for structured book JSON (structure/<edition>/): index.json and the per-section part files",
|
|
5
|
-
"keywords": [
|
|
5
|
+
"keywords": [
|
|
6
|
+
"json-schema",
|
|
7
|
+
"book",
|
|
8
|
+
"structure"
|
|
9
|
+
],
|
|
6
10
|
"author": "yanqirenshi",
|
|
7
11
|
"license": "MIT",
|
|
8
12
|
"repository": {
|
|
@@ -10,7 +14,13 @@
|
|
|
10
14
|
"url": "git+https://github.com/yanqirenshi/Hefti.git"
|
|
11
15
|
},
|
|
12
16
|
"type": "module",
|
|
13
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"schema",
|
|
19
|
+
"examples",
|
|
20
|
+
"index.js",
|
|
21
|
+
"index.d.ts",
|
|
22
|
+
"types.d.ts"
|
|
23
|
+
],
|
|
14
24
|
"main": "./index.js",
|
|
15
25
|
"types": "./index.d.ts",
|
|
16
26
|
"exports": {
|
|
@@ -22,12 +32,17 @@
|
|
|
22
32
|
"./package.json": "./package.json"
|
|
23
33
|
},
|
|
24
34
|
"sideEffects": false,
|
|
25
|
-
"publishConfig": {
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
26
38
|
"scripts": {
|
|
27
|
-
"build": "node scripts/build-index.mjs",
|
|
28
|
-
"test": "node --test"
|
|
39
|
+
"build": "node scripts/build-index.mjs && node scripts/build-types.mjs",
|
|
40
|
+
"test": "node --test",
|
|
41
|
+
"prepublishOnly": "npm test"
|
|
29
42
|
},
|
|
30
43
|
"devDependencies": {
|
|
31
|
-
"ajv": "^8.17.1"
|
|
44
|
+
"ajv": "^8.17.1",
|
|
45
|
+
"json-schema-to-typescript": "16.0.0",
|
|
46
|
+
"typescript": "5.9.3"
|
|
32
47
|
}
|
|
33
48
|
}
|