From 7eebf97c24b6109bf172d6c2d086bbade38e5091 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 13 Jan 2024 15:56:20 +0200 Subject: ambient.yaml: add doc.subplot.tech Signed-off-by: Lars Wirzenius Sponsored-by: author --- ambient.yaml | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/ambient.yaml b/ambient.yaml index 4813ef4..5f2911b 100644 --- a/ambient.yaml +++ b/ambient.yaml @@ -84,6 +84,60 @@ projects: dch -r '' - action: deb + doc.subplot.tech: + image: ~/tmp/ambient/ambient-boot.qcow2 + source: ~/pers/subplot/git + publish_artifacts: true + pre_plan: + - action: cargo_fetch + plan: + - action: rustup_setup + - action: cargo_build + - action: shell + shell: | + # Once + # https://gitlab.com/subplot/subplot/-/merge_requests/371 is + # merged, use the build-docs script here. + + output="/workspace/artifacts" + + # Build Subplot so that we can use it to generate + # documentation. + + PATH="${CARGO_TARGET_DIR:-target}:$PATH" + type -all subplot + + # Build subplots that come with Subplot + + opts="--resources $(pwd)/src/share" + find . -name "*.subplot" | + grep -Fv .gitlab/ | + while read -r file; do + base="$(basename "$file" .subplot)" + ( + cd "$(dirname "$file")" + # shellcheck disable=SC2154 disable=SC2086 + if subplot $opts metadata --merciful "$base.subplot" | awk '/^title:/ && NF > 1' | grep .; then + subplot $opts docgen --merciful "$base.subplot" -o "$output/$base.html" + fi + ) + done + + # Build Subplot library documentation. + + libdocs="$output/libdocs" + mkdir -p "$libdocs" + + find share -name '*.yaml' ! -name template.yaml | + while read -r yaml; do + dir="$(dirname "$yaml")" + md="$dir/$(basename "$yaml" .yaml).md" + subplot "--resources=$(pwd)" libdocgen --output "$md" "$yaml" + pandoc --standalone --self-contained \ + --metadata title="$(basename "$yaml" .yaml)" \ + -o "$libdocs/$(basename "$md" .md)".html "$md" + done + ewww.liw.fi: image: ~/tmp/ambient/ambient-boot.qcow2 source: ~/pers/ewww/ewww.liw.fi/src -- cgit v1.2.1