alexcrichton opened PR #8727 from alexcrichton:bindgen-docs
to bytecodealliance:main
:
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 thewasmtime
crate and where it's located.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
alexcrichton requested fitzgen for a review on PR #8727.
alexcrichton requested wasmtime-core-reviewers for a review on PR #8727.
alexcrichton requested wasmtime-default-reviewers for a review on PR #8727.
elliottt submitted PR review.
alexcrichton merged PR #8727.
Last updated: Nov 22 2024 at 17:03 UTC