wgsldoc 📃🧑💻
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.
Installation
To install wgsldoc, you can use Cargo, the Rust package manager. Run the following command:
Usage
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:
If you want to host your docs as a website, you should specify a base URL with the -U option:
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:
or for stdout
More advanced usage:
)
Features
- CLI
- AST-only mode
- Documentation generation
- Show undocumented items
- Parsing
- Modules
- Imports
- Functions
- Structures
- Entry points
- Built-in imports
- Constants
- Bindings
- Enums
- HTML Generation
- Main page
- Modules
- Index page
- Module page
- Import page
- Function page
- Structure page
- Entry point page
- Built-in import page
- Constants page
- Bindings page
- Enums page
- Source code
- Documentation
- Search functionality
- Search index generation
- Search page