-
-
Notifications
You must be signed in to change notification settings - Fork 237
Open
Labels
c: coreCore componentsCore componentsdocumentationImprovements or additions to documentationImprovements or additions to documentationfeatureAdds functionality to the libraryAdds functionality to the library
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:
// Generated code
macro_rules! godot_builtin_doc {
(Quaternion.spherical_cubic_interpolate) => {
"\n\nSome imported docs from Godot."
};
// all the stuff
}
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:
P5ina
Metadata
Metadata
Assignees
Labels
c: coreCore componentsCore componentsdocumentationImprovements or additions to documentationImprovements or additions to documentationfeatureAdds functionality to the libraryAdds functionality to the library