From b4683a868165a922abe38ed92d21c39792dbd308 Mon Sep 17 00:00:00 2001
From: Malin Freeborn <malinfreeborn@posteo.net>
Date: Thu, 13 Feb 2025 00:08:34 +0100
Subject: [PATCH] add contents to databases

---
 Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile b/Makefile
index 2c3c113..86a4e83 100644
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,8 @@ EDITOR ?= vi
 FZF != command -v sk || command -v fzy || command -v fzf || \
 	{ echo install a fuzzy finder && exit 1 ;}
 
+spill_contents = sed -e '1,/---/d'
+
 help: ## Print the help message
 	@awk 'BEGIN {FS = ":.*?## "} /^[0-9a-zA-Z._-]+:.*?## / {printf "\033[36m%s\033[0m : %s\n", $$1, $$2}' $(MAKEFILE_LIST) | \
 		sort | \
@@ -29,6 +31,7 @@ $(databases): .dbs/%.rec: %/ | .dbs/
 	done > $@
 	for entry in $(shell find $< -type f -name "*.md"); do \
 		recset $@ -e "file = '$${entry}'" -f wordcount --set-add="$$(wc -w < $${entry})" ;\
+		recset $@ -e "file = '$${entry}'" -f contents --set-add="$$($(spill_contents) $${entry})" ;\
 	done
 
 db.rec: $(databases)