Skip to content

Resolve: subdir layout for multi-package hosted projects (cross-project links)#4

Merged
balat merged 1 commit into
masterfrom
cross-project-subdir-links
Jun 18, 2026
Merged

Resolve: subdir layout for multi-package hosted projects (cross-project links)#4
balat merged 1 commit into
masterfrom
cross-project-subdir-links

Conversation

@balat

@balat balat commented Jun 18, 2026

Copy link
Copy Markdown
Member

Why

When a project's docs reference another Ocsigen project, odoc_driver --remap emits an absolute https://ocaml.org/p/<pkg>/… link. Resolve.deps (the (hosted …) table) rewrites those into relative links into our own ocsigen.org deploy — but only knew two deploy layouts:

  • multilib — client/server libs under <dir>.<side>/ (eliom, toolkit, start)
  • root — a single package's modules at the version root (ocsigenserver)

Multi-package projects (js_of_ocaml, tyxml, and lwt once migrated) deploy each opam package under its own <pkg>/ subtree, keeping odoc's nested module layout. Their xrefs were therefore left pointing at ocaml.org.

What

  • Replace the boolean multilib flag in the hosted tuple with a layout variant: Multilib | Root | Subdir.
  • Subdir rewrites a link to <dir>/latest/<pkg>/<path> verbatim (no flattening) and a single entry matches a whole opam family — js_of_ocaml also covers js_of_ocaml-lwt, js_of_ocaml-tyxml, wasm_of_ocaml-*, … (key + -/_ separator).
  • Config token (pkg dir subdir) / root / multilib; legacy true/false still parse as multilib/root (no consumer change required).
  • New cram test test/deps.t covering all three layouts, family matching, and a non-Ocsigen dep (react) left on ocaml.org.

Note

Consumer doc/wodoc configs (eliom, toolkit, start, tuto) gain subdir entries for js_of_ocaml/tyxml/reactiveData in separate PRs. Those configs require this change first (their CI pins wodoc from master, so they pick it up automatically once merged).

Cross-project link rewriting (Resolve.deps / the hosted table) assumed a
hosted project deploys its modules either under <dir>.<side>/ (multilib) or
at the version root. Multi-package projects such as js_of_ocaml and tyxml
deploy each opam package under its own <pkg>/ subtree, keeping odoc's nested
module layout, so their ocaml.org xrefs were left unrewritten.

Replace the boolean multilib flag with a layout (multilib | root | subdir);
a subdir entry rewrites a link into <dir>/latest/<pkg>/<path> verbatim and
matches a whole opam family (js_of_ocaml also covers js_of_ocaml-lwt, ...).
Legacy true/false tokens still parse as multilib/root.
@balat balat merged commit df92dfa into master Jun 18, 2026
balat added a commit to ocsigen/eliom that referenced this pull request Jun 18, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-toolkit that referenced this pull request Jun 18, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-start that referenced this pull request Jun 18, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/js_of_ocaml that referenced this pull request Jun 18, 2026
The API is built with odoc_driver --remap, so cross-project references
resolve to absolute ocaml.org links. Add a (hosted ...) table so links to
TyXML and ReactiveData — Ocsigen projects with docs on ocsigen.org — are
rewritten to relative links into our own deploy instead of pointing at
ocaml.org. react (not an Ocsigen project) stays on ocaml.org; lwt will be
added once its docs are rebuilt with wodoc (ocsigen/lwt#1109).

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
@balat balat deleted the cross-project-subdir-links branch June 20, 2026 10:51
balat added a commit to ocsigen/eliom that referenced this pull request Jun 22, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-start that referenced this pull request Jun 22, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-toolkit that referenced this pull request Jun 22, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/eliom that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-start that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-toolkit that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-toolkit that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/eliom that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
balat added a commit to ocsigen/ocsigen-start that referenced this pull request Jun 25, 2026
Keep the (hosted ...) table in sync with master: add the js_of_ocaml/tyxml
(subdir layout) and reactiveData (root) entries so cross-project links point
to ocsigen.org. Avoids reverting them when this doc branch merges.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
Julow pushed a commit to Julow/ocsigen-toolkit that referenced this pull request Jun 26, 2026
References to these Ocsigen projects were rewritten only for a few core
packages; js_of_ocaml/tyxml/reactiveData xrefs stayed on ocaml.org. Add them
to the (hosted ...) table so cross-project links point to our own deploy.
js_of_ocaml and tyxml use the new `subdir` layout (one entry per opam family);
reactiveData deploys its modules at the version root.

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
vouillon pushed a commit to ocsigen/js_of_ocaml that referenced this pull request Jul 2, 2026
The API is built with odoc_driver --remap, so cross-project references
resolve to absolute ocaml.org links. Add a (hosted ...) table so links to
TyXML and ReactiveData — Ocsigen projects with docs on ocsigen.org — are
rewritten to relative links into our own deploy instead of pointing at
ocaml.org. react (not an Ocsigen project) stays on ocaml.org; lwt will be
added once its docs are rebuilt with wodoc (ocsigen/lwt#1109).

Requires wodoc with the `subdir` layout (ocsigen/wodoc#4).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant