Artifact 40325cee91818cfcc7a1205b04b5fb641997618862f6250abbf24c524ee8dae5:
- Executable file
scripts/prepend-sdk-frontmatter.sh
— part of check-in
[c12b02189f]
at
2026-10-26 00:46:10
on branch main
— docs: regenerate the SDK reference and check it in CI
The gomarkdoc SDK pages had drifted about a thousand lines from the code: make docs-gen-sdk was never part of docs-gen, so nothing regenerated them and the docs check did not compare them. ReadBlob, SetContentCache, ListFilesIn and OriginNamer were missing from the libfossil page.
scripts/gen-sdk-docs.sh now renders them, running gomarkdoc v1.1.0 through go run so CI needs no install, then adds the frontmatter. It honours OUT_DIR, gen-docs.sh calls it, and check-docs-generated.sh compares the result, so a stale SDK page fails CI like any other generated input. make docs-gen-sdk calls the same script. llms.txt and llms-full.txt are regenerated from the refreshed pages. (user: [email protected], size: 874) [annotate] [blame] [check-ins using] [more...]
#!/usr/bin/env bash # Prepend Hugo frontmatter to gomarkdoc-generated SDK pages so each page's # nav label is the package name instead of the filename ("api"). Idempotent: # strips any existing frontmatter and re-injects, so re-running after # `make docs-gen-sdk` produces stable bytes. set -euo pipefail SDK_ROOT="${SDK_ROOT:-docs/site/content/docs/reference/sdk}" while IFS= read -r f; do rel="${f#${SDK_ROOT}/}" pkg="${rel%/api.md}" if head -1 "$f" | grep -qE '^---$'; then awk 'NR==1 && /^---$/ { in_fm=1; next } in_fm && /^---$/ { in_fm=0; next } !in_fm' "$f" > "$f.body" else cp "$f" "$f.body" fi { printf -- '---\n' printf 'title: %s\n' "$pkg" printf -- '---\n\n' cat "$f.body" } > "$f" rm "$f.body" done < <(find "$SDK_ROOT" -name 'api.md' -type f | sort)