Skip to content

feat: vendor doc-gen tooling and build from the spec's openapi.yaml release asset - #2

Open
eddie-knight wants to merge 1 commit into
mainfrom
feat/self-contained-docgen
Open

feat: vendor doc-gen tooling and build from the spec's openapi.yaml release asset#2
eddie-knight wants to merge 1 commit into
mainfrom
feat/self-contained-docgen

Conversation

@eddie-knight

@eddie-knight eddie-knight commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

🤖 Summary

Makes the website self-contained: the markdown rendering tools move into this repo, and the build consumes the spec's OpenAPI projection (openapi.yaml) instead of cloning the spec repo and running its CLI.

Merge this before gemaraproj/gemara's website-removal PR — that PR deletes the tools this repo previously ran out of the spec checkout.

Changes

  • tools/ — new Go module (github.com/gemaraproj/website/tools) vendoring openapi2md, lexicon2md, termlinker, and the nav-parsing scripts from the spec repo's cmd/, with flag defaults adjusted for this repo's root-level layout. The OpenAPISpec types consumed by openapi2md are mirrored in openapi_types.go.
  • Makefilegendocs now acquires generated/openapi.yaml (in order of precedence): GEMARA_OPENAPI=<file> (pre-generated copy), GEMARA_DIR=<spec checkout> (runs the spec's cue2openapi locally, for unreleased schema work), or downloads the release asset for GEMARA_REF (default: latest). All markdown rendering now runs from tools/. The acquisition is a file target, so CI can pre-populate the file and skip it.
  • .github/workflows/deploy.yml — downloads the openapi.yaml asset for the resolved spec ref; falls back to clone-and-generate for refs that predate the asset (all releases up to and including the current latest) and for branch refs like main.
  • README.md — build documentation updated to match.

Verification

  • go build ./... && go vet ./... in tools/ pass.
  • Full round-trip against a local spec checkout: make gendocs GEMARA_DIR=../gemara renders all 16 schema pages, the definitions table, and term links across 85 files; make cleanup returns the tree to clean.

Transition notes

  • The spec repo starts attaching openapi.yaml on its next release (companion PR); until then every CI build takes the fallback path, which keeps working because old spec tags still contain the full CLI.
  • The repository_dispatch contract (gemara-release, client_payload.ref) is unchanged.

…elease asset

The site previously cloned gemaraproj/gemara and ran the markdown
tooling (openapi2md, lexicon2md, termlinker, parse-nav.sh) out of that
checkout's cmd/ directory. Those tools only exist to render this site,
so they now live here under tools/ as their own Go module.

The build input is now the spec's OpenAPI projection instead of a
source checkout:

- make gendocs downloads openapi.yaml from the spec release named by
  GEMARA_REF (default: latest). GEMARA_DIR=/path/to/gemara still
  generates it locally via the spec's cue2openapi for unreleased
  schema work, and GEMARA_OPENAPI=/path/to/file uses a pre-generated
  copy.
- deploy.yml downloads the release asset for the resolved ref, falling
  back to clone-and-generate for refs that predate the asset (and for
  branch refs like main).

The spec repo publishes the openapi.yaml asset starting with its next
release; the fallback keeps builds working against older tags.

Signed-off-by: Eddie Knight <knight@linux.com>
echo "Downloaded openapi.yaml from release $REF"
else
echo "::warning::No openapi.yaml release asset for $REF; generating from a spec checkout"
git clone --depth 1 --branch "$REF" https://github.com/gemaraproj/gemara .gemara-spec

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit

Suggested change
git clone --depth 1 --branch "$REF" https://github.com/gemaraproj/gemara .gemara-spec
timeout 120 git clone --depth 1 --branch "$REF" https://github.com/gemaraproj/gemara .gemara-spec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants