Handle reexports items list a bit differently since they cannot have documentation

This commit is contained in:
Guillaume Gomez 2025-01-17 18:35:56 +01:00
parent b6ad420a20
commit 42f9c79776
2 changed files with 6 additions and 8 deletions

View File

@ -141,6 +141,7 @@ macro_rules! item_template_methods {
}
const ITEM_TABLE_OPEN: &str = "<dl class=\"item-table\">";
const REEXPORTS_TABLE_OPEN: &str = "<dl class=\"item-table reexports\">";
const ITEM_TABLE_CLOSE: &str = "</dl>";
// A component in a `use` path, like `string` in std::string::ToString
@ -398,13 +399,10 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl
w.write_str(ITEM_TABLE_CLOSE);
}
last_section = Some(my_section);
write_section_heading(
w,
my_section.name(),
&cx.derive_id(my_section.id()),
None,
ITEM_TABLE_OPEN,
);
let section_id = my_section.id();
let tag =
if section_id == "reexports" { REEXPORTS_TABLE_OPEN } else { ITEM_TABLE_OPEN };
write_section_heading(w, my_section.name(), &cx.derive_id(section_id), None, tag);
}
match myitem.kind {

View File

@ -2543,7 +2543,7 @@ in src-script.js and main.js
}
/* Since the screen is wide enough, we show items on their description on the same line. */
.item-table {
.item-table:not(.reexports) {
display: grid;
grid-template-columns: 33% 67%;
}