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>

+208 -82
+7 -3
deploy-site.sh
··· 37 37 echo "=== Step 1: Build and register plugins ===" 38 38 cd "$MONO" 39 39 dune build @install 40 + dune install x-ocaml 2>/dev/null 40 41 echo " plugins registered" 41 42 42 43 echo "" ··· 47 48 echo "" 48 49 echo "=== Step 3: Build universes for interactive code cells ===" 49 50 jtw opam astring brr note mime_printer fpath rresult \ 50 - opam-format bos odoc.model tyxml yojson uri jsonm -o "$SITE_HTML/_opam" 51 + opam-format bos odoc.model tyxml yojson uri jsonm \ 52 + js_top_worker-widget-leaflet -o "$SITE_HTML/_opam" 51 53 echo " universe built → $SITE_HTML/_opam/" 52 54 53 55 echo "" ··· 60 62 # Copy @doc reference output into the site's reference/ directory. 61 63 # The site build already creates reference/index.html from reference/index.mld; 62 64 # we add the API docs packages alongside it. 63 - cp -r "$DOC_HTML/reference/"* "$SITE_HTML/reference/" 64 - cp -r "$DOC_HTML/odoc.support" "$SITE_HTML/odoc.support" 65 + # Make existing files writable first (dune marks build outputs read-only). 66 + chmod -R u+w "$SITE_HTML/reference/" "$SITE_HTML/odoc.support/" 2>/dev/null || true 67 + cp -rf "$DOC_HTML/reference/"* "$SITE_HTML/reference/" 68 + cp -rf "$DOC_HTML/odoc.support" "$SITE_HTML/odoc.support" 65 69 echo " merged reference docs into site tree" 66 70 67 71 echo ""
+2 -1
dune-workspace
··· 15 15 (env 16 16 (dev 17 17 (odoc 18 - (html_flags --shell jon-shell) 18 + (html_flags --shell jon-shell 19 + --config x-ocaml.universe=/_opam) 19 20 (prefix reference) 20 21 )))
+14 -3
js_top_worker/lib/findlibish.ml
··· 35 35 | None -> 36 36 let v = 37 37 let id = Ident.create_persistent module_name in 38 - match Symtable.Global.of_ident id with 39 - | None -> false 40 - | Some g -> Symtable.is_global_defined g 38 + let in_symtable = 39 + match Symtable.Global.of_ident id with 40 + | None -> false 41 + | Some g -> Symtable.is_global_defined g 42 + in 43 + if in_symtable then true 44 + else 45 + (* Symtable only knows about modules loaded via the bytecode linker. 46 + Modules statically compiled into the jsoo binary are registered 47 + in caml_global_data by caml_register_global but are invisible to 48 + Symtable. Check the JS runtime as a fallback. *) 49 + let open Js_of_ocaml in 50 + let global_data = Js.Unsafe.pure_js_expr "globalThis.jsoo_runtime.caml_get_global_data()" in 51 + Js.Optdef.test (Js.Unsafe.get global_data (Js.string module_name)) 41 52 in 42 53 Hashtbl.replace Js_top_worker.Impl.symtable_memo module_name v; 43 54 v
-3
odoc-interactive-extension/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
odoc-interactive-extension/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
odoc-interactive-extension/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
odoc-interactive-extension/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
odoc-interactive-extension/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 = [] }
+15
odoc-jon-shell/src/odoc_jon_shell.ml
··· 40 40 let page = Url.Path.{ kind = `File; parent = uri; name = file } in 41 41 Odoc_html.Link.href ~config ~resolve:(Current url) (Url.from_path page) 42 42 43 + (* --- Config-driven meta tags --- *) 44 + 45 + let xocaml_meta_tags config = 46 + let prefix = "x-ocaml." in 47 + Odoc_html.Config.config_values config 48 + |> List.filter_map (fun (k, v) -> 49 + match String.cut ~sep:prefix k with 50 + | Some ("", suffix) -> 51 + let meta_name = "x-ocaml-" ^ suffix in 52 + Some 53 + (Html.meta ~a:[ Html.a_name meta_name; Html.a_content v ] ()) 54 + | _ -> None) 55 + 43 56 (* --- Page assembly --- *) 44 57 45 58 let page_creator ~config ~url ~uses_katex ~resources ~sidebar_data ~header ··· 157 170 (Printf.sprintf "window.BASE_URL = %S; window.CURRENT_URL = %S;" 158 171 base_url current_url)); 159 172 ] 173 + @ xocaml_meta_tags config 160 174 @ katex_elements @ extension_head_elements 161 175 @ sidebar_json_script sidebar_data 162 176 in ··· 267 281 (Printf.sprintf "window.BASE_URL = %S; window.CURRENT_URL = %S;" 268 282 base_url current_url)); 269 283 ] 284 + @ xocaml_meta_tags config 270 285 @ sidebar_json_script sidebar_data 271 286 in 272 287 Html.head (Html.title (Html.txt title_string)) meta_elements
+22 -2
odoc/src/html/generator.ml
··· 718 718 let (module Shell : Html_shell.S) = 719 719 match Html_shell.find shell_name with 720 720 | Some shell -> shell 721 - | None -> Html_shell.default () 721 + | None -> 722 + match Config.shell config with 723 + | Some name -> 724 + failwith 725 + (Printf.sprintf 726 + "Shell '%s' not found. Available shells: %s. \ 727 + Ensure the shell plugin is installed (run 'dune build \ 728 + @install' first)." 729 + name 730 + (Stdlib.String.concat ", " (Html_shell.list_shells ()))) 731 + | None -> Html_shell.default () 722 732 in 723 733 Shell.make ~config 724 734 { url; header; preamble; content; breadcrumbs; toc; ··· 749 759 let (module Shell : Html_shell.S) = 750 760 match Html_shell.find shell_name with 751 761 | Some shell -> shell 752 - | None -> Html_shell.default () 762 + | None -> 763 + match Config.shell config with 764 + | Some name -> 765 + failwith 766 + (Printf.sprintf 767 + "Shell '%s' not found. Available shells: %s. \ 768 + Ensure the shell plugin is installed (run 'dune build \ 769 + @install' first)." 770 + name 771 + (Stdlib.String.concat ", " (Html_shell.list_shells ()))) 772 + | None -> Html_shell.default () 753 773 in 754 774 Shell.make_src ~config 755 775 { url; header; breadcrumbs; sidebar = sidebar_html;
+1 -1
site-builder/gen_rules.ml
··· 139 139 (* HTML generate *) 140 140 List.iter 141 141 (fun rel -> 142 - prl " (run odoc html-generate --shell jon-shell -o _html %s)" 142 + prl " (run odoc html-generate --shell jon-shell --config x-ocaml.universe=/_opam -o _html %s)" 143 143 (odocl_target rel)) 144 144 mld_files; 145 145 (* Support files *)
+134 -1
site/dune.inc
··· 1206 1206 html-generate 1207 1207 --shell 1208 1208 jon-shell 1209 + --config 1210 + x-ocaml.universe=/_opam 1209 1211 -o 1210 1212 _html 1211 1213 _odoc/blog/2025/03/page-code-block-metadata.odocl) ··· 1214 1216 html-generate 1215 1217 --shell 1216 1218 jon-shell 1219 + --config 1220 + x-ocaml.universe=/_opam 1217 1221 -o 1218 1222 _html 1219 1223 _odoc/blog/2025/03/page-index.odocl) ··· 1222 1226 html-generate 1223 1227 --shell 1224 1228 jon-shell 1229 + --config 1230 + x-ocaml.universe=/_opam 1225 1231 -o 1226 1232 _html 1227 1233 _odoc/blog/2025/03/page-module-type-of.odocl) ··· 1230 1236 html-generate 1231 1237 --shell 1232 1238 jon-shell 1239 + --config 1240 + x-ocaml.universe=/_opam 1233 1241 -o 1234 1242 _html 1235 1243 _odoc/blog/2025/04/page-index.odocl) ··· 1238 1246 html-generate 1239 1247 --shell 1240 1248 jon-shell 1249 + --config 1250 + x-ocaml.universe=/_opam 1241 1251 -o 1242 1252 _html 1243 1253 _odoc/blog/2025/04/page-meeting-the-team.odocl) ··· 1246 1256 html-generate 1247 1257 --shell 1248 1258 jon-shell 1259 + --config 1260 + x-ocaml.universe=/_opam 1249 1261 -o 1250 1262 _html 1251 1263 _odoc/blog/2025/04/page-ocaml-docs-ci-and-odoc-3.odocl) ··· 1254 1266 html-generate 1255 1267 --shell 1256 1268 jon-shell 1269 + --config 1270 + x-ocaml.universe=/_opam 1257 1271 -o 1258 1272 _html 1259 1273 _odoc/blog/2025/04/page-odoc-3.odocl) ··· 1262 1276 html-generate 1263 1277 --shell 1264 1278 jon-shell 1279 + --config 1280 + x-ocaml.universe=/_opam 1265 1281 -o 1266 1282 _html 1267 1283 _odoc/blog/2025/04/page-semantic-versioning-is-hard.odocl) ··· 1270 1286 html-generate 1271 1287 --shell 1272 1288 jon-shell 1289 + --config 1290 + x-ocaml.universe=/_opam 1273 1291 -o 1274 1292 _html 1275 1293 _odoc/blog/2025/04/page-this-site.odocl) ··· 1278 1296 html-generate 1279 1297 --shell 1280 1298 jon-shell 1299 + --config 1300 + x-ocaml.universe=/_opam 1281 1301 -o 1282 1302 _html 1283 1303 _odoc/blog/2025/05/page-ai-for-climate-and-nature-day.odocl) ··· 1286 1306 html-generate 1287 1307 --shell 1288 1308 jon-shell 1309 + --config 1310 + x-ocaml.universe=/_opam 1289 1311 -o 1290 1312 _html 1291 1313 _odoc/blog/2025/05/page-docs-progress.odocl) ··· 1294 1316 html-generate 1295 1317 --shell 1296 1318 jon-shell 1319 + --config 1320 + x-ocaml.universe=/_opam 1297 1321 -o 1298 1322 _html 1299 1323 _odoc/blog/2025/05/page-index.odocl) ··· 1302 1326 html-generate 1303 1327 --shell 1304 1328 jon-shell 1329 + --config 1330 + x-ocaml.universe=/_opam 1305 1331 -o 1306 1332 _html 1307 1333 _odoc/blog/2025/05/page-lots-of-things.odocl) ··· 1310 1336 html-generate 1311 1337 --shell 1312 1338 jon-shell 1339 + --config 1340 + x-ocaml.universe=/_opam 1313 1341 -o 1314 1342 _html 1315 1343 _odoc/blog/2025/05/page-oxcaml-gets-closer.odocl) ··· 1318 1346 html-generate 1319 1347 --shell 1320 1348 jon-shell 1349 + --config 1350 + x-ocaml.universe=/_opam 1321 1351 -o 1322 1352 _html 1323 1353 _odoc/blog/2025/05/page-ticks-solved-by-ai.odocl) ··· 1326 1356 html-generate 1327 1357 --shell 1328 1358 jon-shell 1359 + --config 1360 + x-ocaml.universe=/_opam 1329 1361 -o 1330 1362 _html 1331 1363 _odoc/blog/2025/06/page-index.odocl) ··· 1334 1366 html-generate 1335 1367 --shell 1336 1368 jon-shell 1369 + --config 1370 + x-ocaml.universe=/_opam 1337 1371 -o 1338 1372 _html 1339 1373 _odoc/blog/2025/06/page-week23.odocl) ··· 1342 1376 html-generate 1343 1377 --shell 1344 1378 jon-shell 1379 + --config 1380 + x-ocaml.universe=/_opam 1345 1381 -o 1346 1382 _html 1347 1383 _odoc/blog/2025/07/page-index.odocl) ··· 1350 1386 html-generate 1351 1387 --shell 1352 1388 jon-shell 1389 + --config 1390 + x-ocaml.universe=/_opam 1353 1391 -o 1354 1392 _html 1355 1393 _odoc/blog/2025/07/page-odoc-3-live-on-ocaml-org.odocl) ··· 1358 1396 html-generate 1359 1397 --shell 1360 1398 jon-shell 1399 + --config 1400 + x-ocaml.universe=/_opam 1361 1401 -o 1362 1402 _html 1363 1403 _odoc/blog/2025/07/page-retrospective.odocl) ··· 1366 1406 html-generate 1367 1407 --shell 1368 1408 jon-shell 1409 + --config 1410 + x-ocaml.universe=/_opam 1369 1411 -o 1370 1412 _html 1371 1413 _odoc/blog/2025/07/page-week27.odocl) ··· 1374 1416 html-generate 1375 1417 --shell 1376 1418 jon-shell 1419 + --config 1420 + x-ocaml.universe=/_opam 1377 1421 -o 1378 1422 _html 1379 1423 _odoc/blog/2025/07/page-week28.odocl) ··· 1382 1426 html-generate 1383 1427 --shell 1384 1428 jon-shell 1429 + --config 1430 + x-ocaml.universe=/_opam 1385 1431 -o 1386 1432 _html 1387 1433 _odoc/blog/2025/08/page-index.odocl) ··· 1390 1436 html-generate 1391 1437 --shell 1392 1438 jon-shell 1439 + --config 1440 + x-ocaml.universe=/_opam 1393 1441 -o 1394 1442 _html 1395 1443 _odoc/blog/2025/08/page-ocaml-lsp-mcp.odocl) ··· 1398 1446 html-generate 1399 1447 --shell 1400 1448 jon-shell 1449 + --config 1450 + x-ocaml.universe=/_opam 1401 1451 -o 1402 1452 _html 1403 1453 _odoc/blog/2025/08/page-ocaml-mcp-server.odocl) ··· 1406 1456 html-generate 1407 1457 --shell 1408 1458 jon-shell 1459 + --config 1460 + x-ocaml.universe=/_opam 1409 1461 -o 1410 1462 _html 1411 1463 _odoc/blog/2025/08/page-week33.odocl) ··· 1414 1466 html-generate 1415 1467 --shell 1416 1468 jon-shell 1469 + --config 1470 + x-ocaml.universe=/_opam 1417 1471 -o 1418 1472 _html 1419 1473 _odoc/blog/2025/09/page-build-ids-for-day10.odocl) ··· 1422 1476 html-generate 1423 1477 --shell 1424 1478 jon-shell 1479 + --config 1480 + x-ocaml.universe=/_opam 1425 1481 -o 1426 1482 _html 1427 1483 _odoc/blog/2025/09/page-caching-opam-solutions.odocl) ··· 1430 1486 html-generate 1431 1487 --shell 1432 1488 jon-shell 1489 + --config 1490 + x-ocaml.universe=/_opam 1433 1491 -o 1434 1492 _html 1435 1493 _odoc/blog/2025/09/page-caching-opam-solutions2.odocl) ··· 1438 1496 html-generate 1439 1497 --shell 1440 1498 jon-shell 1499 + --config 1500 + x-ocaml.universe=/_opam 1441 1501 -o 1442 1502 _html 1443 1503 _odoc/blog/2025/09/page-giving-hub-cl-an-upgrade.odocl) ··· 1446 1506 html-generate 1447 1507 --shell 1448 1508 jon-shell 1509 + --config 1510 + x-ocaml.universe=/_opam 1449 1511 -o 1450 1512 _html 1451 1513 _odoc/blog/2025/09/page-index.odocl) ··· 1454 1516 html-generate 1455 1517 --shell 1456 1518 jon-shell 1519 + --config 1520 + x-ocaml.universe=/_opam 1457 1521 -o 1458 1522 _html 1459 1523 _odoc/blog/2025/09/page-odoc-bugs.odocl) ··· 1462 1526 html-generate 1463 1527 --shell 1464 1528 jon-shell 1529 + --config 1530 + x-ocaml.universe=/_opam 1465 1531 -o 1466 1532 _html 1467 1533 _odoc/blog/2025/11/page-foundations-of-computer-science.odocl) ··· 1470 1536 html-generate 1471 1537 --shell 1472 1538 jon-shell 1539 + --config 1540 + x-ocaml.universe=/_opam 1473 1541 -o 1474 1542 _html 1475 1543 _odoc/blog/2025/11/page-index.odocl) ··· 1478 1546 html-generate 1479 1547 --shell 1480 1548 jon-shell 1549 + --config 1550 + x-ocaml.universe=/_opam 1481 1551 -o 1482 1552 _html 1483 1553 _odoc/blog/2025/12/page-an-svg-is-all-you-need.odocl) ··· 1486 1556 html-generate 1487 1557 --shell 1488 1558 jon-shell 1559 + --config 1560 + x-ocaml.universe=/_opam 1489 1561 -o 1490 1562 _html 1491 1563 _odoc/blog/2025/12/page-claude-and-dune.odocl) ··· 1494 1566 html-generate 1495 1567 --shell 1496 1568 jon-shell 1569 + --config 1570 + x-ocaml.universe=/_opam 1497 1571 -o 1498 1572 _html 1499 1573 _odoc/blog/2025/12/page-index.odocl) ··· 1502 1576 html-generate 1503 1577 --shell 1504 1578 jon-shell 1579 + --config 1580 + x-ocaml.universe=/_opam 1505 1581 -o 1506 1582 _html 1507 1583 _odoc/blog/2025/page-index.odocl) ··· 1510 1586 html-generate 1511 1587 --shell 1512 1588 jon-shell 1589 + --config 1590 + x-ocaml.universe=/_opam 1513 1591 -o 1514 1592 _html 1515 1593 _odoc/blog/2026/01/page-index.odocl) ··· 1518 1596 html-generate 1519 1597 --shell 1520 1598 jon-shell 1599 + --config 1600 + x-ocaml.universe=/_opam 1521 1601 -o 1522 1602 _html 1523 1603 _odoc/blog/2026/01/page-weeknotes-2026-03.odocl) ··· 1526 1606 html-generate 1527 1607 --shell 1528 1608 jon-shell 1609 + --config 1610 + x-ocaml.universe=/_opam 1529 1611 -o 1530 1612 _html 1531 1613 _odoc/blog/2026/01/page-weeknotes-2026-04-05.odocl) ··· 1534 1616 html-generate 1535 1617 --shell 1536 1618 jon-shell 1619 + --config 1620 + x-ocaml.universe=/_opam 1537 1621 -o 1538 1622 _html 1539 1623 _odoc/blog/2026/02/page-index.odocl) ··· 1542 1626 html-generate 1543 1627 --shell 1544 1628 jon-shell 1629 + --config 1630 + x-ocaml.universe=/_opam 1545 1631 -o 1546 1632 _html 1547 1633 _odoc/blog/2026/02/page-weeknotes-2026-06.odocl) ··· 1550 1636 html-generate 1551 1637 --shell 1552 1638 jon-shell 1639 + --config 1640 + x-ocaml.universe=/_opam 1553 1641 -o 1554 1642 _html 1555 1643 _odoc/blog/2026/page-index.odocl) ··· 1558 1646 html-generate 1559 1647 --shell 1560 1648 jon-shell 1649 + --config 1650 + x-ocaml.universe=/_opam 1561 1651 -o 1562 1652 _html 1563 1653 _odoc/blog/page-index.odocl) ··· 1566 1656 html-generate 1567 1657 --shell 1568 1658 jon-shell 1659 + --config 1660 + x-ocaml.universe=/_opam 1569 1661 -o 1570 1662 _html 1571 1663 _odoc/drafts/page-index.odocl) 1572 - (run odoc html-generate --shell jon-shell -o _html _odoc/page-index.odocl) 1664 + (run 1665 + odoc 1666 + html-generate 1667 + --shell 1668 + jon-shell 1669 + --config 1670 + x-ocaml.universe=/_opam 1671 + -o 1672 + _html 1673 + _odoc/page-index.odocl) 1573 1674 (run 1574 1675 odoc 1575 1676 html-generate 1576 1677 --shell 1577 1678 jon-shell 1679 + --config 1680 + x-ocaml.universe=/_opam 1578 1681 -o 1579 1682 _html 1580 1683 _odoc/notebooks/foundations/page-foundations1.odocl) ··· 1583 1686 html-generate 1584 1687 --shell 1585 1688 jon-shell 1689 + --config 1690 + x-ocaml.universe=/_opam 1586 1691 -o 1587 1692 _html 1588 1693 _odoc/notebooks/foundations/page-foundations10.odocl) ··· 1591 1696 html-generate 1592 1697 --shell 1593 1698 jon-shell 1699 + --config 1700 + x-ocaml.universe=/_opam 1594 1701 -o 1595 1702 _html 1596 1703 _odoc/notebooks/foundations/page-foundations11.odocl) ··· 1599 1706 html-generate 1600 1707 --shell 1601 1708 jon-shell 1709 + --config 1710 + x-ocaml.universe=/_opam 1602 1711 -o 1603 1712 _html 1604 1713 _odoc/notebooks/foundations/page-foundations2.odocl) ··· 1607 1716 html-generate 1608 1717 --shell 1609 1718 jon-shell 1719 + --config 1720 + x-ocaml.universe=/_opam 1610 1721 -o 1611 1722 _html 1612 1723 _odoc/notebooks/foundations/page-foundations3.odocl) ··· 1615 1726 html-generate 1616 1727 --shell 1617 1728 jon-shell 1729 + --config 1730 + x-ocaml.universe=/_opam 1618 1731 -o 1619 1732 _html 1620 1733 _odoc/notebooks/foundations/page-foundations4.odocl) ··· 1623 1736 html-generate 1624 1737 --shell 1625 1738 jon-shell 1739 + --config 1740 + x-ocaml.universe=/_opam 1626 1741 -o 1627 1742 _html 1628 1743 _odoc/notebooks/foundations/page-foundations5.odocl) ··· 1631 1746 html-generate 1632 1747 --shell 1633 1748 jon-shell 1749 + --config 1750 + x-ocaml.universe=/_opam 1634 1751 -o 1635 1752 _html 1636 1753 _odoc/notebooks/foundations/page-foundations6.odocl) ··· 1639 1756 html-generate 1640 1757 --shell 1641 1758 jon-shell 1759 + --config 1760 + x-ocaml.universe=/_opam 1642 1761 -o 1643 1762 _html 1644 1763 _odoc/notebooks/foundations/page-foundations7.odocl) ··· 1647 1766 html-generate 1648 1767 --shell 1649 1768 jon-shell 1769 + --config 1770 + x-ocaml.universe=/_opam 1650 1771 -o 1651 1772 _html 1652 1773 _odoc/notebooks/foundations/page-foundations8.odocl) ··· 1655 1776 html-generate 1656 1777 --shell 1657 1778 jon-shell 1779 + --config 1780 + x-ocaml.universe=/_opam 1658 1781 -o 1659 1782 _html 1660 1783 _odoc/notebooks/foundations/page-foundations9.odocl) ··· 1663 1786 html-generate 1664 1787 --shell 1665 1788 jon-shell 1789 + --config 1790 + x-ocaml.universe=/_opam 1666 1791 -o 1667 1792 _html 1668 1793 _odoc/notebooks/foundations/page-index.odocl) ··· 1671 1796 html-generate 1672 1797 --shell 1673 1798 jon-shell 1799 + --config 1800 + x-ocaml.universe=/_opam 1674 1801 -o 1675 1802 _html 1676 1803 _odoc/notebooks/page-index.odocl) ··· 1679 1806 html-generate 1680 1807 --shell 1681 1808 jon-shell 1809 + --config 1810 + x-ocaml.universe=/_opam 1682 1811 -o 1683 1812 _html 1684 1813 _odoc/notebooks/oxcaml/page-local.odocl) ··· 1687 1816 html-generate 1688 1817 --shell 1689 1818 jon-shell 1819 + --config 1820 + x-ocaml.universe=/_opam 1690 1821 -o 1691 1822 _html 1692 1823 _odoc/projects/page-index.odocl) ··· 1695 1826 html-generate 1696 1827 --shell 1697 1828 jon-shell 1829 + --config 1830 + x-ocaml.universe=/_opam 1698 1831 -o 1699 1832 _html 1700 1833 _odoc/reference/page-index.odocl)
-3
site/notebooks/foundations/foundations1.mld
··· 1 1 {0 Lecture 1: Introduction to Programming} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 Basic Concepts in Computer Science} 7 4 {ul {- Computers: a child can use them; {b nobody} can fully understand them! 8 5 }{- We can master complexity through levels of abstraction.
-5
site/notebooks/foundations/foundations10.mld
··· 1 1 {0 Lecture 10: Queues and Search Strategies} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {@ocaml hidden[ 7 4 type 'a tree = Lf | Br of 'a * 'a tree * 'a tree 8 5 ]} 9 - 10 - 11 6 12 7 {1 Breadth-First v Depth-First Tree Traversal} 13 8 {ul {- binary trees as {e decision trees}
-3
site/notebooks/foundations/foundations11.mld
··· 1 1 {0 Lecture 11: Elements of Procedural Programming} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 Procedural Programming} 7 4 {ul {- Procedural programs can change the machine state. 8 5 }{- They can interact with its environment
-3
site/notebooks/foundations/foundations2.mld
··· 1 1 {0 Lecture 2: Recursion and Efficiency} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 Expression Evaluation} 7 4 8 5 Expression evaluation concerns expressions and the values they return. This
-3
site/notebooks/foundations/foundations3.mld
··· 1 1 {0 Lecture 3: Lists} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 Introduction} 7 4 8 5 {@ocaml run-on=load[
-3
site/notebooks/foundations/foundations4.mld
··· 1 1 {0 Lecture 4: More on Lists} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 List Utilities: take and drop} 7 4 8 5 This lecture examines more list utilities, illustrating more patterns of
-3
site/notebooks/foundations/foundations5.mld
··· 1 1 {0 Lecture 5: Sorting} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 A few applications for sorting and arranging items into order are: 7 4 {ul {- search 8 5 }{- merging
-6
site/notebooks/foundations/foundations6.mld
··· 1 1 {0 Lecture 6: Datatypes and Trees} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 3 @x-ocaml.requires tyxml,mime_printer,tyxml.functor 6 4 7 5 {@ocaml run-on=load hidden[ ··· 196 194 } 197 195 end;; 198 196 ]} 199 - 200 - 201 197 {1 An Enumeration Type} 202 198 203 199 We will now learn how to define more expressive types than the ··· 514 510 Br(3, Lf, Lf));; 515 511 tree_printer string_of_int tree 516 512 ]} 517 - 518 - 519 513 {e Binary trees} are nearly as fundamental as lists. They can provide 520 514 efficient storage and retrieval of information. In a binary tree, each node 521 515 is empty ({m Lf}), or is a branch ({m Br}) with a label and two subtrees.
-3
site/notebooks/foundations/foundations7.mld
··· 1 1 {0 Lecture 7: Dictionaries and Functional Arrays} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 Dictionaries} 7 4 {ul {- lookup: find an item in the dictionary 8 5 }{- update (insert): replace (store) an item in the dictionary
-3
site/notebooks/foundations/foundations8.mld
··· 1 1 {0 Lecture 8: Functions as Values} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 In OCaml, functions can be 7 4 {ul {- passed as arguments to other functions, 8 5 }{- returned as results,
-3
site/notebooks/foundations/foundations9.mld
··· 1 1 {0 Lecture 9: Sequences, or Lazy Lists} 2 2 3 - @x-ocaml.universe /_opam 4 - @x-ocaml.worker /_opam/worker.js 5 - 6 3 {1 A Pipeline} 7 4 8 5 {math
+2
x-ocaml/src/dune
··· 24 24 merlin-js.protocol 25 25 x_protocol) 26 26 (modes js) 27 + (js_of_ocaml 28 + (sourcemap no)) 27 29 (preprocess 28 30 (pps ppx_blob)) 29 31 (preprocessor_deps
+5 -1
x-ocaml/src/x_ocaml.ml
··· 26 26 | None -> 27 27 match read_meta "x-ocaml-backend" with 28 28 | Some name -> name 29 - | None -> "builtin" 29 + | None -> 30 + (* Infer backend from universe: if a universe is configured, use jtw *) 31 + match read_meta "x-ocaml-universe" with 32 + | Some _ -> "jtw" 33 + | None -> "builtin" 30 34 in 31 35 32 36 let findlib_requires =
+1
x-ocaml/worker/effects/dune
··· 3 3 (libraries x_worker) 4 4 (modes js) 5 5 (js_of_ocaml 6 + (sourcemap no) 6 7 (flags 7 8 --export=%{dep:../export.txt} 8 9 --toplevel
+1
x-ocaml/worker/no-effects/dune
··· 3 3 (libraries x_worker) 4 4 (modes js) 5 5 (js_of_ocaml 6 + (sourcemap no) 6 7 (flags --export=%{dep:../export.txt} --toplevel)))