Skip to content

Commit ab6fe0a

Browse files
committed
feature: 增加生成 epub 格式的文件
1 parent b687c1e commit ab6fe0a

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

bin/epub

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
#!/usr/bin/env bash
22

3-
set -ex
4-
53
# Set the directory containing Markdown files
64
SCRIPT_DIR=$(dirname "$0")
75
INPUT_DIR=$(cd "$(dirname "$SCRIPT_DIR")" && pwd)
@@ -19,7 +17,7 @@ convert_to_epub() {
1917
local meta_file=${INPUT_DIR}/metadata.yaml
2018
local css_file=${INPUT_DIR}/js/epub.css
2119

22-
pandoc -o "$OUTPUT_BOOK" "$meta_file" \
20+
pandoc -o "$OUTPUT_BOOK" --metadata-file="$meta_file" \
2321
--toc-depth=2 \
2422
--top-level-division=chapter \
2523
--file-scope=true \

metadata.yaml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1-
---
2-
title: 设计数据密集型应用
3-
author: Martin Kleppmann
1+
title:
2+
- type: main
3+
text: 设计数据密集型应用
4+
- type: subtitle
5+
text: 可靠、可扩展、可维护的系统
6+
7+
creator:
8+
- role: author
9+
name: Martin Kleppmann
10+
411
rights: Creative Commons Non-Commercial Share Alike 3.0
512
language: 中文
13+
cover-image: ./img/title.png

0 commit comments

Comments
 (0)