mirror of
https://github.com/Vonng/ddia.git
synced 2026-06-20 16:45:44 +08:00
feature: 增加生成 epub 格式的文件
This commit is contained in:
parent
b687c1e660
commit
ab6fe0a1dd
2 changed files with 12 additions and 6 deletions
4
bin/epub
4
bin/epub
|
|
@ -1,7 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
# Set the directory containing Markdown files
|
# Set the directory containing Markdown files
|
||||||
SCRIPT_DIR=$(dirname "$0")
|
SCRIPT_DIR=$(dirname "$0")
|
||||||
INPUT_DIR=$(cd "$(dirname "$SCRIPT_DIR")" && pwd)
|
INPUT_DIR=$(cd "$(dirname "$SCRIPT_DIR")" && pwd)
|
||||||
|
|
@ -19,7 +17,7 @@ convert_to_epub() {
|
||||||
local meta_file=${INPUT_DIR}/metadata.yaml
|
local meta_file=${INPUT_DIR}/metadata.yaml
|
||||||
local css_file=${INPUT_DIR}/js/epub.css
|
local css_file=${INPUT_DIR}/js/epub.css
|
||||||
|
|
||||||
pandoc -o "$OUTPUT_BOOK" "$meta_file" \
|
pandoc -o "$OUTPUT_BOOK" --metadata-file="$meta_file" \
|
||||||
--toc-depth=2 \
|
--toc-depth=2 \
|
||||||
--top-level-division=chapter \
|
--top-level-division=chapter \
|
||||||
--file-scope=true \
|
--file-scope=true \
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,13 @@
|
||||||
---
|
title:
|
||||||
title: 设计数据密集型应用
|
- type: main
|
||||||
author: Martin Kleppmann
|
text: 设计数据密集型应用
|
||||||
|
- type: subtitle
|
||||||
|
text: 可靠、可扩展、可维护的系统
|
||||||
|
|
||||||
|
creator:
|
||||||
|
- role: author
|
||||||
|
name: Martin Kleppmann
|
||||||
|
|
||||||
rights: Creative Commons Non-Commercial Share Alike 3.0
|
rights: Creative Commons Non-Commercial Share Alike 3.0
|
||||||
language: 中文
|
language: 中文
|
||||||
|
cover-image: ./img/title.png
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue