Skip to content

Commit e5cfd0d

Browse files
authored
add epub validation to ebooks (#112)
1 parent 1495c68 commit e5cfd0d

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

tools/make-books.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ echo "Making ebooks ..."
33
DIR_DOWNLOADS=downloads
44

55
cd ../
6+
7+
# Check dependencies
68
if command -v pandoc &>/dev/null; then
79
echo "pandoc is installed"
810
else
911
echo "You need to install pandoc. Please visit: https://pandoc.org/installing.html"
1012
exit 1
1113
fi
14+
if command -v epubcheck &>/dev/null; then
15+
echo "epubcheck is installed"
16+
else
17+
echo "You need to install epubcheck. Please visit: https://www.w3.org/publishing/epubcheck/docs/installation/"
18+
exit 1
19+
fi
1220

21+
# Generate eBooks
1322
pandoc -o $DIR_DOWNLOADS/typescript-book.epub --metadata title="The Concise TypeScript Book" --metadata author="Simone Poggiali" -s README.md
1423
pandoc -o $DIR_DOWNLOADS/typescript-book-zh_CN.epub --metadata title="# 简洁的TypeScript之书" --metadata author="Simone Poggiali" -s README-zh_CN.md
1524

25+
# Validate eBooks
26+
epubcheck $DIR_DOWNLOADS/typescript-book.epub
27+
epubcheck $DIR_DOWNLOADS/typescript-book-zh_CN.epub
28+
1629
echo "Books were created. Please commit!"

0 commit comments

Comments
 (0)