Import Godot docs for builtin types
- Dominant language
- Rust
- Stars
- 5.2k
- Forks
- 312
- Avg merge
- 12h 59m
- Merged PRs (30d)
- 9
Description
We should not manually write documentation for builtin types like `Vector3`, `Quaternion`, `Callable`, ... -- except in cases where the Rust API differs from Godot's. Otherwise, it would require us to copy-paste large swaths of Godot's docs, only for it to become outdated when upstream changes.
Instead, can automate it by pre-generating documentation in `godot-codegen` and importing it on demand:
```rs
// Generated code
macro_rules! godot_builtin_doc {
(Quaternion.spherical_cubic_interpolate) => {
"\n\nSome imported docs from Godot."
};
// all the stuff
}
```
```rs
impl Quaternion {
/// A manually written first part of the doc.
#[doc = godot_builtin_doc!(Quaternion.spherical_cubic_interpolate)]
pub fn spherical_cubic_interpolate() {
...
}
}
```
rustdoc output:

Contributor guide
Assessment
This issue has not been assessed yet.