-
Notifications
You must be signed in to change notification settings - Fork 567
CNTRLPLANE-3945: Migrate documentation tooling from mkdocs-material to zensical #9139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,5 @@ | ||
| site/ | ||
| site-base/ | ||
| site-head/ | ||
| compare/output/ | ||
| compare/node_modules/ |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,31 +1,74 @@ | ||
| RUNTIME ?= $(shell sh ../hack/utils.sh get_container_engine) | ||
| version := $(shell awk -f image-version.awk requirements.txt) | ||
| VERSION ?= $(if $(MKDOCS_TAG),$(MKDOCS_TAG),$(version)) | ||
| IMG ?= quay.io/hypershift/mkdocs-material:$(VERSION) | ||
| IMG ?= docker.io/zensical/zensical:0.0.51 | ||
| BASE ?= main | ||
|
|
||
| .PHONY: build | ||
| build: | ||
| mkdocs build | ||
| uv run --frozen zensical build --strict | ||
|
|
||
| .PHONY: build-containerized | ||
| build-containerized: | ||
| $(RUNTIME) volume create --ignore hypershift-docs-site | ||
| $(RUNTIME) run --rm -it \ | ||
| -v ${PWD}:/home/docs/hypershift:Z \ | ||
| -v hypershift-docs-site:/home/docs/hypershift/site \ | ||
| -v ${PWD}:/docs:Z \ | ||
| -v hypershift-docs-site:/docs/site \ | ||
| $(IMG) build --strict | ||
|
|
||
| .PHONY: serve-containerized | ||
| serve-containerized: | ||
| $(RUNTIME) run --rm -it -p 8000:8000 \ | ||
| -v ${PWD}:/home/docs/hypershift:Z \ | ||
| -v hypershift-docs-site:/home/docs/hypershift/site \ | ||
| $(IMG) serve --dev-addr 0.0.0.0:8000 | ||
| -v ${PWD}:/docs:Z \ | ||
| -v hypershift-docs-site:/docs/site \ | ||
| $(IMG) | ||
|
|
||
| .PHONY: image | ||
| image: | ||
| $(RUNTIME) build -t $(IMG) . | ||
| # Visual comparison between the current working tree and a base ref (default: main). | ||
| # | ||
| # make compare # compare against main | ||
| # make compare BASE=v4.18 # compare against a tag | ||
| # | ||
| # The report is written to compare/output/ and served on http://127.0.0.1:8883. | ||
| .PHONY: compare | ||
| compare: compare-build compare-run | ||
|
|
||
| .PHONY: push | ||
| push: | ||
| $(RUNTIME) push $(IMG) | ||
| .PHONY: compare-build | ||
| compare-build: compare-build-base compare-build-head | ||
|
|
||
| .PHONY: compare-build-base | ||
| compare-build-base: | ||
| @BASE_SHA=$$(git -C .. rev-parse "$(BASE)"); \ | ||
| if [ -f site-base/.commit ] && [ "$$(cat site-base/.commit)" = "$$BASE_SHA" ]; then \ | ||
| echo "site-base is up to date ($$BASE_SHA), skipping"; \ | ||
| else \ | ||
| rm -rf site-base; \ | ||
| echo "Building base site from $(BASE) ($$BASE_SHA)..."; \ | ||
| WORKTREE=$$(mktemp -d); \ | ||
| trap 'git -C .. worktree remove --force "$$WORKTREE" 2>/dev/null' EXIT; \ | ||
| git -C .. worktree add --detach "$$WORKTREE" "$(BASE)"; \ | ||
| cd "$$WORKTREE/docs" && uv run --frozen zensical build -d "$(CURDIR)/site-base"; \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🧩 Analysis chain🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
base_ref="${BASE:-main}"
for path in docs/pyproject.toml docs/uv.lock docs/requirements.txt docs/Makefile; do
if git cat-file -e "$base_ref:$path" 2>/dev/null; then
printf '== %s:%s ==\n' "$base_ref" "$path"
git show "$base_ref:$path" | sed -n '1,160p'
else
printf 'MISSING %s:%s\n' "$base_ref" "$path"
fi
done
printf '== build-tool references ==\n'
git show "$base_ref:docs/Makefile" 2>/dev/null |
rg -n 'mkdocs|zensical|uv run|pip' || trueRepository: openshift/hypershift Length of output: 12762 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '== docs/Makefile =='
cat -n docs/Makefile | sed -n '1,110p'
printf '%s\n' '== relevant changes =='
git diff -- docs/Makefile | sed -n '1,220p'
printf '%s\n' '== related comparison/build references =='
rg -n -C 3 'WORKTREE|BASE|site-base|zensical|mkdocs|verify-parallel|comparison' . \
-g 'Makefile' -g '*.yml' -g '*.yaml' -g '*.md' -g '*.sh'Repository: openshift/hypershift Length of output: 50377 🏁 Script executed: #!/usr/bin/env bash
set -euo pipefail
printf '%s\n' '== docs/Makefile =='
cat -n docs/Makefile | sed -n '1,100p'
printf '%s\n' '== docs/Makefile diff =='
git diff --unified=30 -- docs/Makefile | sed -n '1,240p'
printf '%s\n' '== narrow references =='
rg -n -C 5 'WORKTREE|site-base|BASE|zensical|mkdocs|verify-parallel' \
docs/Makefile Makefile .github docs \
-g 'Makefile' -g '*.yml' -g '*.yaml' -g '*.md' -g '*.sh' \
--glob '!docs/site/**' --glob '!docs/site-base/**' \
| sed -n '1,320p'Repository: openshift/hypershift Length of output: 21023 Build the base site with the toolchain from 🤖 Prompt for AI Agents |
||
| echo "$$BASE_SHA" > site-base/.commit; \ | ||
| fi | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
|
|
||
| .PHONY: compare-build-head | ||
| compare-build-head: | ||
| @rm -rf site-head site; \ | ||
| echo "Building head site from working tree..."; \ | ||
| uv run --frozen zensical build -f mkdocs.yml; \ | ||
| mv site site-head | ||
|
|
||
| .PHONY: compare-run | ||
| compare-run: | ||
| cd compare && pnpm install --frozen-lockfile | ||
| cd compare && pnpm exec playwright install chromium | ||
| cd compare && node compare.mjs ../site-base ../site-head --output output | ||
| @echo "" | ||
| @echo "Report: compare/output/index.html" | ||
| @echo "Run 'make compare-serve' to view in a browser." | ||
|
|
||
| .PHONY: compare-serve | ||
| compare-serve: | ||
| @echo "Serving report at http://127.0.0.1:8883" | ||
| @cd compare/output && python3 -m http.server 8883 --bind 127.0.0.1 | ||
|
|
||
| .PHONY: compare-clean | ||
| compare-clean: | ||
| rm -rf site-base site-head compare/output | ||
Uh oh!
There was an error while loading. Please reload this page.