mod(node2buffer): add styling to parsed contents
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 29s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 29s
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user