Zig 0.17.0-dev (Split by item)

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.

create

Fmt.create
pub fn create(owner: *std.Build, options: Options) *Fmt

File

Code

pub fn create(owner: *std.Build, options: Options) *Fmt {
    const graph = owner.graph;
    const fmt = graph.create(Fmt);

    fmt.* = .{
        .step = .init(.{
            .tag = base_tag,
            .name = if (options.check) "zig fmt --check" else "zig fmt",
            .owner = owner,
        }),
        .paths = LazyPath.dupeList(options.paths, graph),
        .exclude_paths = LazyPath.dupeList(options.exclude_paths, graph),
        .check = options.check,
    };

    for (options.paths) |lp| lp.addStepDependencies(&fmt.step);
    for (options.exclude_paths) |lp| lp.addStepDependencies(&fmt.step);

    return fmt;
}