Misc docs polishing (#6712)

* Fake modules for Rust std lib functions

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Include the missing @ in Rust std lib fns

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Move revolve and mirror2d to better modules

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Use docs from KCL mods for type summaries

Signed-off-by: Nick Cameron <nrc@ncameron.org>

* Use type docs to describe types from KCL std lib

Signed-off-by: Nick Cameron <nrc@ncameron.org>

---------

Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
Nick Cameron
2025-05-06 16:09:59 +12:00
committed by GitHub
parent 1e056cfd8a
commit 1841e63021
116 changed files with 1178 additions and 1095 deletions

View File

@ -307,6 +307,15 @@ impl DocData {
_ => unreachable!(),
}
}
pub(super) fn summary(&self) -> Option<&String> {
match self {
DocData::Fn(f) => f.summary.as_ref(),
DocData::Const(c) => c.summary.as_ref(),
DocData::Ty(t) => t.summary.as_ref(),
DocData::Mod(m) => m.summary.as_ref(),
}
}
}
#[derive(Debug, Clone)]
@ -459,7 +468,6 @@ impl ModData {
}
}
#[cfg(test)]
pub fn find_by_name(&self, name: &str) -> Option<&DocData> {
if let Some(result) = self.children.values().find(|dd| dd.name() == name) {
return Some(result);