package weberizer
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Weberizer.Binding
Source
Mutable value holding a collection of mappings from names of variables to their values (both being strings).
Not_found var
is raised if the variable var
is not found in the binding.
copy b
returns a new collection of bindings initially containing the same bindings as b
.
val fun_html :
t ->
string ->
(< content : html ; page : html > -> string list -> html) ->
unit
fun_html b var f
add to the binding var
-> f
to b
. At each occurrence of var
, f ctx args
will be executed and its output will replace current HTML tag (or its content, depending on whether ml:strip
was set or not). ctx
is an object giving some "context". ctx#content
is the html that is inside the tag and which is going to be replaced. It can be used as a structured argument. ctx#page
returns the whole HTML page — this can be useful to generate a table of content for example.
fun_string b var f
add to the binding var
-> f
to b
. See fun_html
for the arguments of f
.