This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig library itself.
pubfnjoin(self: Directory, allocator: Allocator, paths: []const []constu8) ![]u8 {
if (self.path) |p| {
// TODO clean way to do this with only 1 allocationconstpart2 = tryfs.path.join(allocator, paths);
deferallocator.free(part2);
returnfs.path.join(allocator, &[_][]constu8{ p, part2 });
} else {
returnfs.path.join(allocator, paths);
}
}