From 3604b06e6cb16c806d183232d4ea4fd54e18cc29 Mon Sep 17 00:00:00 2001 From: Paul-Elliot Date: Wed, 5 Jul 2023 11:13:25 +0200 Subject: [PATCH] Link to Ocamlary from index of pages and add an example of comments associated to polymorphic variants Signed-off-by: Paul-Elliot --- doc/driver.mld | 2 +- doc/library_mlds/dune | 3 ++- doc/library_mlds/ocamlary.mld | 3 +++ doc/odoc.mld | 1 + src/ocamlary/ocamlary.mli | 4 +++- 5 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 doc/library_mlds/ocamlary.mld diff --git a/doc/driver.mld b/doc/driver.mld index d000865cf4..cc4cd11b32 100644 --- a/doc/driver.mld +++ b/doc/driver.mld @@ -269,7 +269,7 @@ let dep_libraries = let odoc_libraries = [ "odoc_xref_test"; "odoc_xref2"; "odoc_odoc"; "odoc_html_support_files"; "odoc_model_desc"; "odoc_model"; "odoc_manpage"; "odoc_loader"; - "odoc_latex"; "odoc_html"; "odoc_document"; "odoc_examples" ];; + "odoc_latex"; "odoc_html"; "odoc_document"; "odoc_examples"; "ocamlary" ];; let all_libraries = dep_libraries @ odoc_libraries;; diff --git a/doc/library_mlds/dune b/doc/library_mlds/dune index 96a31e81c6..149a6a9307 100644 --- a/doc/library_mlds/dune +++ b/doc/library_mlds/dune @@ -11,4 +11,5 @@ odoc_model_desc odoc_odoc odoc_xref2 - odoc_xref_test)) + odoc_xref_test + ocamlary)) diff --git a/doc/library_mlds/ocamlary.mld b/doc/library_mlds/ocamlary.mld new file mode 100644 index 0000000000..ff79eeb112 --- /dev/null +++ b/doc/library_mlds/ocamlary.mld @@ -0,0 +1,3 @@ +{0 Ocamlary} + +A demonstration of the rendering of most of the OCaml constructs {!module-Ocamlary}. diff --git a/doc/odoc.mld b/doc/odoc.mld index dad35f6b20..8d1d384ce6 100644 --- a/doc/odoc.mld +++ b/doc/odoc.mld @@ -53,4 +53,5 @@ The main other pages of this site: - {!page-dune} Dune - {!page-parent_child_spec} Parent/Child specification - {!page-interface} Interface guarantees +- {!page-ocamlary} A demonstration of the rendering of most of the OCaml constructs diff --git a/src/ocamlary/ocamlary.mli b/src/ocamlary/ocamlary.mli index e9bed1aeb6..6ef6a2e791 100644 --- a/src/ocamlary/ocamlary.mli +++ b/src/ocamlary/ocamlary.mli @@ -430,7 +430,9 @@ type variant = (** This comment is also for [variant]. *) (** This comment is for [poly_variant]. *) -type poly_variant = [ `TagA | `ConstrB of int ] +type poly_variant = + [ `TagA (** This is a comment for [`TagA] *) + | `ConstrB of int (** This is a comment for [`ConstrB] *) ] (** Wow! It was a polymorphic variant! *) (** This comment is for [full_gadt]. *)