# \[ANN\] dream-html 2.0.0

**URL:** https://discuss.ocaml.org/t/ann-dream-html-2-0-0/13626
**Category:** Ecosystem
**Tags:** announce, dream
**Created:** [December 13, 2023, 12:47am UTC](https://discuss.ocaml.org/t/ann-dream-html-2-0-0/13626 "2023-12-13T00:47:25Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)
#### Post date: [December 13, 2023, 12:47am UTC](https://discuss.ocaml.org/t/ann-dream-html-2-0-0/13626/1 "2023-12-13T00:47:25Z")

</div>

Hi, dream-html 2.0.0 has been released to opam: [dream-html 2.0.0 (latest) · OCaml Package](https://ocaml.org/p/dream-html/latest)

Repo: [GitHub - yawaramin/dream-html: Generate HTML markup from your OCaml Dream backend server](https://github.com/yawaramin/dream-html)  
API docs: [Dream\_html (dream-html.Dream\_html)](https://yawaramin.github.io/dream-html/dream-html/Dream_html/index.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:

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

let () =
  Dream.run
  @@ 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.

---

<div class="post-metadata">

### Author: ![yawaramin](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/yawaramin/32/3384_2.png) [@yawaramin](https://discuss.ocaml.org/u/yawaramin)
#### Post date: [January 25, 2024, 12:47am UTC](https://discuss.ocaml.org/t/ann-dream-html-2-0-0/13626/2 "2024-01-25T00:47:18Z")

</div>

[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

---

<div class="post-metadata">

### Author: ![dangdennis](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ocaml.org/dangdennis/32/2594_2.png) [@dangdennis](https://discuss.ocaml.org/u/dangdennis)
#### Post date: [January 25, 2024, 2:07am UTC](https://discuss.ocaml.org/t/ann-dream-html-2-0-0/13626/3 "2024-01-25T02:07:51Z")

</div>

Thanks @yawaramin! Been using the lib.
