Skip to content

Commit 01ba5ea

Browse files
committed
Driver doc; from clusters to trees
1 parent eea750c commit 01ba5ea

File tree

1 file changed

+38
-38
lines changed

1 file changed

+38
-38
lines changed

doc/driver.mld

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -28,27 +28,27 @@ understand how to build [odoc] projects. It can be useful to look at the
2828
implementation code, but it can also help to simply look at all invocations of
2929
[odoc] during a run of the driver.
3030

31-
{1:units Cluster of documentation}
31+
{1:units Trees of documentation}
3232

3333
In its third major version, [odoc] has been improved so that the same
3434
documentation can work on multiple scenarios, from local switches to big
3535
monorepos, or the ocaml.org hub of documentation for all packages, without
3636
anything breaking, especially references.
3737

38-
The idea is that we have named group of documentation, that we'll call cluster
39-
here. We have two kinds of them: page clusters, and modules clusters. Inside the
40-
clusters, everything is managed by [odoc]. Outside of the cluster, the driver is
41-
free to arrange them however they like. In order to reference another cluster, a
42-
documentation author can use the name of the cluster in the reference.
38+
The idea is that we have named group of documentation, that we'll call {e trees}
39+
here. We have two kinds of them: page trees, and modules trees. Inside the
40+
trees, everything is managed by [odoc]. The driver is free to root them however
41+
they like in the overall hierarchy. In order to reference another tree, a
42+
documentation author can use the name of the tree in the reference.
4343

44-
Different situations will give different meanings to the clusters. In the case
45-
of [opam] packages, though, there is a natural meaning to give to those clusters
44+
Different situations will give different meanings to the trees. In the case of
45+
[opam] packages, though, there is a natural meaning to give to those trees
4646
(you'll find more details in the convention for opam-installed packages). Any
47-
opam package will have an associated "documentation cluster", named with the
48-
name of the package. Any of its libraries will have an associated "module
49-
cluster", named with the name of the library. Another package can thus refer to
50-
the doc using the package name, or to any of its library using the library name,
51-
no matter where the package is located in the hierarchy.
47+
opam package will have an associated "documentation tree", named with the name
48+
of the package. Any of its libraries will have an associated "module tree",
49+
named with the name of the library. Another package can thus refer to the doc
50+
using the package name, or to any of its library using the library name, no
51+
matter where the package is located in the hierarchy.
5252

5353
{1 The doc generation pipeline}
5454

@@ -187,15 +187,15 @@ A generic link command is:
187187
[--parent-id] from the link phase, and it is important for the indexing phase
188188
that it stays in the same location.
189189

190-
- [-P <name>:<dir>] are used to list the "page clusters", used to resolve
190+
- [-P <name>:<dir>] are used to list the "page trees", used to resolve
191191
references such as [{!/ocamlfind/index}].
192192

193-
- [-L <name>:<dir>] are used to list the "module clusters", used to resolve
193+
- [-L <name>:<dir>] are used to list the "module trees", used to resolve
194194
references such as [{!/findlib.dynload/Fl_dynload}]. This also adds [<dir>] to
195195
the search path.
196196

197197
- [-I <dir>] adds [<dir>] to the search path. The search path is used to resolve
198-
references that do not use the cluster mechanism, such as [{!Module}] and
198+
references that do not use the "named tree" mechanism, such as [{!Module}] and
199199
[{!page-pagename}].
200200

201201
{2 The indexing phase}
@@ -339,18 +339,18 @@ argument, and give the asset unit using [--asset-unit].
339339

340340
In order to build the documentation for installed package, the driver needs to
341341
give a meaning to various of the concept above. In particular, it needs to
342-
define the pages and libraries clusters, know where to find the pages and
343-
assets, what id to give them, when linking it needs to know to which clusters
344-
the artifact may be linking...
342+
define the pages and libraries trees, know where to find the pages and assets,
343+
what id to give them, when linking it needs to know to which trees the artifact
344+
may be linking...
345345

346346
So that the different drivers and installed packages play well together, we
347347
define here a convention for building installed packages. If both the package
348348
and the driver follow it, building the docs should go well!
349349

350-
{2 The [-P] and [-L] clusters, and their root ids}
350+
{2 The [-P] and [-L] trees, and their root ids}
351351

352-
Each package define a set of cluster, each of them having a root ids. These
353-
roots will be used in [--parent-id] and in [-P] and [-L].
352+
Each package define a set of trees, each of them having a root ids. These roots
353+
will be used in [--parent-id] and in [-P] and [-L].
354354

355355
The driver can decide any set of mutually disjoint set of roots, without posing
356356
problem to the reference resolution. For instance, both [-P
@@ -363,36 +363,36 @@ For each package [<p>], each library [<l>] defines a library root id:
363363
[<p>/lib/<l>].
364364

365365
For instance, a package [foo] with two libraries: [foo] and [foo.bar] will
366-
define three clusters:
366+
define three trees:
367367

368-
- A documentation cluster named [foo], with root id [foo/doc]. When referred
369-
from other clusters, a [-P foo:<odoc_dir>/foo/doc] argument needs to be added
368+
- A documentation tree named [foo], with root id [foo/doc]. When referred
369+
from other trees, a [-P foo:<odoc_dir>/foo/doc] argument needs to be added
370370
at the link phase.
371371

372-
- A module cluster named [foo], with root id [foo/lib/foo]. When referred from
373-
other clusters, a [-L foo:<odoc_dir>/foo/lib/foo] argument needs to be added
372+
- A module tree named [foo], with root id [foo/lib/foo]. When referred from
373+
other trees, a [-L foo:<odoc_dir>/foo/lib/foo] argument needs to be added
374374
at the link phase.
375375

376-
- A module cluster named [foo.bar], with root id [foo/doc]. When referred from
377-
other clusters, a [-L foo.bar:<odoc_dir>/foo/lib/foo.bar] argument needs to be
376+
- A module tree named [foo.bar], with root id [foo/doc]. When referred from
377+
other trees, a [-L foo.bar:<odoc_dir>/foo/lib/foo.bar] argument needs to be
378378
added at the link phase.
379379

380380
{2 Link-time dependencies}
381381

382-
Installed OPAM packages need to specify which clusters they may be referencing
382+
Installed OPAM packages need to specify which trees they may be referencing
383383
during the link phase, so that the proper [-P] and [-L] arguments are
384384
added. (Note that these dependencies can be circular without problem, as they
385385
happen during the link phase and only require the artifact from the compile
386386
phase.)
387387

388-
An installed package [<p>] specifies its cluster dependencies in a file at
388+
An installed package [<p>] specifies its tree dependencies in a file at
389389
[<opam root>/doc/<p>/odoc-config.sexp]. This file contains s-expressions.
390390

391-
Stanzas of the form [(packages p1 p2 ...)] specifies that page clusters [p1],
391+
Stanzas of the form [(packages p1 p2 ...)] specifies that page trees [p1],
392392
[p2], ..., should be added using the [-P] argument: with the canonical roots, it
393393
would be [-P p1:<output_dir>/p1/doc -P p2:<output_dir>/p2/doc -P ...].
394394

395-
Stanzas of the form [(libraries l1 l2 ...)] specifies that module clusters [l1],
395+
Stanzas of the form [(libraries l1 l2 ...)] specifies that module trees [l1],
396396
[l2], ..., should be added using the [-L] argument: with the canonical roots, it
397397
would be [-L l1:<output_dir>/p1/lib/l1 -L l2<output_dir>/p2/lib/l2 -L ...],
398398
where [p1] is the package [l1] is in, etc.
@@ -413,20 +413,20 @@ root>/doc/odoc-assets/].
413413
{2 The [--parent-id] arguments}
414414

415415
Interface and implementation units have as parent id the root of the library
416-
cluster they belong to: with "canonical" roots, [<pkgname>/lib/<libname>].
416+
tree they belong to: with "canonical" roots, [<pkgname>/lib/<libname>].
417417

418418
Page units that are found in [<opam
419-
root>/doc/<pkgname>/odoc-pages/<relpath>/<name>.mld] have the parent id from their
420-
page cluster, followed by [<relpath>]. So, with canonical roots,
419+
root>/doc/<pkgname>/odoc-pages/<relpath>/<name>.mld] have the parent id from
420+
their page tree, followed by [<relpath>]. So, with canonical roots,
421421
[<pkgname>/doc/<relpath>].
422422

423423
Asset units that are found in [<opam
424424
root>/doc/<pkgname>/odoc-pages/<relpath>/<name>.<ext>] have the parent id from
425-
their page cluster, followed by [<relpath>]. With canonical roots,
425+
their page tree, followed by [<relpath>]. With canonical roots,
426426
[<pkgname>/doc/<relpath>].
427427

428428
Asset units that are found in [<opam root>/doc/<pkgname>/odoc-assets/<filename>]
429-
have the parent id from their page cluster, followed by [_asset/<filename>]
429+
have the parent id from their page tree, followed by [_asset/<filename>]
430430
[<p>/doc/_assets/<filename>].
431431

432432
{2 The [--source-id] arguments}

0 commit comments

Comments
 (0)