wcl_wdoc 0.11.0-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
    export let widget_uml_package = (b) => {
        let w = attr_or(b, "width", 200)
        let h = attr_or(b, "height", 130)
        let name = attr_or(b, "label", "Package")
        let color = attr_or(b, "color", "var(--color-link)")
        let surface_fill = attr_or(b, "surface_fill", "var(--color-bg)")
        let border_stroke = attr_or(b, "border_stroke", color)
        let label_fill = attr_or(b, "label_fill", "currentColor")
        let tw = w * 0.4
        [
            { kind = "rect", x = 0, y = 0, width = tw, height = 20,
              fill = surface_fill, stroke = border_stroke, stroke_width = 1.5 },
            { kind = "text", x = 0, y = 0, width = tw, height = 20, content = name, font_size = 11, fill = label_fill },
            { kind = "rect", x = 0, y = 19, width = w, height = h - 19,
              fill = surface_fill, stroke = border_stroke, stroke_width = 1.5 }
        ]
    }