package dream-html

  1. Overview
  2. Docs
HTML generator eDSL for Dream

Install

dune-project
 Dependency

Authors

Maintainers

Sources

dream-html-3.11.1.tbz
sha256=46740bc3e088406bbcf8f789ce9c8d7e4c4aaca608b85dca916b1fb380220fbe
sha512=504400f06e964b28cbefa2e06c8a29c7165a30ff48ff5790716baa27ef4949f424e979cd561c9b7c2ef0c9d8ff79d7d5e327ed4700bb04004dc8c327e4d481e4

doc/ppx/Ppx/index.html

Module PpxSource

This PPX provides an extension point to create route paths.

You can add it to your dune file in the usual way: (preprocess (pps dream-html.ppx)).

Then create a path: let%path orders = "/orders".

And use it in a route: Dream_html.get orders (fun req -> ...).

The PPX expands the above path to:

  let orders = Dream_html.path "/orders" "/orders"

Ie, it just duplicates the path string to use as two separate format strings with different types for parsing and printing. If you need to actually have a different format string for printing (eg if you need to print the path with query parameters), you can use the underlying Dream_html.path function directly: path "/orders/%s" "/orders/%s?utm_src=%s&utm_campaign=%s".

  • since 3.9.0
OCaml

Innovation. Community. Security.