Questions tagged [ocamldoc]

The OCaml documentation generator

The documentation generator ocamldoc generates documentation from special comments embedded in source files. The comments used by ocamldoc are of the form (** ... *) and follow the format described in the The OCaml user's manual.

ocamldoc can produce documentation in various formats: , , , , and . Moreover, users can add their own custom generators.

Useful resources:

15 questions
8
votes
2 answers

Making ocamlbuild pass both .ml and .mli files to ocamldoc

I want to include source code in my generated docs. This works when I invoke ocamldoc on the command-line like this: ocamldoc -I _build -html -keep-code -colorize-code *.{ml,mli} -d .docdir. However, I'm having troubles integrating this with…
Mikhail Glushenkov
  • 14,928
  • 3
  • 52
  • 65
5
votes
2 answers

Generating class-like diagrams for OCaml

I have a large OCaml code base and would like to obtain some UML-like class/module diagrams from it, similar to what some Java reverse engineering tools do. These diagrams do not need to be formal UML diagrams, but being able to see at least the…
anol
  • 8,264
  • 3
  • 34
  • 78
5
votes
1 answer

Why does ocamldoc fail on unbound modules?

Here is an example interface test.mli, commented with ocamldoc-style comments: (** ocamldoc module comment *) open MissingModule;; (** ocamldoc function comment *) val test : unit;; If I run the command ocamldoc test.mli, I get the following…
Matthew Piziak
  • 3,430
  • 4
  • 35
  • 49
3
votes
2 answers

Using ocamldoc with packs

I have an ocamlbuild project which includes some files in a subdirectory with an .mlpack file listing them. e.g. I have a file support/logging.ml which defines the module Support.Logging. The _tags file says "support": for-pack(Support). This all…
Thomas Leonard
  • 7,068
  • 2
  • 36
  • 40
3
votes
1 answer

How to generate doc for OCaml based on module signatures?

I have a.ml like this: module type ASig = sig val do_something : unit -> int;; end ;; module A:ASig = struct let do_something () = 1;; let do_secrectly () = 2;; end;; So for my module A, the interface should be only…
Jackson Tale
  • 25,428
  • 34
  • 149
  • 271
3
votes
2 answers

Can ocamldoc reference type constructors?

I'm trying to refer to a type constructor in ocamldoc. For example: type x = Awesome | Boring And later we want to refer to one of the constructors in some documentation: (** {!Awesome} is a really great constructor for {!x}. You should definitely…
Ed McMan
  • 521
  • 2
  • 15
2
votes
1 answer

odoc (documentation generator for OCaml) remove 'Stdlib' prefix

I'm using odoc, along with dune to generate documentation for a library. This is made by doing: dune build @doc However, this generates signatures like: val print : Stdlib.Format.formatter -> t -> unit While what i would like is: val print :…
ghilesZ
  • 1,502
  • 1
  • 18
  • 30
2
votes
0 answers

How to run dune build @doc with arguments

I have an ocaml project using Dune. I want to generate documentation using Odoc. Currently, running dune build @doc works, but I want to pass in the -short-functors option to Odoc. How do I pass options to Odoc through Dune?
nosman
  • 95
  • 1
  • 7
2
votes
1 answer

Bind Core to ocamldoc

I am trying to generate documentation for a module of mine using ocamldoc. However, I use the Core library and ocamldoc complains about not finding it. Error: Unbound module Core I understand why thanks to this question, but it doesn't mention any…
Richard-Degenne
  • 2,892
  • 2
  • 26
  • 43
1
vote
2 answers

ocamldoc not properly displaying parameter names or description with @param

Simply put, let us say I have the following OCaml file called test.ml: (** [Test] is a sample module for showing the problem I am having with @ tags with OCamlDoc *) (** [id] is the identity function. For any argument [x], [id x] is [x]. …
1
vote
1 answer

Does ocamldoc generate documentation for functions?

I'm using ocamldoc to generate the documentation of my program. My code is not particularly big yet, I just have one function, but when I open the HTML the function documentation doesn't appear in any of the files generated by ocamldoc. I use…
Farengar
  • 33
  • 8
1
vote
1 answer

#OCaml ocamldoc generation error

Hello I'm trying to generate ocaml documentation with ocamldoc. I'm trying the following command : ocamldoc -html alpha.mli -d doc/ But I have this error : File "compiler/alpha.ml", line 16, characters 12-23: Error: Unbound module Id File…
Juanpi
  • 15
  • 4
1
vote
1 answer

Ocamldoc and open modules

I'm trying to document a small project of mine using ocamldoc. I have one main .ml file which opens two others .ml files. $ ocamldoc -html included1.ml included2.ml Works just fine, but when I add the including file, like $ ocamldoc -html…
pimple
  • 338
  • 1
  • 11
1
vote
1 answer

Ocamldoc "Unbound module Thread" without ocamlfind

Is it possible to use ocamldoc for a project with Threads without using ocamlfind? More importantly, how? -thread or -package aren't supported by ocamldoc, and -I -thread doesn't work.
Théo Winterhalter
  • 4,908
  • 2
  • 18
  • 34
1
vote
1 answer

referencing a type constructor in ocamldoc

I'm getting ocamldoc warnings: Warning: Element MyModule.VariantName not found when using {!MyModule.VariantName} in doc comments. The ocamldoc doc says In this chapter, we use the word element to refer to any of the following parts of an OCaml…
Mike Samuel
  • 118,113
  • 30
  • 216
  • 245