vxml_pipeline/core
Core desugarer and pipeline types, errors, warnings, and VXML utilities.
Types
One named VXML -> VXML transformation step.
pub type Desugarer {
Desugarer(
name: String,
stringified_param: option.Option(String),
stringified_outside: option.Option(String),
transform: fn(vxml.VXML) -> Result(
#(vxml.VXML, List(DesugaringWarning)),
DesugaringError,
),
)
}
Constructors
-
Desugarer( name: String, stringified_param: option.Option(String), stringified_outside: option.Option(String), transform: fn(vxml.VXML) -> Result( #(vxml.VXML, List(DesugaringWarning)), DesugaringError, ), )
pub type DesugarerTransform =
fn(vxml.VXML) -> Result(
#(vxml.VXML, List(DesugaringWarning)),
DesugaringError,
)
pub type DesugaringError {
DesugaringError(blame: blame.Blame, message: String)
}
Constructors
-
DesugaringError(blame: blame.Blame, message: String)
pub type DesugaringWarning {
DesugaringWarning(blame: blame.Blame, message: String)
}
Constructors
-
DesugaringWarning(blame: blame.Blame, message: String)
pub type LatexDelimiterPair {
DoubleDollar
SingleDollar
BackslashParenthesis
BackslashSquareBracket
BeginEndAlign
BeginEndAlignStar
BeginEndEnvironment(name: String)
}
Constructors
-
DoubleDollar -
SingleDollar -
BackslashParenthesis -
BackslashSquareBracket -
BeginEndAlign -
BeginEndAlignStar -
BeginEndEnvironment(name: String)
pub type LatexDelimiterSingleton {
DoubleDollarSingleton
SingleDollarSingleton
BackslashOpeningParenthesis
BackslashClosingParenthesis
BackslashOpeningSquareBracket
BackslashClosingSquareBracket
BeginAlign
EndAlign
BeginAlignStar
EndAlignStar
BeginEnvironment(name: String)
EndEnvironment(name: String)
}
Constructors
-
DoubleDollarSingleton -
SingleDollarSingleton -
BackslashOpeningParenthesis -
BackslashClosingParenthesis -
BackslashOpeningSquareBracket -
BackslashClosingSquareBracket -
BeginAlign -
EndAlign -
BeginAlignStar -
EndAlignStar -
BeginEnvironment(name: String) -
EndEnvironment(name: String)
The ordered VXML -> VXML transformation stage, not the full render loop.
pub type Pipeline =
List(Desugarer)
pub type SelectorError {
EmptyTag
InvalidTag
InvalidKey
}
Constructors
-
EmptyTag -
InvalidTag -
InvalidKey
pub type SingletonError {
MoreThanOne
LessThanOne
}
Constructors
-
MoreThanOne -
LessThanOne
pub type TrafficLight {
Continue
GoBack
}
Constructors
-
Continue -
GoBack
Values
pub fn aggregate_on_first(
l: List(#(a, b)),
) -> dict.Dict(a, List(b))
pub fn append_if_not_present(items: List(a), item: a) -> List(a)
pub fn assert_drop_last(z: List(a)) -> List(a)
pub fn assert_drop_prefix(s: String, prefix: String) -> String
pub fn assert_split_style(
style: String,
) -> List(#(String, String))
pub fn attrs_append_classes(
attrs: List(vxml.Attr),
blame: blame.Blame,
classes: String,
) -> List(vxml.Attr)
pub fn attrs_extract_first(
attrs: List(vxml.Attr),
key: String,
) -> #(option.Option(vxml.Attr), List(vxml.Attr))
pub fn attrs_extract_key_occurrences(
attrs: List(vxml.Attr),
key: String,
) -> #(List(vxml.Attr), List(vxml.Attr))
pub fn attrs_extract_key_val(
attrs: List(vxml.Attr),
key: String,
val: String,
) -> #(List(vxml.Attr), List(vxml.Attr))
pub fn attrs_extract_unique_key_or_none(
attrs: List(vxml.Attr),
key: String,
) -> Result(
#(option.Option(vxml.Attr), List(vxml.Attr)),
DesugaringError,
)
pub fn attrs_first_with_key(
attrs: List(vxml.Attr),
key: String,
) -> option.Option(vxml.Attr)
pub fn attrs_have_class(
attrs: List(vxml.Attr),
class: String,
) -> Bool
pub fn attrs_have_key(
attrs: List(vxml.Attr),
key: String,
) -> Bool
pub fn attrs_have_key_val(
attrs: List(vxml.Attr),
key: String,
val: String,
) -> Bool
pub fn attrs_merge_prepend_styles(
attrs: List(vxml.Attr),
blame: blame.Blame,
styles: String,
) -> List(vxml.Attr)
pub fn attrs_merge_styles(
attrs: List(vxml.Attr),
blame: blame.Blame,
styles: String,
) -> List(vxml.Attr)
pub fn attrs_set(
attrs: List(vxml.Attr),
blame: blame.Blame,
key: String,
val: String,
) -> List(vxml.Attr)
pub fn attrs_unique_key_or_none(
attrs: List(vxml.Attr),
key: String,
) -> Result(option.Option(vxml.Attr), DesugaringError)
pub fn attrs_val_first_with_key(
attrs: List(vxml.Attr),
key: String,
) -> option.Option(String)
pub fn attrs_val_first_with_key_expected(
attrs: List(vxml.Attr),
key: String,
blame: blame.Blame,
) -> Result(String, DesugaringError)
pub fn attrs_val_of_unique_key(
attrs: List(vxml.Attr),
key: String,
blame: blame.Blame,
) -> Result(String, DesugaringError)
pub fn break_out_first_word(input: String) -> #(String, String)
“word” == “non-whitespace” == empty string if string starts with whitespace
returns: -> #(before_first_space, everything_afterwards)
pub fn compose_style(keyvals: List(#(String, String))) -> String
pub fn descendant_text_contains(v: vxml.VXML, s: String) -> Bool
pub fn descendant_text_does_not_contain(
vxml: vxml.VXML,
s: String,
) -> Bool
pub fn dict_from_list(
l: List(#(a, b)),
) -> Result(dict.Dict(a, b), DesugaringError)
pub fn drop_ending_slash(path: String) -> String
pub fn drop_prefix(s: String, prefix: String) -> String
pub fn drop_suffix(s: String, suffix: String) -> String
pub fn ensure_prefix(s: String, prefix: String) -> String
pub fn ensure_suffix(s: String, suffix: String) -> String
pub fn expand_selector_shorthand(
shorthand: String,
) -> Result(vxml.VXML, SelectorError)
pub fn extract_first_word_from_t_node_if_t(
vxml: vxml.VXML,
) -> #(option.Option(vxml.VXML), vxml.VXML)
“word” == “non-whitespace” == empty string if node starts with whitespace
returns -> #( Option(new T(..) containing first word), node leftover with word taken out, )
pub fn extract_last_word_from_t_node_if_t(
vxml: vxml.VXML,
) -> #(vxml.VXML, option.Option(vxml.VXML))
“word” == “non-whitespace” == empty string if node ends with whitespace
returns -> #( node leftover with last word taken out, Option(new T(..) containing last word), )
pub fn extract_trim_end(content: String) -> #(String, String)
pub fn extract_trim_start(content: String) -> #(String, String)
pub fn first_line_ends_with(
lines: List(vxml.Line),
s: String,
) -> Bool
pub fn first_line_starts_with(
lines: List(vxml.Line),
s: String,
) -> Bool
pub fn first_with_tag(
nodes: List(vxml.VXML),
tag: String,
) -> option.Option(vxml.VXML)
pub fn from_tag(
blame: blame.Blame,
tag: String,
) -> Result(vxml.VXML, DesugaringError)
pub fn get_contained(
from: List(a),
in: List(a),
) -> option.Option(a)
pub fn get_duplicate(list: List(a)) -> option.Option(a)
pub fn html_info_shorthand_to_attrs(
blame: blame.Blame,
info: String,
) -> Result(
#(
option.Option(vxml.Attr),
option.Option(vxml.Attr),
option.Option(vxml.Attr),
option.Option(vxml.Attr),
),
String,
)
pub fn insert_before_first(
list: List(a),
elt: a,
condition: fn(a) -> Bool,
) -> List(a)
pub fn insert_child_before_first_in_list(
nodes: List(vxml.VXML),
child: vxml.VXML,
before: String,
) -> List(vxml.VXML)
pub fn insert_in_list_pair_as_dict(
list_pairs: List(#(a, b)),
item: #(a, b),
) -> List(#(a, b))
pub fn invalid_tag(tag: String) -> Bool
pub fn is_t_and_text_contains(
vxml: vxml.VXML,
content: String,
) -> Bool
pub fn is_t_or_is_one_of(
node: vxml.VXML,
tags: List(String),
) -> Bool
pub fn is_v_and_has_attr_with_key(
vxml: vxml.VXML,
key: String,
) -> Bool
pub fn is_v_and_has_class(vxml: vxml.VXML, class: String) -> Bool
pub fn is_v_and_tag_equals(vxml: vxml.VXML, tag: String) -> Bool
pub fn is_v_and_tag_is_not_one_of(
vxml: vxml.VXML,
tags: List(String),
) -> Bool
pub fn is_v_and_tag_is_one_of(
vxml: vxml.VXML,
tags: List(String),
) -> Bool
pub fn is_v_and_tag_not_equals(
vxml: vxml.VXML,
tag: String,
) -> Bool
pub fn kebab_case_to_camel_case(input: String) -> String
pub fn last_to_first_concatenation_in_list_list_lines(
l: List(List(vxml.Line)),
) -> List(vxml.Line)
pub fn last_to_first_concatenation_in_list_list_of_lines_where_all_but_last_list_are_already_reversed(
list_of_lists: List(List(vxml.Line)),
) -> List(vxml.Line)
pub fn latex_inline_delimiters() -> List(LatexDelimiterPair)
pub fn latex_strippable_delimiter_pairs() -> List(
LatexDelimiterPair,
)
pub fn latex_strippable_display_delimiters() -> List(
LatexDelimiterPair,
)
pub fn lines_are_whitespace(lines: List(vxml.Line)) -> Bool
pub fn lines_contain(lines: List(vxml.Line), s: String) -> Bool
pub fn lines_first_blame(lines: List(vxml.Line)) -> blame.Blame
pub fn lines_total_chars(lines: List(vxml.Line)) -> Int
pub fn list_param_stringifier(param: List(p)) -> String
pub fn list_string_stringifier(param: List(String)) -> String
pub fn merge_classes(a: String, b: String) -> String
pub fn merge_styles(a: String, b: String) -> String
pub fn normalize_spaces(s: String) -> String
pub fn not_contains(list: List(a), element: a) -> Bool
pub fn on_t_on_v(
node: vxml.VXML,
f1: fn(blame.Blame, List(vxml.Line)) -> c,
f2: fn(blame.Blame, String, List(vxml.Attr), List(vxml.VXML)) -> c,
) -> c
pub fn opening_and_closing_delimiter_strings(
delimiters: List(LatexDelimiterPair),
) -> #(List(String), List(String))
pub fn opening_and_closing_singletons_for_pair(
pair: LatexDelimiterPair,
) -> #(LatexDelimiterSingleton, LatexDelimiterSingleton)
pub fn opening_and_closing_string_for_pair(
pair: LatexDelimiterPair,
) -> #(String, String)
pub fn optional_style_extract_unique_key_or_none(
style_attr: option.Option(vxml.Attr),
key: String,
) -> Result(
#(option.Option(String), option.Option(vxml.Attr)),
DesugaringError,
)
pub fn pour(from: List(a), into: List(a)) -> List(a)
dumps the contents of ‘from’ “upside-down” into ‘into’, so that the first element of ‘from’ ends up buried inside the resulting list, while the last element of ‘from’ ends up surfaced as the first element of the result
pub fn pour_before_first(
list: List(a),
to_pour: List(a),
condition: fn(a) -> Bool,
) -> List(a)
pub fn pour_before_first_in_list(
nodes: List(vxml.VXML),
to_insert: List(vxml.VXML),
before: String,
) -> List(vxml.VXML)
pub fn pour_but_last(
from: List(a),
into: List(a),
) -> #(List(a), a)
pub fn prefix_partition(
list: List(a),
condition: fn(a) -> Bool,
) -> #(List(a), List(a))
pub fn quad_drop_3rd(t: #(a, b, c, d)) -> #(a, b, d)
pub fn quad_drop_4th(t: #(a, b, c, d)) -> #(a, b, c)
pub fn quad_to_pair(t: #(a, b, c, d)) -> #(a, #(b, c, d))
pub fn quad_to_pair_pair(t: #(a, b, c, d)) -> #(#(a, b), #(c, d))
pub fn quads_to_pair_pairs(
l: List(#(a, b, c, d)),
) -> List(#(#(a, b), #(c, d)))
pub fn quads_to_pairs(
l: List(#(a, b, c, d)),
) -> List(#(a, #(b, c, d)))
pub fn read_singleton(z: List(a)) -> Result(a, SingletonError)
pub fn remove_class(classes: String, class: String) -> String
pub fn string_pair_to_attr(
pair: #(String, String),
blame: blame.Blame,
) -> vxml.Attr
pub fn string_pairs_to_attrs(
pairs: List(#(String, String)),
blame: blame.Blame,
) -> List(vxml.Attr)
pub fn style_extract_unique_key_or_none(
style: String,
key: String,
blame: blame.Blame,
) -> Result(#(option.Option(String), String), DesugaringError)
pub fn substitute_in_class_attr(
attrs: List(vxml.Attr),
from: String,
to: String,
) -> List(vxml.Attr)
pub fn suffix_partition(
l: List(a),
condition: fn(a) -> Bool,
) -> #(List(a), List(a))
pub fn supplement_in_class_attr(
attrs: List(vxml.Attr),
if_this_is_there: String,
then_add: String,
) -> List(vxml.Attr)
pub fn t_extract_ending_spaces(
node: vxml.VXML,
) -> #(option.Option(vxml.VXML), vxml.VXML)
pub fn t_extract_starting_spaces(
node: vxml.VXML,
) -> #(option.Option(vxml.VXML), vxml.VXML)
pub fn t_remove_ending_empty_lines(
vxml: vxml.VXML,
) -> option.Option(vxml.VXML)
pub fn t_remove_starting_empty_lines(
vxml: vxml.VXML,
) -> option.Option(vxml.VXML)
pub fn t_trim_end(node: vxml.VXML) -> option.Option(vxml.VXML)
pub fn t_trim_start(node: vxml.VXML) -> option.Option(vxml.VXML)
pub fn total_chars(vxml: vxml.VXML) -> Int
pub fn triple_3rd(t: #(a, b, c)) -> c
pub fn triple_drop_2nd(t: #(a, b, c)) -> #(a, c)
pub fn triple_drop_3rd(t: #(a, b, c)) -> #(a, b)
pub fn triple_to_pair(t: #(a, b, c)) -> #(a, #(b, c))
pub fn triples_to_aggregated_dict(
l: List(#(a, b, c)),
) -> dict.Dict(a, List(#(b, c)))
pub fn triples_to_dict(
l: List(#(a, b, c)),
) -> dict.Dict(a, #(b, c))
pub fn triples_to_pairs(
l: List(#(a, b, c)),
) -> List(#(a, #(b, c)))
pub fn try_map_fold(
over items: List(q),
from state: a,
with f: fn(a, q) -> Result(#(q, a), c),
) -> Result(#(List(q), a), c)
pub fn use_list_pair_as_dict(
list_pairs: List(#(a, b)),
key: a,
) -> Result(b, Nil)
pub fn v_append_classes_if(
node: vxml.VXML,
classes: String,
condition: fn(vxml.VXML) -> Bool,
) -> vxml.VXML
pub fn v_attrs_constructor(
blame: blame.Blame,
tag: String,
attrs: List(#(String, String)),
) -> vxml.VXML
pub fn v_extract_children(
vxml: vxml.VXML,
condition: fn(vxml.VXML) -> Bool,
) -> #(vxml.VXML, List(vxml.VXML))
pub fn v_extract_ending_spaces(
node: vxml.VXML,
) -> #(option.Option(vxml.VXML), vxml.VXML)
pub fn v_extract_starting_spaces(
node: vxml.VXML,
) -> #(option.Option(vxml.VXML), vxml.VXML)
pub fn v_first_attr_with_key(
vxml: vxml.VXML,
key: String,
) -> option.Option(vxml.Attr)
pub fn v_first_child_with_tag(
vxml: vxml.VXML,
tag: String,
) -> option.Option(vxml.VXML)
pub fn v_has_attr_with_key(vxml: vxml.VXML, key: String) -> Bool
pub fn v_has_class(vxml: vxml.VXML, class: String) -> Bool
pub fn v_has_key_val(
vxml: vxml.VXML,
key: String,
val: String,
) -> Bool
pub fn v_pour_before_first(
vxml: vxml.VXML,
to_insert: List(vxml.VXML),
before: String,
) -> vxml.VXML
pub fn v_set_attr(
vxml: vxml.VXML,
blame: blame.Blame,
key: String,
val: String,
) -> vxml.VXML
pub fn v_tag_is_one_of(
vxml: vxml.VXML,
tags: List(String),
) -> Bool
pub fn v_unique_child(
vxml: vxml.VXML,
tag: String,
) -> Result(vxml.VXML, DesugaringError)
pub fn v_unique_child_with_singleton_error(
vxml: vxml.VXML,
tag: String,
) -> Result(vxml.VXML, SingletonError)
pub fn v_val_of_first_attr_with_key(
vxml: vxml.VXML,
key: String,
) -> option.Option(String)
pub fn validate_unique_keys(
l: List(#(a, b)),
) -> Result(List(#(a, b)), DesugaringError)
pub fn vxml_digest(vxml: vxml.VXML) -> String
pub fn with_default(
o: option.Option(a),
default: a,
) -> option.Option(a)