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.
fnprintVerboseInvocation(
argv: []const []constu8,
search_basename: ?[]constu8,
verbose: bool,
stderr: ?[]constu8,
) void {
if (!verbose) return;
if (search_basename) |s| {
std.debug.print("Zig attempted to find the file '{s}' by executing this command:\n", .{s});
} else {
std.debug.print("Zig attempted to find the path to native system libc headers by executing this command:\n", .{});
}
for (argv, 0..) |arg, i| {
if (i != 0) std.debug.print(" ", .{});
std.debug.print("{s}", .{arg});
}
std.debug.print("\n", .{});
if (stderr) |s| {
std.debug.print("Output:\n==========\n{s}\n==========\n", .{s});
}
}