bindery-cli 0.2.0 → 0.2.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.
- checksums.yaml +4 -4
- data/README.md +9 -7
- data/lib/bindery/assets/index.html +687 -0
- data/lib/bindery/book.rb +2 -25
- data/lib/bindery/builder.rb +15 -48
- data/lib/bindery/cli.rb +63 -3
- data/lib/bindery/cover.rb +1 -1
- data/lib/bindery/generators/book_generator.rb +1 -1
- data/lib/bindery/generators/chapter_generator.rb +6 -6
- data/lib/bindery/generators/templates/book/chapters/{01-chapter.md.erb → chapter-0001.md.erb} +2 -1
- data/lib/bindery/generators/templates/project/README.md.erb +6 -0
- data/lib/bindery/generators/volume_generator.rb +16 -20
- data/lib/bindery/renamer.rb +57 -0
- data/lib/bindery/server.rb +56 -3
- data/lib/bindery/validator.rb +3 -3
- data/lib/bindery/version.rb +1 -1
- data/lib/bindery.rb +1 -0
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7457c3072ce5bcbcbdedc902ef9318408f638430051e6c704fafa29d78bba631
|
|
4
|
+
data.tar.gz: f7a197b9dff65d489d3d6b245139e8ac67b88fce77a8283b87a1c9eafb79d382
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f86e911bfbee318cf7784389007f3e37bd9067a2eb20af9b01d8e7da5d1dd45cbfacfdc6d2f2106f23ee80c09557b25158c8ef9ae7cb37afc625e06c4f32b1cc
|
|
7
|
+
data.tar.gz: c24b1ea8c04950e228ee87387d6ed5fa9b172f16d420a336ee3234b29f954c173524369578ec0af541aa985ec43d5f05bfbbcee9eb1ea1ddbb15a454d3c7da9e
|
data/README.md
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
- `bindery new book <书名>` 新建一本书(ID 自动生成)
|
|
7
7
|
- `bindery build` 调用 [Pandoc](https://pandoc.org) 批量构建 EPUB
|
|
8
8
|
- `bindery validate` / `clean` / `watch` / `serve` / `status` 管理书籍与产物
|
|
9
|
+
- `bindery web` 打开 Web 封面生成器(自动填充书籍信息)
|
|
9
10
|
|
|
10
11
|
仅依赖 Ruby 标准库,不引入任何第三方 gem。
|
|
11
12
|
|
|
@@ -40,12 +41,13 @@ bindery init
|
|
|
40
41
|
# (N = 正文章节数,封面/目录由构建自动生成)
|
|
41
42
|
bindery new book "论语" --author "孔子及弟子" --dynasty "先秦" --translator "译者甲" --isbn "9781234567890" --cover
|
|
42
43
|
|
|
43
|
-
# 4.
|
|
44
|
+
# 4. (可选)卷式结构:卷由标题层级定义(h2=卷名,h3=章名),每卷在 EPUB 中独立成页
|
|
44
45
|
bindery new volume <id> "学而" --chapters 5
|
|
45
46
|
bindery new volume <id> "为政" --chapters 5
|
|
46
47
|
|
|
47
48
|
# 5. 编辑 books/<id>/chapters/ 下的章节文件
|
|
48
49
|
# (可选)单独批量创建章节:bindery new chapter <id> 10
|
|
50
|
+
# (可选)按标题自动重命名章节:bindery rename chapters <id>
|
|
49
51
|
# (可选)单独生成封面:bindery cover <id>
|
|
50
52
|
|
|
51
53
|
# 6. 构建 EPUB
|
|
@@ -67,6 +69,9 @@ bindery watch
|
|
|
67
69
|
# 本地启动书库站点
|
|
68
70
|
bindery serve
|
|
69
71
|
|
|
72
|
+
# 打开 Web 封面生成器(自动填充书籍信息)
|
|
73
|
+
bindery web
|
|
74
|
+
|
|
70
75
|
# 清理构建产物
|
|
71
76
|
bindery clean --all
|
|
72
77
|
```
|
|
@@ -80,13 +85,10 @@ my-books/
|
|
|
80
85
|
│ └── <id>/
|
|
81
86
|
│ ├── metadata.yaml # 书籍元信息
|
|
82
87
|
│ ├── cover.png # 封面(可选,bindery cover 自动生成)
|
|
83
|
-
│ └── chapters/ #
|
|
88
|
+
│ └── chapters/ # 平铺 Markdown,卷结构由标题层级定义(## 卷名 / ### 章名)
|
|
84
89
|
│ ├── 01-chapter.md
|
|
85
|
-
│ ├── 01
|
|
86
|
-
│
|
|
87
|
-
│ │ └── 02.md
|
|
88
|
-
│ └── 02-为政/
|
|
89
|
-
│ └── 01.md
|
|
90
|
+
│ ├── 卷01-学而.md
|
|
91
|
+
│ └── 卷02-为政.md
|
|
90
92
|
├── templates/style.css # 全项目共用的 EPUB 样式
|
|
91
93
|
├── output/epub/ # 构建产物
|
|
92
94
|
└── books.json # 自动生成的书目索引
|