aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile13
1 files changed, 13 insertions, 0 deletions
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 <http://www.w3.org/2004/02/skos/core#prefLabel> ?o}' -D $< | grep -Po -m1 '#>, o=string[()]"\K[^"]+'))
+ $(eval desc = $(shell roqet -q -i sparql -e 'SELECT ?s ?o WHERE { ?s <http://purl.org/dc/elements/1.1/description> ?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: