mod(node2buffer): add styling to parsed contents
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 29s

This commit is contained in:
2024-10-13 16:39:51 +02:00
parent a01619911d
commit a3d0b7af9a
3 changed files with 88 additions and 24 deletions

View File

@@ -37,6 +37,10 @@ pub fn update(this: *@This(), event: Event) ?Event {
// Home
return .{ .path = "./doc/home.md" };
}
if (key.matches('t', .{})) {
// test
return .{ .path = "./doc/test.md" };
}
},
else => {},
}
@@ -55,6 +59,7 @@ pub fn draw(this: *@This(), win: vaxis.Window) void {
\\
\\**a** about
\\**h** home
\\**t** test
;
var zmd = Zmd.init(this.allocator);
defer zmd.deinit();
@@ -63,7 +68,7 @@ pub fn draw(this: *@This(), win: vaxis.Window) void {
defer cells.deinit();
zmd.parse(msg) catch @panic("failed to parse markdown file");
node2buffer.toBuffer(zmd.nodes.items[0], this.allocator, msg, &cells, .{}) catch @panic("failed to transform to cell array");
node2buffer.toBuffer(zmd.nodes.items[0], this.allocator, msg, &cells, .{}, null) catch @panic("failed to transform to cell array");
var col: usize = 0;
var row: usize = 0;