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.
pubfnstackGrowth(target: *constTarget) StackGrowth {
// Strictly speaking, most architectures don't inherently define the stack growth direction; you
// could quite easily argue that it is in fact a property of the ABI. However, that's just not
// really how it plays out in the real world. And besides, we have no mechanism for indicating
// a different stack growth ABI, nor a compelling use case for creating such a mechanism.
returnswitch (target.cpu.arch) {
.hppa,
.hppa64,
=> .up,
else => .down,
};
}