From 74869fe684cd48ae98aea3e8dd1855e2cd4a112f Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 17 Nov 2020 23:20:39 -0600 Subject: [PATCH] Edit cookbook I'm not really using this any more, but will keep it here for reference. --- cookbook | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/cookbook b/cookbook index f84816f..6e237c6 100644 --- a/cookbook +++ b/cookbook @@ -3,6 +3,7 @@ DEFAULT_MANDIR=/bread/man DEFAULT_MANSECTION=bread +DEFAULT_COOKBOOKDIR=/bread/cookbook usage() { prog="${BASH_SOURCE[0]}" @@ -12,6 +13,7 @@ OPTIONS -h show this help -d DIR specify a manual directory. Default: "$DEFAULT_MANDIR" -s SECTION specify a manual section. Default: "$DEFAULT_MANSECTION" +-e RECIPE edit a recipe. Will search $COOKBOOKDIR for RECIPE. ENDUSAGE } @@ -19,7 +21,7 @@ template() { # template TITLE HEADER FOOTER name="$1" header="$2" footer="$3" - upname="$(printf %s "$name" | tr a-z A-Z)" + upname="$(echo "$name" | tr a-z A-Z)" cat <"$f" "$EDITOR" "$f" + + mk_manpage "$f" + + mk_webpage "$f" } if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then