llm docs improvements (#7726)

This commit is contained in:
Anton-4 2025-04-04 18:37:46 +02:00 committed by GitHub
parent 7e6d846ff6
commit dd11c2cf9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 18 additions and 42 deletions

View file

@ -246,38 +246,25 @@ fn render_package_index(docs_by_module: &[(ModuleId, ModuleDocumentation)]) -> S
push_html(&mut module_list_buf, "li", [], link_buf.as_str());
}
let header = {
let mut header_buf = String::new();
push_html(
&mut header_buf,
"h2",
[("class", "module-name")],
"Exposed Modules",
);
push_html(
&mut header_buf,
"a",
[
("class", "llm-prompt-link"),
("title", "Documentation in a LLM-friendly format"),
("href", "llms.txt"),
],
"LLM docs",
);
header_buf
};
// The HTML for the index page
let mut index_buf = String::new();
push_html(
&mut index_buf,
"div",
[("class", "module-header-container")],
&header,
"a",
[
("class", "ai-docs-link"),
("title", "Documentation in an AI-friendly format"),
("href", "llms.txt"),
],
"<span style=\"vertical-align: 2px;\">🤖</span> AI docs",
);
push_html(
&mut index_buf,
"h2",
[("class", "module-name")],
"Exposed Modules",
);
push_html(

View file

@ -714,19 +714,8 @@ pre>samp {
line-height: 1.3em;
}
.module-header-container {
display: flex;
justify-content: space-between;
align-items: flex-end;
margin-bottom: 48px;
}
.llm-prompt-link {
flex-shrink: 0;
}
.module-name {
flex-grow: 1;
.ai-docs-link {
margin-bottom: 10px;
}
@media (prefers-color-scheme: dark) {