Skip to content

Commit 5d31ff2

Browse files
Line editing for dune.mld (#1180)
1 parent a28b179 commit 5d31ff2

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

doc/dune.mld

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ Dune creates the docs for these with this command:
3232
$ dune build @doc
3333
]}
3434

35-
and the results will be in [_build/default/_doc/_html/].
35+
The results will be in [_build/default/_doc/_html/].
3636

3737
{1:library_wrapping Dune's Library Wrapping}
3838

3939
Dune has a feature whereby a library may be exposed under a single top-level
40-
module. This makes use of an OCaml feature where the use of the compiler
41-
flag [-no-alias-deps] is used to avoid introducing dependencies between
40+
module. This employs an OCaml feature where using the compiler
41+
flag [-no-alias-deps] will avoid introducing dependencies between
4242
compilation units.
4343

4444
We aim to reduce the potential name clashes of modules by
45-
only exposing one main module for library users to use,
45+
only exposing one main module for library users,
4646
encapsulating all other modules as submodules, while
4747
still retaining the usual way of writing OCaml code with one module per
48-
file. These individual files are still compiled, and installed, and
48+
file. These individual files are still compiled, installed, and
4949
available in the global namespace, but their names are prefixed with
5050
the library's name in order to reduce the possibility of clashes. These
5151
prefixed modules are not intended to be used directly, so
@@ -94,22 +94,22 @@ have double underscores meaning they are hidden. Only the non-hidden module
9494
[Lib] is linked, and during this process, the
9595
the modules [A] and [B] are expanded because they are aliases of hidden
9696
modules. All references to [Lib__A] and [Lib__B] are replaced with the canonical
97-
paths [Lib.A] and [Lib.B], so in this way odoc presents the library as entirely
97+
paths [Lib.A] and [Lib.B], so in this way, [odoc] presents the library as entirely
9898
contained within the module [Lib].
9999

100100
{2 Hand-Written Top-Level Module}
101101

102102
In some cases it's desirable to hand-write the top-level library module. This
103-
is usually done because some of the modules within the library are intended to
104-
be internal only and not exposed. Dune will notice that a module exists with
105-
the name of the library ([lib.ml] in this case), so instead it will create the
106-
file [lib__.ml]. The contents of this are identical to the previous section,
107-
with aliases for all modules. The canonical tags on the aliases are, as before,
108-
to [Lib.A] and [Lib.B]. These are references to module aliases that should be
109-
present in [lib.ml]. If these are {e not} there, [odoc] won't be able to
110-
resolve the canonical references, and any items from these modules that are
111-
exposed elsewhere will be hidden. If the items are type aliases they can be
112-
replaced, but otherwise they'll be rendered as unresolved links.
103+
is usually done because some modules in the library are intended to be internal
104+
only and not exposed. Dune will notice that a module exists with the library's
105+
name ([lib.ml] in this case), so instead it will create the file
106+
[lib__.ml]. Its contents are identical to the previous section, with aliases
107+
for all modules. Like before, the canonical tags on these aliases are
108+
references to [Lib.A] and [Lib.B]. These module should be present in [lib.ml]
109+
as module aliases. If these are {e not} there, [odoc] won't be able to resolve
110+
the canonical references, and any items from these modules that are exposed
111+
elsewhere will be hidden. If the items are type aliases, they can be replaced,
112+
but otherwise they'll be rendered as unresolved links.
113113

114114
For example, consider the following module structure. First, the module [Unexposed]
115115
in file [unexposed.mli]:
@@ -130,10 +130,10 @@ type t = Unexposed.t
130130
val f : Unexposed.t
131131
]}
132132

133-
and the library module that only exposes the module [Wrapping]:
133+
The library module that only exposes the module [Wrapping]:
134134

135135
{[
136136
module Wrapping = Wrapping
137137
]}
138138

139-
This structure is rendered {{!Odoc_examples.Wrapping}here}.
139+
This structure is rendered {{!Odoc_examples.Wrapping}here}.

0 commit comments

Comments
 (0)