From 83dda5bb5dba67af153e848224209557c5f15ef3 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 31 Jan 2019 10:31:59 +0000 Subject: [PATCH 1/5] remove `release` target as `dune-release` can be used now --- Makefile | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Makefile b/Makefile index 93b4f0c..e2e7cc7 100644 --- a/Makefile +++ b/Makefile @@ -39,16 +39,3 @@ cinaps: clean: rm -rf _build *.install find . -name .merlin -delete - -# This needs to be updated -.PHONY: gh-pages -gh-pages: doc - git clone `git config --get remote.origin.url` .gh-pages --reference . - git -C .gh-pages checkout --orphan gh-pages - git -C .gh-pages reset - git -C .gh-pages clean -dxf - cp -t .gh-pages/ _build/utop-api.docdir/* - git -C .gh-pages add . - git -C .gh-pages commit -m "Update Pages" - git -C .gh-pages push origin gh-pages -f - rm -rf .gh-pages From a91ae34dce86ba2dba4ce1b40a81ecd7d4a38c8c Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 31 Jan 2019 10:32:13 +0000 Subject: [PATCH 2/5] ignore vim swapfiles --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index ab824aa..1ec4270 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ _build/ .merlin *.install -*.elc \ No newline at end of file +*.elc +.*.swp From 4aca5d81361c9b9ff7bb25c30a3f180e505ecab9 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 31 Jan 2019 10:32:19 +0000 Subject: [PATCH 3/5] add doc entry to opam file to support dune-release --- utop.opam | 1 + 1 file changed, 1 insertion(+) diff --git a/utop.opam b/utop.opam index 8441f16..71ba49c 100644 --- a/utop.opam +++ b/utop.opam @@ -4,6 +4,7 @@ authors: "Jérémie Dimino" license: "BSD3" homepage: "https://github.com/ocaml-community/utop" bug-reports: "https://github.com/ocaml-community/utop/issues" +doc: "https://ocaml-community.github.io/utop/" depends: [ "ocaml" {>= "4.03.0"} "base-unix" From 499b1a6435c726119a5f67deb5e8b12614fb36b6 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 31 Jan 2019 10:32:27 +0000 Subject: [PATCH 4/5] update CHANGES for release 2.3.0 --- CHANGES.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 7f68b55..517e1a8 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,32 @@ -dev ---- +2.3.0 (2019-01-31) +------------------ -* Port build to dune from jbuilder (@avsm) -* Upgrade local opam metadata to opam 2.0 format (@avsm) +The new feature in this release is to automatically install +printers marked with `[@@ocaml.toplevel_printer]` (#269 @diml). +Adding this annotation to your libraries will remove the need +to have a separate `top` package to install the printers. + +For example, in the [uri](https://github.com/mirage/ocaml-uri) +library, the old printing function for `Uri.t` was: + +``` +val pp_hum : Format.formatter -> t -> unit +``` + +Just adding this annotation results in `Uri.t` values being automatically +pretty printed in this version of utop. + +``` +val pp_hum : Format.formatter -> t -> unit [@@ocaml.toplevel_printer] +``` + +* Add cool screenshot to README (#259 @rizo) and update links (#257 @bobot) +* Improve robustness by using more tail-recursive functions (#251 @gpetiot) +* Remove deprecation warnings in newer compilers (#246 @ncihnegn) +* Minimum OCaml version supported is now 4.03.0 (#254 @XVilka) +* Publish API documentation online and add `doc:` entry to opam file (#270 @avsm) +* Port build to dune from jbuilder (#268 @avsm) +* Upgrade local opam metadata to opam 2.0 format (#268 @avsm) 2.2.0 (2018-07-15) ------------------ From 2a711a79c8447f575c01813ea36331f2cb7b667b Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Thu, 31 Jan 2019 10:37:01 +0000 Subject: [PATCH 5/5] also update the README with the toplevel printers documentation --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/README.md b/README.md index f3f48cd..a8c5e8e 100644 --- a/README.md +++ b/README.md @@ -206,6 +206,34 @@ correctly: It shall point to the directory `stublibs` inside your ocaml installation. +Automatically installing toplevel printers +------------------------------------------ + +Utop will automatically install toplevel printers for custom +types if their interface file is marked with an +`[@@ocaml.toplevel_printer]` attribute. Adding this annotation to +your libraries will remove the need to have a separate `top` package +to install the printers. + +For example, in the [uri](https://github.com/mirage/ocaml-uri) +library, the old printing function for `Uri.t` was: + +``` +val pp_hum : Format.formatter -> t -> unit +``` + +Just adding this annotation results in `Uri.t` values being automatically +pretty printed in this version of utop. + +``` +val pp_hum : Format.formatter -> t -> unit [@@ocaml.toplevel_printer] +``` + +There should be no downsides to adding this attribute to your +libraries, so we encourage community library maintainers to +use this attribute to improve the out-of-the-box experience +for users of their libraries within utop. + Creating a custom utop-enabled toplevel ---------------------------------------