| Crates.io | wgsldoc |
| lib.rs | wgsldoc |
| version | 0.2.2 |
| created_at | 2025-02-13 18:53:43.386965+00 |
| updated_at | 2025-07-08 18:34:37.684051+00 |
| description | Documentation generator for WGSL shaders |
| homepage | |
| repository | https://github.com/konceptosociala/wgsldoc |
| max_upload_size | |
| id | 1554578 |
| size | 452,992 |
wgsldoc is a documentation generator for WGSL (WebGPU Shading Language) shader modules. It parses .wgsl files, extracts documentation comments, and generates a structured, searchable HTML site for easy browsing and reference.
To install wgsldoc, you can use Cargo, the Rust package manager. Run the following command:
cargo install wgsldoc
After installation, you can run wgsldoc from the command line.
The following command will generate documentation for all WGSL files (including README.md and favicon.png files) in the current directory, outputting the result
to the docs directory:
wgsldoc
If you want to host your docs as a website, you should specify a base URL with the -U option:
wgsldoc -U https://example.com/docs
If you want to only generate the AST (Abstract Syntax Tree) and print it to stdout (or another stream) instead of generating full documentation, you can use the -A option:
wgsldoc -A > ast_output.txt
or for stdout
wgsldoc -A
More advanced usage:
Usage: wgsldoc [OPTIONS]
Options:
-N, --name <NAME> Name of the package to generate documentation for
-D, --target-dir <TARGET_DIR> Target directory for the generated documentation
-U, --base-url <BASE_URL> Base URL for future website. If specified, it will be used to generate links in the documentation. Otherwise, the links will use `target_dir` as the base URL
-A, --ast-only Generate AST and print it to stdout instead of generating full documentation
-I, --input <FILES> Input files to process. If not specified, the program will look for .wgsl files in the current directory
-W, --show-undocumented Show undocumented items in the documentation
-h, --help Print help (see more with '--help')
-V, --version Print version