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 use it instead of {!Boring}. *)
ocamldoc complains:
Warning: Element Awesome not found
Warning: Element Boring not found
Is there a way to reference type constructors such that ocamldoc can link to the corresponding type?
You cannot directly cross-link to a type constructor. However, you can link to the type itself:
(** {{!x}Awesome} is a really great constructor for {!x}. *)
If you want to have something more precise, you can write a small ocamldoc plugin to overwrite the html_of_Ref method.
AFAIK that's not possible. You can see the kind of references that can be made with this syntax here. However what you can do is :
(** {{!x}[Awesome]} that will at least bring to {!x} by clicking on it. *)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With