# autodoc: show more doc comments for namespaces and types · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/c481510c99ab29903350a834810bdcac32dbd9ea)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: c481510c99ab29903350a834810bdcac32dbd9ea

Requested commit: c481510c99ab29903350a834810bdcac32dbd9ea

Commit: c481510c99ab29903350a834810bdcac32dbd9ea

Tree: 93d30e203b38f33ea297f9ad46170226c2a40ebb

Author: Loris Cro

Committer: Loris Cro

## Message

````
autodoc: show more doc comments for namespaces and types

previously, in the container view (the type of view that you see when
you look at `std` for example), when listing types and namespaces, we
would only show doc comments places on the direct child decl, which in
the case of the `std` namespace, for example, it's just a bunch of
re-exports.

now, if we don't find a direct doc comment, we chase indirection and
display doc comments placed directly on the definition, if any.

this is the precise priority order:

```
/// 1
pub const Foo = _Foo;

/// 2
const _Foo = struct {
   //! 3
};
```
The numbers show the priority order for autodoc.

````

## Parents

- [a63a1c5cb9fd31a57e8371e6cba5f316bd3f2a65](https://git.cafe/gitcafe/zig/commit/a63a1c5cb9fd31a57e8371e6cba5f316bd3f2a65?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/c481510c99ab29903350a834810bdcac32dbd9ea?format=markdown)
