package odoc

  1. Overview
  2. Docs
OCaml documentation generator

Install

Dune Dependency

Authors

Maintainers

Sources

odoc-2.1.1.tbz
sha256=f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd
sha512=1c545c281a7022a167f028fff8cec6fb3f2f82da0881431be74e7a4281c5353ed83bfbdb4d9d9e08af6755dbe3505c052c5e5b58cdeb08c57aed5e89c0f15e91

doc/index.html

odoc

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 turned into html, or TeX or manpages.

The syntax reference is a refinement of that explained in the OCaml manual. The differences are described here.

odoc's main advantages over OCamldoc are

  • an accurate 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 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!

For Library Authors

For guidance on how to document your OCaml project, see odoc for authors.

For Integrators

To integrate odoc into your tool, webpage or any other setting, you'll need to understand how to drive odoc.

For Developers

To start contributing to odoc, please see our contributors guide.

Page index

The main other pages of this site:

OCaml

Innovation. Community. Security.