From 2016a8de97ff1a9f95779795ec4cb2757d77074a Mon Sep 17 00:00:00 2001 From: burinc Date: Sun, 20 Sep 2026 15:03:15 +1000 Subject: [PATCH] fix(docs): repair a broken catalog table and four stale homepage counts Two defects, both mine, both visible on the published site. The shaders table in the catalog had the basic-lighting row ABOVE its header, so the whole table rendered as a literal |---|---|--- and no rows at all. My insertion script sorted rows by the text between the first pair of backticks, and the header line "| preview | `bb` name | shows |" also has backticks, yielding "bb". Since basic-lighting sorts before bb, the header was chosen as the insert anchor. Only that one row was low enough in the alphabet to hit it. home.html still said 175 in four places: the call-to-action button, an architecture diagram label, a section heading and a shell comment. I corrected its headline and per-group counts in the previous commit and missed these because I piped the audit grep through head -20, which cut the output at exactly the line that would have shown them. Reading the whole file finds five 175s, not one. Both are now gated, because neither was catchable before. The catalog gate checks that each group table starts with its header and that the heading count matches the rows beneath. The homepage gate checks the example count wherever it appears and every per-group figure against the registry. Each of the five new checks was verified by planting the exact error it is meant to catch and confirming it fires. --- docs/guide/example-catalog.md | 2 +- docs/templates/home.html | 8 +++---- scripts/check_demos.clj | 44 +++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 5 deletions(-) diff --git a/docs/guide/example-catalog.md b/docs/guide/example-catalog.md index 4082887..325b583 100644 --- a/docs/guide/example-catalog.md +++ b/docs/guide/example-catalog.md @@ -252,9 +252,9 @@ That `[:by-value ...]` support also supersedes the workarounds described in pages still describe what the suite currently does elsewhere. A page on the by-value API itself is not written yet. -| [](demos.md#basic-lighting) | `basic-lighting` | four point lights, custom vertex shader | | preview | `bb` name | shows | |---|---|---| +| [](demos.md#basic-lighting) | `basic-lighting` | four point lights, custom vertex shader | | [](demos.md#fog-rendering) | `fog-rendering` | exponential distance fog in the light shader | | [](demos.md#julia-set) | `julia-set` | the Julia set, mouse-steered, in a shader | | [](demos.md#mandelbrot-set) | `mandelbrot-set` | the Mandelbrot set, zoomable, in a shader | diff --git a/docs/templates/home.html b/docs/templates/home.html index 658fd7d..167cc15 100644 --- a/docs/templates/home.html +++ b/docs/templates/home.html @@ -66,7 +66,7 @@

raylib examples in Jolt

jolt.ffi: no wrapper library, no codegen, no C shim.

- Browse all 175 + Browse all 187 Read the guide
@@ -166,7 +166,7 @@

Vector2 / Vector3 → rlgl immediate mode

How it fits together

 flowchart TB
-  subgraph ex["175 example namespaces"]
+  subgraph ex["187 example namespaces"]
     e["pong · boids · tetris
camera-3d · penrose-tiling · …"] end door["net.b12n.raylib.all
generated aggregator (bb gen:all)"] @@ -217,7 +217,7 @@

Provable without a display

RAYLIB_APP_AUTO_QUIT_MS closes the window on a timer and RAYLIB_APP_SHOT dumps a frame to PNG, so a windowed example can prove itself unattended.

-

A compile gate over all 175

+

A compile gate over all 187

bb check requires every example namespace headlessly. No window, no JVM, and it catches a broken binding across the whole suite at once.

@@ -241,7 +241,7 @@

Quickstart

bb info # grouped cheat-sheet of every example bb tetris # run one (opens a window) bb run-all 10 # demo reel: every example, 10s each -bb check # headless compile-check of all 175, no window
+bb check # headless compile-check of all 187, no window

Needs jolt 0.8.0 or newer (deps.edn declares :jolt/min-version) and a system libraylib 6.0+. diff --git a/scripts/check_demos.clj b/scripts/check_demos.clj index 16bb75b..10df5e3 100644 --- a/scripts/check_demos.clj +++ b/scripts/check_demos.clj @@ -108,6 +108,50 @@ (add! (str "docs/guide/demos.md group headings total " stated ", but " (count shown) " examples have a GIF or a still")))) + ;; 6b. The catalog's own group headings state their row counts, and every + ;; group's table starts with its header. A row inserted above the header + ;; renders as a literal |---|---|---| on the published site and nothing + ;; else in this gate can see it, because every row is still present and + ;; every image still resolves. + (doseq [m (re-seq #"(?m)^## (\S+) \((\d+)\)$" catalog)] + (let [[whole grp n] m + start (+ (.indexOf catalog whole) (count whole)) + rest' (subs catalog start) + end (if-let [i (re-find #"(?m)^## " rest')] + (.indexOf rest' i) (count rest')) + sec (subs rest' 0 end) + rows (filter #(str/starts-with? % "| ") (str/split-lines sec)) + data (remove #(or (str/includes? % "| preview |") + (str/starts-with? % "|---")) rows)] + (when (and (seq rows) (not (str/includes? (first rows) "| preview |"))) + (add! (str "docs/guide/example-catalog.md: the " grp + " table has a row above its header, which renders as a broken table"))) + (when (not= (parse-long n) (count data)) + (add! (str "docs/guide/example-catalog.md heading \"## " grp " (" n ")\" but the section holds " + (count data) " rows"))))) + + ;; 6c. The homepage states the example count in several places and had + ;; nothing gating it, which is how it sat at a stale 175 in four spots + ;; and carried per-group counts wrong in six of nine groups. + (let [home "docs/templates/home.html"] + (when (.exists (io/file home)) + (let [txt (slurp (io/file home)) + want (count ids)] + (doseq [[whole num] (re-seq #"(\d+)\s+(?:)?raylib(?:)?\s+examples" txt)] + (when (not= (parse-long num) want) + (add! (str home " says \"" (str/trim whole) "\", but the registry holds " want)))) + (doseq [[whole num] (re-seq #"(?:Browse all|all of|compile-check of all)\s+(\d+)" txt)] + (when (not= (parse-long num) want) + (add! (str home " says \"" (str/trim whole) "\", but the registry holds " want)))) + (doseq [[whole num] (re-seq #"(\d+)\s+example namespaces" txt)] + (when (not= (parse-long num) want) + (add! (str home " says \"" (str/trim whole) "\", but the registry holds " want)))) + (let [by-group (frequencies (map #(nth % 2) examples-registry/examples))] + (doseq [[whole grp num] (re-seq #"([a-z0-9]+) (\d+)(?: ·|\.)" txt)] + (when-let [actual (by-group grp)] + (when (not= (parse-long num) actual) + (add! (str home " says \"" (str/trim whole) "\", but that group holds " actual))))))))) + ;; 7. Prose counting GIFs or recordings must say what is on disk. Scoped to ;; a number immediately followed by a gallery word, so it does not fire ;; on a resolution, a year or an example count.