LinuxCommandLibrary

ocamldoc

Generate documentation from OCaml source code

SYNOPSIS

ocamldoc [options] [ml-files] [mli-files] [directories]

PARAMETERS

-a
    Include all directories in the load path.

-I directory
    Add directory to the list of directories searched for interface files.

-d directory
    Specify the destination directory for the generated documentation.

-html
    Generate HTML output.

-latex
    Generate LaTeX output.

-t title
    Set the title of the generated documentation.

-v
    Be verbose.

-version
    Print version and exit.

DESCRIPTION

ocamldoc is a tool to generate documentation from OCaml source code. It parses the input .mli and .ml files and produces documentation in various formats, including HTML, LaTeX, and more. ocamldoc extracts information such as module types, function signatures, comments (specifically those with special docstrings), and structure definitions. The generated documentation can be used to easily navigate and understand OCaml projects.
It serves as a static documentation generator, producing output files that represent the API and code structure of your OCaml project. The documentation format is guided by comments that follow the (** ... *) comment syntax, allowing you to embed markup for special formatting, code examples, or other relevant information. ocamldoc also includes a browsing mode that permits interactive inspection of modules and types.

CAVEATS

ocamldoc relies on properly formatted comments within the OCaml source code. Ensure that comments intended for documentation adhere to the (** ... *) syntax and use appropriate markup tags for desired formatting.

DOCUMENTATION COMMENTS

Documentation comments start with two stars (** and end with *). They are used to document modules, types, values, classes, class types, methods, and instances variables.
Documentation comments can contain markup for rich formatting like lists, code blocks, and links.

HISTORY

ocamldoc has evolved alongside the OCaml language. Initially a simpler tool, it has been extended to support more output formats, custom markup, and advanced documentation features.
It plays an important role in maintaining the documentation standards of the OCaml open-source ecosystem and promotes good documentation practices.

SEE ALSO

ocamlc(1), ocamlopt(1)

Copied to clipboard