# pretty A compile-time pretty printer for Zig with colored terminal output. ## Installation Run: ```sh zig fetch --save git+https://git.sr.ht/~altagos/pretty#main ``` Or manually add to `build.zig.zon`: ```zig .dependencies = .{ .pretty = .{ .url = "git+https://git.sr.ht/~altagos/pretty#main", .hash = "", }, } ``` In `build.zig`: ```zig const pretty = b.dependency("pretty", .{ .target = target, .optimize = optimize }); exe.root_module.addImport("pretty", pretty.module("pretty")); ``` ## Usage For a detailed example, see [example/main](./example/main.zig) ```zig const pretty = @import("pretty").pretty; std.debug.print("{f}\n", .{pretty(my_value)}); ``` ### With Options ```zig const prettyO = @import("pretty").prettyO; std.debug.print("{f}\n", .{prettyO(my_value, .{ .struct_inline = true, .array_inline = true, })}); ``` ### Global Defaults ```zig pub const pretty_options = @import("pretty").Options{ .skip_root_type_name = true, .theme = .{ .indent_width = 4 }, }; ``` ## License [MIT License](./LICENSE)