aboutsummaryrefslogtreecommitdiff
path: root/src/root.zig
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <william@herges.fr>2026-04-28 15:08:02 +0200
committerAnhgelus Morhtuuzh <william@herges.fr>2026-04-28 15:08:02 +0200
commit3b1e6547d069d7c438af551a4989972802a895ee (patch)
tree7c32e8fcac432539888e0cdb598f495316b0772d /src/root.zig
parente154408e8ddeaee83242002f4c7af68b29d3a677 (diff)
perf(html): reduce memory usage
Diffstat (limited to 'src/root.zig')
-rw-r--r--src/root.zig13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/root.zig b/src/root.zig
index 919c3ee..6fd15f5 100644
--- a/src/root.zig
+++ b/src/root.zig
@@ -4,6 +4,10 @@ const Allocator = std.mem.Allocator;
const parser = @import("parser.zig");
pub const Document = parser.Document;
pub const Error = parser.Error;
+/// Parse the content.
+///
+/// Use typdown_parse if you are not in Zig.
+pub const parse = parser.parse;
inline fn getErrorCode(err: Error) u8 {
return switch (err) {
@@ -70,14 +74,7 @@ export fn typdown_parse(content: [*:0]const u8, code: *u8) ?[*:0]const u8 {
};
}
-/// Parse the content.
-///
-/// Use parse if you are not in Zig.
-pub fn parse(alloc: std.mem.Allocator, content: []const u8) Error!Document {
- return parser.parse(alloc, content);
-}
-
-pub fn parseReader(alloc: std.mem.Allocator, r: *std.io.Reader) (Error || std.io.Reader.Error)!Document {
+pub fn parseReader(alloc: std.mem.Allocator, r: *std.io.Reader) (Error || std.io.Reader.Error)!*Document {
return parser.parseReader(alloc, r);
}