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.
pubfnrender(self: LibCInstallation, out: *std.Io.Writer) !void {
@setEvalBranchQuota(4000);
constinclude_dir = self.include_dirorelse"";
constsys_include_dir = self.sys_include_dirorelse"";
constcrt_dir = self.crt_dirorelse"";
constmsvc_lib_dir = self.msvc_lib_dirorelse"";
constkernel32_lib_dir = self.kernel32_lib_dirorelse"";
constgcc_dir = self.gcc_dirorelse"";
tryout.print(
\\# The directory that contains `stdlib.h`.\\# On POSIX-like systems, include directories be found with: `cc -E -Wp,-v -xc /dev/null`\\include_dir={s}\\\\# The system-specific include directory. May be the same as `include_dir`.\\# On Windows it's the directory that includes `vcruntime.h`.\\# On POSIX it's the directory that includes `sys/errno.h`.\\sys_include_dir={s}\\\\# The directory that contains `crt1.o` or `crt2.o`.\\# On POSIX, can be found with `cc -print-file-name=crt1.o`.\\# Not needed when targeting MacOS.\\crt_dir={s}\\\\# The directory that contains `vcruntime.lib`.\\# Only needed when targeting MSVC on Windows.\\msvc_lib_dir={s}\\\\# The directory that contains `kernel32.lib`.\\# Only needed when targeting MSVC on Windows.\\kernel32_lib_dir={s}\\\\# The directory that contains `crtbeginS.o` and `crtendS.o`\\# Only needed when targeting Haiku.\\gcc_dir={s}\\
, .{
include_dir,
sys_include_dir,
crt_dir,
msvc_lib_dir,
kernel32_lib_dir,
gcc_dir,
});
}