edit article categories in makefile

This commit is contained in:
Malin Freeborn 2025-02-12 15:46:02 +01:00
parent 37df47cf3b
commit 137466a423
Signed by: andonome
GPG Key ID: 52295D2377F4D70F

View File

@ -8,6 +8,8 @@ help: ## Print the help message
articles != find * -type f -name "*.md" articles != find * -type f -name "*.md"
categories != ls -d */
db.rec: $(articles) db.rec: $(articles)
printf '%s\n' '%rec: guide' > $@ printf '%s\n' '%rec: guide' > $@
printf '%s\n' '%type: wordcount int' >> $@ printf '%s\n' '%type: wordcount int' >> $@
@ -41,7 +43,7 @@ database: $(default) ## Make a recfiles database
.PHONY: article .PHONY: article
article: ## Write an 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 ;\ read -p "Title: " title ;\
filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\ filename="$$(echo "$$title" | tr '[:upper:]' '[:lower:]' | tr ' ' '_')" ;\
printf '%s\n' '---' >> $$path/$$filename.md ;\ printf '%s\n' '---' >> $$path/$$filename.md ;\