about summary refs log tree commit diff
path: root/src/librustdoc/html/templates/page.html
AgeCommit message (Collapse)AuthorLines
2022-10-15rustdoc: make the help button a link to a pageMichael Howell-1/+1
This allows you to open the help section in a new browser tab, which is a pretty reasonable thing to want for a documentation page.
2022-10-08rustdoc: remove mobile topbar from source pages instead of hiding itMichael Howell-0/+2
2022-08-25rustdoc: remove `type="text/css" from stylesheet linksMichael Howell-4/+4
MDN directly recommends this in <https://developer.mozilla.org/en-US/docs/Web/HTML/Element/link>, since "CSS is the only stylesheet language used on the web."
2022-07-29Remove unwanted extra white space characters from HTMLGuillaume Gomez-7/+7
2022-07-14Correctly handle crate level page on docs.rs as wellGuillaume Gomez-1/+1
2022-06-23Move help popup into a pocket menu as wellGuillaume Gomez-1/+3
2022-06-20Improve loading of crates.js and sidebar-items.jsJacob Hoffman-Andrews-7/+8
Now that the "All Crates" dropdown is only rendered on the search results page, there is no need to load crates.js on most pages. Load it only on crate pages. Also, add the `defer` attribute so it does not block page rendering. For sidebar-items.js, move the script tag to `<head>`. Since it already has the defer attribute it won't block loading. The defer attribute does preserve ordering between scripts, so instead of the callback on load, it can set a global variable on load, which is slightly simpler. Also, since it is required to finish rendering the page, beginning its load earlier is better. Remove generation and handling of sidebar-vars. Everything there can be computed with information available in JS via other means. Remove the "other" wrapper in the sidebar. It was unnecessary. Remove excess script fields
2022-05-14Remove theme picker buttonGuillaume Gomez-7/+0
2022-05-14Improve settings menu displayGuillaume Gomez-3/+5
2022-04-30Move settings into full JSGuillaume Gomez-1/+0
2022-01-28rustdoc: no `shortcut` in `rel="icon"`Miguel Ojeda-1/+1
According to https://html.spec.whatwg.org/multipage/links.html#rel-icon: > For historical reasons, the `icon` keyword may be preceded by > the keyword "`shortcut`". And to https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types: > **Warning:** The `shortcut` link type is often seen before `icon`, > but this link type is non-conforming, ignored and **web authors > must not use it anymore.** While it was removed from the Rust logo case a while ago in commit 085679c8414 ("Use theme-adaptive SVG favicon from other Rust sites"), it is still there for the custom logo case. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2022-01-23rustdoc: fix bump down typing search on SafariJacob Hoffman-Andrews-0/+1
2022-01-21Unify search input and buttons sizeGuillaume Gomez-11/+9
2022-01-19Move back templates into html folderGuillaume Gomez-0/+152
2022-01-10Migrate rustdoc from Tera to AskamaDirkjan Ochtman-140/+0
See #84419.
2022-01-05Move crate drop-down to search results pageJacob Hoffman-Andrews-5/+1
This reduces clutter on doc pages.
2021-12-15Apply rust-logo class only on default logoJacob Hoffman-Andrews-18/+14
Also replace ' with " in rustdoc template
2021-12-07Add missing whitespace before disabled HTML attributeGuillaume Gomez-1/+1
2021-12-05Auto merge of #91356 - GuillaumeGomez:improve-rustdoc-layout, r=jshabors-39/+54
Improve rustdoc layout This is an overtake of https://github.com/rust-lang/rust/pull/89385 originally written by `@cynecx.` I kept the original commit and simply added the missing fixes into a new one. You can test it online [here](https://rustdoc.crud.net/imperio/improve-rustdoc-layout/std/index.html). r? `@jsha`
2021-12-03Rollup merge of #91170 - jsha:preload-fonts, r=GuillaumeGomezMatthias Krüger-0/+6
rustdoc: preload fonts Follow-up from #82315. I noticed that font loading was so slow that even when loading from local disk, we get a flash of unstyled text (FOUT) followed by a reflow when the fonts load. With this change, we reliably get the appropriate fonts in the first render pass when loading locally, and we get it some of the time when loading from a website. This only preloads woff2 versions. According to https://caniuse.com/?search=preload and https://caniuse.com/?search=woff2, all browsers that support preload also support woff2, so this is fine; we will never load two copies of a font. Don't preload italic font faces because they aren't used on all pages. Demo: https://rustdoc.crud.net/jsha/preload-fonts/std/string/struct.String.html
2021-12-02Rename CSS class main-inner into width-limiterGuillaume Gomez-1/+1
2021-12-02Rename ID "main" into "main-content"Guillaume Gomez-1/+1
2021-12-02Fix remaining bugsGuillaume Gomez-1/+0
2021-11-29rustdoc: show logo in source sub navcynecx-37/+49
2021-11-29rustdoc: merge source sidebar into main sidebarcynecx-12/+1
2021-11-29rustdoc: fix source viewcynecx-7/+18
2021-11-29rustdoc: use flexbox to layout sidebar and main contentcynecx-32/+36
2021-11-24Consistentize the system for image URLs in CSS.Jacob Hoffman-Andrews-5/+0
2021-11-24Move themes and version into rustdoc-varsJacob Hoffman-Andrews-3/+6
We had been injecting the list of themes and the rustdoc version into main.js by rewriting it at doc generation time. By avoiding this rewrite, we can make it easier to edit main.js without regenerating all the docs. Added a more convenient accessor for rustdoc-vars. Changed storage.js to not rely on resourcesSuffix. It could in theory use rustdoc-vars, but because rustdoc-vars is at the end of the HTML, it's not available when storage.js runs (very early in page load).
2021-11-24Simplify rendering of stylesheet links into HTMLJacob Hoffman-Andrews-1/+9
We carry around a list of stylesheets that can carry two different types of thing: 1. Internal stylesheets specific to a page type (only for settings) 2. Themes In this change I move the link generation for settings.css into settings(), so Context.style_files is reserved just for themes. We had two places where we extracted a base theme name from a list of StylePaths. I consolidated that code to be a method on StylePath. I moved generation of link tags for stylesheets into the page.html template. With that change, I made the template responsible for special handling of light.css (making it the default theme) and of the other themes (marking them disabled). That allowed getting rid of the `disabled` field on StylePath.
2021-11-23Preload the most commonly used fonts.Jacob Hoffman-Andrews-0/+6
Don't preload italic font faces because they aren't used on all pages, and when they are used, they are used sparingly so it's okay if they are slower to load.
2021-11-20Move `scripts` on the rustdoc template into `head` and apply the `defer` ↵Ken Matsui-10/+10
attribute
2021-11-02Fix URL for scrape-examples.js in rustdoc page templateWill Crichton-3/+3
2021-10-31Hide search bar in noscript.cssJacob Hoffman-Andrews-1/+0
Also, remove the highlighting of the search bar in disabled state. This reduces flicker when loading a page.
2021-10-06Move JS into a standalone fileWill Crichton-0/+3
2021-08-12Updates favicon order of precedence as it matters to Chromeskim-2/+2
2021-07-26Add missing whitespace after attribute in HTML templateGuillaume Gomez-1/+1
2021-06-20Use Tera templates for rustdoc.Jacob Hoffman-Andrews-0/+119
Replaces a format!() call in layout::render with a template expansion. Introduces a `templates` field in SharedContext so parts of rustdoc can share pre-rendered templates. This currently builds in a copy of the single template available, like with static files. However, future work can make this live-loadable with a perma-unstable flag, to make rustdoc developers' work easier.