1
Fork 0

Auto merge of #49954 - GuillaumeGomez:doc-settings, r=ollie27,QuietMisdreavus

Add rustdoc settings menu

Fixes #18167.

r? @QuietMisdreavus
This commit is contained in:
bors 2018-04-22 11:04:41 +00:00
commit 28193e873c
9 changed files with 231 additions and 26 deletions

View file

@ -85,6 +85,9 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
autocomplete=\"off\" \
placeholder=\"Click or press S to search, ? for more options…\" \
type=\"search\">\
<a id=\"settings-menu\" href=\"{root_path}settings.html\">\
<img src=\"{root_path}wheel{suffix}.svg\" width=\"18\" alt=\"Change settings\">\
</a>\
</div>\
</form>\
</nav>\
@ -182,9 +185,10 @@ pub fn render<T: fmt::Display, S: fmt::Display>(
themes = themes.iter()
.filter_map(|t| t.file_stem())
.filter_map(|t| t.to_str())
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}{}">"#,
.map(|t| format!(r#"<link rel="stylesheet" type="text/css" href="{}{}{}.css">"#,
page.root_path,
t.replace(".css", &format!("{}.css", page.resource_suffix))))
t,
page.resource_suffix))
.collect::<String>(),
suffix=page.resource_suffix,
)