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