Library
Module
Module type
Parameter
Class
Class type
Types and base definitions.
module Smap : sig ... end
Maps of strings.
module Sset : sig ... end
String sets.
module Imap : sig ... end
Maps over integers.
val mk_pp : ('a -> string) -> Format.formatter -> 'a -> unit
mk_pp f
creates a formatter -> x -> unit
function from the given x -> string
function.
string_of_list sep to_string l
is String.concat sep (List.map to_string l)
.
mk_of_string to_string l
returns a function mapping strings to values, according to the reverse function to_string
. Optional argument case_sensitive
(default is true
) indicates where case is taken into account when mapping from string to values. The returned function returns None
if the given string could not be mapped to a value, else Some value
.
type pos = Lexing.position
type 'a with_loc = 'a * loc
type 'a with_loc_option = 'a * loc option
val dummy_loc : Lexing.position * Lexing.position
val string_of_loc : (Lexing.position * Lexing.position) -> string
val string_of_loc_option : (Lexing.position * Lexing.position) option -> string
val pp_loc : Format.formatter -> (Lexing.position * Lexing.position) -> unit
val pp_loc_option :
Format.formatter ->
(Lexing.position * Lexing.position) option ->
unit
val pos_of_string_at :
?fname:string ->
?from:(int * Lexing.position) ->
string ->
int ->
Lexing.position
pos_of_string_at str at
returns the pos
corresponding to offset at
in the given string. Optional arguments:
fname
specifies a filename to use in the returned position.from
, as a pair (offset, p)
, specifies to start at offset
, using p
as initial pos
structure. The fname
in returned position still is the optiona fname
argument.val loc_of_string_at : string -> int -> Lexing.position * Lexing.position
A context is used in parsers to retrieve location information. get_pos
returns the current position. last_pos
returns the most advanced position seen. string_of_loc
returns the string corresponding to the given location.
val string_ctx : ?fname:string -> string -> ctx
string_ctx str
creates a context from the given string str
. Computing of pos
structure is cached. fname
can be specified to set this field in positions.
type parse_error =
| Unterminated_string
| Unterminated_comment
| Unterminated_char_escape
| Invalid_iri of string * Iri.error
| Other of string
Parsing errors.
exception Error of error
val string_of_parse_error : parse_error -> string
val pp_error : Format.formatter -> error -> unit
val error : error -> 'a
A 'a p_value
is either a global keyword, a variable (`Var (name, optional string value)
) or a value (`V 'a
). We do not know at variable definition time in which property this variable will be used. The parser associated to a property will parse the optional default variable value when the variable is expanded.
val string_of_p_value : ('a -> string) -> 'a p_value -> string
val pp_p_value :
(Format.formatter -> 'a -> unit) ->
Format.formatter ->
'a p_value ->
unit
Parsed strings, with a quoted
flag indicating whether string is quoted.
val string_of_str : str -> string
val pp_str : Format.formatter -> str -> unit
val string_of_side : side -> string
val pp_number : Format.formatter -> float -> unit
type rel_length_unit = [
| `em
Font size of the element.
*)| `ex
x-height of the element's font.
*)| `cap
Cap height (the nominal height of capital letters) of the element's font.
*)| `ch
Average character advance of a narrow glyph in the element's font, as represented by the "0" (ZERO, U+0030) glyph.
*)| `ic
Average character advance of a full width glyph in the element's font, as represented by the "水" (CJK water ideograph, U+6C34) glyph.
*)| `rem
Font size of the root element.
*)| `lh
Line height of the element.
*)| `rlh
Line height of the root element.
*)| `vw
1% of viewport's width.
*)| `vh
1% of viewport's height.
*)| `vi
1% of viewport's size in the root element's inline axis.
*)| `vb
1% of viewport's size in the root element's block axis.
*)| `vmin
1% of viewport's smaller dimension.
*)| `vmax
1% of viewport's larger dimension.
*)| `cqw
1% of a query container's width
*)| `cqh
1% of a query container's height
*)| `cqi
1% of a query container's inline size
*)| `cqb
1% of a query container's block size
*)| `cqmin
The smaller value of cqi or cqb
*)| `cqmax
The larger value of cqi or cqb
*) ]
val string_of_rel_length_unit : rel_length_unit -> string
val string_of_abs_length_unit : abs_length_unit -> string
val string_of_length_unit : length_unit -> string
val pp_length_unit : Format.formatter -> length_unit -> unit
val string_of_angle_unit : angle_unit -> string
val pp_angle_unit : Format.formatter -> angle_unit -> unit
type angle = number * angle_unit
val string_of_angle : (float * angle_unit) -> string
val pp_angle : Format.formatter -> (float * angle_unit) -> unit
val string_of_time_unit : time_unit -> string
val pp_time_unit : Format.formatter -> time_unit -> unit
val string_of_freq_unit : freq_unit -> string
val pp_freq_unit : Format.formatter -> freq_unit -> unit
val string_of_flex_unit : flex_unit -> string
val pp_flex_unit : Format.formatter -> flex_unit -> unit
val string_of_resolution_unit : resolution_unit -> string
val pp_resolution_unit : Format.formatter -> resolution_unit -> unit
val string_of_dim_unit : dim_unit -> string
val pp_dim_unit : Format.formatter -> dim_unit -> unit
val string_of_dimension : float -> dim_unit -> string
val string_of_system_color : system_color -> string
val pp_system_color : Format.formatter -> system_color -> unit
val system_color_of_string : string -> system_color option
val color_kws : color_kw list
type color = [
| `Rgba of float * float * float * float
| `Named_color of string
| `System_color of system_color
| color_kw
]
val string_of_color : color -> string
val pp_color : Format.formatter -> color -> unit
val trblc_kws : trblc list
val string_of_trblc : [< trblc ] -> string
val string_of_x_position_kw : x_position_kw -> string
val string_of_y_position_kw : y_position_kw -> string
val string_of_percentage : percentage -> string
val string_of_length : float -> length_unit -> string
val pp_length : Format.formatter -> (float * length_unit) -> unit
val string_of_length_percentage : length_percentage -> string
val pp_length_percentage : Format.formatter -> length_percentage -> unit
type x_position = x_position_kw axis_pos
type y_position = y_position_kw axis_pos
val string_of_x_position : x_position -> string
val string_of_y_position : y_position -> string
val string_of_axis_position : axis_position -> string
val pp_axis_position : Format.formatter -> axis_position -> unit
val string_of_p_number : float p_value -> string
val size_kws : size_kw list
val string_of_size : size -> string
val pp_size : Format.formatter -> size -> unit
val max_size_kws : max_size_kw list
val string_of_max_size : max_size -> string
val pp_max_size : Format.formatter -> max_size -> unit
val string_of_url : Iri.t -> string
val pp_url : Format.formatter -> Iri.t -> unit
val line_styles : line_style list
val string_of_line_style : line_style -> string
val pp_line_style : Format.formatter -> line_style -> unit
val string_of_gradient : gradient -> string
val pp_gradient : Format.formatter -> gradient -> unit
val string_of_image : image -> string
val pp_image : Format.formatter -> image -> unit
val string_of_value : value -> string
val pp_value : Format.formatter -> value -> unit
val accent_color_kws : accent_color_kw list
val string_of_accent_color : accent_color -> string
val pp_accent_color : Format.formatter -> accent_color -> unit
val baseline_position_kws : baseline_position_kw list
val string_of_baseline_position : baseline_position -> string
val pp_baseline_position : Format.formatter -> baseline_position -> unit
type content_position = content_position_kw
val string_of_content_position : content_position -> string
val pp_content_position : Format.formatter -> content_position -> unit
type content_position_lr = content_position_lr_kw
val string_of_content_position_lr : content_position_lr -> string
val pp_content_position_lr : Format.formatter -> content_position_lr -> unit
type self_position = self_position_kw
val string_of_self_position : self_position -> string
val pp_self_position : Format.formatter -> self_position -> unit
type self_position_lr = self_position_lr_kw
val string_of_self_position_lr : self_position_lr -> string
val pp : 'a -> Format.formatter -> self_position_lr -> unit
type content_distribution = content_distribution_kw
val string_of_content_distribution : content_distribution -> string
val pp_content_distribution : Format.formatter -> content_distribution -> unit
val align_content_kws : align_content_kw list
type align_content = [
| align_content_kw
| baseline_position
| content_distribution
| content_position
| `Safe_pos of content_position
| `Unsafe_pos of content_position
]
val string_of_align_content : align_content -> string
val pp_align_content : Format.formatter -> align_content -> unit
val align_items_kws : align_items_kw list
type align_items = [
| baseline_position
| self_position
| `Safe_self_pos of self_position
| `Unsafe_self_pos of self_position
| align_items_kw
]
val string_of_align_items : align_items -> string
val pp_align_items : Format.formatter -> align_items -> unit
val align_self_kws : align_self_kw list
val string_of_align_self : align_self -> string
val pp_align_self : Format.formatter -> align_self -> unit
val aspect_ratio_kws : aspect_ratio_kw list
val string_of_aspect_ratio : aspect_ratio -> string
val pp_aspect_ratio : Format.formatter -> aspect_ratio -> unit
val background_attachment_kws : background_attachment_kw list
type background_attachment_ = background_attachment_kw
type background_attachment = background_attachment_ list
val string_of_background_attachment : background_attachment -> string
val pp_background_attachment :
Format.formatter ->
background_attachment ->
unit
val background_clip_kws : background_clip_kw list
type background_clip_ = background_clip_kw
type background_clip = background_clip_ list
val string_of_background_clip : background_clip -> string
val pp_background_clip : Format.formatter -> background_clip -> unit
val background_image_kws : background_image_kw list
val string_of_background_image_ : background_image_ -> string
type background_image = background_image_ list
val string_of_background_image : background_image -> string
val pp_background_image : Format.formatter -> background_image -> unit
val background_origin_kws : background_origin_kw list
type background_origin_ = background_origin_kw
type background_origin = background_origin_ list
val string_of_background_origin : background_origin -> string
val pp_background_origin : Format.formatter -> background_origin -> unit
type background_position_x = x_position list
val string_of_background_position_x : background_position_x -> string
val pp_background_position_x :
Format.formatter ->
background_position_x ->
unit
type background_position_y = y_position list
val string_of_background_position_y : background_position_y -> string
val pp_background_position_y :
Format.formatter ->
background_position_y ->
unit
val repeat_kws : repeat list
val string_of_repeat : repeat -> string
val pp_repeat : Format.formatter -> repeat -> unit
val background_repeat_kws : background_repeat_kw list
type background_repeat = background_repeat_ list
val string_of_background_repeat : background_repeat -> string
val pp_background_repeat : Format.formatter -> background_repeat -> unit
val background_size_kws : background_size_kw list
val string_of_background_size_ : background_size_ -> string
type background_size = (background_size_ * background_size_) list
val string_of_background_size : background_size -> string
val pp_background_size : Format.formatter -> background_size -> unit
type background_color = color
val string_of_background_color : color -> string
val pp_background_color : Format.formatter -> color -> unit
type width = size
val string_of_width : size -> string
val pp_width : Format.formatter -> size -> unit
val border_width_kws : border_width_kw list
val string_of_border_width : border_width -> string
val pp_border_width : Format.formatter -> border_width -> unit
val display_outside_kws : display_outside list
val display_flow_kws : display_flow list
val display_inside_kws : display_inside list
type display_listitem = display_outside * display_flow
val display_listitem_kws : display_listitem_kw list
val display_internal_kws : display_internal list
val display_box_kws : display_box list
type display_out_in = display_outside * display_inside * [ `List_item ] option
val string_of_display : display -> string
val pp_display : Format.formatter -> display -> unit
val flex_basis_kws : flex_basis_kw list
val string_of_flex_basis : flex_basis -> string
val pp_flex_basis : Format.formatter -> flex_basis -> unit
val flex_direction_kws : flex_direction_kw list
type flex_direction = flex_direction_kw
val string_of_flex_direction : flex_direction -> string
val pp_flex_direction : Format.formatter -> flex_direction -> unit
val flex_wrap_kws : flex_wrap_kw list
type flex_wrap = flex_wrap_kw
val string_of_flex_wrap : flex_wrap -> string
val pp_flex_wrap : Format.formatter -> flex_wrap -> unit
val font_family_generic_kws : font_family_generic_kw list
val string_of_font_family_ : font_family_ -> string
type font_family = font_family_ list
val string_of_font_family : font_family -> string
val pp_font_family : Format.formatter -> font_family -> unit
val font_kerning_kws : font_kerning list
val string_of_font_kerning : font_kerning -> string
val pp_font_kerning : Format.formatter -> font_kerning -> unit
val font_size_kws : font_size_kw list
val string_of_font_size : font_size -> string
val pp_font_size : Format.formatter -> font_size -> unit
val font_stretch_kws : font_stretch_kw list
val string_of_font_stretch : font_stretch -> string
val pp_font_stretch : Format.formatter -> font_stretch -> unit
val font_style_kws : font_style_kw list
val string_of_font_style : font_style -> string
val pp_font_style : Format.formatter -> font_style -> unit
val string_of_font_variant_alternates : font_variant_alternates -> string
val pp_font_variant_alternates :
Format.formatter ->
font_variant_alternates ->
unit
val font_variant_caps_kws : font_variant_caps list
val string_of_font_variant_caps : font_variant_caps -> string
val pp_font_variant_caps : Format.formatter -> font_variant_caps -> unit
val font_variant_east_asian_kws : font_variant_east_asian_kw list
val string_of_font_variant_east_asian : font_variant_east_asian -> string
val pp_font_variant_east_asian :
Format.formatter ->
font_variant_east_asian ->
unit
val font_variant_emoji_kws : font_variant_emoji list
val string_of_font_variant_emoji : font_variant_emoji -> string
val pp_font_variant_emoji : Format.formatter -> font_variant_emoji -> unit
val string_of_font_variant_ligatures : font_variant_ligatures -> string
val pp_font_variant_ligatures :
Format.formatter ->
font_variant_ligatures ->
unit
val string_of_font_variant_numeric : font_variant_numeric -> string
val pp_font_variant_numeric : Format.formatter -> font_variant_numeric -> unit
val font_variant_position_kws : font_variant_position list
val string_of_font_variant_position : font_variant_position -> string
val pp_font_variant_position :
Format.formatter ->
font_variant_position ->
unit
val string_of_font_weight : font_weight -> string
val pp_font_weight : Format.formatter -> font_weight -> unit
val line_height_kws : line_height_kw list
val string_of_line_height : line_height -> string
val pp_line_height : Format.formatter -> line_height -> unit
type system_font = {
family : font_family_ list;
size : font_size;
stretch : font_stretch;
style : font_style;
variant_alternates : font_variant_alternates;
variant_caps : font_variant_caps;
variant_east_asian : font_variant_east_asian;
variant_emoji : font_variant_emoji;
variant_ligatures : font_variant_ligatures;
variant_numeric : font_variant_numeric;
variant_position : font_variant_position;
weight : font_weight;
line_height : line_height;
}
val system_font :
?stretch:font_stretch ->
?style:font_style ->
?variant_alternates:font_variant_alternates ->
?variant_caps:font_variant_caps ->
?variant_east_asian:font_variant_east_asian ->
?variant_emoji:font_variant_emoji ->
?variant_ligatures:font_variant_ligatures ->
?variant_numeric:font_variant_numeric ->
?variant_position:font_variant_position ->
?weight:font_weight ->
?line_height:line_height ->
font_size ->
font_family_ list ->
system_font
val system_font_names : system_font_name list
module Sys_font_map : sig ... end
val system_fonts_r : system_font Sys_font_map.t ref
val set_system_font : Sys_font_map.key -> system_font -> unit
val get_system_font : Sys_font_map.key -> system_font option
val font_stretch_css3 : font_stretch_kw list
val justify_content_kws : justify_content_kw list
type justify_content = [
| justify_content_kw
| content_distribution
| content_position_lr
| `Safe_pos_lr of content_position_lr
| `Unsafe_pos_lr of content_position_lr
]
val string_of_justify_content : justify_content -> string
val pp_justify_content : Format.formatter -> justify_content -> unit
type height = size
val string_of_height : size -> string
val pp_height : Format.formatter -> size -> unit
val justify_items_kws : justify_items_kw list
type justify_items = [
| baseline_position
| self_position_lr
| `Safe_self_pos_lr of self_position_lr
| `Unsafe_self_pos_lr of self_position_lr
| `Legacy_lcr of [ `Left | `Center | `Right ]
| justify_items_kw
]
val string_of_justify_items : justify_items -> string
val pp_justify_items : Format.formatter -> justify_items -> unit
val justify_self_kws : justify_self_kw list
type justify_self = [
| baseline_position
| self_position_lr
| `Safe_self_pos_lr of self_position_lr
| `Unsafe_self_pos_lr of self_position_lr
| `Legacy_lcr of [ `Left | `Center | `Right ]
| justify_self_kw
]
val string_of_justify_self : justify_self -> string
val pp_justify_self : Format.formatter -> justify_self -> unit
val list_style_image_kws : list_style_image_kw list
val string_of_list_style_image : list_style_image -> string
val pp_list_style_image : Format.formatter -> list_style_image -> unit
val list_style_position_kws : list_style_position_kw list
type list_style_position = list_style_position_kw
val string_of_list_style_position : list_style_position -> string
val pp_list_style_position : Format.formatter -> list_style_position -> unit
val list_style_type_kws : list_style_type_kw list
type list_style_type = [
| list_style_type_kw
| `Ident_ of string
| `String_ of string
| `Symbols_ of string
]
val string_of_list_style_type : list_style_type -> string
val pp_list_style_type : Format.formatter -> list_style_type -> unit
val margin_kws : margin_kw list
val string_of_margin : margin -> string
val pp_margin : Format.formatter -> margin -> unit
type padding = length_percentage
val string_of_padding : padding -> string
val pp_padding : Format.formatter -> padding -> unit
val position_kws : position_kw list
type position = position_kw
val string_of_position : position -> string
val pp_position : Format.formatter -> position -> unit
val text_align_kws : text_align_kw list
type text_align = text_align_kw
val string_of_text_align : text_align -> string
val pp_text_align : Format.formatter -> text_align -> unit
val text_align_last_kws : text_align_last_kw list
type text_align_last = text_align_last_kw
val string_of_text_align_last : text_align_last -> string
val pp_text_align_last : Format.formatter -> text_align_last -> unit
val vertical_align_kws : vertical_align_kw list
val string_of_vertical_align : vertical_align -> string
val pp_vertical_align : Format.formatter -> vertical_align -> unit
val visibility_kws : visibility_kw list
type visibility = visibility_kw
val string_of_visibility : visibility -> string
val pp_visibilty : Format.formatter -> visibility -> unit
val white_space_kws : white_space_kw list
type white_space = white_space_kw
val string_of_white_space : white_space -> string
val pp_white_space : Format.formatter -> white_space -> unit
val word_spacing_kws : word_spacing_kw list
val string_of_word_spacing : word_spacing -> string
val pp_word_spacing : Format.formatter -> word_spacing -> unit