Skip to content

Commit

Permalink
Update to master docgen API
Browse files Browse the repository at this point in the history
This updates the build.zig to use the latest API for building
documentation.

Documentation is now emitted to `zig-out/docs`
  • Loading branch information
LordMZTE authored and joachimschmidt557 committed Jul 25, 2023
1 parent 24ddf9e commit 1614b61
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Upload
uses: actions/upload-pages-artifact@v1
with:
path: "docs/"
path: "zig-out/docs/"

publish:
name: Publish website
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/docs
zig-cache/
zig-out/
deps.zig
gyro.lock
9 changes: 5 additions & 4 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ pub fn build(b: *Builder) void {
const test_step = b.step("test", "Run library tests");
test_step.dependOn(&run_main_tests.step);

const docs = b.addTest(.{
.root_source_file = .{ .path = "src/main.zig" },
const install_docs = b.addInstallDirectory(.{
.source_dir = main_tests.getEmittedDocs(),
.install_dir = .prefix,
.install_subdir = "docs",
});
docs.emit_docs = .emit;

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

0 comments on commit 1614b61

Please sign in to comment.