zig.guide icon indicating copy to clipboard operation
zig.guide copied to clipboard

Generating documentation

Open ivanstepanovftw opened this issue 1 year ago • 1 comments

I have skill issue - how to open generated docs in browser locally? https://zig.guide/build-system/generating-documentation/

ivanstepanovftw avatar Jul 13 '24 16:07 ivanstepanovftw

// Docs
const docs_step = b.addInstallDirectory(.{
    .source_dir = lib_unit_tests.getEmittedDocs(),
    .install_dir = .prefix,
    .install_subdir = "docs",
});
docs_step.step.dependOn(&exe.step);

const docs = b.step("docs", "Generate documentation");
docs.dependOn(&docs_step.step);

zig build docs generates docs in "zig-out/docs/" directory. To open it need to serve HTTP server by using i.e. Python: python -m http.server -d zig-out/docs &

ivanstepanovftw avatar Jul 22 '24 12:07 ivanstepanovftw

Closed in e751f6c4bf215461a18382961cdd28057ddf3b3a

Sobeston avatar Dec 27 '24 22:12 Sobeston