/stdlib-docgen

Zig Standard Library document generator

Primary LanguageHTMLMIT LicenseMIT

Zig Standard Library Doc Generator

MOVED! Hello, I am moving my repos to http://ratfactor.com/repos/ and setting them to read-only ("archived") on GitHub. Thank you, -Dave

Generates a single-page "map" of the functions and types available in the Zig stdlib.

Based on g-w1’s zigdoc

First of all, this only exists because g-w1 created zigdoc. I shamelessly copied zigdoc and pared it down to produce the output I wanted. If you want multi-page Zig stdlib docs with HTML or JSON output and full function signatures (and even whole functions if they’re 3 lines or less), then go take a look at zigdoc!

What

The idea is to make it easy to do an in-page browser search for the feature you want and then have a handy link to view the source, where you can learn more about the usage or implementation of the feature.

Latest export from this tool (and currently quite horrendous) can be viewed here:

Usage

$ zig build-exe gen.zig
$ ./gen /path/to/zig/lib/std/

Output is a single index.html.

If you would like to change any settings, edit gen.zig.

TODO

  • Sort source files

  • How to handle little stubby helper files that don’t do much on their own?

  • Sort decls by type then name

  • Summarize but don’t show all billion values in some of the modules (index.html started at 13Mb and I’ve got it down to 4Mb, but there’s still too much)

  • Make functions more obvious (just add ()?)

  • Clever way to add descriptions - don’t really want to create a separate text file for each module file, but that might be the best way to do it