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.
pubconstFileDefinition = externstruct {
/// An ANSI string that gives the name of the source file./// This is padded with nulls if it is less than the maximum length.file_name: [18]u8,
pubfngetFileName(self: *constFileDefinition) []constu8 {
constlen = std.mem.findScalar(u8, &self.file_name, @as(u8, 0)) orelseself.file_name.len;
returnself.file_name[0..len];
}
}