about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2018-08-23Check null-able variables before using themKazuyoshi Kato-3/+2
2018-08-23use String::new() instead of String::from(""), "".to_string(), "".to_owned() ↵Matthias Krüger-8/+8
or "".into()
2018-08-23Automatically expand a section even after page loadKazuyoshi Kato-16/+32
Fixes #52774
2018-08-22Search a substring instead of start of string in rustdoc searchGuillaume Gomez-10/+10
2018-08-21Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkorkennytm-1/+1
Fix typos found by codespell.
2018-08-21Rollup merge of #53405 - oconnor663:search_esc, r=GuillaumeGomezkennytm-0/+3
restore the page title after escaping out of a search Currently if I start a search in the docs, but then hit ESC, the "Results for..." title is still there in my browser tab. This is a simple attempt to fix that. I see that there's a separate `var previousTitle = document.title` thing happening in `startSearch()`, but as far as I can tell that's only related to the back stack? I'd also appreciate feedback on the right place to declare the `titleBeforeSearch` variable. Testing-wise, I've confirmed by hand that the tab title restores correctly after building with `./x.py doc --stage 1 src/libstd`, but nothing more involved than that. What else should I test?
2018-08-19fix tidy errorsDonato Sciarra-2/+4
2018-08-19mv codemap source_mapDonato Sciarra-5/+5
2018-08-19mv codemap() source_map()Donato Sciarra-2/+2
2018-08-19mv (mod) codemap source_mapDonato Sciarra-2/+2
2018-08-19mv filemap source_fileDonato Sciarra-1/+1
2018-08-19mv CodeMap SourceMapDonato Sciarra-3/+3
2018-08-19Fix typos found by codespell.Matthias Krüger-1/+1
2018-08-18Use the new Entry::or_default method where possible.Eduard-Mihai Burtescu-4/+4
2018-08-15restore the page title after escaping out of a searchJack O'Connor-0/+3
2018-08-15Fix links' colorGuillaume Gomez-4/+4
2018-08-12Rollup merge of #53267 - GuillaumeGomez:fix-styles, r=QuietMisdreavusGuillaume Gomez-4/+4
Fix styles Fixes #53262. r? @QuietMisdreavus
2018-08-11Fix stylesGuillaume Gomez-4/+4
2018-08-10Remove unwanted console logGuillaume Gomez-1/+0
2018-08-09Rollup merge of #53094 - GuillaumeGomez:automatic-expand, r=nrckennytm-0/+19
Automatically expand section if url id point to one of its component Fixes #52517. r? @nrc
2018-08-09Rollup merge of #52773 - ljedrz:unncecessary_patterns, r=nikomatsakiskennytm-2/+2
Avoid unnecessary pattern matching against Option and Result
2018-08-07Avoid unnecessary pattern matching against Option and Resultljedrz-2/+2
2018-08-05Automatically expand section if url id point to one of its componentGuillaume Gomez-0/+19
2018-08-05Change rustdoc style so fully qualified names do not overlap src linksMike Boutin-35/+32
A type's fully qualified name will now wrap once it gets to the `[-][src]` link aligned against the right edge of the content area. Previously the two would overlap and the name would only wrap when hitting the edge of the content area. The `[-][src]` link will main at the top of the header.
2018-08-04Rollup merge of #53050 - carols10cents:rustdoc-moar-room, r=GuillaumeGomezkennytm-1/+1
Make left column of rustdoc search results narrower To make more room for the description of the item The description often has useful text that helps disambiguate between search results, but very little of it is shown. As a side effect, this breaks the alignment between the search results and the "In Return Types" tab, which tends to line up above the description-- up until I started investigating this, I thought "In Names"/"In Parameters"/"In Return Types" were column headers and I just never saw search results that had info for the "In Parameters" middle column! Now, with the two columns of search results each taking up about a half, they look more like tabs than column headers. Types that are long still wrap and look good-- I made some artificially long types in the following screenshots. Before screenshot: <img width="1258" alt="screen shot 2018-08-03 at 8 32 35 pm" src="https://user-images.githubusercontent.com/193874/43670805-56e3b3b4-975e-11e8-9296-600837d03de2.png"> After screenshot: <img width="1239" alt="screen shot 2018-08-03 at 8 31 17 pm" src="https://user-images.githubusercontent.com/193874/43670810-6591f9ac-975e-11e8-9e12-4ea9ab1e5806.png">
2018-08-04Rollup merge of #53047 - integer32llc:rustdoc-clicky-clicky, r=QuietMisdreavuskennytm-0/+5
Make entire row of doc search results clickable By adding empty `after` content that clears and is `display: block`. Technique found here: https://stackoverflow.com/a/7817313/51683 Now any part of a documentation search result that is highlighted when you hover over it should also be clickable. NOTE: THE BELOW IMAGES ARE GIFS BUT I DIDN'T MAKE THEM LOOP, OPEN IN A NEW TAB TO SEE THEM SORRY SORRY Here's what happens before this change: my mouse cursor is in the middle of the table cell, and the row is highlighted which makes it look like clicking should have an effect, but clicking doesn't do anything: ![rustdoc-clicky-clicky-before](https://user-images.githubusercontent.com/193874/43668604-d1e63392-974b-11e8-99f5-e7e11c9056e8.gif) After this change, clicking in the middle of the cell works! ![rustdoc-clicky-clicky-after](https://user-images.githubusercontent.com/193874/43668616-e522fa08-974b-11e8-8409-3826d586d1f7.gif) It even works nicely when the type is really long and wraps! (I created the type artificially because I couldn't find a long enough one in the wild) ![rustdoc-clicky-clicky-after-long](https://user-images.githubusercontent.com/193874/43668639-f962a75c-974b-11e8-9218-70bf068387a3.gif)
2018-08-04Rollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMisdreavuskennytm-2/+2
Fix invalid code css rule Fixes #53017. r? @QuietMisdreavus
2018-08-03Make left column of rustdoc search results narrowerCarol (Nichols || Goulding)-1/+1
To make more room for the description of the item
2018-08-03Make entire row of doc search results clickableCarol (Nichols || Goulding)-0/+5
By adding empty `after` content that clears and is `display: block`. Technique found here: https://stackoverflow.com/a/7817313/51683 Now any part of a documentation search result that is highlighted when you hover over it should also be clickable.
2018-08-04Improve unstable message displayGuillaume Gomez-0/+13
2018-08-03Fix invalid code css ruleGuillaume Gomez-2/+2
2018-08-02Fix trait item doc setting, add new setting, start hiding elements by ↵Guillaume Gomez-10/+34
default and then showing them up
2018-07-31Add dyn to WriteMark Rousskov-1/+1
2018-07-31Cleanup highlighting codeMark Rousskov-42/+23
Removes some unused code and de-publicizes structs
2018-07-31Remove global derive_id and reset_ids functionsMark Rousskov-137/+164
Previously these functions relied on TLS but we can instead thread the relevant state through explicitly.
2018-07-31Format code for easier editingMark Rousskov-6/+5
2018-07-31Further extract error code switchMark Rousskov-45/+76
Removes dependency on UnstableFeatures from markdown rendering
2018-07-31Remove dependency on error handling from find_testable_codeMark Rousskov-8/+13
2018-07-31Provide test configuration through structMark Rousskov-15/+10
This is far more sound than passing many different arguments of the same type.
2018-07-31Provide warnings for invalid code blocks in markdown filesMark Rousskov-5/+3
Previously we would only warn on Rust code but we can also do so when testing markdown (the diag::Handler is available).
2018-07-31Pull out nightly checking to edgesMark Rousskov-8/+7
Parsing the code block's LangString (```foo) previously checked itself to see if we were on nightly; that isn't the right place to do so. Move that check slightly outwards to better abstract LangString. (This is also an optimization as we avoid the costly environment variable load of RUSTC_BOOTSTRAP).
2018-07-30Delete unused code in rustdocMark Rousskov-14/+0
2018-07-30Auto merge of #52805 - ljedrz:format_str_literal, r=petrochenkovbors-1/+1
Don't format!() string literals Prefer `to_string()` to `format!()` take 2, this time targetting string literals. In some cases (`&format!("...")` -> `"..."`) also removes allocations. Occurences of `format!("")` are changed to `String::new()`.
2018-07-29Auto merge of #52767 - ljedrz:avoid_format, r=petrochenkovbors-16/+16
Prefer to_string() to format!() Simple benchmarks suggest in some cases it can be faster by even 37%: ``` test converting_f64_long ... bench: 339 ns/iter (+/- 199) test converting_f64_short ... bench: 136 ns/iter (+/- 34) test converting_i32_long ... bench: 87 ns/iter (+/- 16) test converting_i32_short ... bench: 87 ns/iter (+/- 49) test converting_str ... bench: 54 ns/iter (+/- 15) test formatting_f64_long ... bench: 349 ns/iter (+/- 176) test formatting_f64_short ... bench: 145 ns/iter (+/- 14) test formatting_i32_long ... bench: 98 ns/iter (+/- 14) test formatting_i32_short ... bench: 93 ns/iter (+/- 15) test formatting_str ... bench: 86 ns/iter (+/- 23) ```
2018-07-29Auto merge of #52764 - sinkuu:cleanup, r=nikomatsakisbors-15/+11
Misc cleanups
2018-07-28Auto merge of #52585 - GuillaumeGomez:generic-impls, r=QuietMisdreavusbors-35/+66
[rustdoc] Generic impls Fixes #33772. r? @QuietMisdreavus
2018-07-28Don't format!() string literalsljedrz-1/+1
2018-07-28Don't display full blanket implementation and put it into its own sectionGuillaume Gomez-18/+47
2018-07-28Rollup merge of #52781 - ljedrz:avoid_vec_arguments, r=nikomatsakiskennytm-3/+3
Use a slice where a vector is not necessary
2018-07-27Use slices where a vector is not necessaryljedrz-3/+3