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