Bel LaPointe 2024-01-09 13:52:07 -07:00
parent 93c7a325dd
commit ef93baf97c
5 changed files with 42 additions and 3 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
.DS_Store
/book

View File

@ -1,5 +1,5 @@
[book]
authors = ["Bel LaPointe"]
authors = ["ZachGoldberg"]
language = "en"
multilingual = false
src = "src"

39
scrape.sh Normal file
View File

@ -0,0 +1,39 @@
#! /bin/bash
main() (
set -ueo pipefail
if [ ! -f ./raw.md ]; then
wget -q -O ./raw.md https://raw.githubusercontent.com/ZachGoldberg/Startup-CTO-Handbook/main/StartupCTOHandbook.md
fi
rm ./src/*
printf "# Summary\n\n" > ./src/SUMMARY.md
cat ./raw.md \
| (
n=0
while read -r line; do
n=$((n+1))
depth="$(echo "$line" | grep -o '^##*')"
(
echo n=$n
echo line="$line"
echo depth=$depth
) >&2
if ((n>20)); then
break
fi
done
)
mdbook build
)
if [ "$0" == "$BASH_SOURCE" ]; then
main "$@"
ret=$?
echo ret=$? >&2
exit $ret
fi

View File

@ -1,3 +1,2 @@
# Summary
- [Chapter 1](./chapter_1.md)

View File

@ -1 +0,0 @@
# Chapter 1