Compare commits
No commits in common. "415985d08ce2e5df81afbc9d5d3646d903793ac0" and "137466a4235f87f14835da7cc3e7466af4aad29a" have entirely different histories.
415985d08c
...
137466a423
34
Makefile
34
Makefile
@ -1,6 +1,3 @@
|
||||
MAKEFLAGS += -j
|
||||
MAKEFLAGS += -s
|
||||
EDITOR ?= vi
|
||||
FZF != command -v sk || command -v fzy || command -v fzf || \
|
||||
{ echo install a fuzzy finder && exit 1 ;}
|
||||
|
||||
@ -13,36 +10,25 @@ articles != find * -type f -name "*.md"
|
||||
|
||||
categories != ls -d */
|
||||
|
||||
databases = $(patsubst %/, .dbs/%.rec, $(categories))
|
||||
|
||||
default += $(databases)
|
||||
|
||||
$(databases): .dbs/%.rec: %/ | .dbs/
|
||||
$(info making $(@F))
|
||||
mkdir -p $(@D)
|
||||
for entry in $(shell find $< -type f -name "*.md") ; do \
|
||||
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$entry" |\
|
||||
sed -e 's/\[ //' -e 's/ \]//' |\
|
||||
tr -d '"' ;\
|
||||
printf "wordcount: %s\n" "$$(wc -w < $$entry)" ;\
|
||||
printf "file: %s\n\n" "$$entry" ;\
|
||||
done >> $@
|
||||
for entry in $(shell find $< -type f -name "*.md"); do \
|
||||
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
|
||||
done
|
||||
|
||||
db.rec: $(databases)
|
||||
db.rec: $(articles)
|
||||
printf '%s\n' '%rec: guide' > $@
|
||||
printf '%s\n' '%type: wordcount int' >> $@
|
||||
printf '%s\n\n' '%sort: title' >> $@
|
||||
cat $^ >> $@
|
||||
for x in $^ ; do \
|
||||
sed -n '2,/^---$$/ {/^---$$/d; p}' "$$x" |\
|
||||
sed -e 's/\[ //' -e 's/ \]//' |\
|
||||
tr -d '"' ;\
|
||||
printf "file: %s\n\n" "$$x" ;\
|
||||
done >> $@
|
||||
for entry in $^; do \
|
||||
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
|
||||
done
|
||||
recsel $@ -e "requires != ''" -CR title,requires |\
|
||||
while read title requires; do \
|
||||
IFS=', ' && for provider in $$requires; do \
|
||||
recset $@ -e "title = '$${provider}'" -f provides -a "$${title}" ;\
|
||||
done ;\
|
||||
done
|
||||
$(info Created main database: $@)
|
||||
recfix --sort $@
|
||||
|
||||
default += db.rec
|
||||
|
Loading…
x
Reference in New Issue
Block a user