diff --git a/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html b/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html new file mode 100644 index 00000000..f62ccfb8 --- /dev/null +++ b/dev/tiny_httpd/Tiny_httpd_dir/Embedded_fs/index.html @@ -0,0 +1,2 @@ + +
Tiny_httpd_dir.Embedded_fsAn embedded file system, as a list of files with (relative) paths. This is useful in combination with the "tiny-httpd-mkfs" tool, which embeds the files it's given into a OCaml module.
val create : ?mtime:float -> unit -> tval add_file : ?mtime:float -> t -> path:string -> string -> unitAdd file to the virtual file system.
Tiny_httpd_dir.VFSVirtual file system.
This is used to emulate a file system from pure OCaml functions and data, e.g. for resources bundled inside the web server.
file_exists vfs path returns true if path points to a file or directory inside vfs.
List directory. This only returns basenames, the files need to be put in the directory path using Filename.concat.
Create a file and obtain a pair write, close
val read_file_content : string -> Tiny_httpd_stream.tRead content of a file
Tiny_httpd_htmlHTML 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.
module IO = Tiny_httpd_iomodule Out = Tiny_httpd_html_.OutOutput for HTML combinators.
type elt = Out.t -> unitA html element. It is represented by its output function, so we can directly print it.
Element with children, represented as a list.
A chunk of sub-elements, possibly empty.
Element with children, represented as a list of sub_elt to be flattened
val sub_empty : sub_eltSub-element with nothing inside. Useful in conditionals, when one decides not to emit a sub-element at all.
val txt : string -> eltEmit a string value, which will be escaped.
val txtf :
('a, Stdlib.Format.formatter, unit, Out.t -> unit) Stdlib.format4 ->
- 'bFormatted version of txt
val raw_html : string -> eltEmit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.
tag "menuitem", see mdn
tag "footer", see mdn
tag "footer", see mdn
tag "menu", see mdn
tag "menu", see mdn
tag "nav", see mdn
tag "nav", see mdn
module A = Tiny_httpd_html_.AAttributes.
val to_out_channel : ?top:bool -> elt -> IO.Out_channel.t -> unitWrite an HTML element to this out channel.
val to_string : ?top:bool -> elt -> stringConvert a HTML element to a string.
val to_string_l : elt list -> stringConvert 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 -> stringval to_out_channel_top : elt -> IO.Out_channel.t -> unitWrite a toplevel element to an output channel.
val to_writer : ?top:bool -> elt -> IO.Writer.tProduce a streaming writer from this HTML element.
val to_stream : elt -> Tiny_httpd_stream.tConvert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.
Formatted version of txt
val raw_html : string -> eltEmit raw HTML. Caution, this can lead to injection vulnerabilities, never use with text that comes from untrusted users.
tag "menuitem", see mdn
tag "footer", see mdn
tag "footer", see mdn
tag "menu", see mdn
tag "menu", see mdn
tag "nav", see mdn
tag "nav", see mdn
module A = Tiny_httpd_html_.AAttributes.
val to_out_channel : ?top:bool -> elt -> IO.Output.t -> unitWrite an HTML element to this out channel.
val to_string : ?top:bool -> elt -> stringConvert a HTML element to a string.
val to_string_l : elt list -> stringConvert 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 -> stringval to_out_channel_top : elt -> IO.Output.t -> unitWrite a toplevel element to an output channel.
val to_writer : ?top:bool -> elt -> IO.Writer.tProduce a streaming writer from this HTML element.
val to_stream : elt -> Tiny_httpd_stream.tConvert a HTML element to a stream. This might just convert it to a string first, do not assume it to be more efficient.