Fix site build, merlin hover errors, and mermaid SPA navigation
build-site.sh: Use dune-built worker.js (--no-worker + cp) so the
worker always matches the source tree. Previously jtw compiled against
the installed js_top_worker-web package via ocamlfind, which could be
stale. Also make @site and @doc steps fail on errors instead of
swallowing them.
js_top_worker: Add blank_directives to strip #require lines from source
before sending to merlin. The pre_source context prepends previous cells'
source (including #require directives) which causes Menhir's incremental
parser to throw force_reduction errors.
x-ocaml: Add bounds checking to Typed_enclosings response in
merlin_ext.ml, matching the existing pattern for Errors. Prevents
CodeMirror RangeError when merlin returns positions outside the cell's
document range.
odoc-mermaid-extension: Fix SPA navigation by replacing Js_inline init
script with Js_url support file using MutationObserver pattern. The old
startOnLoad:true approach only worked on full page loads; now mermaid.run()
is called explicitly whenever new pre.mermaid elements appear in the DOM.
site/dune.inc: Regenerated with --warn-error on odoc compile/link/
html-generate, and -L/-P flags for library/package cross-references
from @doc build output.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>