@yanqirenshi/hefti 0.0.0-stage → 2.0.0
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 +136 -2
- package/examples/invalid/index/decoration_type.json +112 -0
- package/examples/invalid/index/file_chars_negative.json +112 -0
- package/examples/invalid/index/file_name.json +112 -0
- package/examples/invalid/index/file_no_file.json +111 -0
- package/examples/invalid/index/no_files.json +74 -0
- package/examples/invalid/index/no_pages.json +86 -0
- package/examples/invalid/index/no_sha256.json +111 -0
- package/examples/invalid/index/no_source.json +108 -0
- package/examples/invalid/index/no_toc.json +73 -0
- package/examples/invalid/index/no_version.json +111 -0
- package/examples/invalid/index/page_no_id.json +111 -0
- package/examples/invalid/index/page_status.json +112 -0
- package/examples/invalid/index/sha256_bad.json +112 -0
- package/examples/invalid/index/split_chars_0.json +112 -0
- package/examples/invalid/index/toc_children_string.json +89 -0
- package/examples/invalid/index/toc_id.json +112 -0
- package/examples/invalid/index/toc_level_0.json +112 -0
- package/examples/invalid/index/toc_no_file.json +111 -0
- package/examples/invalid/index/version_1.json +112 -0
- package/examples/invalid/part/caption--id.json +72 -0
- package/examples/invalid/part/caption--no_source.json +69 -0
- package/examples/invalid/part/caption--no_text.json +71 -0
- package/examples/invalid/part/figure--id.json +72 -0
- package/examples/invalid/part/figure--no_source.json +69 -0
- package/examples/invalid/part/figure--text_string.json +70 -0
- package/examples/invalid/part/file_ancestor_level_0.json +86 -0
- package/examples/invalid/part/file_body_string.json +18 -0
- package/examples/invalid/part/file_id.json +86 -0
- package/examples/invalid/part/file_no_ancestors.json +74 -0
- package/examples/invalid/part/file_no_body.json +17 -0
- package/examples/invalid/part/file_no_version.json +85 -0
- package/examples/invalid/part/file_version_1.json +86 -0
- package/examples/invalid/part/list--id.json +92 -0
- package/examples/invalid/part/list--item_id.json +92 -0
- package/examples/invalid/part/list--item_no_sentences.json +86 -0
- package/examples/invalid/part/list--no_items.json +62 -0
- package/examples/invalid/part/list--no_source.json +88 -0
- package/examples/invalid/part/paragraph--id.json +25 -0
- package/examples/invalid/part/paragraph--no_sentences.json +15 -0
- package/examples/invalid/part/paragraph--no_source.json +22 -0
- package/examples/invalid/part/paragraph--sentence_id.json +25 -0
- package/examples/invalid/part/paragraph--sentence_no_text.json +24 -0
- package/examples/invalid/part/paragraph--sentence_text_number.json +25 -0
- package/examples/invalid/part/paragraph--sentences_string.json +16 -0
- package/examples/invalid/part/paragraph--source_block_not_number.json +25 -0
- package/examples/invalid/part/paragraph--source_string.json +23 -0
- package/examples/invalid/part/paragraph--type.json +25 -0
- package/examples/invalid/part/section--id.json +92 -0
- package/examples/invalid/part/section--level_0.json +92 -0
- package/examples/invalid/part/section--level_string.json +92 -0
- package/examples/invalid/part/section--no_children.json +17 -0
- package/examples/invalid/part/section--no_id.json +91 -0
- package/examples/invalid/part/section--no_source.json +89 -0
- package/examples/invalid/part/section--no_title.json +91 -0
- package/examples/invalid/part/section--source_no_hash.json +92 -0
- package/examples/invalid/part/section--type.json +92 -0
- package/examples/invalid/part/section_ref--file_name.json +92 -0
- package/examples/invalid/part/section_ref--level_0.json +92 -0
- package/examples/invalid/part/section_ref--no_file.json +91 -0
- package/examples/invalid/part/section_ref--no_id.json +91 -0
- package/examples/invalid/part/section_ref--no_title.json +91 -0
- package/examples/invalid/part/table--cell_col_negative.json +86 -0
- package/examples/invalid/part/table--cell_col_span_0.json +86 -0
- package/examples/invalid/part/table--cell_no_text.json +85 -0
- package/examples/invalid/part/table--cell_row_negative.json +86 -0
- package/examples/invalid/part/table--cell_row_span_0.json +86 -0
- package/examples/invalid/part/table--id.json +86 -0
- package/examples/invalid/part/table--no_cells.json +56 -0
- package/examples/invalid/part/table--no_source.json +83 -0
- package/examples/valid/big_table_book/001_s1.json +27 -0
- package/examples/valid/big_table_book/002_s1.1.json +216 -0
- package/examples/valid/big_table_book/003_s1.2.json +27 -0
- package/examples/valid/big_table_book/004_s2.json +25 -0
- package/examples/valid/big_table_book/index.json +28 -0
- package/examples/valid/deep_book/001_s1.json +27 -0
- package/examples/valid/deep_book/002_s1.1.json +29 -0
- package/examples/valid/deep_book/003_s1.1.1.json +30 -0
- package/examples/valid/deep_book/004_s1.1.1.1.json +31 -0
- package/examples/valid/deep_book/005_s1.1.1.1.1.json +32 -0
- package/examples/valid/deep_book/006_s1.1.1.1.1.1.json +33 -0
- package/examples/valid/deep_book/007_s1.1.1.1.1.1.1.json +33 -0
- package/examples/valid/deep_book/index.json +69 -0
- package/examples/valid/empty_book/index.json +9 -0
- package/examples/valid/merged_table_book/001_s1.json +38 -0
- package/examples/valid/merged_table_book/index.json +15 -0
- package/examples/valid/no_heading_book/001_front.json +39 -0
- package/examples/valid/no_heading_book/index.json +14 -0
- package/examples/valid/rich_book/001_front.json +17 -0
- package/examples/valid/rich_book/002_s1.json +123 -0
- package/examples/valid/rich_book/003_s2.json +25 -0
- package/examples/valid/rich_book/index.json +45 -0
- package/examples/valid/rich_split_book/001_front.json +17 -0
- package/examples/valid/rich_split_book/002_s1.json +28 -0
- package/examples/valid/rich_split_book/003_s1.1.json +90 -0
- package/examples/valid/rich_split_book/004_s1.1.1.json +28 -0
- package/examples/valid/rich_split_book/005_s2.json +25 -0
- package/examples/valid/rich_split_book/index.json +47 -0
- package/examples/valid/sized_book/001_front.json +17 -0
- package/examples/valid/sized_book/002_s1.json +51 -0
- package/examples/valid/sized_book/003_s1.1.json +43 -0
- package/examples/valid/sized_book/004_s1.1.1.json +42 -0
- package/examples/valid/sized_book/005_s1.2.json +28 -0
- package/examples/valid/sized_book/006_s2.json +64 -0
- package/examples/valid/sized_book/index.json +39 -0
- package/index.d.ts +18 -0
- package/index.js +693 -0
- package/package.json +31 -4
- package/schema/structure-index.schema.json +196 -0
- package/schema/structure-part.schema.json +492 -0
package/README.md
CHANGED
|
@@ -1,3 +1,137 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Hefti
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
書籍の構造化 JSON(`structure/<版>/`)の形式を定める JSON Schema(draft 2020-12)です。
|
|
4
|
+
npm パッケージ `@yanqirenshi/hefti` として配ります。
|
|
5
|
+
|
|
6
|
+
この形式は、本を OCR して構造化するプログラムと、それを読む・編集する後工程のプログラムが、共通して使います。
|
|
7
|
+
形式の定義だけを独立させてあるので、どの言語・どの道具からも同じスキーマで確かめられます。
|
|
8
|
+
|
|
9
|
+
## 形式
|
|
10
|
+
|
|
11
|
+
`structure/<版>/` は、1 冊の本を「セクション(入れ子)→ パラグラフ → センテンス」で持つフォルダです。
|
|
12
|
+
`structure/` の下には版が並びます(OCR の結果から作る原本の `original`、それを編集した版など)。
|
|
13
|
+
どの版も、同じ形式を使います。
|
|
14
|
+
|
|
15
|
+
| ファイル | 検証するもの |
|
|
16
|
+
|---|---|
|
|
17
|
+
| `schema/structure-index.schema.json` | `structure/<版>/index.json`(全体の情報・ページの情報・ファイルの一覧・目次) |
|
|
18
|
+
| `schema/structure-part.schema.json` | 分けたファイル(`001_front.json`、`002_s1.json` など)。要素(section / section_ref / paragraph / list / figure / caption / table / sentence / source)の定義は、このファイルの `$defs` にまとめてある |
|
|
19
|
+
|
|
20
|
+
- どちらも 1 ファイルだけで検証できます(別ファイルへの `$ref` は使っていません)。
|
|
21
|
+
- 各プロパティに日本語の `description` があります。スキーマだけ読んでも意味が分かります。
|
|
22
|
+
- 知らないプロパティは許します。後工程が要素に情報を足して別の JSON にできるようにするためです。
|
|
23
|
+
- ID の形(`s1.2`・`p12`・`p12.3`・`l1.2.3`・`f1`・`t1`・`c1`)と `source`(`ページID#ブロック番号`)は、`pattern` で締めてあります。
|
|
24
|
+
- **スキーマでは確かめられないこと**:ID が `structure/<版>/` 全体で重複しない、`section_ref` の先のファイルがある、`index.json` の `files` と実際のファイルが合う、など。これらは、読み込む側のプログラムが確かめます。
|
|
25
|
+
|
|
26
|
+
## 版番号
|
|
27
|
+
|
|
28
|
+
パッケージの版番号のメジャーは、データ形式の版(JSON の `version`)と同じです。
|
|
29
|
+
いまの形式は `version: 2` なので、`2.x.y` が対応します。
|
|
30
|
+
形式を壊す変更をしたときは、`version` とメジャーを一緒に上げます。
|
|
31
|
+
|
|
32
|
+
## 使い方(npm)
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
npm install @yanqirenshi/hefti
|
|
36
|
+
npm install ajv # 検証に使う場合(Hefti 自体は実行時の依存を持ちません)
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
スキーマを JS のオブジェクトとして読めます。
|
|
40
|
+
Node でも、Next.js などのバンドラーでも、同じように読めます。
|
|
41
|
+
|
|
42
|
+
```js
|
|
43
|
+
import Ajv2020 from "ajv/dist/2020.js";
|
|
44
|
+
import { structureIndexSchema, structurePartSchema } from "@yanqirenshi/hefti";
|
|
45
|
+
|
|
46
|
+
const ajv = new Ajv2020();
|
|
47
|
+
const validateIndex = ajv.compile(structureIndexSchema);
|
|
48
|
+
const validatePart = ajv.compile(structurePartSchema);
|
|
49
|
+
|
|
50
|
+
if (!validateIndex(index)) console.error(validateIndex.errors);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
JSON ファイルのまま読むこともできます。
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
import index from "@yanqirenshi/hefti/schema/structure-index.schema.json" with { type: "json" };
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
> 補足:ajv の `strict: true`(`strictTypes` を含む)では、`structure-part.schema.json` の `then` の中の `maxItems` に「`type` が無い」と警告されます。
|
|
60
|
+
> 検証の結果は変わらないので、`new Ajv2020({ strictTypes: false })` にするか、既定の設定で使ってください。
|
|
61
|
+
|
|
62
|
+
## 使い方(npm を使わない言語)
|
|
63
|
+
|
|
64
|
+
Python や Rust など、npm を使わない言語では、レジストリの tarball から `schema/` を取り出して使います。
|
|
65
|
+
`<版>` には、取り込みたいパッケージの版(例: `2.0.0`)を入れます。
|
|
66
|
+
|
|
67
|
+
```sh
|
|
68
|
+
curl -fsSL https://registry.npmjs.org/@yanqirenshi/hefti/-/hefti-<版>.tgz -o hefti.tgz
|
|
69
|
+
tar -xzf hefti.tgz package/schema package/examples
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
`package/schema/` に、スキーマ 2 件が入っています。
|
|
73
|
+
自分のリポジトリにコピーし、取り込んだ版を記録しておくと、あとで同期を確かめられます。
|
|
74
|
+
取り込んだファイルは、Hefti のコピーです。直接編集しないでください。
|
|
75
|
+
|
|
76
|
+
Python(`jsonschema`)での検証の例:
|
|
77
|
+
|
|
78
|
+
```python
|
|
79
|
+
import json
|
|
80
|
+
from pathlib import Path
|
|
81
|
+
from jsonschema import Draft202012Validator
|
|
82
|
+
|
|
83
|
+
def validator(name):
|
|
84
|
+
return Draft202012Validator(json.loads(Path(f"schema/{name}.schema.json").read_text(encoding="utf-8")))
|
|
85
|
+
|
|
86
|
+
index, part = validator("structure-index"), validator("structure-part")
|
|
87
|
+
for f in sorted(Path("out/structure/original").glob("*.json")):
|
|
88
|
+
v = index if f.name == "index.json" else part
|
|
89
|
+
for e in v.iter_errors(json.loads(f.read_text(encoding="utf-8"))):
|
|
90
|
+
print(f.name, "/".join(map(str, e.absolute_path)), e.message)
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Rust では、`include_str!` でスキーマをバイナリに埋め込み、`jsonschema` クレートなどで検証できます。
|
|
94
|
+
|
|
95
|
+
## 見本
|
|
96
|
+
|
|
97
|
+
`examples/valid/<本の名前>/` に、正しい見本があります(`index.json` と分けたファイル)。
|
|
98
|
+
見本全体で、すべての種類の要素(section / section_ref / paragraph / list / figure / caption / table)を含みます。
|
|
99
|
+
パッケージにも入っているので、ほかの言語の実装が、同じ見本でテストできます。
|
|
100
|
+
|
|
101
|
+
| フォルダ | 内容 |
|
|
102
|
+
|---|---|
|
|
103
|
+
| `rich_book` | 柱・ノンブル・索引、白紙のページ、OCR 失敗、図・表・箇条書き・図表の説明を含む(最上位のセクションごとに 3 ファイル) |
|
|
104
|
+
| `rich_split_book` | `rich_book` と同じ本を小さく分けたもの(`section_ref` を含む) |
|
|
105
|
+
| `sized_book` | 上限を 1 文字にして、セクションごとに分けたもの(`section_ref` を含む) |
|
|
106
|
+
| `no_heading_book` | 見出しが無い本(`id` が `null` のファイルだけ) |
|
|
107
|
+
| `empty_book` | 中身が空の本 |
|
|
108
|
+
| `big_table_book` | 大きな表を含む本(`section_ref` を含む) |
|
|
109
|
+
| `deep_book` | 見出しが 7 段まで入れ子になる本 |
|
|
110
|
+
| `merged_table_book` | 結合セル(`row_span` / `col_span`)を含む表 |
|
|
111
|
+
|
|
112
|
+
`examples/invalid/` には、スキーマに通らない見本があります。
|
|
113
|
+
`sized_book` を 1 か所だけ壊したもので、1 ファイルに違反が 1 つです。
|
|
114
|
+
ファイル名が違反の内容を表します。
|
|
115
|
+
|
|
116
|
+
| フォルダ | 検証に使うスキーマ | ファイル名 |
|
|
117
|
+
|---|---|---|
|
|
118
|
+
| `index/` | `structure-index.schema.json` | `<違反>.json`(例: `no_sha256.json`、`toc_level_0.json`) |
|
|
119
|
+
| `part/` | `structure-part.schema.json` | `<要素の種類>--<違反>.json`(例: `paragraph--no_sentences.json`)。ファイル全体の違反は `file_<違反>.json` |
|
|
120
|
+
|
|
121
|
+
ほかの言語の実装では、`examples/valid/` がすべて通り、`examples/invalid/` がすべて拒否されることを確かめてください。
|
|
122
|
+
|
|
123
|
+
## 開発
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
npm install
|
|
127
|
+
npm test # スキーマ自体・見本・index.js のテスト(test/)
|
|
128
|
+
node scripts/build-index.mjs # schema/ から index.js を作り直す
|
|
129
|
+
node scripts/build-invalid.mjs # examples/valid/sized_book から examples/invalid/ を作り直す
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
`examples/invalid/` は生成したものをコミットしています。
|
|
133
|
+
壊し方を変えるときは `scripts/build-invalid.mjs` を直して作り直してください(作り直し忘れは `npm test` が見つけます)。
|
|
134
|
+
|
|
135
|
+
## ライセンス
|
|
136
|
+
|
|
137
|
+
MIT
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {
|
|
5
|
+
"book": "book.json",
|
|
6
|
+
"sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"
|
|
7
|
+
},
|
|
8
|
+
"split_chars": 1,
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"id": "p0001_0",
|
|
12
|
+
"status": "ok",
|
|
13
|
+
"decorations": [
|
|
14
|
+
{
|
|
15
|
+
"type": "body",
|
|
16
|
+
"text": "柱:テストの本"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "footer",
|
|
20
|
+
"text": "1"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "p0002_0",
|
|
26
|
+
"status": "ok",
|
|
27
|
+
"decorations": [
|
|
28
|
+
{
|
|
29
|
+
"type": "footer",
|
|
30
|
+
"text": "2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
{
|
|
37
|
+
"file": "001_front.json",
|
|
38
|
+
"id": null,
|
|
39
|
+
"chars": 21,
|
|
40
|
+
"json_chars": 273
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"file": "002_s1.json",
|
|
44
|
+
"id": "s1",
|
|
45
|
+
"chars": 51,
|
|
46
|
+
"json_chars": 1112
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"file": "003_s1.1.json",
|
|
50
|
+
"id": "s1.1",
|
|
51
|
+
"chars": 32,
|
|
52
|
+
"json_chars": 862
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"file": "004_s1.1.1.json",
|
|
56
|
+
"id": "s1.1.1",
|
|
57
|
+
"chars": 21,
|
|
58
|
+
"json_chars": 959
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "005_s1.2.json",
|
|
62
|
+
"id": "s1.2",
|
|
63
|
+
"chars": 22,
|
|
64
|
+
"json_chars": 473
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"file": "006_s2.json",
|
|
68
|
+
"id": "s2",
|
|
69
|
+
"chars": 291,
|
|
70
|
+
"json_chars": 2008
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"toc": [
|
|
74
|
+
{
|
|
75
|
+
"id": "s1",
|
|
76
|
+
"level": 1,
|
|
77
|
+
"title": "第1章 はじめの章",
|
|
78
|
+
"file": "002_s1.json",
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"id": "s1.1",
|
|
82
|
+
"level": 2,
|
|
83
|
+
"title": "1.1 最初の節",
|
|
84
|
+
"file": "003_s1.1.json",
|
|
85
|
+
"children": [
|
|
86
|
+
{
|
|
87
|
+
"id": "s1.1.1",
|
|
88
|
+
"level": 3,
|
|
89
|
+
"title": "1.1.1 深い項",
|
|
90
|
+
"file": "004_s1.1.1.json",
|
|
91
|
+
"children": []
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "s1.2",
|
|
97
|
+
"level": 2,
|
|
98
|
+
"title": "1.2 二つ目の節",
|
|
99
|
+
"file": "005_s1.2.json",
|
|
100
|
+
"children": []
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "s2",
|
|
106
|
+
"level": 1,
|
|
107
|
+
"title": "第2章 子の無い大きな章",
|
|
108
|
+
"file": "006_s2.json",
|
|
109
|
+
"children": []
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {
|
|
5
|
+
"book": "book.json",
|
|
6
|
+
"sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"
|
|
7
|
+
},
|
|
8
|
+
"split_chars": 1,
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"id": "p0001_0",
|
|
12
|
+
"status": "ok",
|
|
13
|
+
"decorations": [
|
|
14
|
+
{
|
|
15
|
+
"type": "header",
|
|
16
|
+
"text": "柱:テストの本"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "footer",
|
|
20
|
+
"text": "1"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "p0002_0",
|
|
26
|
+
"status": "ok",
|
|
27
|
+
"decorations": [
|
|
28
|
+
{
|
|
29
|
+
"type": "footer",
|
|
30
|
+
"text": "2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
{
|
|
37
|
+
"file": "001_front.json",
|
|
38
|
+
"id": null,
|
|
39
|
+
"chars": -1,
|
|
40
|
+
"json_chars": 273
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"file": "002_s1.json",
|
|
44
|
+
"id": "s1",
|
|
45
|
+
"chars": 51,
|
|
46
|
+
"json_chars": 1112
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"file": "003_s1.1.json",
|
|
50
|
+
"id": "s1.1",
|
|
51
|
+
"chars": 32,
|
|
52
|
+
"json_chars": 862
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"file": "004_s1.1.1.json",
|
|
56
|
+
"id": "s1.1.1",
|
|
57
|
+
"chars": 21,
|
|
58
|
+
"json_chars": 959
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "005_s1.2.json",
|
|
62
|
+
"id": "s1.2",
|
|
63
|
+
"chars": 22,
|
|
64
|
+
"json_chars": 473
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"file": "006_s2.json",
|
|
68
|
+
"id": "s2",
|
|
69
|
+
"chars": 291,
|
|
70
|
+
"json_chars": 2008
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"toc": [
|
|
74
|
+
{
|
|
75
|
+
"id": "s1",
|
|
76
|
+
"level": 1,
|
|
77
|
+
"title": "第1章 はじめの章",
|
|
78
|
+
"file": "002_s1.json",
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"id": "s1.1",
|
|
82
|
+
"level": 2,
|
|
83
|
+
"title": "1.1 最初の節",
|
|
84
|
+
"file": "003_s1.1.json",
|
|
85
|
+
"children": [
|
|
86
|
+
{
|
|
87
|
+
"id": "s1.1.1",
|
|
88
|
+
"level": 3,
|
|
89
|
+
"title": "1.1.1 深い項",
|
|
90
|
+
"file": "004_s1.1.1.json",
|
|
91
|
+
"children": []
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "s1.2",
|
|
97
|
+
"level": 2,
|
|
98
|
+
"title": "1.2 二つ目の節",
|
|
99
|
+
"file": "005_s1.2.json",
|
|
100
|
+
"children": []
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "s2",
|
|
106
|
+
"level": 1,
|
|
107
|
+
"title": "第2章 子の無い大きな章",
|
|
108
|
+
"file": "006_s2.json",
|
|
109
|
+
"children": []
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {
|
|
5
|
+
"book": "book.json",
|
|
6
|
+
"sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"
|
|
7
|
+
},
|
|
8
|
+
"split_chars": 1,
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"id": "p0001_0",
|
|
12
|
+
"status": "ok",
|
|
13
|
+
"decorations": [
|
|
14
|
+
{
|
|
15
|
+
"type": "header",
|
|
16
|
+
"text": "柱:テストの本"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "footer",
|
|
20
|
+
"text": "1"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "p0002_0",
|
|
26
|
+
"status": "ok",
|
|
27
|
+
"decorations": [
|
|
28
|
+
{
|
|
29
|
+
"type": "footer",
|
|
30
|
+
"text": "2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
{
|
|
37
|
+
"file": "001_front.json",
|
|
38
|
+
"id": null,
|
|
39
|
+
"chars": 21,
|
|
40
|
+
"json_chars": 273
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"file": "s1.json",
|
|
44
|
+
"id": "s1",
|
|
45
|
+
"chars": 51,
|
|
46
|
+
"json_chars": 1112
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"file": "003_s1.1.json",
|
|
50
|
+
"id": "s1.1",
|
|
51
|
+
"chars": 32,
|
|
52
|
+
"json_chars": 862
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"file": "004_s1.1.1.json",
|
|
56
|
+
"id": "s1.1.1",
|
|
57
|
+
"chars": 21,
|
|
58
|
+
"json_chars": 959
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
"file": "005_s1.2.json",
|
|
62
|
+
"id": "s1.2",
|
|
63
|
+
"chars": 22,
|
|
64
|
+
"json_chars": 473
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"file": "006_s2.json",
|
|
68
|
+
"id": "s2",
|
|
69
|
+
"chars": 291,
|
|
70
|
+
"json_chars": 2008
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"toc": [
|
|
74
|
+
{
|
|
75
|
+
"id": "s1",
|
|
76
|
+
"level": 1,
|
|
77
|
+
"title": "第1章 はじめの章",
|
|
78
|
+
"file": "002_s1.json",
|
|
79
|
+
"children": [
|
|
80
|
+
{
|
|
81
|
+
"id": "s1.1",
|
|
82
|
+
"level": 2,
|
|
83
|
+
"title": "1.1 最初の節",
|
|
84
|
+
"file": "003_s1.1.json",
|
|
85
|
+
"children": [
|
|
86
|
+
{
|
|
87
|
+
"id": "s1.1.1",
|
|
88
|
+
"level": 3,
|
|
89
|
+
"title": "1.1.1 深い項",
|
|
90
|
+
"file": "004_s1.1.1.json",
|
|
91
|
+
"children": []
|
|
92
|
+
}
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"id": "s1.2",
|
|
97
|
+
"level": 2,
|
|
98
|
+
"title": "1.2 二つ目の節",
|
|
99
|
+
"file": "005_s1.2.json",
|
|
100
|
+
"children": []
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"id": "s2",
|
|
106
|
+
"level": 1,
|
|
107
|
+
"title": "第2章 子の無い大きな章",
|
|
108
|
+
"file": "006_s2.json",
|
|
109
|
+
"children": []
|
|
110
|
+
}
|
|
111
|
+
]
|
|
112
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {
|
|
5
|
+
"book": "book.json",
|
|
6
|
+
"sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"
|
|
7
|
+
},
|
|
8
|
+
"split_chars": 1,
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"id": "p0001_0",
|
|
12
|
+
"status": "ok",
|
|
13
|
+
"decorations": [
|
|
14
|
+
{
|
|
15
|
+
"type": "header",
|
|
16
|
+
"text": "柱:テストの本"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "footer",
|
|
20
|
+
"text": "1"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "p0002_0",
|
|
26
|
+
"status": "ok",
|
|
27
|
+
"decorations": [
|
|
28
|
+
{
|
|
29
|
+
"type": "footer",
|
|
30
|
+
"text": "2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"files": [
|
|
36
|
+
{
|
|
37
|
+
"id": null,
|
|
38
|
+
"chars": 21,
|
|
39
|
+
"json_chars": 273
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
"file": "002_s1.json",
|
|
43
|
+
"id": "s1",
|
|
44
|
+
"chars": 51,
|
|
45
|
+
"json_chars": 1112
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"file": "003_s1.1.json",
|
|
49
|
+
"id": "s1.1",
|
|
50
|
+
"chars": 32,
|
|
51
|
+
"json_chars": 862
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"file": "004_s1.1.1.json",
|
|
55
|
+
"id": "s1.1.1",
|
|
56
|
+
"chars": 21,
|
|
57
|
+
"json_chars": 959
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"file": "005_s1.2.json",
|
|
61
|
+
"id": "s1.2",
|
|
62
|
+
"chars": 22,
|
|
63
|
+
"json_chars": 473
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"file": "006_s2.json",
|
|
67
|
+
"id": "s2",
|
|
68
|
+
"chars": 291,
|
|
69
|
+
"json_chars": 2008
|
|
70
|
+
}
|
|
71
|
+
],
|
|
72
|
+
"toc": [
|
|
73
|
+
{
|
|
74
|
+
"id": "s1",
|
|
75
|
+
"level": 1,
|
|
76
|
+
"title": "第1章 はじめの章",
|
|
77
|
+
"file": "002_s1.json",
|
|
78
|
+
"children": [
|
|
79
|
+
{
|
|
80
|
+
"id": "s1.1",
|
|
81
|
+
"level": 2,
|
|
82
|
+
"title": "1.1 最初の節",
|
|
83
|
+
"file": "003_s1.1.json",
|
|
84
|
+
"children": [
|
|
85
|
+
{
|
|
86
|
+
"id": "s1.1.1",
|
|
87
|
+
"level": 3,
|
|
88
|
+
"title": "1.1.1 深い項",
|
|
89
|
+
"file": "004_s1.1.1.json",
|
|
90
|
+
"children": []
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"id": "s1.2",
|
|
96
|
+
"level": 2,
|
|
97
|
+
"title": "1.2 二つ目の節",
|
|
98
|
+
"file": "005_s1.2.json",
|
|
99
|
+
"children": []
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"id": "s2",
|
|
105
|
+
"level": 1,
|
|
106
|
+
"title": "第2章 子の無い大きな章",
|
|
107
|
+
"file": "006_s2.json",
|
|
108
|
+
"children": []
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 2,
|
|
3
|
+
"title": "テストの本",
|
|
4
|
+
"source": {
|
|
5
|
+
"book": "book.json",
|
|
6
|
+
"sha256": "b9cf0e2d7620250d09d1c9124cf40f88999c0308f743f0560d2965da21a65555"
|
|
7
|
+
},
|
|
8
|
+
"split_chars": 1,
|
|
9
|
+
"pages": [
|
|
10
|
+
{
|
|
11
|
+
"id": "p0001_0",
|
|
12
|
+
"status": "ok",
|
|
13
|
+
"decorations": [
|
|
14
|
+
{
|
|
15
|
+
"type": "header",
|
|
16
|
+
"text": "柱:テストの本"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"type": "footer",
|
|
20
|
+
"text": "1"
|
|
21
|
+
}
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"id": "p0002_0",
|
|
26
|
+
"status": "ok",
|
|
27
|
+
"decorations": [
|
|
28
|
+
{
|
|
29
|
+
"type": "footer",
|
|
30
|
+
"text": "2"
|
|
31
|
+
}
|
|
32
|
+
]
|
|
33
|
+
}
|
|
34
|
+
],
|
|
35
|
+
"toc": [
|
|
36
|
+
{
|
|
37
|
+
"id": "s1",
|
|
38
|
+
"level": 1,
|
|
39
|
+
"title": "第1章 はじめの章",
|
|
40
|
+
"file": "002_s1.json",
|
|
41
|
+
"children": [
|
|
42
|
+
{
|
|
43
|
+
"id": "s1.1",
|
|
44
|
+
"level": 2,
|
|
45
|
+
"title": "1.1 最初の節",
|
|
46
|
+
"file": "003_s1.1.json",
|
|
47
|
+
"children": [
|
|
48
|
+
{
|
|
49
|
+
"id": "s1.1.1",
|
|
50
|
+
"level": 3,
|
|
51
|
+
"title": "1.1.1 深い項",
|
|
52
|
+
"file": "004_s1.1.1.json",
|
|
53
|
+
"children": []
|
|
54
|
+
}
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"id": "s1.2",
|
|
59
|
+
"level": 2,
|
|
60
|
+
"title": "1.2 二つ目の節",
|
|
61
|
+
"file": "005_s1.2.json",
|
|
62
|
+
"children": []
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
"id": "s2",
|
|
68
|
+
"level": 1,
|
|
69
|
+
"title": "第2章 子の無い大きな章",
|
|
70
|
+
"file": "006_s2.json",
|
|
71
|
+
"children": []
|
|
72
|
+
}
|
|
73
|
+
]
|
|
74
|
+
}
|