Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add epub validation to ebooks #112

Merged
merged 1 commit into from
May 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions tools/make-books.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,27 @@ echo "Making ebooks ..."
DIR_DOWNLOADS=downloads

cd ../

# Check dependencies
if command -v pandoc &>/dev/null; then
echo "pandoc is installed"
else
echo "You need to install pandoc. Please visit: https://pandoc.org/installing.html"
exit 1
fi
if command -v epubcheck &>/dev/null; then
echo "epubcheck is installed"
else
echo "You need to install epubcheck. Please visit: https://www.w3.org/publishing/epubcheck/docs/installation/"
exit 1
fi

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

# Validate eBooks
epubcheck $DIR_DOWNLOADS/typescript-book.epub
epubcheck $DIR_DOWNLOADS/typescript-book-zh_CN.epub

echo "Books were created. Please commit!"
Loading