Skip to content

Commit 8c4597b

Browse files
panglesdjonludlam
authored andcommitted
Driver doc: more review comments
1 parent d4bb22f commit 8c4597b

File tree

1 file changed

+17
-12
lines changed

1 file changed

+17
-12
lines changed

doc/driver.mld

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,15 @@ anything breaking, especially references.
3737

3838
The idea is that we have named groups of documentation, that we'll call {e trees}
3939
here. We have two kinds of trees: 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.
40+
trees, the hierarchy is managed by [odoc]. The driver is free to "root" them
41+
however they like in the overall hierarchy. So [odoc] is responsible for the
42+
hierarchy below the trees root, and the driver is responsible for the one
43+
outside of the trees. In order to reference another tree, a documentation author
44+
can use the name of the tree in the reference.
4345

4446
Different situations will give different meanings to the trees. In the case of
4547
[opam] packages, though, there is a natural meaning to give to those trees
46-
(you'll find more details in the convention for opam-installed packages). Any
48+
(you'll find more details in the {{!label-conv}convention for opam-installed packages}). Any
4749
opam package will have an associated "documentation tree", named with the name
4850
of the package. Any of its libraries will have an associated "module tree",
4951
named with the name of the library. Another package can thus refer to the doc
@@ -110,11 +112,11 @@ Let's have a look at a generic invocation of [odoc] during the compile phase:
110112
for pages. Documentation artifacts that will be in the same {{!units}unit of
111113
documentation} need to hare a common root in their parent id.
112114

113-
- [-I <dir>] corresponds to the search path for other [.odoc] files. It can be
114-
given as many times as necessary, but should allow to access every [.odoc]
115-
file generated from a [.cm{i;t;ti}] listed when calling [odoc compile-deps] on
116-
the input file. [<dir>] are directories under the [<od>] directory, computed
117-
from the [--parent-id] option given to previous calls to [odoc compile].
115+
- [-I <dir>] corresponds to the search path for other [.odoc] files. Multiple
116+
directory can be added to the search path, so every required [.odoc] file is
117+
in the search path. The required [.odoc] files are the one generated from a
118+
[.cm{i;t;ti}] file listed when calling [odoc compile-deps] on the input
119+
file.
118120

119121
A concrete example for such command would be:
120122

@@ -313,7 +315,10 @@ web worker to perform searches:
313315
standard mechanism of message passing.
314316

315317
- The web worker has to send back the result as a message to the main thread,
316-
containing the list of results. The format is defined in the TODO.
318+
containing the results. The format for the result message is a string that can
319+
be parsed as a list of JSON objects. Each object contain two keys-value pairs:
320+
a key ["url"] which contains a relative URL from [--ouput-dir]; and a key
321+
["html"] which contain the html showing the search entry.
317322

318323
- The JavaScript file must be manually put in the [--output-dir] values, the driver can
319324
decide where.
@@ -389,7 +394,7 @@ argument, and give the asset unit using [--asset-unit].
389394
$ odoc html-generate-asset --output-dir <odir> --asset-unit <path/to/asset-file.odocl> <path/to/asset/file.ext>
390395
]}
391396

392-
{1 Convention for installed packages}
397+
{1:conv Convention for installed packages}
393398

394399
In order to build the documentation for installed packages, the driver needs to
395400
give a meaning to the various concepts above. In particular, it needs to
@@ -427,7 +432,7 @@ define three trees:
427432
other trees, a [-L foo:<odoc_dir>/foo/lib/foo] argument needs to be added
428433
at the link phase.
429434

430-
- A module tree named [foo.bar], with root id [foo/doc]. When referred from
435+
- A module tree named [foo.bar], with root id [foo/lib/foo.bar]. When referred from
431436
other trees, a [-L foo.bar:<odoc_dir>/foo/lib/foo.bar] argument needs to be
432437
added at the link phase.
433438

0 commit comments

Comments
 (0)