commits
Three fixes for "Position N is out of range for changeset" errors:
1. js_top_worker: clamp output_at loc to input length — the ";;"
appended for parsing made pos_cnum extend past the original source
2. x-ocaml/editor: clamp decoration positions against CM document
length (Text.length) not OCaml String.length — they differ for
non-ASCII text (UTF-16 vs bytes). Also combine doc replacement +
decoration clear into a single transaction in set_source, and
read actual CM doc in build_range_set
3. jsoo-code-mirror/decoration: defensive safe_map that catches
JS RangeError in RangeSet.map and returns empty
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Compartment+reconfigure approach caused "Position out of range for
changeset" RangeErrors because decorations weren't mapped through
document change transactions. A StateField maps decorations via
RangeSet.map(tr.changes) synchronously within each transaction,
keeping positions consistent with the document state.
- Add StateEffect and StateField OCaml bindings to jsoo-code-mirror
- Add Decoration.Range_set.empty and .map
- Convert editor.ml messages from Compartment to StateField+StateEffect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous commit added StateField/StateEffect to includes.js but
didn't rebuild bundle.js (the esbuild+babel output that dune embeds).
Without this, the __CM__StateField and __CM__StateEffect globals were
undefined at runtime, causing TypeError on page load.
Built with: dune build --profile=with-bundle
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This reverts commit 051c718e8b619909d2f4199f6b5fbcd0642c5364.
The Compartment+reconfigure approach caused "Position out of range for
changeset" RangeErrors because decorations weren't mapped through
document change transactions. A StateField maps decorations via
RangeSet.map(tr.changes) synchronously within each transaction,
keeping positions consistent with the document state.
- Add StateEffect and StateField OCaml bindings to jsoo-code-mirror
- Add Decoration.Range_set.empty and .map
- Convert editor.ml messages from Compartment to StateField+StateEffect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1c5e32e0 Fix odoc build with OCaml 5.4.1: Data_types module migration
c31be687 Site updates
c5f2c361 Fix odoc doc build warnings: Tsig_include annotation, onnxrt refs, fatal warnings
68bbb7b2 Fix PPX spurious source links and same-module value linking in odoc
e7c7d887 Merge commit '07bc534031770950e35905270cc6916f76009aa0'
e9b5ed8a Constrain lwt < 6.1.0 (6.1.1 incompatible with oxcaml)
e9636bef Add new test and blog post
b66e7262 Alternative, simpler fix
git-subtree-dir: odoc
git-subtree-split: 1c5e32e0e12f06603becf9b1394f95ce7fc5409a
4095c1af Constrain lwt < 6.1.0 (6.1.1 incompatible with oxcaml)
47c161ce Minor updates
1f56d069 Better source rendering
56c34e9a test: update json_expansion_with_sources test for pos_of_loc fix
825790c5 feat: add open/include tracking to source linking
77fbf3d4 feat: add record field references to source linking
dd8d0182 feat: add constructor references to source linking
8e072559 feat: re-enable documentation links from source code
21091826 fix: correct pos_of_loc end position in source annotations
git-subtree-dir: odoc
git-subtree-split: 4095c1afe288e6bf73c4ba8006cbc67d543913a7
5629c8d5 Add mdx as test dependency in odoc.opam
git-subtree-dir: odoc
git-subtree-split: 5629c8d594f948bfa9098e39d20afbc53f2f3ffb
265e6296 Fix scrollycode SPA navigation bug and add extensions authoring guide
21799997 WIP: site redesign, odoc extension API updates, and new content
e410f6cf jon-shell css: reduce body font to 16px and set x-ocaml editor font size
fc897c09 Add odoc-standalone package scaffolding
git-subtree-dir: odoc
git-subtree-split: 265e6296d2a506eff23ddb8f497a8cb379f7a866
71fe7ccd3 Merge branch 'point-release-fixes' of https://github.com/jonludlam/odoc
4d53f50da Make all warnings respect --warn-error
d1f796f14 Add test showing --warn-error doesn't affect unresolved references
d6c8ece57 Don't resolve imports without digests during compile
18adbf89b Add test for no-alias-deps import resolution bug
c3f0f46ee Update for dune 3.21
git-subtree-dir: odoc
git-subtree-split: 71fe7ccd36eee7f244a355653e10de197d6bcb94
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests addMarker, clearMarkers, addImageOverlay, removeImageOverlay
commands in a standalone HTML page.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
New commands:
- enableBboxDraw: custom rectangle drawing with bbox_drawn event
- addImageOverlay/removeImageOverlay: display data URL images on map
- addMarker/clearMarkers: circle markers with labels
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests PNG encoding and data URL generation in a web worker.
Verified: 4x4 RGBA image encodes to valid PNG, renders as <img>.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests run in a web worker (sync XHR requires worker context).
Fetches a real scales.npy from dl2.geotessera.org, parses it,
and verifies the shape and data values.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Widen sidebar from 200px to 260px with updated max-width calculations
- Collapse top two wrapper levels so content aligns with header
- Add border-left indentation guides on nested lists
- Replace original toggle arrows with larger inline chevrons (1em, rotate on expand)
- Separate click targets: chevrons toggle expand/collapse, links navigate
- Align childless items with toggle items via 20px margin-left
- Fix CSS cascade where .jon-shell-main ul overrode sidebar ul padding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add browser test that compiles OCaml to JS via js_of_ocaml and verifies
fetch, npy parsing, and mosaic assembly work in a real browser.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Generate tessera-viz.opam from dune-project. All odoc documentation
is in the .mli with section headers and docstrings for every public
type and function.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add color_of_hex for parsing hex color strings and classification_to_rgba
for mapping integer class predictions to colored RGBA pixels. Unknown
classes render as black. Add unit arg to resolve optional alpha parameter.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Convert 3-component PCA matrix to false-color RGBA image with
per-component percentile clipping and 0-255 scaling. Optional args
moved before positional to satisfy OCaml's optional-arg resolution.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add the tessera-viz library skeleton with dune-project, .mli interface,
and a working percentile function with linear interpolation. Other API
functions are stubbed with failwith for TDD iteration.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generate opam file from dune-project. All 15 tests pass across grid
math, dequantization, mosaic, and fetch_mosaic_sync.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add end-to-end test for fetch_mosaic_sync using mock fetch function
with numpy fixture files. Verifies the full pipeline: bbox -> tile
enumeration -> fetch -> dequantize -> mosaic -> correct output values.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add mosaic tests verifying horizontal and vertical tile assembly.
North tiles appear at top (row 0), south at bottom. Confirms correct
grid position calculation and data placement.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add dequantization test with numpy fixtures (2x3x4 int8 embeddings,
2x3 float32 scales). Verifies correct int8 * scale multiplication
and output matrix dimensions.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add new tessera-geotessera library with dune project structure, public
API (.mli), and grid math implementation (snap_to_grid, tiles_for_bbox,
tile_name, URL construction). Includes full implementations of
dequantize, mosaic, and fetch_mosaic_sync. Grid math tests all pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add trailing-comma (1D shape) and scalar shape edge case tests
- Comprehensive .mli documentation with usage example
- Auto-generated opam file
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Each foundations lecture now specifies @x-ocaml.universe and
@x-ocaml.worker so interactive code cells use the correct opam
package set.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Site pages (blog, notebooks) don't need the reference sidebar — it's only
for @doc output. Also adds the opam universe build step to deploy-site.sh,
copies odoc.support into the site tree, and refreshes the homepage with
recent entries and an about section.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch from server-rendered sidebar to JS-rendered sidebar from
sidebar_data JSON (same approach as odoc-docsite). On link clicks
within /reference/, fetch the page, swap .odoc-content, update title
and body class — no full reload. Back/forward via popstate.
- New odoc_jon_shell_js.ml: sidebar rendering, collapsible entries,
SPA navigation with click interception and resource deduplication
- odoc_jon_shell.ml: inject BASE_URL/CURRENT_URL/sidebar JSON in head,
register JS support file, empty sidebar container filled by JS,
extension resources moved to head for SPA discovery
- odoc_jon_shell_css.ml: collapsible toggle triangles, sidebar-label
styling for non-link entries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add sidebar pipeline: compile-index → sidebar-generate → html-generate --sidebar
- jon-shell: render sidebar nav with sticky CSS layout
- Convert all {@ocamltop blocks to {@ocaml for interactive extension
- odoc-interactive-extension: handle autorun (→ run-on=load) and skip tags
- Remove package prefix from URLs (parent-id uses "." for root pages)
- Add projects/index.mld placeholder, @children_order for notebooks
- Add (prefix reference) to dune-workspace for @doc output
- Update deploy-site.sh for two-pass build (site + reference docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the (documentation ...) stanza in site/dune with explicit
odoc compile → link → html-generate rules generated by a small OCaml
tool (site-builder/gen_rules.exe).
The generator walks site/ finding .mld files and static assets, then
emits two directory-target rules (compile+link → _odoc/, html-generate
+ support-files + assets → _html/) and a top-level @site alias.
Build the site with: dune build @site
Output lands in: _build/default/site/_html/
The committed site/dune.inc is kept in sync via dune build @runtest
(diff check against the generated output).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests the full end-to-end flow of runtime preloaded package detection:
- Preloaded package (yojson): succeeds without fetching .cma.js
- Normal package (stringext): fetches and loads from universe
- CRC mismatch (crc_conflict): raises Crc_mismatch with bogus CRC
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Three fixes for "Position N is out of range for changeset" errors:
1. js_top_worker: clamp output_at loc to input length — the ";;"
appended for parsing made pos_cnum extend past the original source
2. x-ocaml/editor: clamp decoration positions against CM document
length (Text.length) not OCaml String.length — they differ for
non-ASCII text (UTF-16 vs bytes). Also combine doc replacement +
decoration clear into a single transaction in set_source, and
read actual CM doc in build_range_set
3. jsoo-code-mirror/decoration: defensive safe_map that catches
JS RangeError in RangeSet.map and returns empty
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Compartment+reconfigure approach caused "Position out of range for
changeset" RangeErrors because decorations weren't mapped through
document change transactions. A StateField maps decorations via
RangeSet.map(tr.changes) synchronously within each transaction,
keeping positions consistent with the document state.
- Add StateEffect and StateField OCaml bindings to jsoo-code-mirror
- Add Decoration.Range_set.empty and .map
- Convert editor.ml messages from Compartment to StateField+StateEffect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous commit added StateField/StateEffect to includes.js but
didn't rebuild bundle.js (the esbuild+babel output that dune embeds).
Without this, the __CM__StateField and __CM__StateEffect globals were
undefined at runtime, causing TypeError on page load.
Built with: dune build --profile=with-bundle
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The Compartment+reconfigure approach caused "Position out of range for
changeset" RangeErrors because decorations weren't mapped through
document change transactions. A StateField maps decorations via
RangeSet.map(tr.changes) synchronously within each transaction,
keeping positions consistent with the document state.
- Add StateEffect and StateField OCaml bindings to jsoo-code-mirror
- Add Decoration.Range_set.empty and .map
- Convert editor.ml messages from Compartment to StateField+StateEffect
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1c5e32e0 Fix odoc build with OCaml 5.4.1: Data_types module migration
c31be687 Site updates
c5f2c361 Fix odoc doc build warnings: Tsig_include annotation, onnxrt refs, fatal warnings
68bbb7b2 Fix PPX spurious source links and same-module value linking in odoc
e7c7d887 Merge commit '07bc534031770950e35905270cc6916f76009aa0'
e9b5ed8a Constrain lwt < 6.1.0 (6.1.1 incompatible with oxcaml)
e9636bef Add new test and blog post
b66e7262 Alternative, simpler fix
git-subtree-dir: odoc
git-subtree-split: 1c5e32e0e12f06603becf9b1394f95ce7fc5409a
4095c1af Constrain lwt < 6.1.0 (6.1.1 incompatible with oxcaml)
47c161ce Minor updates
1f56d069 Better source rendering
56c34e9a test: update json_expansion_with_sources test for pos_of_loc fix
825790c5 feat: add open/include tracking to source linking
77fbf3d4 feat: add record field references to source linking
dd8d0182 feat: add constructor references to source linking
8e072559 feat: re-enable documentation links from source code
21091826 fix: correct pos_of_loc end position in source annotations
git-subtree-dir: odoc
git-subtree-split: 4095c1afe288e6bf73c4ba8006cbc67d543913a7
265e6296 Fix scrollycode SPA navigation bug and add extensions authoring guide
21799997 WIP: site redesign, odoc extension API updates, and new content
e410f6cf jon-shell css: reduce body font to 16px and set x-ocaml editor font size
fc897c09 Add odoc-standalone package scaffolding
git-subtree-dir: odoc
git-subtree-split: 265e6296d2a506eff23ddb8f497a8cb379f7a866
71fe7ccd3 Merge branch 'point-release-fixes' of https://github.com/jonludlam/odoc
4d53f50da Make all warnings respect --warn-error
d1f796f14 Add test showing --warn-error doesn't affect unresolved references
d6c8ece57 Don't resolve imports without digests during compile
18adbf89b Add test for no-alias-deps import resolution bug
c3f0f46ee Update for dune 3.21
git-subtree-dir: odoc
git-subtree-split: 71fe7ccd36eee7f244a355653e10de197d6bcb94
- Widen sidebar from 200px to 260px with updated max-width calculations
- Collapse top two wrapper levels so content aligns with header
- Add border-left indentation guides on nested lists
- Replace original toggle arrows with larger inline chevrons (1em, rotate on expand)
- Separate click targets: chevrons toggle expand/collapse, links navigate
- Align childless items with toggle items via 20px margin-left
- Fix CSS cascade where .jon-shell-main ul overrode sidebar ul padding
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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>
Add new tessera-geotessera library with dune project structure, public
API (.mli), and grid math implementation (snap_to_grid, tiles_for_bbox,
tile_name, URL construction). Includes full implementations of
dequantize, mosaic, and fetch_mosaic_sync. Grid math tests all pass.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Site pages (blog, notebooks) don't need the reference sidebar — it's only
for @doc output. Also adds the opam universe build step to deploy-site.sh,
copies odoc.support into the site tree, and refreshes the homepage with
recent entries and an about section.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Switch from server-rendered sidebar to JS-rendered sidebar from
sidebar_data JSON (same approach as odoc-docsite). On link clicks
within /reference/, fetch the page, swap .odoc-content, update title
and body class — no full reload. Back/forward via popstate.
- New odoc_jon_shell_js.ml: sidebar rendering, collapsible entries,
SPA navigation with click interception and resource deduplication
- odoc_jon_shell.ml: inject BASE_URL/CURRENT_URL/sidebar JSON in head,
register JS support file, empty sidebar container filled by JS,
extension resources moved to head for SPA discovery
- odoc_jon_shell_css.ml: collapsible toggle triangles, sidebar-label
styling for non-link entries
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add sidebar pipeline: compile-index → sidebar-generate → html-generate --sidebar
- jon-shell: render sidebar nav with sticky CSS layout
- Convert all {@ocamltop blocks to {@ocaml for interactive extension
- odoc-interactive-extension: handle autorun (→ run-on=load) and skip tags
- Remove package prefix from URLs (parent-id uses "." for root pages)
- Add projects/index.mld placeholder, @children_order for notebooks
- Add (prefix reference) to dune-workspace for @doc output
- Update deploy-site.sh for two-pass build (site + reference docs)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the (documentation ...) stanza in site/dune with explicit
odoc compile → link → html-generate rules generated by a small OCaml
tool (site-builder/gen_rules.exe).
The generator walks site/ finding .mld files and static assets, then
emits two directory-target rules (compile+link → _odoc/, html-generate
+ support-files + assets → _html/) and a top-level @site alias.
Build the site with: dune build @site
Output lands in: _build/default/site/_html/
The committed site/dune.inc is kept in sync via dune build @runtest
(diff check against the generated output).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests the full end-to-end flow of runtime preloaded package detection:
- Preloaded package (yojson): succeeds without fetching .cma.js
- Normal package (stringext): fetches and loads from universe
- CRC mismatch (crc_conflict): raises Crc_mismatch with bogus CRC
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>