From 4bd8e24d62f95e111a984dbdb3d0479aaadfbeab Mon Sep 17 00:00:00 2001 From: "russell@unturf.com" Date: Sun, 8 Mar 2026 16:53:41 -0400 Subject: [PATCH] Add training-data target to convert RST posts to plain text for ML training Creates a new Makefile target that converts all RST blog posts to plain text format using pandoc, enabling use of blog content as training data for machine learning applications. --- Makefile | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7793ad5..ad9b060 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: html help clean regenerate serve devserver publish pygments jsonresume jsonresume-themes jsonresume-pdf rst2md llms jsonfeed jsonblog plaintext formats +.PHONY: html help clean regenerate serve devserver publish pygments jsonresume jsonresume-themes jsonresume-pdf rst2md llms jsonfeed jsonblog plaintext formats training-data BASEDIR=$(CURDIR) INPUTDIR=$(BASEDIR)/content @@ -193,4 +193,17 @@ plaintext: formats: rst2md plaintext jsonfeed jsonblog llms @echo "All agent-friendly formats generated!" +TRAINING_DATA_OUT ?= $(BASEDIR)/russell.ballestrini.net.txt + +training-data: ## Convert all RST posts to plain text for ML training + @echo "converting $(words $(wildcard $(INPUTDIR)/*.rst)) RST posts to plain text via pandoc..." + @> $(TRAINING_DATA_OUT) + @count=0; \ + for rst in $(INPUTDIR)/*.rst; do \ + pandoc -f rst -t plain --wrap=none "$$rst" >> $(TRAINING_DATA_OUT) 2>/dev/null; \ + echo "" >> $(TRAINING_DATA_OUT); \ + count=$$((count + 1)); \ + done; \ + echo "russell.ballestrini.net: $$count posts, $$(wc -l < $(TRAINING_DATA_OUT)) lines" + SITEURL ?= https://russell.ballestrini.net