[ANN] dream-html 2.0.0

Hi, dream-html 2.0.0 has been released to opam: dream-html 2.0.0 (latest) · OCaml Package

Repo: GitHub - yawaramin/dream-html: Generate HTML markup from your OCaml Dream backend server
API docs: Dream_html (dream-html.Dream_html)

Dream-html is a library for generating HTML, closely integrated with Dream. It can be used as an alternative to Dream’s built-in Embedded ML templating language. Here’s the Dream home page example using dream-html:

let hello who =
  let open Dream_html in
  let open HTML in
  html [] [
    body [] [
      h1 [] [txt "Hello, %s!" who]]]

let () =
  @@ Dream.logger
  @@ Dream.router [Dream.get "/" (fun _ -> Dream_html.respond (hello "world"))]

In this release, I made a breaking change (hence major version bump) to restrict the capture attribute to only the values `user or `environment. Previously it was accepting any format string.

Plus a small addition, the autocomplete attribute now also accepts the `webauthn value.


[ANN] dream-html 2.1.0

  • Deprecate Hx.on and introduce new Hx.on_ event handler attribute style used by htmx
  • Add form [method_ `dialog] new attribute value for pure HTML modals
1 Like

Thanks @yawaramin! Been using the lib.

1 Like