[Libguestfs] [PATCH 2/2] ocaml: Improve ocamldoc.
Pino Toscano
ptoscano at redhat.com
Wed Sep 30 12:58:12 UTC 2015
On Wednesday 30 September 2015 10:19:10 Richard W.M. Jones wrote:
> Miscellaneous improvements to the ocamldoc:
>
> - Generate more sub-headings.
>
> - Document the object-oriented API.
>
> - Use a common function to generate the doc for module and OO APIs.
> ---
Mostly OK, except ...
> + let generate_doc ?(indent = "") f =
> + if is_documented f then (
> + let has_tags = ref false in
> +
> + pr "%s(** %s" indent f.shortdesc;
> + (match f.deprecated_by with
> + | None -> ()
> + | Some replacement ->
> + has_tags := true;
> + pr "\n\n @deprecated Use {!%s} instead" replacement
> + );
> + (match version_added f with
> + | None -> ()
> + | Some version ->
> + has_tags := true;
> + pr "\n\n @since %s" version
> + );
> + if !has_tags then
> + pr "\n";
> + pr "%s *)\n" indent;
> + )
Unfortunately, this is not enough to hide the internal functions from
the API doc, but they need be enclosed by
(**/**)
val to_not_be_documented = ...
(**/**)
See also a0892aa29e92bc906a011faca84befe58f0265bc.
Thanks,
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20150930/3f2be65b/attachment.sig>
More information about the Libguestfs
mailing list