wcl_wdoc 0.11.2-alpha

WCL documentation format — build structured docs with WCL, render to HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
    export let widget_user = (b) => {
        let w = attr_or(b, "width", 80)
        let h = attr_or(b, "height", 100)
        let name = attr_or(b, "label", "User")
        let color = attr_or(b, "color", "var(--color-link)")
        let bg_fill = attr_or(b, "background_fill", color)
        let label_fill = attr_or(b, "label_fill", "currentColor")
        let ih = h * 0.65
        let hr = ih * 0.22
        let cx = w / 2
        [
            { kind = "circle", x = cx - hr, y = 0, r = hr, fill = bg_fill },
            { kind = "rect", x = cx - w * 0.35, y = hr * 2 + 4,
              width = w * 0.7, height = ih - hr * 2 - 4, rx = w * 0.15, fill = bg_fill },
            { kind = "text", x = 0, y = ih + 4, width = w, height = h - ih - 4,
              content = name, font_size = 12, fill = label_fill }
        ]
    }