wcl_wdoc 0.11.2-alpha

WCL documentation format — build structured docs with WCL, render to HTML
    export let widget_database = (b) => {
        let w = attr_or(b, "width", 100)
        let h = attr_or(b, "height", 120)
        let name = attr_or(b, "label", "Database")
        let color = attr_or(b, "color", "var(--color-link)")
        let surface_fill = attr_or(b, "surface_fill", "var(--color-code-bg)")
        let top_fill = attr_or(b, "top_fill", "var(--color-nav-bg)")
        let border_stroke = attr_or(b, "border_stroke", color)
        let label_fill = attr_or(b, "label_fill", "currentColor")
        let eh = h * 0.15
        let bh = h * 0.55
        let body_d = "M 0 " + to_string(eh) + " L 0 " + to_string(bh) + " Q 0 " + to_string(bh + eh) + " " + to_string(w / 2) + " " + to_string(bh + eh) + " Q " + to_string(w) + " " + to_string(bh + eh) + " " + to_string(w) + " " + to_string(bh) + " L " + to_string(w) + " " + to_string(eh)
        let top_d = "M 0 " + to_string(eh) + " Q 0 0 " + to_string(w / 2) + " 0 Q " + to_string(w) + " 0 " + to_string(w) + " " + to_string(eh) + " Q " + to_string(w) + " " + to_string(eh * 2) + " " + to_string(w / 2) + " " + to_string(eh * 2) + " Q 0 " + to_string(eh * 2) + " 0 " + to_string(eh)
        [
            { kind = "path", x = 0, y = 0, width = w, height = h, d = body_d, fill = surface_fill, stroke = border_stroke, stroke_width = 2 },
            { kind = "path", x = 0, y = 0, width = w, height = h, d = top_d, fill = top_fill, stroke = border_stroke, stroke_width = 2 },
            { kind = "text", x = 0, y = bh + eh + 4, width = w, height = h - bh - eh - 4, content = name, font_size = 12, fill = label_fill }
        ]
    }