rustdoc: add missing macros to sibling nav sidebar
This commit is contained in:
parent
47c46324aa
commit
7bb2c96c69
@ -2079,6 +2079,7 @@ impl ItemSection {
|
||||
const ALL: &'static [Self] = {
|
||||
use ItemSection::*;
|
||||
// NOTE: The order here affects the order in the UI.
|
||||
// Keep this synchronized with addSidebarItems in main.js
|
||||
&[
|
||||
Reexports,
|
||||
PrimitiveTypes,
|
||||
|
@ -119,18 +119,16 @@ pub(super) fn print_sidebar(cx: &Context<'_>, it: &clean::Item, buffer: &mut Buf
|
||||
//
|
||||
// otherwise, the parent path header is redundant with the big crate
|
||||
// branding area at the top of the sidebar
|
||||
let sidebar_path = if it.is_mod() { &cx.current[..cx.current.len() - 1] } else { &cx.current[..] };
|
||||
let sidebar_path =
|
||||
if it.is_mod() { &cx.current[..cx.current.len() - 1] } else { &cx.current[..] };
|
||||
let path: String = if sidebar_path.len() > 1 || !title.is_empty() {
|
||||
let path = sidebar_path.iter().map(|s| s.as_str()).intersperse("::").collect();
|
||||
if sidebar_path.len() == 1 {
|
||||
format!("crate {path}")
|
||||
} else {
|
||||
path
|
||||
}
|
||||
if sidebar_path.len() == 1 { format!("crate {path}") } else { path }
|
||||
} else {
|
||||
"".into()
|
||||
};
|
||||
let sidebar = Sidebar { title_prefix, title, is_mod: it.is_mod(), is_crate: it.is_crate(), blocks, path };
|
||||
let sidebar =
|
||||
Sidebar { title_prefix, title, is_mod: it.is_mod(), is_crate: it.is_crate(), blocks, path };
|
||||
sidebar.render_into(buffer).unwrap();
|
||||
}
|
||||
|
||||
|
@ -490,19 +490,33 @@ function preLoadCss(cssUrl) {
|
||||
}
|
||||
|
||||
if (sidebar) {
|
||||
// keep this synchronized with ItemSection::ALL in html/render/mod.rs
|
||||
// Re-exports aren't shown here, because they don't have child pages
|
||||
//block("reexport", "reexports", "Re-exports");
|
||||
block("primitive", "primitives", "Primitive Types");
|
||||
block("mod", "modules", "Modules");
|
||||
block("macro", "macros", "Macros");
|
||||
block("struct", "structs", "Structs");
|
||||
block("enum", "enums", "Enums");
|
||||
block("union", "unions", "Unions");
|
||||
block("constant", "constants", "Constants");
|
||||
block("static", "static", "Statics");
|
||||
block("trait", "traits", "Traits");
|
||||
block("fn", "functions", "Functions");
|
||||
block("type", "types", "Type Aliases");
|
||||
block("union", "unions", "Unions");
|
||||
// No point, because these items don't appear in modules
|
||||
//block("impl", "impls", "Implementations");
|
||||
//block("tymethod", "tymethods", "Type Methods");
|
||||
//block("method", "methods", "Methods");
|
||||
//block("structfield", "fields", "Fields");
|
||||
//block("variant", "variants", "Variants");
|
||||
//block("associatedtype", "associated-types", "Associated Types");
|
||||
//block("associatedconstant", "associated-consts", "Associated Constants");
|
||||
block("foreigntype", "foreign-types", "Foreign Types");
|
||||
block("keyword", "keywords", "Keywords");
|
||||
block("opaque", "opaque-types", "Opaque Types");
|
||||
block("attr", "attributes", "Attribute Macros");
|
||||
block("derive", "derives", "Derive Macros");
|
||||
block("traitalias", "trait-aliases", "Trait Aliases");
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user