///|
pub fn Palette::render_html_color_table(self : Palette) -> String {
let rows : Array[String] = []
for color in self.colors {
rows.push(
"| " +
escape_html(color.name) +
" | " +
escape_html(color.value) +
" | " +
escape_html(color.role) +
" |
",
)
}
"Color tokens| Token | Value | Role |
" +
rows.join("") +
"
"
}
///|
pub fn Typography::render_html_scale_table(self : Typography) -> String {
let rows : Array[String] = []
for step in self.scale {
rows.push(
"| " +
escape_html(step.name) +
" | " +
step.size_px.to_string() +
"px | " +
step.line_height_px.to_string() +
"px |
",
)
}
"Type scale| Step | Size | Line height |
" +
rows.join("") +
"
"
}
///|
pub fn BrandBook::render_html_reference_tables(self : BrandBook) -> String {
"Reference tables
" +
self.palette.render_html_color_table() +
self.typography.render_html_scale_table() +
""
}