#generating docs

1 messages · Page 1 of 1 (latest)

tender stump
#

I’m trying to generate docs from my library. Do I need to modify the build.zig file to tell it to do that? If so, what change is needed?

dull plover
#

if you mean autodoc, you can do this:

    const autodoc_test = b.addTest(.{
        .root_source_file = std.Build.FileSource.relative("src/init.zig"),
        .target = target,
        .optimize = optimize,
    });
    // add modules like you would when normally compiling
    autodoc_test.addModule("blahblah", blahblah_mod);

    const install_docs = b.addInstallDirectory(.{
        .source_dir = autodoc_test.getEmittedDocs(),
        .install_dir = .prefix,
        .install_subdir = "autodocs",
    });

    const docs_step = b.step("autodocs", "Build and install documentation");
    docs_step.dependOn(&install_docs.step);
tender stump
#

I was hoping it would just be a command-line flag. Maybe before 1.0 it will become easier.