Zig std library offline

I’ll be travelling and have no idea what the WiFi/Internet connection is going to look like, so I like to take some documentation with me.

The Zig Language Reference states "This HTML document depends on no external files, so you can use it offline. ", so for that it was easy to have as a local copy.

The Zig Standard Library documentation doesn’t seem to be a single page. Is there some way to have local “server” provide the pages and search functionality?

I am not sure if the conversion described here still works, that could be an alternative if there is no simple way to run the standard lib documenation server locally.

zig std runs a local http server and serves the documentation.


I got error: FileNotFound and the although the program did not exit, I could not connect with Firefox using copy and paste of the URL printed, which I originally thought would mean I did not have the source of the library (which of course is not true).

But it looks like the browser executable could not be found. I had to start using zig std --no-open-browser, which no longer gave me the FileNotFound erorr, and and then connect to the URL printed.

FWIW: Using Firefox on macOS on a Macbook M1

In macOS zig 0.12.0 opening the url is missing. It is fixed in 0.13.0-dev.
On 0.12.0 you can automate it by specifying the port like in:

zig std --port 8008 --no-open-browser
1 Like