zig docs on command line
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alex 3fa0f65b54 output: insert empty line between container members
unfortunately, this spits out double newlines between top level
declarations and sometimes in between fields. this is because the
original rendering logic designed to handle a complete source file,
whereas we're printing only public members.

but this makes reading the output of container fields easier.
will take care of double newlines later.
2 years ago
src output: insert empty line between container members 2 years ago
LICENSE initial import 2 years ago
README.md readme: mention zig build test before sending a patch 2 years ago
build.zig build: add test subcommand 2 years ago

README.md

zig docs on command line.

usage:

zdoc [source] <identifier>

the program searches source code for matching public identifiers, printing found types and their doc comments to stdout. the search is case-insensitive and non-exhaustive.

for example, look up format function in std lib:

zdoc std.fmt format

print fmt's top level doc comments:

zdoc std.fmt

look up "hello" identifier in a project file:

zdoc ./src/main.zig hello

search across all .zig files starting from the src directory, recursively and following symlinks:

zdoc ./src hello

that's about all it can do for now. a future version may include search syntax for public struct fields, enum tags and other constructs, like so:

zdoc std.foo.bar .somefield

for some types, zig may log an error reading something like, "renderingExpression for ... unimplemented". that's because i commented out a big chunk of rendering cases in src/output.zig which was adapted from std/zig/render.zig, to suppress definitions output.

if you see an error like this, please create an issue or send a code change.


to contribute, create a pull request or send a patch with git send-mail to alex-dot-cloudware.io.

before sending a change, please make sure tests pass:

zig build test

and all code is formatted:

zig fmt --check .

license

same as zig license.