const std = @import("std"); pub const Minifier = @import("Minifier.zig"); pub const Component = @import("Component.zig"); pub const File = @import("File.zig"); const Element = @import("html").Element; pub const script: File = .{ .tag = .script, .minifier = .js, }; pub const style: File = .{ .tag = .style, .minifier = .css, }; pub const body: File = .{ .tag = .body, .minifier = .html, }; pub const html: File = .{ .tag = null, .minifier = .html, }; pub fn env(comptime components: []const Component) Element { var children: []const Element = &.{script.load(@embedFile("z.js"))}; inline for (components) |c| { const child: []const Element = &.{c.toElement()}; children = children ++ child; } return .transparent(.children(children)); } pub fn component(kind: @EnumLiteral(), attrs: anytype, content: Element.Content) Element { var element: Element = .native(.@"z-component", attrs, content); const type_attr: []const Element.Attribute = &.{.{ .name = "type", .value = @tagName(kind), }}; element.attributes = type_attr ++ element.attributes; return element; } test { _ = std.testing.refAllDecls(@This()); }