Autodoc should generate a source link for any decl

Raising this as many useful data structures currently in zig official doc is returned in comptime function, so the official doc only list its type, but not given their src link (which is an important tool if want to further investigate).

E.g… take ArrayHashMap as example std.ArrayHashMap - Zig (ziglang.org)

This is what I see


and if want to check its src (like many places in official doc), I have to search github repo.

If a src link can provided this will be fantastic, and much more convinient to learn from zig std source, as well as find out what’s the APIs exposed, e.g., the iterator of ArrayHashMap.

I found this wonderful site ( The Browseable Zig Standard Library (ratfactor.com)) by Dave Gauer actually serves me better than official doc sometimes, even though it is only listing std src code nicely in one page, but as the source is side by side, it works.

This is not an urgent issue, but I really hope it can be improved.

2 Likes

I think you’re in luck, because Andrew Kelley has been working on a redesign of the Autodoc system for a little while now, and just opened a PR for it! It looks like it’ll include interactive source code and be much more explorable overall.

2 Likes

I you like watching programming videos, you can see in this recent (4h23m!) stream by Andrew how things are shaping up for the new autodoc implementation.

This is actually a recent regression which I pointed out here on Discord.

Hopefully it’ll be fixed soon as the pre-regression was far more usable.