Autodoc: Wrong namespace documentation taken
Build the following two files and observe the behaviour:
main.zig
//! This is the entry point and root file of microzig.
//! If you do a @import("microzig"), you'll *basically* get this file.
//!
//! But microzig employs a proxy tactic
const std = @import("std");
/// The app that is currently built.
pub const app = @import("app");
app.zig:
//!
//! I AM THE APPLICATION
//!
with zig build-lib main.zig --mod app::app.zig -femit-docs=docs --deps app. Documentation will then look like this:



Zig Version: 0.11.0
i can't find the issue/pr reference atm but I remember seeing something about the behavior of this changing recently. I would try generating the autodocs with master and see if the behavior is the same
New autodoc does this currently:
That's with sources.tar that looks like this:
root/
root/main.zig
app/
app/app.zig
If you do it the other way around, you get:
(I had to navigate to the hash tag manually to find the other package here)
That's with
app/
app/app.zig
root/
root/main.zig
I think that's closer to what you want, but currently -femit-docs has 2 limitations:
- It does not (yet?) put all modules into
sources.tar, only the root module - It does not (yet?) provide the ability to configure which module is the root (first in sources.tar) module
You can, of course, manually construct sources.tar if it suits your use case.