aboutsummaryrefslogtreecommitdiff
path: root/src/zeroscript/html/element.zig
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2026-10-12 09:43:19 +0200
committerNathan Reiner <nathan@nathanreiner.xyz>2026-10-12 09:43:19 +0200
commit0b2af471b6d5dfc4eaf53639102c1b854bbb324b (patch)
treeaba3943b8c54d26d8552d0685d4178bc995d91c3 /src/zeroscript/html/element.zig
parent812f547d84b5ce1a2924ae16f6257e4fd19efcc0 (diff)
first version of zilch
Diffstat (limited to 'src/zeroscript/html/element.zig')
-rw-r--r--src/zeroscript/html/element.zig30
1 files changed, 0 insertions, 30 deletions
diff --git a/src/zeroscript/html/element.zig b/src/zeroscript/html/element.zig
deleted file mode 100644
index 739eb0b..0000000
--- a/src/zeroscript/html/element.zig
+++ /dev/null
@@ -1,30 +0,0 @@
-const std = @import("std");
-const mod = @import("root.zig");
-const Attribute = mod.Attribute;
-const Tag = mod.Tag;
-
-pub const Element = union(enum) {
- const Self = @This();
-
- tag: Tag,
- string: []const u8,
-
- pub fn node(name: []const u8, attributes: anytype, children: []const Element) Self {
- return .{ .tag = .tag(name, attributes, children) };
- }
-
- pub fn @"void"(name: []const u8, attribute: anytype) Self {
- return .{ .tag = .void(name, attribute) };
- }
-
- pub fn text(content: []const u8) Self {
- return .{ .string = content };
- }
-
- pub fn format(self: *const Self, writer: *std.Io.Writer) !void {
- try switch (self.*) {
- .string => |content| writer.writeAll(content),
- .tag => |n| n.format(writer),
- };
- }
-};