Generate documentation for WESL projects.
Warning: This is a work in progress and not stable in any way yet.
- Generate HTML documentation for WESL projects.
- Search for items or attributes in the documentation.
- Go to source code from the documentation.
- Documentation comments (
///and//!) with Markdown formatting and (currently limited) support for intra-doc links. - Show translate-time features in the documentation.
- Choose between a dark and a light theme.
For a live example, check out the GitHub Pages site of this repository.
First install the wesldoc CLI:
cargo install wesldoc --locked --path ./crates/wesldocThen use it like this:
wesldoc ./path/to/my_wesl_projectCheck wesldoc --help for more options.
Note: Dependencies are resolved using the
wesl.tomlfile in the root of the project. Currently the dependencies are not built recursively, this will be addressed in the future.
Note: Currently only
cargois supported as package manager. Support for other package managers may be added in the future.
The wesldoc CLI is just a wrapper around the wesldoc_compiler and wesldoc_generator crates. You can use them directly in your own projects.
Look at the wesldoc crate for an example on how to use them.
wesldoc_ast: This crate provides the AST for the WESL documentation. It is fully standalone and does not depend onwesl-rs.wesldoc_generator: This crate takes aWeslDocsfromwesldoc_astand generates the documentation in HTML format.wesldoc_compiler: This crate takes the compile results fromwesl-rsand compiles them into aWeslDocsobject. It is agnostic to how the packages where resolved and compiled, but requires the availability of source maps to work properly.wesldoc: This crate is a wrapper aroundwesldoc_compilerandwesldoc_generator. It provides a CLI to generate the documentation from WESL packages. It useswesl-rsto resolve and compile the packages, and then generates the documentation usingwesldoc_compilerandwesldoc_generator.
Note: Certain features of
wesldocmay be migrated towesldoc_compilerin the future once a standardized method for packaging WESL projects is established.
To build the example packages, run:
cargo run --example build_examplesLicensed under either of
- MIT license (LICENSE-MIT)
- Apache License, Version 2.0 (LICENSE-APACHE)
at your option.