Fix empty code blocks: rename ~docs/code param, fix batched IO dispatch

Two bugs caused code blocks to render empty across the site:

1. ~docs/code component had parameter named `code` which collided with
   the HTML <code> tag name. Renamed to `src` and updated all 57
   callers. Added font-mono class for explicit monospace.

2. Batched IO dispatch in ocaml_bridge.py only skipped one leading
   number (batch ID) but the format has two (epoch + ID):
   (io-request EPOCH ID "name" args...). Changed to skip all leading
   numbers so the string name is correctly found. This fixes highlight
   and other batchable helpers returning empty results.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 18:08:40 +00:00
parent 739d04672b
commit 6f96452f70
58 changed files with 440 additions and 437 deletions

View File

@@ -716,10 +716,12 @@ class OcamlBridge:
if len(parts) < 2:
raise OcamlBridgeError(f"Malformed io-request: {line}")
# Skip numeric batch ID if present
# Skip leading numeric IDs (epoch, batch ID, or both)
offset = 1
if isinstance(parts[1], (int, float)):
offset = 2
while offset < len(parts) and isinstance(parts[offset], (int, float)):
offset += 1
if offset >= len(parts):
raise OcamlBridgeError(f"Malformed io-request (no name after IDs): {line}")
req_name = _to_str(parts[offset])
args = parts[offset + 1:]