package tiny_httpd
Minimal HTTP server using threads
Install
Dune Dependency
Authors
Maintainers
Sources
tiny_httpd-0.17.0.tbz
sha256=67c636f1bbaf93da0cb0a12cb44803299892caf51e637815c753f0af6f4e7b7e
sha512=c254415a69df5a1bec255a223dbc2d10370b2f533da0b14ff458545da7aa5e4a634972272e7eef64425b6360494d6b3446761c03b49fd7558765cbfefae2178b
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 63
(** 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)"
>