this repo has no description

Configure x-ocaml universe globally via dune-workspace --config

Instead of requiring every .mld file to specify @x-ocaml.universe and
@x-ocaml.worker tags individually, configure the default universe path
once in dune-workspace (--config x-ocaml.universe=/_opam). The shell
emits <meta> tags from config values, and per-page @x-ocaml tags can
still override them.

Changes:
- dune-workspace: add --config x-ocaml.universe=/_opam to html_flags
- gen_rules.ml: pass --config to odoc html-generate for @site build
- odoc_jon_shell.ml: emit <meta> tags from x-ocaml.* config values
- odoc generator.ml: pass config to shell page_creator
- interactive_extension.ml: upsert meta tags (update existing or create)
- x_ocaml.ml: infer jtw backend from x-ocaml-universe meta tag
- Remove @x-ocaml.universe/@x-ocaml.worker from 14 .mld files using
the default /_opam universe
- deploy-site.sh: add dune install x-ocaml, chmod fix, widget-leaflet
- findlibish.ml: module detection fallback via jsoo runtime

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+4 -32
-3
doc/demo1.mld
··· 1 1 {0 Interactive OCaml Demo} 2 2 3 - @x-ocaml.universe ./universe 4 - @x-ocaml.worker ./universe/worker.js 5 - 6 3 This page demonstrates interactive OCaml code cells powered by 7 4 [x-ocaml] and [js_top_worker]. 8 5
-3
doc/demo_map.mld
··· 1 1 {0 Interactive Map Demo} 2 2 3 - @x-ocaml.universe ./universe 4 - @x-ocaml.worker ./universe/worker.js 5 - 6 3 This page demonstrates a managed Leaflet map widget with FRP signals 7 4 and commands. 8 5
-3
doc/demo_widgets.mld
··· 1 1 {0 Widget Demo} 2 2 3 - @x-ocaml.universe ./universe 4 - @x-ocaml.worker ./universe/worker.js 5 - 6 3 This page demonstrates interactive FRP widgets powered by 7 4 [Widget] and [Note]. 8 5
-18
doc/dune
··· 1 1 (documentation 2 2 (package odoc-interactive-extension)) 3 - 4 - ; Build a jtw universe with yojson for the demo pages. 5 - ; The universe directory contains worker.js, findlib_index.json, 6 - ; and lib/ with CMIs, META files, and .cma.js archives. 7 - ; 8 - ; Usage: 9 - ; dune build odoc-interactive-extension/doc/universe 10 - ; 11 - ; After building, deploy to the doc HTML output (see below). 12 - (rule 13 - (targets 14 - (dir universe)) 15 - (action 16 - (run jtw opam -o universe yojson js_top_worker-widget-leaflet))) 17 - 18 - ; After building, deploy to the doc HTML output: 19 - ; cp -r _build/default/odoc-interactive-extension/doc/universe \ 20 - ; _build/default/_doc/_html/odoc-interactive-extension/
+4 -5
src/interactive_extension.ml
··· 50 50 51 51 let meta_tag_script name value = 52 52 Printf.sprintf 53 - {|(function(){var m=document.createElement('meta');m.name='%s';m.content='%s';document.head.appendChild(m)})();|} 53 + {|(function(){var n='%s',v='%s',m=document.querySelector('meta[name="'+n+'"]');if(!m){m=document.createElement('meta');m.name=n;document.head.appendChild(m)}m.content=v})();|} 54 54 (js_escape name) (js_escape value) 55 55 56 56 module X_ocaml_config : Api.Extension = struct ··· 134 134 }] in 135 135 (* Resources: load x-ocaml.js via Js_url so odoc resolves the path 136 136 relative to the support files directory (just like odoc.css). 137 - Configuration (backend, universe, worker, packages) is communicated 138 - via <meta> tags which x-ocaml.js reads at startup. *) 139 - let backend = match !universe_url with Some _ -> "jtw" | None -> "builtin" in 137 + Configuration (universe, worker, packages) is communicated via 138 + <meta> tags which x-ocaml.js reads at startup. The backend is 139 + inferred from the presence of x-ocaml-universe by x-ocaml.js. *) 140 140 let resources = [ 141 - Api.Js_inline (meta_tag_script "x-ocaml-backend" backend); 142 141 Api.Js_url "_x-ocaml/x-ocaml.js"; 143 142 ] in 144 143 Some { Api.content = block; overrides = []; resources; assets = [] }