module Columns: sig
.. end
The basic units of visual information in a tournabox UI. Columns
are short lists of textual fragments, each element of which may
have css classes. This allows us to do things like style the number
"6" in the column "in round 6."
Each column may specify whether or not filter text applies to it,
that is, whether it is "filterable."
Functions exist to render columns as HTML and to test them against
filter text.
type
shallow_span = {
|
class_name : string ; |
|
text : string ; |
}
A non-nested html span with a css class.
type
column_fragment =
The atomic element of a column.
type
column = {
|
content : column_fragment list ; |
|
class_name : string option ; |
|
should_filter : bool ; |
}
A column in the UI.
= {
}
A header column of a group
val column_content_string : column_fragment list -> string
Get The content of a column as a string
val is_upset : column list -> bool
val entry : ?filterable:bool -> Entry.t -> column
Render an entry as a complex column, including country and
seed.
val just_country : string -> column
Get a column containing just a country name
: column -> column
Adds a header class to an existing column, thereby treating it as
a header.
val in_round : int -> column
"In round N"
val advanced : column
"advanced"
val with_a_bye : column
"With a bye"
val defeated : winner:Entry.t -> Entry.t -> column
Renders either a "defeated" or "upset" column, based on seed
disparity.
val was_defeated_by : winner:Entry.t -> Entry.t -> column
Renders either a "defeated" or "upset" column, based on seed
disparity.
val will_face : column
"will face"
val to_be_decided : column
"to be decided"
val plain : should_filter:bool -> string -> column
Just a plain string