From f605ca3157085d0cf2de06be0af0ae13a50f85be Mon Sep 17 00:00:00 2001 From: webdevtodayjason <115739170+webdevtodayjason@users.noreply.github.com> Date: Mon, 12 Oct 2026 20:16:17 +0000 Subject: [PATCH 1/2] chore(contributors): add Jason Brashear --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index 67a8fdf3..9f964495 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -30,3 +30,6 @@ sync_github_name = true [people.thaynej] real_name = "Jeffrey Thayne" + +[people.webdevtodayjason] +display_name = "Jason Brashear" From 98f1340f61a44f3681d8f2d3cac6298b10be5912 Mon Sep 17 00:00:00 2001 From: webdevtodayjason <115739170+webdevtodayjason@users.noreply.github.com> Date: Mon, 12 Oct 2026 20:16:17 +0000 Subject: [PATCH 2/2] fix(index): keep level 3 and 4 topics in a run-in index --- crates/doc/src/index.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/crates/doc/src/index.rs b/crates/doc/src/index.rs index 0c2e58f4..84d8caf6 100644 --- a/crates/doc/src/index.rs +++ b/crates/doc/src/index.rs @@ -184,10 +184,15 @@ fn entry_text(spec: &IndexSpec, n: &Node, page_name: &dyn Fn(usize) -> String) - t } +// `build` limits topic paths to four levels, bounding this traversal. +fn run_in_subtopics(spec: &IndexSpec, n: &Node, page_name: &dyn Fn(usize) -> String) -> Vec { + n.children.values().flat_map(|c| [entry_text(spec, c, page_name)].into_iter().chain(run_in_subtopics(spec, c, page_name))).collect() +} + fn emit(spec: &IndexSpec, n: &Node, level: usize, page_name: &dyn Fn(usize) -> String, out: &mut Vec<(String, String)>) { if spec.run_in && level == 1 { let mut t = entry_text(spec, n, page_name); - let subs: Vec = n.children.values().map(|c| entry_text(spec, c, page_name)).collect(); + let subs = run_in_subtopics(spec, n, page_name); if !subs.is_empty() { t.push_str(": "); t.push_str(&subs.join(&spec.between_entries)); @@ -209,6 +214,19 @@ mod tests { Resolved { r: IndexRef { topics: topics.iter().map(|s| s.to_string()).collect(), sort: vec![], range }, pages } } + #[test] + fn run_in_keeps_all_topic_levels_in_sort_order() { + let refs = vec![ + r(&["Typography", "kerning", "pairs", "optical"], IndexRange::CurrentPage, Some((4, 4))), + r(&["Typography", "kerning", "pairs"], IndexRange::CurrentPage, Some((2, 2))), + r(&["Typography", "leading"], IndexRange::CurrentPage, Some((6, 6))), + r(&["Typography", "kerning", "adjustment"], IndexRange::See("Spacing".into()), None), + ]; + let spec = IndexSpec { run_in: true, title: String::new(), section_headings: false, between_entries: " / ".into(), ..IndexSpec::default() }; + let out = build(&spec, &refs, &|p| (p + 1).to_string()); + assert_eq!(out, [("Index Level 1".into(), "Typography: kerning / adjustment See Spacing / pairs 3 / optical 5 / leading 7".into())]); + } + #[test] fn builds_nested_index() { let refs = vec![