diff --git a/src/librustdoc/html/highlight.rs b/src/librustdoc/html/highlight.rs index 688860f94e183..de237bbd5ad57 100644 --- a/src/librustdoc/html/highlight.rs +++ b/src/librustdoc/html/highlight.rs @@ -48,22 +48,10 @@ crate fn render_with_highlighting( decoration_info: Option<DecorationInfo>, ) { debug!("highlighting: ================\n{}\n==============", src); - if let Some((edition_info, class)) = tooltip { - write!( - out, - "<div class='information'><div class='tooltip {}'{}>β</div></div>", - class, - if let Some(edition_info) = edition_info { - format!(" data-edition=\"{}\"", edition_info) - } else { - String::new() - }, - ); - } write_header(out, class, extra_content); write_code(out, src, edition, context_info, decoration_info); - write_footer(out, playground_button); + write_footer(out, tooltip, playground_button); } fn write_header(out: &mut Buffer, class: Option<&str>, extra_content: Option<Buffer>) { @@ -114,8 +102,25 @@ fn write_code( }); } -fn write_footer(out: &mut Buffer, playground_button: Option<&str>) { - writeln!(out, "</code></pre>{}</div>", playground_button.unwrap_or_default()); +fn write_footer( + out: &mut Buffer, + tooltip: Option<(Option<Edition>, &str)>, + playground_button: Option<&str>, +) { + writeln!(out, "</code></pre>"); + if let Some((edition_info, class)) = tooltip { + write!( + out, + "<div class='information'><div class='tooltip {}'{}><span class='icon'>β</span></div></div>", + class, + if let Some(edition_info) = edition_info { + format!(" data-edition=\"{}\"", edition_info) + } else { + String::new() + }, + ); + } + writeln!(out, "{}</div>", playground_button.unwrap_or_default()); } /// How a span of text is classified. Mostly corresponds to token kinds. diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 166e084012724..13c7c0eca3534 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -361,7 +361,7 @@ enum Setting { } impl Setting { - fn display(&self, root_path: &str, suffix: &str) -> String { + fn display(&self) -> String { match *self { Setting::Section { description, ref sub_settings } => format!( "<div class=\"setting-line\">\ @@ -369,7 +369,7 @@ impl Setting { <div class=\"sub-settings\">{}</div> </div>", description, - sub_settings.iter().map(|s| s.display(root_path, suffix)).collect::<String>() + sub_settings.iter().map(|s| s.display()).collect::<String>() ), Setting::Toggle { js_data_name, description, default_value } => format!( "<div class=\"setting-line\">\ @@ -388,7 +388,7 @@ impl Setting { <div>{}</div>\ <label class=\"select-wrapper\">\ <select id=\"{}\" autocomplete=\"off\">{}</select>\ - <img src=\"{}down-arrow{}.svg\" alt=\"Select item\">\ + <span class=\"icon\">β·</span>\ </label>\ </div>", description, @@ -401,8 +401,6 @@ impl Setting { name = opt, )) .collect::<String>(), - root_path, - suffix, ), } } @@ -462,7 +460,7 @@ fn settings(root_path: &str, suffix: &str, theme_names: Vec<String>) -> Result<S <div class=\"settings\">{}</div>\ <link rel=\"stylesheet\" href=\"{root_path}settings{suffix}.css\">\ <script src=\"{root_path}settings{suffix}.js\"></script>", - settings.iter().map(|s| s.display(root_path, suffix)).collect::<String>(), + settings.iter().map(|s| s.display()).collect::<String>(), root_path = root_path, suffix = suffix )) @@ -667,8 +665,7 @@ fn short_item_info( message.push_str(&format!(": {}", html.into_string())); } extra_info.push(format!( - "<div class=\"stab deprecated\"><span class=\"emoji\">π</span> {}</div>", - message, + "<div class=\"stab deprecated\"><span class=\"icon\">π</span> {message}</div>" )); } @@ -680,9 +677,6 @@ fn short_item_info( .filter(|stab| stab.feature != sym::rustc_private) .map(|stab| (stab.level, stab.feature)) { - let mut message = - "<span class=\"emoji\">π¬</span> This is a nightly-only experimental API.".to_owned(); - let mut feature = format!("<code>{}</code>", Escape(&feature.as_str())); if let (Some(url), Some(issue)) = (&cx.shared.issue_tracker_base_url, issue) { feature.push_str(&format!( @@ -692,9 +686,9 @@ fn short_item_info( )); } - message.push_str(&format!(" ({})", feature)); - - extra_info.push(format!("<div class=\"stab unstable\">{}</div>", message)); + extra_info.push(format!( + "<div class=\"stab unstable\"><span class=\"icon\">π¬</span> This is a nightly-only experimental API. ({feature})</div>" + )); } if let Some(portability) = portability(item, parent) { @@ -1292,7 +1286,7 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String { if !out.is_empty() { out.insert_str( 0, - "<span class=\"notable-traits\"><span class=\"notable-traits-tooltip\">β\ + "<span class=\"notable-traits\"><span class=\"notable-traits-tooltip\"><span class=\"icon\">β</span>\ <div class=\"notable-traits-tooltiptext\"><span class=\"docblock\">", ); out.push_str("</code></span></div></span></span>"); diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 9943e23b9281c..6d50f033230b3 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -380,7 +380,7 @@ fn item_module(w: &mut Buffer, cx: &Context<'_>, item: &clean::Item, items: &[cl clean::FunctionItem(ref func) | clean::ForeignFunctionItem(ref func) if func.header.unsafety == hir::Unsafety::Unsafe => { - "<a title=\"unsafe function\" href=\"#\"><sup>β </sup></a>" + "<a title=\"unsafe function\" href=\"#\"><sup class=\"icon\">β </sup></a>" } _ => "", }; diff --git a/src/librustdoc/html/render/write_shared.rs b/src/librustdoc/html/render/write_shared.rs index 0d5ba8e80d242..e29c9939a18e4 100644 --- a/src/librustdoc/html/render/write_shared.rs +++ b/src/librustdoc/html/render/write_shared.rs @@ -200,12 +200,12 @@ pub(super) fn write_shared( write_minify( "rustdoc.css", static_files::RUSTDOC_CSS + .replace("/* AUTOREPLACE: */url('icons.woff2')", &ver_url(cx, "icons.woff2")) + .replace("/* AUTOREPLACE: */url('icons.woff')", &ver_url(cx, "icons.woff")) .replace( - "/* AUTOREPLACE: */url(\"toggle-minus.svg\")", - &ver_url(cx, "toggle-minus.svg"), - ) - .replace("/* AUTOREPLACE: */url(\"toggle-plus.svg\")", &ver_url(cx, "toggle-plus.svg")) - .replace("/* AUTOREPLACE: */url(\"down-arrow.svg\")", &ver_url(cx, "down-arrow.svg")), + "AUTOREPLACE: icons-FontAwesome-LICENSE.txt", + &ver_url(cx, "icons-FontAwesome-LICENSE.txt"), + ), cx, options, )?; @@ -247,12 +247,10 @@ pub(super) fn write_shared( write_toolchain("favicon-16x16.png", static_files::RUST_FAVICON_PNG_16)?; write_toolchain("favicon-32x32.png", static_files::RUST_FAVICON_PNG_32)?; } - write_toolchain("brush.svg", static_files::BRUSH_SVG)?; - write_toolchain("wheel.svg", static_files::WHEEL_SVG)?; - write_toolchain("clipboard.svg", static_files::CLIPBOARD_SVG)?; - write_toolchain("down-arrow.svg", static_files::DOWN_ARROW_SVG)?; - write_toolchain("toggle-minus.svg", static_files::TOGGLE_MINUS_PNG)?; - write_toolchain("toggle-plus.svg", static_files::TOGGLE_PLUS_PNG)?; + + write_toolchain("icons.woff", static_files::icons::WOFF)?; + write_toolchain("icons.woff2", static_files::icons::WOFF2)?; + write_toolchain("icons-FontAwesome-LICENSE.txt", static_files::icons::LICENSE)?; let mut themes: Vec<&String> = themes.iter().collect(); themes.sort(); diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 5751ec2cc02b3..4ed496b5db37f 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -84,6 +84,17 @@ unicode-range: U+AC00-D7AF, U+1100-11FF, U+3130-318F, U+A960-A97F, U+D7B0-D7FF; } +/* Icon font generated from hand-picked SVGs */ +/* See AUTOREPLACE: icons-FontAwesome-LICENSE.txt for the Font awesome license. */ +@font-face { + font-family: 'icons'; + src: /* AUTOREPLACE: */url('icons.woff2') format('woff2'), + /* AUTOREPLACE: */url('icons.woff') format('woff'); + font-weight: normal; + font-style: normal; + font-display: swap; +} + * { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; @@ -117,6 +128,10 @@ body { font-feature-settings: "kern", "liga"; } +.icon { + font-family: 'icons'; +} + h1 { font-size: 1.5em; } @@ -197,7 +212,6 @@ h1, h2, h3, h4, h5, h6, .item-left > a, div.item-list .out-of-band, span.since, #source-sidebar, #sidebar-toggle, -details.rustdoc-toggle > summary::before, div.impl-items > div:not(.docblock):not(.item-info), .content ul.crate a.crate, a.srclink, /* This selector is for the items listed in the "all items" page. */ @@ -510,6 +524,12 @@ nav.sub { margin-bottom: 10px; } +.rustdoc .docblock > .example-wrap { + /* Override `.docblock > *` style since internal `pre` has `overflow-x: auto` anyways. + Allows us to put `.information` within `.example-wrap` for pure CSS hover. */ + overflow-x: visible; +} + .example-wrap { position: relative; width: 100%; @@ -864,14 +884,17 @@ h2.small-section-header > .anchor { width: calc(100% - 63px); } #crate-search { - min-width: 115px; + flex: none; margin-top: 5px; + display: flex; + border-radius: 4px 0 0 4px; +} +#crate-search > select { + min-width: 115px; padding: 6px; padding-right: 19px; - flex: none; border: 0; border-right: 0; - border-radius: 4px 0 0 4px; outline: none; cursor: pointer; border-right: 1px solid; @@ -880,11 +903,14 @@ h2.small-section-header > .anchor { /* Removes default arrow from firefox */ text-indent: 0.01px; text-overflow: ""; - background-repeat: no-repeat; background-color: transparent; - background-size: 20px; - background-position: calc(100% - 1px) 56%; - background-image: /* AUTOREPLACE: */url("down-arrow.svg"); +} +#crate-search > .icon { + font-size: 20px; + margin: 5px; + margin-left: -19px; + padding-top: 3px; + pointer-events: none; } .search-container > .top-button { position: absolute; @@ -1038,19 +1064,10 @@ body.blur > :not(#help) { display: inline; } -.stab .emoji { +.stab .icon { font-size: 1.2em; } -/* Black one-pixel outline around emoji shapes */ -.emoji { - text-shadow: - 1px 0 0 black, - -1px 0 0 black, - 0 1px 0 black, - 0 -1px 0 black; -} - .module-item .stab, .import-item .stab { border-radius: 3px; @@ -1212,7 +1229,7 @@ h3.variant { .information { position: absolute; left: -25px; - margin-top: 7px; + top: 7px; z-index: 1; } @@ -1427,19 +1444,19 @@ pre.rust { #theme-picker, #settings-menu, #help-button, #copy-path { padding: 4px; + padding-top: 2px; width: 27px; height: 29px; border: 1px solid; border-radius: 3px; cursor: pointer; + text-align: center; + font-size: 17px; } #help-button { right: 30px; font-family: "Fira Sans", Arial, sans-serif; - text-align: center; - font-size: 17px; - padding-top: 2px; } #copy-path { @@ -1588,18 +1605,6 @@ details.rustdoc-toggle > summary.hideme > span { margin-left: 9px; } -details.rustdoc-toggle > summary::before { - content: ""; - cursor: pointer; - width: 17px; - height: max(17px, 1.1em); - background-repeat: no-repeat; - background-position: top left; - display: inline-block; - vertical-align: middle; - opacity: .5; -} - /* Screen readers see the text version at the end the line. Visual readers see the icon at the start of the line, but small and transparent. */ details.rustdoc-toggle > summary::after { @@ -1615,15 +1620,8 @@ details.rustdoc-toggle > summary.hideme::after { content: ""; } -details.rustdoc-toggle > summary:focus::before, -details.rustdoc-toggle > summary:hover::before { - opacity: 1; -} - details.rustdoc-toggle.top-doc > summary, -details.rustdoc-toggle.top-doc > summary::before, -details.rustdoc-toggle.non-exhaustive > summary, -details.rustdoc-toggle.non-exhaustive > summary::before { +details.rustdoc-toggle.non-exhaustive > summary { font-family: 'Fira Sans'; font-size: 16px; } @@ -1664,24 +1662,17 @@ details.rustdoc-toggle[open] > summary.hideme > span { display: none; } -details.undocumented[open] > summary::before, -details.rustdoc-toggle[open] > summary::before, -details.rustdoc-toggle[open] > summary.hideme::before { - background-image: /* AUTOREPLACE: */url("toggle-minus.svg"); -} - -details.undocumented > summary::before, details.rustdoc-toggle > summary::before { - background-image: /* AUTOREPLACE: */url("toggle-plus.svg"); +details.undocumented > summary::before, +details.rustdoc-toggle > summary::before { + font-family: 'icons'; + font-size: 13px; + cursor: pointer; + content: "β"; } -details.rustdoc-toggle[open] > summary::before, -details.rustdoc-toggle[open] > summary.hideme::before { - width: 17px; - height: max(17px, 1.1em); - background-repeat: no-repeat; - background-position: top left; - display: inline-block; - content: ""; +details.undocumented[open] > summary::before, +details.rustdoc-toggle[open] > summary::before { + content: "β"; } details.rustdoc-toggle[open] > summary::after, @@ -1696,7 +1687,7 @@ details.rustdoc-toggle[open] > summary.hideme::after { to prevent an overlay between the "collapse toggle" and the information tooltip. However, it's not needed with smaller screen width because the doc/code block is always put "one line" below. */ - .docblock > .information:first-child > .tooltip { + .docblock > .example-wrap:first-child > .information { margin-top: 16px; } @@ -2035,6 +2026,7 @@ details.rustdoc-toggle[open] > summary.hideme::after { #theme-picker, #settings-menu { padding: 5px; + padding-top: 3px; width: 31px; height: 31px; } diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css index fb8990b30e2ed..0c14bacd04fad 100644 --- a/src/librustdoc/html/static/css/settings.css +++ b/src/librustdoc/html/static/css/settings.css @@ -47,15 +47,17 @@ width: 100%; } -.select-wrapper img { +.select-wrapper .icon { pointer-events: none; position: absolute; right: 0; - bottom: 0; + top: 0; background: #ccc; height: 100%; - width: 28px; - padding: 0px 4px; + padding: 2px 4px; + color: #000; + font-size: 26px; + line-height: 1; } .select-wrapper select option { diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css index dea6d08396f31..95680521d17ad 100644 --- a/src/librustdoc/html/static/css/themes/ayu.css +++ b/src/librustdoc/html/static/css/themes/ayu.css @@ -239,9 +239,11 @@ details.undocumented > summary::before { color: #999; } -details.rustdoc-toggle > summary::before, -details.undocumented > summary::before { - filter: invert(100%); +details.rustdoc-toggle > summary:focus::before, +details.rustdoc-toggle > summary:hover::before, +details.undocumented > summary:focus::before, +details.undocumented > summary:hover::before { + color: #fff; } #crate-search { @@ -356,48 +358,42 @@ a.test-arrow:hover { pre.compile_fail { border-left: 2px solid rgba(255,0,0,.4); } +.tooltip.compile_fail { + color: rgba(255,0,0,.4); +} -pre.compile_fail:hover, .information:hover + pre.compile_fail { +.example-wrap:hover pre.compile_fail { border-left: 2px solid #f00; } +.example-wrap:hover .tooltip.compile_fail { + color: #f00; +} pre.should_panic { border-left: 2px solid rgba(255,0,0,.4); } - -pre.should_panic:hover, .information:hover + pre.should_panic { - border-left: 2px solid #f00; -} - -pre.ignore { - border-left: 2px solid rgba(255,142,0,.6); -} - -pre.ignore:hover, .information:hover + pre.ignore { - border-left: 2px solid #ff9200; +.tooltip.should_panic { + color: rgba(255,0,0,.4); } -.tooltip.compile_fail { - color: rgba(255,0,0,.5); +.example-wrap:hover pre.should_panic { + border-left: 2px solid #f00; } - -.information > .compile_fail:hover { +.example-wrap:hover .tooltip.should_panic { color: #f00; } -.tooltip.should_panic { - color: rgba(255,0,0,.5); -} - -.information > .should_panic:hover { - color: #f00; +pre.ignore { + border-left: 2px solid rgba(255,142,0,.6); } - .tooltip.ignore { color: rgba(255,142,0,.6); } -.information > .ignore:hover { +.example-wrap:hover pre.ignore { + border-left: 2px solid #ff9200; +} +.example-wrap:hover .tooltip.ignore { color: #ff9200; } @@ -541,13 +537,10 @@ kbd { } #copy-path { - color: #fff; + color: #b2b2b2; } -#copy-path > img { - filter: invert(70%); -} -#copy-path:hover > img { - filter: invert(100%); +#copy-path:hover { + color: #fff; } #theme-picker:hover, #theme-picker:focus, @@ -633,5 +626,5 @@ input:checked + .slider { background: #616161; } .toggle-line:hover .toggle-line-inner { - background: ##898989; + background: #898989; } diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css index 6e2cbbecbf712..1c59cde40f60f 100644 --- a/src/librustdoc/html/static/css/themes/dark.css +++ b/src/librustdoc/html/static/css/themes/dark.css @@ -204,9 +204,11 @@ details.undocumented > summary::before { color: #999; } -details.rustdoc-toggle > summary::before, -details.undocumented > summary::before { - filter: invert(100%); +details.rustdoc-toggle > summary:focus::before, +details.rustdoc-toggle > summary:hover::before, +details.undocumented > summary:focus::before, +details.undocumented > summary:hover::before { + color: #fff; } #crate-search { @@ -304,48 +306,42 @@ a.test-arrow:hover{ pre.compile_fail { border-left: 2px solid rgba(255,0,0,.8); } - -pre.compile_fail:hover, .information:hover + pre.compile_fail { - border-left: 2px solid #f00; -} - -pre.should_panic { - border-left: 2px solid rgba(255,0,0,.8); -} - -pre.should_panic:hover, .information:hover + pre.should_panic { - border-left: 2px solid #f00; -} - -pre.ignore { - border-left: 2px solid rgba(255,142,0,.6); -} - -pre.ignore:hover, .information:hover + pre.ignore { - border-left: 2px solid #ff9200; -} - .tooltip.compile_fail { color: rgba(255,0,0,.8); } -.information > .compile_fail:hover { +.example-wrap:hover pre.compile_fail { + border-left: 2px solid #f00; +} +.example-wrap:hover .tooltip.compile_fail { color: #f00; } +pre.should_panic { + border-left: 2px solid rgba(255,0,0,.8); +} .tooltip.should_panic { color: rgba(255,0,0,.8); } -.information > .should_panic:hover { +.example-wrap:hover pre.should_panic { + border-left: 2px solid #f00; +} +.example-wrap:hover .tooltip.should_panic { color: #f00; } +pre.ignore { + border-left: 2px solid rgba(255,142,0,.6); +} .tooltip.ignore { color: rgba(255,142,0,.6); } -.information > .ignore:hover { +.example-wrap:hover pre.ignore { + border-left: 2px solid #ff9200; +} +.example-wrap:hover .tooltip.ignore { color: #ff9200; } @@ -425,13 +421,10 @@ kbd { } #copy-path { - color: #999; -} -#copy-path > img { - filter: invert(50%); + color: #7f7f7f; } -#copy-path:hover > img { - filter: invert(65%); +#copy-path:hover { + color: #a5a5a5; } #theme-choices { @@ -505,5 +498,5 @@ div.files > .selected { background: #616161; } .toggle-line:hover .toggle-line-inner { - background: ##898989; + background: #898989; } diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css index 4bf411d459a35..ebe1bf3565582 100644 --- a/src/librustdoc/html/static/css/themes/light.css +++ b/src/librustdoc/html/static/css/themes/light.css @@ -199,6 +199,13 @@ details.undocumented > summary::before { color: #999; } +details.rustdoc-toggle > summary:focus::before, +details.rustdoc-toggle > summary:hover::before, +details.undocumented > summary:focus::before, +details.undocumented > summary:hover::before { + color: #000; +} + #crate-search { color: #555; background-color: white; @@ -291,48 +298,42 @@ a.test-arrow:hover{ pre.compile_fail { border-left: 2px solid rgba(255,0,0,.5); } - -pre.compile_fail:hover, .information:hover + pre.compile_fail { - border-left: 2px solid #f00; -} - -pre.should_panic { - border-left: 2px solid rgba(255,0,0,.5); -} - -pre.should_panic:hover, .information:hover + pre.should_panic { - border-left: 2px solid #f00; -} - -pre.ignore { - border-left: 2px solid rgba(255,142,0,.6); -} - -pre.ignore:hover, .information:hover + pre.ignore { - border-left: 2px solid #ff9200; -} - .tooltip.compile_fail { color: rgba(255,0,0,.5); } -.information > .compile_fail:hover { +.example-wrap:hover pre.compile_fail { + border-left: 2px solid #f00; +} +.example-wrap:hover .tooltip.compile_fail { color: #f00; } +pre.should_panic { + border-left: 2px solid rgba(255,0,0,.5); +} .tooltip.should_panic { color: rgba(255,0,0,.5); } -.information > .should_panic:hover { +.example-wrap:hover pre.should_panic { + border-left: 2px solid #f00; +} +.example-wrap:hover .tooltip.should_panic { color: #f00; } +pre.ignore { + border-left: 2px solid rgba(255,142,0,.6); +} .tooltip.ignore { color: rgba(255,142,0,.6); } -.information > .ignore:hover { +.example-wrap:hover pre.ignore { + border-left: 2px solid #ff9200; +} +.example-wrap:hover .tooltip.ignore { color: #ff9200; } @@ -401,6 +402,7 @@ kbd { #theme-picker, #settings-menu, #help-button { border-color: #e0e0e0; background-color: #fff; + color: #000; } #theme-picker:hover, #theme-picker:focus, @@ -410,13 +412,10 @@ kbd { } #copy-path { - color: #999; -} -#copy-path > img { - filter: invert(50%); + color: #7f7f7f; } -#copy-path:hover > img { - filter: invert(35%); +#copy-path:hover { + color: #595959; } #theme-choices { diff --git a/src/librustdoc/html/static/fonts/icons-FontAwesome-LICENSE.txt b/src/librustdoc/html/static/fonts/icons-FontAwesome-LICENSE.txt new file mode 100644 index 0000000000000..79d50e57be4ae --- /dev/null +++ b/src/librustdoc/html/static/fonts/icons-FontAwesome-LICENSE.txt @@ -0,0 +1,43 @@ +Font Awesome Icons: + - U+23F7 (caret-down) + - U+2699 (cog) + - U+26A0 (exclamation-triangle) + - U+1F52C (flask) + - U+24D8 (info-circle) + - U+1F58C (paint-brush) + - U+1F44E (thumbs-down) + +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** \ No newline at end of file diff --git a/src/librustdoc/html/static/fonts/icons.woff b/src/librustdoc/html/static/fonts/icons.woff new file mode 100644 index 0000000000000..9c69dcd854530 Binary files /dev/null and b/src/librustdoc/html/static/fonts/icons.woff differ diff --git a/src/librustdoc/html/static/fonts/icons.woff2 b/src/librustdoc/html/static/fonts/icons.woff2 new file mode 100644 index 0000000000000..741f5f99bd80f Binary files /dev/null and b/src/librustdoc/html/static/fonts/icons.woff2 differ diff --git a/src/librustdoc/html/static/images/brush.svg b/src/librustdoc/html/static/images/brush.svg deleted file mode 100644 index ea266e856a9d8..0000000000000 --- a/src/librustdoc/html/static/images/brush.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" width="1792" height="1792" viewBox="0 0 1792 1792"><path d="M1615 0q70 0 122.5 46.5t52.5 116.5q0 63-45 151-332 629-465 752-97 91-218 91-126 0-216.5-92.5t-90.5-219.5q0-128 92-212l638-579q59-54 130-54zm-909 1034q39 76 106.5 130t150.5 76l1 71q4 213-129.5 347t-348.5 134q-123 0-218-46.5t-152.5-127.5-86.5-183-29-220q7 5 41 30t62 44.5 59 36.5 46 17q41 0 55-37 25-66 57.5-112.5t69.5-76 88-47.5 103-25.5 125-10.5z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/LICENSE.txt b/src/librustdoc/html/static/images/bundled_into_icon_font/LICENSE.txt new file mode 100644 index 0000000000000..b32d3db9ebca1 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/LICENSE.txt @@ -0,0 +1,43 @@ +Font Awesome Icons: + - caret-down.svg + - cog.svg + - exclamation-triangle.svg + - flask.svg + - info-circle.svg + - paint-brush.svg + - thumbs-down.svg + +Font Awesome Free License +------------------------- + +Font Awesome Free is free, open source, and GPL friendly. You can use it for +commercial projects, open source projects, or really almost whatever you want. +Full Font Awesome Free license: https://fontawesome.com/license/free. + +# Icons: CC BY 4.0 License (https://creativecommons.org/licenses/by/4.0/) +In the Font Awesome Free download, the CC BY 4.0 license applies to all icons +packaged as SVG and JS file types. + +# Fonts: SIL OFL 1.1 License (https://scripts.sil.org/OFL) +In the Font Awesome Free download, the SIL OFL license applies to all icons +packaged as web and desktop font files. + +# Code: MIT License (https://opensource.org/licenses/MIT) +In the Font Awesome Free download, the MIT license applies to all non-font and +non-icon files. + +# Attribution +Attribution is required by MIT, SIL OFL, and CC BY licenses. Downloaded Font +Awesome Free files already contain embedded comments with sufficient +attribution, so you shouldn't need to do anything additional when using these +files normally. + +We've kept attribution comments terse, so we ask that you do not actively work +to remove them from files, especially code. They're a great way for folks to +learn about Font Awesome. + +# Brand Icons +All brand icons are trademarks of their respective owners. The use of these +trademarks does not indicate endorsement of the trademark holder by Font +Awesome, nor vice versa. **Please do not use brand logos for any purpose except +to represent the company, product, or service to which they refer.** \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/README.md b/src/librustdoc/html/static/images/bundled_into_icon_font/README.md new file mode 100644 index 0000000000000..007f6b03daebf --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/README.md @@ -0,0 +1,31 @@ +The SVGs in this directory are bundled into a webfont. This allows them to be easily colored with CSS. + +## Creating the webfont + +Use https://fontello.com + +1. Drag all SVG images in this folder onto the webpage to upload them +2. After upload is complete, select them all by dragging a rectangle over them under "**Custom Icons**" +3. Go to the "Customize Codes" tab +4. We use the following for each icon + +| Icon | Unicode Character | Unicode Code | +|--------------- |-------------------|--------------| +|  | β· | 23F7 | +|  | π | 1F4CB | +|  | β | 2699 | +|  | β | 26A0 | +|  | π¬ | 1F52C | +|  | β | 24D8 | +|  | π | 1F58C | +|  | π | 1F44E | +|  | β | 229F | +|  | β | 229E | + +We set these characters to fitting Unicode symbols for the fallback case if a user's browser doesn't support our webfonts or has webfonts disabled. + +5. Click the wrench icon, then go to "Advanced font settings" +6. Select Unicode encoding +7. Set "font name" to `icons` +8. Download webfont +9. Extract `font/icons.woff` and `font/icons.woff2` into `static/fonts` diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/caret-down.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/caret-down.svg new file mode 100644 index 0000000000000..b3ee2ea95198c --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/caret-down.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><path d="M31.3 192h257.3c17.8 0 26.7 21.5 14.1 34.1L174.1 354.8c-7.8 7.8-20.5 7.8-28.3 0L17.2 226.1C4.6 213.5 13.5 192 31.3 192z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/clipboard.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/clipboard.svg similarity index 100% rename from src/librustdoc/html/static/images/clipboard.svg rename to src/librustdoc/html/static/images/bundled_into_icon_font/clipboard.svg diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/cog.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/cog.svg new file mode 100644 index 0000000000000..fb5bd35ac9671 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/cog.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M487.4 315.7l-42.6-24.6c4.3-23.2 4.3-47 0-70.2l42.6-24.6c4.9-2.8 7.1-8.6 5.5-14-11.1-35.6-30-67.8-54.7-94.6-3.8-4.1-10-5.1-14.8-2.3L380.8 110c-17.9-15.4-38.5-27.3-60.8-35.1V25.8c0-5.6-3.9-10.5-9.4-11.7-36.7-8.2-74.3-7.8-109.2 0-5.5 1.2-9.4 6.1-9.4 11.7V75c-22.2 7.9-42.8 19.8-60.8 35.1L88.7 85.5c-4.9-2.8-11-1.9-14.8 2.3-24.7 26.7-43.6 58.9-54.7 94.6-1.7 5.4.6 11.2 5.5 14L67.3 221c-4.3 23.2-4.3 47 0 70.2l-42.6 24.6c-4.9 2.8-7.1 8.6-5.5 14 11.1 35.6 30 67.8 54.7 94.6 3.8 4.1 10 5.1 14.8 2.3l42.6-24.6c17.9 15.4 38.5 27.3 60.8 35.1v49.2c0 5.6 3.9 10.5 9.4 11.7 36.7 8.2 74.3 7.8 109.2 0 5.5-1.2 9.4-6.1 9.4-11.7v-49.2c22.2-7.9 42.8-19.8 60.8-35.1l42.6 24.6c4.9 2.8 11 1.9 14.8-2.3 24.7-26.7 43.6-58.9 54.7-94.6 1.5-5.5-.7-11.3-5.6-14.1zM256 336c-44.1 0-80-35.9-80-80s35.9-80 80-80 80 35.9 80 80-35.9 80-80 80z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/exclamation-triangle.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/exclamation-triangle.svg new file mode 100644 index 0000000000000..2ab53271b42a7 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/exclamation-triangle.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 576 512"><path d="M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/flask.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/flask.svg new file mode 100644 index 0000000000000..c30929ace917e --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/flask.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M437.2 403.5L320 215V64h8c13.3 0 24-10.7 24-24V24c0-13.3-10.7-24-24-24H120c-13.3 0-24 10.7-24 24v16c0 13.3 10.7 24 24 24h8v151L10.8 403.5C-18.5 450.6 15.3 512 70.9 512h306.2c55.7 0 89.4-61.5 60.1-108.5zM137.9 320l48.2-77.6c3.7-5.2 5.8-11.6 5.8-18.4V64h64v160c0 6.9 2.2 13.2 5.8 18.4l48.2 77.6h-172z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/info-circle.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/info-circle.svg new file mode 100644 index 0000000000000..a25c1632d11a2 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/info-circle.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/paint-brush.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/paint-brush.svg new file mode 100644 index 0000000000000..01d1c927330ae --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/paint-brush.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M167.02 309.34c-40.12 2.58-76.53 17.86-97.19 72.3-2.35 6.21-8 9.98-14.59 9.98-11.11 0-45.46-27.67-55.25-34.35C0 439.62 37.93 512 128 512c75.86 0 128-43.77 128-120.19 0-3.11-.65-6.08-.97-9.13l-88.01-73.34zM457.89 0c-15.16 0-29.37 6.71-40.21 16.45C213.27 199.05 192 203.34 192 257.09c0 13.7 3.25 26.76 8.73 38.7l63.82 53.18c7.21 1.8 14.64 3.03 22.39 3.03 62.11 0 98.11-45.47 211.16-256.46 7.38-14.35 13.9-29.85 13.9-45.99C512 20.64 486 0 457.89 0z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/thumbs-down.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/thumbs-down.svg new file mode 100644 index 0000000000000..1cb6e676f2e50 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/thumbs-down.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M0 56v240c0 13.255 10.745 24 24 24h80c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H24C10.745 32 0 42.745 0 56zm40 200c0-13.255 10.745-24 24-24s24 10.745 24 24-10.745 24-24 24-24-10.745-24-24zm272 256c-20.183 0-29.485-39.293-33.931-57.795-5.206-21.666-10.589-44.07-25.393-58.902-32.469-32.524-49.503-73.967-89.117-113.111a11.98 11.98 0 0 1-3.558-8.521V59.901c0-6.541 5.243-11.878 11.783-11.998 15.831-.29 36.694-9.079 52.651-16.178C256.189 17.598 295.709.017 343.995 0h2.844c42.777 0 93.363.413 113.774 29.737 8.392 12.057 10.446 27.034 6.148 44.632 16.312 17.053 25.063 48.863 16.382 74.757 17.544 23.432 19.143 56.132 9.308 79.469l.11.11c11.893 11.949 19.523 31.259 19.439 49.197-.156 30.352-26.157 58.098-59.553 58.098H350.723C358.03 364.34 384 388.132 384 430.548 384 504 336 512 312 512z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-minus.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-minus.svg new file mode 100644 index 0000000000000..41fa7fbb98a48 --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-minus.svg @@ -0,0 +1 @@ +<svg width="13" height="13" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 0v13h3v-1H1V1h2V0zm10 0v1h2v11h-2v1h3V0ZM3 6v1h7V6z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-plus.svg b/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-plus.svg new file mode 100644 index 0000000000000..f1e4477efa09c --- /dev/null +++ b/src/librustdoc/html/static/images/bundled_into_icon_font/toggle-plus.svg @@ -0,0 +1 @@ +<svg width="13" height="13" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 0v13h3v-1H1V1h2V0Zm10 0v1h2v11h-2v1h3V0ZM6 3v3H3v1h3v3h1V7h3V6H7V3Z"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/down-arrow.svg b/src/librustdoc/html/static/images/down-arrow.svg deleted file mode 100644 index 35437e77a710c..0000000000000 --- a/src/librustdoc/html/static/images/down-arrow.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Layer_1" width="128" height="128" enable-background="new 0 0 128 128" version="1.1" viewBox="-30 -20 176 176" xml:space="preserve"><g><line x1="111" x2="64" y1="40.5" y2="87.499" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/><line x1="64" x2="17" y1="87.499" y2="40.5" fill="none" stroke="#2F3435" stroke-linecap="square" stroke-miterlimit="10" stroke-width="12"/></g></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/toggle-minus.svg b/src/librustdoc/html/static/images/toggle-minus.svg deleted file mode 100644 index 73154788a0e8e..0000000000000 --- a/src/librustdoc/html/static/images/toggle-minus.svg +++ /dev/null @@ -1 +0,0 @@ -<svg width="17" height="17" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/toggle-plus.svg b/src/librustdoc/html/static/images/toggle-plus.svg deleted file mode 100644 index 08b17033e164b..0000000000000 --- a/src/librustdoc/html/static/images/toggle-plus.svg +++ /dev/null @@ -1 +0,0 @@ -<svg width="17" height="17" shape-rendering="crispEdges" stroke="#000" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5 2.5H2.5v12H5m7-12h2.5v12H12M5 8.5h7M8.5 12V8.625v0V5"/></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/images/wheel.svg b/src/librustdoc/html/static/images/wheel.svg deleted file mode 100644 index 01da3b24c7c4f..0000000000000 --- a/src/librustdoc/html/static/images/wheel.svg +++ /dev/null @@ -1 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="Capa_1" width="27.434" height="29.5" enable-background="new 0 0 27.434 29.5" version="1.1" viewBox="0 0 27.434 29.5" xml:space="preserve"><g><path d="M27.315,18.389c-0.165-0.604-0.509-1.113-0.981-1.459c-0.042-0.144-0.083-0.429-0.015-0.761l0.037-0.177v-0.182V14.8 c0-1.247-0.006-1.277-0.048-1.472c-0.076-0.354-0.035-0.653,0.007-0.803c0.477-0.346,0.828-0.861,0.996-1.476 c0.261-0.956,0.076-2.091-0.508-3.114l-0.591-1.032c-0.746-1.307-1.965-2.119-3.182-2.119c-0.378,0-0.75,0.081-1.085,0.235 c-0.198-0.025-0.554-0.15-0.855-0.389l-0.103-0.082l-0.114-0.065l-1.857-1.067L18.92,3.36l-0.105-0.044 c-0.376-0.154-0.658-0.41-0.768-0.556C17.918,1.172,16.349,0,14.296,0H13.14c-2.043,0-3.608,1.154-3.749,2.721 C9.277,2.862,8.999,3.104,8.633,3.25l-0.1,0.039L8.439,3.341L6.495,4.406L6.363,4.479L6.245,4.573 C5.936,4.82,5.596,4.944,5.416,4.977c-0.314-0.139-0.66-0.21-1.011-0.21c-1.198,0-2.411,0.819-3.165,2.139L0.65,7.938 c-0.412,0.72-0.642,1.521-0.644,2.258c-0.003,0.952,0.362,1.756,1.013,2.256c0.034,0.155,0.061,0.448-0.016,0.786 c-0.038,0.168-0.062,0.28-0.062,1.563c0,1.148,0,1.148,0.015,1.262l0.009,0.073l0.017,0.073c0.073,0.346,0.045,0.643,0.011,0.802 C0.348,17.512-0.01,18.314,0,19.268c0.008,0.729,0.238,1.523,0.648,2.242l0.589,1.031c0.761,1.331,1.967,2.159,3.15,2.159 c0.324,0,0.645-0.064,0.938-0.187c0.167,0.038,0.492,0.156,0.813,0.416l0.11,0.088l0.124,0.07l2.045,1.156l0.102,0.057l0.107,0.043 c0.364,0.147,0.646,0.381,0.766,0.521c0.164,1.52,1.719,2.634,3.745,2.634h1.155c2.037,0,3.598-1.134,3.747-2.675 c0.117-0.145,0.401-0.393,0.774-0.549l0.111-0.047l0.105-0.062l1.96-1.159l0.105-0.062l0.097-0.075 c0.309-0.246,0.651-0.371,0.832-0.402c0.313,0.138,0.662,0.212,1.016,0.212c1.199,0,2.412-0.82,3.166-2.139l0.59-1.032 C27.387,20.48,27.575,19.342,27.315,18.389z M25.274,20.635l-0.59,1.032c-0.438,0.765-1.104,1.251-1.639,1.251 c-0.133,0-0.258-0.029-0.369-0.094c-0.15-0.086-0.346-0.127-0.566-0.127c-0.596,0-1.383,0.295-2.01,0.796l-1.96,1.157 c-1.016,0.425-1.846,1.291-1.846,1.929s-0.898,1.159-1.998,1.159H13.14c-1.1,0-1.998-0.514-1.998-1.141s-0.834-1.477-1.854-1.888 l-2.046-1.157c-0.636-0.511-1.425-0.814-2.006-0.814c-0.202,0-0.379,0.037-0.516,0.115c-0.101,0.057-0.214,0.084-0.333,0.084 c-0.518,0-1.179-0.498-1.62-1.271l-0.591-1.032c-0.545-0.954-0.556-1.983-0.024-2.286c0.532-0.305,0.78-1.432,0.551-2.506 c0,0,0-0.003,0-1.042c0-1.088,0.021-1.18,0.021-1.18c0.238-1.072-0.01-2.203-0.552-2.513C1.631,10.8,1.634,9.765,2.18,8.812 L2.769,7.78c0.438-0.766,1.103-1.251,1.636-1.251c0.131,0,0.255,0.029,0.365,0.092C4.92,6.707,5.114,6.747,5.334,6.747 c0.596,0,1.38-0.296,2.007-0.795l1.944-1.065c1.021-0.407,1.856-1.277,1.856-1.933c0-0.656,0.898-1.192,1.998-1.192h1.156V1.761 c1.1,0,1.998,0.545,1.998,1.211c0,0.667,0.832,1.554,1.849,1.973L20,6.013c0.618,0.489,1.401,0.775,2.012,0.775 c0.24,0,0.454-0.045,0.62-0.139c0.122-0.069,0.259-0.102,0.403-0.102c0.551,0,1.221,0.476,1.653,1.231l0.59,1.032 c0.544,0.953,0.518,2.004-0.062,2.334c-0.577,0.331-0.859,1.48-0.627,2.554c0,0,0.01,0.042,0.01,1.103c0,1.012,0,1.012,0,1.012 c-0.218,1.049,0.068,2.174,0.636,2.498C25.802,18.635,25.819,19.68,25.274,20.635z"/><path d="M13.61,7.611c-3.913,0-7.084,3.173-7.084,7.085c0,3.914,3.171,7.085,7.084,7.085s7.085-3.172,7.085-7.085 C20.695,10.784,17.523,7.611,13.61,7.611z M13.61,20.02c-2.936,0-5.323-2.388-5.323-5.323c0-2.935,2.388-5.323,5.323-5.323 s5.324,2.388,5.324,5.323C18.934,17.632,16.546,20.02,13.61,20.02z"/><path d="M13.682,9.908c-2.602,0-4.718,2.116-4.718,4.718c0,2.601,2.116,4.716,4.718,4.716c2.601,0,4.717-2.115,4.717-4.716 C18.399,12.024,16.283,9.908,13.682,9.908z M13.682,17.581c-1.633,0-2.956-1.323-2.956-2.955s1.323-2.956,2.956-2.956 c1.632,0,2.956,1.324,2.956,2.956S15.314,17.581,13.682,17.581z"/></g></svg> \ No newline at end of file diff --git a/src/librustdoc/html/static/js/main.js b/src/librustdoc/html/static/js/main.js index 411a94ef2d1c1..ab39609769ab2 100644 --- a/src/librustdoc/html/static/js/main.js +++ b/src/librustdoc/html/static/js/main.js @@ -296,7 +296,7 @@ function hideThemeButtonState() { } }, addCrateDropdown: function(crates) { - var elem = document.getElementById("crate-search"); + var elem = document.getElementById("crate-search").children[0]; if (!elem) { return; @@ -847,9 +847,8 @@ function hideThemeButtonState() { (function() { // To avoid checking on "rustdoc-line-numbers" value on every loop... - var lineNumbersFunc = function() {}; if (getSettingValue("line-numbers") === "true") { - lineNumbersFunc = function(x) { + onEachLazy(document.getElementsByClassName("rust-example-rendered"), function(x) { var count = x.textContent.split("\n").length; var elems = []; for (var i = 0; i < count; ++i) { @@ -859,26 +858,8 @@ function hideThemeButtonState() { addClass(node, "line-number"); node.innerHTML = elems.join("\n"); x.parentNode.insertBefore(node, x); - }; + }); } - onEachLazy(document.getElementsByClassName("rust-example-rendered"), function(e) { - if (hasClass(e, "compile_fail")) { - e.addEventListener("mouseover", function() { - this.parentElement.previousElementSibling.childNodes[0].style.color = "#f00"; - }); - e.addEventListener("mouseout", function() { - this.parentElement.previousElementSibling.childNodes[0].style.color = ""; - }); - } else if (hasClass(e, "ignore")) { - e.addEventListener("mouseover", function() { - this.parentElement.previousElementSibling.childNodes[0].style.color = "#ff9200"; - }); - e.addEventListener("mouseout", function() { - this.parentElement.previousElementSibling.childNodes[0].style.color = ""; - }); - } - lineNumbersFunc(e); - }); }()); function handleClick(id, f) { diff --git a/src/librustdoc/html/static/js/search.js b/src/librustdoc/html/static/js/search.js index 7c55d10836c45..c6ddb06fb0ca6 100644 --- a/src/librustdoc/html/static/js/search.js +++ b/src/librustdoc/html/static/js/search.js @@ -1249,7 +1249,7 @@ window.initSearch = function(rawSearchIndex) { } function getFilterCrates() { - var elem = document.getElementById("crate-search"); + var elem = document.getElementById("crate-search").children[0]; if (elem && elem.value !== "All crates" && hasOwnPropertyRustdoc(rawSearchIndex, elem.value)) @@ -1489,7 +1489,7 @@ window.initSearch = function(rawSearchIndex) { }); - var selectCrate = document.getElementById("crate-search"); + var selectCrate = document.getElementById("crate-search").children[0]; if (selectCrate) { selectCrate.onchange = function() { updateLocalStorage("rustdoc-saved-filter-crate", selectCrate.value); diff --git a/src/librustdoc/html/static_files.rs b/src/librustdoc/html/static_files.rs index 56c5399d074b6..c5958a677bfa2 100644 --- a/src/librustdoc/html/static_files.rs +++ b/src/librustdoc/html/static_files.rs @@ -39,24 +39,6 @@ crate static STORAGE_JS: &str = include_str!("static/js/storage.js"); /// --scrape-examples flag that inserts automatically-found examples of usages of items. crate static SCRAPE_EXAMPLES_JS: &str = include_str!("static/js/scrape-examples.js"); -/// The file contents of `brush.svg`, the icon used for the theme-switch button. -crate static BRUSH_SVG: &[u8] = include_bytes!("static/images/brush.svg"); - -/// The file contents of `wheel.svg`, the icon used for the settings button. -crate static WHEEL_SVG: &[u8] = include_bytes!("static/images/wheel.svg"); - -/// The file contents of `clipboard.svg`, the icon used for the "copy path" button. -crate static CLIPBOARD_SVG: &[u8] = include_bytes!("static/images/clipboard.svg"); - -/// The file contents of `down-arrow.svg`, the icon used for the crate choice combobox. -crate static DOWN_ARROW_SVG: &[u8] = include_bytes!("static/images/down-arrow.svg"); - -/// The file contents of `toggle-minus.svg`, the icon used for opened toggles. -crate static TOGGLE_MINUS_PNG: &[u8] = include_bytes!("static/images/toggle-minus.svg"); - -/// The file contents of `toggle-plus.svg`, the icon used for closed toggles. -crate static TOGGLE_PLUS_PNG: &[u8] = include_bytes!("static/images/toggle-plus.svg"); - /// The contents of `COPYRIGHT.txt`, the license listing for files distributed with documentation /// output. crate static COPYRIGHT: &[u8] = include_bytes!("static/COPYRIGHT.txt"); @@ -74,6 +56,13 @@ crate static RUST_FAVICON_SVG: &[u8] = include_bytes!("static/images/favicon.svg crate static RUST_FAVICON_PNG_16: &[u8] = include_bytes!("static/images/favicon-16x16.png"); crate static RUST_FAVICON_PNG_32: &[u8] = include_bytes!("static/images/favicon-32x32.png"); +/// Files related to the icon font. +crate mod icons { + crate static WOFF: &[u8] = include_bytes!("static/fonts/icons.woff"); + crate static WOFF2: &[u8] = include_bytes!("static/fonts/icons.woff2"); + crate static LICENSE: &[u8] = include_bytes!("static/fonts/icons-FontAwesome-LICENSE.txt"); +} + /// The built-in themes given to every documentation site. crate mod themes { /// The "light" theme, selected by default when no setting is available. Used as the basis for diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html index 5c957e4a379a4..ada70cb3dd69f 100644 --- a/src/librustdoc/html/templates/page.html +++ b/src/librustdoc/html/templates/page.html @@ -102,17 +102,19 @@ <nav class="sub"> {#- -#} <div class="theme-picker"> {#- -#} <button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"> {#- -#} - <img width="18" height="18" alt="Pick another theme!" {# -#} - src="{{static_root_path | safe}}brush{{page.resource_suffix}}.svg"> {#- -#} + <span class="icon">π</span> {#- -#} </button> {#- -#} <div id="theme-choices" role="menu"></div> {#- -#} </div> {#- -#} <form class="search-form"> {#- -#} <div class="search-container"> {#- -#} <div>{%- if layout.generate_search_filter -%} - <select id="crate-search"> {#- -#} - <option value="All crates">All crates</option> {#- -#} - </select> {#- -#} + <div id="crate-search"> {#- -#} + <select> {#- -#} + <option value="All crates">All crates</option> {#- -#} + </select> {#- -#} + <span class="icon">β·</span> {#- -#} + </div> {#- -#} {%- endif -%} <input {# -#} class="search-input" {# -#} @@ -124,8 +126,7 @@ </div> {#- -#} <button type="button" id="help-button" title="help">?</button> {#- -#} <a id="settings-menu" href="{{page.root_path | safe}}settings.html" title="settings"> {#- -#} - <img width="18" height="18" alt="Change settings" {# -#} - src="{{static_root_path | safe}}wheel{{page.resource_suffix}}.svg"> {#- -#} + <span class="icon">β</span> {#- -#} </a> {#- -#} </div> {#- -#} </form> {#- -#} diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index 5a468f3cc1ea0..79ad27f3eb084 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -7,9 +7,7 @@ <h1 class="fqn"> {#- -#} {%- endfor -%} <a class="{{item_type}}" href="#">{{name}}</a> {#- -#} <button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"> {#- -#} - <img src="{{static_root_path | safe}}clipboard{{page.resource_suffix}}.svg" {# -#} - width="19" height="18" {# -#} - alt="Copy item path"> {#- -#} + <span class="icon">π</span> {#- -#} </button> {#- -#} </span> {#- -#} <span class="out-of-band"> {#- -#} diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml index 94e3fe79c9451..81c0708916ae8 100644 --- a/src/test/rustdoc-gui/check_info_sign_position.goml +++ b/src/test/rustdoc-gui/check_info_sign_position.goml @@ -2,8 +2,8 @@ goto: file://|DOC_PATH|/test_docs/index.html goto: ./fn.check_list_code_block.html // If the codeblock is the first element of the docblock, the information tooltip must have // have some top margin to avoid going over the toggle (the "[+]"). -assert-css: (".docblock > .information > .compile_fail", { "margin-top": "16px" }) +assert-css: (".docblock > .example-wrap > .compile_fail + .information", { "margin-top": "16px" }) // Checks that the other codeblocks don't have this top margin. -assert-css: ("ol > li > .information > .compile_fail", { "margin-top": "0px" }) -assert-css: ("ol > li > .information > .ignore", { "margin-top": "0px" }) -assert-css: (".docblock > .information > .ignore", { "margin-top": "0px" }) +assert-css: ("ol > li > .example-wrap > .compile_fail + .information", { "margin-top": "0px" }) +assert-css: ("ol > li > .example-wrap > .ignore + .information", { "margin-top": "0px" }) +assert-css: (".docblock > .example-wrap > .ignore + .information", { "margin-top": "0px" }) diff --git a/src/test/rustdoc-gui/overflow-tooltip-information.goml b/src/test/rustdoc-gui/overflow-tooltip-information.goml index 7ef85a4c44565..5be1aff8d3bce 100644 --- a/src/test/rustdoc-gui/overflow-tooltip-information.goml +++ b/src/test/rustdoc-gui/overflow-tooltip-information.goml @@ -2,7 +2,7 @@ // have overflow and max-width CSS rules set because they create a bug in firefox on // mac. For more information: https://github.com/rust-lang/rust/issues/89185 goto: file://|DOC_PATH|/test_docs/fn.foo.html -assert-css: (".docblock > .information", { +assert-css: (".docblock > .example-wrap > .information", { "overflow-x": "visible", "max-width": "none" }, ALL) diff --git a/src/test/rustdoc-gui/search-result-go-to-first.goml b/src/test/rustdoc-gui/search-result-go-to-first.goml index cadd7f6a3f3b5..3c95512159fc9 100644 --- a/src/test/rustdoc-gui/search-result-go-to-first.goml +++ b/src/test/rustdoc-gui/search-result-go-to-first.goml @@ -3,13 +3,13 @@ // First, we check that the first page doesn't have the string we're looking for to ensure // that the feature is changing page as expected. goto: file://|DOC_PATH|/test_docs/index.html -assert-text-false: (".fqn .in-band", "Struct test_docs::Foo") +assert-text-false: (".fqn .in-band", "Struct test_docs::Fooπ") // We now check that we land on the search result page if "go_to_first" isn't set. goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo // Waiting for the search results to appear... wait-for: "#titles" -assert-text-false: (".fqn .in-band", "Struct test_docs::Foo") +assert-text-false: (".fqn .in-band", "Struct test_docs::Fooπ") // Ensure that the search results are displayed, not the "normal" content. assert-css: ("#main-content", {"display": "none"}) @@ -17,4 +17,4 @@ assert-css: ("#main-content", {"display": "none"}) goto: file://|DOC_PATH|/test_docs/index.html?search=struct%3AFoo&go_to_first=true // Waiting for the page to load... wait-for: 500 -assert-text: (".fqn .in-band", "Struct test_docs::Foo") +assert-text: (".fqn .in-band", "Struct test_docs::Fooπ") diff --git a/src/test/rustdoc-gui/toggle-click-deadspace.goml b/src/test/rustdoc-gui/toggle-click-deadspace.goml index 7bc3c56315784..5bb38eecf89a8 100644 --- a/src/test/rustdoc-gui/toggle-click-deadspace.goml +++ b/src/test/rustdoc-gui/toggle-click-deadspace.goml @@ -9,4 +9,4 @@ assert-attribute-false: (".impl-items .rustdoc-toggle", {"open": ""}) // Click the "Trait" part of "impl Trait" and verify it navigates. click: "#impl-Trait h3 a:first-of-type" -assert-text: (".fqn .in-band", "Trait lib2::Trait") +assert-text: (".fqn .in-band", "Trait lib2::Traitπ") diff --git a/src/test/rustdoc-gui/toggle-docs-mobile.goml b/src/test/rustdoc-gui/toggle-docs-mobile.goml index 471d88701d4f5..0561137e1b647 100644 --- a/src/test/rustdoc-gui/toggle-docs-mobile.goml +++ b/src/test/rustdoc-gui/toggle-docs-mobile.goml @@ -1,21 +1,21 @@ goto: file://|DOC_PATH|/test_docs/struct.Foo.html size: (433, 600) assert-attribute: (".top-doc", {"open": ""}) -click: (4, 280) // This is the position of the top doc comment toggle +click: (4, 290) // This is the position of the top doc comment toggle assert-attribute-false: (".top-doc", {"open": ""}) -click: (4, 280) +click: (4, 290) assert-attribute: (".top-doc", {"open": ""}) -// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. -click: (3, 280) +// To ensure that the toggle isn't off-screen, we check that the toggle isn't clicked. +click: (2, 290) assert-attribute: (".top-doc", {"open": ""}) // Now we do the same but with a little bigger width size: (600, 600) assert-attribute: (".top-doc", {"open": ""}) -click: (4, 240) // New Y position since all search elements are back on one line. +click: (4, 250) // New Y position since all search elements are back on one line. assert-attribute-false: (".top-doc", {"open": ""}) -click: (4, 240) +click: (4, 250) assert-attribute: (".top-doc", {"open": ""}) -// To ensure that the toggle isn't over the text, we check that the toggle isn't clicked. -click: (3, 240) +// To ensure that the toggle isn't off-screen, we check that the toggle isn't clicked. +click: (2, 250) assert-attribute: (".top-doc", {"open": ""})