Can ocamldoc reference type constructors?

I am trying to access the type constructor in ocamldoc.

For instance:

type x = Awesome | Boring

And later we want to refer to one of the designers in some documentation:

(** {!Awesome} is a really great constructor for {!x}.  You should definitely use it instead of {!Boring}. *)

ocamldoc complains:

Warning: Element Awesome not found
Warning: Element Boring not found

Is there a way to refer to type constructors so that ocamldoc can refer to the corresponding type?

+3
source share
2 answers

You cannot directly cross-reference a type constructor. However, you can refer to the type itself:

(** {{!x}Awesome} is a really great constructor for {!x}. *)

If you want to have something more accurate, you can write a small ocamldoc plugin to overwrite the method html_of_Ref.

+4
source

AFAIK . , . :

(** {{!x}[Awesome]} that will at least bring to {!x} by clicking on it. *)
+3

All Articles