diff --git a/crates/rune/src/doc/build.rs b/crates/rune/src/doc/build.rs index d06ff423c..f0575bc83 100644 --- a/crates/rune/src/doc/build.rs +++ b/crates/rune/src/doc/build.rs @@ -165,6 +165,18 @@ pub(crate) fn build( tests: Vec::new(), }; + // sort the crates by their name + initial.make_contiguous().sort_by_key(|item| { + if let Build::Module(m) = item { + if let Some(item) = m.item { + if let Some(name) = item.as_crate() { + return name; + } + } + } + "" + }); + let mut queue = initial.into_iter().try_collect::>()?; let mut modules = Vec::new();