aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore2
-rw-r--r--Makefile13
-rw-r--r--styles/main.scss3
-rw-r--r--styles/sdml.scss79
4 files changed, 97 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index a23c38a..859b1ca 100644
--- a/.gitignore
+++ b/.gitignore
@@ -11,10 +11,12 @@ svg-inkscape/
/learn/*/*.ttl
/learn/*.ttl
/learn/*.pdf
+/learn/*.qmd
/learn/*.puml
/learn/*.png
/learn/*.svg
/learn/*.tex
+/learn/_*.html
/waste/*.ttl
/waste/*.puml
/waste/*.png
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:
diff --git a/styles/main.scss b/styles/main.scss
index cb90dff..a07aec4 100644
--- a/styles/main.scss
+++ b/styles/main.scss
@@ -13,6 +13,9 @@ $headings-font-family: $font-family-sans-serif;
$display-font-family: $font-family-sans-serif;
$input-btn-font-family: $font-family-sans-serif;
+@import "sdml";
+@include sdml;
+
/*-- scss:mixins --*/
@mixin font-face($name, $style, $weight, $basedir, $file) {
diff --git a/styles/sdml.scss b/styles/sdml.scss
new file mode 100644
index 0000000..592a598
--- /dev/null
+++ b/styles/sdml.scss
@@ -0,0 +1,79 @@
+@mixin sdml {
+
+pre code.sdml {
+ font-family: "InconsolataN",monospace;
+// font-size: .9em;
+// font-weight: 300;
+// line-height: 1.4;
+ padding: .6em;
+ border: 1px solid #e1e4e5;
+ white-space: pre;
+}
+
+pre code.sdml span.comment {
+ color: #949494;
+ font-style: italic;
+}
+
+pre code.sdml span.constant-builtin {
+ color: #5f5f00;
+}
+
+pre code.sdml span.error {
+ color: #ff0000;
+}
+
+pre code.sdml span.function-call {
+ color: #005fd7;
+}
+
+pre code.sdml span.keyword {
+ color: #878700;
+}
+
+pre code.sdml span.operator {
+ color: #4e4e4e;
+ font-weight: bold;
+}
+
+pre code.sdml span.module {
+ color: #005faf;
+}
+
+pre code.sdml span.module-definition {
+ color: #0000af;
+}
+
+pre code.sdml span.number {
+ color: #5f5f00;
+}
+
+pre code.sdml span.property {
+ color: #d70000;
+}
+
+pre code.sdml span.punctuation-bracket {
+ color: #4e4e4e;
+}
+
+pre code.sdml span.string {
+ color: #5faf00;
+}
+
+pre code.sdml span.string-special {
+ color: #8700d7;
+}
+
+pre code.sdml span.type {
+ color: #005fff;
+}
+
+pre code.sdml span.type-definition {
+ color: #0000ff;
+}
+
+pre code.sdml span.variable-field {
+ color: #5f87af;
+}
+
+}