--- /dev/null
+const std = @import("std");
+const md = @import("./markdown_parser.zig");
+
+const HtmlFormatter = struct {
+ buffer: std.ArrayList(u8),
+
+ pub fn init() @This() {
+ const ary: std.ArrayList(u8) = .empty;
+ return .{
+ .buffer = ary
+ };
+ }
+
+ pub fn format(self: *@This(), doc: md.MarkdownDoc) []const u8 {
+ _ = doc;
+ return self.buffer.items;
+ }
+};
+
+test "can format empty document" {
+ const formatter = HtmlFormatter.init();
+ const doc = md.MarkdownDoc.parse("");
+
+ _ = formatter.format(doc);
+}
+
pub fn main() !void {
const alloc = std.heap.page_allocator;
- var arena = std.heap.ArenaAllocator.init(alloc);
- const document = "";
- _ = blog_processor.parse_markdown(document, arena.allocator());
+ const arena = std.heap.ArenaAllocator.init(alloc);
+ _ = arena;
}
-const std = @import("std");
-const md_parser = @import("./markdown_parser.zig");
+// const std = @import("std");
-pub const Entry = struct {
-};
-
-pub fn parse_markdown(md: []const u8, alloc: std.mem.Allocator) std.ArrayList(Entry) {
- _ = alloc;
- _ = md;
- _ = unreachable;
-}
+// const md_parser = @import("./markdown_parser.zig");
+// const html = @import("./html_formatter.zig");
test "all tests" {
_ = @import("./markdown_parser.zig");
+ _ = @import("./html_formatter.zig");
}