edit article categories in makefile
This commit is contained in:
parent
37df47cf3b
commit
137466a423
4
Makefile
4
Makefile
@ -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 ;\
|
||||||
|
Loading…
Reference in New Issue
Block a user