diff options
author | Jonas Smedegaard <dr@jones.dk> | 2024-06-26 16:34:39 +0200 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2024-06-26 16:34:39 +0200 |
commit | 9e6d4b21e3646d6d19e08ee66dcc0907218d72bb (patch) | |
tree | e75309948f57e5de58f9026a8829d5c3e1c0a553 /Makefile | |
parent | 256f0e11e900c0621befd0a3d8df72fdced920b3 (diff) |
generate color-hightlighted html representation of SDML source files
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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: |