| 44220746 | 03-Jun-2024 |
Alex Crichton <[email protected]> |
Overhaul and improve documentation of `bindgen!` (#8727)
This is another take at improving the documentation for `bindgen!` in Wasmtime. This commit takes a leaf out of the book of bytecodealliance/
Overhaul and improve documentation of `bindgen!` (#8727)
This is another take at improving the documentation for `bindgen!` in Wasmtime. This commit takes a leaf out of the book of bytecodealliance/wit-bindgen#871 to organize the documentation of the macro a bit more rather than having one giant doc block that can be difficult to explore. The macro's documentation itself is now mostly a reference of all the options that can be specified. There is now a new documentation-only module which serves a few purposes:
* Individual examples are organized per-submodule to be a bit more digestable. * Each example has an example of the generated code in addition to the source code used for each example. * All examples are tested on CI to compile (none are run).
My hope is that this makes it easier to expand the docs here further over time with niche features as they arise or with various options that the macro has. This is one of the lynchpins of Wasmtime's support for the component model so it seems pretty important to have a good onboarding experience here.
Along the way I've implemented a few more niche options for the `bindgen!` macro that I found necessary, such as configuring the `wasmtime` crate and where it's located.
show more ...
|