Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/guide/example-catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

| [<img src="../demos/basic-lighting.png" width="80">](demos.md#basic-lighting) | `basic-lighting` | four point lights, custom vertex shader |
| preview | `bb` name | shows |
|---|---|---|
| [<img src="../demos/basic-lighting.png" width="80">](demos.md#basic-lighting) | `basic-lighting` | four point lights, custom vertex shader |
| [<img src="../demos/fog-rendering.png" width="80">](demos.md#fog-rendering) | `fog-rendering` | exponential distance fog in the light shader |
| [<img src="../demos/julia-set.gif" width="80">](demos.md#julia-set) | `julia-set` | the Julia set, mouse-steered, in a shader |
| [<img src="../demos/mandelbrot-set.gif" width="80">](demos.md#mandelbrot-set) | `mandelbrot-set` | the Mandelbrot set, zoomable, in a shader |
Expand Down
8 changes: 4 additions & 4 deletions docs/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>raylib examples in Jolt</h1>
<code>jolt.ffi</code>: no wrapper library, no codegen, no C shim.
</p>
<div class="hero-actions">
<a class="btn btn-primary" href="{{site-base}}/guide/example-catalog.html">Browse all 175</a>
<a class="btn btn-primary" href="{{site-base}}/guide/example-catalog.html">Browse all 187</a>
<a class="btn" href="{{site-base}}/guide/index.html">Read the guide</a>
</div>
</div>
Expand Down Expand Up @@ -166,7 +166,7 @@ <h4>Vector2 / Vector3 → rlgl immediate mode</h4>
<h2>How it fits together</h2>
<pre class="mermaid">
flowchart TB
subgraph ex["175 example namespaces"]
subgraph ex["187 example namespaces"]
e["pong · boids · tetris<br/>camera-3d · penrose-tiling · …"]
end
door["net.b12n.raylib.all<br/>generated aggregator (bb gen:all)"]
Expand Down Expand Up @@ -217,7 +217,7 @@ <h4>Provable without a display</h4>
<p><code>RAYLIB_APP_AUTO_QUIT_MS</code> closes the window on a timer and <code>RAYLIB_APP_SHOT</code> dumps a frame to PNG, so a windowed example can prove itself unattended.</p>
</div>
<div class="feat">
<h4>A compile gate over all 175</h4>
<h4>A compile gate over all 187</h4>
<p><code>bb check</code> requires every example namespace headlessly. No window, no JVM, and it catches a broken binding across the whole suite at once.</p>
</div>
<div class="feat">
Expand All @@ -241,7 +241,7 @@ <h2>Quickstart</h2>
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</code></pre>
bb check # headless compile-check of all 187, no window</code></pre>
<p>
Needs <code>jolt</code> 0.8.0 or newer (<code>deps.edn</code> declares
<code>:jolt/min-version</code>) and a system <code>libraylib</code> 6.0+.
Expand Down
44 changes: 44 additions & 0 deletions scripts/check_demos.clj
Original file line number Diff line number Diff line change
Expand Up @@ -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+(?:<strong>)?raylib(?:</strong>)?\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.
Expand Down
Loading