From dc72c3a395f7ea8afd100ad659589ca8751dd413 Mon Sep 17 00:00:00 2001 From: c-cube Date: Mon, 7 Aug 2023 14:14:09 +0000 Subject: [PATCH] deploy: b3b99af7aea8e288e392e5be85d300e2d0e4be3a --- dev/tiny_httpd/Tiny_httpd_buf/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_html/index.html | 4 ++-- dev/tiny_httpd/Tiny_httpd_html_/Out/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_io/In_channel/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_io/Out_channel/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_io/Writer/index.html | 2 ++ dev/tiny_httpd/Tiny_httpd_io/index.html | 2 +- dev/tiny_httpd/Tiny_httpd_server/Response/index.html | 7 +++++-- dev/tiny_httpd/Tiny_httpd_stream/index.html | 8 ++++++-- 10 files changed, 21 insertions(+), 12 deletions(-) create mode 100644 dev/tiny_httpd/Tiny_httpd_io/Writer/index.html diff --git a/dev/tiny_httpd/Tiny_httpd_buf/index.html b/dev/tiny_httpd/Tiny_httpd_buf/index.html index d8ee3bba..3f18c8a9 100644 --- a/dev/tiny_httpd/Tiny_httpd_buf/index.html +++ b/dev/tiny_httpd/Tiny_httpd_buf/index.html @@ -1,2 +1,2 @@ -Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)

Module Tiny_httpd_buf

Simple buffer.

These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.

type t
val size : t -> int
val clear : t -> unit
val create : ?size:int -> unit -> t
val contents : t -> string
val bytes_slice : t -> bytes

Access underlying slice of bytes.

  • since 0.5
val contents_and_clear : t -> string

Get contents of the buffer and clear it.

  • since 0.5
val add_bytes : t -> bytes -> int -> int -> unit

Append given bytes slice to the buffer.

  • since 0.5
val add_string : t -> string -> unit

Add string.

  • since NEXT_RELEASE
val add_buffer : t -> Stdlib.Buffer.t -> unit

Append bytes from buffer.

  • since NEXT_RELEASE
\ No newline at end of file +Tiny_httpd_buf (tiny_httpd.Tiny_httpd_buf)

Module Tiny_httpd_buf

Simple buffer.

These buffers are used to avoid allocating too many byte arrays when processing streams and parsing requests.

type t
val size : t -> int
val clear : t -> unit
val create : ?size:int -> unit -> t
val contents : t -> string
val bytes_slice : t -> bytes

Access underlying slice of bytes.

  • since 0.5
val contents_and_clear : t -> string

Get contents of the buffer and clear it.

  • since 0.5
val add_char : t -> char -> unit

Add a single char.

  • since NEXT_RELEASE
val add_bytes : t -> bytes -> int -> int -> unit

Append given bytes slice to the buffer.

  • since 0.5
val add_string : t -> string -> unit

Add string.

  • since NEXT_RELEASE
val add_buffer : t -> Stdlib.Buffer.t -> unit

Append bytes from buffer.

  • since NEXT_RELEASE
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html/index.html b/dev/tiny_httpd/Tiny_httpd_html/index.html index fd6ce64b..d7250740 100644 --- a/dev/tiny_httpd/Tiny_httpd_html/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html/index.html @@ -1,4 +1,4 @@ -Tiny_httpd_html (tiny_httpd.Tiny_httpd_html)

Module Tiny_httpd_html

HTML combinators.

This module provides combinators to produce html. It doesn't enforce the well-formedness of the html, unlike Tyxml, but it's simple and should be reasonably efficient.

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
  1. | `E of elt
  2. | `L of elt list
  3. | `S of elt Stdlib.Seq.t
  4. | `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'b Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : +Tiny_httpd_html (tiny_httpd.Tiny_httpd_html)

Module Tiny_httpd_html

HTML combinators.

This module provides combinators to produce html. It doesn't enforce the well-formedness of the html, unlike Tyxml, but it's simple and should be reasonably efficient.

  • since 0.12
module IO = Tiny_httpd_io

Output for HTML combinators.

type attribute = string * string

An attribute, i.e. a key/value pair

type elt = Out.t -> unit

A html element. It is represented by its output function, so we can directly print it.

type void = ?if_:bool -> attribute list -> elt

Element without children.

type nary = ?if_:bool -> attribute list -> elt list -> elt

Element with children, represented as a list.

  • parameter if_

    if false, do not print anything (default true)

type sub_elt = [
  1. | `E of elt
  2. | `L of elt list
  3. | `S of elt Stdlib.Seq.t
  4. | `Nil
]

A chunk of sub-elements, possibly empty.

type nary' = ?if_:bool -> attribute list -> sub_elt list -> elt

Element with children, represented as a list of sub_elt to be flattened

  • parameter if_

    if false, do not print anything (default true)

val sub_e : elt -> sub_elt

Sub-element with a single element inside.

val sub_l : elt list -> sub_elt

Sub-element with a list of items inside.

val sub_seq : elt Stdlib.Seq.t -> sub_elt

Sub-element with a sequence (Seq.t) of items inside.

val seq_of_array : 'a array -> 'b Stdlib.Seq.t

Helper to build a Seq.t from an array.

val sub_empty : sub_elt

Sub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.

val txt : string -> elt

Emit a string value, which will be escaped.

val txtf : ('a, Stdlib.Format.formatter, unit, Out.t -> unit) Stdlib.format4 -> - 'b

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

Attributes.

val to_string : ?top:bool -> elt -> string

Convert a HTML element to a string.

  • parameter top

    if true, add DOCTYPE at the beginning. The top element should then be a "html" tag.

val to_string_l : elt list -> string

Convert a list of HTML elements to a string. This is designed for fragments of HTML that are to be injected inside a bigger context, as it's invalid to have multiple elements at the toplevel of a HTML document.

val to_string_top : elt -> string
val to_stream : elt -> Tiny_httpd_stream.t

Convert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.

\ No newline at end of file + 'b

Formatted version of txt

val raw_html : string -> elt

Emit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.

val area : void

tag "area", see mdn

val base : void

tag "base", see mdn

val br : void

tag "br", see mdn

val col : void

tag "col", see mdn

val embed : void

tag "embed", see mdn

val hr : void

tag "hr", see mdn

val img : void

tag "img", see mdn

val input : void

tag "input", see mdn

tag "link", see mdn

val menuitem : void

tag "menuitem", see mdn

val meta : void

tag "meta", see mdn

val param : void

tag "param", see mdn

val source : void

tag "source", see mdn

val track : void

tag "track", see mdn

val wbr : void

tag "wbr", see mdn

val a : nary

tag "a", see mdn

val a' : nary'

tag "a", see mdn

val abbr : nary

tag "abbr", see mdn

val abbr' : nary'

tag "abbr", see mdn

val address : nary

tag "address", see mdn

val address' : nary'

tag "address", see mdn

val article : nary

tag "article", see mdn

val article' : nary'

tag "article", see mdn

val aside : nary

tag "aside", see mdn

val aside' : nary'

tag "aside", see mdn

val audio : nary

tag "audio", see mdn

val audio' : nary'

tag "audio", see mdn

val b : nary

tag "b", see mdn

val b' : nary'

tag "b", see mdn

val bdi : nary

tag "bdi", see mdn

val bdi' : nary'

tag "bdi", see mdn

val bdo : nary

tag "bdo", see mdn

val bdo' : nary'

tag "bdo", see mdn

val blockquote : nary

tag "blockquote", see mdn

val blockquote' : nary'

tag "blockquote", see mdn

val body : nary

tag "body", see mdn

val body' : nary'

tag "body", see mdn

val button : nary

tag "button", see mdn

val button' : nary'

tag "button", see mdn

val canvas : nary

tag "canvas", see mdn

val canvas' : nary'

tag "canvas", see mdn

val caption : nary

tag "caption", see mdn

val caption' : nary'

tag "caption", see mdn

val cite : nary

tag "cite", see mdn

val cite' : nary'

tag "cite", see mdn

val code : nary

tag "code", see mdn

val code' : nary'

tag "code", see mdn

val colgroup : nary

tag "colgroup", see mdn

val colgroup' : nary'

tag "colgroup", see mdn

val data : nary

tag "data", see mdn

val data' : nary'

tag "data", see mdn

val datalist : nary

tag "datalist", see mdn

val datalist' : nary'

tag "datalist", see mdn

val dd : nary

tag "dd", see mdn

val dd' : nary'

tag "dd", see mdn

val del : nary

tag "del", see mdn

val del' : nary'

tag "del", see mdn

val details : nary

tag "details", see mdn

val details' : nary'

tag "details", see mdn

val dfn : nary

tag "dfn", see mdn

val dfn' : nary'

tag "dfn", see mdn

val dialog : nary

tag "dialog", see mdn

val dialog' : nary'

tag "dialog", see mdn

val div : nary

tag "div", see mdn

val div' : nary'

tag "div", see mdn

val dl : nary

tag "dl", see mdn

val dl' : nary'

tag "dl", see mdn

val dt : nary

tag "dt", see mdn

val dt' : nary'

tag "dt", see mdn

val em : nary

tag "em", see mdn

val em' : nary'

tag "em", see mdn

val fieldset : nary

tag "fieldset", see mdn

val fieldset' : nary'

tag "fieldset", see mdn

val figcaption : nary

tag "figcaption", see mdn

val figcaption' : nary'

tag "figcaption", see mdn

val figure : nary

tag "figure", see mdn

val figure' : nary'

tag "figure", see mdn

tag "footer", see mdn

val footer' : nary'

tag "footer", see mdn

val form : nary

tag "form", see mdn

val form' : nary'

tag "form", see mdn

val h1 : nary

tag "h1", see mdn

val h1' : nary'

tag "h1", see mdn

val h2 : nary

tag "h2", see mdn

val h2' : nary'

tag "h2", see mdn

val h3 : nary

tag "h3", see mdn

val h3' : nary'

tag "h3", see mdn

val h4 : nary

tag "h4", see mdn

val h4' : nary'

tag "h4", see mdn

val h5 : nary

tag "h5", see mdn

val h5' : nary'

tag "h5", see mdn

val h6 : nary

tag "h6", see mdn

val h6' : nary'

tag "h6", see mdn

val head : nary

tag "head", see mdn

val head' : nary'

tag "head", see mdn

val header : nary

tag "header", see mdn

val header' : nary'

tag "header", see mdn

val hgroup : nary

tag "hgroup", see mdn

val hgroup' : nary'

tag "hgroup", see mdn

val html : nary

tag "html", see mdn

val html' : nary'

tag "html", see mdn

val i : nary

tag "i", see mdn

val i' : nary'

tag "i", see mdn

val iframe : nary

tag "iframe", see mdn

val iframe' : nary'

tag "iframe", see mdn

val ins : nary

tag "ins", see mdn

val ins' : nary'

tag "ins", see mdn

val kbd : nary

tag "kbd", see mdn

val kbd' : nary'

tag "kbd", see mdn

val label : nary

tag "label", see mdn

val label' : nary'

tag "label", see mdn

val legend : nary

tag "legend", see mdn

val legend' : nary'

tag "legend", see mdn

val li : nary

tag "li", see mdn

val li' : nary'

tag "li", see mdn

val main : nary

tag "main", see mdn

val main' : nary'

tag "main", see mdn

val map : nary

tag "map", see mdn

val map' : nary'

tag "map", see mdn

val mark : nary

tag "mark", see mdn

val mark' : nary'

tag "mark", see mdn

val math : nary

tag "math", see mdn

val math' : nary'

tag "math", see mdn

val menu : nary

tag "menu", see mdn

val menu' : nary'

tag "menu", see mdn

val meter : nary

tag "meter", see mdn

val meter' : nary'

tag "meter", see mdn

val nav : nary

tag "nav", see mdn

val nav' : nary'

tag "nav", see mdn

val noscript : nary

tag "noscript", see mdn

val noscript' : nary'

tag "noscript", see mdn

val object_ : nary

tag "object", see mdn

val object_' : nary'

tag "object", see mdn

val ol : nary

tag "ol", see mdn

val ol' : nary'

tag "ol", see mdn

val optgroup : nary

tag "optgroup", see mdn

val optgroup' : nary'

tag "optgroup", see mdn

val option : nary

tag "option", see mdn

val option' : nary'

tag "option", see mdn

val output : nary

tag "output", see mdn

val output' : nary'

tag "output", see mdn

val p : nary

tag "p", see mdn

val p' : nary'

tag "p", see mdn

val picture : nary

tag "picture", see mdn

val picture' : nary'

tag "picture", see mdn

val pre : nary

tag "pre", see mdn

val pre' : nary'

tag "pre", see mdn

val progress : nary

tag "progress", see mdn

val progress' : nary'

tag "progress", see mdn

val q : nary

tag "q", see mdn

val q' : nary'

tag "q", see mdn

val rb : nary

tag "rb", see mdn

val rb' : nary'

tag "rb", see mdn

val rp : nary

tag "rp", see mdn

val rp' : nary'

tag "rp", see mdn

val rt : nary

tag "rt", see mdn

val rt' : nary'

tag "rt", see mdn

val rtc : nary

tag "rtc", see mdn

val rtc' : nary'

tag "rtc", see mdn

val ruby : nary

tag "ruby", see mdn

val ruby' : nary'

tag "ruby", see mdn

val s : nary

tag "s", see mdn

val s' : nary'

tag "s", see mdn

val samp : nary

tag "samp", see mdn

val samp' : nary'

tag "samp", see mdn

val script : nary

tag "script", see mdn

val script' : nary'

tag "script", see mdn

val section : nary

tag "section", see mdn

val section' : nary'

tag "section", see mdn

val select : nary

tag "select", see mdn

val select' : nary'

tag "select", see mdn

val slot : nary

tag "slot", see mdn

val slot' : nary'

tag "slot", see mdn

val small : nary

tag "small", see mdn

val small' : nary'

tag "small", see mdn

val span : nary

tag "span", see mdn

val span' : nary'

tag "span", see mdn

val strong : nary

tag "strong", see mdn

val strong' : nary'

tag "strong", see mdn

val style : nary

tag "style", see mdn

val style' : nary'

tag "style", see mdn

val sub : nary

tag "sub", see mdn

val sub' : nary'

tag "sub", see mdn

val summary : nary

tag "summary", see mdn

val summary' : nary'

tag "summary", see mdn

val sup : nary

tag "sup", see mdn

val sup' : nary'

tag "sup", see mdn

val svg : nary

tag "svg", see mdn

val svg' : nary'

tag "svg", see mdn

val table : nary

tag "table", see mdn

val table' : nary'

tag "table", see mdn

val tbody : nary

tag "tbody", see mdn

val tbody' : nary'

tag "tbody", see mdn

val td : nary

tag "td", see mdn

val td' : nary'

tag "td", see mdn

val template : nary

tag "template", see mdn

val template' : nary'

tag "template", see mdn

val textarea : nary

tag "textarea", see mdn

val textarea' : nary'

tag "textarea", see mdn

val tfoot : nary

tag "tfoot", see mdn

val tfoot' : nary'

tag "tfoot", see mdn

val th : nary

tag "th", see mdn

val th' : nary'

tag "th", see mdn

val thead : nary

tag "thead", see mdn

val thead' : nary'

tag "thead", see mdn

val time : nary

tag "time", see mdn

val time' : nary'

tag "time", see mdn

val title : nary

tag "title", see mdn

val title' : nary'

tag "title", see mdn

val tr : nary

tag "tr", see mdn

val tr' : nary'

tag "tr", see mdn

val u : nary

tag "u", see mdn

val u' : nary'

tag "u", see mdn

val ul : nary

tag "ul", see mdn

val ul' : nary'

tag "ul", see mdn

val var : nary

tag "var", see mdn

val var' : nary'

tag "var", see mdn

val video : nary

tag "video", see mdn

val video' : nary'

tag "video", see mdn

Attributes.

val to_out_channel : ?top:bool -> elt -> IO.Out_channel.t -> unit

Write an HTML element to this out channel.

  • parameter top

    if true, add DOCTYPE at the beginning. The top element should then be a "html" tag.

  • since NEXT_RELEASE
val to_string : ?top:bool -> elt -> string

Convert a HTML element to a string.

  • parameter top

    if true, add DOCTYPE at the beginning. The top element should then be a "html" tag.

val to_string_l : elt list -> string

Convert a list of HTML elements to a string. This is designed for fragments of HTML that are to be injected inside a bigger context, as it's invalid to have multiple elements at the toplevel of a HTML document.

val to_string_top : elt -> string
val to_out_channel_top : elt -> IO.Out_channel.t -> unit

Write a toplevel element to an output channel.

  • since NEXT_RELEASE
val to_writer : ?top:bool -> elt -> IO.Writer.t

Produce a streaming writer from this HTML element.

  • since NEXT_RELEASE
val to_stream : elt -> Tiny_httpd_stream.t

Convert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html index e3a7915e..2fd0f8d4 100644 --- a/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html +++ b/dev/tiny_httpd/Tiny_httpd_html_/Out/index.html @@ -1,2 +1,2 @@ -Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

type t
val create : unit -> t
val clear : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> (unit -> 'a) -> 'a
val to_string : t -> string
\ No newline at end of file +Out (tiny_httpd.Tiny_httpd_html_.Out)

Module Tiny_httpd_html_.Out

Output for HTML combinators.

This output type is used to produce a string reasonably efficiently from a tree of combinators.

NOTE: this is experimental and an unstable API.

type t
val create_of_buffer : Stdlib.Buffer.t -> t
val create_of_out : Tiny_httpd_io.Out_channel.t -> t
val flush : t -> unit
val add_char : t -> char -> unit
val add_string : t -> string -> unit
val add_format_nl : t -> unit
val with_no_format_nl : t -> (unit -> 'a) -> 'a
\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/In_channel/index.html b/dev/tiny_httpd/Tiny_httpd_io/In_channel/index.html index 9e66b392..550db665 100644 --- a/dev/tiny_httpd/Tiny_httpd_io/In_channel/index.html +++ b/dev/tiny_httpd/Tiny_httpd_io/In_channel/index.html @@ -1,2 +1,2 @@ -In_channel (tiny_httpd.Tiny_httpd_io.In_channel)

Module Tiny_httpd_io.In_channel

type t = {
  1. input : bytes -> int -> int -> int;
    (*

    Read into the slice. Returns 0 only if the channel is closed.

    *)
  2. close : unit -> unit;
}
val of_in_channel : ?close_noerr:bool -> Stdlib.in_channel -> t
val of_unix_fd : ?close_noerr:bool -> Unix.file_descr -> t
val input : t -> bytes -> int -> int -> int
val close : t -> unit
\ No newline at end of file +In_channel (tiny_httpd.Tiny_httpd_io.In_channel)

Module Tiny_httpd_io.In_channel

Input channel (byte source)

type t = {
  1. input : bytes -> int -> int -> int;
    (*

    Read into the slice. Returns 0 only if the channel is closed.

    *)
  2. close : unit -> unit;
    (*

    Close the input. Must be idempotent.

    *)
}

An input channel, i.e an incoming stream of bytes.

This can be a string, an int_channel, an Unix.file_descr, a decompression wrapper around another input channel, etc.

val of_in_channel : ?close_noerr:bool -> Stdlib.in_channel -> t
val of_unix_fd : ?close_noerr:bool -> Unix.file_descr -> t
val input : t -> bytes -> int -> int -> int

Read into the given slice.

  • returns

    the number of bytes read, 0 means end of input.

val close : t -> unit

Close the channel.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/Out_channel/index.html b/dev/tiny_httpd/Tiny_httpd_io/Out_channel/index.html index 6255ce08..9ab67f15 100644 --- a/dev/tiny_httpd/Tiny_httpd_io/Out_channel/index.html +++ b/dev/tiny_httpd/Tiny_httpd_io/Out_channel/index.html @@ -1,2 +1,2 @@ -Out_channel (tiny_httpd.Tiny_httpd_io.Out_channel)

Module Tiny_httpd_io.Out_channel

type t = {
  1. output : bytes -> int -> int -> unit;
    (*

    Output slice

    *)
  2. flush : unit -> unit;
    (*

    Flush underlying buffer

    *)
  3. close : unit -> unit;
}
val of_out_channel : ?close_noerr:bool -> Stdlib.out_channel -> t
val output : t -> bytes -> int -> int -> unit
val output_string : t -> string -> unit
val close : t -> unit
val flush : t -> unit
val output_buf : t -> Buf.t -> unit
\ No newline at end of file +Out_channel (tiny_httpd.Tiny_httpd_io.Out_channel)

Module Tiny_httpd_io.Out_channel

Output channel (byte sink)

type t = {
  1. output_char : char -> unit;
    (*

    Output a single char

    *)
  2. output : bytes -> int -> int -> unit;
    (*

    Output slice

    *)
  3. flush : unit -> unit;
    (*

    Flush underlying buffer

    *)
  4. close : unit -> unit;
    (*

    Close the output. Must be idempotent.

    *)
}

An output channel, ie. a place into which we can write bytes.

This can be a Buffer.t, an out_channel, a Unix.file_descr, etc.

val of_out_channel : ?close_noerr:bool -> Stdlib.out_channel -> t

of_out_channel oc wraps the channel into a Out_channel.t.

  • parameter close_noerr

    if true, then closing the result uses close_out_noerr instead of close_out to close oc

val of_buffer : Stdlib.Buffer.t -> t

of_buffer buf is an output channel that writes directly into buf. flush and close have no effect.

val output_char : t -> char -> unit

Output the buffer slice into this channel

val output : t -> bytes -> int -> int -> unit

Output the buffer slice into this channel

val output_string : t -> string -> unit
val close : t -> unit

Close the channel.

val flush : t -> unit

Flush (ie. force write) any buffered bytes.

val output_buf : t -> Buf.t -> unit
val chunk_encoding : ?buf:Buf.t -> close_rec:bool -> t -> t

chunk_encoding oc makes a new channel that outputs its content into oc in chunk encoding form.

  • parameter close_rec

    if true, closing the result will also close oc

  • parameter buf

    a buffer used to accumulate data into chunks. Chunks are emitted when buf's size gets over a certain threshold, or when flush is called.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html b/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html index 851c2a3c..f6cb4b89 100644 --- a/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html +++ b/dev/tiny_httpd/Tiny_httpd_io/TCP_server/index.html @@ -1,2 +1,2 @@ -TCP_server (tiny_httpd.Tiny_httpd_io.TCP_server)

Module Tiny_httpd_io.TCP_server

A TCP server abstraction

type conn_handler = {
  1. handle : In_channel.t -> Out_channel.t -> unit;
    (*

    Handle client connection

    *)
}
type t = {
  1. endpoint : unit -> string * int;
    (*

    Endpoint we listen on. This can only be called from within serve.

    *)
  2. active_connections : unit -> int;
    (*

    Number of connections currently active

    *)
  3. running : unit -> bool;
    (*

    Is the server currently running?

    *)
  4. stop : unit -> unit;
    (*

    Ask the server to stop. This might not take effect immediately.

    *)
}

Running server.

type builder = {
  1. serve : after_init:(t -> unit) -> handle:conn_handler -> unit -> unit;
    (*

    Blocking call to listen for incoming connections and handle them. Uses the connection handler to handle individual client connections.

    *)
}

A TCP server implementation.

\ No newline at end of file +TCP_server (tiny_httpd.Tiny_httpd_io.TCP_server)

Module Tiny_httpd_io.TCP_server

A TCP server abstraction.

type conn_handler = {
  1. handle : In_channel.t -> Out_channel.t -> unit;
    (*

    Handle client connection

    *)
}
type t = {
  1. endpoint : unit -> string * int;
    (*

    Endpoint we listen on. This can only be called from within serve.

    *)
  2. active_connections : unit -> int;
    (*

    Number of connections currently active

    *)
  3. running : unit -> bool;
    (*

    Is the server currently running?

    *)
  4. stop : unit -> unit;
    (*

    Ask the server to stop. This might not take effect immediately, and is idempotent. After this server.running() must return false.

    *)
}

A running TCP server.

This contains some functions that provide information about the running server, including whether it's active (as opposed to stopped), a function to stop it, and statistics about the number of connections.

type builder = {
  1. serve : after_init:(t -> unit) -> handle:conn_handler -> unit -> unit;
    (*

    Blocking call to listen for incoming connections and handle them. Uses the connection handler handle to handle individual client connections in individual threads/fibers/tasks.

    • parameter after_init

      is called once with the server after the server has started.

    *)
}

A TCP server builder implementation.

Calling builder.serve ~after_init ~handle () starts a new TCP server on an unspecified endpoint (most likely coming from the function returning this builder) and returns the running server.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html b/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html new file mode 100644 index 00000000..0d020926 --- /dev/null +++ b/dev/tiny_httpd/Tiny_httpd_io/Writer/index.html @@ -0,0 +1,2 @@ + +Writer (tiny_httpd.Tiny_httpd_io.Writer)

Module Tiny_httpd_io.Writer

A writer abstraction.

type t = {
  1. write : Out_channel.t -> unit;
}

Writer.

A writer is a push-based stream of bytes. Give it an output channel and it will write the bytes in it.

This is useful for responses: an http endpoint can return a writer as its response's body, and output into it as if it were a regular out_channel, including controlling calls to flush.

  • since NEXT_RELEASE
val make : write:(Out_channel.t -> unit) -> unit -> t
val write : Out_channel.t -> t -> unit

Write into the channel.

val empty : t

Empty writer, will output 0 bytes.

val of_string : string -> t

A writer that just emits the bytes from the given string.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_io/index.html b/dev/tiny_httpd/Tiny_httpd_io/index.html index 4aeaf718..5debb293 100644 --- a/dev/tiny_httpd/Tiny_httpd_io/index.html +++ b/dev/tiny_httpd/Tiny_httpd_io/index.html @@ -1,2 +1,2 @@ -Tiny_httpd_io (tiny_httpd.Tiny_httpd_io)

Module Tiny_httpd_io

IO abstraction.

We abstract IO so we can support classic unix blocking IOs with threads, and modern async IO with Eio.

NOTE: experimental.

module Buf = Tiny_httpd_buf
module In_channel : sig ... end
module Out_channel : sig ... end
module TCP_server : sig ... end

A TCP server abstraction

\ No newline at end of file +Tiny_httpd_io (tiny_httpd.Tiny_httpd_io)

Module Tiny_httpd_io

IO abstraction.

We abstract IO so we can support classic unix blocking IOs with threads, and modern async IO with Eio.

NOTE: experimental.

module Buf = Tiny_httpd_buf
module In_channel : sig ... end

Input channel (byte source)

module Out_channel : sig ... end

Output channel (byte sink)

module Writer : sig ... end

A writer abstraction.

module TCP_server : sig ... end

A TCP server abstraction.

\ No newline at end of file diff --git a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html index b41f8d2a..b5c6e241 100644 --- a/dev/tiny_httpd/Tiny_httpd_server/Response/index.html +++ b/dev/tiny_httpd/Tiny_httpd_server/Response/index.html @@ -1,5 +1,5 @@ -Response (tiny_httpd.Tiny_httpd_server.Response)

Module Tiny_httpd_server.Response

type body = [
  1. | `String of string
  2. | `Stream of byte_stream
  3. | `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events notably).

type t = private {
  1. code : Response_code.t;
    (*

    HTTP response code. See Response_code.

    *)
  2. headers : Headers.t;
    (*

    Headers of the reply. Some will be set by Tiny_httpd automatically.

    *)
  3. body : body;
    (*

    Body of the response. Can be empty.

    *)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : (Headers.t -> Headers.t) -> t -> t

Modify headers.

  • since 0.11
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : +Response (tiny_httpd.Tiny_httpd_server.Response)

Module Tiny_httpd_server.Response

type body = [
  1. | `String of string
  2. | `Stream of byte_stream
  3. | `Writer of Tiny_httpd_io.Writer.t
  4. | `Void
]

Body of a response, either as a simple string, or a stream of bytes, or nothing (for server-sent events notably).

  • `String str replies with a body set to this string, and a known content-length.
  • `Stream str replies with a body made from this string, using chunked encoding.
  • `Void replies with no body.
  • `Writer w replies with a body created by the writer w, using a chunked encoding. It is available since NEXT_RELEASE.
type t = private {
  1. code : Response_code.t;
    (*

    HTTP response code. See Response_code.

    *)
  2. headers : Headers.t;
    (*

    Headers of the reply. Some will be set by Tiny_httpd automatically.

    *)
  3. body : body;
    (*

    Body of the response. Can be empty.

    *)
}

A response to send back to a client.

val set_body : body -> t -> t

Set the body of the response.

  • since 0.11
val set_header : string -> string -> t -> t

Set a header.

  • since 0.11
val update_headers : (Headers.t -> Headers.t) -> t -> t

Modify headers.

  • since 0.11
val set_headers : Headers.t -> t -> t

Set all headers.

  • since 0.11
val set_code : Response_code.t -> t -> t

Set the response code.

  • since 0.11
val make_raw : ?headers:Headers.t -> code:Response_code.t -> string -> t

Make a response from its raw components, with a string body. Use "" to not send a body at all.

val make_raw_stream : ?headers:Headers.t -> code:Response_code.t -> byte_stream -> @@ -9,7 +9,10 @@ t

make r turns a result into a response.

  • make (Ok body) replies with 200 and the body.
  • make (Error (code,msg)) replies with the given error code and message as body.
val make_string : ?headers:Headers.t -> (string, Response_code.t * string) Stdlib.result -> - t

Same as make but with a string body.

val make_stream : + t

Same as make but with a string body.

val make_writer : + ?headers:Headers.t -> + (Tiny_httpd_io.Writer.t, Response_code.t * string) Stdlib.result -> + t

Same as make but with a writer body.

val make_stream : ?headers:Headers.t -> (byte_stream, Response_code.t * string) Stdlib.result -> t

Same as make but with a stream body.

val fail : diff --git a/dev/tiny_httpd/Tiny_httpd_stream/index.html b/dev/tiny_httpd/Tiny_httpd_stream/index.html index 5958d82e..ce448efe 100644 --- a/dev/tiny_httpd/Tiny_httpd_stream/index.html +++ b/dev/tiny_httpd/Tiny_httpd_stream/index.html @@ -6,7 +6,7 @@ Bytes.blit self.bs self.off buf offset len; self.consume len; ); - len
val close : t -> unit

Close stream

val empty : t

Stream with 0 bytes inside

val of_input : ?buf_size:int -> Tiny_httpd_io.In_channel.t -> t

Make a buffered stream from the given channel.

  • since NEXT_RELEASE
val of_chan : ?buf_size:int -> Stdlib.in_channel -> t

Make a buffered stream from the given channel.

val of_chan_close_noerr : ?buf_size:int -> Stdlib.in_channel -> t

Same as of_chan but the close method will never fail.

val of_fd : ?buf_size:int -> Unix.file_descr -> t

Make a buffered stream from the given file descriptor.

val of_fd_close_noerr : ?buf_size:int -> Unix.file_descr -> t

Same as of_fd but the close method will never fail.

val of_bytes : ?i:int -> ?len:int -> bytes -> t

A stream that just returns the slice of bytes starting from i and of length len.

val of_string : string -> t
val iter : (bytes -> int -> int -> unit) -> t -> unit

Iterate on the chunks of the stream

  • since 0.3
val to_chan : Stdlib.out_channel -> t -> unit

Write the stream to the channel.

  • since 0.3
val to_chan' : Tiny_httpd_io.Out_channel.t -> t -> unit

Write to the IO channel.

  • since NEXT_RELEASE
val make : + len
val close : t -> unit

Close stream

val empty : t

Stream with 0 bytes inside

val of_input : ?buf_size:int -> Tiny_httpd_io.In_channel.t -> t

Make a buffered stream from the given channel.

  • since NEXT_RELEASE
val of_chan : ?buf_size:int -> Stdlib.in_channel -> t

Make a buffered stream from the given channel.

val of_chan_close_noerr : ?buf_size:int -> Stdlib.in_channel -> t

Same as of_chan but the close method will never fail.

val of_fd : ?buf_size:int -> Unix.file_descr -> t

Make a buffered stream from the given file descriptor.

val of_fd_close_noerr : ?buf_size:int -> Unix.file_descr -> t

Same as of_fd but the close method will never fail.

val of_bytes : ?i:int -> ?len:int -> bytes -> t

A stream that just returns the slice of bytes starting from i and of length len.

val of_string : string -> t
val iter : (bytes -> int -> int -> unit) -> t -> unit

Iterate on the chunks of the stream

  • since 0.3
val to_chan : Stdlib.out_channel -> t -> unit

Write the stream to the channel.

  • since 0.3
val to_chan' : Tiny_httpd_io.Out_channel.t -> t -> unit

Write to the IO channel.

  • since NEXT_RELEASE
val to_writer : t -> Tiny_httpd_io.Writer.t

Turn this stream into a writer.

  • since NEXT_RELEASE
val make : ?bs:bytes -> ?close:(t -> unit) -> consume:(t -> int -> unit) -> @@ -22,4 +22,8 @@ size:int -> too_short:(int -> unit) -> t -> - t

read_exactly ~size bs returns a new stream that reads exactly size bytes from bs, and then closes.

  • parameter close_rec

    if true, closing the resulting stream also closes bs

  • parameter too_short

    is called if bs closes with still n bytes remaining

val output_chunked : Stdlib.out_channel -> t -> unit

Write the stream into the channel, using the chunked encoding.

val output_chunked' : Tiny_httpd_io.Out_channel.t -> t -> unit

Write the stream into the channel, using the chunked encoding.

  • since NEXT_RELEASE
\ No newline at end of file + t

read_exactly ~size bs returns a new stream that reads exactly size bytes from bs, and then closes.

  • parameter close_rec

    if true, closing the resulting stream also closes bs

  • parameter too_short

    is called if bs closes with still n bytes remaining

val output_chunked : ?buf:Tiny_httpd_buf.t -> Stdlib.out_channel -> t -> unit

Write the stream into the channel, using the chunked encoding.

  • parameter buf

    optional buffer for chunking (since NEXT_RELEASE)

val output_chunked' : + ?buf:Tiny_httpd_buf.t -> + Tiny_httpd_io.Out_channel.t -> + t -> + unit

Write the stream into the channel, using the chunked encoding.

  • since NEXT_RELEASE
\ No newline at end of file