File: index.mld

package info (click to toggle)
ocaml-odoc 2.1.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,744 kB
  • sloc: ml: 37,049; makefile: 124; sh: 79
file content (61 lines) | stat: -rw-r--r-- 2,327 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{0 odoc}

{1:overview What is [odoc]?}

[odoc] is a documentation generator for OCaml. It reads doc comments
from your source files and your [.mld] files, and outputs HTML, LaTeX and
man pages. The pages you are reading now are rendered using [odoc].

Text inside doc comments (delimited by [(** ... *)]) is marked up in
[odoc] syntax:

{[
val float_dsig : int -> float t
(** [float_dsig d] rounds the normalized {e decimal} significand
    of the float to the [d]th decimal fractional digit and formats
    the result with ["%g"]. Ties are rounded towards positive
    infinity. The result is NaN on infinities and only defined for
    [0 <= d <= 16].

    {b Warning.} The current implementation overflows on large [d]
    and floats. *)
]}

These comments are picked up by [odoc] and {{!Fmt.float_dsig}turned into html}, or TeX or manpages.

The syntax reference is a refinement of that explained in the
{{:https://ocaml.org/manual/ocamldoc.html}OCaml manual}. The differences
are described {{!page-ocamldoc_differences}here}.

[odoc]'s main advantages over OCamldoc are

- an accurate {e cross-referencer} that can calculate links between types, modules,
module types and more. So if you've ever been baffled by exactly what the [t] was in [val f : A(M).t -> unit], [odoc] will link to it!
- an {e expander}, which can expand complex module-type expressions while preserving their structure, including comment, includes and
more. If you've ever wondered what values there are in your module [M : Base.Applicative.S with type t := u], [odoc] will show you!

{1 For Library Authors}

For guidance on how to document your OCaml project, see {{!page-odoc_for_authors}[odoc] for authors}.

{1 For Integrators}

To integrate [odoc] into your tool, webpage or any other
setting, you'll need to understand {{!page-driver}how to drive [odoc]}.

{1 For Developers}

To start contributing to [odoc], please see our {{!page-contributing}contributors guide}.

{1 Page index}

The main other pages of this site:
- {!page-odoc_for_authors} Odoc For Authors
- {!page-features} Language Features
- {!page-driver} Reference Driver
- {!page-contributing} Contributing
- {!page-ocamldoc_differences} Differences from OCamldoc
- {!page-dune} Dune
- {!page-parent_child_spec} Parent/Child specification
- {!page-interface} Interface guarantees