Skip to content

Instantly share code, notes, and snippets.

@romilly
Created November 4, 2021 16:48
Show Gist options
  • Save romilly/89437f44bb34a6a03b54226eca9ed532 to your computer and use it in GitHub Desktop.
Save romilly/89437f44bb34a6a03b54226eca9ed532 to your computer and use it in GitHub Desktop.
Track writing progress for pandoc or LeanPub book
#!/usr/bin/env bash
# capture wordcounts in dayfile
# invoke with project root as argument; default is (currently) start-apl
# assumes book contents are markdown files in the `manuscript` directory
# creates a `progress` direectory if necessary
# writes wordcounts (using wc) for each markdown file and totals in a file whose name is based on today's date
_project=${1:-start-apl}
cd ~/git/active/$_project/
_now=$(date +"%Y%m%d")
mkdir -p progress
wc manuscript/*.md > "progress/$_now.txt"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment