Compare commits
No commits in common. "b81fd55a876cc512a94d2929742872e456f29fca" and "eeade3cdfbc08b935f6da08817a005076a1ccd09" have entirely different histories.
b81fd55a87
...
eeade3cdfb
10
Makefile
10
Makefile
@ -1,6 +1,3 @@
|
|||||||
FZF != command -v sk || command -v fzy || command -v fzf || \
|
|
||||||
{ echo install a fuzzy finder && exit 1 ;}
|
|
||||||
|
|
||||||
help: ## Print the help message
|
help: ## Print the help message
|
||||||
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
|
||||||
sort | \
|
sort | \
|
||||||
@ -9,21 +6,18 @@ help: ## Print the help message
|
|||||||
articles != find * -type f -name "*.md"
|
articles != find * -type f -name "*.md"
|
||||||
|
|
||||||
db.rec: $(articles)
|
db.rec: $(articles)
|
||||||
printf '%s\n' '%rec: guide' > $@
|
|
||||||
printf '%s\n\n' '%sort: title' >> $@
|
|
||||||
for x in $^ ; do \
|
for x in $^ ; do \
|
||||||
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
|
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
|
||||||
sed -e 's/\[ //' -e 's/ \]//' |\
|
sed -e 's/\[ //' -e 's/ \]//' |\
|
||||||
tr -d '"' ;\
|
tr -d '"' ;\
|
||||||
printf "file: %s\n\n" "$$x" ;\
|
printf "file: %s\n\n" "$$x" ;\
|
||||||
done >> $@
|
done > $@
|
||||||
recsel $@ -e "requires != ''" -CR title,requires |\
|
recsel $@ -e "requires != ''" -CR title,requires |\
|
||||||
while read title requires; do \
|
while read title requires; do \
|
||||||
IFS=', ' && for provider in $$requires; do \
|
IFS=', ' && for provider in $$requires; do \
|
||||||
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
||||||
done ;\
|
done ;\
|
||||||
done
|
done
|
||||||
recfix --sort $@
|
|
||||||
|
|
||||||
default += db.rec
|
default += db.rec
|
||||||
|
|
||||||
@ -37,7 +31,7 @@ database: $(default) ## Make a database for recfiles
|
|||||||
|
|
||||||
.PHONY: article
|
.PHONY: article
|
||||||
article: ## Write an article
|
article: ## Write an article
|
||||||
@path=$$(find . -type d -printf '%P\n' | $(FZF)); \
|
@path=$$(find . -type d -printf '%P\n' | fzy); \
|
||||||
read -p "Title: " title; \
|
read -p "Title: " title; \
|
||||||
printf '%s\n' '---' >> $$path/$$title.md ; \
|
printf '%s\n' '---' >> $$path/$$title.md ; \
|
||||||
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \
|
printf 'title: "%s"\n' "$$title" >> $$path/$$title.md ; \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user