about summary refs log tree commit diff
path: root/src/librustdoc/html/templates
AgeCommit message (Collapse)AuthorLines
2022-01-27rustdoc: remove tooltip from source linkMichael Howell-1/+1
This made more sense back when it was abbreviated, but now it seems redundant.
2022-01-23rustdoc: fix bump down typing search on SafariJacob Hoffman-Andrews-0/+1
2022-01-23Rollup merge of #93113 - GuillaumeGomez:unify-sizes, r=jshaMatthias Krüger-11/+9
Unify search input and buttons size Fixes #93060. Here what it looks like: ![Screenshot from 2022-01-20 21-38-19](https://user-images.githubusercontent.com/3050060/150418571-fefd6538-b3ee-4dd2-b77b-77e96bcfa0ed.png) ![Screenshot from 2022-01-20 21-38-22](https://user-images.githubusercontent.com/3050060/150418570-53ba259b-9bd4-4084-8b43-d74a5752d712.png) You can test it [here](https://rustdoc.crud.net/imperio/unify-sizes/std/index.html). r? ``@jsha``
2022-01-21Fix spacing for `·` between stability and sourceJacob Hoffman-Andrews-1/+1
2022-01-21Unify search input and buttons sizeGuillaume Gomez-11/+9
2022-01-19Move back templates into html folderGuillaume Gomez-0/+219
2022-01-10Migrate rustdoc from Tera to AskamaDirkjan Ochtman-205/+0
See #84419.
2022-01-10Rollup merge of #92602 - jsha:source-link-2, r=GuillaumeGomezMatthias Krüger-24/+26
Make source links look cleaner Change from syntaxy-looking [src] to the plain word "source". Change the syntaxy-looking `[-]` at the top of the page to say "collapse". Reduce opacity of rightside content. Part of #59851 r? `@GuillaumeGomez` Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html [Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
2022-01-08Make source links look cleanerJacob Hoffman-Andrews-24/+26
Change from syntaxy-looking [src] to the plain word "source".
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-23Rollup merge of #85833 - willcrichton:example-analyzer, r=jyn514Matthias Krüger-0/+3
Scrape code examples from examples/ directory for Rustdoc Adds support for the functionality described in https://github.com/rust-lang/rfcs/pull/3123 Matching changes to Cargo are here: https://github.com/rust-lang/cargo/pull/9525 Live demo here: https://willcrichton.net/example-analyzer/warp/trait.Filter.html#method.and
2021-10-09Remove some stray whitespace.Jacob Hoffman-Andrews-3/+3
2021-10-08Add template for print_itemJacob Hoffman-Andrews-0/+26
Add print_item.html and the code in print_item.rs to use it.
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/+156
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.