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.
pubconstTransformation = union(enum) {
/// Replace the fn decl AST Node with one whose body is only `@trap()` with/// discarded parameters.gut_function: Ast.Node.Index,
/// Omit a global declaration.delete_node: Ast.Node.Index,
/// Delete a local variable declaration and replace all of its references/// with `undefined`.delete_var_decl: struct {
var_decl_node: Ast.Node.Index,
/// Identifier nodes that reference the variable.references: std.ArrayList(Ast.Node.Index),
},
/// Replace an expression with `undefined`.replace_with_undef: Ast.Node.Index,
/// Replace an expression with `true`.replace_with_true: Ast.Node.Index,
/// Replace an expression with `false`.replace_with_false: Ast.Node.Index,
/// Replace a node with another node.replace_node: struct {
to_replace: Ast.Node.Index,
replacement: Ast.Node.Index,
},
/// Replace an `@import` with the imported file contents wrapped in a struct.inline_imported_file: InlineImportedFile,
pubconstInlineImportedFile = struct {
builtin_call_node: Ast.Node.Index,
imported_string: []constu8,
/// Identifier names that must be renamed in the inlined code or else/// will cause ambiguous reference errors.in_scope_names: std.array_hash_map.String(void),
};
}