help:
	@echo "targets:"
	@grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
	| sed -n 's/^\(.*\): \(.*\)##\(.*\)/  \1|\3/p' \
	| column -t  -s '|'

journal: ## create new journal post
	@test -n "$(title)" || read -p "Enter a title for your journal: " title; \
	export post_date=$(shell date +"%Y-%m-%d"); \
	export post_date_slug=$(shell date +"%Y%m%d"); \
	export title_slug=$$post_date_slug-`echo $${title:-Untitled} | sed -E -e 's/[^[:alnum:]]/-/g' -e 's/^-+|-+$$//g' | tr -s '-' | tr A-Z a-z`; \
	export post_path=journal/$$title_slug.gmi; \
	printf "# %s\n" "$$title"                                    > $$post_path; \
	printf "\n\n"                                                >> $$post_path; \
	printf "Originally Published %s at:\n" "$$post_date"         >> $$post_path; \
	printf "gemini://tilde.team/~tomasino/%s\n" "$$post_path"    >> $$post_path; \
	printf "\n"                                                  >> $$post_path; \
	printf "If you have questions or thoughts to add"            >> $$post_path; \
	printf " please send me a link to your response.\n"          >> $$post_path; \
	printf "=> /~tomasino/about.txt Contact Information"         >> $$post_path; \
	vim $$post_path

review: ## create new 5-star review post
	@test -n "$(title)" || read -p "Enter a title for your review: " title; \
	export post_date=$(shell date +"%Y-%m-%d"); \
	export post_date_slug=$(shell date +"%Y%m%d"); \
	export title_slug=$$post_date_slug-`echo $${title:-Untitled} | sed -E -e 's/[^[:alnum:]]/-/g' -e 's/^-+|-+$$//g' | tr -s '-' | tr A-Z a-z`; \
	export post_path=review/$$title_slug.gmi; \
	printf "# %s\n" "$$title"                                    > $$post_path; \
	printf "⭐⭐⭐⭐⭐\n"                                        >> $$post_path; \
	printf "\n\n"                                                >> $$post_path; \
	printf "Originally Published %s at:\n" "$$post_date"         >> $$post_path; \
	printf "gemini://tilde.team/~tomasino/%s\n" "$$post_path"    >> $$post_path; \
	printf "\n"                                                  >> $$post_path; \
	printf "If you have questions or thoughts to add"            >> $$post_path; \
	printf " please send me a link to your response.\n"          >> $$post_path; \
	printf "=> /~tomasino/about.txt Contact Information"         >> $$post_path; \
	vim $$post_path

.PHONY: help journal review
