From 137466a4235f87f14835da7cc3e7466af4aad29a Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Wed, 12 Feb 2025 15:46:02 +0100 Subject: [PATCH] edit article categories in makefile --- Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d7f7560..5a4ae4d 100644 --- a/Makefile +++ b/Makefile @@ -8,6 +8,8 @@ help: ## Print the help message articles != find * -type f -name "*.md" +categories != ls -d */ + db.rec: $(articles) printf '%s\n' '%rec: guide' > $@ printf '%s\n' '%type: wordcount int' >> $@ @@ -41,7 +43,7 @@ database: $(default) ## Make a recfiles database .PHONY: article article: ## Write an article - @path=$$(find . -type d -printf '%P\n' | $(FZF)) ;\ + @path=$$(find $(categories) -type d | sort | uniq | $(FZF)) ;\ read -p "Title: " title ;\ filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\ printf '%s\n' '---' >> $$path/$$filename.md ;\