this repo has no description

odoc extensions: find x-ocaml.js from dune build dir

Both interactive and scrollycode extensions now check
_build/install/default/share/x-ocaml/x-ocaml.js (walking up from CWD)
before falling back to opam share. This avoids requiring 'dune install
x-ocaml' as a separate step.

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

+16 -1
+16 -1
src/scrollycode_extension.ml
··· 751 filename = "extensions/scrollycode.css"; 752 content = Inline Scrollycode_css.structural_css; 753 }; 754 - (match Sys.getenv_opt "ODOC_X_OCAML_JS_PATH" with 755 | Some path -> 756 Odoc_extension_api.Registry.register_support_file ~prefix:"scrolly" { 757 filename = "_x-ocaml/x-ocaml.js";
··· 751 filename = "extensions/scrollycode.css"; 752 content = Inline Scrollycode_css.structural_css; 753 }; 754 + (* Find x-ocaml.js: env var, then dune build install dir (walk up from CWD). *) 755 + let x_ocaml_js_path = 756 + match Sys.getenv_opt "ODOC_X_OCAML_JS_PATH" with 757 + | Some p -> Some p 758 + | None -> 759 + let target = "_build/install/default/share/x-ocaml/x-ocaml.js" in 760 + let rec walk dir = 761 + let candidate = Filename.concat dir target in 762 + if Sys.file_exists candidate then Some candidate 763 + else 764 + let parent = Filename.dirname dir in 765 + if parent = dir then None else walk parent 766 + in 767 + walk (Sys.getcwd ()) 768 + in 769 + (match x_ocaml_js_path with 770 | Some path -> 771 Odoc_extension_api.Registry.register_support_file ~prefix:"scrolly" { 772 filename = "_x-ocaml/x-ocaml.js";