From 6c6adfe12cfabe59807c82d6888de105e4342f67 Mon Sep 17 00:00:00 2001 From: Peter Jaszkowiak Date: Thu, 9 Dec 2021 23:13:42 -0700 Subject: [PATCH] rustdoc: more consistent icons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Change to solid Font Awesome icons to match the style of docs.rs and crates.io + `down-arrow.svg` (`{}\ - \"Select\ + ⏷\ \ ", description, @@ -401,8 +401,6 @@ impl Setting { name = opt, )) .collect::(), - root_path, - suffix, ), } } @@ -462,7 +460,7 @@ fn settings(root_path: &str, suffix: &str, theme_names: Vec) -> Result{}\ \ ", - settings.iter().map(|s| s.display(root_path, suffix)).collect::(), + settings.iter().map(|s| s.display()).collect::(), 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!( - "
πŸ‘Ž {}
", - message, + "
πŸ‘Ž {message}
" )); } @@ -680,9 +677,6 @@ fn short_item_info( .filter(|stab| stab.feature != sym::rustc_private) .map(|stab| (stab.level, stab.feature)) { - let mut message = - "πŸ”¬ This is a nightly-only experimental API.".to_owned(); - let mut feature = format!("{}", 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!("
{}
", message)); + extra_info.push(format!( + "
πŸ”¬ This is a nightly-only experimental API. ({feature})
" + )); } 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, - "β“˜\ + "β“˜\
", ); out.push_str("
"); 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 => { - "⚠" + "⚠" } _ => "", }; 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 0000000000000000000000000000000000000000..9c69dcd854530c563e3f2be4e318edc1b30167d9 GIT binary patch literal 5052 zcmY*dWmHsc*B%%JgkgjMq=tu(Qb3WC5b2bVmXhx7?oJ8mF6r)cKo~%J5Cx<|x*uT3 zd5`b+{`vM=*V_BK*1gX@_c>>+efI64EG-Sf0s%(S1$z9~(^>u>{~P~*lTp(U2Z69Y z0ICoGb-EZPZ)LTYT!8i&;F16gJ$sGWP3(*u0c{rGSs)NL4*7Zyvx&Pa9T2+$8UX+( z0Fb$(g&m*;fOVi5US-_ZL`h(69DJc4mME>&|$6&C;<4|*7gyGQ815z_X zGjjw!HcC&80?ImegUJ)v4tOF#dPWs)C2Ay1Dy0A_vm)&B%sxo$B@7lNlENUOWh157 zO_e{3R}CgxJmy14Z4ctGO7;hoETYv&JdYM!4@scfxpPxA6q7Rfa? z7Fm__PLWP;OzL|XKvstCxeyDcJCK$Bd(O5?FzFf-^1u5N#rgXYU;%NpmW?j;AX)AV zVJsF{e0Hqkkkv#bjb@n932w{=oikH`GnFIS7TxSSW!n^!KPD}0^L8727ID#RQqFO> zvhtc3mB+$eD4kGyyWPcoHlDqgtu1RQx8_fZRCT9~y2^Q>aVQ+Q9scgu+C~9<=~LOH ztVq_A>B42L8~bi024>>2>O@D$1hk?v&+vv(GQQ4?Mz@?42d>P(X67-t0*6cPwyF+} z)-IxWPd_X4nWqvI>?&Hav|9F_b%mmWRTMy-7^8X;pvp^Lo|YQtKz><+>lzA|3h|lT75FcQvQmk z+Se4Mo5ZZ4&_?`7VCc(*-*C)+jm_AW0ZeYT^i+o?CJ6qW-qmbx6NjORgh}}IV%$@* zUnX){mkd?y@U(@`%!*cma22+@2~JT3vWN;-#i}P`9_qfV}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}Szx-aXQaw2;y z92~ZxQ|mVq!u}w&6VFB9+1rgM!useSqDCm4=Hhp?y#?4MJSKrqk)pw0Drx?etzOpe z4Rr1zI1zX(=_?TOwmt|I(UUNa2)ZRWYVUM!s9fuy3~m1NR(8m01nK0oCX@DUOeE)h zF;XByGaYr)*K%pOXOW(BY{Z@7HXpi6^LXt?EJydDd^c#aq>!0BB|a literal 0 HcmV?d00001 diff --git a/src/librustdoc/html/static/fonts/icons.woff2 b/src/librustdoc/html/static/fonts/icons.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..741f5f99bd80f5f1a03e6e27f70fff571159e1fb GIT binary patch literal 4232 zcmV;35O?o)Pew8T0RR9101$`(4*&oF03c`p01z$!0RR9100000000000000000000 z0000SR0d!Gga!x>37iZO2nv%}kuD1u00A}vBm*o2AO(df2Z1aMfgBqk9Bf;r57K@rNi=^G9%wtx`IK5>TQIM`~G-kgL2j}xkAH17b#Cp5m%Pyh}f z?CKv)%Lqwk4a&`C6W}0eJr$>_XGYDbs6xflGk>|&IXC0V*6JQxvAOd-Q((c*WDxiK zEB_*fEFlQ7aM@;dH`yfD|DijK!F5%tdQkA{IZKoD^HqOo7YHL+&OzQV73e8bnUa4! z?d>v_Xn6O51kOpD;>cEo|L}a;QZA~575K^z-)IA5KpiE#c1Q|JzV#Kgi+a22Y0ZOn znY2zSY3r`-#db84HMi!j05%YZqN@69uD9j)Hc9V37Sy+elt4I?>|AbhNwd43U~|R0 zUxLe(Qa}`jSTbD!Kz3>?I~`vkYwIg~jU=V`F}CpN&TVn(kZt`Dc4LkCE>f^+`jMX` z2mlP`jY9a=-A#u@4lC6Gn~n6S4JWYShW3`xeuvag9uN^ARRihMz!?*Ut3i-- zn-c_;Zu^6v)9qdmf^>%oLYVGwn}G=UHOd7BS#buM1;oH_ZZ04JF$*Zm8Eb!Bul^Sh z;4uuN$cHnSx&45+{}pI#GVz+G(w@ISJfG__CcTO78Eb)8fI8?vg~>Y*6w1^=pjNGe zLYhOmbZN%-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.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 @@ - \ 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 | +|--------------- |-------------------|--------------| +| ![](caret-down.svg) | ⏷ | 23F7 | +| ![](clipboard.svg) | πŸ“‹ | 1F4CB | +| ![](cog.svg) | βš™ | 2699 | +| ![](exclamation-triangle.svg) | ⚠ | 26A0 | +| ![](flask.svg) | πŸ”¬ | 1F52C | +| ![](info-circle.svg) | β“˜ | 24D8 | +| ![](paint-brush.svg) | πŸ–Œ | 1F58C | +| ![](thumbs-down.svg) | πŸ‘Ž | 1F44E | +| ![](toggle-minus.svg) | ⊟ | 229F | +| ![](toggle-plus.svg) | ⊞ | 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ + \ 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 @@ - \ 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 @@ - \ 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 @@ - \ 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 @@ - \ 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 @@