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.
fndumpBadDirnameHelp(
fail_step: ?*Step,
asking_step: ?*Step,
comptimemsg: []constu8,
args: anytype,
) anyerror!void {
conststderr = std.debug.lockStderr(&.{}).terminal();
deferstd.debug.unlockStderr();
constw = stderr.writer;
tryw.print(msg, args);
if (fail_step) |s| {
stderr.setColor(.red) catch {};
tryw.writeAll(" The step was created by this stack trace:\n");
stderr.setColor(.reset) catch {};
s.dump(stderr);
}
if (asking_step) |as| {
stderr.setColor(.red) catch {};
tryw.print(" The step {q} that is missing a dependency on the above step was created by this stack trace:\n", .{as.name});
stderr.setColor(.reset) catch {};
as.dump(stderr);
}
stderr.setColor(.red) catch {};
tryw.writeAll(" Proceeding to panic.\n");
stderr.setColor(.reset) catch {};
}