Artifact 81db670673aa338188bab41d919bbd738db923cc8ab14f066fa97f8df51e5274:
- Executable file
scripts/gen-sdk-docs.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: 1031) [annotate] [blame] [check-ins using] [more...]
#!/usr/bin/env bash # Regenerates the SDK reference: one gomarkdoc page per public package, then # the Hugo frontmatter that titles each page by its package. Run from the repo # root. OUT_DIR redirects the output; scripts/check-docs-generated.sh uses it # to regenerate into a scratch dir and compare. # # gomarkdoc runs at the version pinned here through `go run`, so CI needs no # separate install and every machine renders the same bytes. set -euo pipefail OUT_DIR="${OUT_DIR:-docs/site/content/docs/reference/sdk}" GOMARKDOC="github.com/princjef/gomarkdoc/cmd/[email protected]" # Package directory, then its page under OUT_DIR. packages=( "./ libfossil/api.md" "./cli/ cli/api.md" "./db/ db/api.md" "./observer/otel/ observer/otel/api.md" "./dst/ dst/api.md" ) for entry in "${packages[@]}"; do read -r pkg page <<<"$entry" mkdir -p "$(dirname "$OUT_DIR/$page")" GOWORK=off go run "$GOMARKDOC" --output "$OUT_DIR/$page" "$pkg" done SDK_ROOT="$OUT_DIR" bash scripts/prepend-sdk-frontmatter.sh