summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2024-01-13 15:56:20 +0200
committerLars Wirzenius <liw@liw.fi>2024-01-13 15:56:20 +0200
commit7eebf97c24b6109bf172d6c2d086bbade38e5091 (patch)
tree6909ad60f366c0be823d2c6cdcfac97defd4aed8
parent5561bdb7f3bcfbacc6cc6684b8a2f94fbf4afc8f (diff)
downloadliw-dot-files-7eebf97c24b6109bf172d6c2d086bbade38e5091.tar.gz
ambient.yaml: add doc.subplot.tech
Signed-off-by: Lars Wirzenius <liw@liw.fi> Sponsored-by: author
-rw-r--r--ambient.yaml54
1 files changed, 54 insertions, 0 deletions
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