From 9e6d4b21e3646d6d19e08ee66dcc0907218d72bb Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Wed, 26 Jun 2024 16:34:39 +0200 Subject: generate color-hightlighted html representation of SDML source files --- Makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 397a39b..fef2d4c 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,7 @@ publish: rsync -avH --delete-after _site/ $(BASE_SSH) prepare: \ + $(patsubst %,learn/%.qmd,core $(ONTOLOGIES_LEARN)) \ $(patsubst %,learn/$(ONTOLOGIES_VERSION)/%.ttl,core $(ONTOLOGIES_LEARN)) \ $(foreach ext,svg tex,learn/rdfs.$(ext)) \ $(foreach dia,tentacular trap all,$(foreach ext,svg tex,learn/$(dia)_rdfs.$(ext))) @@ -47,6 +48,18 @@ learn/$(ONTOLOGIES_VERSION)/%.ttl: learn/%.ttl -e 's,\n\s*owl:imports\s[^\n]+;(?=\n),,g;' \ < $< > $@ +learn/%.qmd: learn/$(ONTOLOGIES_VERSION)/%.ttl + sdml highlight --output-format html -i $< -o learn/_$*.html + $(eval title = $(shell roqet -q -i sparql -e 'SELECT ?s ?o WHERE { ?s ?o}' -D $< | grep -Po -m1 '#>, o=string[()]"\K[^"]+')) + $(eval desc = $(shell roqet -q -i sparql -e 'SELECT ?s ?o WHERE { ?s ?o }' -D $< | grep -Po '#>, o=string[()]"\K[^"]+')) + @echo '---' > $@ + @echo 'title: $(title)' >> $@ + @echo 'subtitle: SDML source' >> $@ + @echo '---' >> $@ + @echo '$(desc)' >> $@ + @echo >> $@ + @echo '{{< include _$*.html >}}' >> $@ + cal-all: cal-fetch cal-render cal-publish cal-fetch: -- cgit v1.2.3