add wordcount to database

This commit is contained in:
Malin Freeborn 2025-02-11 20:38:45 +01:00
parent b81fd55a87
commit d92631c795
Signed by: andonome
GPG Key ID: 52295D2377F4D70F
2 changed files with 8 additions and 4 deletions

View File

@ -10,6 +10,7 @@ articles != find * -type f -name "*.md"
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\n' '%sort: title' >> $@ 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" |\
@ -17,6 +18,9 @@ db.rec: $(articles)
tr -d '"' ;\ tr -d '"' ;\
printf "file: %s\n\n" "$$x" ;\ printf "file: %s\n\n" "$$x" ;\
done >> $@ done >> $@
for entry in $^; do \
recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
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 \

View File

@ -1,10 +1,8 @@
--- ---
title: "Knowledge Base" title: "Linux Knowledge Base"
--- ---
# Linux Knowledgebase The Linux Knowledge-Base provides quick-start guides for working with terminal programs.
This is a list of quickstart guides for Linux programs, designed to get the user up and running as fast as possible.
# Style # Style
@ -79,12 +77,14 @@ ss -tr dst :$PORT
- Often presumes you know everything except that one program. - Often presumes you know everything except that one program.
- Often written in the 80's, and it shows. - Often written in the 80's, and it shows.
- Zero respect for your time. - Zero respect for your time.
- Often references `info` pages (yuck).
## curl cheat.sh/ ## curl cheat.sh/
- Doesn't have the programs I like. - Doesn't have the programs I like.
- Too short to get you started on many programs. - Too short to get you started on many programs.
- Poor understanding of priority (`git stash` is covered before `git commit`). - Poor understanding of priority (`git stash` is covered before `git commit`).
- Repetitive
# Current State # Current State