package tiny_httpd
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Minimal HTTP server using threads
Install
dune-project
Dependency
Authors
Maintainers
Sources
tiny_httpd-0.22.tbz
sha256=09fb93125c26b99f8714d0060dd3fb972046cde3ff935626d495b25e80543d8e
sha512=5751a0ac007c8cad11255d08b4915c8a8fb82ad33d28e58809ef1e29dc8c8f2fceb0dd15ecbe1fda5b5db2edbbc9479fa1d0690a4a25949e1d1b375ea13bd1a9
doc/src/tiny_httpd.html/Tiny_httpd_html.ml.html
Source file Tiny_httpd_html.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62(** 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 *) include Html_ (** @inline *) (** Write an HTML element to this output. @param top if true, add DOCTYPE at the beginning. The top element should then be a "html" tag. @since 0.14 *) let to_output ?(top = false) (self : elt) (out : #IO.Output.t) : unit = let out = Out.create_of_out out in if top then Out.add_string out "<!DOCTYPE html>\n"; self out; Out.add_format_nl out; Out.flush out (** Convert a HTML element to a string. @param top if true, add DOCTYPE at the beginning. The top element should then be a "html" tag. *) let to_string ?top (self : elt) : string = let buf = Buffer.create 64 in let out = IO.Output.of_buffer buf in to_output ?top self out; Buffer.contents buf (** 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. *) let to_string_l (l : elt list) = let buf = Buffer.create 64 in let out = Out.create_of_buffer buf in List.iter (fun f -> f out; Out.add_format_nl out) l; Buffer.contents buf let to_string_top = to_string ~top:true (** Write a toplevel element to an output channel. @since 0.14 *) let to_out_channel_top = to_output ~top:true (** Produce a streaming writer from this HTML element. @param top if true, add a DOCTYPE. See {!to_out_channel}. @since 0.14 *) let to_writer ?top (self : elt) : IO.Writer.t = let write (oc : #IO.Output.t) = to_output ?top self oc in IO.Writer.make ~write () (** Convert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient. *) let[@inline] to_stream (self : elt) : IO.Input.t = IO.Input.of_string @@ to_string self
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>