Module Htmlact

Htmlit HTML generation and Webs HTTP headers.

These functions help generate htmlact data attributes and HTTP headers with Htmlit and Webs. Ignore if you are using something else to generate your HTML or interact with HTTP.

Attributes

val request : ?method':[< Webs.Http.Method.t | `Sse ] -> string -> Htmlit.At.t

request ~method' r is a data-request attribute for URL r using method method' (defaults to `GET).

val request_path : ?method':[< Webs.Http.Method.t | `Sse ] -> Webs.Http.Path.t -> Htmlit.At.t

request ~meth p is a data-request attribute for URL p using method method' (defaults to `GET).

val query : string -> Htmlit.At.t

query sel is the data-query attribute sel.

val query_rescue : [ `Bool of bool | `Force ] -> Htmlit.At.t

query_rescue b is the data-query-rescue attribute b.

val event_src : string -> Htmlit.At.t

event_src sel is the data-event-src attribute sel.

type dur_ms = int

The type for millisecond durations.

val event : ?once:bool -> ?debounce_ms:dur_ms -> ?throttle_ms:dur_ms -> ?filter:string -> string -> Htmlit.At.t

event () is the data-event attribute ev.

val target : string -> Htmlit.At.t

target sel is the data-target attribute sel.

type effect_kind = [
  1. | `Element
  2. | `Children
  3. | `Beforebegin
  4. | `Afterbegin
  5. | `Beforeend
  6. | `Afterend
  7. | `None
  8. | `Event of string
]

The type for kind of request effects.

val effect : effect_kind -> Htmlit.At.t

effect e is the data-effect attribute e.

val feedback : string -> Htmlit.At.t

feedback sel is the data-feedback attribute sel.

type referrer_policy = [
  1. | `No_referrer
  2. | `No_referrer_when_downgrade
  3. | `Origin
  4. | `Origin_when_cross_origin
  5. | `Same_origin
  6. | `Strict_origin
  7. | `Strict_origin_when_cross_origin
  8. | `Unsafe_url
  9. | `Other of string
]

The type for referrer policies.

val referrer_policy : referrer_policy -> Htmlit.At.t

referrer_policy policy is the data-referrer-policy attribute policy.

Durations

module Dur : sig ... end

Named durations.

HTTP headers

Requests

val htmlact : Webs.Http.Headers.Name.t

htmlact is the htmlact header.

Responses

val redirect : Webs.Http.Headers.Name.t

redirect is the htmlact-redirect header.

val reload : Webs.Http.Headers.Name.t

reload is the htmlact-reload header.

val location_push : Webs.Http.Headers.Name.t

location_push is the htmlact-location-push header.

val location_replace : Webs.Http.Headers.Name.t

location_replace is the htmlact-location-replace header.

val location_title : Webs.Http.Headers.Name.t

location_title is the htmlact-location-title header.

val encode_location_title : string -> string

encode_location_title s encodes s for the location_title headers.