build: version number and date in e-book

This commit is contained in:
Dave Kerr
2020-10-01 18:06:58 +08:00
committed by GitHub
parent 50e2f2e6ce
commit 0bf80bf8b5
3 changed files with 22 additions and 3 deletions

View File

@@ -2,12 +2,21 @@
# This script prepares a `hacker-laws.md` file which is in a format ready to be
# exported to PDF or other formats for an e-book.
# Require that we provide the version number and get a date.
version=$1
date=$(date "+%Y-%m-%d")
if [ -z $version ]; then
echo "version must be specified: ./prepare-markdown-for-ebook.sh <version>"
exit 1
fi
# Create the frontmatter.
cat << EOF > frontmatter.md
---
title: "Hacker Laws"
author: "Dave Kerr, github.com/dwmkerr/hacker-laws"
subtitle: "Laws, Theories, Principles and Patterns that developers will find useful."
subtitle: "Laws, Theories, Principles and Patterns that developers will find useful. ${version}, ${date}."
---
EOF