ZigDoc - Zig lang Auto Doc alternative!

ZigDoc:


Generates documentation for Zig projects.

It can do HTML or MD format. It can do it all in a single document, or multiple interlinked documents.

I generated sample docs for the Zig master branch I’m using:

I’m working on a project that will need documentation published on a website, and Auto Doc doesn’t produce output that is nice for that purpose. You also can’t browse its output by just opening a file.

I also wanted a way to show LLMs the function signatures of projects without sending them the full source code. Yeah.

What I learnt is that Windows considers filenames with different capitalisation to be the exact same file and won’t play nice when you create filenames with certain words. The Zig lang’s libraries contain words that pitted ZigDoc up against such limitations.

Supported Zig versions

The current version was written for zig-0.17-dev, so I’ll have to go over it again when that’s stable.
In the meantime I added the binaries to the project.

AI / LLM usage excuses

I needed this application to create the docs for another project, so it’s a bit of a side-quest to that. Claude has gone over it a few times and it did ruin a lot but I review and keep redesigning what it did - so at the end of the day it is maintainable. Sure, he makes me mad. This is also my first finished Zig project so there’s a lot I didn’t know how to do. It helped me scaffold, add doc comments, and create patches (that I apply by hand). My own ways always come first. I expect people might use this as a separate tool rather than mingling it with their own codebase.

It’s good to have competition in the space, but there is a lot of work needed to make your version attractive. First private members are shown, which includes imports . Second it’s really hard to navigate the doc. Zig top level page shows the sub namespaces of std, allowing to filter the ones you want.

Lastly the fuzzy search is pretty useful, and is often better than the browser search

1 Like

As a counter point, I think being able to see private members can be a bonus. It should be toggleable, but that’s a big point of frustration when reading through Zig docs for me.

5 Likes
1 Like

I hear ya. I scratched my itch and called it a day.

I’ve added more options now to cover those points. Better nav structures available, search box, an option to control whether your privates get described.

This example shows the new features: std | Zig 0.17.0-dev (Split by item)

2 Likes

looks way better now !

This might be a bit off-topic, but isn’t there a plan to replace current zig packages documentation process with something better? something like this one possibly.

I tried to use doc comments, zig renders it into wasm file. This is bad.

If code presented here is dependency free (and not needing wasm) then that would be good candidate for replacement of current wasm-based documentation.

Developers need a smooth process for their zig packages documentation.

(post deleted by author)