| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Simplify foreign type rendering.
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans.
Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too.
Known visual changes (happy to tweak based on feedback):
* The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it.
* There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly.
* "[src]" links are all sized at 17px. A few were 19px in the original.
I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing.
TODO:
- [x] Test on Chrome
- [x] Test on Firefox
- [ ] ~~Test on UC Android~~
- [x] Test on Edge
- [x] Test on iOS safari
- [x] Test on desktop safari
- [x] Update automated tests
- [x] Increase vertical margin
- [x] Fix "Important traits for" hover overlap
- [x] Wait for #55798 to land & merge it
|
|
|
|
Add no-crate filter option on rustdoc
@onur asked me about it so here it is!
r? @QuietMisdreavus
|
|
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans.
Reduces element count on std::iter::Iterator by 30%.
|
|
|
|
address some FIXME whose associated issues were marked as closed
part of #44366
|
|
|
|
rustdoc: add new CLI flag to load static files from a different location
This PR adds a new CLI flag to rustdoc, `--static-root-path`, which controls how rustdoc links pages to the CSS/JS/font static files bundled with the output. By default, these files are linked with a series of `../` which is calculated per-page to link it to the documentation root - i.e. a relative link to the directory given by `-o`. This is causing problems for docs.rs, because even though docs.rs has saved one copy of these files and is dispatching them dynamically, browsers have no way of knowing that these are the same files and can cache them. This can allow it to link these files as, for example, `/rustdoc.css` instead of `../../rustdoc.css`, creating a single location that the files are loaded from.
I made sure to only change links for the *static* files, those that don't change between crates. Files like the search index, aliases, the source files listing, etc, are still linked with relative links.
r? @GuillaumeGomez
cc @onur
|
|
Replace current crate's searchIndex when regenerating
Fixes #56921.
r? @QuietMisdreavus
|
|
rustdoc: display rustc_private APIs as "Internal"
This PR updates the display of `rustc_private` APIs to be "Internal" instead of "Experimental", and changes the colors appropriately. It also updates the copy of the `rustc_private` feature to sound more informative and less like a compiler suggestion.
The PR additionally contains a significant refactor of the `short_stability` function to remove duplication and fix a few rendering bugs due to extra or missing spaces.
Before:

After:

|
|
r=QuietMisdreavus
Add version display for associated consts
Fixes #54030.
<img width="1440" alt="screenshot 2018-11-08 at 23 57 29" src="https://user-images.githubusercontent.com/3050060/48232648-99decf00-e3b2-11e8-9f41-6bd12a161c7d.png">
r? @QuietMisdreavus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Greatly improve rustdoc rendering speed issues
Fixes #55900.
So a few improvements here:
* we're switching to `DOMTokenList` API when available providing a replacement if it isn't (should only happen on safari and IE I think...)
* hide doc sections by default to allow the whole HTML generation to happen in the background to avoid triggering DOM redraw all the times (which killed the performances)
r? @QuietMisdreavus
|
|
|
|
Remove unneeded extra chars to reduce search-index size
Before:
```
2013782 Dec 11 10:16 build/x86_64-unknown-linux-gnu/doc/search-index.js
```
After:
```
1736597 Dec 11 10:50 build/x86_64-unknown-linux-gnu/doc/search-index.js
```
No changes in the output of the search.
r? @QuietMisdreavus
|
|
|
|
Filter out `ProcMacroStub`s to avoid an ICE during cleaning.
Also add proc macros to `cache().paths` so it can generate links.
|
|
Various minor/cosmetic improvements to code
r? @Centril 😄
|
|
|
|
This commit replaces many usages of `File::open` and reading or writing
with `fs::read_to_string`, `fs::read` and `fs::write`. This reduces code
complexity, and will improve performance for most reads, since the
functions allocate the buffer to be the size of the file.
I believe that this commit will not impact behavior in any way, so some
matches will check the error kind in case the file was not valid UTF-8.
Some of these cases may not actually care about the error.
|
|
Replace usages of `..i + 1` ranges with `..=i`.
Before this change we were using old computer code techniques. After this change we use the new and improved computer code techniques.
|
|
|
|
|
|
|
|
[rustdoc] Specific crate search
Reopening of #54706.
Fixes #54616.
<img width="1440" alt="screenshot 2018-11-29 at 01 29 11" src="https://user-images.githubusercontent.com/3050060/49191372-979adf80-f376-11e8-963e-e4feb927c1da.png">
r? @QuietMisdreavus
|
|
Rollup of 15 pull requests
Successful merges:
- #51753 (Document `From` implementations)
- #55563 (Improve no result found sentence in doc search)
- #55987 (Add Weak.ptr_eq)
- #56119 (Utilize `?` instead of `return None`.)
- #56372 (Refer to the second borrow as the "second borrow" in E0501.rs)
- #56388 (More MIR borrow check cleanup)
- #56424 (Mention raw-ident syntax)
- #56452 (Remove redundant clones)
- #56456 (Handle existential types in dead code analysis)
- #56466 (data_structures: remove tuple_slice)
- #56476 (Fix invalid line number match)
- #56497 (cleanup: remove static lifetimes from consts in libstd)
- #56498 (Fix line numbers display)
- #56523 (Added a bare-bones eslint config (removing jslint))
- #56538 (Use inner iterator may_have_side_effect for Cloned)
Failed merges:
r? @ghost
|
|
Utilize `?` instead of `return None`.
None
|
|
emit error when doc generation fails
Fixes #41813.
The diagnostic looks something like this:
```
error: couldn't generate documentation: No space left on device (os error 28)
|
= note: failed to create or modify "/path/to/crate/target/doc/src/lazycell"
```
|
|
Fixes #41813.
|
|
|
|
|
|
Add source file sidebar
This is just a start currently but that gives a good overview of what it'll look like:
<img width="1440" alt="screenshot 2018-11-06 at 01 39 15" src="https://user-images.githubusercontent.com/3050060/48035592-05336180-e165-11e8-82e1-5ead0c345eb9.png">
r? @QuietMisdreavus
|
|
r=QuietMisdreavus
Fixes primitive sidebar link generation
Fixes #50746.
Fixes #55656.
r? @QuietMisdreavus
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Remove short doc where it starts with a codeblock
Fixes #54975.
|