Skip to content

Commit e395d1a

Browse files
committed
Merge branch 'master' into generate-assets
2 parents 65be5a3 + 3e332c9 commit e395d1a

File tree

47 files changed

+461
-734
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+461
-734
lines changed

CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
`count-occurrences` flag and command to count occurrences of every identifiers
77
(@panglesd, #976)
88
- Separate compilation of interface and implementation files, using a new
9-
`compile-src` command (@panglesd, #1067).
9+
`compile-src` command (@panglesd, #1067, #1188).
1010
- Add clock emoji before `@since` tag (@yawaramin, #1089)
1111
- Navigation for the search bar : use '/' to enter search, up and down arrows to
1212
select a result, and enter to follow the selected link. (@EmileTrotignon, #1088)

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}.

doc/interface.mld

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
1-
{0 [odoc] interface guarantees}
1+
{0 [odoc] Interface Guarantees}
22

33
[odoc] has several 'public facing' parts with varying levels of support guarantees.
44
This document describes what those interfaces are, what the support levels are
55
now, and what we aim for in the future.
66

77
{2 Documentation Comments}
88

9-
The first and most important is the syntax of the documentation comments present in source code.
9+
The first and most important is the syntax of the documentation comments present in the source code.
1010
This is relevant to everyone who is writing code that’s intended to be documented by [odoc], so it applies to the widest set of people.
1111
We have a separate page describing the {{!page-ocamldoc_differences}markup differences from OCamldoc}.
1212

1313
{2 CLI Interface}
1414

15-
The way in which the [odoc] CLI is invoked is not trivial, and it requires careful
16-
ordering and correct arguments to produce correctly linked documentation. It’s not expected that
17-
end-users will invoke [odoc] by hand, but rather it will be driven by separate tools. As a consequence, it’s important to preserve the tools’ ability to create good documentation with
18-
each release of [odoc], so we’ll ensure backward compatibility of the CLI as much as possible.
15+
The way in which we invoke the [odoc] CLI is not trivial, and it requires careful
16+
ordering and accurate arguments to produce correctly linked documentation. It’s not expected that
17+
end users will invoke [odoc] by hand, but rather it will be driven by separate tools. As a consequence, it’s important to preserve the tools’ ability to create good documentation with
18+
each [odoc] release, so we’ll ensure CLI backward compatibility as much as possible.
1919
There are currently three ‘first class’ tools that 'drive' [odoc]. We will not make
2020
releases of [odoc] whilst knowingly breaking these tools. These are:
2121

2222
- Odig
2323
- Dune
2424
- OCaml
2525

26-
Here, OCaml refers to the newly merged configure option (from 4.12.0) that builds the standard library documentation with
27-
[odoc]. If the recommended way of invoking [odoc] changes, we will work with the maintainers of these projects
28-
to ensure they are updated correspondingly.
26+
Here, OCaml refers to the newly-merged configure option (from 4.12.0) that builds the standard library documentation with
27+
[odoc]. If the recommended way of invoking [odoc] changes, we will work with these projects' maintainers
28+
to ensure they are updated accordingly.
2929

3030
Additionally, there will be a reference implementation of a tool to build [odoc]'s documentation, which should
3131
serve as a guide for anyone building other 'drivers' of [odoc].
3232

3333
{2 Output Formats}
3434

3535
[odoc] currently outputs HTML files, man pages, and LaTex documents. In a similar vein to the CLI interface,
36-
we will try to ensure that the three tools described above will not be broken by any changes to the
37-
outputs. That is, they will succeed and produce ‘correct’ documentation. Although, we don’t make any
36+
we will try to ensure that any changes to the outputs will not break the three tools described above.
37+
That is, they will succeed and produce ‘correct’ documentation. However, we don’t make any
3838
guarantees about the internal structure of the output documents; e.g., the exact nesting of
3939
tags or sequence of LaTex commands may not be preserved. We will attempt to ensure that the HTML anchors are preserved, implying that the filenames will also be preserved.
4040

@@ -45,5 +45,5 @@ no guarantees about the stability of the API.
4545

4646
{2 Intermediate Files}
4747

48-
The intermediate files that [odoc] produces ([.odoc] and [.odocl]) should be considered to be internal only
48+
The intermediate files that [odoc] produces ([.odoc] and [.odocl]) should be considered internal only
4949
and tied to the specific version of [odoc].

0 commit comments

Comments
 (0)