>From d9cac4f113ef8536d49b44668f2c2c7dac0fac17 Mon Sep 17 00:00:00 2001 From: John Soo Date: Thu, 31 Dec 2020 11:43:03 -0800 Subject: [PATCH 4/9] gnu: Add ocaml-mdx. * gnu/packages/ocaml.scm (ocaml-mdx): New variable. --- gnu/packages/ocaml.scm | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/gnu/packages/ocaml.scm b/gnu/packages/ocaml.scm index d86555906b..707880dd5d 100644 --- a/gnu/packages/ocaml.scm +++ b/gnu/packages/ocaml.scm @@ -3965,6 +3965,49 @@ Mercurial's @code{https://www.selenic.com/blog/?p=663, unified test format}. @code{craml} is released as a single binary (called @code{craml}).") (license license:isc))) +(define-public ocaml-mdx + (package + (name "ocaml-mdx") + (version "1.7.0") + (source + (origin + (method url-fetch) + (uri "https://github.com/realworldocaml/mdx/releases/download/1.7.0/mdx-1.7.0.tbz") + (sha256 + (base32 + "0vpc30sngl3vpychrfvjwyi93mk311x3f2azlkxasgcj69fq03i7")))) + (build-system dune-build-system) + (inputs + `(("ocaml-fmt" ,ocaml-fmt) + ("ocaml-astring" ,ocaml-astring) + ("ocaml-logs" ,ocaml-logs) + ("ocaml-cmdliner" ,ocaml-cmdliner) + ("ocaml-re" ,ocaml-re) + ("ocaml-result" ,ocaml-result) + ("ocaml-migrate-parsetree" ,ocaml-migrate-parsetree) + ("ocaml-version" ,ocaml-version) + ("ocaml-odoc" ,ocaml-odoc))) + (native-inputs + `(("ocaml-cppo" ,ocaml-cppo) + ("ocaml-lwt" ,ocaml-lwt) + ("ocaml-alcotest" ,ocaml-alcotest))) + (home-page + "https://github.com/realworldocaml/mdx") + (synopsis + "Executable code blocks inside markdown files") + (description + "This package allows execution of code blocks inside markdown files. +There are (currently) two sub-commands, corresponding to two modes of +operations: pre-processing (@command{ocaml-mdx pp}) and +tests (@command{ocaml-mdx test}). + +The pre-processor mode allows to mix documentation and code, and to practice +\"literate programming\" using markdown and OCaml. + +The test mode allows to ensure that shell scripts and OCaml fragments in the +documentation always stays up-to-date.") + (license license:isc))) + (define-public ocaml4.07-merlin (package (name "ocaml4.07-merlin") -- 2.29.2